]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 00:15:07 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 00:15:07 +0000 (17:15 -0700)
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] move include/asm-s390 to arch/s390/include/asm

2035 files changed:
Documentation/ABI/testing/sysfs-class-regulator [new file with mode: 0644]
Documentation/DocBook/kgdb.tmpl
Documentation/filesystems/configfs/configfs.txt
Documentation/filesystems/configfs/configfs_example.c [deleted file]
Documentation/filesystems/configfs/configfs_example_explicit.c [new file with mode: 0644]
Documentation/filesystems/configfs/configfs_example_macros.c [new file with mode: 0644]
Documentation/ftrace.txt
Documentation/hwmon/dme1737
Documentation/hwmon/lm85
Documentation/power/power_supply_class.txt
Documentation/power/regulator/consumer.txt [new file with mode: 0644]
Documentation/power/regulator/machine.txt [new file with mode: 0644]
Documentation/power/regulator/overview.txt [new file with mode: 0644]
Documentation/power/regulator/regulator.txt [new file with mode: 0644]
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/boot/compressed/Makefile
arch/arm/configs/at91cap9adk_defconfig
arch/arm/configs/at91sam9260ek_defconfig
arch/arm/configs/at91sam9261ek_defconfig
arch/arm/configs/at91sam9263ek_defconfig
arch/arm/configs/at91sam9g20ek_defconfig
arch/arm/configs/at91sam9rlek_defconfig
arch/arm/configs/cam60_defconfig
arch/arm/configs/qil-a9260_defconfig
arch/arm/configs/sam9_l9260_defconfig
arch/arm/configs/usb-a9260_defconfig
arch/arm/configs/usb-a9263_defconfig
arch/arm/configs/yl9200_defconfig
arch/arm/include/asm/Kbuild [new file with mode: 0644]
arch/arm/include/asm/a.out-core.h [new file with mode: 0644]
arch/arm/include/asm/a.out.h [new file with mode: 0644]
arch/arm/include/asm/assembler.h [new file with mode: 0644]
arch/arm/include/asm/atomic.h [new file with mode: 0644]
arch/arm/include/asm/auxvec.h [new file with mode: 0644]
arch/arm/include/asm/bitops.h [new file with mode: 0644]
arch/arm/include/asm/bug.h [new file with mode: 0644]
arch/arm/include/asm/bugs.h [new file with mode: 0644]
arch/arm/include/asm/byteorder.h [new file with mode: 0644]
arch/arm/include/asm/cache.h [new file with mode: 0644]
arch/arm/include/asm/cacheflush.h [new file with mode: 0644]
arch/arm/include/asm/checksum.h [new file with mode: 0644]
arch/arm/include/asm/cnt32_to_63.h [new file with mode: 0644]
arch/arm/include/asm/cpu-multi32.h [new file with mode: 0644]
arch/arm/include/asm/cpu-single.h [new file with mode: 0644]
arch/arm/include/asm/cpu.h [new file with mode: 0644]
arch/arm/include/asm/cputime.h [new file with mode: 0644]
arch/arm/include/asm/current.h [new file with mode: 0644]
arch/arm/include/asm/delay.h [new file with mode: 0644]
arch/arm/include/asm/device.h [new file with mode: 0644]
arch/arm/include/asm/div64.h [new file with mode: 0644]
arch/arm/include/asm/dma-mapping.h [new file with mode: 0644]
arch/arm/include/asm/dma.h [new file with mode: 0644]
arch/arm/include/asm/domain.h [new file with mode: 0644]
arch/arm/include/asm/ecard.h [new file with mode: 0644]
arch/arm/include/asm/elf.h [new file with mode: 0644]
arch/arm/include/asm/emergency-restart.h [new file with mode: 0644]
arch/arm/include/asm/errno.h [new file with mode: 0644]
arch/arm/include/asm/fb.h [new file with mode: 0644]
arch/arm/include/asm/fcntl.h [new file with mode: 0644]
arch/arm/include/asm/fiq.h [new file with mode: 0644]
arch/arm/include/asm/flat.h [new file with mode: 0644]
arch/arm/include/asm/floppy.h [new file with mode: 0644]
arch/arm/include/asm/fpstate.h [new file with mode: 0644]
arch/arm/include/asm/ftrace.h [new file with mode: 0644]
arch/arm/include/asm/futex.h [new file with mode: 0644]
arch/arm/include/asm/glue.h [new file with mode: 0644]
arch/arm/include/asm/gpio.h [new file with mode: 0644]
arch/arm/include/asm/hardirq.h [new file with mode: 0644]
arch/arm/include/asm/hardware.h [new file with mode: 0644]
arch/arm/include/asm/hardware/arm_timer.h [new file with mode: 0644]
arch/arm/include/asm/hardware/arm_twd.h [new file with mode: 0644]
arch/arm/include/asm/hardware/cache-l2x0.h [new file with mode: 0644]
arch/arm/include/asm/hardware/clps7111.h [new file with mode: 0644]
arch/arm/include/asm/hardware/cs89712.h [new file with mode: 0644]
arch/arm/include/asm/hardware/debug-8250.S [new file with mode: 0644]
arch/arm/include/asm/hardware/debug-pl01x.S [new file with mode: 0644]
arch/arm/include/asm/hardware/dec21285.h [new file with mode: 0644]
arch/arm/include/asm/hardware/entry-macro-iomd.S [new file with mode: 0644]
arch/arm/include/asm/hardware/ep7211.h [new file with mode: 0644]
arch/arm/include/asm/hardware/ep7212.h [new file with mode: 0644]
arch/arm/include/asm/hardware/gic.h [new file with mode: 0644]
arch/arm/include/asm/hardware/icst307.h [new file with mode: 0644]
arch/arm/include/asm/hardware/icst525.h [new file with mode: 0644]
arch/arm/include/asm/hardware/ioc.h [new file with mode: 0644]
arch/arm/include/asm/hardware/iomd.h [new file with mode: 0644]
arch/arm/include/asm/hardware/iop3xx-adma.h [new file with mode: 0644]
arch/arm/include/asm/hardware/iop3xx-gpio.h [new file with mode: 0644]
arch/arm/include/asm/hardware/iop3xx.h [new file with mode: 0644]
arch/arm/include/asm/hardware/iop_adma.h [new file with mode: 0644]
arch/arm/include/asm/hardware/it8152.h [new file with mode: 0644]
arch/arm/include/asm/hardware/linkup-l1110.h [new file with mode: 0644]
arch/arm/include/asm/hardware/locomo.h [new file with mode: 0644]
arch/arm/include/asm/hardware/memc.h [new file with mode: 0644]
arch/arm/include/asm/hardware/pci_v3.h [new file with mode: 0644]
arch/arm/include/asm/hardware/sa1111.h [new file with mode: 0644]
arch/arm/include/asm/hardware/scoop.h [new file with mode: 0644]
arch/arm/include/asm/hardware/sharpsl_pm.h [new file with mode: 0644]
arch/arm/include/asm/hardware/ssp.h [new file with mode: 0644]
arch/arm/include/asm/hardware/uengine.h [new file with mode: 0644]
arch/arm/include/asm/hardware/vic.h [new file with mode: 0644]
arch/arm/include/asm/hw_irq.h [new file with mode: 0644]
arch/arm/include/asm/hwcap.h [new file with mode: 0644]
arch/arm/include/asm/ide.h [new file with mode: 0644]
arch/arm/include/asm/io.h [new file with mode: 0644]
arch/arm/include/asm/ioctl.h [new file with mode: 0644]
arch/arm/include/asm/ioctls.h [new file with mode: 0644]
arch/arm/include/asm/ipcbuf.h [new file with mode: 0644]
arch/arm/include/asm/irq.h [new file with mode: 0644]
arch/arm/include/asm/irq_regs.h [new file with mode: 0644]
arch/arm/include/asm/irqflags.h [new file with mode: 0644]
arch/arm/include/asm/kdebug.h [new file with mode: 0644]
arch/arm/include/asm/kexec.h [new file with mode: 0644]
arch/arm/include/asm/kgdb.h [new file with mode: 0644]
arch/arm/include/asm/kmap_types.h [new file with mode: 0644]
arch/arm/include/asm/kprobes.h [new file with mode: 0644]
arch/arm/include/asm/leds.h [new file with mode: 0644]
arch/arm/include/asm/limits.h [new file with mode: 0644]
arch/arm/include/asm/linkage.h [new file with mode: 0644]
arch/arm/include/asm/local.h [new file with mode: 0644]
arch/arm/include/asm/locks.h [new file with mode: 0644]
arch/arm/include/asm/mach/arch.h [new file with mode: 0644]
arch/arm/include/asm/mach/dma.h [new file with mode: 0644]
arch/arm/include/asm/mach/flash.h [new file with mode: 0644]
arch/arm/include/asm/mach/irda.h [new file with mode: 0644]
arch/arm/include/asm/mach/irq.h [new file with mode: 0644]
arch/arm/include/asm/mach/map.h [new file with mode: 0644]
arch/arm/include/asm/mach/mmc.h [new file with mode: 0644]
arch/arm/include/asm/mach/pci.h [new file with mode: 0644]
arch/arm/include/asm/mach/serial_at91.h [new file with mode: 0644]
arch/arm/include/asm/mach/serial_sa1100.h [new file with mode: 0644]
arch/arm/include/asm/mach/sharpsl_param.h [new file with mode: 0644]
arch/arm/include/asm/mach/time.h [new file with mode: 0644]
arch/arm/include/asm/mach/udc_pxa2xx.h [new file with mode: 0644]
arch/arm/include/asm/mc146818rtc.h [new file with mode: 0644]
arch/arm/include/asm/memory.h [new file with mode: 0644]
arch/arm/include/asm/mman.h [new file with mode: 0644]
arch/arm/include/asm/mmu.h [new file with mode: 0644]
arch/arm/include/asm/mmu_context.h [new file with mode: 0644]
arch/arm/include/asm/mmzone.h [new file with mode: 0644]
arch/arm/include/asm/module.h [new file with mode: 0644]
arch/arm/include/asm/msgbuf.h [new file with mode: 0644]
arch/arm/include/asm/mtd-xip.h [new file with mode: 0644]
arch/arm/include/asm/mutex.h [new file with mode: 0644]
arch/arm/include/asm/nwflash.h [new file with mode: 0644]
arch/arm/include/asm/page-nommu.h [new file with mode: 0644]
arch/arm/include/asm/page.h [new file with mode: 0644]
arch/arm/include/asm/param.h [new file with mode: 0644]
arch/arm/include/asm/parport.h [new file with mode: 0644]
arch/arm/include/asm/pci.h [new file with mode: 0644]
arch/arm/include/asm/percpu.h [new file with mode: 0644]
arch/arm/include/asm/pgalloc.h [new file with mode: 0644]
arch/arm/include/asm/pgtable-hwdef.h [new file with mode: 0644]
arch/arm/include/asm/pgtable-nommu.h [new file with mode: 0644]
arch/arm/include/asm/pgtable.h [new file with mode: 0644]
arch/arm/include/asm/poll.h [new file with mode: 0644]
arch/arm/include/asm/posix_types.h [new file with mode: 0644]
arch/arm/include/asm/proc-fns.h [new file with mode: 0644]
arch/arm/include/asm/processor.h [new file with mode: 0644]
arch/arm/include/asm/procinfo.h [new file with mode: 0644]
arch/arm/include/asm/ptrace.h [new file with mode: 0644]
arch/arm/include/asm/resource.h [new file with mode: 0644]
arch/arm/include/asm/scatterlist.h [new file with mode: 0644]
arch/arm/include/asm/sections.h [new file with mode: 0644]
arch/arm/include/asm/segment.h [new file with mode: 0644]
arch/arm/include/asm/sembuf.h [new file with mode: 0644]
arch/arm/include/asm/serial.h [new file with mode: 0644]
arch/arm/include/asm/setup.h [new file with mode: 0644]
arch/arm/include/asm/shmbuf.h [new file with mode: 0644]
arch/arm/include/asm/shmparam.h [new file with mode: 0644]
arch/arm/include/asm/sigcontext.h [new file with mode: 0644]
arch/arm/include/asm/siginfo.h [new file with mode: 0644]
arch/arm/include/asm/signal.h [new file with mode: 0644]
arch/arm/include/asm/sizes.h [new file with mode: 0644]
arch/arm/include/asm/smp.h [new file with mode: 0644]
arch/arm/include/asm/socket.h [new file with mode: 0644]
arch/arm/include/asm/sockios.h [new file with mode: 0644]
arch/arm/include/asm/sparsemem.h [new file with mode: 0644]
arch/arm/include/asm/spinlock.h [new file with mode: 0644]
arch/arm/include/asm/spinlock_types.h [new file with mode: 0644]
arch/arm/include/asm/stat.h [new file with mode: 0644]
arch/arm/include/asm/statfs.h [new file with mode: 0644]
arch/arm/include/asm/string.h [new file with mode: 0644]
arch/arm/include/asm/suspend.h [new file with mode: 0644]
arch/arm/include/asm/system.h [new file with mode: 0644]
arch/arm/include/asm/termbits.h [new file with mode: 0644]
arch/arm/include/asm/termios.h [new file with mode: 0644]
arch/arm/include/asm/therm.h [new file with mode: 0644]
arch/arm/include/asm/thread_info.h [new file with mode: 0644]
arch/arm/include/asm/thread_notify.h [new file with mode: 0644]
arch/arm/include/asm/timex.h [new file with mode: 0644]
arch/arm/include/asm/tlb.h [new file with mode: 0644]
arch/arm/include/asm/tlbflush.h [new file with mode: 0644]
arch/arm/include/asm/topology.h [new file with mode: 0644]
arch/arm/include/asm/traps.h [new file with mode: 0644]
arch/arm/include/asm/types.h [new file with mode: 0644]
arch/arm/include/asm/uaccess.h [new file with mode: 0644]
arch/arm/include/asm/ucontext.h [new file with mode: 0644]
arch/arm/include/asm/unaligned.h [new file with mode: 0644]
arch/arm/include/asm/unistd.h [new file with mode: 0644]
arch/arm/include/asm/user.h [new file with mode: 0644]
arch/arm/include/asm/vfp.h [new file with mode: 0644]
arch/arm/include/asm/vfpmacros.h [new file with mode: 0644]
arch/arm/include/asm/vga.h [new file with mode: 0644]
arch/arm/include/asm/xor.h [new file with mode: 0644]
arch/arm/kernel/head-common.S
arch/arm/lib/getuser.S
arch/arm/lib/putuser.S
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/at91cap9_devices.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-cap9adk.c
arch/arm/mach-at91/board-qil-a9260.c
arch/arm/mach-at91/board-sam9-l9260.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-usb-a9260.c
arch/arm/mach-at91/board-usb-a9263.c
arch/arm/mach-imx/clock.c
arch/arm/mach-imx/generic.c
arch/arm/mach-imx/mx1ads.c
arch/arm/mach-kirkwood/rd88f6281-setup.c
arch/arm/mach-ns9xxx/board-a9m9750dev.c
arch/arm/mach-ns9xxx/gpio-ns9360.c
arch/arm/mach-ns9xxx/gpio.c
arch/arm/mach-ns9xxx/irq.c
arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
arch/arm/mach-ns9xxx/mach-cc9p9360js.c
arch/arm/mach-ns9xxx/plat-serial8250.c
arch/arm/mach-ns9xxx/processor-ns9360.c
arch/arm/mach-ns9xxx/time-ns9360.c
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
arch/arm/mach-orion5x/wnr854t-setup.c
arch/arm/mach-orion5x/wrt350n-v2-setup.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mm/Kconfig
arch/arm/mm/cache-xsc3l2.c [new file with mode: 0644]
arch/arm/mm/init.c
arch/arm/mm/ioremap.c
arch/arm/mm/proc-arm720.S
arch/arm/mm/proc-xsc3.S
arch/arm/nwfpe/fpa11.h
arch/frv/kernel/entry.S
arch/ia64/include/asm/Kbuild [new file with mode: 0644]
arch/ia64/include/asm/a.out.h [new file with mode: 0644]
arch/ia64/include/asm/acpi-ext.h [new file with mode: 0644]
arch/ia64/include/asm/acpi.h [new file with mode: 0644]
arch/ia64/include/asm/agp.h [new file with mode: 0644]
arch/ia64/include/asm/asmmacro.h [new file with mode: 0644]
arch/ia64/include/asm/atomic.h [new file with mode: 0644]
arch/ia64/include/asm/auxvec.h [new file with mode: 0644]
arch/ia64/include/asm/bitops.h [new file with mode: 0644]
arch/ia64/include/asm/break.h [new file with mode: 0644]
arch/ia64/include/asm/bug.h [new file with mode: 0644]
arch/ia64/include/asm/bugs.h [new file with mode: 0644]
arch/ia64/include/asm/byteorder.h [new file with mode: 0644]
arch/ia64/include/asm/cache.h [new file with mode: 0644]
arch/ia64/include/asm/cacheflush.h [new file with mode: 0644]
arch/ia64/include/asm/checksum.h [new file with mode: 0644]
arch/ia64/include/asm/compat.h [new file with mode: 0644]
arch/ia64/include/asm/cpu.h [new file with mode: 0644]
arch/ia64/include/asm/cputime.h [new file with mode: 0644]
arch/ia64/include/asm/current.h [new file with mode: 0644]
arch/ia64/include/asm/cyclone.h [new file with mode: 0644]
arch/ia64/include/asm/delay.h [new file with mode: 0644]
arch/ia64/include/asm/device.h [new file with mode: 0644]
arch/ia64/include/asm/div64.h [new file with mode: 0644]
arch/ia64/include/asm/dma-mapping.h [new file with mode: 0644]
arch/ia64/include/asm/dma.h [new file with mode: 0644]
arch/ia64/include/asm/dmi.h [new file with mode: 0644]
arch/ia64/include/asm/elf.h [new file with mode: 0644]
arch/ia64/include/asm/emergency-restart.h [new file with mode: 0644]
arch/ia64/include/asm/errno.h [new file with mode: 0644]
arch/ia64/include/asm/esi.h [new file with mode: 0644]
arch/ia64/include/asm/fb.h [new file with mode: 0644]
arch/ia64/include/asm/fcntl.h [new file with mode: 0644]
arch/ia64/include/asm/fpswa.h [new file with mode: 0644]
arch/ia64/include/asm/fpu.h [new file with mode: 0644]
arch/ia64/include/asm/futex.h [new file with mode: 0644]
arch/ia64/include/asm/gcc_intrin.h [new file with mode: 0644]
arch/ia64/include/asm/hardirq.h [new file with mode: 0644]
arch/ia64/include/asm/hpsim.h [new file with mode: 0644]
arch/ia64/include/asm/hugetlb.h [new file with mode: 0644]
arch/ia64/include/asm/hw_irq.h [new file with mode: 0644]
arch/ia64/include/asm/ia32.h [new file with mode: 0644]
arch/ia64/include/asm/ia64regs.h [new file with mode: 0644]
arch/ia64/include/asm/intel_intrin.h [new file with mode: 0644]
arch/ia64/include/asm/intrinsics.h [new file with mode: 0644]
arch/ia64/include/asm/io.h [new file with mode: 0644]
arch/ia64/include/asm/ioctl.h [new file with mode: 0644]
arch/ia64/include/asm/ioctls.h [new file with mode: 0644]
arch/ia64/include/asm/iosapic.h [new file with mode: 0644]
arch/ia64/include/asm/ipcbuf.h [new file with mode: 0644]
arch/ia64/include/asm/irq.h [new file with mode: 0644]
arch/ia64/include/asm/irq_regs.h [new file with mode: 0644]
arch/ia64/include/asm/kdebug.h [new file with mode: 0644]
arch/ia64/include/asm/kexec.h [new file with mode: 0644]
arch/ia64/include/asm/kmap_types.h [new file with mode: 0644]
arch/ia64/include/asm/kprobes.h [new file with mode: 0644]
arch/ia64/include/asm/kregs.h [new file with mode: 0644]
arch/ia64/include/asm/kvm.h [new file with mode: 0644]
arch/ia64/include/asm/kvm_host.h [new file with mode: 0644]
arch/ia64/include/asm/kvm_para.h [new file with mode: 0644]
arch/ia64/include/asm/libata-portmap.h [new file with mode: 0644]
arch/ia64/include/asm/linkage.h [new file with mode: 0644]
arch/ia64/include/asm/local.h [new file with mode: 0644]
arch/ia64/include/asm/machvec.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_dig.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_hpsim.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_hpzx1.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_hpzx1_swiotlb.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_init.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_sn2.h [new file with mode: 0644]
arch/ia64/include/asm/machvec_uv.h [new file with mode: 0644]
arch/ia64/include/asm/mc146818rtc.h [new file with mode: 0644]
arch/ia64/include/asm/mca.h [new file with mode: 0644]
arch/ia64/include/asm/mca_asm.h [new file with mode: 0644]
arch/ia64/include/asm/meminit.h [new file with mode: 0644]
arch/ia64/include/asm/mman.h [new file with mode: 0644]
arch/ia64/include/asm/mmu.h [new file with mode: 0644]
arch/ia64/include/asm/mmu_context.h [new file with mode: 0644]
arch/ia64/include/asm/mmzone.h [new file with mode: 0644]
arch/ia64/include/asm/module.h [new file with mode: 0644]
arch/ia64/include/asm/msgbuf.h [new file with mode: 0644]
arch/ia64/include/asm/mutex.h [new file with mode: 0644]
arch/ia64/include/asm/native/inst.h [new file with mode: 0644]
arch/ia64/include/asm/native/irq.h [new file with mode: 0644]
arch/ia64/include/asm/nodedata.h [new file with mode: 0644]
arch/ia64/include/asm/numa.h [new file with mode: 0644]
arch/ia64/include/asm/page.h [new file with mode: 0644]
arch/ia64/include/asm/pal.h [new file with mode: 0644]
arch/ia64/include/asm/param.h [new file with mode: 0644]
arch/ia64/include/asm/paravirt.h [new file with mode: 0644]
arch/ia64/include/asm/paravirt_privop.h [new file with mode: 0644]
arch/ia64/include/asm/parport.h [new file with mode: 0644]
arch/ia64/include/asm/patch.h [new file with mode: 0644]
arch/ia64/include/asm/pci.h [new file with mode: 0644]
arch/ia64/include/asm/percpu.h [new file with mode: 0644]
arch/ia64/include/asm/perfmon.h [new file with mode: 0644]
arch/ia64/include/asm/perfmon_default_smpl.h [new file with mode: 0644]
arch/ia64/include/asm/pgalloc.h [new file with mode: 0644]
arch/ia64/include/asm/pgtable.h [new file with mode: 0644]
arch/ia64/include/asm/poll.h [new file with mode: 0644]
arch/ia64/include/asm/posix_types.h [new file with mode: 0644]
arch/ia64/include/asm/processor.h [new file with mode: 0644]
arch/ia64/include/asm/ptrace.h [new file with mode: 0644]
arch/ia64/include/asm/ptrace_offsets.h [new file with mode: 0644]
arch/ia64/include/asm/resource.h [new file with mode: 0644]
arch/ia64/include/asm/rse.h [new file with mode: 0644]
arch/ia64/include/asm/rwsem.h [new file with mode: 0644]
arch/ia64/include/asm/sal.h [new file with mode: 0644]
arch/ia64/include/asm/scatterlist.h [new file with mode: 0644]
arch/ia64/include/asm/sections.h [new file with mode: 0644]
arch/ia64/include/asm/segment.h [new file with mode: 0644]
arch/ia64/include/asm/sembuf.h [new file with mode: 0644]
arch/ia64/include/asm/serial.h [new file with mode: 0644]
arch/ia64/include/asm/setup.h [new file with mode: 0644]
arch/ia64/include/asm/shmbuf.h [new file with mode: 0644]
arch/ia64/include/asm/shmparam.h [new file with mode: 0644]
arch/ia64/include/asm/sigcontext.h [new file with mode: 0644]
arch/ia64/include/asm/siginfo.h [new file with mode: 0644]
arch/ia64/include/asm/signal.h [new file with mode: 0644]
arch/ia64/include/asm/smp.h [new file with mode: 0644]
arch/ia64/include/asm/sn/acpi.h [new file with mode: 0644]
arch/ia64/include/asm/sn/addrs.h [new file with mode: 0644]
arch/ia64/include/asm/sn/arch.h [new file with mode: 0644]
arch/ia64/include/asm/sn/bte.h [new file with mode: 0644]
arch/ia64/include/asm/sn/clksupport.h [new file with mode: 0644]
arch/ia64/include/asm/sn/geo.h [new file with mode: 0644]
arch/ia64/include/asm/sn/intr.h [new file with mode: 0644]
arch/ia64/include/asm/sn/io.h [new file with mode: 0644]
arch/ia64/include/asm/sn/ioc3.h [new file with mode: 0644]
arch/ia64/include/asm/sn/klconfig.h [new file with mode: 0644]
arch/ia64/include/asm/sn/l1.h [new file with mode: 0644]
arch/ia64/include/asm/sn/leds.h [new file with mode: 0644]
arch/ia64/include/asm/sn/module.h [new file with mode: 0644]
arch/ia64/include/asm/sn/mspec.h [new file with mode: 0644]
arch/ia64/include/asm/sn/nodepda.h [new file with mode: 0644]
arch/ia64/include/asm/sn/pcibr_provider.h [new file with mode: 0644]
arch/ia64/include/asm/sn/pcibus_provider_defs.h [new file with mode: 0644]
arch/ia64/include/asm/sn/pcidev.h [new file with mode: 0644]
arch/ia64/include/asm/sn/pda.h [new file with mode: 0644]
arch/ia64/include/asm/sn/pic.h [new file with mode: 0644]
arch/ia64/include/asm/sn/rw_mmr.h [new file with mode: 0644]
arch/ia64/include/asm/sn/shub_mmr.h [new file with mode: 0644]
arch/ia64/include/asm/sn/shubio.h [new file with mode: 0644]
arch/ia64/include/asm/sn/simulator.h [new file with mode: 0644]
arch/ia64/include/asm/sn/sn2/sn_hwperf.h [new file with mode: 0644]
arch/ia64/include/asm/sn/sn_cpuid.h [new file with mode: 0644]
arch/ia64/include/asm/sn/sn_feature_sets.h [new file with mode: 0644]
arch/ia64/include/asm/sn/sn_sal.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tioca.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tioca_provider.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tioce.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tioce_provider.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tiocp.h [new file with mode: 0644]
arch/ia64/include/asm/sn/tiocx.h [new file with mode: 0644]
arch/ia64/include/asm/sn/types.h [new file with mode: 0644]
arch/ia64/include/asm/socket.h [new file with mode: 0644]
arch/ia64/include/asm/sockios.h [new file with mode: 0644]
arch/ia64/include/asm/sparsemem.h [new file with mode: 0644]
arch/ia64/include/asm/spinlock.h [new file with mode: 0644]
arch/ia64/include/asm/spinlock_types.h [new file with mode: 0644]
arch/ia64/include/asm/stat.h [new file with mode: 0644]
arch/ia64/include/asm/statfs.h [new file with mode: 0644]
arch/ia64/include/asm/string.h [new file with mode: 0644]
arch/ia64/include/asm/suspend.h [new file with mode: 0644]
arch/ia64/include/asm/system.h [new file with mode: 0644]
arch/ia64/include/asm/termbits.h [new file with mode: 0644]
arch/ia64/include/asm/termios.h [new file with mode: 0644]
arch/ia64/include/asm/thread_info.h [new file with mode: 0644]
arch/ia64/include/asm/timex.h [new file with mode: 0644]
arch/ia64/include/asm/tlb.h [new file with mode: 0644]
arch/ia64/include/asm/tlbflush.h [new file with mode: 0644]
arch/ia64/include/asm/topology.h [new file with mode: 0644]
arch/ia64/include/asm/types.h [new file with mode: 0644]
arch/ia64/include/asm/uaccess.h [new file with mode: 0644]
arch/ia64/include/asm/ucontext.h [new file with mode: 0644]
arch/ia64/include/asm/unaligned.h [new file with mode: 0644]
arch/ia64/include/asm/uncached.h [new file with mode: 0644]
arch/ia64/include/asm/unistd.h [new file with mode: 0644]
arch/ia64/include/asm/unwind.h [new file with mode: 0644]
arch/ia64/include/asm/user.h [new file with mode: 0644]
arch/ia64/include/asm/ustack.h [new file with mode: 0644]
arch/ia64/include/asm/uv/uv_hub.h [new file with mode: 0644]
arch/ia64/include/asm/uv/uv_mmrs.h [new file with mode: 0644]
arch/ia64/include/asm/vga.h [new file with mode: 0644]
arch/ia64/include/asm/xor.h [new file with mode: 0644]
arch/ia64/kernel/asm-offsets.c
arch/ia64/kernel/head.S
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/jprobes.S
arch/ia64/kernel/nr-irqs.c
arch/ia64/kernel/setup.c
arch/ia64/sn/kernel/iomv.c
arch/mips/Kconfig
arch/mips/Kconfig.debug
arch/mips/au1000/Kconfig
arch/mips/au1000/common/Makefile
arch/mips/au1000/common/dbg_io.c [deleted file]
arch/mips/au1000/db1x00/init.c
arch/mips/au1000/mtx-1/init.c
arch/mips/au1000/pb1000/init.c
arch/mips/au1000/pb1100/init.c
arch/mips/au1000/pb1200/init.c
arch/mips/au1000/pb1500/init.c
arch/mips/au1000/pb1550/init.c
arch/mips/au1000/xxs1500/init.c
arch/mips/basler/excite/Makefile
arch/mips/basler/excite/excite_dbg_io.c [deleted file]
arch/mips/basler/excite/excite_irq.c
arch/mips/basler/excite/excite_setup.c
arch/mips/configs/cobalt_defconfig
arch/mips/configs/db1000_defconfig
arch/mips/configs/db1100_defconfig
arch/mips/configs/db1200_defconfig
arch/mips/configs/db1500_defconfig
arch/mips/configs/db1550_defconfig
arch/mips/configs/excite_defconfig
arch/mips/configs/ip27_defconfig
arch/mips/configs/msp71xx_defconfig
arch/mips/configs/mtx1_defconfig
arch/mips/configs/pb1100_defconfig
arch/mips/configs/pb1500_defconfig
arch/mips/configs/pb1550_defconfig
arch/mips/configs/pnx8550-jbs_defconfig
arch/mips/configs/pnx8550-stb810_defconfig
arch/mips/configs/rbtx49xx_defconfig
arch/mips/configs/sb1250-swarm_defconfig
arch/mips/configs/yosemite_defconfig
arch/mips/emma2rh/markeins/platform.c
arch/mips/emma2rh/markeins/setup.c
arch/mips/kernel/Makefile
arch/mips/kernel/gdb-low.S [deleted file]
arch/mips/kernel/gdb-stub.c [deleted file]
arch/mips/kernel/irq.c
arch/mips/kernel/kgdb.c [new file with mode: 0644]
arch/mips/kernel/traps.c
arch/mips/mm/tlb-r3k.c
arch/mips/mti-malta/Makefile
arch/mips/mti-malta/malta-init.c
arch/mips/mti-malta/malta-kgdb.c [deleted file]
arch/mips/mti-malta/malta-setup.c
arch/mips/nxp/pnx8550/common/Makefile
arch/mips/nxp/pnx8550/common/gdb_hook.c [deleted file]
arch/mips/nxp/pnx8550/common/int.c
arch/mips/nxp/pnx8550/common/proc.c
arch/mips/nxp/pnx8550/common/setup.c
arch/mips/pci/ops-tx3927.c
arch/mips/pci/ops-tx4927.c
arch/mips/pci/pci-tx4927.c
arch/mips/pci/pci-tx4938.c
arch/mips/pci/pci.c
arch/mips/pmc-sierra/msp71xx/msp_serial.c
arch/mips/pmc-sierra/yosemite/Makefile
arch/mips/pmc-sierra/yosemite/dbg_io.c [deleted file]
arch/mips/pmc-sierra/yosemite/irq.c
arch/mips/rb532/gpio.c
arch/mips/rb532/time.c
arch/mips/sgi-ip22/ip22-setup.c
arch/mips/sgi-ip27/Makefile
arch/mips/sgi-ip27/ip27-dbgio.c [deleted file]
arch/mips/sibyte/bcm1480/irq.c
arch/mips/sibyte/cfe/setup.c
arch/mips/sibyte/sb1250/irq.c
arch/mips/sibyte/swarm/Makefile
arch/mips/sibyte/swarm/dbg_io.c [deleted file]
arch/mips/txx9/Kconfig
arch/mips/txx9/generic/Makefile
arch/mips/txx9/generic/dbgio.c [deleted file]
arch/mips/txx9/generic/irq_tx3927.c [new file with mode: 0644]
arch/mips/txx9/generic/pci.c
arch/mips/txx9/generic/setup.c
arch/mips/txx9/generic/setup_tx3927.c [new file with mode: 0644]
arch/mips/txx9/generic/setup_tx4927.c
arch/mips/txx9/generic/setup_tx4938.c
arch/mips/txx9/generic/smsc_fdc37m81x.c
arch/mips/txx9/jmr3927/Makefile
arch/mips/txx9/jmr3927/irq.c
arch/mips/txx9/jmr3927/kgdb_io.c [deleted file]
arch/mips/txx9/jmr3927/prom.c
arch/mips/txx9/jmr3927/setup.c
arch/mips/txx9/rbtx4927/irq.c
arch/mips/txx9/rbtx4927/prom.c
arch/mips/txx9/rbtx4927/setup.c
arch/mips/txx9/rbtx4938/irq.c
arch/mips/txx9/rbtx4938/prom.c
arch/mips/txx9/rbtx4938/setup.c
arch/mn10300/kernel/entry.S
arch/s390/kvm/priv.c
arch/sh/Kconfig
arch/sh/Makefile
arch/sh/boards/Kconfig [new file with mode: 0644]
arch/sh/boards/Makefile [new file with mode: 0644]
arch/sh/boards/board-ap325rxa.c [new file with mode: 0644]
arch/sh/boards/board-magicpanelr2.c [new file with mode: 0644]
arch/sh/boards/board-rsk7203.c [new file with mode: 0644]
arch/sh/boards/board-sh7785lcr.c [new file with mode: 0644]
arch/sh/boards/board-shmin.c [new file with mode: 0644]
arch/sh/boards/cayman/Makefile [deleted file]
arch/sh/boards/cayman/irq.c [deleted file]
arch/sh/boards/cayman/led.c [deleted file]
arch/sh/boards/cayman/setup.c [deleted file]
arch/sh/boards/dreamcast/Makefile [deleted file]
arch/sh/boards/dreamcast/irq.c [deleted file]
arch/sh/boards/dreamcast/rtc.c [deleted file]
arch/sh/boards/dreamcast/setup.c [deleted file]
arch/sh/boards/hp6xx/Makefile [deleted file]
arch/sh/boards/hp6xx/hp6xx_apm.c [deleted file]
arch/sh/boards/hp6xx/pm.c [deleted file]
arch/sh/boards/hp6xx/pm_wakeup.S [deleted file]
arch/sh/boards/hp6xx/setup.c [deleted file]
arch/sh/boards/landisk/Makefile [deleted file]
arch/sh/boards/landisk/gio.c [deleted file]
arch/sh/boards/landisk/irq.c [deleted file]
arch/sh/boards/landisk/psw.c [deleted file]
arch/sh/boards/landisk/setup.c [deleted file]
arch/sh/boards/lboxre2/Makefile [deleted file]
arch/sh/boards/lboxre2/irq.c [deleted file]
arch/sh/boards/lboxre2/setup.c [deleted file]
arch/sh/boards/mach-cayman/Makefile [new file with mode: 0644]
arch/sh/boards/mach-cayman/irq.c [new file with mode: 0644]
arch/sh/boards/mach-cayman/led.c [new file with mode: 0644]
arch/sh/boards/mach-cayman/setup.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/Makefile [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/irq.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/rtc.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/setup.c [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/Makefile [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/io.c [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/setup.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-highlander/Makefile [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7780mp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7780rp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7785rp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/psw.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/setup.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/Makefile [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/hp6xx_apm.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/pm.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/pm_wakeup.S [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/setup.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/Makefile [new file with mode: 0644]
arch/sh/boards/mach-landisk/gio.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/irq.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/psw.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/setup.c [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/Makefile [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/irq.c [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/setup.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/Makefile [new file with mode: 0644]
arch/sh/boards/mach-microdev/io.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/irq.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/led.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/setup.c [new file with mode: 0644]
arch/sh/boards/mach-migor/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-migor/Makefile [new file with mode: 0644]
arch/sh/boards/mach-migor/lcd_qvga.c [new file with mode: 0644]
arch/sh/boards/mach-migor/setup.c [new file with mode: 0644]
arch/sh/boards/mach-r2d/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-r2d/Makefile [new file with mode: 0644]
arch/sh/boards/mach-r2d/irq.c [new file with mode: 0644]
arch/sh/boards/mach-r2d/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/irq.c [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7206/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7343/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/770x/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7721/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7721/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7721/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7722/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7722/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7722/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7751/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/pci.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7780/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7780/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7780/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/board-se7619.c [new file with mode: 0644]
arch/sh/boards/mach-sh03/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sh03/rtc.c [new file with mode: 0644]
arch/sh/boards/mach-sh03/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/irq.c [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/setup.c [new file with mode: 0644]
arch/sh/boards/mach-snapgear/Makefile [new file with mode: 0644]
arch/sh/boards/mach-snapgear/io.c [new file with mode: 0644]
arch/sh/boards/mach-snapgear/setup.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/Makefile [new file with mode: 0644]
arch/sh/boards/mach-systemh/io.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/irq.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/setup.c [new file with mode: 0644]
arch/sh/boards/mach-titan/Makefile [new file with mode: 0644]
arch/sh/boards/mach-titan/io.c [new file with mode: 0644]
arch/sh/boards/mach-titan/setup.c [new file with mode: 0644]
arch/sh/boards/mach-x3proto/Makefile [new file with mode: 0644]
arch/sh/boards/mach-x3proto/ilsel.c [new file with mode: 0644]
arch/sh/boards/mach-x3proto/setup.c [new file with mode: 0644]
arch/sh/boards/magicpanelr2/Kconfig [deleted file]
arch/sh/boards/magicpanelr2/Makefile [deleted file]
arch/sh/boards/magicpanelr2/setup.c [deleted file]
arch/sh/boards/renesas/ap325rxa/Makefile [deleted file]
arch/sh/boards/renesas/ap325rxa/setup.c [deleted file]
arch/sh/boards/renesas/edosk7705/Makefile [deleted file]
arch/sh/boards/renesas/edosk7705/io.c [deleted file]
arch/sh/boards/renesas/edosk7705/setup.c [deleted file]
arch/sh/boards/renesas/migor/Kconfig [deleted file]
arch/sh/boards/renesas/migor/Makefile [deleted file]
arch/sh/boards/renesas/migor/lcd_qvga.c [deleted file]
arch/sh/boards/renesas/migor/setup.c [deleted file]
arch/sh/boards/renesas/r7780rp/Kconfig [deleted file]
arch/sh/boards/renesas/r7780rp/Makefile [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7780mp.c [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7780rp.c [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7785rp.c [deleted file]
arch/sh/boards/renesas/r7780rp/psw.c [deleted file]
arch/sh/boards/renesas/r7780rp/setup.c [deleted file]
arch/sh/boards/renesas/rsk7203/Makefile [deleted file]
arch/sh/boards/renesas/rsk7203/setup.c [deleted file]
arch/sh/boards/renesas/rts7751r2d/Kconfig [deleted file]
arch/sh/boards/renesas/rts7751r2d/Makefile [deleted file]
arch/sh/boards/renesas/rts7751r2d/irq.c [deleted file]
arch/sh/boards/renesas/rts7751r2d/setup.c [deleted file]
arch/sh/boards/renesas/sdk7780/Kconfig [deleted file]
arch/sh/boards/renesas/sdk7780/Makefile [deleted file]
arch/sh/boards/renesas/sdk7780/irq.c [deleted file]
arch/sh/boards/renesas/sdk7780/setup.c [deleted file]
arch/sh/boards/renesas/sh7763rdp/Makefile [deleted file]
arch/sh/boards/renesas/sh7763rdp/irq.c [deleted file]
arch/sh/boards/renesas/sh7763rdp/setup.c [deleted file]
arch/sh/boards/renesas/sh7785lcr/Makefile [deleted file]
arch/sh/boards/renesas/sh7785lcr/setup.c [deleted file]
arch/sh/boards/renesas/systemh/Makefile [deleted file]
arch/sh/boards/renesas/systemh/io.c [deleted file]
arch/sh/boards/renesas/systemh/irq.c [deleted file]
arch/sh/boards/renesas/systemh/setup.c [deleted file]
arch/sh/boards/renesas/x3proto/Makefile [deleted file]
arch/sh/boards/renesas/x3proto/ilsel.c [deleted file]
arch/sh/boards/renesas/x3proto/setup.c [deleted file]
arch/sh/boards/se/7206/Makefile [deleted file]
arch/sh/boards/se/7206/io.c [deleted file]
arch/sh/boards/se/7206/irq.c [deleted file]
arch/sh/boards/se/7206/setup.c [deleted file]
arch/sh/boards/se/7343/Makefile [deleted file]
arch/sh/boards/se/7343/io.c [deleted file]
arch/sh/boards/se/7343/irq.c [deleted file]
arch/sh/boards/se/7343/setup.c [deleted file]
arch/sh/boards/se/7619/Makefile [deleted file]
arch/sh/boards/se/7619/setup.c [deleted file]
arch/sh/boards/se/770x/Makefile [deleted file]
arch/sh/boards/se/770x/io.c [deleted file]
arch/sh/boards/se/770x/irq.c [deleted file]
arch/sh/boards/se/770x/setup.c [deleted file]
arch/sh/boards/se/7721/Makefile [deleted file]
arch/sh/boards/se/7721/irq.c [deleted file]
arch/sh/boards/se/7721/setup.c [deleted file]
arch/sh/boards/se/7722/Makefile [deleted file]
arch/sh/boards/se/7722/irq.c [deleted file]
arch/sh/boards/se/7722/setup.c [deleted file]
arch/sh/boards/se/7751/Makefile [deleted file]
arch/sh/boards/se/7751/io.c [deleted file]
arch/sh/boards/se/7751/irq.c [deleted file]
arch/sh/boards/se/7751/pci.c [deleted file]
arch/sh/boards/se/7751/setup.c [deleted file]
arch/sh/boards/se/7780/Makefile [deleted file]
arch/sh/boards/se/7780/irq.c [deleted file]
arch/sh/boards/se/7780/setup.c [deleted file]
arch/sh/boards/sh03/Makefile [deleted file]
arch/sh/boards/sh03/rtc.c [deleted file]
arch/sh/boards/sh03/setup.c [deleted file]
arch/sh/boards/shmin/Makefile [deleted file]
arch/sh/boards/shmin/setup.c [deleted file]
arch/sh/boards/snapgear/Makefile [deleted file]
arch/sh/boards/snapgear/io.c [deleted file]
arch/sh/boards/snapgear/setup.c [deleted file]
arch/sh/boards/superh/microdev/Makefile [deleted file]
arch/sh/boards/superh/microdev/io.c [deleted file]
arch/sh/boards/superh/microdev/irq.c [deleted file]
arch/sh/boards/superh/microdev/led.c [deleted file]
arch/sh/boards/superh/microdev/setup.c [deleted file]
arch/sh/boards/titan/Makefile [deleted file]
arch/sh/boards/titan/io.c [deleted file]
arch/sh/boards/titan/setup.c [deleted file]
arch/sh/boot/Makefile
arch/sh/boot/compressed/head_64.S
arch/sh/configs/ap325rxa_defconfig
arch/sh/configs/dreamcast_defconfig
arch/sh/configs/hp6xx_defconfig
arch/sh/configs/landisk_defconfig
arch/sh/configs/lboxre2_defconfig
arch/sh/configs/magicpanelr2_defconfig
arch/sh/configs/microdev_defconfig
arch/sh/configs/migor_defconfig
arch/sh/configs/r7780mp_defconfig
arch/sh/configs/r7785rp_defconfig
arch/sh/configs/rsk7203_defconfig
arch/sh/configs/rts7751r2d1_defconfig
arch/sh/configs/rts7751r2dplus_defconfig
arch/sh/configs/sdk7780_defconfig
arch/sh/configs/se7206_defconfig
arch/sh/configs/se7343_defconfig
arch/sh/configs/se7619_defconfig
arch/sh/drivers/dma/dma-g2.c
arch/sh/drivers/dma/dma-pvr2.c
arch/sh/drivers/dma/dma-sh.c
arch/sh/drivers/dma/dma-sh.h
arch/sh/drivers/pci/fixups-dreamcast.c
arch/sh/drivers/pci/ops-cayman.c
arch/sh/drivers/pci/ops-dreamcast.c
arch/sh/drivers/pci/ops-se7780.c
arch/sh/drivers/pci/pci-sh5.c
arch/sh/include/asm/.gitignore [new file with mode: 0644]
arch/sh/include/asm/Kbuild [new file with mode: 0644]
arch/sh/include/asm/a.out.h [new file with mode: 0644]
arch/sh/include/asm/adc.h [new file with mode: 0644]
arch/sh/include/asm/addrspace.h [new file with mode: 0644]
arch/sh/include/asm/atomic-grb.h [new file with mode: 0644]
arch/sh/include/asm/atomic-irq.h [new file with mode: 0644]
arch/sh/include/asm/atomic-llsc.h [new file with mode: 0644]
arch/sh/include/asm/atomic.h [new file with mode: 0644]
arch/sh/include/asm/auxvec.h [new file with mode: 0644]
arch/sh/include/asm/bitops-grb.h [new file with mode: 0644]
arch/sh/include/asm/bitops-irq.h [new file with mode: 0644]
arch/sh/include/asm/bitops.h [new file with mode: 0644]
arch/sh/include/asm/bug.h [new file with mode: 0644]
arch/sh/include/asm/bugs.h [new file with mode: 0644]
arch/sh/include/asm/byteorder.h [new file with mode: 0644]
arch/sh/include/asm/cache.h [new file with mode: 0644]
arch/sh/include/asm/cacheflush.h [new file with mode: 0644]
arch/sh/include/asm/checksum.h [new file with mode: 0644]
arch/sh/include/asm/checksum_32.h [new file with mode: 0644]
arch/sh/include/asm/checksum_64.h [new file with mode: 0644]
arch/sh/include/asm/clock.h [new file with mode: 0644]
arch/sh/include/asm/cmpxchg-grb.h [new file with mode: 0644]
arch/sh/include/asm/cmpxchg-irq.h [new file with mode: 0644]
arch/sh/include/asm/cpu-features.h [new file with mode: 0644]
arch/sh/include/asm/cputime.h [new file with mode: 0644]
arch/sh/include/asm/current.h [new file with mode: 0644]
arch/sh/include/asm/delay.h [new file with mode: 0644]
arch/sh/include/asm/device.h [new file with mode: 0644]
arch/sh/include/asm/div64.h [new file with mode: 0644]
arch/sh/include/asm/dma-mapping.h [new file with mode: 0644]
arch/sh/include/asm/dma.h [new file with mode: 0644]
arch/sh/include/asm/dmabrg.h [new file with mode: 0644]
arch/sh/include/asm/edosk7705.h [new file with mode: 0644]
arch/sh/include/asm/elf.h [new file with mode: 0644]
arch/sh/include/asm/emergency-restart.h [new file with mode: 0644]
arch/sh/include/asm/entry-macros.S [new file with mode: 0644]
arch/sh/include/asm/errno.h [new file with mode: 0644]
arch/sh/include/asm/fb.h [new file with mode: 0644]
arch/sh/include/asm/fcntl.h [new file with mode: 0644]
arch/sh/include/asm/fixmap.h [new file with mode: 0644]
arch/sh/include/asm/flat.h [new file with mode: 0644]
arch/sh/include/asm/fpu.h [new file with mode: 0644]
arch/sh/include/asm/freq.h [new file with mode: 0644]
arch/sh/include/asm/futex-irq.h [new file with mode: 0644]
arch/sh/include/asm/futex.h [new file with mode: 0644]
arch/sh/include/asm/gpio.h [new file with mode: 0644]
arch/sh/include/asm/hardirq.h [new file with mode: 0644]
arch/sh/include/asm/hd64461.h [new file with mode: 0644]
arch/sh/include/asm/hd64465/gpio.h [new file with mode: 0644]
arch/sh/include/asm/hd64465/hd64465.h [new file with mode: 0644]
arch/sh/include/asm/hd64465/io.h [new file with mode: 0644]
arch/sh/include/asm/heartbeat.h [new file with mode: 0644]
arch/sh/include/asm/hp6xx.h [new file with mode: 0644]
arch/sh/include/asm/hugetlb.h [new file with mode: 0644]
arch/sh/include/asm/hw_irq.h [new file with mode: 0644]
arch/sh/include/asm/i2c-sh7760.h [new file with mode: 0644]
arch/sh/include/asm/ilsel.h [new file with mode: 0644]
arch/sh/include/asm/io.h [new file with mode: 0644]
arch/sh/include/asm/io_generic.h [new file with mode: 0644]
arch/sh/include/asm/io_trapped.h [new file with mode: 0644]
arch/sh/include/asm/ioctl.h [new file with mode: 0644]
arch/sh/include/asm/ioctls.h [new file with mode: 0644]
arch/sh/include/asm/ipcbuf.h [new file with mode: 0644]
arch/sh/include/asm/irq.h [new file with mode: 0644]
arch/sh/include/asm/irq_regs.h [new file with mode: 0644]
arch/sh/include/asm/irqflags.h [new file with mode: 0644]
arch/sh/include/asm/irqflags_32.h [new file with mode: 0644]
arch/sh/include/asm/irqflags_64.h [new file with mode: 0644]
arch/sh/include/asm/kdebug.h [new file with mode: 0644]
arch/sh/include/asm/kexec.h [new file with mode: 0644]
arch/sh/include/asm/kgdb.h [new file with mode: 0644]
arch/sh/include/asm/kmap_types.h [new file with mode: 0644]
arch/sh/include/asm/lboxre2.h [new file with mode: 0644]
arch/sh/include/asm/linkage.h [new file with mode: 0644]
arch/sh/include/asm/local.h [new file with mode: 0644]
arch/sh/include/asm/machvec.h [new file with mode: 0644]
arch/sh/include/asm/magicpanelr2.h [new file with mode: 0644]
arch/sh/include/asm/mc146818rtc.h [new file with mode: 0644]
arch/sh/include/asm/microdev.h [new file with mode: 0644]
arch/sh/include/asm/migor.h [new file with mode: 0644]
arch/sh/include/asm/mman.h [new file with mode: 0644]
arch/sh/include/asm/mmu.h [new file with mode: 0644]
arch/sh/include/asm/mmu_context.h [new file with mode: 0644]
arch/sh/include/asm/mmu_context_32.h [new file with mode: 0644]
arch/sh/include/asm/mmu_context_64.h [new file with mode: 0644]
arch/sh/include/asm/mmzone.h [new file with mode: 0644]
arch/sh/include/asm/module.h [new file with mode: 0644]
arch/sh/include/asm/msgbuf.h [new file with mode: 0644]
arch/sh/include/asm/mutex.h [new file with mode: 0644]
arch/sh/include/asm/page.h [new file with mode: 0644]
arch/sh/include/asm/param.h [new file with mode: 0644]
arch/sh/include/asm/parport.h [new file with mode: 0644]
arch/sh/include/asm/pci.h [new file with mode: 0644]
arch/sh/include/asm/percpu.h [new file with mode: 0644]
arch/sh/include/asm/pgalloc.h [new file with mode: 0644]
arch/sh/include/asm/pgtable.h [new file with mode: 0644]
arch/sh/include/asm/pgtable_32.h [new file with mode: 0644]
arch/sh/include/asm/pgtable_64.h [new file with mode: 0644]
arch/sh/include/asm/pm.h [new file with mode: 0644]
arch/sh/include/asm/poll.h [new file with mode: 0644]
arch/sh/include/asm/posix_types.h [new file with mode: 0644]
arch/sh/include/asm/posix_types_32.h [new file with mode: 0644]
arch/sh/include/asm/posix_types_64.h [new file with mode: 0644]
arch/sh/include/asm/processor.h [new file with mode: 0644]
arch/sh/include/asm/processor_32.h [new file with mode: 0644]
arch/sh/include/asm/processor_64.h [new file with mode: 0644]
arch/sh/include/asm/ptrace.h [new file with mode: 0644]
arch/sh/include/asm/push-switch.h [new file with mode: 0644]
arch/sh/include/asm/r7780rp.h [new file with mode: 0644]
arch/sh/include/asm/resource.h [new file with mode: 0644]
arch/sh/include/asm/rtc.h [new file with mode: 0644]
arch/sh/include/asm/rts7751r2d.h [new file with mode: 0644]
arch/sh/include/asm/rwsem.h [new file with mode: 0644]
arch/sh/include/asm/scatterlist.h [new file with mode: 0644]
arch/sh/include/asm/sdk7780.h [new file with mode: 0644]
arch/sh/include/asm/sections.h [new file with mode: 0644]
arch/sh/include/asm/segment.h [new file with mode: 0644]
arch/sh/include/asm/sembuf.h [new file with mode: 0644]
arch/sh/include/asm/serial.h [new file with mode: 0644]
arch/sh/include/asm/setup.h [new file with mode: 0644]
arch/sh/include/asm/sfp-machine.h [new file with mode: 0644]
arch/sh/include/asm/sh7760fb.h [new file with mode: 0644]
arch/sh/include/asm/sh7763rdp.h [new file with mode: 0644]
arch/sh/include/asm/sh7785lcr.h [new file with mode: 0644]
arch/sh/include/asm/sh_bios.h [new file with mode: 0644]
arch/sh/include/asm/sh_keysc.h [new file with mode: 0644]
arch/sh/include/asm/sh_mobile_lcdc.h [new file with mode: 0644]
arch/sh/include/asm/shmbuf.h [new file with mode: 0644]
arch/sh/include/asm/shmin.h [new file with mode: 0644]
arch/sh/include/asm/shmparam.h [new file with mode: 0644]
arch/sh/include/asm/sigcontext.h [new file with mode: 0644]
arch/sh/include/asm/siginfo.h [new file with mode: 0644]
arch/sh/include/asm/signal.h [new file with mode: 0644]
arch/sh/include/asm/smc37c93x.h [new file with mode: 0644]
arch/sh/include/asm/smp.h [new file with mode: 0644]
arch/sh/include/asm/snapgear.h [new file with mode: 0644]
arch/sh/include/asm/socket.h [new file with mode: 0644]
arch/sh/include/asm/sockios.h [new file with mode: 0644]
arch/sh/include/asm/sparsemem.h [new file with mode: 0644]
arch/sh/include/asm/spi.h [new file with mode: 0644]
arch/sh/include/asm/spinlock.h [new file with mode: 0644]
arch/sh/include/asm/spinlock_types.h [new file with mode: 0644]
arch/sh/include/asm/stat.h [new file with mode: 0644]
arch/sh/include/asm/statfs.h [new file with mode: 0644]
arch/sh/include/asm/string.h [new file with mode: 0644]
arch/sh/include/asm/string_32.h [new file with mode: 0644]
arch/sh/include/asm/string_64.h [new file with mode: 0644]
arch/sh/include/asm/system.h [new file with mode: 0644]
arch/sh/include/asm/system_32.h [new file with mode: 0644]
arch/sh/include/asm/system_64.h [new file with mode: 0644]
arch/sh/include/asm/systemh7751.h [new file with mode: 0644]
arch/sh/include/asm/termbits.h [new file with mode: 0644]
arch/sh/include/asm/termios.h [new file with mode: 0644]
arch/sh/include/asm/thread_info.h [new file with mode: 0644]
arch/sh/include/asm/timer.h [new file with mode: 0644]
arch/sh/include/asm/timex.h [new file with mode: 0644]
arch/sh/include/asm/titan.h [new file with mode: 0644]
arch/sh/include/asm/tlb.h [new file with mode: 0644]
arch/sh/include/asm/tlb_64.h [new file with mode: 0644]
arch/sh/include/asm/tlbflush.h [new file with mode: 0644]
arch/sh/include/asm/topology.h [new file with mode: 0644]
arch/sh/include/asm/types.h [new file with mode: 0644]
arch/sh/include/asm/uaccess.h [new file with mode: 0644]
arch/sh/include/asm/uaccess_32.h [new file with mode: 0644]
arch/sh/include/asm/uaccess_64.h [new file with mode: 0644]
arch/sh/include/asm/ubc.h [new file with mode: 0644]
arch/sh/include/asm/ucontext.h [new file with mode: 0644]
arch/sh/include/asm/unaligned.h [new file with mode: 0644]
arch/sh/include/asm/unistd.h [new file with mode: 0644]
arch/sh/include/asm/unistd_32.h [new file with mode: 0644]
arch/sh/include/asm/unistd_64.h [new file with mode: 0644]
arch/sh/include/asm/user.h [new file with mode: 0644]
arch/sh/include/asm/vga.h [new file with mode: 0644]
arch/sh/include/asm/watchdog.h [new file with mode: 0644]
arch/sh/include/asm/xor.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/addrspace.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/cacheflush.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/mmu_context.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/rtc.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/sigcontext.h [new file with mode: 0644]
arch/sh/include/cpu-common/cpu/timer.h [new file with mode: 0644]
arch/sh/include/cpu-sh2/cpu/cache.h [new file with mode: 0644]
arch/sh/include/cpu-sh2/cpu/dma.h [new file with mode: 0644]
arch/sh/include/cpu-sh2/cpu/freq.h [new file with mode: 0644]
arch/sh/include/cpu-sh2/cpu/ubc.h [new file with mode: 0644]
arch/sh/include/cpu-sh2/cpu/watchdog.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/cache.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/dma.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/freq.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/rtc.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/ubc.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/watchdog.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/adc.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/cache.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/cacheflush.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/dac.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/dma.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/freq.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/gpio.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/mmu_context.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/timer.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/ubc.h [new file with mode: 0644]
arch/sh/include/cpu-sh3/cpu/watchdog.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/addrspace.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/cache.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/cacheflush.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/dma-sh7780.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/dma.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/fpu.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/freq.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/mmu_context.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/rtc.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/sigcontext.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/sq.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/timer.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/ubc.h [new file with mode: 0644]
arch/sh/include/cpu-sh4/cpu/watchdog.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/addrspace.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/cache.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/cacheflush.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/dma.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/irq.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/mmu_context.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/registers.h [new file with mode: 0644]
arch/sh/include/cpu-sh5/cpu/rtc.h [new file with mode: 0644]
arch/sh/include/mach-dreamcast/mach/dma.h [new file with mode: 0644]
arch/sh/include/mach-dreamcast/mach/maple.h [new file with mode: 0644]
arch/sh/include/mach-dreamcast/mach/pci.h [new file with mode: 0644]
arch/sh/include/mach-dreamcast/mach/sysasic.h [new file with mode: 0644]
arch/sh/include/mach-landisk/mach/gio.h [new file with mode: 0644]
arch/sh/include/mach-landisk/mach/iodata_landisk.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7206.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7343.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7721.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7722.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7751.h [new file with mode: 0644]
arch/sh/include/mach-se/mach/se7780.h [new file with mode: 0644]
arch/sh/include/mach-sh03/mach/io.h [new file with mode: 0644]
arch/sh/include/mach-sh03/mach/sh03.h [new file with mode: 0644]
arch/sh/kernel/.gitignore [new file with mode: 0644]
arch/sh/kernel/cf-enabler.c
arch/sh/kernel/cpu/irq/intc-sh5.c
arch/sh/kernel/cpu/sh2/entry.S
arch/sh/kernel/cpu/sh2a/entry.S
arch/sh/kernel/cpu/sh3/entry.S
arch/sh/kernel/cpu/sh4/fpu.c
arch/sh/kernel/cpu/sh4/softfloat.c
arch/sh/kernel/cpu/sh4/sq.c
arch/sh/kernel/cpu/sh5/entry.S
arch/sh/kernel/head_64.S
arch/sh/kernel/irq.c
arch/sh/kernel/time_64.c
arch/sh/lib64/panic.c
arch/sh/mm/fault_64.c
arch/sh/tools/Makefile
arch/sparc/include/asm/futex_64.h
arch/sparc/include/asm/irq_64.h
arch/sparc/include/asm/of_platform.h
arch/sparc/include/asm/of_platform_32.h [deleted file]
arch/sparc/include/asm/of_platform_64.h [deleted file]
arch/sparc/include/asm/ptrace_32.h
arch/sparc/include/asm/ptrace_64.h
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/process.c
arch/sparc64/kernel/signal.c
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/traps.c
arch/sparc64/mm/ultra.S
arch/x86/kernel/pci-dma.c
arch/x86/kernel/setup.c
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c
block/blk-core.c
drivers/Makefile
drivers/acpi/asus_acpi.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/libata.h
drivers/ata/pata_ali.c
drivers/ata/pata_it821x.c
drivers/ata/pata_via.c
drivers/atm/iphase.c
drivers/base/class.c
drivers/block/aoe/aoenet.c
drivers/bluetooth/hci_usb.c
drivers/cdrom/gdrom.c
drivers/char/efirtc.c
drivers/char/tty_ldisc.c
drivers/char/vt.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/hwmon/Kconfig
drivers/hwmon/adt7473.c
drivers/hwmon/dme1737.c
drivers/hwmon/lm75.c
drivers/hwmon/lm85.c
drivers/infiniband/hw/ipath/ipath_iba7220.c
drivers/input/keyboard/maple_keyb.c
drivers/isdn/Makefile
drivers/isdn/gigaset/isocdata.c
drivers/isdn/hardware/mISDN/hfcmulti.c
drivers/isdn/hardware/mISDN/hfcpci.c
drivers/isdn/hysdn/hysdn_pof.h
drivers/isdn/mISDN/l1oip_core.c
drivers/isdn/mISDN/socket.c
drivers/md/bitmap.c
drivers/md/dm-table.c
drivers/md/md.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/media/video/cs5345.c
drivers/media/video/cs53l32a.c
drivers/media/video/mt9v022.c
drivers/media/video/planb.c [deleted file]
drivers/media/video/planb.h [deleted file]
drivers/media/video/saa7196.h [deleted file]
drivers/media/video/videodev.c [deleted file]
drivers/misc/Kconfig
drivers/mmc/card/block.c
drivers/mmc/card/mmc_test.c
drivers/mmc/core/core.c
drivers/mmc/host/au1xmmc.c
drivers/mmc/host/sdhci-pci.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
drivers/mtd/chips/jedec_probe.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/maps/ipaq-flash.c
drivers/mtd/mtdsuper.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/bf5xx_nand.c
drivers/mtd/nand/diskonchip.c
drivers/mtd/nand/fsl_elbc_nand.c
drivers/mtd/nand/nandsim.c
drivers/net/Kconfig
drivers/net/bfin_mac.c
drivers/net/cxgb3/t3_hw.c
drivers/net/ehea/ehea_main.c
drivers/net/enc28j60.c
drivers/net/forcedeth.c
drivers/net/ifb.c
drivers/net/irda/act200l-sir.c
drivers/net/irda/actisys-sir.c
drivers/net/irda/ali-ircc.c
drivers/net/irda/donauboe.c
drivers/net/irda/girbil-sir.c
drivers/net/irda/irda-usb.c
drivers/net/irda/irtty-sir.c
drivers/net/irda/kingsun-sir.c
drivers/net/irda/litelink-sir.c
drivers/net/irda/ma600-sir.c
drivers/net/irda/mcp2120-sir.c
drivers/net/irda/nsc-ircc.c
drivers/net/irda/nsc-ircc.h
drivers/net/irda/old_belkin-sir.c
drivers/net/irda/sir_dev.c
drivers/net/irda/sir_dongle.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/tekram-sir.c
drivers/net/irda/toim3232-sir.c
drivers/net/irda/via-ircc.c
drivers/net/irda/vlsi_ir.c
drivers/net/irda/vlsi_ir.h
drivers/net/irda/w83977af_ir.c
drivers/net/mv643xx_eth.c
drivers/net/ne.c
drivers/net/netconsole.c
drivers/net/s2io.c
drivers/net/sh_eth.c
drivers/net/sh_eth.h
drivers/net/skfp/smt.c
drivers/net/tg3.c
drivers/net/tokenring/3c359.c
drivers/net/usb/dm9601.c
drivers/net/wd.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/pcmcia/rsrc_nonstatic.c
drivers/pnp/support.c
drivers/power/Kconfig
drivers/power/Makefile
drivers/power/olpc_battery.c
drivers/power/power_supply_sysfs.c
drivers/power/tosa_battery.c [new file with mode: 0644]
drivers/regulator/Kconfig [new file with mode: 0644]
drivers/regulator/Makefile [new file with mode: 0644]
drivers/regulator/bq24022.c [new file with mode: 0644]
drivers/regulator/core.c [new file with mode: 0644]
drivers/regulator/fixed.c [new file with mode: 0644]
drivers/regulator/virtual.c [new file with mode: 0644]
drivers/scsi/sd.c
drivers/scsi/sd.h
drivers/serial/bfin_5xx.c
drivers/serial/crisv10.c
drivers/serial/crisv10.h
drivers/serial/sh-sci.h
drivers/sh/maple/maple.c
drivers/spi/atmel_spi.c
drivers/spi/spi_s3c24xx.c
drivers/video/Makefile
drivers/video/backlight/hp680_bl.c
drivers/video/console/.gitignore [new file with mode: 0644]
drivers/video/hitfb.c
drivers/video/matrox/matroxfb_base.c
drivers/video/pvr2fb.c
drivers/watchdog/ar7_wdt.c
drivers/watchdog/it8712f_wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/sc1200wdt.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt_pci.c
firmware/ihex2fw.c
fs/afs/mntpt.c
fs/block_dev.c
fs/cifs/cifs_dfs_ref.c
fs/configfs/configfs_internal.h
fs/configfs/dir.c
fs/configfs/symlink.c
fs/dcache.c
fs/devpts/inode.c
fs/dquot.c
fs/ext3/super.c
fs/ext4/acl.c
fs/ext4/balloc.c
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/ialloc.c
fs/ext4/inode.c
fs/ext4/mballoc.c
fs/ext4/mballoc.h
fs/ext4/resize.c
fs/ext4/super.c
fs/ext4/xattr.c
fs/fat/file.c
fs/fcntl.c
fs/file.c
fs/jbd2/commit.c
fs/jbd2/journal.c
fs/jffs2/summary.c
fs/jffs2/summary.h
fs/namei.c
fs/namespace.c
fs/nfs/namespace.c
fs/nfs/nfsroot.c
fs/ocfs2/aops.c
fs/ocfs2/file.c
fs/ocfs2/journal.c
fs/ocfs2/journal.h
fs/ocfs2/ocfs2.h
fs/ocfs2/ocfs2_fs.h
fs/ocfs2/super.c
fs/open.c
fs/proc/generic.c
fs/reiserfs/super.c
fs/ufs/super.c
fs/xfs/Makefile
fs/xfs/linux-2.6/kmem.c
fs/xfs/linux-2.6/kmem.h
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_export.c
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_iops.h
fs/xfs/linux-2.6/xfs_linux.h
fs/xfs/linux-2.6/xfs_stats.c
fs/xfs/linux-2.6/xfs_stats.h
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_super.h
fs/xfs/linux-2.6/xfs_sysctl.c
fs/xfs/linux-2.6/xfs_sysctl.h
fs/xfs/linux-2.6/xfs_vnode.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/linux-2.6/xfs_xattr.c [new file with mode: 0644]
fs/xfs/quota/xfs_dquot.c
fs/xfs/quota/xfs_dquot.h
fs/xfs/quota/xfs_dquot_item.c
fs/xfs/quota/xfs_qm.c
fs/xfs/quota/xfs_qm_syscalls.c
fs/xfs/quota/xfs_quota_priv.h
fs/xfs/support/ktrace.c
fs/xfs/support/uuid.c
fs/xfs/support/uuid.h
fs/xfs/xfs_acl.c
fs/xfs/xfs_acl.h
fs/xfs/xfs_attr.c
fs/xfs/xfs_attr.h
fs/xfs/xfs_attr_leaf.c
fs/xfs/xfs_attr_leaf.h
fs/xfs/xfs_attr_sf.h
fs/xfs/xfs_bmap.c
fs/xfs/xfs_bmap.h
fs/xfs/xfs_bmap_btree.c
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_clnt.h
fs/xfs/xfs_da_btree.c
fs/xfs/xfs_da_btree.h
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_dir2.c
fs/xfs/xfs_dir2.h
fs/xfs/xfs_dir2_block.c
fs/xfs/xfs_dir2_data.c
fs/xfs/xfs_dir2_leaf.c
fs/xfs/xfs_dir2_node.c
fs/xfs/xfs_dir2_sf.c
fs/xfs/xfs_dir2_sf.h
fs/xfs/xfs_dir2_trace.c
fs/xfs/xfs_dmapi.h
fs/xfs/xfs_error.c
fs/xfs/xfs_error.h
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_filestream.c
fs/xfs/xfs_fs.h
fs/xfs/xfs_fsops.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_itable.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_mru_cache.c
fs/xfs/xfs_rename.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_sb.h
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans_inode.c
fs/xfs/xfs_trans_item.c
fs/xfs/xfs_vfsops.c
fs/xfs/xfs_vfsops.h
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.h
include/asm-arm/Kbuild [deleted file]
include/asm-arm/a.out-core.h [deleted file]
include/asm-arm/a.out.h [deleted file]
include/asm-arm/arch-ns9xxx/debug-macro.S
include/asm-arm/arch-ns9xxx/entry-macro.S
include/asm-arm/arch-ns9xxx/processor.h
include/asm-arm/arch-ns9xxx/system.h
include/asm-arm/arch-omap/board.h
include/asm-arm/assembler.h [deleted file]
include/asm-arm/atomic.h [deleted file]
include/asm-arm/auxvec.h [deleted file]
include/asm-arm/bitops.h [deleted file]
include/asm-arm/bug.h [deleted file]
include/asm-arm/bugs.h [deleted file]
include/asm-arm/byteorder.h [deleted file]
include/asm-arm/cache.h [deleted file]
include/asm-arm/cacheflush.h [deleted file]
include/asm-arm/checksum.h [deleted file]
include/asm-arm/cnt32_to_63.h [deleted file]
include/asm-arm/cpu-multi32.h [deleted file]
include/asm-arm/cpu-single.h [deleted file]
include/asm-arm/cpu.h [deleted file]
include/asm-arm/cputime.h [deleted file]
include/asm-arm/current.h [deleted file]
include/asm-arm/delay.h [deleted file]
include/asm-arm/device.h [deleted file]
include/asm-arm/div64.h [deleted file]
include/asm-arm/dma-mapping.h [deleted file]
include/asm-arm/dma.h [deleted file]
include/asm-arm/domain.h [deleted file]
include/asm-arm/ecard.h [deleted file]
include/asm-arm/elf.h [deleted file]
include/asm-arm/emergency-restart.h [deleted file]
include/asm-arm/errno.h [deleted file]
include/asm-arm/fb.h [deleted file]
include/asm-arm/fcntl.h [deleted file]
include/asm-arm/fiq.h [deleted file]
include/asm-arm/flat.h [deleted file]
include/asm-arm/floppy.h [deleted file]
include/asm-arm/fpstate.h [deleted file]
include/asm-arm/ftrace.h [deleted file]
include/asm-arm/futex.h [deleted file]
include/asm-arm/glue.h [deleted file]
include/asm-arm/gpio.h [deleted file]
include/asm-arm/hardirq.h [deleted file]
include/asm-arm/hardware.h [deleted file]
include/asm-arm/hardware/arm_timer.h [deleted file]
include/asm-arm/hardware/arm_twd.h [deleted file]
include/asm-arm/hardware/cache-l2x0.h [deleted file]
include/asm-arm/hardware/clps7111.h [deleted file]
include/asm-arm/hardware/cs89712.h [deleted file]
include/asm-arm/hardware/debug-8250.S [deleted file]
include/asm-arm/hardware/debug-pl01x.S [deleted file]
include/asm-arm/hardware/dec21285.h [deleted file]
include/asm-arm/hardware/entry-macro-iomd.S [deleted file]
include/asm-arm/hardware/ep7211.h [deleted file]
include/asm-arm/hardware/ep7212.h [deleted file]
include/asm-arm/hardware/gic.h [deleted file]
include/asm-arm/hardware/icst307.h [deleted file]
include/asm-arm/hardware/icst525.h [deleted file]
include/asm-arm/hardware/ioc.h [deleted file]
include/asm-arm/hardware/iomd.h [deleted file]
include/asm-arm/hardware/iop3xx-adma.h [deleted file]
include/asm-arm/hardware/iop3xx-gpio.h [deleted file]
include/asm-arm/hardware/iop3xx.h [deleted file]
include/asm-arm/hardware/iop_adma.h [deleted file]
include/asm-arm/hardware/it8152.h [deleted file]
include/asm-arm/hardware/linkup-l1110.h [deleted file]
include/asm-arm/hardware/locomo.h [deleted file]
include/asm-arm/hardware/memc.h [deleted file]
include/asm-arm/hardware/pci_v3.h [deleted file]
include/asm-arm/hardware/sa1111.h [deleted file]
include/asm-arm/hardware/scoop.h [deleted file]
include/asm-arm/hardware/sharpsl_pm.h [deleted file]
include/asm-arm/hardware/ssp.h [deleted file]
include/asm-arm/hardware/uengine.h [deleted file]
include/asm-arm/hardware/vic.h [deleted file]
include/asm-arm/hw_irq.h [deleted file]
include/asm-arm/hwcap.h [deleted file]
include/asm-arm/ide.h [deleted file]
include/asm-arm/io.h [deleted file]
include/asm-arm/ioctl.h [deleted file]
include/asm-arm/ioctls.h [deleted file]
include/asm-arm/ipcbuf.h [deleted file]
include/asm-arm/irq.h [deleted file]
include/asm-arm/irq_regs.h [deleted file]
include/asm-arm/irqflags.h [deleted file]
include/asm-arm/kdebug.h [deleted file]
include/asm-arm/kexec.h [deleted file]
include/asm-arm/kgdb.h [deleted file]
include/asm-arm/kmap_types.h [deleted file]
include/asm-arm/kprobes.h [deleted file]
include/asm-arm/leds.h [deleted file]
include/asm-arm/limits.h [deleted file]
include/asm-arm/linkage.h [deleted file]
include/asm-arm/local.h [deleted file]
include/asm-arm/locks.h [deleted file]
include/asm-arm/mach/arch.h [deleted file]
include/asm-arm/mach/dma.h [deleted file]
include/asm-arm/mach/flash.h [deleted file]
include/asm-arm/mach/irda.h [deleted file]
include/asm-arm/mach/irq.h [deleted file]
include/asm-arm/mach/map.h [deleted file]
include/asm-arm/mach/mmc.h [deleted file]
include/asm-arm/mach/pci.h [deleted file]
include/asm-arm/mach/serial_at91.h [deleted file]
include/asm-arm/mach/serial_sa1100.h [deleted file]
include/asm-arm/mach/sharpsl_param.h [deleted file]
include/asm-arm/mach/time.h [deleted file]
include/asm-arm/mach/udc_pxa2xx.h [deleted file]
include/asm-arm/mc146818rtc.h [deleted file]
include/asm-arm/memory.h [deleted file]
include/asm-arm/mman.h [deleted file]
include/asm-arm/mmu.h [deleted file]
include/asm-arm/mmu_context.h [deleted file]
include/asm-arm/mmzone.h [deleted file]
include/asm-arm/module.h [deleted file]
include/asm-arm/msgbuf.h [deleted file]
include/asm-arm/mtd-xip.h [deleted file]
include/asm-arm/mutex.h [deleted file]
include/asm-arm/nwflash.h [deleted file]
include/asm-arm/page-nommu.h [deleted file]
include/asm-arm/page.h [deleted file]
include/asm-arm/param.h [deleted file]
include/asm-arm/parport.h [deleted file]
include/asm-arm/pci.h [deleted file]
include/asm-arm/percpu.h [deleted file]
include/asm-arm/pgalloc.h [deleted file]
include/asm-arm/pgtable-hwdef.h [deleted file]
include/asm-arm/pgtable-nommu.h [deleted file]
include/asm-arm/pgtable.h [deleted file]
include/asm-arm/poll.h [deleted file]
include/asm-arm/posix_types.h [deleted file]
include/asm-arm/proc-fns.h [deleted file]
include/asm-arm/processor.h [deleted file]
include/asm-arm/procinfo.h [deleted file]
include/asm-arm/ptrace.h [deleted file]
include/asm-arm/resource.h [deleted file]
include/asm-arm/scatterlist.h [deleted file]
include/asm-arm/sections.h [deleted file]
include/asm-arm/segment.h [deleted file]
include/asm-arm/sembuf.h [deleted file]
include/asm-arm/serial.h [deleted file]
include/asm-arm/setup.h [deleted file]
include/asm-arm/shmbuf.h [deleted file]
include/asm-arm/shmparam.h [deleted file]
include/asm-arm/sigcontext.h [deleted file]
include/asm-arm/siginfo.h [deleted file]
include/asm-arm/signal.h [deleted file]
include/asm-arm/sizes.h [deleted file]
include/asm-arm/smp.h [deleted file]
include/asm-arm/socket.h [deleted file]
include/asm-arm/sockios.h [deleted file]
include/asm-arm/sparsemem.h [deleted file]
include/asm-arm/spinlock.h [deleted file]
include/asm-arm/spinlock_types.h [deleted file]
include/asm-arm/stat.h [deleted file]
include/asm-arm/statfs.h [deleted file]
include/asm-arm/string.h [deleted file]
include/asm-arm/suspend.h [deleted file]
include/asm-arm/system.h [deleted file]
include/asm-arm/termbits.h [deleted file]
include/asm-arm/termios.h [deleted file]
include/asm-arm/therm.h [deleted file]
include/asm-arm/thread_info.h [deleted file]
include/asm-arm/thread_notify.h [deleted file]
include/asm-arm/timex.h [deleted file]
include/asm-arm/tlb.h [deleted file]
include/asm-arm/tlbflush.h [deleted file]
include/asm-arm/topology.h [deleted file]
include/asm-arm/traps.h [deleted file]
include/asm-arm/types.h [deleted file]
include/asm-arm/uaccess.h [deleted file]
include/asm-arm/ucontext.h [deleted file]
include/asm-arm/unaligned.h [deleted file]
include/asm-arm/unistd.h [deleted file]
include/asm-arm/user.h [deleted file]
include/asm-arm/vfp.h [deleted file]
include/asm-arm/vfpmacros.h [deleted file]
include/asm-arm/vga.h [deleted file]
include/asm-arm/xor.h [deleted file]
include/asm-frv/unistd.h
include/asm-generic/vmlinux.lds.h
include/asm-ia64/Kbuild [deleted file]
include/asm-ia64/a.out.h [deleted file]
include/asm-ia64/acpi-ext.h [deleted file]
include/asm-ia64/acpi.h [deleted file]
include/asm-ia64/agp.h [deleted file]
include/asm-ia64/asmmacro.h [deleted file]
include/asm-ia64/atomic.h [deleted file]
include/asm-ia64/auxvec.h [deleted file]
include/asm-ia64/bitops.h [deleted file]
include/asm-ia64/break.h [deleted file]
include/asm-ia64/bug.h [deleted file]
include/asm-ia64/bugs.h [deleted file]
include/asm-ia64/byteorder.h [deleted file]
include/asm-ia64/cache.h [deleted file]
include/asm-ia64/cacheflush.h [deleted file]
include/asm-ia64/checksum.h [deleted file]
include/asm-ia64/compat.h [deleted file]
include/asm-ia64/cpu.h [deleted file]
include/asm-ia64/cputime.h [deleted file]
include/asm-ia64/current.h [deleted file]
include/asm-ia64/cyclone.h [deleted file]
include/asm-ia64/delay.h [deleted file]
include/asm-ia64/device.h [deleted file]
include/asm-ia64/div64.h [deleted file]
include/asm-ia64/dma-mapping.h [deleted file]
include/asm-ia64/dma.h [deleted file]
include/asm-ia64/dmi.h [deleted file]
include/asm-ia64/elf.h [deleted file]
include/asm-ia64/emergency-restart.h [deleted file]
include/asm-ia64/errno.h [deleted file]
include/asm-ia64/esi.h [deleted file]
include/asm-ia64/fb.h [deleted file]
include/asm-ia64/fcntl.h [deleted file]
include/asm-ia64/fpswa.h [deleted file]
include/asm-ia64/fpu.h [deleted file]
include/asm-ia64/futex.h [deleted file]
include/asm-ia64/gcc_intrin.h [deleted file]
include/asm-ia64/hardirq.h [deleted file]
include/asm-ia64/hpsim.h [deleted file]
include/asm-ia64/hugetlb.h [deleted file]
include/asm-ia64/hw_irq.h [deleted file]
include/asm-ia64/ia32.h [deleted file]
include/asm-ia64/ia64regs.h [deleted file]
include/asm-ia64/intel_intrin.h [deleted file]
include/asm-ia64/intrinsics.h [deleted file]
include/asm-ia64/io.h [deleted file]
include/asm-ia64/ioctl.h [deleted file]
include/asm-ia64/ioctls.h [deleted file]
include/asm-ia64/iosapic.h [deleted file]
include/asm-ia64/ipcbuf.h [deleted file]
include/asm-ia64/irq.h [deleted file]
include/asm-ia64/irq_regs.h [deleted file]
include/asm-ia64/kdebug.h [deleted file]
include/asm-ia64/kexec.h [deleted file]
include/asm-ia64/kmap_types.h [deleted file]
include/asm-ia64/kprobes.h [deleted file]
include/asm-ia64/kregs.h [deleted file]
include/asm-ia64/kvm.h [deleted file]
include/asm-ia64/kvm_host.h [deleted file]
include/asm-ia64/kvm_para.h [deleted file]
include/asm-ia64/libata-portmap.h [deleted file]
include/asm-ia64/linkage.h [deleted file]
include/asm-ia64/local.h [deleted file]
include/asm-ia64/machvec.h [deleted file]
include/asm-ia64/machvec_dig.h [deleted file]
include/asm-ia64/machvec_hpsim.h [deleted file]
include/asm-ia64/machvec_hpzx1.h [deleted file]
include/asm-ia64/machvec_hpzx1_swiotlb.h [deleted file]
include/asm-ia64/machvec_init.h [deleted file]
include/asm-ia64/machvec_sn2.h [deleted file]
include/asm-ia64/machvec_uv.h [deleted file]
include/asm-ia64/mc146818rtc.h [deleted file]
include/asm-ia64/mca.h [deleted file]
include/asm-ia64/mca_asm.h [deleted file]
include/asm-ia64/meminit.h [deleted file]
include/asm-ia64/mman.h [deleted file]
include/asm-ia64/mmu.h [deleted file]
include/asm-ia64/mmu_context.h [deleted file]
include/asm-ia64/mmzone.h [deleted file]
include/asm-ia64/module.h [deleted file]
include/asm-ia64/msgbuf.h [deleted file]
include/asm-ia64/mutex.h [deleted file]
include/asm-ia64/native/inst.h [deleted file]
include/asm-ia64/native/irq.h [deleted file]
include/asm-ia64/nodedata.h [deleted file]
include/asm-ia64/numa.h [deleted file]
include/asm-ia64/page.h [deleted file]
include/asm-ia64/pal.h [deleted file]
include/asm-ia64/param.h [deleted file]
include/asm-ia64/paravirt.h [deleted file]
include/asm-ia64/paravirt_privop.h [deleted file]
include/asm-ia64/parport.h [deleted file]
include/asm-ia64/patch.h [deleted file]
include/asm-ia64/pci.h [deleted file]
include/asm-ia64/percpu.h [deleted file]
include/asm-ia64/perfmon.h [deleted file]
include/asm-ia64/perfmon_default_smpl.h [deleted file]
include/asm-ia64/pgalloc.h [deleted file]
include/asm-ia64/pgtable.h [deleted file]
include/asm-ia64/poll.h [deleted file]
include/asm-ia64/posix_types.h [deleted file]
include/asm-ia64/processor.h [deleted file]
include/asm-ia64/ptrace.h [deleted file]
include/asm-ia64/ptrace_offsets.h [deleted file]
include/asm-ia64/resource.h [deleted file]
include/asm-ia64/rse.h [deleted file]
include/asm-ia64/rwsem.h [deleted file]
include/asm-ia64/sal.h [deleted file]
include/asm-ia64/scatterlist.h [deleted file]
include/asm-ia64/sections.h [deleted file]
include/asm-ia64/segment.h [deleted file]
include/asm-ia64/sembuf.h [deleted file]
include/asm-ia64/serial.h [deleted file]
include/asm-ia64/setup.h [deleted file]
include/asm-ia64/shmbuf.h [deleted file]
include/asm-ia64/shmparam.h [deleted file]
include/asm-ia64/sigcontext.h [deleted file]
include/asm-ia64/siginfo.h [deleted file]
include/asm-ia64/signal.h [deleted file]
include/asm-ia64/smp.h [deleted file]
include/asm-ia64/sn/acpi.h [deleted file]
include/asm-ia64/sn/addrs.h [deleted file]
include/asm-ia64/sn/arch.h [deleted file]
include/asm-ia64/sn/bte.h [deleted file]
include/asm-ia64/sn/clksupport.h [deleted file]
include/asm-ia64/sn/geo.h [deleted file]
include/asm-ia64/sn/intr.h [deleted file]
include/asm-ia64/sn/io.h [deleted file]
include/asm-ia64/sn/ioc3.h [deleted file]
include/asm-ia64/sn/klconfig.h [deleted file]
include/asm-ia64/sn/l1.h [deleted file]
include/asm-ia64/sn/leds.h [deleted file]
include/asm-ia64/sn/module.h [deleted file]
include/asm-ia64/sn/mspec.h [deleted file]
include/asm-ia64/sn/nodepda.h [deleted file]
include/asm-ia64/sn/pcibr_provider.h [deleted file]
include/asm-ia64/sn/pcibus_provider_defs.h [deleted file]
include/asm-ia64/sn/pcidev.h [deleted file]
include/asm-ia64/sn/pda.h [deleted file]
include/asm-ia64/sn/pic.h [deleted file]
include/asm-ia64/sn/rw_mmr.h [deleted file]
include/asm-ia64/sn/shub_mmr.h [deleted file]
include/asm-ia64/sn/shubio.h [deleted file]
include/asm-ia64/sn/simulator.h [deleted file]
include/asm-ia64/sn/sn2/sn_hwperf.h [deleted file]
include/asm-ia64/sn/sn_cpuid.h [deleted file]
include/asm-ia64/sn/sn_feature_sets.h [deleted file]
include/asm-ia64/sn/sn_sal.h [deleted file]
include/asm-ia64/sn/tioca.h [deleted file]
include/asm-ia64/sn/tioca_provider.h [deleted file]
include/asm-ia64/sn/tioce.h [deleted file]
include/asm-ia64/sn/tioce_provider.h [deleted file]
include/asm-ia64/sn/tiocp.h [deleted file]
include/asm-ia64/sn/tiocx.h [deleted file]
include/asm-ia64/sn/types.h [deleted file]
include/asm-ia64/socket.h [deleted file]
include/asm-ia64/sockios.h [deleted file]
include/asm-ia64/sparsemem.h [deleted file]
include/asm-ia64/spinlock.h [deleted file]
include/asm-ia64/spinlock_types.h [deleted file]
include/asm-ia64/stat.h [deleted file]
include/asm-ia64/statfs.h [deleted file]
include/asm-ia64/string.h [deleted file]
include/asm-ia64/suspend.h [deleted file]
include/asm-ia64/system.h [deleted file]
include/asm-ia64/termbits.h [deleted file]
include/asm-ia64/termios.h [deleted file]
include/asm-ia64/thread_info.h [deleted file]
include/asm-ia64/timex.h [deleted file]
include/asm-ia64/tlb.h [deleted file]
include/asm-ia64/tlbflush.h [deleted file]
include/asm-ia64/topology.h [deleted file]
include/asm-ia64/types.h [deleted file]
include/asm-ia64/uaccess.h [deleted file]
include/asm-ia64/ucontext.h [deleted file]
include/asm-ia64/unaligned.h [deleted file]
include/asm-ia64/uncached.h [deleted file]
include/asm-ia64/unistd.h [deleted file]
include/asm-ia64/unwind.h [deleted file]
include/asm-ia64/user.h [deleted file]
include/asm-ia64/ustack.h [deleted file]
include/asm-ia64/uv/uv_hub.h [deleted file]
include/asm-ia64/uv/uv_mmrs.h [deleted file]
include/asm-ia64/vga.h [deleted file]
include/asm-ia64/xor.h [deleted file]
include/asm-mips/gdb-stub.h [deleted file]
include/asm-mips/kdebug.h
include/asm-mips/kgdb.h [new file with mode: 0644]
include/asm-mips/pci.h
include/asm-mips/txx9/generic.h
include/asm-mips/txx9/jmr3927.h
include/asm-mips/txx9/pci.h
include/asm-mips/txx9/smsc_fdc37m81x.h
include/asm-mips/txx9/tx3927.h
include/asm-mips/txx9/tx4927.h
include/asm-mips/txx9/tx4927pcic.h
include/asm-mips/txx9/tx4938.h
include/asm-mips/txx9/txx927.h [deleted file]
include/asm-mips/txx9irq.h
include/asm-mn10300/unistd.h
include/asm-sh/.gitignore [deleted file]
include/asm-sh/Kbuild [deleted file]
include/asm-sh/a.out.h [deleted file]
include/asm-sh/adc.h [deleted file]
include/asm-sh/addrspace.h [deleted file]
include/asm-sh/atomic-grb.h [deleted file]
include/asm-sh/atomic-irq.h [deleted file]
include/asm-sh/atomic-llsc.h [deleted file]
include/asm-sh/atomic.h [deleted file]
include/asm-sh/auxvec.h [deleted file]
include/asm-sh/bitops-grb.h [deleted file]
include/asm-sh/bitops-irq.h [deleted file]
include/asm-sh/bitops.h [deleted file]
include/asm-sh/bug.h [deleted file]
include/asm-sh/bugs.h [deleted file]
include/asm-sh/byteorder.h [deleted file]
include/asm-sh/cache.h [deleted file]
include/asm-sh/cacheflush.h [deleted file]
include/asm-sh/checksum.h [deleted file]
include/asm-sh/checksum_32.h [deleted file]
include/asm-sh/checksum_64.h [deleted file]
include/asm-sh/clock.h [deleted file]
include/asm-sh/cmpxchg-grb.h [deleted file]
include/asm-sh/cmpxchg-irq.h [deleted file]
include/asm-sh/cpu-features.h [deleted file]
include/asm-sh/cpu-sh2/addrspace.h [deleted file]
include/asm-sh/cpu-sh2/cache.h [deleted file]
include/asm-sh/cpu-sh2/cacheflush.h [deleted file]
include/asm-sh/cpu-sh2/dma.h [deleted file]
include/asm-sh/cpu-sh2/freq.h [deleted file]
include/asm-sh/cpu-sh2/mmu_context.h [deleted file]
include/asm-sh/cpu-sh2/rtc.h [deleted file]
include/asm-sh/cpu-sh2/sigcontext.h [deleted file]
include/asm-sh/cpu-sh2/timer.h [deleted file]
include/asm-sh/cpu-sh2/ubc.h [deleted file]
include/asm-sh/cpu-sh2/watchdog.h [deleted file]
include/asm-sh/cpu-sh2a/addrspace.h [deleted file]
include/asm-sh/cpu-sh2a/cache.h [deleted file]
include/asm-sh/cpu-sh2a/cacheflush.h [deleted file]
include/asm-sh/cpu-sh2a/dma.h [deleted file]
include/asm-sh/cpu-sh2a/freq.h [deleted file]
include/asm-sh/cpu-sh2a/mmu_context.h [deleted file]
include/asm-sh/cpu-sh2a/rtc.h [deleted file]
include/asm-sh/cpu-sh2a/timer.h [deleted file]
include/asm-sh/cpu-sh2a/ubc.h [deleted file]
include/asm-sh/cpu-sh2a/watchdog.h [deleted file]
include/asm-sh/cpu-sh3/adc.h [deleted file]
include/asm-sh/cpu-sh3/addrspace.h [deleted file]
include/asm-sh/cpu-sh3/cache.h [deleted file]
include/asm-sh/cpu-sh3/cacheflush.h [deleted file]
include/asm-sh/cpu-sh3/dac.h [deleted file]
include/asm-sh/cpu-sh3/dma.h [deleted file]
include/asm-sh/cpu-sh3/freq.h [deleted file]
include/asm-sh/cpu-sh3/gpio.h [deleted file]
include/asm-sh/cpu-sh3/mmu_context.h [deleted file]
include/asm-sh/cpu-sh3/rtc.h [deleted file]
include/asm-sh/cpu-sh3/sigcontext.h [deleted file]
include/asm-sh/cpu-sh3/timer.h [deleted file]
include/asm-sh/cpu-sh3/ubc.h [deleted file]
include/asm-sh/cpu-sh3/watchdog.h [deleted file]
include/asm-sh/cpu-sh4/addrspace.h [deleted file]
include/asm-sh/cpu-sh4/cache.h [deleted file]
include/asm-sh/cpu-sh4/cacheflush.h [deleted file]
include/asm-sh/cpu-sh4/dma-sh7780.h [deleted file]
include/asm-sh/cpu-sh4/dma.h [deleted file]
include/asm-sh/cpu-sh4/fpu.h [deleted file]
include/asm-sh/cpu-sh4/freq.h [deleted file]
include/asm-sh/cpu-sh4/mmu_context.h [deleted file]
include/asm-sh/cpu-sh4/rtc.h [deleted file]
include/asm-sh/cpu-sh4/sigcontext.h [deleted file]
include/asm-sh/cpu-sh4/sq.h [deleted file]
include/asm-sh/cpu-sh4/timer.h [deleted file]
include/asm-sh/cpu-sh4/ubc.h [deleted file]
include/asm-sh/cpu-sh4/watchdog.h [deleted file]
include/asm-sh/cpu-sh5/addrspace.h [deleted file]
include/asm-sh/cpu-sh5/cache.h [deleted file]
include/asm-sh/cpu-sh5/cacheflush.h [deleted file]
include/asm-sh/cpu-sh5/dma.h [deleted file]
include/asm-sh/cpu-sh5/irq.h [deleted file]
include/asm-sh/cpu-sh5/mmu_context.h [deleted file]
include/asm-sh/cpu-sh5/registers.h [deleted file]
include/asm-sh/cpu-sh5/rtc.h [deleted file]
include/asm-sh/cpu-sh5/timer.h [deleted file]
include/asm-sh/cputime.h [deleted file]
include/asm-sh/current.h [deleted file]
include/asm-sh/delay.h [deleted file]
include/asm-sh/device.h [deleted file]
include/asm-sh/div64.h [deleted file]
include/asm-sh/dma-mapping.h [deleted file]
include/asm-sh/dma.h [deleted file]
include/asm-sh/dmabrg.h [deleted file]
include/asm-sh/dreamcast/dma.h [deleted file]
include/asm-sh/dreamcast/maple.h [deleted file]
include/asm-sh/dreamcast/pci.h [deleted file]
include/asm-sh/dreamcast/sysasic.h [deleted file]
include/asm-sh/edosk7705.h [deleted file]
include/asm-sh/elf.h [deleted file]
include/asm-sh/emergency-restart.h [deleted file]
include/asm-sh/entry-macros.S [deleted file]
include/asm-sh/errno.h [deleted file]
include/asm-sh/fb.h [deleted file]
include/asm-sh/fcntl.h [deleted file]
include/asm-sh/fixmap.h [deleted file]
include/asm-sh/flat.h [deleted file]
include/asm-sh/fpu.h [deleted file]
include/asm-sh/freq.h [deleted file]
include/asm-sh/futex-irq.h [deleted file]
include/asm-sh/futex.h [deleted file]
include/asm-sh/gpio.h [deleted file]
include/asm-sh/hardirq.h [deleted file]
include/asm-sh/hd64461.h [deleted file]
include/asm-sh/hd64465/gpio.h [deleted file]
include/asm-sh/hd64465/hd64465.h [deleted file]
include/asm-sh/hd64465/io.h [deleted file]
include/asm-sh/heartbeat.h [deleted file]
include/asm-sh/hp6xx.h [deleted file]
include/asm-sh/hugetlb.h [deleted file]
include/asm-sh/hw_irq.h [deleted file]
include/asm-sh/i2c-sh7760.h [deleted file]
include/asm-sh/ilsel.h [deleted file]
include/asm-sh/io.h [deleted file]
include/asm-sh/io_generic.h [deleted file]
include/asm-sh/io_trapped.h [deleted file]
include/asm-sh/ioctl.h [deleted file]
include/asm-sh/ioctls.h [deleted file]
include/asm-sh/ipcbuf.h [deleted file]
include/asm-sh/irq.h [deleted file]
include/asm-sh/irq_regs.h [deleted file]
include/asm-sh/irqflags.h [deleted file]
include/asm-sh/irqflags_32.h [deleted file]
include/asm-sh/irqflags_64.h [deleted file]
include/asm-sh/kdebug.h [deleted file]
include/asm-sh/kexec.h [deleted file]
include/asm-sh/kgdb.h [deleted file]
include/asm-sh/kmap_types.h [deleted file]
include/asm-sh/landisk/gio.h [deleted file]
include/asm-sh/landisk/iodata_landisk.h [deleted file]
include/asm-sh/lboxre2.h [deleted file]
include/asm-sh/linkage.h [deleted file]
include/asm-sh/local.h [deleted file]
include/asm-sh/machvec.h [deleted file]
include/asm-sh/magicpanelr2.h [deleted file]
include/asm-sh/mc146818rtc.h [deleted file]
include/asm-sh/microdev.h [deleted file]
include/asm-sh/migor.h [deleted file]
include/asm-sh/mman.h [deleted file]
include/asm-sh/mmu.h [deleted file]
include/asm-sh/mmu_context.h [deleted file]
include/asm-sh/mmu_context_32.h [deleted file]
include/asm-sh/mmu_context_64.h [deleted file]
include/asm-sh/mmzone.h [deleted file]
include/asm-sh/module.h [deleted file]
include/asm-sh/msgbuf.h [deleted file]
include/asm-sh/mutex.h [deleted file]
include/asm-sh/page.h [deleted file]
include/asm-sh/param.h [deleted file]
include/asm-sh/parport.h [deleted file]
include/asm-sh/pci.h [deleted file]
include/asm-sh/percpu.h [deleted file]
include/asm-sh/pgalloc.h [deleted file]
include/asm-sh/pgtable.h [deleted file]
include/asm-sh/pgtable_32.h [deleted file]
include/asm-sh/pgtable_64.h [deleted file]
include/asm-sh/pm.h [deleted file]
include/asm-sh/poll.h [deleted file]
include/asm-sh/posix_types.h [deleted file]
include/asm-sh/posix_types_32.h [deleted file]
include/asm-sh/posix_types_64.h [deleted file]
include/asm-sh/processor.h [deleted file]
include/asm-sh/processor_32.h [deleted file]
include/asm-sh/processor_64.h [deleted file]
include/asm-sh/ptrace.h [deleted file]
include/asm-sh/push-switch.h [deleted file]
include/asm-sh/r7780rp.h [deleted file]
include/asm-sh/resource.h [deleted file]
include/asm-sh/rtc.h [deleted file]
include/asm-sh/rts7751r2d.h [deleted file]
include/asm-sh/rwsem.h [deleted file]
include/asm-sh/scatterlist.h [deleted file]
include/asm-sh/sdk7780.h [deleted file]
include/asm-sh/se.h [deleted file]
include/asm-sh/se7206.h [deleted file]
include/asm-sh/se7343.h [deleted file]
include/asm-sh/se7721.h [deleted file]
include/asm-sh/se7722.h [deleted file]
include/asm-sh/se7751.h [deleted file]
include/asm-sh/se7780.h [deleted file]
include/asm-sh/sections.h [deleted file]
include/asm-sh/segment.h [deleted file]
include/asm-sh/sembuf.h [deleted file]
include/asm-sh/serial.h [deleted file]
include/asm-sh/setup.h [deleted file]
include/asm-sh/sfp-machine.h [deleted file]
include/asm-sh/sh03/io.h [deleted file]
include/asm-sh/sh03/sh03.h [deleted file]
include/asm-sh/sh7760fb.h [deleted file]
include/asm-sh/sh7763rdp.h [deleted file]
include/asm-sh/sh7785lcr.h [deleted file]
include/asm-sh/sh_bios.h [deleted file]
include/asm-sh/sh_keysc.h [deleted file]
include/asm-sh/sh_mobile_lcdc.h [deleted file]
include/asm-sh/shmbuf.h [deleted file]
include/asm-sh/shmin.h [deleted file]
include/asm-sh/shmparam.h [deleted file]
include/asm-sh/sigcontext.h [deleted file]
include/asm-sh/siginfo.h [deleted file]
include/asm-sh/signal.h [deleted file]
include/asm-sh/smc37c93x.h [deleted file]
include/asm-sh/smp.h [deleted file]
include/asm-sh/snapgear.h [deleted file]
include/asm-sh/socket.h [deleted file]
include/asm-sh/sockios.h [deleted file]
include/asm-sh/sparsemem.h [deleted file]
include/asm-sh/spi.h [deleted file]
include/asm-sh/spinlock.h [deleted file]
include/asm-sh/spinlock_types.h [deleted file]
include/asm-sh/stat.h [deleted file]
include/asm-sh/statfs.h [deleted file]
include/asm-sh/string.h [deleted file]
include/asm-sh/string_32.h [deleted file]
include/asm-sh/string_64.h [deleted file]
include/asm-sh/system.h [deleted file]
include/asm-sh/system_32.h [deleted file]
include/asm-sh/system_64.h [deleted file]
include/asm-sh/systemh7751.h [deleted file]
include/asm-sh/termbits.h [deleted file]
include/asm-sh/termios.h [deleted file]
include/asm-sh/thread_info.h [deleted file]
include/asm-sh/timer.h [deleted file]
include/asm-sh/timex.h [deleted file]
include/asm-sh/titan.h [deleted file]
include/asm-sh/tlb.h [deleted file]
include/asm-sh/tlb_64.h [deleted file]
include/asm-sh/tlbflush.h [deleted file]
include/asm-sh/topology.h [deleted file]
include/asm-sh/types.h [deleted file]
include/asm-sh/uaccess.h [deleted file]
include/asm-sh/uaccess_32.h [deleted file]
include/asm-sh/uaccess_64.h [deleted file]
include/asm-sh/ubc.h [deleted file]
include/asm-sh/ucontext.h [deleted file]
include/asm-sh/unaligned.h [deleted file]
include/asm-sh/unistd.h [deleted file]
include/asm-sh/unistd_32.h [deleted file]
include/asm-sh/unistd_64.h [deleted file]
include/asm-sh/user.h [deleted file]
include/asm-sh/vga.h [deleted file]
include/asm-sh/watchdog.h [deleted file]
include/asm-sh/xor.h [deleted file]
include/asm-x86/iommu.h
include/asm-x86/kvm_host.h
include/linux/Kbuild
include/linux/blkdev.h
include/linux/configfs.h
include/linux/dcache.h
include/linux/file.h
include/linux/ihex.h
include/linux/iommu-helper.h
include/linux/ip_vs.h [new file with mode: 0644]
include/linux/kvm.h
include/linux/kvm_host.h
include/linux/libata.h
include/linux/mISDNif.h
include/linux/maple.h
include/linux/mount.h
include/linux/mtd/mtd.h
include/linux/mtd/nand.h
include/linux/netdevice.h
include/linux/netfilter/nf_conntrack_tcp.h
include/linux/parser.h
include/linux/power_supply.h
include/linux/quotaops.h
include/linux/raid/md_k.h
include/linux/regulator/bq24022.h [new file with mode: 0644]
include/linux/regulator/consumer.h [new file with mode: 0644]
include/linux/regulator/driver.h [new file with mode: 0644]
include/linux/regulator/fixed.h [new file with mode: 0644]
include/linux/regulator/machine.h [new file with mode: 0644]
include/linux/skbuff.h
include/linux/tracehook.h
include/linux/vt_kern.h
include/media/audiochip.h [deleted file]
include/net/ip_vs.h
include/scsi/scsi_device.h
include/sound/soc-dapm.h
init/Kconfig
init/calibrate.c
kernel/audit.c
kernel/auditfilter.c
kernel/auditsc.c
kernel/exit.c
kernel/kgdb.c
kernel/mutex.c
lib/Kconfig.kgdb
lib/iommu-helper.c
lib/random32.c
mm/hugetlb.c
mm/memory.c
mm/mlock.c
mm/truncate.c
net/atm/mpc.c
net/bridge/br_device.c
net/bridge/br_if.c
net/bridge/br_netfilter.c
net/bridge/br_private.h
net/core/dev.c
net/core/netpoll.c
net/core/pktgen.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_recent.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv6/ip6_output.c
net/ipv6/tcp_ipv6.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/xt_hashlimit.c
net/sched/sch_generic.c
net/sched/sch_teql.c
scripts/Makefile.fwinst
scripts/genksyms/genksyms.c
scripts/genksyms/lex.c_shipped
scripts/genksyms/lex.l
scripts/genksyms/parse.c_shipped
scripts/genksyms/parse.y
scripts/kconfig/lex.zconf.c_shipped
scripts/kconfig/zconf.l
scripts/ver_linux
security/selinux/hooks.c
sound/core/seq/oss/seq_oss_synth.c
sound/sh/aica.c
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_ssi.c
sound/soc/pxa/poodle.c
sound/soc/pxa/tosa.c
sound/soc/soc-dapm.c
virt/kvm/kvm_main.c

diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator
new file mode 100644 (file)
index 0000000..79a4a75
--- /dev/null
@@ -0,0 +1,315 @@
+What:          /sys/class/regulator/.../state
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               state. This holds the regulator output state.
+
+               This will be one of the following strings:
+
+               'enabled'
+               'disabled'
+               'unknown'
+
+               'enabled' means the regulator output is ON and is supplying
+               power to the system.
+
+               'disabled' means the regulator output is OFF and is not
+               supplying power to the system..
+
+               'unknown' means software cannot determine the state.
+
+               NOTE: this field can be used in conjunction with microvolts
+               and microamps to determine regulator output levels.
+
+
+What:          /sys/class/regulator/.../type
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               type. This holds the regulator type.
+
+               This will be one of the following strings:
+
+               'voltage'
+               'current'
+               'unknown'
+
+               'voltage' means the regulator output voltage can be controlled
+               by software.
+
+               'current' means the regulator output current limit can be
+               controlled by software.
+
+               'unknown' means software cannot control either voltage or
+               current limit.
+
+
+What:          /sys/class/regulator/.../microvolts
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               microvolts. This holds the regulator output voltage setting
+               measured in microvolts (i.e. E-6 Volts).
+
+               NOTE: This value should not be used to determine the regulator
+               output voltage level as this value is the same regardless of
+               whether the regulator is enabled or disabled.
+
+
+What:          /sys/class/regulator/.../microamps
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               microamps. This holds the regulator output current limit
+               setting measured in microamps (i.e. E-6 Amps).
+
+               NOTE: This value should not be used to determine the regulator
+               output current level as this value is the same regardless of
+               whether the regulator is enabled or disabled.
+
+
+What:          /sys/class/regulator/.../opmode
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               opmode. This holds the regulator operating mode setting.
+
+               The opmode value can be one of the following strings:
+
+               'fast'
+               'normal'
+               'idle'
+               'standby'
+               'unknown'
+
+               The modes are described in include/linux/regulator/regulator.h
+
+               NOTE: This value should not be used to determine the regulator
+               output operating mode as this value is the same regardless of
+               whether the regulator is enabled or disabled.
+
+
+What:          /sys/class/regulator/.../min_microvolts
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               min_microvolts. This holds the minimum safe working regulator
+               output voltage setting for this domain measured in microvolts.
+
+               NOTE: this will return the string 'constraint not defined' if
+               the power domain has no min microvolts constraint defined by
+               platform code.
+
+
+What:          /sys/class/regulator/.../max_microvolts
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               max_microvolts. This holds the maximum safe working regulator
+               output voltage setting for this domain measured in microvolts.
+
+               NOTE: this will return the string 'constraint not defined' if
+               the power domain has no max microvolts constraint defined by
+               platform code.
+
+
+What:          /sys/class/regulator/.../min_microamps
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               min_microamps. This holds the minimum safe working regulator
+               output current limit setting for this domain measured in
+               microamps.
+
+               NOTE: this will return the string 'constraint not defined' if
+               the power domain has no min microamps constraint defined by
+               platform code.
+
+
+What:          /sys/class/regulator/.../max_microamps
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               max_microamps. This holds the maximum safe working regulator
+               output current limit setting for this domain measured in
+               microamps.
+
+               NOTE: this will return the string 'constraint not defined' if
+               the power domain has no max microamps constraint defined by
+               platform code.
+
+
+What:          /sys/class/regulator/.../num_users
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               num_users. This holds the number of consumer devices that
+               have called regulator_enable() on this regulator.
+
+
+What:          /sys/class/regulator/.../requested_microamps
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               requested_microamps. This holds the total requested load
+               current in microamps for this regulator from all its consumer
+               devices.
+
+
+What:          /sys/class/regulator/.../parent
+Date:          April 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Some regulator directories will contain a link called parent.
+               This points to the parent or supply regulator if one exists.
+
+What:          /sys/class/regulator/.../suspend_mem_microvolts
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_mem_microvolts. This holds the regulator output
+               voltage setting for this domain measured in microvolts when
+               the system is suspended to memory.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to memory voltage defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_disk_microvolts
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_disk_microvolts. This holds the regulator output
+               voltage setting for this domain measured in microvolts when
+               the system is suspended to disk.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to disk voltage defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_standby_microvolts
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_standby_microvolts. This holds the regulator output
+               voltage setting for this domain measured in microvolts when
+               the system is suspended to standby.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to standby voltage defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_mem_mode
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_mem_mode. This holds the regulator operating mode
+               setting for this domain when the system is suspended to
+               memory.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to memory mode defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_disk_mode
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_disk_mode. This holds the regulator operating mode
+               setting for this domain when the system is suspended to disk.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to disk mode defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_standby_mode
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_standby_mode. This holds the regulator operating mode
+               setting for this domain when the system is suspended to
+               standby.
+
+               NOTE: this will return the string 'not defined' if
+               the power domain has no suspend to standby mode defined by
+               platform code.
+
+What:          /sys/class/regulator/.../suspend_mem_state
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_mem_state. This holds the regulator operating state
+               when suspended to memory.
+
+               This will be one of the following strings:
+
+               'enabled'
+               'disabled'
+               'not defined'
+
+What:          /sys/class/regulator/.../suspend_disk_state
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_disk_state. This holds the regulator operating state
+               when suspended to disk.
+
+               This will be one of the following strings:
+
+               'enabled'
+               'disabled'
+               'not defined'
+
+What:          /sys/class/regulator/.../suspend_standby_state
+Date:          May 2008
+KernelVersion: 2.6.26
+Contact:       Liam Girdwood <lg@opensource.wolfsonmicro.com>
+Description:
+               Each regulator directory will contain a field called
+               suspend_standby_state. This holds the regulator operating
+               state when suspended to standby.
+
+               This will be one of the following strings:
+
+               'enabled'
+               'disabled'
+               'not defined'
index e8acd1f034567b217f9e9998f5bc05b4c24e276e..372dec20c8dab6db05fbbcd9e3cdef93f1e783a5 100644 (file)
     "Kernel debugging" select "KGDB: kernel debugging with remote gdb".
     </para>
     <para>
+    It is advised, but not required that you turn on the
+    CONFIG_FRAME_POINTER kernel option.  This option inserts code to
+    into the compiled executable which saves the frame information in
+    registers or on the stack at different points which will allow a
+    debugger such as gdb to more accurately construct stack back traces
+    while debugging the kernel.
+    </para>
+    <para>
+    If the architecture that you are using supports the kernel option
+    CONFIG_DEBUG_RODATA, you should consider turning it off.  This
+    option will prevent the use of software breakpoints because it
+    marks certain regions of the kernel's memory space as read-only.
+    If kgdb supports it for the architecture you are using, you can
+    use hardware breakpoints if you desire to run with the
+    CONFIG_DEBUG_RODATA option turned on, else you need to turn off
+    this option.
+    </para>
+    <para>
     Next you should choose one of more I/O drivers to interconnect debugging
     host and debugged target.  Early boot debugging requires a KGDB
     I/O driver that supports early debugging and the driver must be
index 44c97e6accb2655faed63b52e4bc63848571a7ab..fabcb0e00f25d4288c31382699c844d5f3820939 100644 (file)
@@ -311,9 +311,20 @@ the subsystem must be ready for it.
 [An Example]
 
 The best example of these basic concepts is the simple_children
-subsystem/group and the simple_child item in configfs_example.c  It
-shows a trivial object displaying and storing an attribute, and a simple
-group creating and destroying these children.
+subsystem/group and the simple_child item in configfs_example_explicit.c
+and configfs_example_macros.c.  It shows a trivial object displaying and
+storing an attribute, and a simple group creating and destroying these
+children.
+
+The only difference between configfs_example_explicit.c and
+configfs_example_macros.c is how the attributes of the childless item
+are defined.  The childless item has extended attributes, each with
+their own show()/store() operation.  This follows a convention commonly
+used in sysfs.  configfs_example_explicit.c creates these attributes
+by explicitly defining the structures involved.  Conversely
+configfs_example_macros.c uses some convenience macros from configfs.h
+to define the attributes.  These macros are similar to their sysfs
+counterparts.
 
 [Hierarchy Navigation and the Subsystem Mutex]
 
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c
deleted file mode 100644 (file)
index 0396487..0000000
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * vim: noexpandtab ts=8 sts=0 sw=8:
- *
- * configfs_example.c - This file is a demonstration module containing
- *      a number of configfs subsystems.
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- *
- * Based on sysfs:
- *     sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
- *
- * configfs Copyright (C) 2005 Oracle.  All rights reserved.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-
-#include <linux/configfs.h>
-
-
-
-/*
- * 01-childless
- *
- * This first example is a childless subsystem.  It cannot create
- * any config_items.  It just has attributes.
- *
- * Note that we are enclosing the configfs_subsystem inside a container.
- * This is not necessary if a subsystem has no attributes directly
- * on the subsystem.  See the next example, 02-simple-children, for
- * such a subsystem.
- */
-
-struct childless {
-       struct configfs_subsystem subsys;
-       int showme;
-       int storeme;
-};
-
-struct childless_attribute {
-       struct configfs_attribute attr;
-       ssize_t (*show)(struct childless *, char *);
-       ssize_t (*store)(struct childless *, const char *, size_t);
-};
-
-static inline struct childless *to_childless(struct config_item *item)
-{
-       return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL;
-}
-
-static ssize_t childless_showme_read(struct childless *childless,
-                                    char *page)
-{
-       ssize_t pos;
-
-       pos = sprintf(page, "%d\n", childless->showme);
-       childless->showme++;
-
-       return pos;
-}
-
-static ssize_t childless_storeme_read(struct childless *childless,
-                                     char *page)
-{
-       return sprintf(page, "%d\n", childless->storeme);
-}
-
-static ssize_t childless_storeme_write(struct childless *childless,
-                                      const char *page,
-                                      size_t count)
-{
-       unsigned long tmp;
-       char *p = (char *) page;
-
-       tmp = simple_strtoul(p, &p, 10);
-       if (!p || (*p && (*p != '\n')))
-               return -EINVAL;
-
-       if (tmp > INT_MAX)
-               return -ERANGE;
-
-       childless->storeme = tmp;
-
-       return count;
-}
-
-static ssize_t childless_description_read(struct childless *childless,
-                                         char *page)
-{
-       return sprintf(page,
-"[01-childless]\n"
-"\n"
-"The childless subsystem is the simplest possible subsystem in\n"
-"configfs.  It does not support the creation of child config_items.\n"
-"It only has a few attributes.  In fact, it isn't much different\n"
-"than a directory in /proc.\n");
-}
-
-static struct childless_attribute childless_attr_showme = {
-       .attr   = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
-       .show   = childless_showme_read,
-};
-static struct childless_attribute childless_attr_storeme = {
-       .attr   = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
-       .show   = childless_storeme_read,
-       .store  = childless_storeme_write,
-};
-static struct childless_attribute childless_attr_description = {
-       .attr = { .ca_owner = THIS_MODULE, .ca_name = "description", .ca_mode = S_IRUGO },
-       .show = childless_description_read,
-};
-
-static struct configfs_attribute *childless_attrs[] = {
-       &childless_attr_showme.attr,
-       &childless_attr_storeme.attr,
-       &childless_attr_description.attr,
-       NULL,
-};
-
-static ssize_t childless_attr_show(struct config_item *item,
-                                  struct configfs_attribute *attr,
-                                  char *page)
-{
-       struct childless *childless = to_childless(item);
-       struct childless_attribute *childless_attr =
-               container_of(attr, struct childless_attribute, attr);
-       ssize_t ret = 0;
-
-       if (childless_attr->show)
-               ret = childless_attr->show(childless, page);
-       return ret;
-}
-
-static ssize_t childless_attr_store(struct config_item *item,
-                                   struct configfs_attribute *attr,
-                                   const char *page, size_t count)
-{
-       struct childless *childless = to_childless(item);
-       struct childless_attribute *childless_attr =
-               container_of(attr, struct childless_attribute, attr);
-       ssize_t ret = -EINVAL;
-
-       if (childless_attr->store)
-               ret = childless_attr->store(childless, page, count);
-       return ret;
-}
-
-static struct configfs_item_operations childless_item_ops = {
-       .show_attribute         = childless_attr_show,
-       .store_attribute        = childless_attr_store,
-};
-
-static struct config_item_type childless_type = {
-       .ct_item_ops    = &childless_item_ops,
-       .ct_attrs       = childless_attrs,
-       .ct_owner       = THIS_MODULE,
-};
-
-static struct childless childless_subsys = {
-       .subsys = {
-               .su_group = {
-                       .cg_item = {
-                               .ci_namebuf = "01-childless",
-                               .ci_type = &childless_type,
-                       },
-               },
-       },
-};
-
-
-/* ----------------------------------------------------------------- */
-
-/*
- * 02-simple-children
- *
- * This example merely has a simple one-attribute child.  Note that
- * there is no extra attribute structure, as the child's attribute is
- * known from the get-go.  Also, there is no container for the
- * subsystem, as it has no attributes of its own.
- */
-
-struct simple_child {
-       struct config_item item;
-       int storeme;
-};
-
-static inline struct simple_child *to_simple_child(struct config_item *item)
-{
-       return item ? container_of(item, struct simple_child, item) : NULL;
-}
-
-static struct configfs_attribute simple_child_attr_storeme = {
-       .ca_owner = THIS_MODULE,
-       .ca_name = "storeme",
-       .ca_mode = S_IRUGO | S_IWUSR,
-};
-
-static struct configfs_attribute *simple_child_attrs[] = {
-       &simple_child_attr_storeme,
-       NULL,
-};
-
-static ssize_t simple_child_attr_show(struct config_item *item,
-                                     struct configfs_attribute *attr,
-                                     char *page)
-{
-       ssize_t count;
-       struct simple_child *simple_child = to_simple_child(item);
-
-       count = sprintf(page, "%d\n", simple_child->storeme);
-
-       return count;
-}
-
-static ssize_t simple_child_attr_store(struct config_item *item,
-                                      struct configfs_attribute *attr,
-                                      const char *page, size_t count)
-{
-       struct simple_child *simple_child = to_simple_child(item);
-       unsigned long tmp;
-       char *p = (char *) page;
-
-       tmp = simple_strtoul(p, &p, 10);
-       if (!p || (*p && (*p != '\n')))
-               return -EINVAL;
-
-       if (tmp > INT_MAX)
-               return -ERANGE;
-
-       simple_child->storeme = tmp;
-
-       return count;
-}
-
-static void simple_child_release(struct config_item *item)
-{
-       kfree(to_simple_child(item));
-}
-
-static struct configfs_item_operations simple_child_item_ops = {
-       .release                = simple_child_release,
-       .show_attribute         = simple_child_attr_show,
-       .store_attribute        = simple_child_attr_store,
-};
-
-static struct config_item_type simple_child_type = {
-       .ct_item_ops    = &simple_child_item_ops,
-       .ct_attrs       = simple_child_attrs,
-       .ct_owner       = THIS_MODULE,
-};
-
-
-struct simple_children {
-       struct config_group group;
-};
-
-static inline struct simple_children *to_simple_children(struct config_item *item)
-{
-       return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
-}
-
-static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
-{
-       struct simple_child *simple_child;
-
-       simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
-       if (!simple_child)
-               return ERR_PTR(-ENOMEM);
-
-
-       config_item_init_type_name(&simple_child->item, name,
-                                  &simple_child_type);
-
-       simple_child->storeme = 0;
-
-       return &simple_child->item;
-}
-
-static struct configfs_attribute simple_children_attr_description = {
-       .ca_owner = THIS_MODULE,
-       .ca_name = "description",
-       .ca_mode = S_IRUGO,
-};
-
-static struct configfs_attribute *simple_children_attrs[] = {
-       &simple_children_attr_description,
-       NULL,
-};
-
-static ssize_t simple_children_attr_show(struct config_item *item,
-                                        struct configfs_attribute *attr,
-                                        char *page)
-{
-       return sprintf(page,
-"[02-simple-children]\n"
-"\n"
-"This subsystem allows the creation of child config_items.  These\n"
-"items have only one attribute that is readable and writeable.\n");
-}
-
-static void simple_children_release(struct config_item *item)
-{
-       kfree(to_simple_children(item));
-}
-
-static struct configfs_item_operations simple_children_item_ops = {
-       .release        = simple_children_release,
-       .show_attribute = simple_children_attr_show,
-};
-
-/*
- * Note that, since no extra work is required on ->drop_item(),
- * no ->drop_item() is provided.
- */
-static struct configfs_group_operations simple_children_group_ops = {
-       .make_item      = simple_children_make_item,
-};
-
-static struct config_item_type simple_children_type = {
-       .ct_item_ops    = &simple_children_item_ops,
-       .ct_group_ops   = &simple_children_group_ops,
-       .ct_attrs       = simple_children_attrs,
-       .ct_owner       = THIS_MODULE,
-};
-
-static struct configfs_subsystem simple_children_subsys = {
-       .su_group = {
-               .cg_item = {
-                       .ci_namebuf = "02-simple-children",
-                       .ci_type = &simple_children_type,
-               },
-       },
-};
-
-
-/* ----------------------------------------------------------------- */
-
-/*
- * 03-group-children
- *
- * This example reuses the simple_children group from above.  However,
- * the simple_children group is not the subsystem itself, it is a
- * child of the subsystem.  Creation of a group in the subsystem creates
- * a new simple_children group.  That group can then have simple_child
- * children of its own.
- */
-
-static struct config_group *group_children_make_group(struct config_group *group, const char *name)
-{
-       struct simple_children *simple_children;
-
-       simple_children = kzalloc(sizeof(struct simple_children),
-                                 GFP_KERNEL);
-       if (!simple_children)
-               return ERR_PTR(-ENOMEM);
-
-
-       config_group_init_type_name(&simple_children->group, name,
-                                   &simple_children_type);
-
-       return &simple_children->group;
-}
-
-static struct configfs_attribute group_children_attr_description = {
-       .ca_owner = THIS_MODULE,
-       .ca_name = "description",
-       .ca_mode = S_IRUGO,
-};
-
-static struct configfs_attribute *group_children_attrs[] = {
-       &group_children_attr_description,
-       NULL,
-};
-
-static ssize_t group_children_attr_show(struct config_item *item,
-                                       struct configfs_attribute *attr,
-                                       char *page)
-{
-       return sprintf(page,
-"[03-group-children]\n"
-"\n"
-"This subsystem allows the creation of child config_groups.  These\n"
-"groups are like the subsystem simple-children.\n");
-}
-
-static struct configfs_item_operations group_children_item_ops = {
-       .show_attribute = group_children_attr_show,
-};
-
-/*
- * Note that, since no extra work is required on ->drop_item(),
- * no ->drop_item() is provided.
- */
-static struct configfs_group_operations group_children_group_ops = {
-       .make_group     = group_children_make_group,
-};
-
-static struct config_item_type group_children_type = {
-       .ct_item_ops    = &group_children_item_ops,
-       .ct_group_ops   = &group_children_group_ops,
-       .ct_attrs       = group_children_attrs,
-       .ct_owner       = THIS_MODULE,
-};
-
-static struct configfs_subsystem group_children_subsys = {
-       .su_group = {
-               .cg_item = {
-                       .ci_namebuf = "03-group-children",
-                       .ci_type = &group_children_type,
-               },
-       },
-};
-
-/* ----------------------------------------------------------------- */
-
-/*
- * We're now done with our subsystem definitions.
- * For convenience in this module, here's a list of them all.  It
- * allows the init function to easily register them.  Most modules
- * will only have one subsystem, and will only call register_subsystem
- * on it directly.
- */
-static struct configfs_subsystem *example_subsys[] = {
-       &childless_subsys.subsys,
-       &simple_children_subsys,
-       &group_children_subsys,
-       NULL,
-};
-
-static int __init configfs_example_init(void)
-{
-       int ret;
-       int i;
-       struct configfs_subsystem *subsys;
-
-       for (i = 0; example_subsys[i]; i++) {
-               subsys = example_subsys[i];
-
-               config_group_init(&subsys->su_group);
-               mutex_init(&subsys->su_mutex);
-               ret = configfs_register_subsystem(subsys);
-               if (ret) {
-                       printk(KERN_ERR "Error %d while registering subsystem %s\n",
-                              ret,
-                              subsys->su_group.cg_item.ci_namebuf);
-                       goto out_unregister;
-               }
-       }
-
-       return 0;
-
-out_unregister:
-       for (; i >= 0; i--) {
-               configfs_unregister_subsystem(example_subsys[i]);
-       }
-
-       return ret;
-}
-
-static void __exit configfs_example_exit(void)
-{
-       int i;
-
-       for (i = 0; example_subsys[i]; i++) {
-               configfs_unregister_subsystem(example_subsys[i]);
-       }
-}
-
-module_init(configfs_example_init);
-module_exit(configfs_example_exit);
-MODULE_LICENSE("GPL");
diff --git a/Documentation/filesystems/configfs/configfs_example_explicit.c b/Documentation/filesystems/configfs/configfs_example_explicit.c
new file mode 100644 (file)
index 0000000..d428cc9
--- /dev/null
@@ -0,0 +1,485 @@
+/*
+ * vim: noexpandtab ts=8 sts=0 sw=8:
+ *
+ * configfs_example_explicit.c - This file is a demonstration module
+ *      containing a number of configfs subsystems.  It explicitly defines
+ *      each structure without using the helper macros defined in
+ *      configfs.h.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ * Based on sysfs:
+ *     sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
+ *
+ * configfs Copyright (C) 2005 Oracle.  All rights reserved.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+
+#include <linux/configfs.h>
+
+
+
+/*
+ * 01-childless
+ *
+ * This first example is a childless subsystem.  It cannot create
+ * any config_items.  It just has attributes.
+ *
+ * Note that we are enclosing the configfs_subsystem inside a container.
+ * This is not necessary if a subsystem has no attributes directly
+ * on the subsystem.  See the next example, 02-simple-children, for
+ * such a subsystem.
+ */
+
+struct childless {
+       struct configfs_subsystem subsys;
+       int showme;
+       int storeme;
+};
+
+struct childless_attribute {
+       struct configfs_attribute attr;
+       ssize_t (*show)(struct childless *, char *);
+       ssize_t (*store)(struct childless *, const char *, size_t);
+};
+
+static inline struct childless *to_childless(struct config_item *item)
+{
+       return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL;
+}
+
+static ssize_t childless_showme_read(struct childless *childless,
+                                    char *page)
+{
+       ssize_t pos;
+
+       pos = sprintf(page, "%d\n", childless->showme);
+       childless->showme++;
+
+       return pos;
+}
+
+static ssize_t childless_storeme_read(struct childless *childless,
+                                     char *page)
+{
+       return sprintf(page, "%d\n", childless->storeme);
+}
+
+static ssize_t childless_storeme_write(struct childless *childless,
+                                      const char *page,
+                                      size_t count)
+{
+       unsigned long tmp;
+       char *p = (char *) page;
+
+       tmp = simple_strtoul(p, &p, 10);
+       if (!p || (*p && (*p != '\n')))
+               return -EINVAL;
+
+       if (tmp > INT_MAX)
+               return -ERANGE;
+
+       childless->storeme = tmp;
+
+       return count;
+}
+
+static ssize_t childless_description_read(struct childless *childless,
+                                         char *page)
+{
+       return sprintf(page,
+"[01-childless]\n"
+"\n"
+"The childless subsystem is the simplest possible subsystem in\n"
+"configfs.  It does not support the creation of child config_items.\n"
+"It only has a few attributes.  In fact, it isn't much different\n"
+"than a directory in /proc.\n");
+}
+
+static struct childless_attribute childless_attr_showme = {
+       .attr   = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
+       .show   = childless_showme_read,
+};
+static struct childless_attribute childless_attr_storeme = {
+       .attr   = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
+       .show   = childless_storeme_read,
+       .store  = childless_storeme_write,
+};
+static struct childless_attribute childless_attr_description = {
+       .attr = { .ca_owner = THIS_MODULE, .ca_name = "description", .ca_mode = S_IRUGO },
+       .show = childless_description_read,
+};
+
+static struct configfs_attribute *childless_attrs[] = {
+       &childless_attr_showme.attr,
+       &childless_attr_storeme.attr,
+       &childless_attr_description.attr,
+       NULL,
+};
+
+static ssize_t childless_attr_show(struct config_item *item,
+                                  struct configfs_attribute *attr,
+                                  char *page)
+{
+       struct childless *childless = to_childless(item);
+       struct childless_attribute *childless_attr =
+               container_of(attr, struct childless_attribute, attr);
+       ssize_t ret = 0;
+
+       if (childless_attr->show)
+               ret = childless_attr->show(childless, page);
+       return ret;
+}
+
+static ssize_t childless_attr_store(struct config_item *item,
+                                   struct configfs_attribute *attr,
+                                   const char *page, size_t count)
+{
+       struct childless *childless = to_childless(item);
+       struct childless_attribute *childless_attr =
+               container_of(attr, struct childless_attribute, attr);
+       ssize_t ret = -EINVAL;
+
+       if (childless_attr->store)
+               ret = childless_attr->store(childless, page, count);
+       return ret;
+}
+
+static struct configfs_item_operations childless_item_ops = {
+       .show_attribute         = childless_attr_show,
+       .store_attribute        = childless_attr_store,
+};
+
+static struct config_item_type childless_type = {
+       .ct_item_ops    = &childless_item_ops,
+       .ct_attrs       = childless_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct childless childless_subsys = {
+       .subsys = {
+               .su_group = {
+                       .cg_item = {
+                               .ci_namebuf = "01-childless",
+                               .ci_type = &childless_type,
+                       },
+               },
+       },
+};
+
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * 02-simple-children
+ *
+ * This example merely has a simple one-attribute child.  Note that
+ * there is no extra attribute structure, as the child's attribute is
+ * known from the get-go.  Also, there is no container for the
+ * subsystem, as it has no attributes of its own.
+ */
+
+struct simple_child {
+       struct config_item item;
+       int storeme;
+};
+
+static inline struct simple_child *to_simple_child(struct config_item *item)
+{
+       return item ? container_of(item, struct simple_child, item) : NULL;
+}
+
+static struct configfs_attribute simple_child_attr_storeme = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "storeme",
+       .ca_mode = S_IRUGO | S_IWUSR,
+};
+
+static struct configfs_attribute *simple_child_attrs[] = {
+       &simple_child_attr_storeme,
+       NULL,
+};
+
+static ssize_t simple_child_attr_show(struct config_item *item,
+                                     struct configfs_attribute *attr,
+                                     char *page)
+{
+       ssize_t count;
+       struct simple_child *simple_child = to_simple_child(item);
+
+       count = sprintf(page, "%d\n", simple_child->storeme);
+
+       return count;
+}
+
+static ssize_t simple_child_attr_store(struct config_item *item,
+                                      struct configfs_attribute *attr,
+                                      const char *page, size_t count)
+{
+       struct simple_child *simple_child = to_simple_child(item);
+       unsigned long tmp;
+       char *p = (char *) page;
+
+       tmp = simple_strtoul(p, &p, 10);
+       if (!p || (*p && (*p != '\n')))
+               return -EINVAL;
+
+       if (tmp > INT_MAX)
+               return -ERANGE;
+
+       simple_child->storeme = tmp;
+
+       return count;
+}
+
+static void simple_child_release(struct config_item *item)
+{
+       kfree(to_simple_child(item));
+}
+
+static struct configfs_item_operations simple_child_item_ops = {
+       .release                = simple_child_release,
+       .show_attribute         = simple_child_attr_show,
+       .store_attribute        = simple_child_attr_store,
+};
+
+static struct config_item_type simple_child_type = {
+       .ct_item_ops    = &simple_child_item_ops,
+       .ct_attrs       = simple_child_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+
+struct simple_children {
+       struct config_group group;
+};
+
+static inline struct simple_children *to_simple_children(struct config_item *item)
+{
+       return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
+}
+
+static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
+{
+       struct simple_child *simple_child;
+
+       simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
+       if (!simple_child)
+               return ERR_PTR(-ENOMEM);
+
+       config_item_init_type_name(&simple_child->item, name,
+                                  &simple_child_type);
+
+       simple_child->storeme = 0;
+
+       return &simple_child->item;
+}
+
+static struct configfs_attribute simple_children_attr_description = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "description",
+       .ca_mode = S_IRUGO,
+};
+
+static struct configfs_attribute *simple_children_attrs[] = {
+       &simple_children_attr_description,
+       NULL,
+};
+
+static ssize_t simple_children_attr_show(struct config_item *item,
+                                        struct configfs_attribute *attr,
+                                        char *page)
+{
+       return sprintf(page,
+"[02-simple-children]\n"
+"\n"
+"This subsystem allows the creation of child config_items.  These\n"
+"items have only one attribute that is readable and writeable.\n");
+}
+
+static void simple_children_release(struct config_item *item)
+{
+       kfree(to_simple_children(item));
+}
+
+static struct configfs_item_operations simple_children_item_ops = {
+       .release        = simple_children_release,
+       .show_attribute = simple_children_attr_show,
+};
+
+/*
+ * Note that, since no extra work is required on ->drop_item(),
+ * no ->drop_item() is provided.
+ */
+static struct configfs_group_operations simple_children_group_ops = {
+       .make_item      = simple_children_make_item,
+};
+
+static struct config_item_type simple_children_type = {
+       .ct_item_ops    = &simple_children_item_ops,
+       .ct_group_ops   = &simple_children_group_ops,
+       .ct_attrs       = simple_children_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct configfs_subsystem simple_children_subsys = {
+       .su_group = {
+               .cg_item = {
+                       .ci_namebuf = "02-simple-children",
+                       .ci_type = &simple_children_type,
+               },
+       },
+};
+
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * 03-group-children
+ *
+ * This example reuses the simple_children group from above.  However,
+ * the simple_children group is not the subsystem itself, it is a
+ * child of the subsystem.  Creation of a group in the subsystem creates
+ * a new simple_children group.  That group can then have simple_child
+ * children of its own.
+ */
+
+static struct config_group *group_children_make_group(struct config_group *group, const char *name)
+{
+       struct simple_children *simple_children;
+
+       simple_children = kzalloc(sizeof(struct simple_children),
+                                 GFP_KERNEL);
+       if (!simple_children)
+               return ERR_PTR(-ENOMEM);
+
+       config_group_init_type_name(&simple_children->group, name,
+                                   &simple_children_type);
+
+       return &simple_children->group;
+}
+
+static struct configfs_attribute group_children_attr_description = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "description",
+       .ca_mode = S_IRUGO,
+};
+
+static struct configfs_attribute *group_children_attrs[] = {
+       &group_children_attr_description,
+       NULL,
+};
+
+static ssize_t group_children_attr_show(struct config_item *item,
+                                       struct configfs_attribute *attr,
+                                       char *page)
+{
+       return sprintf(page,
+"[03-group-children]\n"
+"\n"
+"This subsystem allows the creation of child config_groups.  These\n"
+"groups are like the subsystem simple-children.\n");
+}
+
+static struct configfs_item_operations group_children_item_ops = {
+       .show_attribute = group_children_attr_show,
+};
+
+/*
+ * Note that, since no extra work is required on ->drop_item(),
+ * no ->drop_item() is provided.
+ */
+static struct configfs_group_operations group_children_group_ops = {
+       .make_group     = group_children_make_group,
+};
+
+static struct config_item_type group_children_type = {
+       .ct_item_ops    = &group_children_item_ops,
+       .ct_group_ops   = &group_children_group_ops,
+       .ct_attrs       = group_children_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct configfs_subsystem group_children_subsys = {
+       .su_group = {
+               .cg_item = {
+                       .ci_namebuf = "03-group-children",
+                       .ci_type = &group_children_type,
+               },
+       },
+};
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * We're now done with our subsystem definitions.
+ * For convenience in this module, here's a list of them all.  It
+ * allows the init function to easily register them.  Most modules
+ * will only have one subsystem, and will only call register_subsystem
+ * on it directly.
+ */
+static struct configfs_subsystem *example_subsys[] = {
+       &childless_subsys.subsys,
+       &simple_children_subsys,
+       &group_children_subsys,
+       NULL,
+};
+
+static int __init configfs_example_init(void)
+{
+       int ret;
+       int i;
+       struct configfs_subsystem *subsys;
+
+       for (i = 0; example_subsys[i]; i++) {
+               subsys = example_subsys[i];
+
+               config_group_init(&subsys->su_group);
+               mutex_init(&subsys->su_mutex);
+               ret = configfs_register_subsystem(subsys);
+               if (ret) {
+                       printk(KERN_ERR "Error %d while registering subsystem %s\n",
+                              ret,
+                              subsys->su_group.cg_item.ci_namebuf);
+                       goto out_unregister;
+               }
+       }
+
+       return 0;
+
+out_unregister:
+       for (; i >= 0; i--) {
+               configfs_unregister_subsystem(example_subsys[i]);
+       }
+
+       return ret;
+}
+
+static void __exit configfs_example_exit(void)
+{
+       int i;
+
+       for (i = 0; example_subsys[i]; i++) {
+               configfs_unregister_subsystem(example_subsys[i]);
+       }
+}
+
+module_init(configfs_example_init);
+module_exit(configfs_example_exit);
+MODULE_LICENSE("GPL");
diff --git a/Documentation/filesystems/configfs/configfs_example_macros.c b/Documentation/filesystems/configfs/configfs_example_macros.c
new file mode 100644 (file)
index 0000000..d8e30a0
--- /dev/null
@@ -0,0 +1,448 @@
+/*
+ * vim: noexpandtab ts=8 sts=0 sw=8:
+ *
+ * configfs_example_macros.c - This file is a demonstration module
+ *      containing a number of configfs subsystems.  It uses the helper
+ *      macros defined by configfs.h
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ * Based on sysfs:
+ *     sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
+ *
+ * configfs Copyright (C) 2005 Oracle.  All rights reserved.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+
+#include <linux/configfs.h>
+
+
+
+/*
+ * 01-childless
+ *
+ * This first example is a childless subsystem.  It cannot create
+ * any config_items.  It just has attributes.
+ *
+ * Note that we are enclosing the configfs_subsystem inside a container.
+ * This is not necessary if a subsystem has no attributes directly
+ * on the subsystem.  See the next example, 02-simple-children, for
+ * such a subsystem.
+ */
+
+struct childless {
+       struct configfs_subsystem subsys;
+       int showme;
+       int storeme;
+};
+
+static inline struct childless *to_childless(struct config_item *item)
+{
+       return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL;
+}
+
+CONFIGFS_ATTR_STRUCT(childless);
+#define CHILDLESS_ATTR(_name, _mode, _show, _store)    \
+struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store)
+#define CHILDLESS_ATTR_RO(_name, _show)        \
+struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show);
+
+static ssize_t childless_showme_read(struct childless *childless,
+                                    char *page)
+{
+       ssize_t pos;
+
+       pos = sprintf(page, "%d\n", childless->showme);
+       childless->showme++;
+
+       return pos;
+}
+
+static ssize_t childless_storeme_read(struct childless *childless,
+                                     char *page)
+{
+       return sprintf(page, "%d\n", childless->storeme);
+}
+
+static ssize_t childless_storeme_write(struct childless *childless,
+                                      const char *page,
+                                      size_t count)
+{
+       unsigned long tmp;
+       char *p = (char *) page;
+
+       tmp = simple_strtoul(p, &p, 10);
+       if (!p || (*p && (*p != '\n')))
+               return -EINVAL;
+
+       if (tmp > INT_MAX)
+               return -ERANGE;
+
+       childless->storeme = tmp;
+
+       return count;
+}
+
+static ssize_t childless_description_read(struct childless *childless,
+                                         char *page)
+{
+       return sprintf(page,
+"[01-childless]\n"
+"\n"
+"The childless subsystem is the simplest possible subsystem in\n"
+"configfs.  It does not support the creation of child config_items.\n"
+"It only has a few attributes.  In fact, it isn't much different\n"
+"than a directory in /proc.\n");
+}
+
+CHILDLESS_ATTR_RO(showme, childless_showme_read);
+CHILDLESS_ATTR(storeme, S_IRUGO | S_IWUSR, childless_storeme_read,
+              childless_storeme_write);
+CHILDLESS_ATTR_RO(description, childless_description_read);
+
+static struct configfs_attribute *childless_attrs[] = {
+       &childless_attr_showme.attr,
+       &childless_attr_storeme.attr,
+       &childless_attr_description.attr,
+       NULL,
+};
+
+CONFIGFS_ATTR_OPS(childless);
+static struct configfs_item_operations childless_item_ops = {
+       .show_attribute         = childless_attr_show,
+       .store_attribute        = childless_attr_store,
+};
+
+static struct config_item_type childless_type = {
+       .ct_item_ops    = &childless_item_ops,
+       .ct_attrs       = childless_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct childless childless_subsys = {
+       .subsys = {
+               .su_group = {
+                       .cg_item = {
+                               .ci_namebuf = "01-childless",
+                               .ci_type = &childless_type,
+                       },
+               },
+       },
+};
+
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * 02-simple-children
+ *
+ * This example merely has a simple one-attribute child.  Note that
+ * there is no extra attribute structure, as the child's attribute is
+ * known from the get-go.  Also, there is no container for the
+ * subsystem, as it has no attributes of its own.
+ */
+
+struct simple_child {
+       struct config_item item;
+       int storeme;
+};
+
+static inline struct simple_child *to_simple_child(struct config_item *item)
+{
+       return item ? container_of(item, struct simple_child, item) : NULL;
+}
+
+static struct configfs_attribute simple_child_attr_storeme = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "storeme",
+       .ca_mode = S_IRUGO | S_IWUSR,
+};
+
+static struct configfs_attribute *simple_child_attrs[] = {
+       &simple_child_attr_storeme,
+       NULL,
+};
+
+static ssize_t simple_child_attr_show(struct config_item *item,
+                                     struct configfs_attribute *attr,
+                                     char *page)
+{
+       ssize_t count;
+       struct simple_child *simple_child = to_simple_child(item);
+
+       count = sprintf(page, "%d\n", simple_child->storeme);
+
+       return count;
+}
+
+static ssize_t simple_child_attr_store(struct config_item *item,
+                                      struct configfs_attribute *attr,
+                                      const char *page, size_t count)
+{
+       struct simple_child *simple_child = to_simple_child(item);
+       unsigned long tmp;
+       char *p = (char *) page;
+
+       tmp = simple_strtoul(p, &p, 10);
+       if (!p || (*p && (*p != '\n')))
+               return -EINVAL;
+
+       if (tmp > INT_MAX)
+               return -ERANGE;
+
+       simple_child->storeme = tmp;
+
+       return count;
+}
+
+static void simple_child_release(struct config_item *item)
+{
+       kfree(to_simple_child(item));
+}
+
+static struct configfs_item_operations simple_child_item_ops = {
+       .release                = simple_child_release,
+       .show_attribute         = simple_child_attr_show,
+       .store_attribute        = simple_child_attr_store,
+};
+
+static struct config_item_type simple_child_type = {
+       .ct_item_ops    = &simple_child_item_ops,
+       .ct_attrs       = simple_child_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+
+struct simple_children {
+       struct config_group group;
+};
+
+static inline struct simple_children *to_simple_children(struct config_item *item)
+{
+       return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
+}
+
+static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
+{
+       struct simple_child *simple_child;
+
+       simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
+       if (!simple_child)
+               return ERR_PTR(-ENOMEM);
+
+       config_item_init_type_name(&simple_child->item, name,
+                                  &simple_child_type);
+
+       simple_child->storeme = 0;
+
+       return &simple_child->item;
+}
+
+static struct configfs_attribute simple_children_attr_description = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "description",
+       .ca_mode = S_IRUGO,
+};
+
+static struct configfs_attribute *simple_children_attrs[] = {
+       &simple_children_attr_description,
+       NULL,
+};
+
+static ssize_t simple_children_attr_show(struct config_item *item,
+                                        struct configfs_attribute *attr,
+                                        char *page)
+{
+       return sprintf(page,
+"[02-simple-children]\n"
+"\n"
+"This subsystem allows the creation of child config_items.  These\n"
+"items have only one attribute that is readable and writeable.\n");
+}
+
+static void simple_children_release(struct config_item *item)
+{
+       kfree(to_simple_children(item));
+}
+
+static struct configfs_item_operations simple_children_item_ops = {
+       .release        = simple_children_release,
+       .show_attribute = simple_children_attr_show,
+};
+
+/*
+ * Note that, since no extra work is required on ->drop_item(),
+ * no ->drop_item() is provided.
+ */
+static struct configfs_group_operations simple_children_group_ops = {
+       .make_item      = simple_children_make_item,
+};
+
+static struct config_item_type simple_children_type = {
+       .ct_item_ops    = &simple_children_item_ops,
+       .ct_group_ops   = &simple_children_group_ops,
+       .ct_attrs       = simple_children_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct configfs_subsystem simple_children_subsys = {
+       .su_group = {
+               .cg_item = {
+                       .ci_namebuf = "02-simple-children",
+                       .ci_type = &simple_children_type,
+               },
+       },
+};
+
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * 03-group-children
+ *
+ * This example reuses the simple_children group from above.  However,
+ * the simple_children group is not the subsystem itself, it is a
+ * child of the subsystem.  Creation of a group in the subsystem creates
+ * a new simple_children group.  That group can then have simple_child
+ * children of its own.
+ */
+
+static struct config_group *group_children_make_group(struct config_group *group, const char *name)
+{
+       struct simple_children *simple_children;
+
+       simple_children = kzalloc(sizeof(struct simple_children),
+                                 GFP_KERNEL);
+       if (!simple_children)
+               return ERR_PTR(-ENOMEM);
+
+       config_group_init_type_name(&simple_children->group, name,
+                                   &simple_children_type);
+
+       return &simple_children->group;
+}
+
+static struct configfs_attribute group_children_attr_description = {
+       .ca_owner = THIS_MODULE,
+       .ca_name = "description",
+       .ca_mode = S_IRUGO,
+};
+
+static struct configfs_attribute *group_children_attrs[] = {
+       &group_children_attr_description,
+       NULL,
+};
+
+static ssize_t group_children_attr_show(struct config_item *item,
+                                       struct configfs_attribute *attr,
+                                       char *page)
+{
+       return sprintf(page,
+"[03-group-children]\n"
+"\n"
+"This subsystem allows the creation of child config_groups.  These\n"
+"groups are like the subsystem simple-children.\n");
+}
+
+static struct configfs_item_operations group_children_item_ops = {
+       .show_attribute = group_children_attr_show,
+};
+
+/*
+ * Note that, since no extra work is required on ->drop_item(),
+ * no ->drop_item() is provided.
+ */
+static struct configfs_group_operations group_children_group_ops = {
+       .make_group     = group_children_make_group,
+};
+
+static struct config_item_type group_children_type = {
+       .ct_item_ops    = &group_children_item_ops,
+       .ct_group_ops   = &group_children_group_ops,
+       .ct_attrs       = group_children_attrs,
+       .ct_owner       = THIS_MODULE,
+};
+
+static struct configfs_subsystem group_children_subsys = {
+       .su_group = {
+               .cg_item = {
+                       .ci_namebuf = "03-group-children",
+                       .ci_type = &group_children_type,
+               },
+       },
+};
+
+/* ----------------------------------------------------------------- */
+
+/*
+ * We're now done with our subsystem definitions.
+ * For convenience in this module, here's a list of them all.  It
+ * allows the init function to easily register them.  Most modules
+ * will only have one subsystem, and will only call register_subsystem
+ * on it directly.
+ */
+static struct configfs_subsystem *example_subsys[] = {
+       &childless_subsys.subsys,
+       &simple_children_subsys,
+       &group_children_subsys,
+       NULL,
+};
+
+static int __init configfs_example_init(void)
+{
+       int ret;
+       int i;
+       struct configfs_subsystem *subsys;
+
+       for (i = 0; example_subsys[i]; i++) {
+               subsys = example_subsys[i];
+
+               config_group_init(&subsys->su_group);
+               mutex_init(&subsys->su_mutex);
+               ret = configfs_register_subsystem(subsys);
+               if (ret) {
+                       printk(KERN_ERR "Error %d while registering subsystem %s\n",
+                              ret,
+                              subsys->su_group.cg_item.ci_namebuf);
+                       goto out_unregister;
+               }
+       }
+
+       return 0;
+
+out_unregister:
+       for (; i >= 0; i--) {
+               configfs_unregister_subsystem(example_subsys[i]);
+       }
+
+       return ret;
+}
+
+static void __exit configfs_example_exit(void)
+{
+       int i;
+
+       for (i = 0; example_subsys[i]; i++) {
+               configfs_unregister_subsystem(example_subsys[i]);
+       }
+}
+
+module_init(configfs_example_init);
+module_exit(configfs_example_exit);
+MODULE_LICENSE("GPL");
index f218f616ff6bbf79e6b6aa6987f64a41142df5f0..d330fe3103da9c9a3cb8f888ac7255ce48e666d4 100644 (file)
@@ -4,6 +4,7 @@
 Copyright 2008 Red Hat Inc.
    Author:   Steven Rostedt <srostedt@redhat.com>
   License:   The GNU Free Documentation License, Version 1.2
+               (dual licensed under the GPL v2)
 Reviewers:   Elias Oltmanns, Randy Dunlap, Andrew Morton,
             John Kacur, and David Teigland.
 
index 8f446070e64a56ebc2c19a98c3f5e40688648b06..b1fe009994396030943ad570ddb84abe42611de5 100644 (file)
@@ -22,6 +22,10 @@ Module Parameters
                        and PWM output control functions. Using this parameter
                        shouldn't be required since the BIOS usually takes care
                        of this.
+* probe_all_addr: bool Include non-standard LPC addresses 0x162e and 0x164e
+                       when probing for ISA devices. This is required for the
+                       following boards:
+                       - VIA EPIA SN18000
 
 Note that there is no need to use this parameter if the driver loads without
 complaining. The driver will say so if it is necessary.
index 9549237530cf8a08dbe1460f3f048802cea62567..6d41db7f17f8b5372a765504f2d6c173bfc2b372 100644 (file)
@@ -96,11 +96,6 @@ initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has
 confirmed this "bug". The ADT7463 is reported to work as described in the
 documentation. The current lm85 driver does not show the offset register.
 
-The ADT7463 has a THERM asserted counter. This counter has a 22.76ms
-resolution and a range of 5.8 seconds. The driver implements a 32-bit
-accumulator of the counter value to extend the range to over a year. The
-counter will stay at it's max value until read.
-
 See the vendor datasheets for more information. There is application note
 from National (AN-1260) with some additional information about the LM85.
 The Analog Devices datasheet is very detailed and describes a procedure for
@@ -206,13 +201,15 @@ Configuration choices:
 
 The National LM85's have two vendor specific configuration
 features. Tach. mode and Spinup Control. For more details on these,
-see the LM85 datasheet or Application Note AN-1260.
+see the LM85 datasheet or Application Note AN-1260. These features
+are not currently supported by the lm85 driver.
 
 The Analog Devices ADM1027 has several vendor specific enhancements.
 The number of pulses-per-rev of the fans can be set, Tach monitoring
 can be optimized for PWM operation, and an offset can be applied to
 the temperatures to compensate for systemic errors in the
-measurements.
+measurements. These features are not currently supported by the lm85
+driver.
 
 In addition to the ADM1027 features, the ADT7463 also has Tmin control
 and THERM asserted counts. Automatic Tmin control acts to adjust the
index a8686e5a68579fc207d4c12e59246d7aee58ffcd..c6cd4956047c2f88c24ef5df0282193e885b6b3e 100644 (file)
@@ -101,6 +101,10 @@ of charge when battery became full/empty". It also could mean "value of
 charge when battery considered full/empty at given conditions (temperature,
 age)". I.e. these attributes represents real thresholds, not design values.
 
+CHARGE_COUNTER - the current charge counter (in ÂµAh).  This could easily
+be negative; there is no empty or full value.  It is only useful for
+relative, time-based measurements.
+
 ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
 
 CAPACITY - capacity in percents.
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt
new file mode 100644 (file)
index 0000000..82b7a43
--- /dev/null
@@ -0,0 +1,182 @@
+Regulator Consumer Driver Interface
+===================================
+
+This text describes the regulator interface for consumer device drivers.
+Please see overview.txt for a description of the terms used in this text.
+
+
+1. Consumer Regulator Access (static & dynamic drivers)
+=======================================================
+
+A consumer driver can get access to it's supply regulator by calling :-
+
+regulator = regulator_get(dev, "Vcc");
+
+The consumer passes in it's struct device pointer and power supply ID. The core
+then finds the correct regulator by consulting a machine specific lookup table.
+If the lookup is successful then this call will return a pointer to the struct
+regulator that supplies this consumer.
+
+To release the regulator the consumer driver should call :-
+
+regulator_put(regulator);
+
+Consumers can be supplied by more than one regulator e.g. codec consumer with
+analog and digital supplies :-
+
+digital = regulator_get(dev, "Vcc");  /* digital core */
+analog = regulator_get(dev, "Avdd");  /* analog */
+
+The regulator access functions regulator_get() and regulator_put() will
+usually be called in your device drivers probe() and remove() respectively.
+
+
+2. Regulator Output Enable & Disable (static & dynamic drivers)
+====================================================================
+
+A consumer can enable it's power supply by calling:-
+
+int regulator_enable(regulator);
+
+NOTE: The supply may already be enabled before regulator_enabled() is called.
+This may happen if the consumer shares the regulator or the regulator has been
+previously enabled by bootloader or kernel board initialization code.
+
+A consumer can determine if a regulator is enabled by calling :-
+
+int regulator_is_enabled(regulator);
+
+This will return > zero when the regulator is enabled.
+
+
+A consumer can disable it's supply when no longer needed by calling :-
+
+int regulator_disable(regulator);
+
+NOTE: This may not disable the supply if it's shared with other consumers. The
+regulator will only be disabled when the enabled reference count is zero.
+
+Finally, a regulator can be forcefully disabled in the case of an emergency :-
+
+int regulator_force_disable(regulator);
+
+NOTE: this will immediately and forcefully shutdown the regulator output. All
+consumers will be powered off.
+
+
+3. Regulator Voltage Control & Status (dynamic drivers)
+======================================================
+
+Some consumer drivers need to be able to dynamically change their supply
+voltage to match system operating points. e.g. CPUfreq drivers can scale
+voltage along with frequency to save power, SD drivers may need to select the
+correct card voltage, etc.
+
+Consumers can control their supply voltage by calling :-
+
+int regulator_set_voltage(regulator, min_uV, max_uV);
+
+Where min_uV and max_uV are the minimum and maximum acceptable voltages in
+microvolts.
+
+NOTE: this can be called when the regulator is enabled or disabled. If called
+when enabled, then the voltage changes instantly, otherwise the voltage
+configuration changes and the voltage is physically set when the regulator is
+next enabled.
+
+The regulators configured voltage output can be found by calling :-
+
+int regulator_get_voltage(regulator);
+
+NOTE: get_voltage() will return the configured output voltage whether the
+regulator is enabled or disabled and should NOT be used to determine regulator
+output state. However this can be used in conjunction with is_enabled() to
+determine the regulator physical output voltage.
+
+
+4. Regulator Current Limit Control & Status (dynamic drivers)
+===========================================================
+
+Some consumer drivers need to be able to dynamically change their supply
+current limit to match system operating points. e.g. LCD backlight driver can
+change the current limit to vary the backlight brightness, USB drivers may want
+to set the limit to 500mA when supplying power.
+
+Consumers can control their supply current limit by calling :-
+
+int regulator_set_current_limit(regulator, min_uV, max_uV);
+
+Where min_uA and max_uA are the minimum and maximum acceptable current limit in
+microamps.
+
+NOTE: this can be called when the regulator is enabled or disabled. If called
+when enabled, then the current limit changes instantly, otherwise the current
+limit configuration changes and the current limit is physically set when the
+regulator is next enabled.
+
+A regulators current limit can be found by calling :-
+
+int regulator_get_current_limit(regulator);
+
+NOTE: get_current_limit() will return the current limit whether the regulator
+is enabled or disabled and should not be used to determine regulator current
+load.
+
+
+5. Regulator Operating Mode Control & Status (dynamic drivers)
+=============================================================
+
+Some consumers can further save system power by changing the operating mode of
+their supply regulator to be more efficient when the consumers operating state
+changes. e.g. consumer driver is idle and subsequently draws less current
+
+Regulator operating mode can be changed indirectly or directly.
+
+Indirect operating mode control.
+--------------------------------
+Consumer drivers can request a change in their supply regulator operating mode
+by calling :-
+
+int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
+
+This will cause the core to recalculate the total load on the regulator (based
+on all it's consumers) and change operating mode (if necessary and permitted)
+to best match the current operating load.
+
+The load_uA value can be determined from the consumers datasheet. e.g.most
+datasheets have tables showing the max current consumed in certain situations.
+
+Most consumers will use indirect operating mode control since they have no
+knowledge of the regulator or whether the regulator is shared with other
+consumers.
+
+Direct operating mode control.
+------------------------------
+Bespoke or tightly coupled drivers may want to directly control regulator
+operating mode depending on their operating point. This can be achieved by
+calling :-
+
+int regulator_set_mode(struct regulator *regulator, unsigned int mode);
+unsigned int regulator_get_mode(struct regulator *regulator);
+
+Direct mode will only be used by consumers that *know* about the regulator and
+are not sharing the regulator with other consumers.
+
+
+6. Regulator Events
+===================
+Regulators can notify consumers of external events. Events could be received by
+consumers under regulator stress or failure conditions.
+
+Consumers can register interest in regulator events by calling :-
+
+int regulator_register_notifier(struct regulator *regulator,
+                             struct notifier_block *nb);
+
+Consumers can uregister interest by calling :-
+
+int regulator_unregister_notifier(struct regulator *regulator,
+                               struct notifier_block *nb);
+
+Regulators use the kernel notifier framework to send event to thier interested
+consumers.
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
new file mode 100644 (file)
index 0000000..c9a3566
--- /dev/null
@@ -0,0 +1,101 @@
+Regulator Machine Driver Interface
+===================================
+
+The regulator machine driver interface is intended for board/machine specific
+initialisation code to configure the regulator subsystem. Typical things that
+machine drivers would do are :-
+
+ 1. Regulator -> Device mapping.
+ 2. Regulator supply configuration.
+ 3. Power Domain constraint setting.
+
+
+
+1. Regulator -> device mapping
+==============================
+Consider the following machine :-
+
+  Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
+               |
+               +-> [Consumer B @ 3.3V]
+
+The drivers for consumers A & B must be mapped to the correct regulator in
+order to control their power supply. This mapping can be achieved in machine
+initialisation code by calling :-
+
+int regulator_set_device_supply(const char *regulator, struct device *dev,
+                               const char *supply);
+
+and is shown with the following code :-
+
+regulator_set_device_supply("Regulator-1", devB, "Vcc");
+regulator_set_device_supply("Regulator-2", devA, "Vcc");
+
+This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
+to the 'Vcc' supply for Consumer A.
+
+
+2. Regulator supply configuration.
+==================================
+Consider the following machine (again) :-
+
+  Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
+               |
+               +-> [Consumer B @ 3.3V]
+
+Regulator-1 supplies power to Regulator-2. This relationship must be registered
+with the core so that Regulator-1 is also enabled when Consumer A enables it's
+supply (Regulator-2).
+
+This relationship can be register with the core via :-
+
+int regulator_set_supply(const char *regulator, const char *regulator_supply);
+
+In this example we would use the following code :-
+
+regulator_set_supply("Regulator-2", "Regulator-1");
+
+Relationships can be queried by calling :-
+
+const char *regulator_get_supply(const char *regulator);
+
+
+3. Power Domain constraint setting.
+===================================
+Each power domain within a system has physical constraints on voltage and
+current. This must be defined in software so that the power domain is always
+operated within specifications.
+
+Consider the following machine (again) :-
+
+  Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
+               |
+               +-> [Consumer B @ 3.3V]
+
+This gives us two regulators and two power domains:
+
+                   Domain 1: Regulator-2, Consumer B.
+                   Domain 2: Consumer A.
+
+Constraints can be registered by calling :-
+
+int regulator_set_platform_constraints(const char *regulator,
+       struct regulation_constraints *constraints);
+
+The example is defined as follows :-
+
+struct regulation_constraints domain_1 = {
+       .min_uV = 3300000,
+       .max_uV = 3300000,
+       .valid_modes_mask = REGULATOR_MODE_NORMAL,
+};
+
+struct regulation_constraints domain_2 = {
+       .min_uV = 1800000,
+       .max_uV = 2000000,
+       .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+       .valid_modes_mask = REGULATOR_MODE_NORMAL,
+};
+
+regulator_set_platform_constraints("Regulator-1", &domain_1);
+regulator_set_platform_constraints("Regulator-2", &domain_2);
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt
new file mode 100644 (file)
index 0000000..bdcb332
--- /dev/null
@@ -0,0 +1,171 @@
+Linux voltage and current regulator framework
+=============================================
+
+About
+=====
+
+This framework is designed to provide a standard kernel interface to control
+voltage and current regulators.
+
+The intention is to allow systems to dynamically control regulator power output
+in order to save power and prolong battery life. This applies to both voltage
+regulators (where voltage output is controllable) and current sinks (where
+current limit is controllable).
+
+(C) 2008  Wolfson Microelectronics PLC.
+Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
+
+
+Nomenclature
+============
+
+Some terms used in this document:-
+
+  o Regulator    - Electronic device that supplies power to other devices.
+                   Most regulators can enable and disable their output whilst
+                   some can control their output voltage and or current.
+
+                   Input Voltage -> Regulator -> Output Voltage
+
+
+  o PMIC         - Power Management IC. An IC that contains numerous regulators
+                   and often contains other susbsystems.
+
+
+  o Consumer     - Electronic device that is supplied power by a regulator.
+                   Consumers can be classified into two types:-
+
+                   Static: consumer does not change it's supply voltage or
+                   current limit. It only needs to enable or disable it's
+                   power supply. It's supply voltage is set by the hardware,
+                   bootloader, firmware or kernel board initialisation code.
+
+                   Dynamic: consumer needs to change it's supply voltage or
+                   current limit to meet operation demands.
+
+
+  o Power Domain - Electronic circuit that is supplied it's input power by the
+                   output power of a regulator, switch or by another power
+                   domain.
+
+                   The supply regulator may be behind a switch(s). i.e.
+
+                   Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A]
+                              |             |
+                              |             +-> [Consumer B], [Consumer C]
+                              |
+                              +-> [Consumer D], [Consumer E]
+
+                   That is one regulator and three power domains:
+
+                   Domain 1: Switch-1, Consumers D & E.
+                   Domain 2: Switch-2, Consumers B & C.
+                   Domain 3: Consumer A.
+
+                   and this represents a "supplies" relationship:
+
+                   Domain-1 --> Domain-2 --> Domain-3.
+
+                   A power domain may have regulators that are supplied power
+                   by other regulators. i.e.
+
+                   Regulator-1 -+-> Regulator-2 -+-> [Consumer A]
+                                |
+                                +-> [Consumer B]
+
+                   This gives us two regulators and two power domains:
+
+                   Domain 1: Regulator-2, Consumer B.
+                   Domain 2: Consumer A.
+
+                   and a "supplies" relationship:
+
+                   Domain-1 --> Domain-2
+
+
+  o Constraints  - Constraints are used to define power levels for performance
+                   and hardware protection. Constraints exist at three levels:
+
+                   Regulator Level: This is defined by the regulator hardware
+                   operating parameters and is specified in the regulator
+                   datasheet. i.e.
+
+                     - voltage output is in the range 800mV -> 3500mV.
+                     - regulator current output limit is 20mA @ 5V but is
+                       10mA @ 10V.
+
+                   Power Domain Level: This is defined in software by kernel
+                   level board initialisation code. It is used to constrain a
+                   power domain to a particular power range. i.e.
+
+                     - Domain-1 voltage is 3300mV
+                     - Domain-2 voltage is 1400mV -> 1600mV
+                     - Domain-3 current limit is 0mA -> 20mA.
+
+                   Consumer Level: This is defined by consumer drivers
+                   dynamically setting voltage or current limit levels.
+
+                   e.g. a consumer backlight driver asks for a current increase
+                   from 5mA to 10mA to increase LCD illumination. This passes
+                   to through the levels as follows :-
+
+                   Consumer: need to increase LCD brightness. Lookup and
+                   request next current mA value in brightness table (the
+                   consumer driver could be used on several different
+                   personalities based upon the same reference device).
+
+                   Power Domain: is the new current limit within the domain
+                   operating limits for this domain and system state (e.g.
+                   battery power, USB power)
+
+                   Regulator Domains: is the new current limit within the
+                   regulator operating parameters for input/ouput voltage.
+
+                   If the regulator request passes all the constraint tests
+                   then the new regulator value is applied.
+
+
+Design
+======
+
+The framework is designed and targeted at SoC based devices but may also be
+relevant to non SoC devices and is split into the following four interfaces:-
+
+
+   1. Consumer driver interface.
+
+      This uses a similar API to the kernel clock interface in that consumer
+      drivers can get and put a regulator (like they can with clocks atm) and
+      get/set voltage, current limit, mode, enable and disable. This should
+      allow consumers complete control over their supply voltage and current
+      limit. This also compiles out if not in use so drivers can be reused in
+      systems with no regulator based power control.
+
+        See Documentation/power/regulator/consumer.txt
+
+   2. Regulator driver interface.
+
+      This allows regulator drivers to register their regulators and provide
+      operations to the core. It also has a notifier call chain for propagating
+      regulator events to clients.
+
+        See Documentation/power/regulator/regulator.txt
+
+   3. Machine interface.
+
+      This interface is for machine specific code and allows the creation of
+      voltage/current domains (with constraints) for each regulator. It can
+      provide regulator constraints that will prevent device damage through
+      overvoltage or over current caused by buggy client drivers. It also
+      allows the creation of a regulator tree whereby some regulators are
+      supplied by others (similar to a clock tree).
+
+        See Documentation/power/regulator/machine.txt
+
+   4. Userspace ABI.
+
+      The framework also exports a lot of useful voltage/current/opmode data to
+      userspace via sysfs. This could be used to help monitor device power
+      consumption and status.
+
+        See Documentation/ABI/testing/regulator-sysfs.txt
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt
new file mode 100644 (file)
index 0000000..a690501
--- /dev/null
@@ -0,0 +1,30 @@
+Regulator Driver Interface
+==========================
+
+The regulator driver interface is relatively simple and designed to allow
+regulator drivers to register their services with the core framework.
+
+
+Registration
+============
+
+Drivers can register a regulator by calling :-
+
+struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+                                         void *reg_data);
+
+This will register the regulators capabilities and operations the regulator
+core. The core does not touch reg_data (private to regulator driver).
+
+Regulators can be unregistered by calling :-
+
+void regulator_unregister(struct regulator_dev *rdev);
+
+
+Regulator Events
+================
+Regulators can send events (e.g. over temp, under voltage, etc) to consumer
+drivers by calling :-
+
+int regulator_notifier_call_chain(struct regulator_dev *rdev,
+                                 unsigned long event, void *data);
index deedc0d827b534af5f9d660f47162449da4bdb4f..8223a521d7c3f2198c19d7065469b7f1484f714f 100644 (file)
@@ -502,6 +502,12 @@ L: openezx-devel@lists.openezx.org (subscribers-only)
 W:     http://www.openezx.org/
 S:     Maintained
 
+ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
+P:     Sascha Hauer
+M:     kernel@pengutronix.de
+L:     linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
+S:     Maintained
+
 ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
 P:     Lennert Buytenhek
 M:     kernel@wantstofly.org
@@ -1878,13 +1884,9 @@ W:       http://gigaset307x.sourceforge.net/
 S:     Maintained
 
 HARDWARE MONITORING
-P:     Mark M. Hoffman
-M:     mhoffman@lightlink.com
 L:     lm-sensors@lm-sensors.org
 W:     http://www.lm-sensors.org/
-T:     git lm-sensors.org:/kernel/mhoffman/hwmon-2.6.git testing
-T:     git lm-sensors.org:/kernel/mhoffman/hwmon-2.6.git release
-S:     Maintained
+S:     Orphaned
 
 HARDWARE RANDOM NUMBER GENERATOR CORE
 S:     Orphaned
@@ -3968,7 +3970,7 @@ M:        lethal@linux-sh.org
 L:     linux-sh@vger.kernel.org
 W:     http://www.linux-sh.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git
-S:     Maintained
+S:     Supported
 
 SUN3/3X
 P:     Sam Creasey
@@ -4504,6 +4506,15 @@ M:       kaber@trash.net
 L:     netdev@vger.kernel.org
 S:     Maintained
 
+VOLTAGE AND CURRENT REGULATOR FRAMEWORK
+P:     Liam Girdwood
+M:     lg@opensource.wolfsonmicro.com
+P:     Mark Brown
+M:     broonie@opensource.wolfsonmicro.com
+W:     http://opensource.wolfsonmicro.com/node/15
+T:     git kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
+S:     Supported
+
 VT1211 HARDWARE MONITOR DRIVER
 P:     Juerg Haefliger
 M:     juergh@gmail.com
index aa527a46c8070f77582671b71b6e5470c0f87aae..f156f40d6334282160409ef6a2ca30ee755de98a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -930,7 +930,7 @@ ifneq ($(KBUILD_SRC),)
                /bin/false; \
        fi;
        $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
-       $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then  \
+       $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/errno.h ]; then  \
            ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm;     \
            fi
 endif
index 257033c691f2618adf9c6103d9e1e9090b470fcb..4b8acd2851f48e4a7e42bd6f8886fae30aae930c 100644 (file)
@@ -1225,6 +1225,8 @@ source "drivers/dma/Kconfig"
 
 source "drivers/dca/Kconfig"
 
+source "drivers/regulator/Kconfig"
+
 source "drivers/uio/Kconfig"
 
 endmenu
index 95baac4939e09a3809e427ed82207c5f3c1270c7..94462a097f86697ce51558bd9389a4886b904318 100644 (file)
@@ -112,6 +112,3 @@ $(obj)/font.c: $(FONTC)
 
 $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
        @sed "$(SEDFLAGS)" < $< > $@
-
-$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
-
index be2b2f38fd94912642b59b706ee4edadcfd40bf1..bf97801a10682d9058b8f09b1485b27a80524880 100644 (file)
@@ -170,7 +170,7 @@ CONFIG_MACH_AT91CAP9ADK=y
 # AT91 Board Options
 #
 CONFIG_MTD_AT91_DATAFLASH_CARD=y
-# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
@@ -442,7 +442,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index 2011adfa6758998115dec29a07593b052f66515a..38e6a0abeb4eaceba5008eb71c96a2107e2f1b6b 100644 (file)
@@ -176,7 +176,7 @@ CONFIG_MACH_AT91SAM9260EK=y
 # AT91 Board Options
 #
 # CONFIG_MTD_AT91_DATAFLASH_CARD is not set
-# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
index 4049768962d2dc4379b3a0295cc2e6acd15c3ad1..93b779f94b41ef8ce7731c169951768e9b4a9528 100644 (file)
@@ -169,7 +169,7 @@ CONFIG_MACH_AT91SAM9261EK=y
 # AT91 Board Options
 #
 # CONFIG_MTD_AT91_DATAFLASH_CARD is not set
-# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
@@ -433,7 +433,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index fa1c5aecb5a8d86c2ebdf9d204c55adcfc45154d..a7ddd94363cac32839653882b17926d8ff568881 100644 (file)
@@ -169,7 +169,7 @@ CONFIG_MACH_AT91SAM9263EK=y
 # AT91 Board Options
 #
 CONFIG_MTD_AT91_DATAFLASH_CARD=y
-# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
@@ -428,7 +428,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index c06863847364de15645a1b5c64dfd9524a37e36b..df0d6ee672b388d86b15f54fb7501fefabc50475 100644 (file)
@@ -168,7 +168,7 @@ CONFIG_MACH_AT91SAM9G20EK=y
 # AT91 Board Options
 #
 # CONFIG_MTD_AT91_DATAFLASH_CARD is not set
-# CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
@@ -442,10 +442,10 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
-CONFIG_MTD_NAND_AT91_ECC_SOFT=y
-# CONFIG_MTD_NAND_AT91_ECC_HW is not set
-# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index d8ec5f9ca6ec49c5ec40aebd6b4672124020e27d..1c76642272a1bde973eabeb7a4f0164bded8b36a 100644 (file)
@@ -392,7 +392,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ONENAND is not set
index f3cd4a95373ab3bcf76e983c2f6926441eb92796..f945105d6cd6000b9f64a1196aa367371ccb6f07 100644 (file)
@@ -466,10 +466,10 @@ CONFIG_MTD_NAND_VERIFY_WRITE=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
-# CONFIG_MTD_NAND_AT91_ECC_SOFT is not set
-CONFIG_MTD_NAND_AT91_ECC_HW=y
-# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+CONFIG_MTD_NAND_ATMEL=y
+# CONFIG_MTD_NAND_ATMEL_ECC_SOFT is not set
+CONFIG_MTD_NAND_ATMEL_ECC_HW=y
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index ef903bed061e602cc04849b22245e309519fed18..5cbd815896474350c4ec5fa15fbfb5fb1dea38a2 100644 (file)
@@ -458,10 +458,10 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
-CONFIG_MTD_NAND_AT91_ECC_SOFT=y
-# CONFIG_MTD_NAND_AT91_ECC_HW is not set
-# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index 8688362bcf7b18ffb7525954c4a34112dccf6db9..1174e276487577d92585066e5f69b78aae2b57e2 100644 (file)
@@ -429,7 +429,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 CONFIG_MTD_NAND_PLATFORM=y
 # CONFIG_MTD_ONENAND is not set
index 3680bd2df26d8ad65536d80131ef8b4e024fdf8a..fcb4aaabd439d8c8a0995501f1427aa22cfe653d 100644 (file)
@@ -458,10 +458,10 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
-CONFIG_MTD_NAND_AT91_ECC_SOFT=y
-# CONFIG_MTD_NAND_AT91_ECC_HW is not set
-# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index 48d455bc73631394c70934f7a9697091f4d2662a..b786e0407e8e08ba11c7efea9773cd12a2c127a1 100644 (file)
@@ -450,10 +450,10 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
-CONFIG_MTD_NAND_AT91=y
-CONFIG_MTD_NAND_AT91_ECC_SOFT=y
-# CONFIG_MTD_NAND_AT91_ECC_HW is not set
-# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
index 26de37f74686d3be37ad8f2b19f91480d953e699..a9f41c24c9dc2d05b7331b0e58c60aa596c90ebf 100644 (file)
@@ -421,7 +421,7 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_ECC_SMC is not set
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
-CONFIG_MTD_NAND_AT91=y
+CONFIG_MTD_NAND_ATMEL=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 CONFIG_MTD_NAND_PLATFORM=y
 # CONFIG_MTD_ALAUDA is not set
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
new file mode 100644 (file)
index 0000000..73237bd
--- /dev/null
@@ -0,0 +1,3 @@
+include include/asm-generic/Kbuild.asm
+
+unifdef-y += hwcap.h
diff --git a/arch/arm/include/asm/a.out-core.h b/arch/arm/include/asm/a.out-core.h
new file mode 100644 (file)
index 0000000..93d04ac
--- /dev/null
@@ -0,0 +1,49 @@
+/* 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>
+#include <linux/elfcore.h>
+
+/*
+ * fill in the user structure for an a.out core dump
+ */
+static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
+{
+       struct task_struct *tsk = current;
+
+       dump->magic = CMAGIC;
+       dump->start_code = tsk->mm->start_code;
+       dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
+
+       dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
+       dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
+       dump->u_ssize = 0;
+
+       dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;
+       dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
+       dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
+       dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
+       dump->u_debugreg[4] = tsk->thread.debug.nsaved;
+
+       if (dump->start_stack < 0x04000000)
+               dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
+
+       dump->regs = *regs;
+       dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
+}
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_A_OUT_CORE_H */
diff --git a/arch/arm/include/asm/a.out.h b/arch/arm/include/asm/a.out.h
new file mode 100644 (file)
index 0000000..79489fd
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ARM_A_OUT_H__
+#define __ARM_A_OUT_H__
+
+#include <linux/personality.h>
+#include <asm/types.h>
+
+struct exec
+{
+  __u32 a_info;                /* Use macros N_MAGIC, etc for access */
+  __u32 a_text;                /* length of text, in bytes */
+  __u32 a_data;                /* length of data, in bytes */
+  __u32 a_bss;         /* length of uninitialized data area for file, in bytes */
+  __u32 a_syms;                /* length of symbol table data in file, in bytes */
+  __u32 a_entry;       /* start address */
+  __u32 a_trsize;      /* length of relocation info for text, in bytes */
+  __u32 a_drsize;      /* length of relocation info for data, in bytes */
+};
+
+/*
+ * This is always the same
+ */
+#define N_TXTADDR(a)   (0x00008000)
+
+#define N_TRSIZE(a)    ((a).a_trsize)
+#define N_DRSIZE(a)    ((a).a_drsize)
+#define N_SYMSIZE(a)   ((a).a_syms)
+
+#define M_ARM 103
+
+#ifndef LIBRARY_START_TEXT
+#define LIBRARY_START_TEXT     (0x00c00000)
+#endif
+
+#endif /* __A_OUT_GNU_H__ */
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
new file mode 100644 (file)
index 0000000..6116e48
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ *  arch/arm/include/asm/assembler.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * 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.
+ *
+ *  This file contains arm architecture specific defines
+ *  for the different processors.
+ *
+ *  Do not include any C declarations in this file - it is included by
+ *  assembler source.
+ */
+#ifndef __ASSEMBLY__
+#error "Only include this from assembly code"
+#endif
+
+#include <asm/ptrace.h>
+
+/*
+ * Endian independent macros for shifting bytes within registers.
+ */
+#ifndef __ARMEB__
+#define pull            lsr
+#define push            lsl
+#define get_byte_0      lsl #0
+#define get_byte_1     lsr #8
+#define get_byte_2     lsr #16
+#define get_byte_3     lsr #24
+#define put_byte_0      lsl #0
+#define put_byte_1     lsl #8
+#define put_byte_2     lsl #16
+#define put_byte_3     lsl #24
+#else
+#define pull            lsl
+#define push            lsr
+#define get_byte_0     lsr #24
+#define get_byte_1     lsr #16
+#define get_byte_2     lsr #8
+#define get_byte_3      lsl #0
+#define put_byte_0     lsl #24
+#define put_byte_1     lsl #16
+#define put_byte_2     lsl #8
+#define put_byte_3      lsl #0
+#endif
+
+/*
+ * Data preload for architectures that support it
+ */
+#if __LINUX_ARM_ARCH__ >= 5
+#define PLD(code...)   code
+#else
+#define PLD(code...)
+#endif
+
+/*
+ * This can be used to enable code to cacheline align the destination
+ * pointer when bulk writing to memory.  Experiments on StrongARM and
+ * XScale didn't show this a worthwhile thing to do when the cache is not
+ * set to write-allocate (this would need further testing on XScale when WA
+ * is used).
+ *
+ * On Feroceon there is much to gain however, regardless of cache mode.
+ */
+#ifdef CONFIG_CPU_FEROCEON
+#define CALGN(code...) code
+#else
+#define CALGN(code...)
+#endif
+
+/*
+ * Enable and disable interrupts
+ */
+#if __LINUX_ARM_ARCH__ >= 6
+       .macro  disable_irq
+       cpsid   i
+       .endm
+
+       .macro  enable_irq
+       cpsie   i
+       .endm
+#else
+       .macro  disable_irq
+       msr     cpsr_c, #PSR_I_BIT | SVC_MODE
+       .endm
+
+       .macro  enable_irq
+       msr     cpsr_c, #SVC_MODE
+       .endm
+#endif
+
+/*
+ * Save the current IRQ state and disable IRQs.  Note that this macro
+ * assumes FIQs are enabled, and that the processor is in SVC mode.
+ */
+       .macro  save_and_disable_irqs, oldcpsr
+       mrs     \oldcpsr, cpsr
+       disable_irq
+       .endm
+
+/*
+ * Restore interrupt state previously stored in a register.  We don't
+ * guarantee that this will preserve the flags.
+ */
+       .macro  restore_irqs, oldcpsr
+       msr     cpsr_c, \oldcpsr
+       .endm
+
+#define USER(x...)                             \
+9999:  x;                                      \
+       .section __ex_table,"a";                \
+       .align  3;                              \
+       .long   9999b,9001f;                    \
+       .previous
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..325f881
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ *  arch/arm/include/asm/atomic.h
+ *
+ *  Copyright (C) 1996 Russell King.
+ *  Copyright (C) 2002 Deep Blue Solutions Ltd.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_ATOMIC_H
+#define __ASM_ARM_ATOMIC_H
+
+#include <linux/compiler.h>
+#include <asm/system.h>
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#ifdef __KERNEL__
+
+#define atomic_read(v) ((v)->counter)
+
+#if __LINUX_ARM_ARCH__ >= 6
+
+/*
+ * ARMv6 UP and SMP safe atomic ops.  We use load exclusive and
+ * store exclusive to ensure that these are atomic.  We may loop
+ * to ensure that the update happens.  Writing to 'v->counter'
+ * without using the following operations WILL break the atomic
+ * nature of these ops.
+ */
+static inline void atomic_set(atomic_t *v, int i)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__("@ atomic_set\n"
+"1:    ldrex   %0, [%1]\n"
+"      strex   %0, %2, [%1]\n"
+"      teq     %0, #0\n"
+"      bne     1b"
+       : "=&r" (tmp)
+       : "r" (&v->counter), "r" (i)
+       : "cc");
+}
+
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       unsigned long tmp;
+       int result;
+
+       __asm__ __volatile__("@ atomic_add_return\n"
+"1:    ldrex   %0, [%2]\n"
+"      add     %0, %0, %3\n"
+"      strex   %1, %0, [%2]\n"
+"      teq     %1, #0\n"
+"      bne     1b"
+       : "=&r" (result), "=&r" (tmp)
+       : "r" (&v->counter), "Ir" (i)
+       : "cc");
+
+       return result;
+}
+
+static inline int atomic_sub_return(int i, atomic_t *v)
+{
+       unsigned long tmp;
+       int result;
+
+       __asm__ __volatile__("@ atomic_sub_return\n"
+"1:    ldrex   %0, [%2]\n"
+"      sub     %0, %0, %3\n"
+"      strex   %1, %0, [%2]\n"
+"      teq     %1, #0\n"
+"      bne     1b"
+       : "=&r" (result), "=&r" (tmp)
+       : "r" (&v->counter), "Ir" (i)
+       : "cc");
+
+       return result;
+}
+
+static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
+{
+       unsigned long oldval, res;
+
+       do {
+               __asm__ __volatile__("@ atomic_cmpxchg\n"
+               "ldrex  %1, [%2]\n"
+               "mov    %0, #0\n"
+               "teq    %1, %3\n"
+               "strexeq %0, %4, [%2]\n"
+                   : "=&r" (res), "=&r" (oldval)
+                   : "r" (&ptr->counter), "Ir" (old), "r" (new)
+                   : "cc");
+       } while (res);
+
+       return oldval;
+}
+
+static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
+{
+       unsigned long tmp, tmp2;
+
+       __asm__ __volatile__("@ atomic_clear_mask\n"
+"1:    ldrex   %0, [%2]\n"
+"      bic     %0, %0, %3\n"
+"      strex   %1, %0, [%2]\n"
+"      teq     %1, #0\n"
+"      bne     1b"
+       : "=&r" (tmp), "=&r" (tmp2)
+       : "r" (addr), "Ir" (mask)
+       : "cc");
+}
+
+#else /* ARM_ARCH_6 */
+
+#include <asm/system.h>
+
+#ifdef CONFIG_SMP
+#error SMP not supported on pre-ARMv6 CPUs
+#endif
+
+#define atomic_set(v,i)        (((v)->counter) = (i))
+
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       unsigned long flags;
+       int val;
+
+       raw_local_irq_save(flags);
+       val = v->counter;
+       v->counter = val += i;
+       raw_local_irq_restore(flags);
+
+       return val;
+}
+
+static inline int atomic_sub_return(int i, atomic_t *v)
+{
+       unsigned long flags;
+       int val;
+
+       raw_local_irq_save(flags);
+       val = v->counter;
+       v->counter = val -= i;
+       raw_local_irq_restore(flags);
+
+       return val;
+}
+
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+{
+       int ret;
+       unsigned long flags;
+
+       raw_local_irq_save(flags);
+       ret = v->counter;
+       if (likely(ret == old))
+               v->counter = new;
+       raw_local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
+{
+       unsigned long flags;
+
+       raw_local_irq_save(flags);
+       *addr &= ~mask;
+       raw_local_irq_restore(flags);
+}
+
+#endif /* __LINUX_ARM_ARCH__ */
+
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
+{
+       int c, old;
+
+       c = atomic_read(v);
+       while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
+               c = old;
+       return c != u;
+}
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+
+#define atomic_add(i, v)       (void) atomic_add_return(i, v)
+#define atomic_inc(v)          (void) atomic_add_return(1, v)
+#define atomic_sub(i, v)       (void) atomic_sub_return(i, v)
+#define atomic_dec(v)          (void) atomic_sub_return(1, v)
+
+#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
+#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
+#define atomic_inc_return(v)    (atomic_add_return(1, v))
+#define atomic_dec_return(v)    (atomic_sub_return(1, v))
+#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
+
+#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
+
+/* Atomic operations are already serializing on ARM */
+#define smp_mb__before_atomic_dec()    barrier()
+#define smp_mb__after_atomic_dec()     barrier()
+#define smp_mb__before_atomic_inc()    barrier()
+#define smp_mb__after_atomic_inc()     barrier()
+
+#include <asm-generic/atomic.h>
+#endif
+#endif
diff --git a/arch/arm/include/asm/auxvec.h b/arch/arm/include/asm/auxvec.h
new file mode 100644 (file)
index 0000000..c0536f6
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef __ASMARM_AUXVEC_H
+#define __ASMARM_AUXVEC_H
+
+#endif
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..9a1db20
--- /dev/null
@@ -0,0 +1,340 @@
+/*
+ * Copyright 1995, Russell King.
+ * Various bits and pieces copyrights include:
+ *  Linus Torvalds (test_bit).
+ * Big endian support: Copyright 2001, Nicolas Pitre
+ *  reworked by rmk.
+ *
+ * bit 0 is the LSB of an "unsigned long" quantity.
+ *
+ * Please note that the code in this file should never be included
+ * from user space.  Many of these are not implemented in assembler
+ * since they would be too costly.  Also, they require privileged
+ * instructions (which are not available from user mode) to ensure
+ * that they are atomic.
+ */
+
+#ifndef __ASM_ARM_BITOPS_H
+#define __ASM_ARM_BITOPS_H
+
+#ifdef __KERNEL__
+
+#ifndef _LINUX_BITOPS_H
+#error only <linux/bitops.h> can be included directly
+#endif
+
+#include <linux/compiler.h>
+#include <asm/system.h>
+
+#define smp_mb__before_clear_bit()     mb()
+#define smp_mb__after_clear_bit()      mb()
+
+/*
+ * These functions are the basis of our bit ops.
+ *
+ * First, the atomic bitops. These use native endian.
+ */
+static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       *p |= mask;
+       raw_local_irq_restore(flags);
+}
+
+static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       *p &= ~mask;
+       raw_local_irq_restore(flags);
+}
+
+static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       *p ^= mask;
+       raw_local_irq_restore(flags);
+}
+
+static inline int
+____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned int res;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       res = *p;
+       *p = res | mask;
+       raw_local_irq_restore(flags);
+
+       return res & mask;
+}
+
+static inline int
+____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned int res;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       res = *p;
+       *p = res & ~mask;
+       raw_local_irq_restore(flags);
+
+       return res & mask;
+}
+
+static inline int
+____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
+{
+       unsigned long flags;
+       unsigned int res;
+       unsigned long mask = 1UL << (bit & 31);
+
+       p += bit >> 5;
+
+       raw_local_irq_save(flags);
+       res = *p;
+       *p = res ^ mask;
+       raw_local_irq_restore(flags);
+
+       return res & mask;
+}
+
+#include <asm-generic/bitops/non-atomic.h>
+
+/*
+ *  A note about Endian-ness.
+ *  -------------------------
+ *
+ * When the ARM is put into big endian mode via CR15, the processor
+ * merely swaps the order of bytes within words, thus:
+ *
+ *          ------------ physical data bus bits -----------
+ *          D31 ... D24  D23 ... D16  D15 ... D8  D7 ... D0
+ * little     byte 3       byte 2       byte 1      byte 0
+ * big        byte 0       byte 1       byte 2      byte 3
+ *
+ * This means that reading a 32-bit word at address 0 returns the same
+ * value irrespective of the endian mode bit.
+ *
+ * Peripheral devices should be connected with the data bus reversed in
+ * "Big Endian" mode.  ARM Application Note 61 is applicable, and is
+ * available from http://www.arm.com/.
+ *
+ * The following assumes that the data bus connectivity for big endian
+ * mode has been followed.
+ *
+ * Note that bit 0 is defined to be 32-bit word bit 0, not byte 0 bit 0.
+ */
+
+/*
+ * Little endian assembly bitops.  nr = 0 -> byte 0 bit 0.
+ */
+extern void _set_bit_le(int nr, volatile unsigned long * p);
+extern void _clear_bit_le(int nr, volatile unsigned long * p);
+extern void _change_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
+extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
+extern int _find_first_zero_bit_le(const void * p, unsigned size);
+extern int _find_next_zero_bit_le(const void * p, int size, int offset);
+extern int _find_first_bit_le(const unsigned long *p, unsigned size);
+extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
+
+/*
+ * Big endian assembly bitops.  nr = 0 -> byte 3 bit 0.
+ */
+extern void _set_bit_be(int nr, volatile unsigned long * p);
+extern void _clear_bit_be(int nr, volatile unsigned long * p);
+extern void _change_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
+extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
+extern int _find_first_zero_bit_be(const void * p, unsigned size);
+extern int _find_next_zero_bit_be(const void * p, int size, int offset);
+extern int _find_first_bit_be(const unsigned long *p, unsigned size);
+extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
+
+#ifndef CONFIG_SMP
+/*
+ * The __* form of bitops are non-atomic and may be reordered.
+ */
+#define        ATOMIC_BITOP_LE(name,nr,p)              \
+       (__builtin_constant_p(nr) ?             \
+        ____atomic_##name(nr, p) :             \
+        _##name##_le(nr,p))
+
+#define        ATOMIC_BITOP_BE(name,nr,p)              \
+       (__builtin_constant_p(nr) ?             \
+        ____atomic_##name(nr, p) :             \
+        _##name##_be(nr,p))
+#else
+#define ATOMIC_BITOP_LE(name,nr,p)     _##name##_le(nr,p)
+#define ATOMIC_BITOP_BE(name,nr,p)     _##name##_be(nr,p)
+#endif
+
+#define NONATOMIC_BITOP(name,nr,p)             \
+       (____nonatomic_##name(nr, p))
+
+#ifndef __ARMEB__
+/*
+ * These are the little endian, atomic definitions.
+ */
+#define set_bit(nr,p)                  ATOMIC_BITOP_LE(set_bit,nr,p)
+#define clear_bit(nr,p)                        ATOMIC_BITOP_LE(clear_bit,nr,p)
+#define change_bit(nr,p)               ATOMIC_BITOP_LE(change_bit,nr,p)
+#define test_and_set_bit(nr,p)         ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
+#define test_and_clear_bit(nr,p)       ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
+#define test_and_change_bit(nr,p)      ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
+#define find_first_zero_bit(p,sz)      _find_first_zero_bit_le(p,sz)
+#define find_next_zero_bit(p,sz,off)   _find_next_zero_bit_le(p,sz,off)
+#define find_first_bit(p,sz)           _find_first_bit_le(p,sz)
+#define find_next_bit(p,sz,off)                _find_next_bit_le(p,sz,off)
+
+#define WORD_BITOFF_TO_LE(x)           ((x))
+
+#else
+
+/*
+ * These are the big endian, atomic definitions.
+ */
+#define set_bit(nr,p)                  ATOMIC_BITOP_BE(set_bit,nr,p)
+#define clear_bit(nr,p)                        ATOMIC_BITOP_BE(clear_bit,nr,p)
+#define change_bit(nr,p)               ATOMIC_BITOP_BE(change_bit,nr,p)
+#define test_and_set_bit(nr,p)         ATOMIC_BITOP_BE(test_and_set_bit,nr,p)
+#define test_and_clear_bit(nr,p)       ATOMIC_BITOP_BE(test_and_clear_bit,nr,p)
+#define test_and_change_bit(nr,p)      ATOMIC_BITOP_BE(test_and_change_bit,nr,p)
+#define find_first_zero_bit(p,sz)      _find_first_zero_bit_be(p,sz)
+#define find_next_zero_bit(p,sz,off)   _find_next_zero_bit_be(p,sz,off)
+#define find_first_bit(p,sz)           _find_first_bit_be(p,sz)
+#define find_next_bit(p,sz,off)                _find_next_bit_be(p,sz,off)
+
+#define WORD_BITOFF_TO_LE(x)           ((x) ^ 0x18)
+
+#endif
+
+#if __LINUX_ARM_ARCH__ < 5
+
+#include <asm-generic/bitops/ffz.h>
+#include <asm-generic/bitops/__ffs.h>
+#include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/ffs.h>
+
+#else
+
+static inline int constant_fls(int x)
+{
+       int r = 32;
+
+       if (!x)
+               return 0;
+       if (!(x & 0xffff0000u)) {
+               x <<= 16;
+               r -= 16;
+       }
+       if (!(x & 0xff000000u)) {
+               x <<= 8;
+               r -= 8;
+       }
+       if (!(x & 0xf0000000u)) {
+               x <<= 4;
+               r -= 4;
+       }
+       if (!(x & 0xc0000000u)) {
+               x <<= 2;
+               r -= 2;
+       }
+       if (!(x & 0x80000000u)) {
+               x <<= 1;
+               r -= 1;
+       }
+       return r;
+}
+
+/*
+ * On ARMv5 and above those functions can be implemented around
+ * the clz instruction for much better code efficiency.
+ */
+
+#define __fls(x) \
+       ( __builtin_constant_p(x) ? constant_fls(x) : \
+         ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
+
+/* Implement fls() in C so that 64-bit args are suitably truncated */
+static inline int fls(int x)
+{
+       return __fls(x);
+}
+
+#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
+#define __ffs(x) (ffs(x) - 1)
+#define ffz(x) __ffs( ~(x) )
+
+#endif
+
+#include <asm-generic/bitops/fls64.h>
+
+#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
+
+/*
+ * Ext2 is defined to use little-endian byte ordering.
+ * These do not need to be atomic.
+ */
+#define ext2_set_bit(nr,p)                     \
+               __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define ext2_set_bit_atomic(lock,nr,p)          \
+                test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define ext2_clear_bit(nr,p)                   \
+               __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define ext2_clear_bit_atomic(lock,nr,p)        \
+                test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define ext2_test_bit(nr,p)                    \
+               test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define ext2_find_first_zero_bit(p,sz)         \
+               _find_first_zero_bit_le(p,sz)
+#define ext2_find_next_zero_bit(p,sz,off)      \
+               _find_next_zero_bit_le(p,sz,off)
+#define ext2_find_next_bit(p, sz, off) \
+               _find_next_bit_le(p, sz, off)
+
+/*
+ * Minix is defined to use little-endian byte ordering.
+ * These do not need to be atomic.
+ */
+#define minix_set_bit(nr,p)                    \
+               __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define minix_test_bit(nr,p)                   \
+               test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define minix_test_and_set_bit(nr,p)           \
+               __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define minix_test_and_clear_bit(nr,p)         \
+               __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
+#define minix_find_first_zero_bit(p,sz)                \
+               _find_first_zero_bit_le(p,sz)
+
+#endif /* __KERNEL__ */
+
+#endif /* _ARM_BITOPS_H */
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
new file mode 100644 (file)
index 0000000..7b62351
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _ASMARM_BUG_H
+#define _ASMARM_BUG_H
+
+
+#ifdef CONFIG_BUG
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+extern void __bug(const char *file, int line) __attribute__((noreturn));
+
+/* give file/line information */
+#define BUG()          __bug(__FILE__, __LINE__)
+
+#else
+
+/* this just causes an oops */
+#define BUG()          (*(int *)0 = 0)
+
+#endif
+
+#define HAVE_ARCH_BUG
+#endif
+
+#include <asm-generic/bug.h>
+
+#endif
diff --git a/arch/arm/include/asm/bugs.h b/arch/arm/include/asm/bugs.h
new file mode 100644 (file)
index 0000000..a97f1ea
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  arch/arm/include/asm/bugs.h
+ *
+ *  Copyright (C) 1995-2003 Russell King
+ *
+ * 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.
+ */
+#ifndef __ASM_BUGS_H
+#define __ASM_BUGS_H
+
+#ifdef CONFIG_MMU
+extern void check_writebuffer_bugs(void);
+
+#define check_bugs() check_writebuffer_bugs()
+#else
+#define check_bugs() do { } while (0)
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h
new file mode 100644 (file)
index 0000000..4fbfb22
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *  arch/arm/include/asm/byteorder.h
+ *
+ * ARM Endian-ness.  In little endian mode, the data bus is connected such
+ * that byte accesses appear as:
+ *  0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ *
+ * When in big endian mode, byte accesses appear as:
+ *  0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ */
+#ifndef __ASM_ARM_BYTEORDER_H
+#define __ASM_ARM_BYTEORDER_H
+
+#include <linux/compiler.h>
+#include <asm/types.h>
+
+static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+       __u32 t;
+
+#ifndef __thumb__
+       if (!__builtin_constant_p(x)) {
+               /*
+                * The compiler needs a bit of a hint here to always do the
+                * right thing and not screw it up to different degrees
+                * depending on the gcc version.
+                */
+               asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
+       } else
+#endif
+               t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
+
+       x = (x << 24) | (x >> 8);               /* mov r0,r0,ror #8      */
+       t &= ~0x00FF0000;                       /* bic r1,r1,#0x00FF0000 */
+       x ^= (t >> 8);                          /* eor r0,r0,r1,lsr #8   */
+
+       return x;
+}
+
+#define __arch__swab32(x) ___arch__swab32(x)
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#  define __BYTEORDER_HAS_U64__
+#  define __SWAB_64_THRU_32__
+#endif
+
+#ifdef __ARMEB__
+#include <linux/byteorder/big_endian.h>
+#else
+#include <linux/byteorder/little_endian.h>
+#endif
+
+#endif
+
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
new file mode 100644 (file)
index 0000000..cb7a9e9
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ *  arch/arm/include/asm/cache.h
+ */
+#ifndef __ASMARM_CACHE_H
+#define __ASMARM_CACHE_H
+
+#define L1_CACHE_SHIFT         5
+#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
+
+#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..9073d9c
--- /dev/null
@@ -0,0 +1,537 @@
+/*
+ *  arch/arm/include/asm/cacheflush.h
+ *
+ *  Copyright (C) 1999-2002 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_CACHEFLUSH_H
+#define _ASMARM_CACHEFLUSH_H
+
+#include <linux/sched.h>
+#include <linux/mm.h>
+
+#include <asm/glue.h>
+#include <asm/shmparam.h>
+
+#define CACHE_COLOUR(vaddr)    ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
+
+/*
+ *     Cache Model
+ *     ===========
+ */
+#undef _CACHE
+#undef MULTI_CACHE
+
+#if defined(CONFIG_CPU_CACHE_V3)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE v3
+# endif
+#endif
+
+#if defined(CONFIG_CPU_CACHE_V4)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE v4
+# endif
+#endif
+
+#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
+    defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020)
+# define MULTI_CACHE 1
+#endif
+
+#if defined(CONFIG_CPU_ARM926T)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE arm926
+# endif
+#endif
+
+#if defined(CONFIG_CPU_ARM940T)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE arm940
+# endif
+#endif
+
+#if defined(CONFIG_CPU_ARM946E)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE arm946
+# endif
+#endif
+
+#if defined(CONFIG_CPU_CACHE_V4WB)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE v4wb
+# endif
+#endif
+
+#if defined(CONFIG_CPU_XSCALE)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE xscale
+# endif
+#endif
+
+#if defined(CONFIG_CPU_XSC3)
+# ifdef _CACHE
+#  define MULTI_CACHE 1
+# else
+#  define _CACHE xsc3
+# endif
+#endif
+
+#if defined(CONFIG_CPU_FEROCEON)
+# define MULTI_CACHE 1
+#endif
+
+#if defined(CONFIG_CPU_V6)
+//# ifdef _CACHE
+#  define MULTI_CACHE 1
+//# else
+//#  define _CACHE v6
+//# endif
+#endif
+
+#if defined(CONFIG_CPU_V7)
+//# ifdef _CACHE
+#  define MULTI_CACHE 1
+//# else
+//#  define _CACHE v7
+//# endif
+#endif
+
+#if !defined(_CACHE) && !defined(MULTI_CACHE)
+#error Unknown cache maintainence model
+#endif
+
+/*
+ * This flag is used to indicate that the page pointed to by a pte
+ * is dirty and requires cleaning before returning it to the user.
+ */
+#define PG_dcache_dirty PG_arch_1
+
+/*
+ *     MM Cache Management
+ *     ===================
+ *
+ *     The arch/arm/mm/cache-*.S and arch/arm/mm/proc-*.S files
+ *     implement these methods.
+ *
+ *     Start addresses are inclusive and end addresses are exclusive;
+ *     start addresses should be rounded down, end addresses up.
+ *
+ *     See Documentation/cachetlb.txt for more information.
+ *     Please note that the implementation of these, and the required
+ *     effects are cache-type (VIVT/VIPT/PIPT) specific.
+ *
+ *     flush_cache_kern_all()
+ *
+ *             Unconditionally clean and invalidate the entire cache.
+ *
+ *     flush_cache_user_mm(mm)
+ *
+ *             Clean and invalidate all user space cache entries
+ *             before a change of page tables.
+ *
+ *     flush_cache_user_range(start, end, flags)
+ *
+ *             Clean and invalidate a range of cache entries in the
+ *             specified address space before a change of page tables.
+ *             - start - user start address (inclusive, page aligned)
+ *             - end   - user end address   (exclusive, page aligned)
+ *             - flags - vma->vm_flags field
+ *
+ *     coherent_kern_range(start, end)
+ *
+ *             Ensure coherency between the Icache and the Dcache in the
+ *             region described by start, end.  If you have non-snooping
+ *             Harvard caches, you need to implement this function.
+ *             - start  - virtual start address
+ *             - end    - virtual end address
+ *
+ *     DMA Cache Coherency
+ *     ===================
+ *
+ *     dma_inv_range(start, end)
+ *
+ *             Invalidate (discard) the specified virtual address range.
+ *             May not write back any entries.  If 'start' or 'end'
+ *             are not cache line aligned, those lines must be written
+ *             back.
+ *             - start  - virtual start address
+ *             - end    - virtual end address
+ *
+ *     dma_clean_range(start, end)
+ *
+ *             Clean (write back) the specified virtual address range.
+ *             - start  - virtual start address
+ *             - end    - virtual end address
+ *
+ *     dma_flush_range(start, end)
+ *
+ *             Clean and invalidate the specified virtual address range.
+ *             - start  - virtual start address
+ *             - end    - virtual end address
+ */
+
+struct cpu_cache_fns {
+       void (*flush_kern_all)(void);
+       void (*flush_user_all)(void);
+       void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
+
+       void (*coherent_kern_range)(unsigned long, unsigned long);
+       void (*coherent_user_range)(unsigned long, unsigned long);
+       void (*flush_kern_dcache_page)(void *);
+
+       void (*dma_inv_range)(const void *, const void *);
+       void (*dma_clean_range)(const void *, const void *);
+       void (*dma_flush_range)(const void *, const void *);
+};
+
+struct outer_cache_fns {
+       void (*inv_range)(unsigned long, unsigned long);
+       void (*clean_range)(unsigned long, unsigned long);
+       void (*flush_range)(unsigned long, unsigned long);
+};
+
+/*
+ * Select the calling method
+ */
+#ifdef MULTI_CACHE
+
+extern struct cpu_cache_fns cpu_cache;
+
+#define __cpuc_flush_kern_all          cpu_cache.flush_kern_all
+#define __cpuc_flush_user_all          cpu_cache.flush_user_all
+#define __cpuc_flush_user_range                cpu_cache.flush_user_range
+#define __cpuc_coherent_kern_range     cpu_cache.coherent_kern_range
+#define __cpuc_coherent_user_range     cpu_cache.coherent_user_range
+#define __cpuc_flush_dcache_page       cpu_cache.flush_kern_dcache_page
+
+/*
+ * These are private to the dma-mapping API.  Do not use directly.
+ * Their sole purpose is to ensure that data held in the cache
+ * is visible to DMA, or data written by DMA to system memory is
+ * visible to the CPU.
+ */
+#define dmac_inv_range                 cpu_cache.dma_inv_range
+#define dmac_clean_range               cpu_cache.dma_clean_range
+#define dmac_flush_range               cpu_cache.dma_flush_range
+
+#else
+
+#define __cpuc_flush_kern_all          __glue(_CACHE,_flush_kern_cache_all)
+#define __cpuc_flush_user_all          __glue(_CACHE,_flush_user_cache_all)
+#define __cpuc_flush_user_range                __glue(_CACHE,_flush_user_cache_range)
+#define __cpuc_coherent_kern_range     __glue(_CACHE,_coherent_kern_range)
+#define __cpuc_coherent_user_range     __glue(_CACHE,_coherent_user_range)
+#define __cpuc_flush_dcache_page       __glue(_CACHE,_flush_kern_dcache_page)
+
+extern void __cpuc_flush_kern_all(void);
+extern void __cpuc_flush_user_all(void);
+extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int);
+extern void __cpuc_coherent_kern_range(unsigned long, unsigned long);
+extern void __cpuc_coherent_user_range(unsigned long, unsigned long);
+extern void __cpuc_flush_dcache_page(void *);
+
+/*
+ * These are private to the dma-mapping API.  Do not use directly.
+ * Their sole purpose is to ensure that data held in the cache
+ * is visible to DMA, or data written by DMA to system memory is
+ * visible to the CPU.
+ */
+#define dmac_inv_range                 __glue(_CACHE,_dma_inv_range)
+#define dmac_clean_range               __glue(_CACHE,_dma_clean_range)
+#define dmac_flush_range               __glue(_CACHE,_dma_flush_range)
+
+extern void dmac_inv_range(const void *, const void *);
+extern void dmac_clean_range(const void *, const void *);
+extern void dmac_flush_range(const void *, const void *);
+
+#endif
+
+#ifdef CONFIG_OUTER_CACHE
+
+extern struct outer_cache_fns outer_cache;
+
+static inline void outer_inv_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.inv_range)
+               outer_cache.inv_range(start, end);
+}
+static inline void outer_clean_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.clean_range)
+               outer_cache.clean_range(start, end);
+}
+static inline void outer_flush_range(unsigned long start, unsigned long end)
+{
+       if (outer_cache.flush_range)
+               outer_cache.flush_range(start, end);
+}
+
+#else
+
+static inline void outer_inv_range(unsigned long start, unsigned long end)
+{ }
+static inline void outer_clean_range(unsigned long start, unsigned long end)
+{ }
+static inline void outer_flush_range(unsigned long start, unsigned long end)
+{ }
+
+#endif
+
+/*
+ * flush_cache_vmap() is used when creating mappings (eg, via vmap,
+ * vmalloc, ioremap etc) in kernel space for pages.  Since the
+ * direct-mappings of these pages may contain cached data, we need
+ * to do a full cache flush to ensure that writebacks don't corrupt
+ * data placed into these pages via the new mappings.
+ */
+#define flush_cache_vmap(start, end)           flush_cache_all()
+#define flush_cache_vunmap(start, end)         flush_cache_all()
+
+/*
+ * Copy user data from/to a page which is mapped into a different
+ * processes address space.  Really, we want to allow our "user
+ * space" model to handle this.
+ */
+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
+       do {                                                    \
+               memcpy(dst, src, len);                          \
+               flush_ptrace_access(vma, page, vaddr, dst, len, 1);\
+       } while (0)
+
+#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
+       do {                                                    \
+               memcpy(dst, src, len);                          \
+       } while (0)
+
+/*
+ * Convert calls to our calling convention.
+ */
+#define flush_cache_all()              __cpuc_flush_kern_all()
+#ifndef CONFIG_CPU_CACHE_VIPT
+static inline void flush_cache_mm(struct mm_struct *mm)
+{
+       if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
+               __cpuc_flush_user_all();
+}
+
+static inline void
+flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
+{
+       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask))
+               __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
+                                       vma->vm_flags);
+}
+
+static inline void
+flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
+{
+       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
+               unsigned long addr = user_addr & PAGE_MASK;
+               __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
+       }
+}
+
+static inline void
+flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
+                        unsigned long uaddr, void *kaddr,
+                        unsigned long len, int write)
+{
+       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
+               unsigned long addr = (unsigned long)kaddr;
+               __cpuc_coherent_kern_range(addr, addr + len);
+       }
+}
+#else
+extern void flush_cache_mm(struct mm_struct *mm);
+extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
+extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
+extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
+                               unsigned long uaddr, void *kaddr,
+                               unsigned long len, int write);
+#endif
+
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
+
+/*
+ * flush_cache_user_range is used when we want to ensure that the
+ * Harvard caches are synchronised for the user space address range.
+ * This is used for the ARM private sys_cacheflush system call.
+ */
+#define flush_cache_user_range(vma,start,end) \
+       __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
+
+/*
+ * Perform necessary cache operations to ensure that data previously
+ * stored within this range of addresses can be executed by the CPU.
+ */
+#define flush_icache_range(s,e)                __cpuc_coherent_kern_range(s,e)
+
+/*
+ * Perform necessary cache operations to ensure that the TLB will
+ * see data written in the specified area.
+ */
+#define clean_dcache_area(start,size)  cpu_dcache_clean_area(start, size)
+
+/*
+ * flush_dcache_page is used when the kernel has written to the page
+ * cache page at virtual address page->virtual.
+ *
+ * If this page isn't mapped (ie, page_mapping == NULL), or it might
+ * have userspace mappings, then we _must_ always clean + invalidate
+ * the dcache entries associated with the kernel mapping.
+ *
+ * Otherwise we can defer the operation, and clean the cache when we are
+ * about to change to user space.  This is the same method as used on SPARC64.
+ * See update_mmu_cache for the user space part.
+ */
+extern void flush_dcache_page(struct page *);
+
+extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
+
+static inline void __flush_icache_all(void)
+{
+       asm("mcr        p15, 0, %0, c7, c5, 0   @ invalidate I-cache\n"
+           :
+           : "r" (0));
+}
+
+#define ARCH_HAS_FLUSH_ANON_PAGE
+static inline void flush_anon_page(struct vm_area_struct *vma,
+                        struct page *page, unsigned long vmaddr)
+{
+       extern void __flush_anon_page(struct vm_area_struct *vma,
+                               struct page *, unsigned long);
+       if (PageAnon(page))
+               __flush_anon_page(vma, page, vmaddr);
+}
+
+#define flush_dcache_mmap_lock(mapping) \
+       spin_lock_irq(&(mapping)->tree_lock)
+#define flush_dcache_mmap_unlock(mapping) \
+       spin_unlock_irq(&(mapping)->tree_lock)
+
+#define flush_icache_user_range(vma,page,addr,len) \
+       flush_dcache_page(page)
+
+/*
+ * We don't appear to need to do anything here.  In fact, if we did, we'd
+ * duplicate cache flushing elsewhere performed by flush_dcache_page().
+ */
+#define flush_icache_page(vma,page)    do { } while (0)
+
+static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
+       unsigned offset, size_t size)
+{
+       const void *start = (void __force *)virt + offset;
+       dmac_inv_range(start, start + size);
+}
+
+#define __cacheid_present(val)                 (val != read_cpuid(CPUID_ID))
+#define __cacheid_type_v7(val)                 ((val & (7 << 29)) == (4 << 29))
+
+#define __cacheid_vivt_prev7(val)              ((val & (15 << 25)) != (14 << 25))
+#define __cacheid_vipt_prev7(val)              ((val & (15 << 25)) == (14 << 25))
+#define __cacheid_vipt_nonaliasing_prev7(val)  ((val & (15 << 25 | 1 << 23)) == (14 << 25))
+#define __cacheid_vipt_aliasing_prev7(val)     ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23))
+
+#define __cacheid_vivt(val)                    (__cacheid_type_v7(val) ? 0 : __cacheid_vivt_prev7(val))
+#define __cacheid_vipt(val)                    (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_prev7(val))
+#define __cacheid_vipt_nonaliasing(val)                (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_nonaliasing_prev7(val))
+#define __cacheid_vipt_aliasing(val)           (__cacheid_type_v7(val) ? 0 : __cacheid_vipt_aliasing_prev7(val))
+#define __cacheid_vivt_asid_tagged_instr(val)  (__cacheid_type_v7(val) ? ((val & (3 << 14)) == (1 << 14)) : 0)
+
+#if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT)
+/*
+ * VIVT caches only
+ */
+#define cache_is_vivt()                        1
+#define cache_is_vipt()                        0
+#define cache_is_vipt_nonaliasing()    0
+#define cache_is_vipt_aliasing()       0
+#define icache_is_vivt_asid_tagged()   0
+
+#elif !defined(CONFIG_CPU_CACHE_VIVT) && defined(CONFIG_CPU_CACHE_VIPT)
+/*
+ * VIPT caches only
+ */
+#define cache_is_vivt()                        0
+#define cache_is_vipt()                        1
+#define cache_is_vipt_nonaliasing()                                    \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_vipt_nonaliasing(__val);                      \
+       })
+
+#define cache_is_vipt_aliasing()                                       \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_vipt_aliasing(__val);                         \
+       })
+
+#define icache_is_vivt_asid_tagged()                                   \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_vivt_asid_tagged_instr(__val);                \
+       })
+
+#else
+/*
+ * VIVT or VIPT caches.  Note that this is unreliable since ARM926
+ * and V6 CPUs satisfy the "(val & (15 << 25)) == (14 << 25)" test.
+ * There's no way to tell from the CacheType register what type (!)
+ * the cache is.
+ */
+#define cache_is_vivt()                                                        \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               (!__cacheid_present(__val)) || __cacheid_vivt(__val);   \
+       })
+               
+#define cache_is_vipt()                                                        \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_present(__val) && __cacheid_vipt(__val);      \
+       })
+
+#define cache_is_vipt_nonaliasing()                                    \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_present(__val) &&                             \
+                __cacheid_vipt_nonaliasing(__val);                     \
+       })
+
+#define cache_is_vipt_aliasing()                                       \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_present(__val) &&                             \
+                __cacheid_vipt_aliasing(__val);                        \
+       })
+
+#define icache_is_vivt_asid_tagged()                                   \
+       ({                                                              \
+               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
+               __cacheid_present(__val) &&                             \
+                __cacheid_vivt_asid_tagged_instr(__val);               \
+       })
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/checksum.h b/arch/arm/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..6dcc164
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ *  arch/arm/include/asm/checksum.h
+ *
+ * IP checksum routines
+ *
+ * Copyright (C) Original authors of ../asm-i386/checksum.h
+ * Copyright (C) 1996-1999 Russell King
+ */
+#ifndef __ASM_ARM_CHECKSUM_H
+#define __ASM_ARM_CHECKSUM_H
+
+#include <linux/in6.h>
+
+/*
+ * 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
+ */
+__wsum csum_partial(const void *buff, int len, __wsum sum);
+
+/*
+ * the same as csum_partial, but copies from src while it
+ * checksums, and handles user-space pointer exceptions correctly, when needed.
+ *
+ * here even more important to align src and dst on a 32-bit (or even
+ * better 64-bit) boundary
+ */
+
+__wsum
+csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
+
+__wsum
+csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
+
+/*
+ *     Fold a partial checksum without adding pseudo headers
+ */
+static inline __sum16 csum_fold(__wsum sum)
+{
+       __asm__(
+       "add    %0, %1, %1, ror #16     @ csum_fold"
+       : "=r" (sum)
+       : "r" (sum)
+       : "cc");
+       return (__force __sum16)(~(__force u32)sum >> 16);
+}
+
+/*
+ *     This is a version of ip_compute_csum() optimized for IP headers,
+ *     which always checksum on 4 octet boundaries.
+ */
+static inline __sum16
+ip_fast_csum(const void *iph, unsigned int ihl)
+{
+       unsigned int tmp1;
+       __wsum sum;
+
+       __asm__ __volatile__(
+       "ldr    %0, [%1], #4            @ ip_fast_csum          \n\
+       ldr     %3, [%1], #4                                    \n\
+       sub     %2, %2, #5                                      \n\
+       adds    %0, %0, %3                                      \n\
+       ldr     %3, [%1], #4                                    \n\
+       adcs    %0, %0, %3                                      \n\
+       ldr     %3, [%1], #4                                    \n\
+1:     adcs    %0, %0, %3                                      \n\
+       ldr     %3, [%1], #4                                    \n\
+       tst     %2, #15                 @ do this carefully     \n\
+       subne   %2, %2, #1              @ without destroying    \n\
+       bne     1b                      @ the carry flag        \n\
+       adcs    %0, %0, %3                                      \n\
+       adc     %0, %0, #0"
+       : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
+       : "1" (iph), "2" (ihl)
+       : "cc", "memory");
+       return csum_fold(sum);
+}
+
+static inline __wsum
+csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
+                  unsigned short proto, __wsum sum)
+{
+       __asm__(
+       "adds   %0, %1, %2              @ csum_tcpudp_nofold    \n\
+       adcs    %0, %0, %3                                      \n"
+#ifdef __ARMEB__
+       "adcs   %0, %0, %4                                      \n"
+#else
+       "adcs   %0, %0, %4, lsl #8                              \n"
+#endif
+       "adcs   %0, %0, %5                                      \n\
+       adc     %0, %0, #0"
+       : "=&r"(sum)
+       : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
+       : "cc");
+       return sum;
+}      
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+static inline __sum16
+csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
+                 unsigned short proto, __wsum sum)
+{
+       return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
+}
+
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+static inline __sum16
+ip_compute_csum(const void *buff, int len)
+{
+       return csum_fold(csum_partial(buff, len, 0));
+}
+
+#define _HAVE_ARCH_IPV6_CSUM
+extern __wsum
+__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
+               __be32 proto, __wsum sum);
+
+static inline __sum16
+csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
+               unsigned short proto, __wsum sum)
+{
+       return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
+                                          htonl(proto), sum));
+}
+#endif
diff --git a/arch/arm/include/asm/cnt32_to_63.h b/arch/arm/include/asm/cnt32_to_63.h
new file mode 100644 (file)
index 0000000..480c873
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ *  include/asm/cnt32_to_63.h -- extend a 32-bit counter to 63 bits
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   December 3, 2006
+ *  Copyright: MontaVista Software, Inc.
+ *
+ * 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.
+ */
+
+#ifndef __INCLUDE_CNT32_TO_63_H__
+#define __INCLUDE_CNT32_TO_63_H__
+
+#include <linux/compiler.h>
+#include <asm/types.h>
+#include <asm/byteorder.h>
+
+/*
+ * Prototype: u64 cnt32_to_63(u32 cnt)
+ * Many hardware clock counters are only 32 bits wide and therefore have
+ * a relatively short period making wrap-arounds rather frequent.  This
+ * is a problem when implementing sched_clock() for example, where a 64-bit
+ * non-wrapping monotonic value is expected to be returned.
+ *
+ * To overcome that limitation, let's extend a 32-bit counter to 63 bits
+ * in a completely lock free fashion. Bits 0 to 31 of the clock are provided
+ * by the hardware while bits 32 to 62 are stored in memory.  The top bit in
+ * memory is used to synchronize with the hardware clock half-period.  When
+ * the top bit of both counters (hardware and in memory) differ then the
+ * memory is updated with a new value, incrementing it when the hardware
+ * counter wraps around.
+ *
+ * Because a word store in memory is atomic then the incremented value will
+ * always be in synch with the top bit indicating to any potential concurrent
+ * reader if the value in memory is up to date or not with regards to the
+ * needed increment.  And any race in updating the value in memory is harmless
+ * as the same value would simply be stored more than once.
+ *
+ * The only restriction for the algorithm to work properly is that this
+ * code must be executed at least once per each half period of the 32-bit
+ * counter to properly update the state bit in memory. This is usually not a
+ * problem in practice, but if it is then a kernel timer could be scheduled
+ * to manage for this code to be executed often enough.
+ *
+ * Note that the top bit (bit 63) in the returned value should be considered
+ * as garbage.  It is not cleared here because callers are likely to use a
+ * multiplier on the returned value which can get rid of the top bit
+ * implicitly by making the multiplier even, therefore saving on a runtime
+ * clear-bit instruction. Otherwise caller must remember to clear the top
+ * bit explicitly.
+ */
+
+/* this is used only to give gcc a clue about good code generation */
+typedef union {
+       struct {
+#if defined(__LITTLE_ENDIAN)
+               u32 lo, hi;
+#elif defined(__BIG_ENDIAN)
+               u32 hi, lo;
+#endif
+       };
+       u64 val;
+} cnt32_to_63_t;
+
+#define cnt32_to_63(cnt_lo) \
+({ \
+       static volatile u32 __m_cnt_hi = 0; \
+       cnt32_to_63_t __x; \
+       __x.hi = __m_cnt_hi; \
+       __x.lo = (cnt_lo); \
+       if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \
+               __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \
+       __x.val; \
+})
+
+#endif
diff --git a/arch/arm/include/asm/cpu-multi32.h b/arch/arm/include/asm/cpu-multi32.h
new file mode 100644 (file)
index 0000000..e2b5b0b
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *  arch/arm/include/asm/cpu-multi32.h
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * 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.
+ */
+#include <asm/page.h>
+
+struct mm_struct;
+
+/*
+ * Don't change this structure - ASM code
+ * relies on it.
+ */
+extern struct processor {
+       /* MISC
+        * get data abort address/flags
+        */
+       void (*_data_abort)(unsigned long pc);
+       /*
+        * Retrieve prefetch fault address
+        */
+       unsigned long (*_prefetch_abort)(unsigned long lr);
+       /*
+        * Set up any processor specifics
+        */
+       void (*_proc_init)(void);
+       /*
+        * Disable any processor specifics
+        */
+       void (*_proc_fin)(void);
+       /*
+        * Special stuff for a reset
+        */
+       void (*reset)(unsigned long addr) __attribute__((noreturn));
+       /*
+        * Idle the processor
+        */
+       int (*_do_idle)(void);
+       /*
+        * Processor architecture specific
+        */
+       /*
+        * clean a virtual address range from the
+        * D-cache without flushing the cache.
+        */
+       void (*dcache_clean_area)(void *addr, int size);
+
+       /*
+        * Set the page table
+        */
+       void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
+       /*
+        * Set a possibly extended PTE.  Non-extended PTEs should
+        * ignore 'ext'.
+        */
+       void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
+} processor;
+
+#define cpu_proc_init()                        processor._proc_init()
+#define cpu_proc_fin()                 processor._proc_fin()
+#define cpu_reset(addr)                        processor.reset(addr)
+#define cpu_do_idle()                  processor._do_idle()
+#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
+#define cpu_set_pte_ext(ptep,pte,ext)  processor.set_pte_ext(ptep,pte,ext)
+#define cpu_do_switch_mm(pgd,mm)       processor.switch_mm(pgd,mm)
diff --git a/arch/arm/include/asm/cpu-single.h b/arch/arm/include/asm/cpu-single.h
new file mode 100644 (file)
index 0000000..f073a6d
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ *  arch/arm/include/asm/cpu-single.h
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * 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.
+ */
+/*
+ * Single CPU
+ */
+#ifdef __STDC__
+#define __catify_fn(name,x)    name##x
+#else
+#define __catify_fn(name,x)    name/**/x
+#endif
+#define __cpu_fn(name,x)       __catify_fn(name,x)
+
+/*
+ * If we are supporting multiple CPUs, then we must use a table of
+ * function pointers for this lot.  Otherwise, we can optimise the
+ * table away.
+ */
+#define cpu_proc_init                  __cpu_fn(CPU_NAME,_proc_init)
+#define cpu_proc_fin                   __cpu_fn(CPU_NAME,_proc_fin)
+#define cpu_reset                      __cpu_fn(CPU_NAME,_reset)
+#define cpu_do_idle                    __cpu_fn(CPU_NAME,_do_idle)
+#define cpu_dcache_clean_area          __cpu_fn(CPU_NAME,_dcache_clean_area)
+#define cpu_do_switch_mm               __cpu_fn(CPU_NAME,_switch_mm)
+#define cpu_set_pte_ext                        __cpu_fn(CPU_NAME,_set_pte_ext)
+
+#include <asm/page.h>
+
+struct mm_struct;
+
+/* declare all the functions as extern */
+extern void cpu_proc_init(void);
+extern void cpu_proc_fin(void);
+extern int cpu_do_idle(void);
+extern void cpu_dcache_clean_area(void *, int);
+extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
+extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
+extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/arch/arm/include/asm/cpu.h b/arch/arm/include/asm/cpu.h
new file mode 100644 (file)
index 0000000..634b2d7
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *  arch/arm/include/asm/cpu.h
+ *
+ *  Copyright (C) 2004-2005 ARM Ltd.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_CPU_H
+#define __ASM_ARM_CPU_H
+
+#include <linux/percpu.h>
+
+struct cpuinfo_arm {
+       struct cpu      cpu;
+#ifdef CONFIG_SMP
+       struct task_struct *idle;
+       unsigned int    loops_per_jiffy;
+#endif
+};
+
+DECLARE_PER_CPU(struct cpuinfo_arm, cpu_data);
+
+#endif
diff --git a/arch/arm/include/asm/cputime.h b/arch/arm/include/asm/cputime.h
new file mode 100644 (file)
index 0000000..3a8002a
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ARM_CPUTIME_H
+#define __ARM_CPUTIME_H
+
+#include <asm-generic/cputime.h>
+
+#endif /* __ARM_CPUTIME_H */
diff --git a/arch/arm/include/asm/current.h b/arch/arm/include/asm/current.h
new file mode 100644 (file)
index 0000000..75d21e2
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef _ASMARM_CURRENT_H
+#define _ASMARM_CURRENT_H
+
+#include <linux/thread_info.h>
+
+static inline struct task_struct *get_current(void) __attribute_const__;
+
+static inline struct task_struct *get_current(void)
+{
+       return current_thread_info()->task;
+}
+
+#define current (get_current())
+
+#endif /* _ASMARM_CURRENT_H */
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
new file mode 100644 (file)
index 0000000..b2deda1
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 1995-2004 Russell King
+ *
+ * Delay routines, using a pre-computed "loops_per_second" value.
+ */
+#ifndef __ASM_ARM_DELAY_H
+#define __ASM_ARM_DELAY_H
+
+#include <asm/param.h> /* HZ */
+
+extern void __delay(int loops);
+
+/*
+ * This function intentionally does not exist; if you see references to
+ * it, it means that you're calling udelay() with an out of range value.
+ *
+ * With currently imposed limits, this means that we support a max delay
+ * of 2000us. Further limits: HZ<=1000 and bogomips<=3355
+ */
+extern void __bad_udelay(void);
+
+/*
+ * division by multiplication: you don't have to worry about
+ * loss of precision.
+ *
+ * Use only for very small delays ( < 1 msec).  Should probably use a
+ * lookup table, really, as the multiplications take much too long with
+ * short delays.  This is a "reasonable" implementation, though (and the
+ * first constant multiplications gets optimized away if the delay is
+ * a constant)
+ */
+extern void __udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long);
+
+#define MAX_UDELAY_MS 2
+
+#define udelay(n)                                                      \
+       (__builtin_constant_p(n) ?                                      \
+         ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() :              \
+                       __const_udelay((n) * ((2199023U*HZ)>>11))) :    \
+         __udelay(n))
+
+#endif /* defined(_ARM_DELAY_H) */
+
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
new file mode 100644 (file)
index 0000000..c61642b
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Arch specific extensions to struct device
+ *
+ * This file is released under the GPLv2
+ */
+#ifndef ASMARM_DEVICE_H
+#define ASMARM_DEVICE_H
+
+struct dev_archdata {
+#ifdef CONFIG_DMABOUNCE
+       struct dmabounce_device_info *dmabounce;
+#endif
+};
+
+#endif
diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h
new file mode 100644 (file)
index 0000000..5001390
--- /dev/null
@@ -0,0 +1,227 @@
+#ifndef __ASM_ARM_DIV64
+#define __ASM_ARM_DIV64
+
+#include <asm/system.h>
+#include <linux/types.h>
+
+/*
+ * The semantics of do_div() are:
+ *
+ * uint32_t do_div(uint64_t *n, uint32_t base)
+ * {
+ *     uint32_t remainder = *n % base;
+ *     *n = *n / base;
+ *     return remainder;
+ * }
+ *
+ * In other words, a 64-bit dividend with a 32-bit divisor producing
+ * a 64-bit result and a 32-bit remainder.  To accomplish this optimally
+ * we call a special __do_div64 helper with completely non standard
+ * calling convention for arguments and results (beware).
+ */
+
+#ifdef __ARMEB__
+#define __xh "r0"
+#define __xl "r1"
+#else
+#define __xl "r0"
+#define __xh "r1"
+#endif
+
+#define __do_div_asm(n, base)                                  \
+({                                                             \
+       register unsigned int __base      asm("r4") = base;     \
+       register unsigned long long __n   asm("r0") = n;        \
+       register unsigned long long __res asm("r2");            \
+       register unsigned int __rem       asm(__xh);            \
+       asm(    __asmeq("%0", __xh)                             \
+               __asmeq("%1", "r2")                             \
+               __asmeq("%2", "r0")                             \
+               __asmeq("%3", "r4")                             \
+               "bl     __do_div64"                             \
+               : "=r" (__rem), "=r" (__res)                    \
+               : "r" (__n), "r" (__base)                       \
+               : "ip", "lr", "cc");                            \
+       n = __res;                                              \
+       __rem;                                                  \
+})
+
+#if __GNUC__ < 4
+
+/*
+ * gcc versions earlier than 4.0 are simply too problematic for the
+ * optimized implementation below. First there is gcc PR 15089 that
+ * tend to trig on more complex constructs, spurious .global __udivsi3
+ * are inserted even if none of those symbols are referenced in the
+ * generated code, and those gcc versions are not able to do constant
+ * propagation on long long values anyway.
+ */
+#define do_div(n, base) __do_div_asm(n, base)
+
+#elif __GNUC__ >= 4
+
+#include <asm/bug.h>
+
+/*
+ * If the divisor happens to be constant, we determine the appropriate
+ * inverse at compile time to turn the division into a few inline
+ * multiplications instead which is much faster. And yet only if compiling
+ * for ARMv4 or higher (we need umull/umlal) and if the gcc version is
+ * sufficiently recent to perform proper long long constant propagation.
+ * (It is unfortunate that gcc doesn't perform all this internally.)
+ */
+#define do_div(n, base)                                                        \
+({                                                                     \
+       unsigned int __r, __b = (base);                                 \
+       if (!__builtin_constant_p(__b) || __b == 0 ||                   \
+           (__LINUX_ARM_ARCH__ < 4 && (__b & (__b - 1)) != 0)) {       \
+               /* non-constant divisor (or zero): slow path */         \
+               __r = __do_div_asm(n, __b);                             \
+       } else if ((__b & (__b - 1)) == 0) {                            \
+               /* Trivial: __b is constant and a power of 2 */         \
+               /* gcc does the right thing with this code.  */         \
+               __r = n;                                                \
+               __r &= (__b - 1);                                       \
+               n /= __b;                                               \
+       } else {                                                        \
+               /* Multiply by inverse of __b: n/b = n*(p/b)/p       */ \
+               /* We rely on the fact that most of this code gets   */ \
+               /* optimized away at compile time due to constant    */ \
+               /* propagation and only a couple inline assembly     */ \
+               /* instructions should remain. Better avoid any      */ \
+               /* code construct that might prevent that.           */ \
+               unsigned long long __res, __x, __t, __m, __n = n;       \
+               unsigned int __c, __p, __z = 0;                         \
+               /* preserve low part of n for reminder computation */   \
+               __r = __n;                                              \
+               /* determine number of bits to represent __b */         \
+               __p = 1 << __div64_fls(__b);                            \
+               /* compute __m = ((__p << 64) + __b - 1) / __b */       \
+               __m = (~0ULL / __b) * __p;                              \
+               __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b;     \
+               /* compute __res = __m*(~0ULL/__b*__b-1)/(__p << 64) */ \
+               __x = ~0ULL / __b * __b - 1;                            \
+               __res = (__m & 0xffffffff) * (__x & 0xffffffff);        \
+               __res >>= 32;                                           \
+               __res += (__m & 0xffffffff) * (__x >> 32);              \
+               __t = __res;                                            \
+               __res += (__x & 0xffffffff) * (__m >> 32);              \
+               __t = (__res < __t) ? (1ULL << 32) : 0;                 \
+               __res = (__res >> 32) + __t;                            \
+               __res += (__m >> 32) * (__x >> 32);                     \
+               __res /= __p;                                           \
+               /* Now sanitize and optimize what we've got. */         \
+               if (~0ULL % (__b / (__b & -__b)) == 0) {                \
+                       /* those cases can be simplified with: */       \
+                       __n /= (__b & -__b);                            \
+                       __m = ~0ULL / (__b / (__b & -__b));             \
+                       __p = 1;                                        \
+                       __c = 1;                                        \
+               } else if (__res != __x / __b) {                        \
+                       /* We can't get away without a correction    */ \
+                       /* to compensate for bit truncation errors.  */ \
+                       /* To avoid it we'd need an additional bit   */ \
+                       /* to represent __m which would overflow it. */ \
+                       /* Instead we do m=p/b and n/b=(n*m+m)/p.    */ \
+                       __c = 1;                                        \
+                       /* Compute __m = (__p << 64) / __b */           \
+                       __m = (~0ULL / __b) * __p;                      \
+                       __m += ((~0ULL % __b + 1) * __p) / __b;         \
+               } else {                                                \
+                       /* Reduce __m/__p, and try to clear bit 31   */ \
+                       /* of __m when possible otherwise that'll    */ \
+                       /* need extra overflow handling later.       */ \
+                       unsigned int __bits = -(__m & -__m);            \
+                       __bits |= __m >> 32;                            \
+                       __bits = (~__bits) << 1;                        \
+                       /* If __bits == 0 then setting bit 31 is     */ \
+                       /* unavoidable.  Simply apply the maximum    */ \
+                       /* possible reduction in that case.          */ \
+                       /* Otherwise the MSB of __bits indicates the */ \
+                       /* best reduction we should apply.           */ \
+                       if (!__bits) {                                  \
+                               __p /= (__m & -__m);                    \
+                               __m /= (__m & -__m);                    \
+                       } else {                                        \
+                               __p >>= __div64_fls(__bits);            \
+                               __m >>= __div64_fls(__bits);            \
+                       }                                               \
+                       /* No correction needed. */                     \
+                       __c = 0;                                        \
+               }                                                       \
+               /* Now we have a combination of 2 conditions:        */ \
+               /* 1) whether or not we need a correction (__c), and */ \
+               /* 2) whether or not there might be an overflow in   */ \
+               /*    the cross product (__m & ((1<<63) | (1<<31)))  */ \
+               /* Select the best insn combination to perform the   */ \
+               /* actual __m * __n / (__p << 64) operation.         */ \
+               if (!__c) {                                             \
+                       asm (   "umull  %Q0, %R0, %1, %Q2\n\t"          \
+                               "mov    %Q0, #0"                        \
+                               : "=&r" (__res)                         \
+                               : "r" (__m), "r" (__n)                  \
+                               : "cc" );                               \
+               } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) {    \
+                       __res = __m;                                    \
+                       asm (   "umlal  %Q0, %R0, %Q1, %Q2\n\t"         \
+                               "mov    %Q0, #0"                        \
+                               : "+r" (__res)                          \
+                               : "r" (__m), "r" (__n)                  \
+                               : "cc" );                               \
+               } else {                                                \
+                       asm (   "umull  %Q0, %R0, %Q1, %Q2\n\t"         \
+                               "cmn    %Q0, %Q1\n\t"                   \
+                               "adcs   %R0, %R0, %R1\n\t"              \
+                               "adc    %Q0, %3, #0"                    \
+                               : "=&r" (__res)                         \
+                               : "r" (__m), "r" (__n), "r" (__z)       \
+                               : "cc" );                               \
+               }                                                       \
+               if (!(__m & ((1ULL << 63) | (1ULL << 31)))) {           \
+                       asm (   "umlal  %R0, %Q0, %R1, %Q2\n\t"         \
+                               "umlal  %R0, %Q0, %Q1, %R2\n\t"         \
+                               "mov    %R0, #0\n\t"                    \
+                               "umlal  %Q0, %R0, %R1, %R2"             \
+                               : "+r" (__res)                          \
+                               : "r" (__m), "r" (__n)                  \
+                               : "cc" );                               \
+               } else {                                                \
+                       asm (   "umlal  %R0, %Q0, %R2, %Q3\n\t"         \
+                               "umlal  %R0, %1, %Q2, %R3\n\t"          \
+                               "mov    %R0, #0\n\t"                    \
+                               "adds   %Q0, %1, %Q0\n\t"               \
+                               "adc    %R0, %R0, #0\n\t"               \
+                               "umlal  %Q0, %R0, %R2, %R3"             \
+                               : "+r" (__res), "+r" (__z)              \
+                               : "r" (__m), "r" (__n)                  \
+                               : "cc" );                               \
+               }                                                       \
+               __res /= __p;                                           \
+               /* The reminder can be computed with 32-bit regs     */ \
+               /* only, and gcc is good at that.                    */ \
+               {                                                       \
+                       unsigned int __res0 = __res;                    \
+                       unsigned int __b0 = __b;                        \
+                       __r -= __res0 * __b0;                           \
+               }                                                       \
+               /* BUG_ON(__r >= __b || __res * __b + __r != n); */     \
+               n = __res;                                              \
+       }                                                               \
+       __r;                                                            \
+})
+
+/* our own fls implementation to make sure constant propagation is fine */
+#define __div64_fls(bits)                                              \
+({                                                                     \
+       unsigned int __left = (bits), __nr = 0;                         \
+       if (__left & 0xffff0000) __nr += 16, __left >>= 16;             \
+       if (__left & 0x0000ff00) __nr +=  8, __left >>=  8;             \
+       if (__left & 0x000000f0) __nr +=  4, __left >>=  4;             \
+       if (__left & 0x0000000c) __nr +=  2, __left >>=  2;             \
+       if (__left & 0x00000002) __nr +=  1;                            \
+       __nr;                                                           \
+})
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..45329fc
--- /dev/null
@@ -0,0 +1,458 @@
+#ifndef ASMARM_DMA_MAPPING_H
+#define ASMARM_DMA_MAPPING_H
+
+#ifdef __KERNEL__
+
+#include <linux/mm.h> /* need struct page */
+
+#include <linux/scatterlist.h>
+
+#include <asm-generic/dma-coherent.h>
+
+/*
+ * DMA-consistent mapping functions.  These allocate/free a region of
+ * uncached, unwrite-buffered mapped memory space for use with DMA
+ * devices.  This is the "generic" version.  The PCI specific version
+ * is in pci.h
+ *
+ * Note: Drivers should NOT use this function directly, as it will break
+ * platforms with CONFIG_DMABOUNCE.
+ * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
+ */
+extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
+
+/*
+ * Return whether the given device DMA address mask can be supported
+ * properly.  For example, if your device can only drive the low 24-bits
+ * during bus mastering, then you would pass 0x00ffffff as the mask
+ * to this function.
+ *
+ * FIXME: This should really be a platform specific issue - we should
+ * return false if GFP_DMA allocations may not satisfy the supplied 'mask'.
+ */
+static inline int dma_supported(struct device *dev, u64 mask)
+{
+       return dev->dma_mask && *dev->dma_mask != 0;
+}
+
+static inline int dma_set_mask(struct device *dev, u64 dma_mask)
+{
+       if (!dev->dma_mask || !dma_supported(dev, dma_mask))
+               return -EIO;
+
+       *dev->dma_mask = dma_mask;
+
+       return 0;
+}
+
+static inline int dma_get_cache_alignment(void)
+{
+       return 32;
+}
+
+static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
+{
+       return !!arch_is_coherent();
+}
+
+/*
+ * DMA errors are defined by all-bits-set in the DMA address.
+ */
+static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+       return dma_addr == ~0;
+}
+
+/*
+ * Dummy noncoherent implementation.  We don't provide a dma_cache_sync
+ * function so drivers using this API are highlighted with build warnings.
+ */
+static inline void *
+dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
+{
+       return NULL;
+}
+
+static inline void
+dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
+                    dma_addr_t handle)
+{
+}
+
+/**
+ * dma_alloc_coherent - allocate consistent memory for DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: required memory size
+ * @handle: bus-specific DMA address
+ *
+ * Allocate some uncached, unbuffered memory for a device for
+ * performing DMA.  This function allocates pages, and will
+ * return the CPU-viewed address, and sets @handle to be the
+ * device-viewed address.
+ */
+extern void *
+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
+
+/**
+ * dma_free_coherent - free memory allocated by dma_alloc_coherent
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: size of memory originally requested in dma_alloc_coherent
+ * @cpu_addr: CPU-view address returned from dma_alloc_coherent
+ * @handle: device-view address returned from dma_alloc_coherent
+ *
+ * Free (and unmap) a DMA buffer previously allocated by
+ * dma_alloc_coherent().
+ *
+ * References to memory and mappings associated with cpu_addr/handle
+ * during and after this call executing are illegal.
+ */
+extern void
+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
+                 dma_addr_t handle);
+
+/**
+ * dma_mmap_coherent - map a coherent DMA allocation into user space
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @vma: vm_area_struct describing requested user mapping
+ * @cpu_addr: kernel CPU-view address returned from dma_alloc_coherent
+ * @handle: device-view address returned from dma_alloc_coherent
+ * @size: size of memory originally requested in dma_alloc_coherent
+ *
+ * Map a coherent DMA buffer previously allocated by dma_alloc_coherent
+ * into user space.  The coherent DMA buffer must not be freed by the
+ * driver until the user space mapping has been released.
+ */
+int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
+                     void *cpu_addr, dma_addr_t handle, size_t size);
+
+
+/**
+ * dma_alloc_writecombine - allocate writecombining memory for DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: required memory size
+ * @handle: bus-specific DMA address
+ *
+ * Allocate some uncached, buffered memory for a device for
+ * performing DMA.  This function allocates pages, and will
+ * return the CPU-viewed address, and sets @handle to be the
+ * device-viewed address.
+ */
+extern void *
+dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
+
+#define dma_free_writecombine(dev,size,cpu_addr,handle) \
+       dma_free_coherent(dev,size,cpu_addr,handle)
+
+int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma,
+                         void *cpu_addr, dma_addr_t handle, size_t size);
+
+
+/**
+ * dma_map_single - map a single buffer for streaming DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @cpu_addr: CPU direct mapped address of buffer
+ * @size: size of buffer to map
+ * @dir: DMA transfer direction
+ *
+ * Ensure that any data held in the cache is appropriately discarded
+ * or written back.
+ *
+ * The device owns this memory once this call has completed.  The CPU
+ * can regain ownership by calling dma_unmap_single() or
+ * dma_sync_single_for_cpu().
+ */
+#ifndef CONFIG_DMABOUNCE
+static inline dma_addr_t
+dma_map_single(struct device *dev, void *cpu_addr, size_t size,
+              enum dma_data_direction dir)
+{
+       if (!arch_is_coherent())
+               dma_cache_maint(cpu_addr, size, dir);
+
+       return virt_to_dma(dev, (unsigned long)cpu_addr);
+}
+#else
+extern dma_addr_t dma_map_single(struct device *,void *, size_t, enum dma_data_direction);
+#endif
+
+/**
+ * dma_map_page - map a portion of a page for streaming DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @page: page that buffer resides in
+ * @offset: offset into page for start of buffer
+ * @size: size of buffer to map
+ * @dir: DMA transfer direction
+ *
+ * Ensure that any data held in the cache is appropriately discarded
+ * or written back.
+ *
+ * The device owns this memory once this call has completed.  The CPU
+ * can regain ownership by calling dma_unmap_page() or
+ * dma_sync_single_for_cpu().
+ */
+static inline dma_addr_t
+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);
+}
+
+/**
+ * dma_unmap_single - unmap a single buffer previously mapped
+ * @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
+ *
+ * Unmap a single streaming mode DMA translation.  The handle and size
+ * must match what was provided in the previous dma_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.
+ */
+#ifndef CONFIG_DMABOUNCE
+static inline void
+dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
+                enum dma_data_direction dir)
+{
+       /* nothing to do */
+}
+#else
+extern void dma_unmap_single(struct device *, dma_addr_t, size_t, enum dma_data_direction);
+#endif
+
+/**
+ * dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
+ * @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
+ *
+ * Unmap a single streaming mode DMA translation.  The handle and size
+ * must match what was provided in the previous dma_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.
+ */
+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_map_sg - map a set of SG buffers for streaming mode DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Map a set of buffers described by scatterlist in streaming
+ * mode for DMA.  This is the scatter-gather version of the
+ * above dma_map_single interface.  Here the scatter gather list
+ * elements are each tagged with the appropriate 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 dma_map_single are
+ * the same here.
+ */
+#ifndef CONFIG_DMABOUNCE
+static inline int
+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
+          enum dma_data_direction dir)
+{
+       int i;
+
+       for (i = 0; i < nents; i++, sg++) {
+               char *virt;
+
+               sg->dma_address = page_to_dma(dev, sg_page(sg)) + sg->offset;
+               virt = sg_virt(sg);
+
+               if (!arch_is_coherent())
+                       dma_cache_maint(virt, sg->length, dir);
+       }
+
+       return nents;
+}
+#else
+extern int dma_map_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
+#endif
+
+/**
+ * dma_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Unmap a set of streaming mode DMA translations.
+ * Again, CPU read rules concerning calls here are the same as for
+ * dma_unmap_single() above.
+ */
+#ifndef CONFIG_DMABOUNCE
+static inline void
+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
+            enum dma_data_direction dir)
+{
+
+       /* nothing to do */
+}
+#else
+extern void dma_unmap_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
+#endif
+
+
+/**
+ * dma_sync_single_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
+ *
+ * Make physical memory consistent for a single streaming mode DMA
+ * translation after a transfer.
+ *
+ * If you perform a dma_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 the perform a dma_sync_for_device, and then the
+ * device again owns the buffer.
+ */
+#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)
+{
+       if (!arch_is_coherent())
+               dma_cache_maint((void *)dma_to_virt(dev, handle), 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)
+{
+       if (!arch_is_coherent())
+               dma_cache_maint((void *)dma_to_virt(dev, handle), 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);
+#endif
+
+
+/**
+ * dma_sync_sg_for_cpu
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Make physical memory consistent for a set of streaming
+ * mode DMA translations after a transfer.
+ *
+ * The same as dma_sync_single_for_* but for a scatter-gather list,
+ * same rules and usage.
+ */
+#ifndef CONFIG_DMABOUNCE
+static inline void
+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
+                   enum dma_data_direction dir)
+{
+       int i;
+
+       for (i = 0; i < nents; i++, sg++) {
+               char *virt = sg_virt(sg);
+               if (!arch_is_coherent())
+                       dma_cache_maint(virt, sg->length, dir);
+       }
+}
+
+static inline void
+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
+                      enum dma_data_direction dir)
+{
+       int i;
+
+       for (i = 0; i < nents; i++, sg++) {
+               char *virt = sg_virt(sg);
+               if (!arch_is_coherent())
+                       dma_cache_maint(virt, sg->length, dir);
+       }
+}
+#else
+extern void dma_sync_sg_for_cpu(struct device*, struct scatterlist*, int, enum dma_data_direction);
+extern void dma_sync_sg_for_device(struct device*, struct scatterlist*, int, enum dma_data_direction);
+#endif
+
+#ifdef CONFIG_DMABOUNCE
+/*
+ * For SA-1111, IXP425, and ADI systems  the dma-mapping functions are "magic"
+ * and utilize bounce buffers as needed to work around limited DMA windows.
+ *
+ * On the SA-1111, a bug limits DMA to only certain regions of RAM.
+ * On the IXP425, the PCI inbound window is 64MB (256MB total RAM)
+ * On some ADI engineering systems, PCI inbound window is 32MB (12MB total RAM)
+ *
+ * The following are helper functions used by the dmabounce subystem
+ *
+ */
+
+/**
+ * dmabounce_register_dev
+ *
+ * @dev: valid struct device pointer
+ * @small_buf_size: size of buffers to use with small buffer pool
+ * @large_buf_size: size of buffers to use with large buffer pool (can be 0)
+ *
+ * This function should be called by low-level platform code to register
+ * a device as requireing DMA buffer bouncing. The function will allocate
+ * appropriate DMA pools for the device.
+ *
+ */
+extern int dmabounce_register_dev(struct device *, unsigned long, unsigned long);
+
+/**
+ * dmabounce_unregister_dev
+ *
+ * @dev: valid struct device pointer
+ *
+ * This function should be called by low-level platform code when device
+ * that was previously registered with dmabounce_register_dev is removed
+ * from the system.
+ *
+ */
+extern void dmabounce_unregister_dev(struct device *);
+
+/**
+ * dma_needs_bounce
+ *
+ * @dev: valid struct device pointer
+ * @dma_handle: dma_handle of unbounced buffer
+ * @size: size of region being mapped
+ *
+ * Platforms that utilize the dmabounce mechanism must implement
+ * this function.
+ *
+ * The dmabounce routines call this function whenever a dma-mapping
+ * is requested to determine whether a given buffer needs to be bounced
+ * or not. The function must return 0 if the buffer is OK for
+ * DMA access and 1 if the buffer needs to be bounced.
+ *
+ */
+extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
+#endif /* CONFIG_DMABOUNCE */
+
+#endif /* __KERNEL__ */
+#endif
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
new file mode 100644 (file)
index 0000000..9f2c530
--- /dev/null
@@ -0,0 +1,143 @@
+#ifndef __ASM_ARM_DMA_H
+#define __ASM_ARM_DMA_H
+
+typedef unsigned int dmach_t;
+
+#include <linux/spinlock.h>
+#include <asm/system.h>
+#include <asm/scatterlist.h>
+#include <asm/arch/dma.h>
+
+/*
+ * This is the maximum virtual address which can be DMA'd from.
+ */
+#ifndef MAX_DMA_ADDRESS
+#define MAX_DMA_ADDRESS        0xffffffff
+#endif
+
+/*
+ * DMA modes
+ */
+typedef unsigned int dmamode_t;
+
+#define DMA_MODE_MASK  3
+
+#define DMA_MODE_READ   0
+#define DMA_MODE_WRITE  1
+#define DMA_MODE_CASCADE 2
+#define DMA_AUTOINIT    4
+
+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);
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ */
+#define clear_dma_ff(channel)
+
+/* Set only the page register bits of the transfer address.
+ *
+ * NOTE: This is an architecture specific function, and should
+ *       be hidden from the drivers
+ */
+extern void set_dma_page(dmach_t channel, char pagenr);
+
+/* Request a DMA channel
+ *
+ * Some architectures may need to do allocate an interrupt
+ */
+extern int  request_dma(dmach_t channel, const char * device_id);
+
+/* Free a DMA channel
+ *
+ * Some architectures may need to do free an interrupt
+ */
+extern void free_dma(dmach_t channel);
+
+/* Enable DMA for this channel
+ *
+ * On some architectures, this may have other side effects like
+ * enabling an interrupt and setting the DMA registers.
+ */
+extern void enable_dma(dmach_t channel);
+
+/* Disable DMA for this channel
+ *
+ * On some architectures, this may have other side effects like
+ * disabling an interrupt or whatever.
+ */
+extern void disable_dma(dmach_t channel);
+
+/* Test whether the specified channel has an active DMA transfer
+ */
+extern int dma_channel_active(dmach_t channel);
+
+/* Set the DMA scatter gather list for this channel
+ *
+ * This should not be called if a DMA channel is enabled,
+ * especially since some DMA architectures don't update the
+ * DMA address immediately, but defer it to the enable_dma().
+ */
+extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
+
+/* Set the DMA address for this channel
+ *
+ * This should not be called if a DMA channel is enabled,
+ * especially since some DMA architectures don't update the
+ * DMA address immediately, but defer it to the enable_dma().
+ */
+extern void __set_dma_addr(dmach_t channel, void *addr);
+#define set_dma_addr(channel, addr)                            \
+       __set_dma_addr(channel, bus_to_virt(addr))
+
+/* Set the DMA byte count for this channel
+ *
+ * This should not be called if a DMA channel is enabled,
+ * especially since some DMA architectures don't update the
+ * DMA count immediately, but defer it to the enable_dma().
+ */
+extern void set_dma_count(dmach_t channel, unsigned long count);
+
+/* Set the transfer direction for this channel
+ *
+ * This should not be called if a DMA channel is enabled,
+ * especially since some DMA architectures don't update the
+ * DMA transfer direction immediately, but defer it to the
+ * enable_dma().
+ */
+extern void set_dma_mode(dmach_t channel, dmamode_t mode);
+
+/* Set the transfer speed for this channel
+ */
+extern void set_dma_speed(dmach_t channel, int cycle_ns);
+
+/* 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.
+ */
+extern int  get_dma_residue(dmach_t channel);
+
+#ifndef NO_DMA
+#define NO_DMA 255
+#endif
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy    (0)
+#endif
+
+#endif /* _ARM_DMA_H */
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
new file mode 100644 (file)
index 0000000..cc7ef40
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ *  arch/arm/include/asm/domain.h
+ *
+ *  Copyright (C) 1999 Russell King.
+ *
+ * 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.
+ */
+#ifndef __ASM_PROC_DOMAIN_H
+#define __ASM_PROC_DOMAIN_H
+
+/*
+ * Domain numbers
+ *
+ *  DOMAIN_IO     - domain 2 includes all IO only
+ *  DOMAIN_USER   - domain 1 includes all user memory only
+ *  DOMAIN_KERNEL - domain 0 includes all kernel memory only
+ *
+ * The domain numbering depends on whether we support 36 physical
+ * address for I/O or not.  Addresses above the 32 bit boundary can
+ * only be mapped using supersections and supersections can only
+ * be set for domain 0.  We could just default to DOMAIN_IO as zero,
+ * but there may be systems with supersection support and no 36-bit
+ * addressing.  In such cases, we want to map system memory with
+ * supersections to reduce TLB misses and footprint.
+ *
+ * 36-bit addressing and supersections are only available on
+ * CPUs based on ARMv6+ or the Intel XSC3 core.
+ */
+#ifndef CONFIG_IO_36
+#define DOMAIN_KERNEL  0
+#define DOMAIN_TABLE   0
+#define DOMAIN_USER    1
+#define DOMAIN_IO      2
+#else
+#define DOMAIN_KERNEL  2
+#define DOMAIN_TABLE   2
+#define DOMAIN_USER    1
+#define DOMAIN_IO      0
+#endif
+
+/*
+ * Domain types
+ */
+#define DOMAIN_NOACCESS        0
+#define DOMAIN_CLIENT  1
+#define DOMAIN_MANAGER 3
+
+#define domain_val(dom,type)   ((type) << (2*(dom)))
+
+#ifndef __ASSEMBLY__
+
+#ifdef CONFIG_MMU
+#define set_domain(x)                                  \
+       do {                                            \
+       __asm__ __volatile__(                           \
+       "mcr    p15, 0, %0, c3, c0      @ set domain"   \
+         : : "r" (x));                                 \
+       isb();                                          \
+       } while (0)
+
+#define modify_domain(dom,type)                                        \
+       do {                                                    \
+       struct thread_info *thread = current_thread_info();     \
+       unsigned int domain = thread->cpu_domain;               \
+       domain &= ~domain_val(dom, DOMAIN_MANAGER);             \
+       thread->cpu_domain = domain | domain_val(dom, type);    \
+       set_domain(thread->cpu_domain);                         \
+       } while (0)
+
+#else
+#define set_domain(x)          do { } while (0)
+#define modify_domain(dom,type)        do { } while (0)
+#endif
+
+#endif
+#endif /* !__ASSEMBLY__ */
diff --git a/arch/arm/include/asm/ecard.h b/arch/arm/include/asm/ecard.h
new file mode 100644 (file)
index 0000000..29f2610
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * arch/arm/include/asm/ecard.h
+ *
+ * definitions for expansion cards
+ *
+ * This is a new system as from Linux 1.2.3
+ *
+ * Changelog:
+ *  11-12-1996 RMK     Further minor improvements
+ *  12-09-1997 RMK     Added interrupt enable/disable for card level
+ *
+ * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
+ */
+
+#ifndef __ASM_ECARD_H
+#define __ASM_ECARD_H
+
+/*
+ * Currently understood cards (but not necessarily
+ * supported):
+ *                        Manufacturer  Product ID
+ */
+#define MANU_ACORN             0x0000
+#define PROD_ACORN_SCSI                        0x0002
+#define PROD_ACORN_ETHER1              0x0003
+#define PROD_ACORN_MFM                 0x000b
+
+#define MANU_ANT2              0x0011
+#define PROD_ANT_ETHER3                        0x00a4
+
+#define MANU_ATOMWIDE          0x0017
+#define PROD_ATOMWIDE_3PSERIAL         0x0090
+
+#define MANU_IRLAM_INSTRUMENTS 0x001f
+#define MANU_IRLAM_INSTRUMENTS_ETHERN  0x5678
+
+#define MANU_OAK               0x0021
+#define PROD_OAK_SCSI                  0x0058
+
+#define MANU_MORLEY            0x002b
+#define PROD_MORLEY_SCSI_UNCACHED      0x0067
+
+#define MANU_CUMANA            0x003a
+#define PROD_CUMANA_SCSI_2             0x003a
+#define PROD_CUMANA_SCSI_1             0x00a0
+
+#define MANU_ICS               0x003c
+#define PROD_ICS_IDE                   0x00ae
+
+#define MANU_ICS2              0x003d
+#define PROD_ICS2_IDE                  0x00ae
+
+#define MANU_SERPORT           0x003f
+#define PROD_SERPORT_DSPORT            0x00b9
+
+#define MANU_ARXE              0x0041
+#define PROD_ARXE_SCSI                 0x00be
+
+#define MANU_I3                        0x0046
+#define PROD_I3_ETHERLAN500            0x00d4
+#define PROD_I3_ETHERLAN600            0x00ec
+#define PROD_I3_ETHERLAN600A           0x011e
+
+#define MANU_ANT               0x0053
+#define PROD_ANT_ETHERM                        0x00d8
+#define PROD_ANT_ETHERB                        0x00e4
+
+#define MANU_ALSYSTEMS         0x005b
+#define PROD_ALSYS_SCSIATAPI           0x0107
+
+#define MANU_MCS               0x0063
+#define PROD_MCS_CONNECT32             0x0125
+
+#define MANU_EESOX             0x0064
+#define PROD_EESOX_SCSI2               0x008c
+
+#define MANU_YELLOWSTONE       0x0096
+#define PROD_YELLOWSTONE_RAPIDE32      0x0120
+
+#ifdef ECARD_C
+#define CONST
+#else
+#define CONST const
+#endif
+
+#define MAX_ECARDS     9
+
+struct ecard_id {                      /* Card ID structure            */
+       unsigned short  manufacturer;
+       unsigned short  product;
+       void            *data;
+};
+
+struct in_ecid {                       /* Packed card ID information   */
+       unsigned short  product;        /* Product code                 */
+       unsigned short  manufacturer;   /* Manufacturer code            */
+       unsigned char   id:4;           /* Simple ID                    */
+       unsigned char   cd:1;           /* Chunk dir present            */
+       unsigned char   is:1;           /* Interrupt status pointers    */
+       unsigned char   w:2;            /* Width                        */
+       unsigned char   country;        /* Country                      */
+       unsigned char   irqmask;        /* IRQ mask                     */
+       unsigned char   fiqmask;        /* FIQ mask                     */
+       unsigned long   irqoff;         /* IRQ offset                   */
+       unsigned long   fiqoff;         /* FIQ offset                   */
+};
+
+typedef struct expansion_card ecard_t;
+typedef unsigned long *loader_t;
+
+typedef struct expansion_card_ops {    /* Card handler routines        */
+       void (*irqenable)(ecard_t *ec, int irqnr);
+       void (*irqdisable)(ecard_t *ec, int irqnr);
+       int  (*irqpending)(ecard_t *ec);
+       void (*fiqenable)(ecard_t *ec, int fiqnr);
+       void (*fiqdisable)(ecard_t *ec, int fiqnr);
+       int  (*fiqpending)(ecard_t *ec);
+} expansioncard_ops_t;
+
+#define ECARD_NUM_RESOURCES    (6)
+
+#define ECARD_RES_IOCSLOW      (0)
+#define ECARD_RES_IOCMEDIUM    (1)
+#define ECARD_RES_IOCFAST      (2)
+#define ECARD_RES_IOCSYNC      (3)
+#define ECARD_RES_MEMC         (4)
+#define ECARD_RES_EASI         (5)
+
+#define ecard_resource_start(ec,nr)    ((ec)->resource[nr].start)
+#define ecard_resource_end(ec,nr)      ((ec)->resource[nr].end)
+#define ecard_resource_len(ec,nr)      ((ec)->resource[nr].end - \
+                                        (ec)->resource[nr].start + 1)
+#define ecard_resource_flags(ec,nr)    ((ec)->resource[nr].flags)
+
+/*
+ * This contains all the info needed on an expansion card
+ */
+struct expansion_card {
+       struct expansion_card  *next;
+
+       struct device           dev;
+       struct resource         resource[ECARD_NUM_RESOURCES];
+
+       /* Public data */
+       void __iomem            *irqaddr;       /* address of IRQ register      */
+       void __iomem            *fiqaddr;       /* address of FIQ register      */
+       unsigned char           irqmask;        /* IRQ mask                     */
+       unsigned char           fiqmask;        /* FIQ mask                     */
+       unsigned char           claimed;        /* Card claimed?                */
+       unsigned char           easi;           /* EASI card                    */
+
+       void                    *irq_data;      /* Data for use for IRQ by card */
+       void                    *fiq_data;      /* Data for use for FIQ by card */
+       const expansioncard_ops_t *ops;         /* Enable/Disable Ops for card  */
+
+       CONST unsigned int      slot_no;        /* Slot number                  */
+       CONST unsigned int      dma;            /* DMA number (for request_dma) */
+       CONST unsigned int      irq;            /* IRQ number (for request_irq) */
+       CONST unsigned int      fiq;            /* FIQ number (for request_irq) */
+       CONST struct in_ecid    cid;            /* Card Identification          */
+
+       /* Private internal data */
+       const char              *card_desc;     /* Card description             */
+       CONST unsigned int      podaddr;        /* Base Linux address for card  */
+       CONST loader_t          loader;         /* loader program */
+       u64                     dma_mask;
+};
+
+void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *ops, void *irq_data);
+
+struct in_chunk_dir {
+       unsigned int start_offset;
+       union {
+               unsigned char string[256];
+               unsigned char data[1];
+       } d;
+};
+
+/*
+ * Read a chunk from an expansion card
+ * cd : where to put read data
+ * ec : expansion card info struct
+ * id : id number to find
+ * num: (n+1)'th id to find.
+ */
+extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
+
+/*
+ * Request and release ecard resources
+ */
+extern int ecard_request_resources(struct expansion_card *ec);
+extern void ecard_release_resources(struct expansion_card *ec);
+
+void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
+                          unsigned long offset, unsigned long maxsize);
+#define ecardm_iounmap(__ec, __addr)   devm_iounmap(&(__ec)->dev, __addr)
+
+extern struct bus_type ecard_bus_type;
+
+#define ECARD_DEV(_d)  container_of((_d), struct expansion_card, dev)
+
+struct ecard_driver {
+       int                     (*probe)(struct expansion_card *, const struct ecard_id *id);
+       void                    (*remove)(struct expansion_card *);
+       void                    (*shutdown)(struct expansion_card *);
+       const struct ecard_id   *id_table;
+       unsigned int            id;
+       struct device_driver    drv;
+};
+
+#define ECARD_DRV(_d)  container_of((_d), struct ecard_driver, drv)
+
+#define ecard_set_drvdata(ec,data)     dev_set_drvdata(&(ec)->dev, (data))
+#define ecard_get_drvdata(ec)          dev_get_drvdata(&(ec)->dev)
+
+int ecard_register_driver(struct ecard_driver *);
+void ecard_remove_driver(struct ecard_driver *);
+
+#endif
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
new file mode 100644 (file)
index 0000000..4ca7516
--- /dev/null
@@ -0,0 +1,116 @@
+#ifndef __ASMARM_ELF_H
+#define __ASMARM_ELF_H
+
+#include <asm/hwcap.h>
+
+#ifndef __ASSEMBLY__
+/*
+ * ELF register definitions..
+ */
+#include <asm/ptrace.h>
+#include <asm/user.h>
+
+typedef unsigned long elf_greg_t;
+typedef unsigned long elf_freg_t[3];
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_fp elf_fpregset_t;
+#endif
+
+#define EM_ARM 40
+#define EF_ARM_APCS26 0x08
+#define EF_ARM_SOFT_FLOAT 0x200
+#define EF_ARM_EABI_MASK 0xFF000000
+
+#define R_ARM_NONE     0
+#define R_ARM_PC24     1
+#define R_ARM_ABS32    2
+#define R_ARM_CALL     28
+#define R_ARM_JUMP24   29
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS      ELFCLASS32
+#ifdef __ARMEB__
+#define ELF_DATA       ELFDATA2MSB
+#else
+#define ELF_DATA       ELFDATA2LSB
+#endif
+#define ELF_ARCH       EM_ARM
+
+#ifndef __ASSEMBLY__
+/*
+ * 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.
+ *
+ * For now we just provide a fairly general string that describes the
+ * processor family.  This could be made more specific later if someone
+ * implemented optimisations that require it.  26-bit CPUs give you
+ * "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
+ * supported).  32-bit CPUs give you "v3[lb]" for anything based on an
+ * ARM6 or ARM7 core and "armv4[lb]" for anything based on a StrongARM-1
+ * core.
+ */
+#define ELF_PLATFORM_SIZE 8
+#define ELF_PLATFORM   (elf_platform)
+
+extern char elf_platform[];
+#endif
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ((x)->e_machine == EM_ARM && ELF_PROC_OK(x))
+
+/*
+ * 32-bit code is always OK.  Some cpus can do 26-bit, some can't.
+ */
+#define ELF_PROC_OK(x) (ELF_THUMB_OK(x) && ELF_26BIT_OK(x))
+
+#define ELF_THUMB_OK(x) \
+       ((elf_hwcap & HWCAP_THUMB && ((x)->e_entry & 1) == 1) || \
+        ((x)->e_entry & 3) == 0)
+
+#define ELF_26BIT_OK(x) \
+       ((elf_hwcap & HWCAP_26BIT && (x)->e_flags & EF_ARM_APCS26) || \
+         ((x)->e_flags & EF_ARM_APCS26) == 0)
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE      4096
+
+/* 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        (2 * TASK_SIZE / 3)
+
+/* When the program starts, a1 contains a pointer to a function to be 
+   registered with atexit, as per the SVR4 ABI.  A value of 0 means we 
+   have no such handler.  */
+#define ELF_PLAT_INIT(_r, load_addr)   (_r)->ARM_r0 = 0
+
+/*
+ * Since the FPA coprocessor uses CP1 and CP2, and iWMMXt uses CP0
+ * and CP1, we only enable access to the iWMMXt coprocessor if the
+ * binary is EABI or softfloat (and thus, guaranteed not to use
+ * FPA instructions.)
+ */
+#define SET_PERSONALITY(ex, ibcs2)                                     \
+       do {                                                            \
+               if ((ex).e_flags & EF_ARM_APCS26) {                     \
+                       set_personality(PER_LINUX);                     \
+               } else {                                                \
+                       set_personality(PER_LINUX_32BIT);               \
+                       if (elf_hwcap & HWCAP_IWMMXT && (ex).e_flags & (EF_ARM_EABI_MASK | EF_ARM_SOFT_FLOAT)) \
+                               set_thread_flag(TIF_USING_IWMMXT);      \
+                       else                                            \
+                               clear_thread_flag(TIF_USING_IWMMXT);    \
+               }                                                       \
+       } while (0)
+
+#endif
diff --git a/arch/arm/include/asm/emergency-restart.h b/arch/arm/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/arm/include/asm/errno.h b/arch/arm/include/asm/errno.h
new file mode 100644 (file)
index 0000000..6e60f06
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ARM_ERRNO_H
+#define _ARM_ERRNO_H
+
+#include <asm-generic/errno.h>
+
+#endif
diff --git a/arch/arm/include/asm/fb.h b/arch/arm/include/asm/fb.h
new file mode 100644 (file)
index 0000000..d92e99c
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _ASM_FB_H_
+#define _ASM_FB_H_
+
+#include <linux/fb.h>
+#include <linux/fs.h>
+#include <asm/page.h>
+
+static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
+                               unsigned long off)
+{
+       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+}
+
+static inline int fb_is_primary_device(struct fb_info *info)
+{
+       return 0;
+}
+
+#endif /* _ASM_FB_H_ */
diff --git a/arch/arm/include/asm/fcntl.h b/arch/arm/include/asm/fcntl.h
new file mode 100644 (file)
index 0000000..a80b660
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ARM_FCNTL_H
+#define _ARM_FCNTL_H
+
+#define O_DIRECTORY     040000 /* must be a directory */
+#define O_NOFOLLOW     0100000 /* don't follow links */
+#define O_DIRECT       0200000 /* direct disk access hint - currently ignored */
+#define O_LARGEFILE    0400000
+
+#include <asm-generic/fcntl.h>
+
+#endif
diff --git a/arch/arm/include/asm/fiq.h b/arch/arm/include/asm/fiq.h
new file mode 100644 (file)
index 0000000..2242ce2
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *  arch/arm/include/asm/fiq.h
+ *
+ * Support for FIQ on ARM architectures.
+ * Written by Philip Blundell <philb@gnu.org>, 1998
+ * Re-written by Russell King
+ */
+
+#ifndef __ASM_FIQ_H
+#define __ASM_FIQ_H
+
+#include <asm/ptrace.h>
+
+struct fiq_handler {
+       struct fiq_handler *next;
+       /* Name
+        */
+       const char *name;
+       /* Called to ask driver to relinquish/
+        * reacquire FIQ
+        * return zero to accept, or -<errno>
+        */
+       int (*fiq_op)(void *, int relinquish);
+       /* data for the relinquish/reacquire functions
+        */
+       void *dev_id;
+};
+
+extern int claim_fiq(struct fiq_handler *f);
+extern void release_fiq(struct fiq_handler *f);
+extern void set_fiq_handler(void *start, unsigned int length);
+extern void set_fiq_regs(struct pt_regs *regs);
+extern void get_fiq_regs(struct pt_regs *regs);
+extern void enable_fiq(int fiq);
+extern void disable_fiq(int fiq);
+
+#endif
diff --git a/arch/arm/include/asm/flat.h b/arch/arm/include/asm/flat.h
new file mode 100644 (file)
index 0000000..1d77e51
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/include/asm/flat.h -- uClinux flat-format executables
+ */
+
+#ifndef __ARM_FLAT_H__
+#define __ARM_FLAT_H__
+
+/* An odd number of words will be pushed after this alignment, so
+   deliberately misalign the value.  */
+#define        flat_stack_align(sp)    sp = (void *)(((unsigned long)(sp) - 4) | 4)
+#define        flat_argvp_envp_on_stack()              1
+#define        flat_old_ram_flag(flags)                (flags)
+#define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
+#define        flat_get_addr_from_rp(rp, relval, flags, persistent) get_unaligned(rp)
+#define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
+#define        flat_get_relocate_addr(rel)             (rel)
+#define        flat_set_persistent(relval, p)          0
+
+#endif /* __ARM_FLAT_H__ */
diff --git a/arch/arm/include/asm/floppy.h b/arch/arm/include/asm/floppy.h
new file mode 100644 (file)
index 0000000..dce20c2
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ *  arch/arm/include/asm/floppy.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * 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.
+ *
+ *  Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
+ */
+#ifndef __ASM_ARM_FLOPPY_H
+#define __ASM_ARM_FLOPPY_H
+#if 0
+#include <asm/arch/floppy.h>
+#endif
+
+#define fd_outb(val,port)                      \
+       do {                                    \
+               if ((port) == FD_DOR)           \
+                       fd_setdor((val));       \
+               else                            \
+                       outb((val),(port));     \
+       } while(0)
+
+#define fd_inb(port)           inb((port))
+#define fd_request_irq()       request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
+                                           IRQF_DISABLED,"floppy",NULL)
+#define fd_free_irq()          free_irq(IRQ_FLOPPYDISK,NULL)
+#define fd_disable_irq()       disable_irq(IRQ_FLOPPYDISK)
+#define fd_enable_irq()                enable_irq(IRQ_FLOPPYDISK)
+
+static inline int fd_dma_setup(void *data, unsigned int length,
+                              unsigned int mode, unsigned long addr)
+{
+       set_dma_mode(DMA_FLOPPY, mode);
+       __set_dma_addr(DMA_FLOPPY, data);
+       set_dma_count(DMA_FLOPPY, length);
+       virtual_dma_port = addr;
+       enable_dma(DMA_FLOPPY);
+       return 0;
+}
+#define fd_dma_setup           fd_dma_setup
+
+#define fd_request_dma()       request_dma(DMA_FLOPPY,"floppy")
+#define fd_free_dma()          free_dma(DMA_FLOPPY)
+#define fd_disable_dma()       disable_dma(DMA_FLOPPY)
+
+/* need to clean up dma.h */
+#define DMA_FLOPPYDISK         DMA_FLOPPY
+
+/* Floppy_selects is the list of DOR's to select drive fd
+ *
+ * On initialisation, the floppy list is scanned, and the drives allocated
+ * in the order that they are found.  This is done by seeking the drive
+ * to a non-zero track, and then restoring it to track 0.  If an error occurs,
+ * then there is no floppy drive present.       [to be put back in again]
+ */
+static unsigned char floppy_selects[2][4] =
+{
+       { 0x10, 0x21, 0x23, 0x33 },
+       { 0x10, 0x21, 0x23, 0x33 }
+};
+
+#define fd_setdor(dor)                                                         \
+do {                                                                           \
+       int new_dor = (dor);                                                    \
+       if (new_dor & 0xf0)                                                     \
+               new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3];  \
+       else                                                                    \
+               new_dor &= 0x0c;                                                \
+       outb(new_dor, FD_DOR);                                                  \
+} while (0)
+
+/*
+ * Someday, we'll automatically detect which drives are present...
+ */
+static inline void fd_scandrives (void)
+{
+#if 0
+       int floppy, drive_count;
+
+       fd_disable_irq();
+       raw_cmd = &default_raw_cmd;
+       raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
+       raw_cmd->track = 0;
+       raw_cmd->rate = ?;
+       drive_count = 0;
+       for (floppy = 0; floppy < 4; floppy ++) {
+               current_drive = drive_count;
+               /*
+                * Turn on floppy motor
+                */
+               if (start_motor(redo_fd_request))
+                       continue;
+               /*
+                * Set up FDC
+                */
+               fdc_specify();
+               /*
+                * Tell FDC to recalibrate
+                */
+               output_byte(FD_RECALIBRATE);
+               LAST_OUT(UNIT(floppy));
+               /* wait for command to complete */
+               if (!successful) {
+                       int i;
+                       for (i = drive_count; i < 3; i--)
+                               floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
+                       floppy_selects[fdc][3] = 0;
+                       floppy -= 1;
+               } else
+                       drive_count++;
+       }
+#else
+       floppy_selects[0][0] = 0x10;
+       floppy_selects[0][1] = 0x21;
+       floppy_selects[0][2] = 0x23;
+       floppy_selects[0][3] = 0x33;
+#endif
+}
+
+#define FDC1 (0x3f0)
+
+#define FLOPPY0_TYPE 4
+#define FLOPPY1_TYPE 4
+
+#define N_FDC 1
+#define N_DRIVE 4
+
+#define CROSS_64KB(a,s) (0)
+
+/*
+ * This allows people to reverse the order of
+ * fd0 and fd1, in case their hardware is
+ * strangely connected (as some RiscPCs
+ * and A5000s seem to be).
+ */
+static void driveswap(int *ints, int dummy, int dummy2)
+{
+       floppy_selects[0][0] ^= floppy_selects[0][1];
+       floppy_selects[0][1] ^= floppy_selects[0][0];
+       floppy_selects[0][0] ^= floppy_selects[0][1];
+}
+
+#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
+       
+#endif
diff --git a/arch/arm/include/asm/fpstate.h b/arch/arm/include/asm/fpstate.h
new file mode 100644 (file)
index 0000000..ee5e03e
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ *  arch/arm/include/asm/fpstate.h
+ *
+ *  Copyright (C) 1995 Russell King
+ *
+ * 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.
+ */
+
+#ifndef __ASM_ARM_FPSTATE_H
+#define __ASM_ARM_FPSTATE_H
+
+
+#ifndef __ASSEMBLY__
+
+/*
+ * VFP storage area has:
+ *  - FPEXC, FPSCR, FPINST and FPINST2.
+ *  - 16 or 32 double precision data registers
+ *  - an implementation-dependant word of state for FLDMX/FSTMX (pre-ARMv6)
+ * 
+ *  FPEXC will always be non-zero once the VFP has been used in this process.
+ */
+
+struct vfp_hard_struct {
+#ifdef CONFIG_VFPv3
+       __u64 fpregs[32];
+#else
+       __u64 fpregs[16];
+#endif
+#if __LINUX_ARM_ARCH__ < 6
+       __u32 fpmx_state;
+#endif
+       __u32 fpexc;
+       __u32 fpscr;
+       /*
+        * VFP implementation specific state
+        */
+       __u32 fpinst;
+       __u32 fpinst2;
+
+#ifdef CONFIG_SMP
+       __u32 cpu;
+#endif
+};
+
+union vfp_state {
+       struct vfp_hard_struct  hard;
+};
+
+extern void vfp_flush_thread(union vfp_state *);
+extern void vfp_release_thread(union vfp_state *);
+
+#define FP_HARD_SIZE 35
+
+struct fp_hard_struct {
+       unsigned int save[FP_HARD_SIZE];                /* as yet undefined */
+};
+
+#define FP_SOFT_SIZE 35
+
+struct fp_soft_struct {
+       unsigned int save[FP_SOFT_SIZE];                /* undefined information */
+};
+
+#define IWMMXT_SIZE    0x98
+
+struct iwmmxt_struct {
+       unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
+};
+
+union fp_state {
+       struct fp_hard_struct   hard;
+       struct fp_soft_struct   soft;
+#ifdef CONFIG_IWMMXT
+       struct iwmmxt_struct    iwmmxt;
+#endif
+};
+
+#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
+
+struct crunch_state {
+       unsigned int    mvdx[16][2];
+       unsigned int    mvax[4][3];
+       unsigned int    dspsc[2];
+};
+
+#define CRUNCH_SIZE    sizeof(struct crunch_state)
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
new file mode 100644 (file)
index 0000000..584ef9a
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ASM_ARM_FTRACE
+#define _ASM_ARM_FTRACE
+
+#ifdef CONFIG_FTRACE
+#define MCOUNT_ADDR            ((long)(mcount))
+#define MCOUNT_INSN_SIZE       4 /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
+extern void mcount(void);
+#endif
+
+#endif
+
+#endif /* _ASM_ARM_FTRACE */
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/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/arm/include/asm/glue.h b/arch/arm/include/asm/glue.h
new file mode 100644 (file)
index 0000000..a0e39d5
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ *  arch/arm/include/asm/glue.h
+ *
+ *  Copyright (C) 1997-1999 Russell King
+ *  Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
+ *
+ * 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.
+ *
+ *  This file provides the glue to stick the processor-specific bits
+ *  into the kernel in an efficient manner.  The idea is to use branches
+ *  when we're only targetting one class of TLB, or indirect calls
+ *  when we're targetting multiple classes of TLBs.
+ */
+#ifdef __KERNEL__
+
+
+#ifdef __STDC__
+#define ____glue(name,fn)      name##fn
+#else
+#define ____glue(name,fn)      name/**/fn
+#endif
+#define __glue(name,fn)                ____glue(name,fn)
+
+
+
+/*
+ *     Data Abort Model
+ *     ================
+ *
+ *     We have the following to choose from:
+ *       arm6          - ARM6 style
+ *       arm7          - ARM7 style
+ *       v4_early      - ARMv4 without Thumb early abort handler
+ *       v4t_late      - ARMv4 with Thumb late abort handler
+ *       v4t_early     - ARMv4 with Thumb early abort handler
+ *       v5tej_early   - ARMv5 with Thumb and Java early abort handler
+ *       xscale        - ARMv5 with Thumb with Xscale extensions
+ *       v6_early      - ARMv6 generic early abort handler
+ *       v7_early      - ARMv7 generic early abort handler
+ */
+#undef CPU_DABORT_HANDLER
+#undef MULTI_DABORT
+
+#if defined(CONFIG_CPU_ARM610)
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER cpu_arm6_data_abort
+# endif
+#endif
+
+#if defined(CONFIG_CPU_ARM710)
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER cpu_arm7_data_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_LV4T
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v4t_late_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV4
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v4_early_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV4T
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v4t_early_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV5TJ
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v5tj_early_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV5T
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v5t_early_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV6
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v6_early_abort
+# endif
+#endif
+
+#ifdef CONFIG_CPU_ABRT_EV7
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
+# else
+#  define CPU_DABORT_HANDLER v7_early_abort
+# endif
+#endif
+
+#ifndef CPU_DABORT_HANDLER
+#error Unknown data abort handler type
+#endif
+
+/*
+ * Prefetch abort handler.  If the CPU has an IFAR use that, otherwise
+ * use the address of the aborted instruction
+ */
+#undef CPU_PABORT_HANDLER
+#undef MULTI_PABORT
+
+#ifdef CONFIG_CPU_PABRT_IFAR
+# ifdef CPU_PABORT_HANDLER
+#  define MULTI_PABORT 1
+# else
+#  define CPU_PABORT_HANDLER(reg, insn)        mrc p15, 0, reg, cr6, cr0, 2
+# endif
+#endif
+
+#ifdef CONFIG_CPU_PABRT_NOIFAR
+# ifdef CPU_PABORT_HANDLER
+#  define MULTI_PABORT 1
+# else
+#  define CPU_PABORT_HANDLER(reg, insn)        mov reg, insn
+# endif
+#endif
+
+#ifndef CPU_PABORT_HANDLER
+#error Unknown prefetch abort handler type
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
new file mode 100644 (file)
index 0000000..fff4f80
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _ARCH_ARM_GPIO_H
+#define _ARCH_ARM_GPIO_H
+
+/* not all ARM platforms necessarily support this API ... */
+#include <asm/arch/gpio.h>
+
+#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..182310b
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __ASM_HARDIRQ_H
+#define __ASM_HARDIRQ_H
+
+#include <linux/cache.h>
+#include <linux/threads.h>
+#include <asm/irq.h>
+
+typedef struct {
+       unsigned int __softirq_pending;
+       unsigned int local_timer_irqs;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+
+#if NR_IRQS > 256
+#define HARDIRQ_BITS   9
+#else
+#define HARDIRQ_BITS   8
+#endif
+
+/*
+ * The hardirq mask has to be large enough to have space
+ * for potentially all IRQ sources in the system nesting
+ * on a single CPU:
+ */
+#if (1 << HARDIRQ_BITS) < NR_IRQS
+# error HARDIRQ_BITS is too low!
+#endif
+
+#define __ARCH_IRQ_EXIT_IRQS_DISABLED  1
+
+#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/arm/include/asm/hardware.h b/arch/arm/include/asm/hardware.h
new file mode 100644 (file)
index 0000000..eb3b3ab
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ *  arch/arm/include/asm/hardware.h
+ *
+ *  Copyright (C) 1996 Russell King
+ *
+ * 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.
+ *
+ *  Common hardware definitions
+ */
+
+#ifndef __ASM_HARDWARE_H
+#define __ASM_HARDWARE_H
+
+#include <asm/arch/hardware.h>
+
+#endif
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h
new file mode 100644 (file)
index 0000000..04be3bd
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
+#define __ASM_ARM_HARDWARE_ARM_TIMER_H
+
+#define TIMER_LOAD     0x00
+#define TIMER_VALUE    0x04
+#define TIMER_CTRL     0x08
+#define TIMER_CTRL_ONESHOT     (1 << 0)
+#define TIMER_CTRL_32BIT       (1 << 1)
+#define TIMER_CTRL_DIV1                (0 << 2)
+#define TIMER_CTRL_DIV16       (1 << 2)
+#define TIMER_CTRL_DIV256      (2 << 2)
+#define TIMER_CTRL_IE          (1 << 5)        /* Interrupt Enable (versatile only) */
+#define TIMER_CTRL_PERIODIC    (1 << 6)
+#define TIMER_CTRL_ENABLE      (1 << 7)
+
+#define TIMER_INTCLR   0x0c
+#define TIMER_RIS      0x10
+#define TIMER_MIS      0x14
+#define TIMER_BGLOAD   0x18
+
+#endif
diff --git a/arch/arm/include/asm/hardware/arm_twd.h b/arch/arm/include/asm/hardware/arm_twd.h
new file mode 100644 (file)
index 0000000..e521b70
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __ASM_HARDWARE_TWD_H
+#define __ASM_HARDWARE_TWD_H
+
+#define TWD_TIMER_LOAD                         0x00
+#define TWD_TIMER_COUNTER              0x04
+#define TWD_TIMER_CONTROL              0x08
+#define TWD_TIMER_INTSTAT              0x0C
+
+#define TWD_WDOG_LOAD                  0x20
+#define TWD_WDOG_COUNTER               0x24
+#define TWD_WDOG_CONTROL               0x28
+#define TWD_WDOG_INTSTAT               0x2C
+#define TWD_WDOG_RESETSTAT             0x30
+#define TWD_WDOG_DISABLE               0x34
+
+#define TWD_TIMER_CONTROL_ENABLE       (1 << 0)
+#define TWD_TIMER_CONTROL_ONESHOT      (0 << 1)
+#define TWD_TIMER_CONTROL_PERIODIC     (1 << 1)
+#define TWD_TIMER_CONTROL_IT_ENABLE    (1 << 2)
+
+#endif
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
new file mode 100644 (file)
index 0000000..64f2252
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * arch/arm/include/asm/hardware/cache-l2x0.h
+ *
+ * Copyright (C) 2007 ARM Limited
+ *
+ * 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.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARM_HARDWARE_L2X0_H
+#define __ASM_ARM_HARDWARE_L2X0_H
+
+#define L2X0_CACHE_ID                  0x000
+#define L2X0_CACHE_TYPE                        0x004
+#define L2X0_CTRL                      0x100
+#define L2X0_AUX_CTRL                  0x104
+#define L2X0_EVENT_CNT_CTRL            0x200
+#define L2X0_EVENT_CNT1_CFG            0x204
+#define L2X0_EVENT_CNT0_CFG            0x208
+#define L2X0_EVENT_CNT1_VAL            0x20C
+#define L2X0_EVENT_CNT0_VAL            0x210
+#define L2X0_INTR_MASK                 0x214
+#define L2X0_MASKED_INTR_STAT          0x218
+#define L2X0_RAW_INTR_STAT             0x21C
+#define L2X0_INTR_CLEAR                        0x220
+#define L2X0_CACHE_SYNC                        0x730
+#define L2X0_INV_LINE_PA               0x770
+#define L2X0_INV_WAY                   0x77C
+#define L2X0_CLEAN_LINE_PA             0x7B0
+#define L2X0_CLEAN_LINE_IDX            0x7B8
+#define L2X0_CLEAN_WAY                 0x7BC
+#define L2X0_CLEAN_INV_LINE_PA         0x7F0
+#define L2X0_CLEAN_INV_LINE_IDX                0x7F8
+#define L2X0_CLEAN_INV_WAY             0x7FC
+#define L2X0_LOCKDOWN_WAY_D            0x900
+#define L2X0_LOCKDOWN_WAY_I            0x904
+#define L2X0_TEST_OPERATION            0xF00
+#define L2X0_LINE_DATA                 0xF10
+#define L2X0_LINE_TAG                  0xF30
+#define L2X0_DEBUG_CTRL                        0xF40
+
+#ifndef __ASSEMBLY__
+extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/hardware/clps7111.h b/arch/arm/include/asm/hardware/clps7111.h
new file mode 100644 (file)
index 0000000..4447722
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ *  arch/arm/include/asm/hardware/clps7111.h
+ *
+ *  This file contains the hardware definitions of the CLPS7111 internal
+ *  registers.
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_HARDWARE_CLPS7111_H
+#define __ASM_HARDWARE_CLPS7111_H
+
+#define CLPS7111_PHYS_BASE     (0x80000000)
+
+#ifndef __ASSEMBLY__
+#define clps_readb(off)                __raw_readb(CLPS7111_BASE + (off))
+#define clps_readw(off)                __raw_readw(CLPS7111_BASE + (off))
+#define clps_readl(off)                __raw_readl(CLPS7111_BASE + (off))
+#define clps_writeb(val,off)   __raw_writeb(val, CLPS7111_BASE + (off))
+#define clps_writew(val,off)   __raw_writew(val, CLPS7111_BASE + (off))
+#define clps_writel(val,off)   __raw_writel(val, CLPS7111_BASE + (off))
+#endif
+
+#define PADR           (0x0000)
+#define PBDR           (0x0001)
+#define PDDR           (0x0003)
+#define PADDR          (0x0040)
+#define PBDDR          (0x0041)
+#define PDDDR          (0x0043)
+#define PEDR           (0x0080)
+#define PEDDR          (0x00c0)
+#define SYSCON1                (0x0100)
+#define SYSFLG1                (0x0140)
+#define MEMCFG1                (0x0180)
+#define MEMCFG2                (0x01c0)
+#define DRFPR          (0x0200)
+#define INTSR1         (0x0240)
+#define INTMR1         (0x0280)
+#define LCDCON         (0x02c0)
+#define TC1D            (0x0300)
+#define TC2D           (0x0340)
+#define RTCDR          (0x0380)
+#define RTCMR          (0x03c0)
+#define PMPCON         (0x0400)
+#define CODR           (0x0440)
+#define UARTDR1                (0x0480)
+#define UBRLCR1                (0x04c0)
+#define SYNCIO         (0x0500)
+#define PALLSW         (0x0540)
+#define PALMSW         (0x0580)
+#define STFCLR         (0x05c0)
+#define BLEOI          (0x0600)
+#define MCEOI          (0x0640)
+#define TEOI           (0x0680)
+#define TC1EOI         (0x06c0)
+#define TC2EOI         (0x0700)
+#define RTCEOI         (0x0740)
+#define UMSEOI         (0x0780)
+#define COEOI          (0x07c0)
+#define HALT           (0x0800)
+#define STDBY          (0x0840)
+
+#define FBADDR         (0x1000)
+#define SYSCON2                (0x1100)
+#define SYSFLG2                (0x1140)
+#define INTSR2         (0x1240)
+#define INTMR2         (0x1280)
+#define UARTDR2                (0x1480)
+#define UBRLCR2                (0x14c0)
+#define SS2DR          (0x1500)
+#define SRXEOF         (0x1600)
+#define SS2POP         (0x16c0)
+#define KBDEOI         (0x1700)
+
+/* common bits: SYSCON1 / SYSCON2 */
+#define SYSCON_UARTEN          (1 << 8)
+
+#define SYSCON1_KBDSCAN(x)     ((x) & 15)
+#define SYSCON1_KBDSCANMASK    (15)
+#define SYSCON1_TC1M           (1 << 4)
+#define SYSCON1_TC1S           (1 << 5)
+#define SYSCON1_TC2M           (1 << 6)
+#define SYSCON1_TC2S           (1 << 7)
+#define SYSCON1_UART1EN                SYSCON_UARTEN
+#define SYSCON1_BZTOG          (1 << 9)
+#define SYSCON1_BZMOD          (1 << 10)
+#define SYSCON1_DBGEN          (1 << 11)
+#define SYSCON1_LCDEN          (1 << 12)
+#define SYSCON1_CDENTX         (1 << 13)
+#define SYSCON1_CDENRX         (1 << 14)
+#define SYSCON1_SIREN          (1 << 15)
+#define SYSCON1_ADCKSEL(x)     (((x) & 3) << 16)
+#define SYSCON1_ADCKSEL_MASK   (3 << 16)
+#define SYSCON1_EXCKEN         (1 << 18)
+#define SYSCON1_WAKEDIS                (1 << 19)
+#define SYSCON1_IRTXM          (1 << 20)
+
+/* common bits: SYSFLG1 / SYSFLG2 */
+#define SYSFLG_UBUSY           (1 << 11)
+#define SYSFLG_URXFE           (1 << 22)
+#define SYSFLG_UTXFF           (1 << 23)
+
+#define SYSFLG1_MCDR           (1 << 0)
+#define SYSFLG1_DCDET          (1 << 1)
+#define SYSFLG1_WUDR           (1 << 2)
+#define SYSFLG1_WUON           (1 << 3)
+#define SYSFLG1_CTS            (1 << 8)
+#define SYSFLG1_DSR            (1 << 9)
+#define SYSFLG1_DCD            (1 << 10)
+#define SYSFLG1_UBUSY          SYSFLG_UBUSY
+#define SYSFLG1_NBFLG          (1 << 12)
+#define SYSFLG1_RSTFLG         (1 << 13)
+#define SYSFLG1_PFFLG          (1 << 14)
+#define SYSFLG1_CLDFLG         (1 << 15)
+#define SYSFLG1_URXFE          SYSFLG_URXFE
+#define SYSFLG1_UTXFF          SYSFLG_UTXFF
+#define SYSFLG1_CRXFE          (1 << 24)
+#define SYSFLG1_CTXFF          (1 << 25)
+#define SYSFLG1_SSIBUSY                (1 << 26)
+#define SYSFLG1_ID             (1 << 29)
+
+#define SYSFLG2_SSRXOF         (1 << 0)
+#define SYSFLG2_RESVAL         (1 << 1)
+#define SYSFLG2_RESFRM         (1 << 2)
+#define SYSFLG2_SS2RXFE                (1 << 3)
+#define SYSFLG2_SS2TXFF                (1 << 4)
+#define SYSFLG2_SS2TXUF                (1 << 5)
+#define SYSFLG2_CKMODE         (1 << 6)
+#define SYSFLG2_UBUSY          SYSFLG_UBUSY
+#define SYSFLG2_URXFE          SYSFLG_URXFE
+#define SYSFLG2_UTXFF          SYSFLG_UTXFF
+
+#define LCDCON_GSEN            (1 << 30)
+#define LCDCON_GSMD            (1 << 31)
+
+#define SYSCON2_SERSEL         (1 << 0)
+#define SYSCON2_KBD6           (1 << 1)
+#define SYSCON2_DRAMZ          (1 << 2)
+#define SYSCON2_KBWEN          (1 << 3)
+#define SYSCON2_SS2TXEN                (1 << 4)
+#define SYSCON2_PCCARD1                (1 << 5)
+#define SYSCON2_PCCARD2                (1 << 6)
+#define SYSCON2_SS2RXEN                (1 << 7)
+#define SYSCON2_UART2EN                SYSCON_UARTEN
+#define SYSCON2_SS2MAEN                (1 << 9)
+#define SYSCON2_OSTB           (1 << 12)
+#define SYSCON2_CLKENSL                (1 << 13)
+#define SYSCON2_BUZFREQ                (1 << 14)
+
+/* common bits: UARTDR1 / UARTDR2 */
+#define UARTDR_FRMERR          (1 << 8)
+#define UARTDR_PARERR          (1 << 9)
+#define UARTDR_OVERR           (1 << 10)
+
+/* common bits: UBRLCR1 / UBRLCR2 */
+#define UBRLCR_BAUD_MASK       ((1 << 12) - 1)
+#define UBRLCR_BREAK           (1 << 12)
+#define UBRLCR_PRTEN           (1 << 13)
+#define UBRLCR_EVENPRT         (1 << 14)
+#define UBRLCR_XSTOP           (1 << 15)
+#define UBRLCR_FIFOEN          (1 << 16)
+#define UBRLCR_WRDLEN5         (0 << 17)
+#define UBRLCR_WRDLEN6         (1 << 17)
+#define UBRLCR_WRDLEN7         (2 << 17)
+#define UBRLCR_WRDLEN8         (3 << 17)
+#define UBRLCR_WRDLEN_MASK     (3 << 17)
+
+#define SYNCIO_SMCKEN          (1 << 13)
+#define SYNCIO_TXFRMEN         (1 << 14)
+
+#endif /* __ASM_HARDWARE_CLPS7111_H */
diff --git a/arch/arm/include/asm/hardware/cs89712.h b/arch/arm/include/asm/hardware/cs89712.h
new file mode 100644 (file)
index 0000000..f756269
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  arch/arm/include/asm/hardware/cs89712.h
+ *
+ *  This file contains the hardware definitions of the CS89712
+ *  additional internal registers.
+ *
+ *  Copyright (C) 2001 Thomas Gleixner autronix automation <gleixner@autronix.de>
+ *                     
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_HARDWARE_CS89712_H
+#define __ASM_HARDWARE_CS89712_H
+
+/*
+*      CS89712 additional registers
+*/
+                                  
+#define PCDR                   0x0002  /* Port C Data register ---------------------------- */
+#define PCDDR                  0x0042  /* Port C Data Direction register ------------------ */
+#define SDCONF                 0x2300  /* SDRAM Configuration register ---------------------*/
+#define SDRFPR                 0x2340  /* SDRAM Refresh period register --------------------*/
+
+#define SDCONF_ACTIVE          (1 << 10)
+#define SDCONF_CLKCTL          (1 << 9)
+#define SDCONF_WIDTH_4         (0 << 7)
+#define SDCONF_WIDTH_8         (1 << 7)
+#define SDCONF_WIDTH_16                (2 << 7)
+#define SDCONF_WIDTH_32                (3 << 7)
+#define SDCONF_SIZE_16         (0 << 5)
+#define SDCONF_SIZE_64         (1 << 5)
+#define SDCONF_SIZE_128                (2 << 5)
+#define SDCONF_SIZE_256                (3 << 5)
+#define SDCONF_CASLAT_2                (2)
+#define SDCONF_CASLAT_3                (3)
+
+#endif /* __ASM_HARDWARE_CS89712_H */
diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S
new file mode 100644 (file)
index 0000000..22c6892
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/include/asm/hardware/debug-8250.S
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *
+ * 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.
+ */
+#include <linux/serial_reg.h>
+
+               .macro  senduart,rd,rx
+               strb    \rd, [\rx, #UART_TX << UART_SHIFT]
+               .endm
+
+               .macro  busyuart,rd,rx
+1002:          ldrb    \rd, [\rx, #UART_LSR << UART_SHIFT]
+               and     \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
+               teq     \rd, #UART_LSR_TEMT | UART_LSR_THRE
+               bne     1002b
+               .endm
+
+               .macro  waituart,rd,rx
+#ifdef FLOW_CONTROL
+1001:          ldrb    \rd, [\rx, #UART_MSR << UART_SHIFT]
+               tst     \rd, #UART_MSR_CTS
+               beq     1001b
+#endif
+               .endm
diff --git a/arch/arm/include/asm/hardware/debug-pl01x.S b/arch/arm/include/asm/hardware/debug-pl01x.S
new file mode 100644 (file)
index 0000000..f9fd083
--- /dev/null
@@ -0,0 +1,29 @@
+/* arch/arm/include/asm/hardware/debug-pl01x.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+ *
+ * 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.
+ *
+*/
+#include <linux/amba/serial.h>
+
+               .macro  senduart,rd,rx
+               strb    \rd, [\rx, #UART01x_DR]
+               .endm
+
+               .macro  waituart,rd,rx
+1001:          ldr     \rd, [\rx, #UART01x_FR]
+               tst     \rd, #UART01x_FR_TXFF
+               bne     1001b
+               .endm
+
+               .macro  busyuart,rd,rx
+1001:          ldr     \rd, [\rx, #UART01x_FR]
+               tst     \rd, #UART01x_FR_BUSY
+               bne     1001b
+               .endm
diff --git a/arch/arm/include/asm/hardware/dec21285.h b/arch/arm/include/asm/hardware/dec21285.h
new file mode 100644 (file)
index 0000000..7068a1c
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ *  arch/arm/include/asm/hardware/dec21285.h
+ *
+ *  Copyright (C) 1998 Russell King
+ *
+ * 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.
+ *
+ *  DC21285 registers
+ */
+#define DC21285_PCI_IACK               0x79000000
+#define DC21285_ARMCSR_BASE            0x42000000
+#define DC21285_PCI_TYPE_0_CONFIG      0x7b000000
+#define DC21285_PCI_TYPE_1_CONFIG      0x7a000000
+#define DC21285_OUTBOUND_WRITE_FLUSH   0x78000000
+#define DC21285_FLASH                  0x41000000
+#define DC21285_PCI_IO                 0x7c000000
+#define DC21285_PCI_MEM                        0x80000000
+
+#ifndef __ASSEMBLY__
+#include <asm/hardware.h>
+#define DC21285_IO(x)          ((volatile unsigned long *)(ARMCSR_BASE+(x)))
+#else
+#define DC21285_IO(x)          (x)
+#endif
+
+#define CSR_PCICMD             DC21285_IO(0x0004)
+#define CSR_CLASSREV           DC21285_IO(0x0008)
+#define CSR_PCICACHELINESIZE   DC21285_IO(0x000c)
+#define CSR_PCICSRBASE         DC21285_IO(0x0010)
+#define CSR_PCICSRIOBASE       DC21285_IO(0x0014)
+#define CSR_PCISDRAMBASE       DC21285_IO(0x0018)
+#define CSR_PCIROMBASE         DC21285_IO(0x0030)
+#define CSR_MBOX0              DC21285_IO(0x0050)
+#define CSR_MBOX1              DC21285_IO(0x0054)
+#define CSR_MBOX2              DC21285_IO(0x0058)
+#define CSR_MBOX3              DC21285_IO(0x005c)
+#define CSR_DOORBELL           DC21285_IO(0x0060)
+#define CSR_DOORBELL_SETUP     DC21285_IO(0x0064)
+#define CSR_ROMWRITEREG                DC21285_IO(0x0068)
+#define CSR_CSRBASEMASK                DC21285_IO(0x00f8)
+#define CSR_CSRBASEOFFSET      DC21285_IO(0x00fc)
+#define CSR_SDRAMBASEMASK      DC21285_IO(0x0100)
+#define CSR_SDRAMBASEOFFSET    DC21285_IO(0x0104)
+#define CSR_ROMBASEMASK                DC21285_IO(0x0108)
+#define CSR_SDRAMTIMING                DC21285_IO(0x010c)
+#define CSR_SDRAMADDRSIZE0     DC21285_IO(0x0110)
+#define CSR_SDRAMADDRSIZE1     DC21285_IO(0x0114)
+#define CSR_SDRAMADDRSIZE2     DC21285_IO(0x0118)
+#define CSR_SDRAMADDRSIZE3     DC21285_IO(0x011c)
+#define CSR_I2O_INFREEHEAD     DC21285_IO(0x0120)
+#define CSR_I2O_INPOSTTAIL     DC21285_IO(0x0124)
+#define CSR_I2O_OUTPOSTHEAD    DC21285_IO(0x0128)
+#define CSR_I2O_OUTFREETAIL    DC21285_IO(0x012c)
+#define CSR_I2O_INFREECOUNT    DC21285_IO(0x0130)
+#define CSR_I2O_OUTPOSTCOUNT   DC21285_IO(0x0134)
+#define CSR_I2O_INPOSTCOUNT    DC21285_IO(0x0138)
+#define CSR_SA110_CNTL         DC21285_IO(0x013c)
+#define SA110_CNTL_INITCMPLETE         (1 << 0)
+#define SA110_CNTL_ASSERTSERR          (1 << 1)
+#define SA110_CNTL_RXSERR              (1 << 3)
+#define SA110_CNTL_SA110DRAMPARITY     (1 << 4)
+#define SA110_CNTL_PCISDRAMPARITY      (1 << 5)
+#define SA110_CNTL_DMASDRAMPARITY      (1 << 6)
+#define SA110_CNTL_DISCARDTIMER                (1 << 8)
+#define SA110_CNTL_PCINRESET           (1 << 9)
+#define SA110_CNTL_I2O_256             (0 << 10)
+#define SA110_CNTL_I20_512             (1 << 10)
+#define SA110_CNTL_I2O_1024            (2 << 10)
+#define SA110_CNTL_I2O_2048            (3 << 10)
+#define SA110_CNTL_I2O_4096            (4 << 10)
+#define SA110_CNTL_I2O_8192            (5 << 10)
+#define SA110_CNTL_I2O_16384           (6 << 10)
+#define SA110_CNTL_I2O_32768           (7 << 10)
+#define SA110_CNTL_WATCHDOG            (1 << 13)
+#define SA110_CNTL_ROMWIDTH_UNDEF      (0 << 14)
+#define SA110_CNTL_ROMWIDTH_16         (1 << 14)
+#define SA110_CNTL_ROMWIDTH_32         (2 << 14)
+#define SA110_CNTL_ROMWIDTH_8          (3 << 14)
+#define SA110_CNTL_ROMACCESSTIME(x)    ((x)<<16)
+#define SA110_CNTL_ROMBURSTTIME(x)     ((x)<<20)
+#define SA110_CNTL_ROMTRISTATETIME(x)  ((x)<<24)
+#define SA110_CNTL_XCSDIR(x)           ((x)<<28)
+#define SA110_CNTL_PCICFN              (1 << 31)
+
+/*
+ * footbridge_cfn_mode() is used when we want
+ * to check whether we are the central function
+ */
+#define __footbridge_cfn_mode() (*CSR_SA110_CNTL & SA110_CNTL_PCICFN)
+#if defined(CONFIG_FOOTBRIDGE_HOST) && defined(CONFIG_FOOTBRIDGE_ADDIN)
+#define footbridge_cfn_mode() __footbridge_cfn_mode()
+#elif defined(CONFIG_FOOTBRIDGE_HOST)
+#define footbridge_cfn_mode() (1)
+#else
+#define footbridge_cfn_mode() (0)
+#endif
+
+#define CSR_PCIADDR_EXTN       DC21285_IO(0x0140)
+#define CSR_PREFETCHMEMRANGE   DC21285_IO(0x0144)
+#define CSR_XBUS_CYCLE         DC21285_IO(0x0148)
+#define CSR_XBUS_IOSTROBE      DC21285_IO(0x014c)
+#define CSR_DOORBELL_PCI       DC21285_IO(0x0150)
+#define CSR_DOORBELL_SA110     DC21285_IO(0x0154)
+#define CSR_UARTDR             DC21285_IO(0x0160)
+#define CSR_RXSTAT             DC21285_IO(0x0164)
+#define CSR_H_UBRLCR           DC21285_IO(0x0168)
+#define CSR_M_UBRLCR           DC21285_IO(0x016c)
+#define CSR_L_UBRLCR           DC21285_IO(0x0170)
+#define CSR_UARTCON            DC21285_IO(0x0174)
+#define CSR_UARTFLG            DC21285_IO(0x0178)
+#define CSR_IRQ_STATUS         DC21285_IO(0x0180)
+#define CSR_IRQ_RAWSTATUS      DC21285_IO(0x0184)
+#define CSR_IRQ_ENABLE         DC21285_IO(0x0188)
+#define CSR_IRQ_DISABLE                DC21285_IO(0x018c)
+#define CSR_IRQ_SOFT           DC21285_IO(0x0190)
+#define CSR_FIQ_STATUS         DC21285_IO(0x0280)
+#define CSR_FIQ_RAWSTATUS      DC21285_IO(0x0284)
+#define CSR_FIQ_ENABLE         DC21285_IO(0x0288)
+#define CSR_FIQ_DISABLE                DC21285_IO(0x028c)
+#define CSR_FIQ_SOFT           DC21285_IO(0x0290)
+#define CSR_TIMER1_LOAD                DC21285_IO(0x0300)
+#define CSR_TIMER1_VALUE       DC21285_IO(0x0304)
+#define CSR_TIMER1_CNTL                DC21285_IO(0x0308)
+#define CSR_TIMER1_CLR         DC21285_IO(0x030c)
+#define CSR_TIMER2_LOAD                DC21285_IO(0x0320)
+#define CSR_TIMER2_VALUE       DC21285_IO(0x0324)
+#define CSR_TIMER2_CNTL                DC21285_IO(0x0328)
+#define CSR_TIMER2_CLR         DC21285_IO(0x032c)
+#define CSR_TIMER3_LOAD                DC21285_IO(0x0340)
+#define CSR_TIMER3_VALUE       DC21285_IO(0x0344)
+#define CSR_TIMER3_CNTL                DC21285_IO(0x0348)
+#define CSR_TIMER3_CLR         DC21285_IO(0x034c)
+#define CSR_TIMER4_LOAD                DC21285_IO(0x0360)
+#define CSR_TIMER4_VALUE       DC21285_IO(0x0364)
+#define CSR_TIMER4_CNTL                DC21285_IO(0x0368)
+#define CSR_TIMER4_CLR         DC21285_IO(0x036c)
+
+#define TIMER_CNTL_ENABLE      (1 << 7)
+#define TIMER_CNTL_AUTORELOAD  (1 << 6)
+#define TIMER_CNTL_DIV1                (0)
+#define TIMER_CNTL_DIV16       (1 << 2)
+#define TIMER_CNTL_DIV256      (2 << 2)
+#define TIMER_CNTL_CNTEXT      (3 << 2)
+
+
diff --git a/arch/arm/include/asm/hardware/entry-macro-iomd.S b/arch/arm/include/asm/hardware/entry-macro-iomd.S
new file mode 100644 (file)
index 0000000..e0af498
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * arch/arm/include/asm/hardware/entry-macro-iomd.S
+ *
+ * Low-level IRQ helper macros for IOC/IOMD based platforms
+ *
+ * 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.
+ */
+
+/* IOC / IOMD based hardware */
+#include <asm/hardware/iomd.h>
+
+               .macro  disable_fiq
+               mov     r12, #ioc_base_high
+               .if     ioc_base_low
+               orr     r12, r12, #ioc_base_low
+               .endif
+               strb    r12, [r12, #0x38]       @ Disable FIQ register
+               .endm
+
+               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+               ldrb    \irqstat, [\base, #IOMD_IRQREQB]        @ get high priority first
+               ldr     \tmp, =irq_prio_h
+               teq     \irqstat, #0
+#ifdef IOMD_BASE
+               ldreqb  \irqstat, [\base, #IOMD_DMAREQ] @ get dma
+               addeq   \tmp, \tmp, #256                @ irq_prio_h table size
+               teqeq   \irqstat, #0
+               bne     2406f
+#endif
+               ldreqb  \irqstat, [\base, #IOMD_IRQREQA]        @ get low priority
+               addeq   \tmp, \tmp, #256                @ irq_prio_d table size
+               teqeq   \irqstat, #0
+#ifdef IOMD_IRQREQC
+               ldreqb  \irqstat, [\base, #IOMD_IRQREQC]
+               addeq   \tmp, \tmp, #256                @ irq_prio_l table size
+               teqeq   \irqstat, #0
+#endif
+#ifdef IOMD_IRQREQD
+               ldreqb  \irqstat, [\base, #IOMD_IRQREQD]
+               addeq   \tmp, \tmp, #256                @ irq_prio_lc table size
+               teqeq   \irqstat, #0
+#endif
+2406:          ldrneb  \irqnr, [\tmp, \irqstat]        @ get IRQ number
+               .endm
+
+/*
+ * Interrupt table (incorporates priority).  Please note that we
+ * rely on the order of these tables (see above code).
+ */
+               .align  5
+irq_prio_h:    .byte    0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+#ifdef IOMD_BASE
+irq_prio_d:    .byte    0,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   20,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
+#endif
+irq_prio_l:    .byte    0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
+               .byte    4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
+               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+               .byte    6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
+               .byte    6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
+               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+#ifdef IOMD_IRQREQC
+irq_prio_lc:   .byte   24,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
+               .byte   28,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
+               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
+               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
+               .byte   30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
+               .byte   30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
+               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
+               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+#endif
+#ifdef IOMD_IRQREQD
+irq_prio_ld:   .byte   40,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
+               .byte   44,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
+               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
+               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
+               .byte   46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
+               .byte   46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
+               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
+               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
+#endif
+
diff --git a/arch/arm/include/asm/hardware/ep7211.h b/arch/arm/include/asm/hardware/ep7211.h
new file mode 100644 (file)
index 0000000..654d5f6
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  arch/arm/include/asm/hardware/ep7211.h
+ *
+ *  This file contains the hardware definitions of the EP7211 internal
+ *  registers.
+ *
+ *  Copyright (C) 2001 Blue Mug, Inc.  All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_HARDWARE_EP7211_H
+#define __ASM_HARDWARE_EP7211_H
+
+#include <asm/hardware/clps7111.h>
+
+/*
+ * define EP7211_BASE to be the base address of the region
+ * you want to access.
+ */
+
+#define EP7211_PHYS_BASE       (0x80000000)
+
+/*
+ * XXX miket@bluemug.com: need to introduce EP7211 registers (those not
+ * present in 7212) here.
+ */
+
+#endif /* __ASM_HARDWARE_EP7211_H */
diff --git a/arch/arm/include/asm/hardware/ep7212.h b/arch/arm/include/asm/hardware/ep7212.h
new file mode 100644 (file)
index 0000000..3b43bbe
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ *  arch/arm/include/asm/hardware/ep7212.h
+ *
+ *  This file contains the hardware definitions of the EP7212 internal
+ *  registers.
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_HARDWARE_EP7212_H
+#define __ASM_HARDWARE_EP7212_H
+
+/*
+ * define EP7212_BASE to be the base address of the region
+ * you want to access.
+ */
+
+#define EP7212_PHYS_BASE       (0x80000000)
+
+#ifndef __ASSEMBLY__
+#define ep_readl(off)          __raw_readl(EP7212_BASE + (off))
+#define ep_writel(val,off)     __raw_writel(val, EP7212_BASE + (off))
+#endif
+
+/*
+ * These registers are specific to the EP7212 only
+ */
+#define DAIR                   0x2000
+#define DAIR0                  0x2040
+#define DAIDR1                 0x2080
+#define DAIDR2                 0x20c0
+#define DAISR                  0x2100
+#define SYSCON3                        0x2200
+#define INTSR3                 0x2240
+#define INTMR3                 0x2280
+#define LEDFLSH                        0x22c0
+
+#define DAIR_DAIEN             (1 << 16)
+#define DAIR_ECS               (1 << 17)
+#define DAIR_LCTM              (1 << 19)
+#define DAIR_LCRM              (1 << 20)
+#define DAIR_RCTM              (1 << 21)
+#define DAIR_RCRM              (1 << 22)
+#define DAIR_LBM               (1 << 23)
+
+#define DAIDR2_FIFOEN          (1 << 15)
+#define DAIDR2_FIFOLEFT                (0x0d << 16)
+#define DAIDR2_FIFORIGHT       (0x11 << 16)
+
+#define DAISR_RCTS             (1 << 0)
+#define DAISR_RCRS             (1 << 1)
+#define DAISR_LCTS             (1 << 2)
+#define DAISR_LCRS             (1 << 3)
+#define DAISR_RCTU             (1 << 4)
+#define DAISR_RCRO             (1 << 5)
+#define DAISR_LCTU             (1 << 6)
+#define DAISR_LCRO             (1 << 7)
+#define DAISR_RCNF             (1 << 8)
+#define DAISR_RCNE             (1 << 9)
+#define DAISR_LCNF             (1 << 10)
+#define DAISR_LCNE             (1 << 11)
+#define DAISR_FIFO             (1 << 12)
+
+#define SYSCON3_ADCCON         (1 << 0)
+#define SYSCON3_DAISEL         (1 << 3)
+#define SYSCON3_ADCCKNSEN      (1 << 4)
+#define SYSCON3_FASTWAKE       (1 << 8)
+#define SYSCON3_DAIEN          (1 << 9)
+
+#endif /* __ASM_HARDWARE_EP7212_H */
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
new file mode 100644 (file)
index 0000000..4924914
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *  arch/arm/include/asm/hardware/gic.h
+ *
+ *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_HARDWARE_GIC_H
+#define __ASM_ARM_HARDWARE_GIC_H
+
+#include <linux/compiler.h>
+
+#define GIC_CPU_CTRL                   0x00
+#define GIC_CPU_PRIMASK                        0x04
+#define GIC_CPU_BINPOINT               0x08
+#define GIC_CPU_INTACK                 0x0c
+#define GIC_CPU_EOI                    0x10
+#define GIC_CPU_RUNNINGPRI             0x14
+#define GIC_CPU_HIGHPRI                        0x18
+
+#define GIC_DIST_CTRL                  0x000
+#define GIC_DIST_CTR                   0x004
+#define GIC_DIST_ENABLE_SET            0x100
+#define GIC_DIST_ENABLE_CLEAR          0x180
+#define GIC_DIST_PENDING_SET           0x200
+#define GIC_DIST_PENDING_CLEAR         0x280
+#define GIC_DIST_ACTIVE_BIT            0x300
+#define GIC_DIST_PRI                   0x400
+#define GIC_DIST_TARGET                        0x800
+#define GIC_DIST_CONFIG                        0xc00
+#define GIC_DIST_SOFTINT               0xf00
+
+#ifndef __ASSEMBLY__
+void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start);
+void gic_cpu_init(unsigned int gic_nr, void __iomem *base);
+void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
+void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/hardware/icst307.h b/arch/arm/include/asm/hardware/icst307.h
new file mode 100644 (file)
index 0000000..554f128
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *  arch/arm/include/asm/hardware/icst307.h
+ *
+ *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
+ *
+ * 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.
+ *
+ *  Support functions for calculating clocks/divisors for the ICS307
+ *  clock generators.  See http://www.icst.com/ for more information
+ *  on these devices.
+ *
+ *  This file is similar to the icst525.h file
+ */
+#ifndef ASMARM_HARDWARE_ICST307_H
+#define ASMARM_HARDWARE_ICST307_H
+
+struct icst307_params {
+       unsigned long   ref;
+       unsigned long   vco_max;        /* inclusive */
+       unsigned short  vd_min;         /* inclusive */
+       unsigned short  vd_max;         /* inclusive */
+       unsigned char   rd_min;         /* inclusive */
+       unsigned char   rd_max;         /* inclusive */
+};
+
+struct icst307_vco {
+       unsigned short  v;
+       unsigned char   r;
+       unsigned char   s;
+};
+
+unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco);
+struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq);
+struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period);
+
+#endif
diff --git a/arch/arm/include/asm/hardware/icst525.h b/arch/arm/include/asm/hardware/icst525.h
new file mode 100644 (file)
index 0000000..58f0dc4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  arch/arm/include/asm/hardware/icst525.h
+ *
+ *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
+ *
+ * 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.
+ *
+ *  Support functions for calculating clocks/divisors for the ICST525
+ *  clock generators.  See http://www.icst.com/ for more information
+ *  on these devices.
+ */
+#ifndef ASMARM_HARDWARE_ICST525_H
+#define ASMARM_HARDWARE_ICST525_H
+
+struct icst525_params {
+       unsigned long   ref;
+       unsigned long   vco_max;        /* inclusive */
+       unsigned short  vd_min;         /* inclusive */
+       unsigned short  vd_max;         /* inclusive */
+       unsigned char   rd_min;         /* inclusive */
+       unsigned char   rd_max;         /* inclusive */
+};
+
+struct icst525_vco {
+       unsigned short  v;
+       unsigned char   r;
+       unsigned char   s;
+};
+
+unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco);
+struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq);
+struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period);
+
+#endif
diff --git a/arch/arm/include/asm/hardware/ioc.h b/arch/arm/include/asm/hardware/ioc.h
new file mode 100644 (file)
index 0000000..1f6b801
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ *  arch/arm/include/asm/hardware/ioc.h
+ *
+ *  Copyright (C) Russell King
+ *
+ * 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.
+ *
+ *  Use these macros to read/write the IOC.  All it does is perform the actual
+ *  read/write.
+ */
+#ifndef __ASMARM_HARDWARE_IOC_H
+#define __ASMARM_HARDWARE_IOC_H
+
+#ifndef __ASSEMBLY__
+
+/*
+ * We use __raw_base variants here so that we give the compiler the
+ * chance to keep IOC_BASE in a register.
+ */
+#define ioc_readb(off)         __raw_readb(IOC_BASE + (off))
+#define ioc_writeb(val,off)    __raw_writeb(val, IOC_BASE + (off))
+
+#endif
+
+#define IOC_CONTROL    (0x00)
+#define IOC_KARTTX     (0x04)
+#define IOC_KARTRX     (0x04)
+
+#define IOC_IRQSTATA   (0x10)
+#define IOC_IRQREQA    (0x14)
+#define IOC_IRQCLRA    (0x14)
+#define IOC_IRQMASKA   (0x18)
+
+#define IOC_IRQSTATB   (0x20)
+#define IOC_IRQREQB    (0x24)
+#define IOC_IRQMASKB   (0x28)
+
+#define IOC_FIQSTAT    (0x30)
+#define IOC_FIQREQ     (0x34)
+#define IOC_FIQMASK    (0x38)
+
+#define IOC_T0CNTL     (0x40)
+#define IOC_T0LTCHL    (0x40)
+#define IOC_T0CNTH     (0x44)
+#define IOC_T0LTCHH    (0x44)
+#define IOC_T0GO       (0x48)
+#define IOC_T0LATCH    (0x4c)
+
+#define IOC_T1CNTL     (0x50)
+#define IOC_T1LTCHL    (0x50)
+#define IOC_T1CNTH     (0x54)
+#define IOC_T1LTCHH    (0x54)
+#define IOC_T1GO       (0x58)
+#define IOC_T1LATCH    (0x5c)
+
+#define IOC_T2CNTL     (0x60)
+#define IOC_T2LTCHL    (0x60)
+#define IOC_T2CNTH     (0x64)
+#define IOC_T2LTCHH    (0x64)
+#define IOC_T2GO       (0x68)
+#define IOC_T2LATCH    (0x6c)
+
+#define IOC_T3CNTL     (0x70)
+#define IOC_T3LTCHL    (0x70)
+#define IOC_T3CNTH     (0x74)
+#define IOC_T3LTCHH    (0x74)
+#define IOC_T3GO       (0x78)
+#define IOC_T3LATCH    (0x7c)
+
+#endif
diff --git a/arch/arm/include/asm/hardware/iomd.h b/arch/arm/include/asm/hardware/iomd.h
new file mode 100644 (file)
index 0000000..9c5afbd
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ *  arch/arm/include/asm/hardware/iomd.h
+ *
+ *  Copyright (C) 1999 Russell King
+ *
+ * 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.
+ *
+ *  This file contains information out the IOMD ASIC used in the
+ *  Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
+ */
+#ifndef __ASMARM_HARDWARE_IOMD_H
+#define __ASMARM_HARDWARE_IOMD_H
+
+
+#ifndef __ASSEMBLY__
+
+/*
+ * We use __raw_base variants here so that we give the compiler the
+ * chance to keep IOC_BASE in a register.
+ */
+#define iomd_readb(off)                __raw_readb(IOMD_BASE + (off))
+#define iomd_readl(off)                __raw_readl(IOMD_BASE + (off))
+#define iomd_writeb(val,off)   __raw_writeb(val, IOMD_BASE + (off))
+#define iomd_writel(val,off)   __raw_writel(val, IOMD_BASE + (off))
+
+#endif
+
+#define IOMD_CONTROL   (0x000)
+#define IOMD_KARTTX    (0x004)
+#define IOMD_KARTRX    (0x004)
+#define IOMD_KCTRL     (0x008)
+
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_IOLINES   (0x00C)
+#endif
+
+#define IOMD_IRQSTATA  (0x010)
+#define IOMD_IRQREQA   (0x014)
+#define IOMD_IRQCLRA   (0x014)
+#define IOMD_IRQMASKA  (0x018)
+
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_SUSMODE   (0x01C)
+#endif
+
+#define IOMD_IRQSTATB  (0x020)
+#define IOMD_IRQREQB   (0x024)
+#define IOMD_IRQMASKB  (0x028)
+
+#define IOMD_FIQSTAT   (0x030)
+#define IOMD_FIQREQ    (0x034)
+#define IOMD_FIQMASK   (0x038)
+
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_CLKCTL    (0x03C)
+#endif
+
+#define IOMD_T0CNTL    (0x040)
+#define IOMD_T0LTCHL   (0x040)
+#define IOMD_T0CNTH    (0x044)
+#define IOMD_T0LTCHH   (0x044)
+#define IOMD_T0GO      (0x048)
+#define IOMD_T0LATCH   (0x04c)
+
+#define IOMD_T1CNTL    (0x050)
+#define IOMD_T1LTCHL   (0x050)
+#define IOMD_T1CNTH    (0x054)
+#define IOMD_T1LTCHH   (0x054)
+#define IOMD_T1GO      (0x058)
+#define IOMD_T1LATCH   (0x05c)
+
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_IRQSTATC  (0x060)
+#define IOMD_IRQREQC   (0x064)
+#define IOMD_IRQMASKC  (0x068)
+
+#define IOMD_VIDMUX    (0x06c)
+
+#define IOMD_IRQSTATD  (0x070)
+#define IOMD_IRQREQD   (0x074)
+#define IOMD_IRQMASKD  (0x078)
+#endif
+
+#define IOMD_ROMCR0    (0x080)
+#define IOMD_ROMCR1    (0x084)
+#ifdef CONFIG_ARCH_RPC
+#define IOMD_DRAMCR    (0x088)
+#endif
+#define IOMD_REFCR     (0x08C)
+
+#define IOMD_FSIZE     (0x090)
+#define IOMD_ID0       (0x094)
+#define IOMD_ID1       (0x098)
+#define IOMD_VERSION   (0x09C)
+
+#ifdef CONFIG_ARCH_RPC
+#define IOMD_MOUSEX    (0x0A0)
+#define IOMD_MOUSEY    (0x0A4)
+#endif
+
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_MSEDAT    (0x0A8)
+#define IOMD_MSECTL    (0x0Ac)
+#endif
+
+#ifdef CONFIG_ARCH_RPC
+#define IOMD_DMATCR    (0x0C0)
+#endif
+#define IOMD_IOTCR     (0x0C4)
+#define IOMD_ECTCR     (0x0C8)
+#ifdef CONFIG_ARCH_RPC
+#define IOMD_DMAEXT    (0x0CC)
+#endif
+#ifdef CONFIG_ARCH_CLPS7500
+#define IOMD_ASTCR     (0x0CC)
+#define IOMD_DRAMCR    (0x0D0)
+#define IOMD_SELFREF   (0x0D4)
+#define IOMD_ATODICR   (0x0E0)
+#define IOMD_ATODSR    (0x0E4)
+#define IOMD_ATODCC    (0x0E8)
+#define IOMD_ATODCNT1  (0x0EC)
+#define IOMD_ATODCNT2  (0x0F0)
+#define IOMD_ATODCNT3  (0x0F4)
+#define IOMD_ATODCNT4  (0x0F8)
+#endif
+
+#ifdef CONFIG_ARCH_RPC
+#define DMA_EXT_IO0    1
+#define DMA_EXT_IO1    2
+#define DMA_EXT_IO2    4
+#define DMA_EXT_IO3    8
+
+#define IOMD_IO0CURA   (0x100)
+#define IOMD_IO0ENDA   (0x104)
+#define IOMD_IO0CURB   (0x108)
+#define IOMD_IO0ENDB   (0x10C)
+#define IOMD_IO0CR     (0x110)
+#define IOMD_IO0ST     (0x114)
+
+#define IOMD_IO1CURA   (0x120)
+#define IOMD_IO1ENDA   (0x124)
+#define IOMD_IO1CURB   (0x128)
+#define IOMD_IO1ENDB   (0x12C)
+#define IOMD_IO1CR     (0x130)
+#define IOMD_IO1ST     (0x134)
+
+#define IOMD_IO2CURA   (0x140)
+#define IOMD_IO2ENDA   (0x144)
+#define IOMD_IO2CURB   (0x148)
+#define IOMD_IO2ENDB   (0x14C)
+#define IOMD_IO2CR     (0x150)
+#define IOMD_IO2ST     (0x154)
+
+#define IOMD_IO3CURA   (0x160)
+#define IOMD_IO3ENDA   (0x164)
+#define IOMD_IO3CURB   (0x168)
+#define IOMD_IO3ENDB   (0x16C)
+#define IOMD_IO3CR     (0x170)
+#define IOMD_IO3ST     (0x174)
+#endif
+
+#define IOMD_SD0CURA   (0x180)
+#define IOMD_SD0ENDA   (0x184)
+#define IOMD_SD0CURB   (0x188)
+#define IOMD_SD0ENDB   (0x18C)
+#define IOMD_SD0CR     (0x190)
+#define IOMD_SD0ST     (0x194)
+
+#ifdef CONFIG_ARCH_RPC
+#define IOMD_SD1CURA   (0x1A0)
+#define IOMD_SD1ENDA   (0x1A4)
+#define IOMD_SD1CURB   (0x1A8)
+#define IOMD_SD1ENDB   (0x1AC)
+#define IOMD_SD1CR     (0x1B0)
+#define IOMD_SD1ST     (0x1B4)
+#endif
+
+#define IOMD_CURSCUR   (0x1C0)
+#define IOMD_CURSINIT  (0x1C4)
+
+#define IOMD_VIDCUR    (0x1D0)
+#define IOMD_VIDEND    (0x1D4)
+#define IOMD_VIDSTART  (0x1D8)
+#define IOMD_VIDINIT   (0x1DC)
+#define IOMD_VIDCR     (0x1E0)
+
+#define IOMD_DMASTAT   (0x1F0)
+#define IOMD_DMAREQ    (0x1F4)
+#define IOMD_DMAMASK   (0x1F8)
+
+#define DMA_END_S      (1 << 31)
+#define DMA_END_L      (1 << 30)
+
+#define DMA_CR_C       0x80
+#define DMA_CR_D       0x40
+#define DMA_CR_E       0x20
+
+#define DMA_ST_OFL     4
+#define DMA_ST_INT     2
+#define DMA_ST_AB      1
+
+/*
+ * DMA (MEMC) compatibility
+ */
+#define HALF_SAM       vram_half_sam
+#define VDMA_ALIGNMENT (HALF_SAM * 2)
+#define VDMA_XFERSIZE  (HALF_SAM)
+#define VDMA_INIT      IOMD_VIDINIT
+#define VDMA_START     IOMD_VIDSTART
+#define VDMA_END       IOMD_VIDEND
+
+#ifndef __ASSEMBLY__
+extern unsigned int vram_half_sam;
+#define video_set_dma(start,end,offset)                                \
+do {                                                           \
+       outl (SCREEN_START + start, VDMA_START);                \
+       outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END);    \
+       if (offset >= end - VDMA_XFERSIZE)                      \
+               offset |= 0x40000000;                           \
+       outl (SCREEN_START + offset, VDMA_INIT);                \
+} while (0)
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/hardware/iop3xx-adma.h b/arch/arm/include/asm/hardware/iop3xx-adma.h
new file mode 100644 (file)
index 0000000..af64676
--- /dev/null
@@ -0,0 +1,888 @@
+/*
+ * Copyright Â© 2006, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+#ifndef _ADMA_H
+#define _ADMA_H
+#include <linux/types.h>
+#include <linux/io.h>
+#include <asm/hardware.h>
+#include <asm/hardware/iop_adma.h>
+
+/* Memory copy units */
+#define DMA_CCR(chan)          (chan->mmr_base + 0x0)
+#define DMA_CSR(chan)          (chan->mmr_base + 0x4)
+#define DMA_DAR(chan)          (chan->mmr_base + 0xc)
+#define DMA_NDAR(chan)         (chan->mmr_base + 0x10)
+#define DMA_PADR(chan)         (chan->mmr_base + 0x14)
+#define DMA_PUADR(chan)        (chan->mmr_base + 0x18)
+#define DMA_LADR(chan)         (chan->mmr_base + 0x1c)
+#define DMA_BCR(chan)          (chan->mmr_base + 0x20)
+#define DMA_DCR(chan)          (chan->mmr_base + 0x24)
+
+/* Application accelerator unit  */
+#define AAU_ACR(chan)          (chan->mmr_base + 0x0)
+#define AAU_ASR(chan)          (chan->mmr_base + 0x4)
+#define AAU_ADAR(chan)         (chan->mmr_base + 0x8)
+#define AAU_ANDAR(chan)        (chan->mmr_base + 0xc)
+#define AAU_SAR(src, chan)     (chan->mmr_base + (0x10 + ((src) << 2)))
+#define AAU_DAR(chan)          (chan->mmr_base + 0x20)
+#define AAU_ABCR(chan)         (chan->mmr_base + 0x24)
+#define AAU_ADCR(chan)         (chan->mmr_base + 0x28)
+#define AAU_SAR_EDCR(src_edc)  (chan->mmr_base + (0x02c + ((src_edc-4) << 2)))
+#define AAU_EDCR0_IDX  8
+#define AAU_EDCR1_IDX  17
+#define AAU_EDCR2_IDX  26
+
+#define DMA0_ID 0
+#define DMA1_ID 1
+#define AAU_ID 2
+
+struct iop3xx_aau_desc_ctrl {
+       unsigned int int_en:1;
+       unsigned int blk1_cmd_ctrl:3;
+       unsigned int blk2_cmd_ctrl:3;
+       unsigned int blk3_cmd_ctrl:3;
+       unsigned int blk4_cmd_ctrl:3;
+       unsigned int blk5_cmd_ctrl:3;
+       unsigned int blk6_cmd_ctrl:3;
+       unsigned int blk7_cmd_ctrl:3;
+       unsigned int blk8_cmd_ctrl:3;
+       unsigned int blk_ctrl:2;
+       unsigned int dual_xor_en:1;
+       unsigned int tx_complete:1;
+       unsigned int zero_result_err:1;
+       unsigned int zero_result_en:1;
+       unsigned int dest_write_en:1;
+};
+
+struct iop3xx_aau_e_desc_ctrl {
+       unsigned int reserved:1;
+       unsigned int blk1_cmd_ctrl:3;
+       unsigned int blk2_cmd_ctrl:3;
+       unsigned int blk3_cmd_ctrl:3;
+       unsigned int blk4_cmd_ctrl:3;
+       unsigned int blk5_cmd_ctrl:3;
+       unsigned int blk6_cmd_ctrl:3;
+       unsigned int blk7_cmd_ctrl:3;
+       unsigned int blk8_cmd_ctrl:3;
+       unsigned int reserved2:7;
+};
+
+struct iop3xx_dma_desc_ctrl {
+       unsigned int pci_transaction:4;
+       unsigned int int_en:1;
+       unsigned int dac_cycle_en:1;
+       unsigned int mem_to_mem_en:1;
+       unsigned int crc_data_tx_en:1;
+       unsigned int crc_gen_en:1;
+       unsigned int crc_seed_dis:1;
+       unsigned int reserved:21;
+       unsigned int crc_tx_complete:1;
+};
+
+struct iop3xx_desc_dma {
+       u32 next_desc;
+       union {
+               u32 pci_src_addr;
+               u32 pci_dest_addr;
+               u32 src_addr;
+       };
+       union {
+               u32 upper_pci_src_addr;
+               u32 upper_pci_dest_addr;
+       };
+       union {
+               u32 local_pci_src_addr;
+               u32 local_pci_dest_addr;
+               u32 dest_addr;
+       };
+       u32 byte_count;
+       union {
+               u32 desc_ctrl;
+               struct iop3xx_dma_desc_ctrl desc_ctrl_field;
+       };
+       u32 crc_addr;
+};
+
+struct iop3xx_desc_aau {
+       u32 next_desc;
+       u32 src[4];
+       u32 dest_addr;
+       u32 byte_count;
+       union {
+               u32 desc_ctrl;
+               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
+       };
+       union {
+               u32 src_addr;
+               u32 e_desc_ctrl;
+               struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
+       } src_edc[31];
+};
+
+struct iop3xx_aau_gfmr {
+       unsigned int gfmr1:8;
+       unsigned int gfmr2:8;
+       unsigned int gfmr3:8;
+       unsigned int gfmr4:8;
+};
+
+struct iop3xx_desc_pq_xor {
+       u32 next_desc;
+       u32 src[3];
+       union {
+               u32 data_mult1;
+               struct iop3xx_aau_gfmr data_mult1_field;
+       };
+       u32 dest_addr;
+       u32 byte_count;
+       union {
+               u32 desc_ctrl;
+               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
+       };
+       union {
+               u32 src_addr;
+               u32 e_desc_ctrl;
+               struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
+               u32 data_multiplier;
+               struct iop3xx_aau_gfmr data_mult_field;
+               u32 reserved;
+       } src_edc_gfmr[19];
+};
+
+struct iop3xx_desc_dual_xor {
+       u32 next_desc;
+       u32 src0_addr;
+       u32 src1_addr;
+       u32 h_src_addr;
+       u32 d_src_addr;
+       u32 h_dest_addr;
+       u32 byte_count;
+       union {
+               u32 desc_ctrl;
+               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
+       };
+       u32 d_dest_addr;
+};
+
+union iop3xx_desc {
+       struct iop3xx_desc_aau *aau;
+       struct iop3xx_desc_dma *dma;
+       struct iop3xx_desc_pq_xor *pq_xor;
+       struct iop3xx_desc_dual_xor *dual_xor;
+       void *ptr;
+};
+
+static inline int iop_adma_get_max_xor(void)
+{
+       return 32;
+}
+
+static inline u32 iop_chan_get_current_descriptor(struct iop_adma_chan *chan)
+{
+       int id = chan->device->id;
+
+       switch (id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return __raw_readl(DMA_DAR(chan));
+       case AAU_ID:
+               return __raw_readl(AAU_ADAR(chan));
+       default:
+               BUG();
+       }
+       return 0;
+}
+
+static inline void iop_chan_set_next_descriptor(struct iop_adma_chan *chan,
+                                               u32 next_desc_addr)
+{
+       int id = chan->device->id;
+
+       switch (id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               __raw_writel(next_desc_addr, DMA_NDAR(chan));
+               break;
+       case AAU_ID:
+               __raw_writel(next_desc_addr, AAU_ANDAR(chan));
+               break;
+       }
+
+}
+
+#define IOP_ADMA_STATUS_BUSY (1 << 10)
+#define IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT (1024)
+#define IOP_ADMA_XOR_MAX_BYTE_COUNT (16 * 1024 * 1024)
+#define IOP_ADMA_MAX_BYTE_COUNT (16 * 1024 * 1024)
+
+static inline int iop_chan_is_busy(struct iop_adma_chan *chan)
+{
+       u32 status = __raw_readl(DMA_CSR(chan));
+       return (status & IOP_ADMA_STATUS_BUSY) ? 1 : 0;
+}
+
+static inline int iop_desc_is_aligned(struct iop_adma_desc_slot *desc,
+                                       int num_slots)
+{
+       /* num_slots will only ever be 1, 2, 4, or 8 */
+       return (desc->idx & (num_slots - 1)) ? 0 : 1;
+}
+
+/* to do: support large (i.e. > hw max) buffer sizes */
+static inline int iop_chan_memcpy_slot_count(size_t len, int *slots_per_op)
+{
+       *slots_per_op = 1;
+       return 1;
+}
+
+/* to do: support large (i.e. > hw max) buffer sizes */
+static inline int iop_chan_memset_slot_count(size_t len, int *slots_per_op)
+{
+       *slots_per_op = 1;
+       return 1;
+}
+
+static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt,
+                                       int *slots_per_op)
+{
+       static const char slot_count_table[] = {
+                                               1, 1, 1, 1, /* 01 - 04 */
+                                               2, 2, 2, 2, /* 05 - 08 */
+                                               4, 4, 4, 4, /* 09 - 12 */
+                                               4, 4, 4, 4, /* 13 - 16 */
+                                               8, 8, 8, 8, /* 17 - 20 */
+                                               8, 8, 8, 8, /* 21 - 24 */
+                                               8, 8, 8, 8, /* 25 - 28 */
+                                               8, 8, 8, 8, /* 29 - 32 */
+                                             };
+       *slots_per_op = slot_count_table[src_cnt - 1];
+       return *slots_per_op;
+}
+
+static inline int
+iop_chan_interrupt_slot_count(int *slots_per_op, struct iop_adma_chan *chan)
+{
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return iop_chan_memcpy_slot_count(0, slots_per_op);
+       case AAU_ID:
+               return iop3xx_aau_xor_slot_count(0, 2, slots_per_op);
+       default:
+               BUG();
+       }
+       return 0;
+}
+
+static inline int iop_chan_xor_slot_count(size_t len, int src_cnt,
+                                               int *slots_per_op)
+{
+       int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
+
+       if (len <= IOP_ADMA_XOR_MAX_BYTE_COUNT)
+               return slot_cnt;
+
+       len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
+       while (len > IOP_ADMA_XOR_MAX_BYTE_COUNT) {
+               len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
+               slot_cnt += *slots_per_op;
+       }
+
+       if (len)
+               slot_cnt += *slots_per_op;
+
+       return slot_cnt;
+}
+
+/* zero sum on iop3xx is limited to 1k at a time so it requires multiple
+ * descriptors
+ */
+static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
+                                               int *slots_per_op)
+{
+       int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
+
+       if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT)
+               return slot_cnt;
+
+       len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
+       while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
+               len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
+               slot_cnt += *slots_per_op;
+       }
+
+       if (len)
+               slot_cnt += *slots_per_op;
+
+       return slot_cnt;
+}
+
+static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
+                                       struct iop_adma_chan *chan)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return hw_desc.dma->dest_addr;
+       case AAU_ID:
+               return hw_desc.aau->dest_addr;
+       default:
+               BUG();
+       }
+       return 0;
+}
+
+static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
+                                       struct iop_adma_chan *chan)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return hw_desc.dma->byte_count;
+       case AAU_ID:
+               return hw_desc.aau->byte_count;
+       default:
+               BUG();
+       }
+       return 0;
+}
+
+/* translate the src_idx to a descriptor word index */
+static inline int __desc_idx(int src_idx)
+{
+       static const int desc_idx_table[] = { 0, 0, 0, 0,
+                                             0, 1, 2, 3,
+                                             5, 6, 7, 8,
+                                             9, 10, 11, 12,
+                                             14, 15, 16, 17,
+                                             18, 19, 20, 21,
+                                             23, 24, 25, 26,
+                                             27, 28, 29, 30,
+                                           };
+
+       return desc_idx_table[src_idx];
+}
+
+static inline u32 iop_desc_get_src_addr(struct iop_adma_desc_slot *desc,
+                                       struct iop_adma_chan *chan,
+                                       int src_idx)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return hw_desc.dma->src_addr;
+       case AAU_ID:
+               break;
+       default:
+               BUG();
+       }
+
+       if (src_idx < 4)
+               return hw_desc.aau->src[src_idx];
+       else
+               return hw_desc.aau->src_edc[__desc_idx(src_idx)].src_addr;
+}
+
+static inline void iop3xx_aau_desc_set_src_addr(struct iop3xx_desc_aau *hw_desc,
+                                       int src_idx, dma_addr_t addr)
+{
+       if (src_idx < 4)
+               hw_desc->src[src_idx] = addr;
+       else
+               hw_desc->src_edc[__desc_idx(src_idx)].src_addr = addr;
+}
+
+static inline void
+iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, unsigned long flags)
+{
+       struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
+       union {
+               u32 value;
+               struct iop3xx_dma_desc_ctrl field;
+       } u_desc_ctrl;
+
+       u_desc_ctrl.value = 0;
+       u_desc_ctrl.field.mem_to_mem_en = 1;
+       u_desc_ctrl.field.pci_transaction = 0xe; /* memory read block */
+       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
+       hw_desc->desc_ctrl = u_desc_ctrl.value;
+       hw_desc->upper_pci_src_addr = 0;
+       hw_desc->crc_addr = 0;
+}
+
+static inline void
+iop_desc_init_memset(struct iop_adma_desc_slot *desc, unsigned long flags)
+{
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
+       union {
+               u32 value;
+               struct iop3xx_aau_desc_ctrl field;
+       } u_desc_ctrl;
+
+       u_desc_ctrl.value = 0;
+       u_desc_ctrl.field.blk1_cmd_ctrl = 0x2; /* memory block fill */
+       u_desc_ctrl.field.dest_write_en = 1;
+       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
+       hw_desc->desc_ctrl = u_desc_ctrl.value;
+}
+
+static inline u32
+iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt,
+                    unsigned long flags)
+{
+       int i, shift;
+       u32 edcr;
+       union {
+               u32 value;
+               struct iop3xx_aau_desc_ctrl field;
+       } u_desc_ctrl;
+
+       u_desc_ctrl.value = 0;
+       switch (src_cnt) {
+       case 25 ... 32:
+               u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
+               edcr = 0;
+               shift = 1;
+               for (i = 24; i < src_cnt; i++) {
+                       edcr |= (1 << shift);
+                       shift += 3;
+               }
+               hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = edcr;
+               src_cnt = 24;
+               /* fall through */
+       case 17 ... 24:
+               if (!u_desc_ctrl.field.blk_ctrl) {
+                       hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
+                       u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
+               }
+               edcr = 0;
+               shift = 1;
+               for (i = 16; i < src_cnt; i++) {
+                       edcr |= (1 << shift);
+                       shift += 3;
+               }
+               hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = edcr;
+               src_cnt = 16;
+               /* fall through */
+       case 9 ... 16:
+               if (!u_desc_ctrl.field.blk_ctrl)
+                       u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
+               edcr = 0;
+               shift = 1;
+               for (i = 8; i < src_cnt; i++) {
+                       edcr |= (1 << shift);
+                       shift += 3;
+               }
+               hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = edcr;
+               src_cnt = 8;
+               /* fall through */
+       case 2 ... 8:
+               shift = 1;
+               for (i = 0; i < src_cnt; i++) {
+                       u_desc_ctrl.value |= (1 << shift);
+                       shift += 3;
+               }
+
+               if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
+                       u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
+       }
+
+       u_desc_ctrl.field.dest_write_en = 1;
+       u_desc_ctrl.field.blk1_cmd_ctrl = 0x7; /* direct fill */
+       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
+       hw_desc->desc_ctrl = u_desc_ctrl.value;
+
+       return u_desc_ctrl.value;
+}
+
+static inline void
+iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt,
+                 unsigned long flags)
+{
+       iop3xx_desc_init_xor(desc->hw_desc, src_cnt, flags);
+}
+
+/* return the number of operations */
+static inline int
+iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
+                      unsigned long flags)
+{
+       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
+       struct iop3xx_desc_aau *hw_desc, *prev_hw_desc, *iter;
+       union {
+               u32 value;
+               struct iop3xx_aau_desc_ctrl field;
+       } u_desc_ctrl;
+       int i, j;
+
+       hw_desc = desc->hw_desc;
+
+       for (i = 0, j = 0; (slot_cnt -= slots_per_op) >= 0;
+               i += slots_per_op, j++) {
+               iter = iop_hw_desc_slot_idx(hw_desc, i);
+               u_desc_ctrl.value = iop3xx_desc_init_xor(iter, src_cnt, flags);
+               u_desc_ctrl.field.dest_write_en = 0;
+               u_desc_ctrl.field.zero_result_en = 1;
+               u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
+               iter->desc_ctrl = u_desc_ctrl.value;
+
+               /* for the subsequent descriptors preserve the store queue
+                * and chain them together
+                */
+               if (i) {
+                       prev_hw_desc =
+                               iop_hw_desc_slot_idx(hw_desc, i - slots_per_op);
+                       prev_hw_desc->next_desc =
+                               (u32) (desc->async_tx.phys + (i << 5));
+               }
+       }
+
+       return j;
+}
+
+static inline void
+iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt,
+                      unsigned long flags)
+{
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
+       union {
+               u32 value;
+               struct iop3xx_aau_desc_ctrl field;
+       } u_desc_ctrl;
+
+       u_desc_ctrl.value = 0;
+       switch (src_cnt) {
+       case 25 ... 32:
+               u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
+               hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
+               /* fall through */
+       case 17 ... 24:
+               if (!u_desc_ctrl.field.blk_ctrl) {
+                       hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
+                       u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
+               }
+               hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = 0;
+               /* fall through */
+       case 9 ... 16:
+               if (!u_desc_ctrl.field.blk_ctrl)
+                       u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
+               hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = 0;
+               /* fall through */
+       case 1 ... 8:
+               if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
+                       u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
+       }
+
+       u_desc_ctrl.field.dest_write_en = 0;
+       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
+       hw_desc->desc_ctrl = u_desc_ctrl.value;
+}
+
+static inline void iop_desc_set_byte_count(struct iop_adma_desc_slot *desc,
+                                       struct iop_adma_chan *chan,
+                                       u32 byte_count)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               hw_desc.dma->byte_count = byte_count;
+               break;
+       case AAU_ID:
+               hw_desc.aau->byte_count = byte_count;
+               break;
+       default:
+               BUG();
+       }
+}
+
+static inline void
+iop_desc_init_interrupt(struct iop_adma_desc_slot *desc,
+                       struct iop_adma_chan *chan)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               iop_desc_init_memcpy(desc, 1);
+               hw_desc.dma->byte_count = 0;
+               hw_desc.dma->dest_addr = 0;
+               hw_desc.dma->src_addr = 0;
+               break;
+       case AAU_ID:
+               iop_desc_init_null_xor(desc, 2, 1);
+               hw_desc.aau->byte_count = 0;
+               hw_desc.aau->dest_addr = 0;
+               hw_desc.aau->src[0] = 0;
+               hw_desc.aau->src[1] = 0;
+               break;
+       default:
+               BUG();
+       }
+}
+
+static inline void
+iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
+{
+       int slots_per_op = desc->slots_per_op;
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
+       int i = 0;
+
+       if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
+               hw_desc->byte_count = len;
+       } else {
+               do {
+                       iter = iop_hw_desc_slot_idx(hw_desc, i);
+                       iter->byte_count = IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
+                       len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
+                       i += slots_per_op;
+               } while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
+
+               if (len) {
+                       iter = iop_hw_desc_slot_idx(hw_desc, i);
+                       iter->byte_count = len;
+               }
+       }
+}
+
+static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
+                                       struct iop_adma_chan *chan,
+                                       dma_addr_t addr)
+{
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               hw_desc.dma->dest_addr = addr;
+               break;
+       case AAU_ID:
+               hw_desc.aau->dest_addr = addr;
+               break;
+       default:
+               BUG();
+       }
+}
+
+static inline void iop_desc_set_memcpy_src_addr(struct iop_adma_desc_slot *desc,
+                                       dma_addr_t addr)
+{
+       struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
+       hw_desc->src_addr = addr;
+}
+
+static inline void
+iop_desc_set_zero_sum_src_addr(struct iop_adma_desc_slot *desc, int src_idx,
+                               dma_addr_t addr)
+{
+
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
+       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
+       int i;
+
+       for (i = 0; (slot_cnt -= slots_per_op) >= 0;
+               i += slots_per_op, addr += IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
+               iter = iop_hw_desc_slot_idx(hw_desc, i);
+               iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
+       }
+}
+
+static inline void iop_desc_set_xor_src_addr(struct iop_adma_desc_slot *desc,
+                                       int src_idx, dma_addr_t addr)
+{
+
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
+       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
+       int i;
+
+       for (i = 0; (slot_cnt -= slots_per_op) >= 0;
+               i += slots_per_op, addr += IOP_ADMA_XOR_MAX_BYTE_COUNT) {
+               iter = iop_hw_desc_slot_idx(hw_desc, i);
+               iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
+       }
+}
+
+static inline void iop_desc_set_next_desc(struct iop_adma_desc_slot *desc,
+                                       u32 next_desc_addr)
+{
+       /* hw_desc->next_desc is the same location for all channels */
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+       BUG_ON(hw_desc.dma->next_desc);
+       hw_desc.dma->next_desc = next_desc_addr;
+}
+
+static inline u32 iop_desc_get_next_desc(struct iop_adma_desc_slot *desc)
+{
+       /* hw_desc->next_desc is the same location for all channels */
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+       return hw_desc.dma->next_desc;
+}
+
+static inline void iop_desc_clear_next_desc(struct iop_adma_desc_slot *desc)
+{
+       /* hw_desc->next_desc is the same location for all channels */
+       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
+       hw_desc.dma->next_desc = 0;
+}
+
+static inline void iop_desc_set_block_fill_val(struct iop_adma_desc_slot *desc,
+                                               u32 val)
+{
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
+       hw_desc->src[0] = val;
+}
+
+static inline int iop_desc_get_zero_result(struct iop_adma_desc_slot *desc)
+{
+       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
+       struct iop3xx_aau_desc_ctrl desc_ctrl = hw_desc->desc_ctrl_field;
+
+       BUG_ON(!(desc_ctrl.tx_complete && desc_ctrl.zero_result_en));
+       return desc_ctrl.zero_result_err;
+}
+
+static inline void iop_chan_append(struct iop_adma_chan *chan)
+{
+       u32 dma_chan_ctrl;
+
+       dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
+       dma_chan_ctrl |= 0x2;
+       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
+}
+
+static inline u32 iop_chan_get_status(struct iop_adma_chan *chan)
+{
+       return __raw_readl(DMA_CSR(chan));
+}
+
+static inline void iop_chan_disable(struct iop_adma_chan *chan)
+{
+       u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
+       dma_chan_ctrl &= ~1;
+       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
+}
+
+static inline void iop_chan_enable(struct iop_adma_chan *chan)
+{
+       u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
+
+       dma_chan_ctrl |= 1;
+       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
+}
+
+static inline void iop_adma_device_clear_eot_status(struct iop_adma_chan *chan)
+{
+       u32 status = __raw_readl(DMA_CSR(chan));
+       status &= (1 << 9);
+       __raw_writel(status, DMA_CSR(chan));
+}
+
+static inline void iop_adma_device_clear_eoc_status(struct iop_adma_chan *chan)
+{
+       u32 status = __raw_readl(DMA_CSR(chan));
+       status &= (1 << 8);
+       __raw_writel(status, DMA_CSR(chan));
+}
+
+static inline void iop_adma_device_clear_err_status(struct iop_adma_chan *chan)
+{
+       u32 status = __raw_readl(DMA_CSR(chan));
+
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               status &= (1 << 5) | (1 << 3) | (1 << 2) | (1 << 1);
+               break;
+       case AAU_ID:
+               status &= (1 << 5);
+               break;
+       default:
+               BUG();
+       }
+
+       __raw_writel(status, DMA_CSR(chan));
+}
+
+static inline int
+iop_is_err_int_parity(unsigned long status, struct iop_adma_chan *chan)
+{
+       return 0;
+}
+
+static inline int
+iop_is_err_mcu_abort(unsigned long status, struct iop_adma_chan *chan)
+{
+       return 0;
+}
+
+static inline int
+iop_is_err_int_tabort(unsigned long status, struct iop_adma_chan *chan)
+{
+       return 0;
+}
+
+static inline int
+iop_is_err_int_mabort(unsigned long status, struct iop_adma_chan *chan)
+{
+       return test_bit(5, &status);
+}
+
+static inline int
+iop_is_err_pci_tabort(unsigned long status, struct iop_adma_chan *chan)
+{
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return test_bit(2, &status);
+       default:
+               return 0;
+       }
+}
+
+static inline int
+iop_is_err_pci_mabort(unsigned long status, struct iop_adma_chan *chan)
+{
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return test_bit(3, &status);
+       default:
+               return 0;
+       }
+}
+
+static inline int
+iop_is_err_split_tx(unsigned long status, struct iop_adma_chan *chan)
+{
+       switch (chan->device->id) {
+       case DMA0_ID:
+       case DMA1_ID:
+               return test_bit(1, &status);
+       default:
+               return 0;
+       }
+}
+#endif /* _ADMA_H */
diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h
new file mode 100644 (file)
index 0000000..222e74b
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * arch/arm/include/asm/hardware/iop3xx-gpio.h
+ *
+ * IOP3xx GPIO wrappers
+ *
+ * Copyright (c) 2008 Arnaud Patard <arnaud.patard@rtp-net.org>
+ * Based on IXP4XX gpio.h file
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
+#define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
+
+#include <asm/hardware.h>
+#include <asm-generic/gpio.h>
+
+#define IOP3XX_N_GPIOS 8
+
+static inline int gpio_get_value(unsigned gpio)
+{
+       if (gpio > IOP3XX_N_GPIOS)
+               return __gpio_get_value(gpio);
+
+       return gpio_line_get(gpio);
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+       if (gpio > IOP3XX_N_GPIOS) {
+               __gpio_set_value(gpio, value);
+               return;
+       }
+       gpio_line_set(gpio, value);
+}
+
+static inline int gpio_cansleep(unsigned gpio)
+{
+       if (gpio < IOP3XX_N_GPIOS)
+               return 0;
+       else
+               return __gpio_cansleep(gpio);
+}
+
+/*
+ * The GPIOs are not generating any interrupt
+ * Note : manuals are not clear about this
+ */
+static inline int gpio_to_irq(int gpio)
+{
+       return -EINVAL;
+}
+
+static inline int irq_to_gpio(int gpio)
+{
+       return -EINVAL;
+}
+
+#endif
+
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
new file mode 100644 (file)
index 0000000..4b8e7f5
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * arch/arm/include/asm/hardware/iop3xx.h
+ *
+ * Intel IOP32X and IOP33X register definitions
+ *
+ * Author: Rory Bolt <rorybolt@pacbell.net>
+ * Copyright (C) 2002 Rory Bolt
+ * Copyright (C) 2004 Intel Corp.
+ *
+ * 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.
+ */
+
+#ifndef __IOP3XX_H
+#define __IOP3XX_H
+
+/*
+ * IOP3XX GPIO handling
+ */
+#define GPIO_IN                        0
+#define GPIO_OUT               1
+#define GPIO_LOW               0
+#define GPIO_HIGH              1
+#define IOP3XX_GPIO_LINE(x)    (x)
+
+#ifndef __ASSEMBLY__
+extern void gpio_line_config(int line, int direction);
+extern int  gpio_line_get(int line);
+extern void gpio_line_set(int line, int value);
+extern int init_atu;
+extern int iop3xx_get_init_atu(void);
+#endif
+
+
+/*
+ * IOP3XX processor registers
+ */
+#define IOP3XX_PERIPHERAL_PHYS_BASE    0xffffe000
+#define IOP3XX_PERIPHERAL_VIRT_BASE    0xfeffe000
+#define IOP3XX_PERIPHERAL_SIZE         0x00002000
+#define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\
+                                       IOP3XX_PERIPHERAL_SIZE - 1)
+#define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\
+                                       IOP3XX_PERIPHERAL_SIZE - 1)
+#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) (addr) -\
+                                       (IOP3XX_PERIPHERAL_PHYS_BASE\
+                                       - IOP3XX_PERIPHERAL_VIRT_BASE))
+#define IOP3XX_REG_ADDR(reg)           (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
+
+/* Address Translation Unit  */
+#define IOP3XX_ATUVID          (volatile u16 *)IOP3XX_REG_ADDR(0x0100)
+#define IOP3XX_ATUDID          (volatile u16 *)IOP3XX_REG_ADDR(0x0102)
+#define IOP3XX_ATUCMD          (volatile u16 *)IOP3XX_REG_ADDR(0x0104)
+#define IOP3XX_ATUSR           (volatile u16 *)IOP3XX_REG_ADDR(0x0106)
+#define IOP3XX_ATURID          (volatile u8  *)IOP3XX_REG_ADDR(0x0108)
+#define IOP3XX_ATUCCR          (volatile u32 *)IOP3XX_REG_ADDR(0x0109)
+#define IOP3XX_ATUCLSR         (volatile u8  *)IOP3XX_REG_ADDR(0x010c)
+#define IOP3XX_ATULT           (volatile u8  *)IOP3XX_REG_ADDR(0x010d)
+#define IOP3XX_ATUHTR          (volatile u8  *)IOP3XX_REG_ADDR(0x010e)
+#define IOP3XX_ATUBIST         (volatile u8  *)IOP3XX_REG_ADDR(0x010f)
+#define IOP3XX_IABAR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0110)
+#define IOP3XX_IAUBAR0         (volatile u32 *)IOP3XX_REG_ADDR(0x0114)
+#define IOP3XX_IABAR1          (volatile u32 *)IOP3XX_REG_ADDR(0x0118)
+#define IOP3XX_IAUBAR1         (volatile u32 *)IOP3XX_REG_ADDR(0x011c)
+#define IOP3XX_IABAR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0120)
+#define IOP3XX_IAUBAR2         (volatile u32 *)IOP3XX_REG_ADDR(0x0124)
+#define IOP3XX_ASVIR           (volatile u16 *)IOP3XX_REG_ADDR(0x012c)
+#define IOP3XX_ASIR            (volatile u16 *)IOP3XX_REG_ADDR(0x012e)
+#define IOP3XX_ERBAR           (volatile u32 *)IOP3XX_REG_ADDR(0x0130)
+#define IOP3XX_ATUILR          (volatile u8  *)IOP3XX_REG_ADDR(0x013c)
+#define IOP3XX_ATUIPR          (volatile u8  *)IOP3XX_REG_ADDR(0x013d)
+#define IOP3XX_ATUMGNT         (volatile u8  *)IOP3XX_REG_ADDR(0x013e)
+#define IOP3XX_ATUMLAT         (volatile u8  *)IOP3XX_REG_ADDR(0x013f)
+#define IOP3XX_IALR0           (volatile u32 *)IOP3XX_REG_ADDR(0x0140)
+#define IOP3XX_IATVR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0144)
+#define IOP3XX_ERLR            (volatile u32 *)IOP3XX_REG_ADDR(0x0148)
+#define IOP3XX_ERTVR           (volatile u32 *)IOP3XX_REG_ADDR(0x014c)
+#define IOP3XX_IALR1           (volatile u32 *)IOP3XX_REG_ADDR(0x0150)
+#define IOP3XX_IALR2           (volatile u32 *)IOP3XX_REG_ADDR(0x0154)
+#define IOP3XX_IATVR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0158)
+#define IOP3XX_OIOWTVR         (volatile u32 *)IOP3XX_REG_ADDR(0x015c)
+#define IOP3XX_OMWTVR0         (volatile u32 *)IOP3XX_REG_ADDR(0x0160)
+#define IOP3XX_OUMWTVR0                (volatile u32 *)IOP3XX_REG_ADDR(0x0164)
+#define IOP3XX_OMWTVR1         (volatile u32 *)IOP3XX_REG_ADDR(0x0168)
+#define IOP3XX_OUMWTVR1                (volatile u32 *)IOP3XX_REG_ADDR(0x016c)
+#define IOP3XX_OUDWTVR         (volatile u32 *)IOP3XX_REG_ADDR(0x0178)
+#define IOP3XX_ATUCR           (volatile u32 *)IOP3XX_REG_ADDR(0x0180)
+#define IOP3XX_PCSR            (volatile u32 *)IOP3XX_REG_ADDR(0x0184)
+#define IOP3XX_ATUISR          (volatile u32 *)IOP3XX_REG_ADDR(0x0188)
+#define IOP3XX_ATUIMR          (volatile u32 *)IOP3XX_REG_ADDR(0x018c)
+#define IOP3XX_IABAR3          (volatile u32 *)IOP3XX_REG_ADDR(0x0190)
+#define IOP3XX_IAUBAR3         (volatile u32 *)IOP3XX_REG_ADDR(0x0194)
+#define IOP3XX_IALR3           (volatile u32 *)IOP3XX_REG_ADDR(0x0198)
+#define IOP3XX_IATVR3          (volatile u32 *)IOP3XX_REG_ADDR(0x019c)
+#define IOP3XX_OCCAR           (volatile u32 *)IOP3XX_REG_ADDR(0x01a4)
+#define IOP3XX_OCCDR           (volatile u32 *)IOP3XX_REG_ADDR(0x01ac)
+#define IOP3XX_PDSCR           (volatile u32 *)IOP3XX_REG_ADDR(0x01bc)
+#define IOP3XX_PMCAPID         (volatile u8  *)IOP3XX_REG_ADDR(0x01c0)
+#define IOP3XX_PMNEXT          (volatile u8  *)IOP3XX_REG_ADDR(0x01c1)
+#define IOP3XX_APMCR           (volatile u16 *)IOP3XX_REG_ADDR(0x01c2)
+#define IOP3XX_APMCSR          (volatile u16 *)IOP3XX_REG_ADDR(0x01c4)
+#define IOP3XX_PCIXCAPID       (volatile u8  *)IOP3XX_REG_ADDR(0x01e0)
+#define IOP3XX_PCIXNEXT                (volatile u8  *)IOP3XX_REG_ADDR(0x01e1)
+#define IOP3XX_PCIXCMD         (volatile u16 *)IOP3XX_REG_ADDR(0x01e2)
+#define IOP3XX_PCIXSR          (volatile u32 *)IOP3XX_REG_ADDR(0x01e4)
+#define IOP3XX_PCIIRSR         (volatile u32 *)IOP3XX_REG_ADDR(0x01ec)
+#define IOP3XX_PCSR_OUT_Q_BUSY (1 << 15)
+#define IOP3XX_PCSR_IN_Q_BUSY  (1 << 14)
+#define IOP3XX_ATUCR_OUT_EN    (1 << 1)
+
+#define IOP3XX_INIT_ATU_DEFAULT 0
+#define IOP3XX_INIT_ATU_DISABLE -1
+#define IOP3XX_INIT_ATU_ENABLE  1
+
+/* Messaging Unit  */
+#define IOP3XX_IMR0            (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
+#define IOP3XX_IMR1            (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
+#define IOP3XX_OMR0            (volatile u32 *)IOP3XX_REG_ADDR(0x0318)
+#define IOP3XX_OMR1            (volatile u32 *)IOP3XX_REG_ADDR(0x031c)
+#define IOP3XX_IDR             (volatile u32 *)IOP3XX_REG_ADDR(0x0320)
+#define IOP3XX_IISR            (volatile u32 *)IOP3XX_REG_ADDR(0x0324)
+#define IOP3XX_IIMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0328)
+#define IOP3XX_ODR             (volatile u32 *)IOP3XX_REG_ADDR(0x032c)
+#define IOP3XX_OISR            (volatile u32 *)IOP3XX_REG_ADDR(0x0330)
+#define IOP3XX_OIMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0334)
+#define IOP3XX_MUCR            (volatile u32 *)IOP3XX_REG_ADDR(0x0350)
+#define IOP3XX_QBAR            (volatile u32 *)IOP3XX_REG_ADDR(0x0354)
+#define IOP3XX_IFHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0360)
+#define IOP3XX_IFTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0364)
+#define IOP3XX_IPHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0368)
+#define IOP3XX_IPTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x036c)
+#define IOP3XX_OFHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0370)
+#define IOP3XX_OFTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0374)
+#define IOP3XX_OPHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0378)
+#define IOP3XX_OPTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x037c)
+#define IOP3XX_IAR             (volatile u32 *)IOP3XX_REG_ADDR(0x0380)
+
+/* DMA Controller  */
+#define IOP3XX_DMA_PHYS_BASE(chan) (IOP3XX_PERIPHERAL_PHYS_BASE + \
+                                       (0x400 + (chan << 6)))
+#define IOP3XX_DMA_UPPER_PA(chan)  (IOP3XX_DMA_PHYS_BASE(chan) + 0x27)
+
+/* Peripheral bus interface  */
+#define IOP3XX_PBCR            (volatile u32 *)IOP3XX_REG_ADDR(0x0680)
+#define IOP3XX_PBISR           (volatile u32 *)IOP3XX_REG_ADDR(0x0684)
+#define IOP3XX_PBBAR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0688)
+#define IOP3XX_PBLR0           (volatile u32 *)IOP3XX_REG_ADDR(0x068c)
+#define IOP3XX_PBBAR1          (volatile u32 *)IOP3XX_REG_ADDR(0x0690)
+#define IOP3XX_PBLR1           (volatile u32 *)IOP3XX_REG_ADDR(0x0694)
+#define IOP3XX_PBBAR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0698)
+#define IOP3XX_PBLR2           (volatile u32 *)IOP3XX_REG_ADDR(0x069c)
+#define IOP3XX_PBBAR3          (volatile u32 *)IOP3XX_REG_ADDR(0x06a0)
+#define IOP3XX_PBLR3           (volatile u32 *)IOP3XX_REG_ADDR(0x06a4)
+#define IOP3XX_PBBAR4          (volatile u32 *)IOP3XX_REG_ADDR(0x06a8)
+#define IOP3XX_PBLR4           (volatile u32 *)IOP3XX_REG_ADDR(0x06ac)
+#define IOP3XX_PBBAR5          (volatile u32 *)IOP3XX_REG_ADDR(0x06b0)
+#define IOP3XX_PBLR5           (volatile u32 *)IOP3XX_REG_ADDR(0x06b4)
+#define IOP3XX_PMBR0           (volatile u32 *)IOP3XX_REG_ADDR(0x06c0)
+#define IOP3XX_PMBR1           (volatile u32 *)IOP3XX_REG_ADDR(0x06e0)
+#define IOP3XX_PMBR2           (volatile u32 *)IOP3XX_REG_ADDR(0x06e4)
+
+/* Peripheral performance monitoring unit  */
+#define IOP3XX_GTMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0700)
+#define IOP3XX_ESR             (volatile u32 *)IOP3XX_REG_ADDR(0x0704)
+#define IOP3XX_EMISR           (volatile u32 *)IOP3XX_REG_ADDR(0x0708)
+#define IOP3XX_GTSR            (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
+/* PERCR0 DOESN'T EXIST - index from 1! */
+#define IOP3XX_PERCR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
+
+/* General Purpose I/O  */
+#define IOP3XX_GPOE            (volatile u32 *)IOP3XX_GPIO_REG(0x0000)
+#define IOP3XX_GPID            (volatile u32 *)IOP3XX_GPIO_REG(0x0004)
+#define IOP3XX_GPOD            (volatile u32 *)IOP3XX_GPIO_REG(0x0008)
+
+/* Timers  */
+#define IOP3XX_TU_TMR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0000)
+#define IOP3XX_TU_TMR1         (volatile u32 *)IOP3XX_TIMER_REG(0x0004)
+#define IOP3XX_TU_TCR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0008)
+#define IOP3XX_TU_TCR1         (volatile u32 *)IOP3XX_TIMER_REG(0x000c)
+#define IOP3XX_TU_TRR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0010)
+#define IOP3XX_TU_TRR1         (volatile u32 *)IOP3XX_TIMER_REG(0x0014)
+#define IOP3XX_TU_TISR         (volatile u32 *)IOP3XX_TIMER_REG(0x0018)
+#define IOP3XX_TU_WDTCR                (volatile u32 *)IOP3XX_TIMER_REG(0x001c)
+#define IOP_TMR_EN         0x02
+#define IOP_TMR_RELOAD     0x04
+#define IOP_TMR_PRIVILEGED 0x08
+#define IOP_TMR_RATIO_1_1  0x00
+
+/* Watchdog timer definitions */
+#define IOP_WDTCR_EN_ARM        0x1e1e1e1e
+#define IOP_WDTCR_EN            0xe1e1e1e1
+/* iop3xx does not support stopping the watchdog, so we just re-arm */
+#define IOP_WDTCR_DIS_ARM      (IOP_WDTCR_EN_ARM)
+#define IOP_WDTCR_DIS          (IOP_WDTCR_EN)
+
+/* Application accelerator unit  */
+#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
+#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
+
+/* I2C bus interface unit  */
+#define IOP3XX_ICR0            (volatile u32 *)IOP3XX_REG_ADDR(0x1680)
+#define IOP3XX_ISR0            (volatile u32 *)IOP3XX_REG_ADDR(0x1684)
+#define IOP3XX_ISAR0           (volatile u32 *)IOP3XX_REG_ADDR(0x1688)
+#define IOP3XX_IDBR0           (volatile u32 *)IOP3XX_REG_ADDR(0x168c)
+#define IOP3XX_IBMR0           (volatile u32 *)IOP3XX_REG_ADDR(0x1694)
+#define IOP3XX_ICR1            (volatile u32 *)IOP3XX_REG_ADDR(0x16a0)
+#define IOP3XX_ISR1            (volatile u32 *)IOP3XX_REG_ADDR(0x16a4)
+#define IOP3XX_ISAR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16a8)
+#define IOP3XX_IDBR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16ac)
+#define IOP3XX_IBMR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16b4)
+
+
+/*
+ * IOP3XX I/O and Mem space regions for PCI autoconfiguration
+ */
+#define IOP3XX_PCI_LOWER_MEM_PA        0x80000000
+
+#define IOP3XX_PCI_IO_WINDOW_SIZE      0x00010000
+#define IOP3XX_PCI_LOWER_IO_PA         0x90000000
+#define IOP3XX_PCI_LOWER_IO_VA         0xfe000000
+#define IOP3XX_PCI_LOWER_IO_BA         0x90000000
+#define IOP3XX_PCI_UPPER_IO_PA         (IOP3XX_PCI_LOWER_IO_PA +\
+                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
+#define IOP3XX_PCI_UPPER_IO_VA         (IOP3XX_PCI_LOWER_IO_VA +\
+                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
+#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\
+                                       IOP3XX_PCI_LOWER_IO_PA) +\
+                                       IOP3XX_PCI_LOWER_IO_VA)
+
+
+#ifndef __ASSEMBLY__
+void iop3xx_map_io(void);
+void iop_init_cp6_handler(void);
+void iop_init_time(unsigned long tickrate);
+unsigned long iop_gettimeoffset(void);
+
+static inline void write_tmr0(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (val));
+}
+
+static inline void write_tmr1(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (val));
+}
+
+static inline u32 read_tcr0(void)
+{
+       u32 val;
+       asm volatile("mrc p6, 0, %0, c2, c1, 0" : "=r" (val));
+       return val;
+}
+
+static inline u32 read_tcr1(void)
+{
+       u32 val;
+       asm volatile("mrc p6, 0, %0, c3, c1, 0" : "=r" (val));
+       return val;
+}
+
+static inline void write_trr0(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val));
+}
+
+static inline void write_trr1(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c5, c1, 0" : : "r" (val));
+}
+
+static inline void write_tisr(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
+}
+
+static inline u32 read_wdtcr(void)
+{
+       u32 val;
+       asm volatile("mrc p6, 0, %0, c7, c1, 0":"=r" (val));
+       return val;
+}
+static inline void write_wdtcr(u32 val)
+{
+       asm volatile("mcr p6, 0, %0, c7, c1, 0"::"r" (val));
+}
+
+extern unsigned long get_iop_tick_rate(void);
+
+/* only iop13xx has these registers, we define these to present a
+ * common register interface for the iop_wdt driver.
+ */
+#define IOP_RCSR_WDT   (0)
+static inline u32 read_rcsr(void)
+{
+       return 0;
+}
+static inline void write_wdtsr(u32 val)
+{
+       do { } while (0);
+}
+
+extern struct platform_device iop3xx_dma_0_channel;
+extern struct platform_device iop3xx_dma_1_channel;
+extern struct platform_device iop3xx_aau_channel;
+extern struct platform_device iop3xx_i2c0_device;
+extern struct platform_device iop3xx_i2c1_device;
+
+#endif
+
+
+#endif
diff --git a/arch/arm/include/asm/hardware/iop_adma.h b/arch/arm/include/asm/hardware/iop_adma.h
new file mode 100644 (file)
index 0000000..cb7e361
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright Â© 2006, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+#ifndef IOP_ADMA_H
+#define IOP_ADMA_H
+#include <linux/types.h>
+#include <linux/dmaengine.h>
+#include <linux/interrupt.h>
+
+#define IOP_ADMA_SLOT_SIZE 32
+#define IOP_ADMA_THRESHOLD 4
+
+/**
+ * struct iop_adma_device - internal representation of an ADMA device
+ * @pdev: Platform device
+ * @id: HW ADMA Device selector
+ * @dma_desc_pool: base of DMA descriptor region (DMA address)
+ * @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
+ * @common: embedded struct dma_device
+ */
+struct iop_adma_device {
+       struct platform_device *pdev;
+       int id;
+       dma_addr_t dma_desc_pool;
+       void *dma_desc_pool_virt;
+       struct dma_device common;
+};
+
+/**
+ * struct iop_adma_chan - internal representation of an ADMA device
+ * @pending: allows batching of hardware operations
+ * @completed_cookie: identifier for the most recently completed operation
+ * @lock: serializes enqueue/dequeue operations to the slot pool
+ * @mmr_base: memory mapped register base
+ * @chain: device chain view of the descriptors
+ * @device: parent device
+ * @common: common dmaengine channel object members
+ * @last_used: place holder for allocation to continue from where it left off
+ * @all_slots: complete domain of slots usable by the channel
+ * @slots_allocated: records the actual size of the descriptor slot pool
+ * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs
+ */
+struct iop_adma_chan {
+       int pending;
+       dma_cookie_t completed_cookie;
+       spinlock_t lock; /* protects the descriptor slot pool */
+       void __iomem *mmr_base;
+       struct list_head chain;
+       struct iop_adma_device *device;
+       struct dma_chan common;
+       struct iop_adma_desc_slot *last_used;
+       struct list_head all_slots;
+       int slots_allocated;
+       struct tasklet_struct irq_tasklet;
+};
+
+/**
+ * struct iop_adma_desc_slot - IOP-ADMA software descriptor
+ * @slot_node: node on the iop_adma_chan.all_slots list
+ * @chain_node: node on the op_adma_chan.chain list
+ * @hw_desc: virtual address of the hardware descriptor chain
+ * @phys: hardware address of the hardware descriptor chain
+ * @group_head: first operation in a transaction
+ * @slot_cnt: total slots used in an transaction (group of operations)
+ * @slots_per_op: number of slots per operation
+ * @idx: pool index
+ * @unmap_src_cnt: number of xor sources
+ * @unmap_len: transaction bytecount
+ * @async_tx: support for the async_tx api
+ * @group_list: list of slots that make up a multi-descriptor transaction
+ *     for example transfer lengths larger than the supported hw max
+ * @xor_check_result: result of zero sum
+ * @crc32_result: result crc calculation
+ */
+struct iop_adma_desc_slot {
+       struct list_head slot_node;
+       struct list_head chain_node;
+       void *hw_desc;
+       struct iop_adma_desc_slot *group_head;
+       u16 slot_cnt;
+       u16 slots_per_op;
+       u16 idx;
+       u16 unmap_src_cnt;
+       size_t unmap_len;
+       struct dma_async_tx_descriptor async_tx;
+       union {
+               u32 *xor_check_result;
+               u32 *crc32_result;
+       };
+};
+
+struct iop_adma_platform_data {
+       int hw_id;
+       dma_cap_mask_t cap_mask;
+       size_t pool_size;
+};
+
+#define to_iop_sw_desc(addr_hw_desc) \
+       container_of(addr_hw_desc, struct iop_adma_desc_slot, hw_desc)
+#define iop_hw_desc_slot_idx(hw_desc, idx) \
+       ( (void *) (((unsigned long) hw_desc) + ((idx) << 5)) )
+#endif
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h
new file mode 100644 (file)
index 0000000..74b5fff
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * linux/include/arm/hardware/it8152.h
+ *
+ * Copyright Compulab Ltd., 2006,2007
+ * Mike Rapoport <mike@compulab.co.il>
+ *
+ * ITE 8152 companion chip register definitions
+ */
+
+#ifndef __ASM_HARDWARE_IT8152_H
+#define __ASM_HARDWARE_IT8152_H
+extern unsigned long it8152_base_address;
+
+#define IT8152_IO_BASE                 (it8152_base_address + 0x03e00000)
+#define IT8152_CFGREG_BASE             (it8152_base_address + 0x03f00000)
+
+#define __REG_IT8152(x)                        (it8152_base_address + (x))
+
+#define IT8152_PCI_CFG_ADDR            __REG_IT8152(0x3f00800)
+#define IT8152_PCI_CFG_DATA            __REG_IT8152(0x3f00804)
+
+#define IT8152_INTC_LDCNIRR            __REG_IT8152(0x3f00300)
+#define IT8152_INTC_LDPNIRR            __REG_IT8152(0x3f00304)
+#define IT8152_INTC_LDCNIMR            __REG_IT8152(0x3f00308)
+#define IT8152_INTC_LDPNIMR            __REG_IT8152(0x3f0030C)
+#define IT8152_INTC_LDNITR             __REG_IT8152(0x3f00310)
+#define IT8152_INTC_LDNIAR             __REG_IT8152(0x3f00314)
+#define IT8152_INTC_LPCNIRR            __REG_IT8152(0x3f00320)
+#define IT8152_INTC_LPPNIRR            __REG_IT8152(0x3f00324)
+#define IT8152_INTC_LPCNIMR            __REG_IT8152(0x3f00328)
+#define IT8152_INTC_LPPNIMR            __REG_IT8152(0x3f0032C)
+#define IT8152_INTC_LPNITR             __REG_IT8152(0x3f00330)
+#define IT8152_INTC_LPNIAR             __REG_IT8152(0x3f00334)
+#define IT8152_INTC_PDCNIRR            __REG_IT8152(0x3f00340)
+#define IT8152_INTC_PDPNIRR            __REG_IT8152(0x3f00344)
+#define IT8152_INTC_PDCNIMR            __REG_IT8152(0x3f00348)
+#define IT8152_INTC_PDPNIMR            __REG_IT8152(0x3f0034C)
+#define IT8152_INTC_PDNITR             __REG_IT8152(0x3f00350)
+#define IT8152_INTC_PDNIAR             __REG_IT8152(0x3f00354)
+#define IT8152_INTC_INTC_TYPER         __REG_IT8152(0x3f003FC)
+
+#define IT8152_GPIO_GPDR               __REG_IT8152(0x3f00500)
+
+/*
+  Interrupt controller per register summary:
+  ---------------------------------------
+  LCDNIRR:
+  IT8152_LD_IRQ(8) PCICLK stop
+  IT8152_LD_IRQ(7) MCLK ready
+  IT8152_LD_IRQ(6) s/w
+  IT8152_LD_IRQ(5) UART
+  IT8152_LD_IRQ(4) GPIO
+  IT8152_LD_IRQ(3) TIMER 4
+  IT8152_LD_IRQ(2) TIMER 3
+  IT8152_LD_IRQ(1) TIMER 2
+  IT8152_LD_IRQ(0) TIMER 1
+
+  LPCNIRR:
+  IT8152_LP_IRQ(x) serial IRQ x
+
+  PCIDNIRR:
+  IT8152_PD_IRQ(14) PCISERR
+  IT8152_PD_IRQ(13) CPU/PCI bridge target abort (h2pTADR)
+  IT8152_PD_IRQ(12) CPU/PCI bridge master abort (h2pMADR)
+  IT8152_PD_IRQ(11) PCI INTD
+  IT8152_PD_IRQ(10) PCI INTC
+  IT8152_PD_IRQ(9)  PCI INTB
+  IT8152_PD_IRQ(8)  PCI INTA
+  IT8152_PD_IRQ(7)  serial INTD
+  IT8152_PD_IRQ(6)  serial INTC
+  IT8152_PD_IRQ(5)  serial INTB
+  IT8152_PD_IRQ(4)  serial INTA
+  IT8152_PD_IRQ(3)  serial IRQ IOCHK (IOCHKR)
+  IT8152_PD_IRQ(2)  chaining DMA (CDMAR)
+  IT8152_PD_IRQ(1)  USB (USBR)
+  IT8152_PD_IRQ(0)  Audio controller (ACR)
+ */
+/* frequently used interrupts */
+#define IT8152_PCISERR         IT8152_PD_IRQ(14)
+#define IT8152_H2PTADR         IT8152_PD_IRQ(13)
+#define IT8152_H2PMAR          IT8152_PD_IRQ(12)
+#define IT8152_PCI_INTD                IT8152_PD_IRQ(11)
+#define IT8152_PCI_INTC                IT8152_PD_IRQ(10)
+#define IT8152_PCI_INTB                IT8152_PD_IRQ(9)
+#define IT8152_PCI_INTA                IT8152_PD_IRQ(8)
+#define IT8152_CDMA_INT                IT8152_PD_IRQ(2)
+#define IT8152_USB_INT         IT8152_PD_IRQ(1)
+#define IT8152_AUDIO_INT       IT8152_PD_IRQ(0)
+
+struct pci_dev;
+struct pci_sys_data;
+
+extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc);
+extern void it8152_init_irq(void);
+extern int it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
+extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *it8152_pci_scan_bus(int nr, struct pci_sys_data *sys);
+
+#endif /* __ASM_HARDWARE_IT8152_H */
diff --git a/arch/arm/include/asm/hardware/linkup-l1110.h b/arch/arm/include/asm/hardware/linkup-l1110.h
new file mode 100644 (file)
index 0000000..7ec9116
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+*
+* Definitions for H3600 Handheld Computer
+*
+* Copyright 2001 Compaq Computer Corporation.
+*
+* Use consistent with the GNU GPL is permitted,
+* provided that this copyright notice is
+* preserved in its entirety in all copies and derived works.
+*
+* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
+* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
+* FITNESS FOR ANY PARTICULAR PURPOSE.
+*
+* Author: Jamey Hicks.
+*
+*/
+
+/* LinkUp Systems PCCard/CompactFlash Interface for SA-1100 */
+
+/* PC Card Status Register */
+#define LINKUP_PRS_S1  (1 << 0) /* voltage control bits S1-S4 */
+#define LINKUP_PRS_S2  (1 << 1)
+#define LINKUP_PRS_S3  (1 << 2)
+#define LINKUP_PRS_S4  (1 << 3)
+#define LINKUP_PRS_BVD1        (1 << 4)
+#define LINKUP_PRS_BVD2        (1 << 5)
+#define LINKUP_PRS_VS1 (1 << 6)
+#define LINKUP_PRS_VS2 (1 << 7)
+#define LINKUP_PRS_RDY (1 << 8)
+#define LINKUP_PRS_CD1 (1 << 9)
+#define LINKUP_PRS_CD2 (1 << 10)
+
+/* PC Card Command Register */
+#define LINKUP_PRC_S1  (1 << 0)
+#define LINKUP_PRC_S2  (1 << 1)
+#define LINKUP_PRC_S3  (1 << 2)
+#define LINKUP_PRC_S4  (1 << 3)
+#define LINKUP_PRC_RESET (1 << 4)
+#define LINKUP_PRC_APOE        (1 << 5) /* Auto Power Off Enable: clears S1-S4 when either nCD goes high */
+#define LINKUP_PRC_CFE (1 << 6) /* CompactFlash mode Enable: addresses A[10:0] only, A[25:11] high */
+#define LINKUP_PRC_SOE (1 << 7) /* signal output driver enable */
+#define LINKUP_PRC_SSP (1 << 8) /* sock select polarity: 0 for socket 0, 1 for socket 1 */
+#define LINKUP_PRC_MBZ (1 << 15) /* must be zero */
+
+struct linkup_l1110 {
+       volatile short prc;
+};
diff --git a/arch/arm/include/asm/hardware/locomo.h b/arch/arm/include/asm/hardware/locomo.h
new file mode 100644 (file)
index 0000000..954b1be
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * arch/arm/include/asm/hardware/locomo.h
+ *
+ * This file contains the definitions for the LoCoMo G/A Chip
+ *
+ * (C) Copyright 2004 John Lenz
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Based on sa1111.h
+ */
+#ifndef _ASM_ARCH_LOCOMO
+#define _ASM_ARCH_LOCOMO
+
+#define locomo_writel(val,addr)        ({ *(volatile u16 *)(addr) = (val); })
+#define locomo_readl(addr)     (*(volatile u16 *)(addr))
+
+/* LOCOMO version */
+#define LOCOMO_VER     0x00
+
+/* Pin status */
+#define LOCOMO_ST      0x04
+
+/* Pin status */
+#define LOCOMO_C32K    0x08
+
+/* Interrupt controller */
+#define LOCOMO_ICR     0x0C
+
+/* MCS decoder for boot selecting */
+#define LOCOMO_MCSX0   0x10
+#define LOCOMO_MCSX1   0x14
+#define LOCOMO_MCSX2   0x18
+#define LOCOMO_MCSX3   0x1c
+
+/* Touch panel controller */
+#define LOCOMO_ASD     0x20            /* AD start delay */
+#define LOCOMO_HSD     0x28            /* HSYS delay */
+#define LOCOMO_HSC     0x2c            /* HSYS period */
+#define LOCOMO_TADC    0x30            /* tablet ADC clock */
+
+
+/* Long time timer */
+#define LOCOMO_LTC     0xd8            /* LTC interrupt setting */
+#define LOCOMO_LTINT   0xdc            /* LTC interrupt */
+
+/* DAC control signal for LCD (COMADJ ) */
+#define LOCOMO_DAC             0xe0
+/* DAC control */
+#define        LOCOMO_DAC_SCLOEB       0x08    /* SCL pin output data       */
+#define        LOCOMO_DAC_TEST         0x04    /* Test bit                  */
+#define        LOCOMO_DAC_SDA          0x02    /* SDA pin level (read-only) */
+#define        LOCOMO_DAC_SDAOEB       0x01    /* SDA pin output data       */
+
+/* SPI interface */
+#define LOCOMO_SPI     0x60
+#define LOCOMO_SPIMD   0x00            /* SPI mode setting */
+#define LOCOMO_SPICT   0x04            /* SPI mode control */
+#define LOCOMO_SPIST   0x08            /* SPI status */
+#define        LOCOMO_SPI_TEND (1 << 3)        /* Transfer end bit */
+#define        LOCOMO_SPI_REND (1 << 2)        /* Receive end bit */
+#define        LOCOMO_SPI_RFW  (1 << 1)        /* write buffer bit */
+#define        LOCOMO_SPI_RFR  (1)             /* read buffer bit */
+
+#define LOCOMO_SPIIS   0x10            /* SPI interrupt status */
+#define LOCOMO_SPIWE   0x14            /* SPI interrupt status write enable */
+#define LOCOMO_SPIIE   0x18            /* SPI interrupt enable */
+#define LOCOMO_SPIIR   0x1c            /* SPI interrupt request */
+#define LOCOMO_SPITD   0x20            /* SPI transfer data write */
+#define LOCOMO_SPIRD   0x24            /* SPI receive data read */
+#define LOCOMO_SPITS   0x28            /* SPI transfer data shift */
+#define LOCOMO_SPIRS   0x2C            /* SPI receive data shift */
+
+/* GPIO */
+#define LOCOMO_GPD             0x90    /* GPIO direction */
+#define LOCOMO_GPE             0x94    /* GPIO input enable */
+#define LOCOMO_GPL             0x98    /* GPIO level */
+#define LOCOMO_GPO             0x9c    /* GPIO out data setting */
+#define LOCOMO_GRIE            0xa0    /* GPIO rise detection */
+#define LOCOMO_GFIE            0xa4    /* GPIO fall detection */
+#define LOCOMO_GIS             0xa8    /* GPIO edge detection status */
+#define LOCOMO_GWE             0xac    /* GPIO status write enable */
+#define LOCOMO_GIE             0xb0    /* GPIO interrupt enable */
+#define LOCOMO_GIR             0xb4    /* GPIO interrupt request */
+#define        LOCOMO_GPIO(Nb)         (0x01 << (Nb))
+#define LOCOMO_GPIO_RTS                LOCOMO_GPIO(0)
+#define LOCOMO_GPIO_CTS                LOCOMO_GPIO(1)
+#define LOCOMO_GPIO_DSR                LOCOMO_GPIO(2)
+#define LOCOMO_GPIO_DTR                LOCOMO_GPIO(3)
+#define LOCOMO_GPIO_LCD_VSHA_ON        LOCOMO_GPIO(4)
+#define LOCOMO_GPIO_LCD_VSHD_ON        LOCOMO_GPIO(5)
+#define LOCOMO_GPIO_LCD_VEE_ON LOCOMO_GPIO(6)
+#define LOCOMO_GPIO_LCD_MOD    LOCOMO_GPIO(7)
+#define LOCOMO_GPIO_DAC_ON     LOCOMO_GPIO(8)
+#define LOCOMO_GPIO_FL_VR      LOCOMO_GPIO(9)
+#define LOCOMO_GPIO_DAC_SDATA  LOCOMO_GPIO(10)
+#define LOCOMO_GPIO_DAC_SCK    LOCOMO_GPIO(11)
+#define LOCOMO_GPIO_DAC_SLOAD  LOCOMO_GPIO(12)
+#define LOCOMO_GPIO_CARD_DETECT LOCOMO_GPIO(13)
+#define LOCOMO_GPIO_WRITE_PROT  LOCOMO_GPIO(14)
+#define LOCOMO_GPIO_CARD_POWER  LOCOMO_GPIO(15)
+
+/* Start the definitions of the devices.  Each device has an initial
+ * base address and a series of offsets from that base address. */
+
+/* Keyboard controller */
+#define LOCOMO_KEYBOARD                0x40
+#define LOCOMO_KIB             0x00    /* KIB level */
+#define LOCOMO_KSC             0x04    /* KSTRB control */
+#define LOCOMO_KCMD            0x08    /* KSTRB command */
+#define LOCOMO_KIC             0x0c    /* Key interrupt */
+
+/* Front light adjustment controller */
+#define LOCOMO_FRONTLIGHT      0xc8
+#define LOCOMO_ALS             0x00    /* Adjust light cycle */
+#define LOCOMO_ALD             0x04    /* Adjust light duty */
+
+#define LOCOMO_ALC_EN          0x8000
+
+/* Backlight controller: TFT signal */
+#define LOCOMO_BACKLIGHT       0x38
+#define LOCOMO_TC              0x00            /* TFT control signal */
+#define LOCOMO_CPSD            0x04            /* CPS delay */
+
+/* Audio controller */
+#define LOCOMO_AUDIO           0x54
+#define LOCOMO_ACC             0x00    /* Audio clock */
+#define LOCOMO_PAIF            0xD0    /* PCM audio interface */
+/* Audio clock */
+#define        LOCOMO_ACC_XON          0x80
+#define        LOCOMO_ACC_XEN          0x40
+#define        LOCOMO_ACC_XSEL0        0x00
+#define        LOCOMO_ACC_XSEL1        0x20
+#define        LOCOMO_ACC_MCLKEN       0x10
+#define        LOCOMO_ACC_64FSEN       0x08
+#define        LOCOMO_ACC_CLKSEL000    0x00    /* mclk  2 */
+#define        LOCOMO_ACC_CLKSEL001    0x01    /* mclk  3 */
+#define        LOCOMO_ACC_CLKSEL010    0x02    /* mclk  4 */
+#define        LOCOMO_ACC_CLKSEL011    0x03    /* mclk  6 */
+#define        LOCOMO_ACC_CLKSEL100    0x04    /* mclk  8 */
+#define        LOCOMO_ACC_CLKSEL101    0x05    /* mclk 12 */
+/* PCM audio interface */
+#define        LOCOMO_PAIF_SCINV       0x20
+#define        LOCOMO_PAIF_SCEN        0x10
+#define        LOCOMO_PAIF_LRCRST      0x08
+#define        LOCOMO_PAIF_LRCEVE      0x04
+#define        LOCOMO_PAIF_LRCINV      0x02
+#define        LOCOMO_PAIF_LRCEN       0x01
+
+/* LED controller */
+#define LOCOMO_LED             0xe8
+#define LOCOMO_LPT0            0x00
+#define LOCOMO_LPT1            0x04
+/* LED control */
+#define LOCOMO_LPT_TOFH                0x80
+#define LOCOMO_LPT_TOFL                0x08
+#define LOCOMO_LPT_TOH(TOH)    ((TOH & 0x7) << 4)
+#define LOCOMO_LPT_TOL(TOL)    ((TOL & 0x7))
+
+extern struct bus_type locomo_bus_type;
+
+#define LOCOMO_DEVID_KEYBOARD  0
+#define LOCOMO_DEVID_FRONTLIGHT        1
+#define LOCOMO_DEVID_BACKLIGHT 2
+#define LOCOMO_DEVID_AUDIO     3
+#define LOCOMO_DEVID_LED       4
+#define LOCOMO_DEVID_UART      5
+#define LOCOMO_DEVID_SPI       6
+
+struct locomo_dev {
+       struct device   dev;
+       unsigned int    devid;
+       unsigned int    irq[1];
+
+       void            *mapbase;
+       unsigned long   length;
+
+       u64             dma_mask;
+};
+
+#define LOCOMO_DEV(_d) container_of((_d), struct locomo_dev, dev)
+
+#define locomo_get_drvdata(d)  dev_get_drvdata(&(d)->dev)
+#define locomo_set_drvdata(d,p)        dev_set_drvdata(&(d)->dev, p)
+
+struct locomo_driver {
+       struct device_driver    drv;
+       unsigned int            devid;
+       int (*probe)(struct locomo_dev *);
+       int (*remove)(struct locomo_dev *);
+       int (*suspend)(struct locomo_dev *, pm_message_t);
+       int (*resume)(struct locomo_dev *);
+};
+
+#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
+
+#define LOCOMO_DRIVER_NAME(_ldev) ((_ldev)->dev.driver->name)
+
+void locomo_lcd_power(struct locomo_dev *, int, unsigned int);
+
+int locomo_driver_register(struct locomo_driver *);
+void locomo_driver_unregister(struct locomo_driver *);
+
+/* GPIO control functions */
+void locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir);
+int locomo_gpio_read_level(struct device *dev, unsigned int bits);
+int locomo_gpio_read_output(struct device *dev, unsigned int bits);
+void locomo_gpio_write(struct device *dev, unsigned int bits, unsigned int set);
+
+/* M62332 control function */
+void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
+
+/* Frontlight control */
+void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
+
+#endif
diff --git a/arch/arm/include/asm/hardware/memc.h b/arch/arm/include/asm/hardware/memc.h
new file mode 100644 (file)
index 0000000..42ba7c1
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ *  arch/arm/include/asm/hardware/memc.h
+ *
+ *  Copyright (C) Russell King.
+ *
+ * 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.
+ */
+#define VDMA_ALIGNMENT PAGE_SIZE
+#define VDMA_XFERSIZE  16
+#define VDMA_INIT      0
+#define VDMA_START     1
+#define VDMA_END       2
+
+#ifndef __ASSEMBLY__
+extern void memc_write(unsigned int reg, unsigned long val);
+
+#define video_set_dma(start,end,offset)                                \
+do {                                                           \
+       memc_write (VDMA_START, (start >> 2));                  \
+       memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2);      \
+       memc_write (VDMA_INIT, (offset >> 2));                  \
+} while (0)
+
+#endif
diff --git a/arch/arm/include/asm/hardware/pci_v3.h b/arch/arm/include/asm/hardware/pci_v3.h
new file mode 100644 (file)
index 0000000..2811c7e
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ *  arch/arm/include/asm/hardware/pci_v3.h
+ *
+ *  Internal header file PCI V3 chip
+ *
+ *  Copyright (C) ARM Limited
+ *  Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef ASM_ARM_HARDWARE_PCI_V3_H
+#define ASM_ARM_HARDWARE_PCI_V3_H
+
+/* -------------------------------------------------------------------------------
+ *  V3 Local Bus to PCI Bridge definitions
+ * -------------------------------------------------------------------------------
+ *  Registers (these are taken from page 129 of the EPC User's Manual Rev 1.04
+ *  All V3 register names are prefaced by V3_ to avoid clashing with any other
+ *  PCI definitions.  Their names match the user's manual.
+ * 
+ *  I'm assuming that I20 is disabled.
+ * 
+ */
+#define V3_PCI_VENDOR                   0x00000000
+#define V3_PCI_DEVICE                   0x00000002
+#define V3_PCI_CMD                      0x00000004
+#define V3_PCI_STAT                     0x00000006
+#define V3_PCI_CC_REV                   0x00000008
+#define V3_PCI_HDR_CFG                  0x0000000C
+#define V3_PCI_IO_BASE                  0x00000010
+#define V3_PCI_BASE0                    0x00000014
+#define V3_PCI_BASE1                    0x00000018
+#define V3_PCI_SUB_VENDOR               0x0000002C
+#define V3_PCI_SUB_ID                   0x0000002E
+#define V3_PCI_ROM                      0x00000030
+#define V3_PCI_BPARAM                   0x0000003C
+#define V3_PCI_MAP0                     0x00000040
+#define V3_PCI_MAP1                     0x00000044
+#define V3_PCI_INT_STAT                 0x00000048
+#define V3_PCI_INT_CFG                  0x0000004C 
+#define V3_LB_BASE0                     0x00000054
+#define V3_LB_BASE1                     0x00000058
+#define V3_LB_MAP0                      0x0000005E
+#define V3_LB_MAP1                      0x00000062
+#define V3_LB_BASE2                     0x00000064
+#define V3_LB_MAP2                      0x00000066
+#define V3_LB_SIZE                      0x00000068
+#define V3_LB_IO_BASE                   0x0000006E
+#define V3_FIFO_CFG                     0x00000070
+#define V3_FIFO_PRIORITY                0x00000072
+#define V3_FIFO_STAT                    0x00000074
+#define V3_LB_ISTAT                     0x00000076
+#define V3_LB_IMASK                     0x00000077
+#define V3_SYSTEM                       0x00000078
+#define V3_LB_CFG                       0x0000007A
+#define V3_PCI_CFG                      0x0000007C
+#define V3_DMA_PCI_ADR0                 0x00000080
+#define V3_DMA_PCI_ADR1                 0x00000090
+#define V3_DMA_LOCAL_ADR0               0x00000084
+#define V3_DMA_LOCAL_ADR1               0x00000094
+#define V3_DMA_LENGTH0                  0x00000088
+#define V3_DMA_LENGTH1                  0x00000098
+#define V3_DMA_CSR0                     0x0000008B
+#define V3_DMA_CSR1                     0x0000009B
+#define V3_DMA_CTLB_ADR0                0x0000008C
+#define V3_DMA_CTLB_ADR1                0x0000009C
+#define V3_DMA_DELAY                    0x000000E0
+#define V3_MAIL_DATA                    0x000000C0
+#define V3_PCI_MAIL_IEWR                0x000000D0
+#define V3_PCI_MAIL_IERD                0x000000D2
+#define V3_LB_MAIL_IEWR                 0x000000D4
+#define V3_LB_MAIL_IERD                 0x000000D6
+#define V3_MAIL_WR_STAT                 0x000000D8
+#define V3_MAIL_RD_STAT                 0x000000DA
+#define V3_QBA_MAP                      0x000000DC
+
+/*  PCI COMMAND REGISTER bits
+ */
+#define V3_COMMAND_M_FBB_EN             (1 << 9)
+#define V3_COMMAND_M_SERR_EN            (1 << 8)
+#define V3_COMMAND_M_PAR_EN             (1 << 6)
+#define V3_COMMAND_M_MASTER_EN          (1 << 2)
+#define V3_COMMAND_M_MEM_EN             (1 << 1)
+#define V3_COMMAND_M_IO_EN              (1 << 0)
+
+/*  SYSTEM REGISTER bits
+ */
+#define V3_SYSTEM_M_RST_OUT             (1 << 15)
+#define V3_SYSTEM_M_LOCK                (1 << 14)
+
+/*  PCI_CFG bits
+ */
+#define V3_PCI_CFG_M_I2O_EN            (1 << 15)
+#define V3_PCI_CFG_M_IO_REG_DIS                (1 << 14)
+#define V3_PCI_CFG_M_IO_DIS            (1 << 13)
+#define V3_PCI_CFG_M_EN3V              (1 << 12)
+#define V3_PCI_CFG_M_RETRY_EN           (1 << 10)
+#define V3_PCI_CFG_M_AD_LOW1            (1 << 9)
+#define V3_PCI_CFG_M_AD_LOW0            (1 << 8)
+
+/*  PCI_BASE register bits (PCI -> Local Bus)
+ */
+#define V3_PCI_BASE_M_ADR_BASE          0xFFF00000
+#define V3_PCI_BASE_M_ADR_BASEL         0x000FFF00
+#define V3_PCI_BASE_M_PREFETCH          (1 << 3)
+#define V3_PCI_BASE_M_TYPE              (3 << 1)
+#define V3_PCI_BASE_M_IO                (1 << 0)
+
+/*  PCI MAP register bits (PCI -> Local bus)
+ */
+#define V3_PCI_MAP_M_MAP_ADR            0xFFF00000
+#define V3_PCI_MAP_M_RD_POST_INH        (1 << 15)
+#define V3_PCI_MAP_M_ROM_SIZE           (3 << 10)
+#define V3_PCI_MAP_M_SWAP               (3 << 8)
+#define V3_PCI_MAP_M_ADR_SIZE           0x000000F0
+#define V3_PCI_MAP_M_REG_EN             (1 << 1)
+#define V3_PCI_MAP_M_ENABLE             (1 << 0)
+
+/*
+ *  LB_BASE0,1 register bits (Local bus -> PCI)
+ */
+#define V3_LB_BASE_ADR_BASE            0xfff00000
+#define V3_LB_BASE_SWAP                        (3 << 8)
+#define V3_LB_BASE_ADR_SIZE            (15 << 4)
+#define V3_LB_BASE_PREFETCH            (1 << 3)
+#define V3_LB_BASE_ENABLE              (1 << 0)
+
+#define V3_LB_BASE_ADR_SIZE_1MB                (0 << 4)
+#define V3_LB_BASE_ADR_SIZE_2MB                (1 << 4)
+#define V3_LB_BASE_ADR_SIZE_4MB                (2 << 4)
+#define V3_LB_BASE_ADR_SIZE_8MB                (3 << 4)
+#define V3_LB_BASE_ADR_SIZE_16MB       (4 << 4)
+#define V3_LB_BASE_ADR_SIZE_32MB       (5 << 4)
+#define V3_LB_BASE_ADR_SIZE_64MB       (6 << 4)
+#define V3_LB_BASE_ADR_SIZE_128MB      (7 << 4)
+#define V3_LB_BASE_ADR_SIZE_256MB      (8 << 4)
+#define V3_LB_BASE_ADR_SIZE_512MB      (9 << 4)
+#define V3_LB_BASE_ADR_SIZE_1GB                (10 << 4)
+#define V3_LB_BASE_ADR_SIZE_2GB                (11 << 4)
+
+#define v3_addr_to_lb_base(a)  ((a) & V3_LB_BASE_ADR_BASE)
+
+/*
+ *  LB_MAP0,1 register bits (Local bus -> PCI)
+ */
+#define V3_LB_MAP_MAP_ADR              0xfff0
+#define V3_LB_MAP_TYPE                 (7 << 1)
+#define V3_LB_MAP_AD_LOW_EN            (1 << 0)
+
+#define V3_LB_MAP_TYPE_IACK            (0 << 1)
+#define V3_LB_MAP_TYPE_IO              (1 << 1)
+#define V3_LB_MAP_TYPE_MEM             (3 << 1)
+#define V3_LB_MAP_TYPE_CONFIG          (5 << 1)
+#define V3_LB_MAP_TYPE_MEM_MULTIPLE    (6 << 1)
+
+#define v3_addr_to_lb_map(a)   (((a) >> 16) & V3_LB_MAP_MAP_ADR)
+
+/*
+ *  LB_BASE2 register bits (Local bus -> PCI IO)
+ */
+#define V3_LB_BASE2_ADR_BASE           0xff00
+#define V3_LB_BASE2_SWAP               (3 << 6)
+#define V3_LB_BASE2_ENABLE             (1 << 0)
+
+#define v3_addr_to_lb_base2(a) (((a) >> 16) & V3_LB_BASE2_ADR_BASE)
+
+/*
+ *  LB_MAP2 register bits (Local bus -> PCI IO)
+ */
+#define V3_LB_MAP2_MAP_ADR             0xff00
+
+#define v3_addr_to_lb_map2(a)  (((a) >> 16) & V3_LB_MAP2_MAP_ADR)
+
+#endif
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h
new file mode 100644 (file)
index 0000000..6cf98d4
--- /dev/null
@@ -0,0 +1,581 @@
+/*
+ * arch/arm/include/asm/hardware/sa1111.h
+ *
+ * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
+ *
+ * This file contains definitions for the SA-1111 Companion Chip.
+ * (Structure and naming borrowed from SA-1101.h, by Peter Danielsson.)
+ *
+ * Macro that calculates real address for registers in the SA-1111
+ */
+
+#ifndef _ASM_ARCH_SA1111
+#define _ASM_ARCH_SA1111
+
+#include <asm/arch/bitfield.h>
+
+/*
+ * The SA1111 is always located at virtual 0xf4000000, and is always
+ * "native" endian.
+ */
+
+#define SA1111_VBASE           0xf4000000
+
+/* Don't use these! */
+#define SA1111_p2v( x )         ((x) - SA1111_BASE + SA1111_VBASE)
+#define SA1111_v2p( x )         ((x) - SA1111_VBASE + SA1111_BASE)
+
+#ifndef __ASSEMBLY__
+#define _SA1111(x)     ((x) + sa1111->resource.start)
+#endif
+
+#define sa1111_writel(val,addr)        __raw_writel(val, addr)
+#define sa1111_readl(addr)     __raw_readl(addr)
+
+/*
+ * 26 bits of the SA-1110 address bus are available to the SA-1111.
+ * Use these when feeding target addresses to the DMA engines.
+ */
+
+#define SA1111_ADDR_WIDTH      (26)
+#define SA1111_ADDR_MASK       ((1<<SA1111_ADDR_WIDTH)-1)
+#define SA1111_DMA_ADDR(x)     ((x)&SA1111_ADDR_MASK)
+
+/*
+ * Don't ask the (SAC) DMA engines to move less than this amount.
+ */
+
+#define SA1111_SAC_DMA_MIN_XFER        (0x800)
+
+/*
+ * System Bus Interface (SBI)
+ *
+ * Registers
+ *    SKCR     Control Register
+ *    SMCR     Shared Memory Controller Register
+ *    SKID     ID Register
+ */
+#define SA1111_SKCR    0x0000
+#define SA1111_SMCR    0x0004
+#define SA1111_SKID    0x0008
+
+#define SKCR_PLL_BYPASS        (1<<0)
+#define SKCR_RCLKEN    (1<<1)
+#define SKCR_SLEEP     (1<<2)
+#define SKCR_DOZE      (1<<3)
+#define SKCR_VCO_OFF   (1<<4)
+#define SKCR_SCANTSTEN (1<<5)
+#define SKCR_CLKTSTEN  (1<<6)
+#define SKCR_RDYEN     (1<<7)
+#define SKCR_SELAC     (1<<8)
+#define SKCR_OPPC      (1<<9)
+#define SKCR_PLLTSTEN  (1<<10)
+#define SKCR_USBIOTSTEN        (1<<11)
+/*
+ * Don't believe the specs!  Take them, throw them outside.  Leave them
+ * there for a week.  Spit on them.  Walk on them.  Stamp on them.
+ * Pour gasoline over them and finally burn them.  Now think about coding.
+ *  - The October 1999 errata (278260-007) says its bit 13, 1 to enable.
+ *  - The Feb 2001 errata (278260-010) says that the previous errata
+ *    (278260-009) is wrong, and its bit actually 12, fixed in spec
+ *    278242-003.
+ *  - The SA1111 manual (278242) says bit 12, but 0 to enable.
+ *  - Reality is bit 13, 1 to enable.
+ *      -- rmk
+ */
+#define SKCR_OE_EN     (1<<13)
+
+#define SMCR_DTIM      (1<<0)
+#define SMCR_MBGE      (1<<1)
+#define SMCR_DRAC_0    (1<<2)
+#define SMCR_DRAC_1    (1<<3)
+#define SMCR_DRAC_2    (1<<4)
+#define SMCR_DRAC      Fld(3, 2)
+#define SMCR_CLAT      (1<<5)
+
+#define SKID_SIREV_MASK        (0x000000f0)
+#define SKID_MTREV_MASK (0x0000000f)
+#define SKID_ID_MASK   (0xffffff00)
+#define SKID_SA1111_ID (0x690cc200)
+
+/*
+ * System Controller
+ *
+ * Registers
+ *    SKPCR    Power Control Register
+ *    SKCDR    Clock Divider Register
+ *    SKAUD    Audio Clock Divider Register
+ *    SKPMC    PS/2 Mouse Clock Divider Register
+ *    SKPTC    PS/2 Track Pad Clock Divider Register
+ *    SKPEN0   PWM0 Enable Register
+ *    SKPWM0   PWM0 Clock Register
+ *    SKPEN1   PWM1 Enable Register
+ *    SKPWM1   PWM1 Clock Register
+ */
+#define SA1111_SKPCR   0x0200
+#define SA1111_SKCDR   0x0204
+#define SA1111_SKAUD   0x0208
+#define SA1111_SKPMC   0x020c
+#define SA1111_SKPTC   0x0210
+#define SA1111_SKPEN0  0x0214
+#define SA1111_SKPWM0  0x0218
+#define SA1111_SKPEN1  0x021c
+#define SA1111_SKPWM1  0x0220
+
+#define SKPCR_UCLKEN   (1<<0)
+#define SKPCR_ACCLKEN  (1<<1)
+#define SKPCR_I2SCLKEN (1<<2)
+#define SKPCR_L3CLKEN  (1<<3)
+#define SKPCR_SCLKEN   (1<<4)
+#define SKPCR_PMCLKEN  (1<<5)
+#define SKPCR_PTCLKEN  (1<<6)
+#define SKPCR_DCLKEN   (1<<7)
+#define SKPCR_PWMCLKEN (1<<8)
+
+/*
+ * USB Host controller
+ */
+#define SA1111_USB             0x0400
+
+/*
+ * Offsets from SA1111_USB_BASE
+ */
+#define SA1111_USB_STATUS      0x0118
+#define SA1111_USB_RESET       0x011c
+#define SA1111_USB_IRQTEST     0x0120
+
+#define USB_RESET_FORCEIFRESET (1 << 0)
+#define USB_RESET_FORCEHCRESET (1 << 1)
+#define USB_RESET_CLKGENRESET  (1 << 2)
+#define USB_RESET_SIMSCALEDOWN (1 << 3)
+#define USB_RESET_USBINTTEST   (1 << 4)
+#define USB_RESET_SLEEPSTBYEN  (1 << 5)
+#define USB_RESET_PWRSENSELOW  (1 << 6)
+#define USB_RESET_PWRCTRLLOW   (1 << 7)
+
+#define USB_STATUS_IRQHCIRMTWKUP  (1 <<  7)
+#define USB_STATUS_IRQHCIBUFFACC  (1 <<  8)
+#define USB_STATUS_NIRQHCIM       (1 <<  9)
+#define USB_STATUS_NHCIMFCLR      (1 << 10)
+#define USB_STATUS_USBPWRSENSE    (1 << 11)
+
+/*
+ * Serial Audio Controller
+ *
+ * Registers
+ *    SACR0             Serial Audio Common Control Register
+ *    SACR1             Serial Audio Alternate Mode (I2C/MSB) Control Register
+ *    SACR2             Serial Audio AC-link Control Register
+ *    SASR0             Serial Audio I2S/MSB Interface & FIFO Status Register
+ *    SASR1             Serial Audio AC-link Interface & FIFO Status Register
+ *    SASCR             Serial Audio Status Clear Register
+ *    L3_CAR            L3 Control Bus Address Register
+ *    L3_CDR            L3 Control Bus Data Register
+ *    ACCAR             AC-link Command Address Register
+ *    ACCDR             AC-link Command Data Register
+ *    ACSAR             AC-link Status Address Register
+ *    ACSDR             AC-link Status Data Register
+ *    SADTCS            Serial Audio DMA Transmit Control/Status Register
+ *    SADTSA            Serial Audio DMA Transmit Buffer Start Address A
+ *    SADTCA            Serial Audio DMA Transmit Buffer Count Register A
+ *    SADTSB            Serial Audio DMA Transmit Buffer Start Address B
+ *    SADTCB            Serial Audio DMA Transmit Buffer Count Register B
+ *    SADRCS            Serial Audio DMA Receive Control/Status Register
+ *    SADRSA            Serial Audio DMA Receive Buffer Start Address A
+ *    SADRCA            Serial Audio DMA Receive Buffer Count Register A
+ *    SADRSB            Serial Audio DMA Receive Buffer Start Address B
+ *    SADRCB            Serial Audio DMA Receive Buffer Count Register B
+ *    SAITR             Serial Audio Interrupt Test Register
+ *    SADR              Serial Audio Data Register (16 x 32-bit)
+ */
+
+#define SA1111_SERAUDIO                0x0600
+
+/*
+ * These are offsets from the above base.
+ */
+#define SA1111_SACR0           0x00
+#define SA1111_SACR1           0x04
+#define SA1111_SACR2           0x08
+#define SA1111_SASR0           0x0c
+#define SA1111_SASR1           0x10
+#define SA1111_SASCR           0x18
+#define SA1111_L3_CAR          0x1c
+#define SA1111_L3_CDR          0x20
+#define SA1111_ACCAR           0x24
+#define SA1111_ACCDR           0x28
+#define SA1111_ACSAR           0x2c
+#define SA1111_ACSDR           0x30
+#define SA1111_SADTCS          0x34
+#define SA1111_SADTSA          0x38
+#define SA1111_SADTCA          0x3c
+#define SA1111_SADTSB          0x40
+#define SA1111_SADTCB          0x44
+#define SA1111_SADRCS          0x48
+#define SA1111_SADRSA          0x4c
+#define SA1111_SADRCA          0x50
+#define SA1111_SADRSB          0x54
+#define SA1111_SADRCB          0x58
+#define SA1111_SAITR           0x5c
+#define SA1111_SADR            0x80
+
+#ifndef CONFIG_ARCH_PXA
+
+#define SACR0_ENB      (1<<0)
+#define SACR0_BCKD     (1<<2)
+#define SACR0_RST      (1<<3)
+
+#define SACR1_AMSL     (1<<0)
+#define SACR1_L3EN     (1<<1)
+#define SACR1_L3MB     (1<<2)
+#define SACR1_DREC     (1<<3)
+#define SACR1_DRPL     (1<<4)
+#define SACR1_ENLBF    (1<<5)
+
+#define SACR2_TS3V     (1<<0)
+#define SACR2_TS4V     (1<<1)
+#define SACR2_WKUP     (1<<2)
+#define SACR2_DREC     (1<<3)
+#define SACR2_DRPL     (1<<4)
+#define SACR2_ENLBF    (1<<5)
+#define SACR2_RESET    (1<<6)
+
+#define SASR0_TNF      (1<<0)
+#define SASR0_RNE      (1<<1)
+#define SASR0_BSY      (1<<2)
+#define SASR0_TFS      (1<<3)
+#define SASR0_RFS      (1<<4)
+#define SASR0_TUR      (1<<5)
+#define SASR0_ROR      (1<<6)
+#define SASR0_L3WD     (1<<16)
+#define SASR0_L3RD     (1<<17)
+
+#define SASR1_TNF      (1<<0)
+#define SASR1_RNE      (1<<1)
+#define SASR1_BSY      (1<<2)
+#define SASR1_TFS      (1<<3)
+#define SASR1_RFS      (1<<4)
+#define SASR1_TUR      (1<<5)
+#define SASR1_ROR      (1<<6)
+#define SASR1_CADT     (1<<16)
+#define SASR1_SADR     (1<<17)
+#define SASR1_RSTO     (1<<18)
+#define SASR1_CLPM     (1<<19)
+#define SASR1_CRDY     (1<<20)
+#define SASR1_RS3V     (1<<21)
+#define SASR1_RS4V     (1<<22)
+
+#define SASCR_TUR      (1<<5)
+#define SASCR_ROR      (1<<6)
+#define SASCR_DTS      (1<<16)
+#define SASCR_RDD      (1<<17)
+#define SASCR_STO      (1<<18)
+
+#define SADTCS_TDEN    (1<<0)
+#define SADTCS_TDIE    (1<<1)
+#define SADTCS_TDBDA   (1<<3)
+#define SADTCS_TDSTA   (1<<4)
+#define SADTCS_TDBDB   (1<<5)
+#define SADTCS_TDSTB   (1<<6)
+#define SADTCS_TBIU    (1<<7)
+
+#define SADRCS_RDEN    (1<<0)
+#define SADRCS_RDIE    (1<<1)
+#define SADRCS_RDBDA   (1<<3)
+#define SADRCS_RDSTA   (1<<4)
+#define SADRCS_RDBDB   (1<<5)
+#define SADRCS_RDSTB   (1<<6)
+#define SADRCS_RBIU    (1<<7)
+
+#define SAD_CS_DEN     (1<<0)
+#define SAD_CS_DIE     (1<<1)  /* Not functional on metal 1 */
+#define SAD_CS_DBDA    (1<<3)  /* Not functional on metal 1 */
+#define SAD_CS_DSTA    (1<<4)
+#define SAD_CS_DBDB    (1<<5)  /* Not functional on metal 1 */
+#define SAD_CS_DSTB    (1<<6)
+#define SAD_CS_BIU     (1<<7)  /* Not functional on metal 1 */
+
+#define SAITR_TFS      (1<<0)
+#define SAITR_RFS      (1<<1)
+#define SAITR_TUR      (1<<2)
+#define SAITR_ROR      (1<<3)
+#define SAITR_CADT     (1<<4)
+#define SAITR_SADR     (1<<5)
+#define SAITR_RSTO     (1<<6)
+#define SAITR_TDBDA    (1<<8)
+#define SAITR_TDBDB    (1<<9)
+#define SAITR_RDBDA    (1<<10)
+#define SAITR_RDBDB    (1<<11)
+
+#endif  /* !CONFIG_ARCH_PXA */
+
+/*
+ * General-Purpose I/O Interface
+ *
+ * Registers
+ *    PA_DDR           GPIO Block A Data Direction
+ *    PA_DRR/PA_DWR    GPIO Block A Data Value Register (read/write)
+ *    PA_SDR           GPIO Block A Sleep Direction
+ *    PA_SSR           GPIO Block A Sleep State
+ *    PB_DDR           GPIO Block B Data Direction
+ *    PB_DRR/PB_DWR    GPIO Block B Data Value Register (read/write)
+ *    PB_SDR           GPIO Block B Sleep Direction
+ *    PB_SSR           GPIO Block B Sleep State
+ *    PC_DDR           GPIO Block C Data Direction
+ *    PC_DRR/PC_DWR    GPIO Block C Data Value Register (read/write)
+ *    PC_SDR           GPIO Block C Sleep Direction
+ *    PC_SSR           GPIO Block C Sleep State
+ */
+
+#define _PA_DDR                _SA1111( 0x1000 )
+#define _PA_DRR                _SA1111( 0x1004 )
+#define _PA_DWR                _SA1111( 0x1004 )
+#define _PA_SDR                _SA1111( 0x1008 )
+#define _PA_SSR                _SA1111( 0x100c )
+#define _PB_DDR                _SA1111( 0x1010 )
+#define _PB_DRR                _SA1111( 0x1014 )
+#define _PB_DWR                _SA1111( 0x1014 )
+#define _PB_SDR                _SA1111( 0x1018 )
+#define _PB_SSR                _SA1111( 0x101c )
+#define _PC_DDR                _SA1111( 0x1020 )
+#define _PC_DRR                _SA1111( 0x1024 )
+#define _PC_DWR                _SA1111( 0x1024 )
+#define _PC_SDR                _SA1111( 0x1028 )
+#define _PC_SSR                _SA1111( 0x102c )
+
+#define SA1111_GPIO    0x1000
+
+#define SA1111_GPIO_PADDR      (0x000)
+#define SA1111_GPIO_PADRR      (0x004)
+#define SA1111_GPIO_PADWR      (0x004)
+#define SA1111_GPIO_PASDR      (0x008)
+#define SA1111_GPIO_PASSR      (0x00c)
+#define SA1111_GPIO_PBDDR      (0x010)
+#define SA1111_GPIO_PBDRR      (0x014)
+#define SA1111_GPIO_PBDWR      (0x014)
+#define SA1111_GPIO_PBSDR      (0x018)
+#define SA1111_GPIO_PBSSR      (0x01c)
+#define SA1111_GPIO_PCDDR      (0x020)
+#define SA1111_GPIO_PCDRR      (0x024)
+#define SA1111_GPIO_PCDWR      (0x024)
+#define SA1111_GPIO_PCSDR      (0x028)
+#define SA1111_GPIO_PCSSR      (0x02c)
+
+#define GPIO_A0                (1 << 0)
+#define GPIO_A1                (1 << 1)
+#define GPIO_A2                (1 << 2)
+#define GPIO_A3                (1 << 3)
+
+#define GPIO_B0                (1 << 8)
+#define GPIO_B1                (1 << 9)
+#define GPIO_B2                (1 << 10)
+#define GPIO_B3                (1 << 11)
+#define GPIO_B4                (1 << 12)
+#define GPIO_B5                (1 << 13)
+#define GPIO_B6                (1 << 14)
+#define GPIO_B7                (1 << 15)
+
+#define GPIO_C0                (1 << 16)
+#define GPIO_C1                (1 << 17)
+#define GPIO_C2                (1 << 18)
+#define GPIO_C3                (1 << 19)
+#define GPIO_C4                (1 << 20)
+#define GPIO_C5                (1 << 21)
+#define GPIO_C6                (1 << 22)
+#define GPIO_C7                (1 << 23)
+
+/*
+ * Interrupt Controller
+ *
+ * Registers
+ *    INTTEST0         Test register 0
+ *    INTTEST1         Test register 1
+ *    INTEN0           Interrupt Enable register 0
+ *    INTEN1           Interrupt Enable register 1
+ *    INTPOL0          Interrupt Polarity selection 0
+ *    INTPOL1          Interrupt Polarity selection 1
+ *    INTTSTSEL                Interrupt source selection
+ *    INTSTATCLR0      Interrupt Status/Clear 0
+ *    INTSTATCLR1      Interrupt Status/Clear 1
+ *    INTSET0          Interrupt source set 0
+ *    INTSET1          Interrupt source set 1
+ *    WAKE_EN0         Wake-up source enable 0
+ *    WAKE_EN1         Wake-up source enable 1
+ *    WAKE_POL0                Wake-up polarity selection 0
+ *    WAKE_POL1                Wake-up polarity selection 1
+ */
+#define SA1111_INTC            0x1600
+
+/*
+ * These are offsets from the above base.
+ */
+#define SA1111_INTTEST0                0x0000
+#define SA1111_INTTEST1                0x0004
+#define SA1111_INTEN0          0x0008
+#define SA1111_INTEN1          0x000c
+#define SA1111_INTPOL0         0x0010
+#define SA1111_INTPOL1         0x0014
+#define SA1111_INTTSTSEL       0x0018
+#define SA1111_INTSTATCLR0     0x001c
+#define SA1111_INTSTATCLR1     0x0020
+#define SA1111_INTSET0         0x0024
+#define SA1111_INTSET1         0x0028
+#define SA1111_WAKEEN0         0x002c
+#define SA1111_WAKEEN1         0x0030
+#define SA1111_WAKEPOL0                0x0034
+#define SA1111_WAKEPOL1                0x0038
+
+/*
+ * PS/2 Trackpad and Mouse Interfaces
+ *
+ * Registers
+ *    PS2CR            Control Register
+ *    PS2STAT          Status Register
+ *    PS2DATA          Transmit/Receive Data register
+ *    PS2CLKDIV                Clock Division Register
+ *    PS2PRECNT                Clock Precount Register
+ *    PS2TEST1         Test register 1
+ *    PS2TEST2         Test register 2
+ *    PS2TEST3         Test register 3
+ *    PS2TEST4         Test register 4
+ */
+
+#define SA1111_KBD             0x0a00
+#define SA1111_MSE             0x0c00
+
+/*
+ * These are offsets from the above bases.
+ */
+#define SA1111_PS2CR           0x0000
+#define SA1111_PS2STAT         0x0004
+#define SA1111_PS2DATA         0x0008
+#define SA1111_PS2CLKDIV       0x000c
+#define SA1111_PS2PRECNT       0x0010
+
+#define PS2CR_ENA              0x08
+#define PS2CR_FKD              0x02
+#define PS2CR_FKC              0x01
+
+#define PS2STAT_STP            0x0100
+#define PS2STAT_TXE            0x0080
+#define PS2STAT_TXB            0x0040
+#define PS2STAT_RXF            0x0020
+#define PS2STAT_RXB            0x0010
+#define PS2STAT_ENA            0x0008
+#define PS2STAT_RXP            0x0004
+#define PS2STAT_KBD            0x0002
+#define PS2STAT_KBC            0x0001
+
+/*
+ * PCMCIA Interface
+ *
+ * Registers
+ *    PCSR     Status Register
+ *    PCCR     Control Register
+ *    PCSSR    Sleep State Register
+ */
+
+#define SA1111_PCMCIA  0x1600
+
+/*
+ * These are offsets from the above base.
+ */
+#define SA1111_PCCR    0x0000
+#define SA1111_PCSSR   0x0004
+#define SA1111_PCSR    0x0008
+
+#define PCSR_S0_READY  (1<<0)
+#define PCSR_S1_READY  (1<<1)
+#define PCSR_S0_DETECT (1<<2)
+#define PCSR_S1_DETECT (1<<3)
+#define PCSR_S0_VS1    (1<<4)
+#define PCSR_S0_VS2    (1<<5)
+#define PCSR_S1_VS1    (1<<6)
+#define PCSR_S1_VS2    (1<<7)
+#define PCSR_S0_WP     (1<<8)
+#define PCSR_S1_WP     (1<<9)
+#define PCSR_S0_BVD1   (1<<10)
+#define PCSR_S0_BVD2   (1<<11)
+#define PCSR_S1_BVD1   (1<<12)
+#define PCSR_S1_BVD2   (1<<13)
+
+#define PCCR_S0_RST    (1<<0)
+#define PCCR_S1_RST    (1<<1)
+#define PCCR_S0_FLT    (1<<2)
+#define PCCR_S1_FLT    (1<<3)
+#define PCCR_S0_PWAITEN        (1<<4)
+#define PCCR_S1_PWAITEN        (1<<5)
+#define PCCR_S0_PSE    (1<<6)
+#define PCCR_S1_PSE    (1<<7)
+
+#define PCSSR_S0_SLEEP (1<<0)
+#define PCSSR_S1_SLEEP (1<<1)
+
+
+
+
+extern struct bus_type sa1111_bus_type;
+
+#define SA1111_DEVID_SBI       0
+#define SA1111_DEVID_SK                1
+#define SA1111_DEVID_USB       2
+#define SA1111_DEVID_SAC       3
+#define SA1111_DEVID_SSP       4
+#define SA1111_DEVID_PS2       5
+#define SA1111_DEVID_GPIO      6
+#define SA1111_DEVID_INT       7
+#define SA1111_DEVID_PCMCIA    8
+
+struct sa1111_dev {
+       struct device   dev;
+       unsigned int    devid;
+       struct resource res;
+       void __iomem    *mapbase;
+       unsigned int    skpcr_mask;
+       unsigned int    irq[6];
+       u64             dma_mask;
+};
+
+#define SA1111_DEV(_d) container_of((_d), struct sa1111_dev, dev)
+
+#define sa1111_get_drvdata(d)  dev_get_drvdata(&(d)->dev)
+#define sa1111_set_drvdata(d,p)        dev_set_drvdata(&(d)->dev, p)
+
+struct sa1111_driver {
+       struct device_driver    drv;
+       unsigned int            devid;
+       int (*probe)(struct sa1111_dev *);
+       int (*remove)(struct sa1111_dev *);
+       int (*suspend)(struct sa1111_dev *, pm_message_t);
+       int (*resume)(struct sa1111_dev *);
+};
+
+#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
+
+#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
+
+/*
+ * These frob the SKPCR register.
+ */
+void sa1111_enable_device(struct sa1111_dev *);
+void sa1111_disable_device(struct sa1111_dev *);
+
+unsigned int sa1111_pll_clock(struct sa1111_dev *);
+
+#define SA1111_AUDIO_ACLINK    0
+#define SA1111_AUDIO_I2S       1
+
+void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode);
+int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate);
+int sa1111_get_audio_rate(struct sa1111_dev *sadev);
+
+int sa1111_check_dma_bug(dma_addr_t addr);
+
+int sa1111_driver_register(struct sa1111_driver *);
+void sa1111_driver_unregister(struct sa1111_driver *);
+
+void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir);
+void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
+void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
+
+#endif  /* _ASM_ARCH_SA1111 */
diff --git a/arch/arm/include/asm/hardware/scoop.h b/arch/arm/include/asm/hardware/scoop.h
new file mode 100644 (file)
index 0000000..dfb8330
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *  Definitions for the SCOOP interface found on various Sharp PDAs
+ *
+ *  Copyright (c) 2004 Richard Purdie
+ *
+ *  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.
+ *
+ */
+
+#define SCOOP_MCR  0x00
+#define SCOOP_CDR  0x04
+#define SCOOP_CSR  0x08
+#define SCOOP_CPR  0x0C
+#define SCOOP_CCR  0x10
+#define SCOOP_IRR  0x14
+#define SCOOP_IRM  0x14
+#define SCOOP_IMR  0x18
+#define SCOOP_ISR  0x1C
+#define SCOOP_GPCR 0x20
+#define SCOOP_GPWR 0x24
+#define SCOOP_GPRR 0x28
+
+#define SCOOP_GPCR_PA22        ( 1 << 12 )
+#define SCOOP_GPCR_PA21        ( 1 << 11 )
+#define SCOOP_GPCR_PA20        ( 1 << 10 )
+#define SCOOP_GPCR_PA19        ( 1 << 9 )
+#define SCOOP_GPCR_PA18        ( 1 << 8 )
+#define SCOOP_GPCR_PA17        ( 1 << 7 )
+#define SCOOP_GPCR_PA16        ( 1 << 6 )
+#define SCOOP_GPCR_PA15        ( 1 << 5 )
+#define SCOOP_GPCR_PA14        ( 1 << 4 )
+#define SCOOP_GPCR_PA13        ( 1 << 3 )
+#define SCOOP_GPCR_PA12        ( 1 << 2 )
+#define SCOOP_GPCR_PA11        ( 1 << 1 )
+
+struct scoop_config {
+       unsigned short io_out;
+       unsigned short io_dir;
+       unsigned short suspend_clr;
+       unsigned short suspend_set;
+       int gpio_base;
+};
+
+/* Structure for linking scoop devices to PCMCIA sockets */
+struct scoop_pcmcia_dev {
+       struct device *dev;     /* Pointer to this socket's scoop device */
+       int     irq;                /* irq for socket */
+       int cd_irq;
+       const char *cd_irq_str;
+       unsigned char keep_vs;
+       unsigned char keep_rd;
+};
+
+struct scoop_pcmcia_config {
+       struct scoop_pcmcia_dev *devs;
+       int num_devs;
+       void (*pcmcia_init)(void);
+       void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
+};
+
+extern struct scoop_pcmcia_config *platform_scoop_config;
+
+void reset_scoop(struct device *dev);
+unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
+unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
+unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
+void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/arch/arm/include/asm/hardware/sharpsl_pm.h b/arch/arm/include/asm/hardware/sharpsl_pm.h
new file mode 100644 (file)
index 0000000..2d00db2
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * SharpSL Battery/PM Driver
+ *
+ * Copyright (c) 2004-2005 Richard Purdie
+ *
+ * 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.
+ *
+ */
+
+#include <linux/interrupt.h>
+
+struct sharpsl_charger_machinfo {
+       void (*init)(void);
+       void (*exit)(void);
+       int gpio_acin;
+       int gpio_batfull;
+       int batfull_irq;
+       int gpio_batlock;
+       int gpio_fatal;
+       void (*discharge)(int);
+       void (*discharge1)(int);
+       void (*charge)(int);
+       void (*measure_temp)(int);
+       void (*presuspend)(void);
+       void (*postsuspend)(void);
+       void (*earlyresume)(void);
+       unsigned long (*read_devdata)(int);
+#define SHARPSL_BATT_VOLT       1
+#define SHARPSL_BATT_TEMP       2
+#define SHARPSL_ACIN_VOLT       3
+#define SHARPSL_STATUS_ACIN     4
+#define SHARPSL_STATUS_LOCK     5
+#define SHARPSL_STATUS_CHRGFULL 6
+#define SHARPSL_STATUS_FATAL    7
+       unsigned long (*charger_wakeup)(void);
+       int (*should_wakeup)(unsigned int resume_on_alarm);
+       void (*backlight_limit)(int);
+       int (*backlight_get_status) (void);
+       int charge_on_volt;
+       int charge_on_temp;
+       int charge_acin_high;
+       int charge_acin_low;
+       int fatal_acin_volt;
+       int fatal_noacin_volt;
+       int bat_levels;
+       struct battery_thresh *bat_levels_noac;
+       struct battery_thresh *bat_levels_acin;
+       struct battery_thresh *bat_levels_noac_bl;
+       struct battery_thresh *bat_levels_acin_bl;
+       int status_high_acin;
+       int status_low_acin;
+       int status_high_noac;
+       int status_low_noac;
+};
+
+struct battery_thresh {
+       int voltage;
+       int percentage;
+};
+
+struct battery_stat {
+       int ac_status;         /* APM AC Present/Not Present */
+       int mainbat_status;    /* APM Main Battery Status */
+       int mainbat_percent;   /* Main Battery Percentage Charge */
+       int mainbat_voltage;   /* Main Battery Voltage */
+};
+
+struct sharpsl_pm_status {
+       struct device *dev;
+       struct timer_list ac_timer;
+       struct timer_list chrg_full_timer;
+
+       int charge_mode;
+#define CHRG_ERROR    (-1)
+#define CHRG_OFF      (0)
+#define CHRG_ON       (1)
+#define CHRG_DONE     (2)
+
+       unsigned int flags;
+#define SHARPSL_SUSPENDED       (1 << 0)  /* Device is Suspended */
+#define SHARPSL_ALARM_ACTIVE    (1 << 1)  /* Alarm is for charging event (not user) */
+#define SHARPSL_BL_LIMIT        (1 << 2)  /* Backlight Intensity Limited */
+#define SHARPSL_APM_QUEUED      (1 << 3)  /* APM Event Queued */
+#define SHARPSL_DO_OFFLINE_CHRG (1 << 4)  /* Trigger the offline charger */
+
+       int full_count;
+       unsigned long charge_start_time;
+       struct sharpsl_charger_machinfo *machinfo;
+       struct battery_stat battstat;
+};
+
+extern struct sharpsl_pm_status sharpsl_pm;
+
+
+#define SHARPSL_LED_ERROR  2
+#define SHARPSL_LED_ON     1
+#define SHARPSL_LED_OFF    0
+
+void sharpsl_battery_kick(void);
+void sharpsl_pm_led(int val);
+irqreturn_t sharpsl_ac_isr(int irq, void *dev_id);
+irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id);
+irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id);
+
diff --git a/arch/arm/include/asm/hardware/ssp.h b/arch/arm/include/asm/hardware/ssp.h
new file mode 100644 (file)
index 0000000..3b42e18
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ *  ssp.h
+ *
+ *  Copyright (C) 2003 Russell King, All Rights Reserved.
+ *
+ * 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.
+ */
+#ifndef SSP_H
+#define SSP_H
+
+struct ssp_state {
+       unsigned int    cr0;
+       unsigned int    cr1;
+};
+
+int ssp_write_word(u16 data);
+int ssp_read_word(u16 *data);
+int ssp_flush(void);
+void ssp_enable(void);
+void ssp_disable(void);
+void ssp_save_state(struct ssp_state *ssp);
+void ssp_restore_state(struct ssp_state *ssp);
+int ssp_init(void);
+void ssp_exit(void);
+
+#endif
diff --git a/arch/arm/include/asm/hardware/uengine.h b/arch/arm/include/asm/hardware/uengine.h
new file mode 100644 (file)
index 0000000..b442d65
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Generic library functions for the microengines found on the Intel
+ * IXP2000 series of network processors.
+ *
+ * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org>
+ * Dedicated to Marija Kulikova.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ */
+
+#ifndef __IXP2000_UENGINE_H
+#define __IXP2000_UENGINE_H
+
+extern u32 ixp2000_uengine_mask;
+
+struct ixp2000_uengine_code
+{
+       u32     cpu_model_bitmask;
+       u8      cpu_min_revision;
+       u8      cpu_max_revision;
+
+       u32     uengine_parameters;
+
+       struct ixp2000_reg_value {
+               int     reg;
+               u32     value;
+       } *initial_reg_values;
+
+       int     num_insns;
+       u8      *insns;
+};
+
+u32 ixp2000_uengine_csr_read(int uengine, int offset);
+void ixp2000_uengine_csr_write(int uengine, int offset, u32 value);
+void ixp2000_uengine_reset(u32 uengine_mask);
+void ixp2000_uengine_set_mode(int uengine, u32 mode);
+void ixp2000_uengine_load_microcode(int uengine, u8 *ucode, int insns);
+void ixp2000_uengine_init_context(int uengine, int context, int pc);
+void ixp2000_uengine_start_contexts(int uengine, u8 ctx_mask);
+void ixp2000_uengine_stop_contexts(int uengine, u8 ctx_mask);
+int ixp2000_uengine_load(int uengine, struct ixp2000_uengine_code *c);
+
+#define IXP2000_UENGINE_8_CONTEXTS             0x00000000
+#define IXP2000_UENGINE_4_CONTEXTS             0x80000000
+#define IXP2000_UENGINE_PRN_UPDATE_EVERY       0x40000000
+#define IXP2000_UENGINE_PRN_UPDATE_ON_ACCESS   0x00000000
+#define IXP2000_UENGINE_NN_FROM_SELF           0x00100000
+#define IXP2000_UENGINE_NN_FROM_PREVIOUS       0x00000000
+#define IXP2000_UENGINE_ASSERT_EMPTY_AT_3      0x000c0000
+#define IXP2000_UENGINE_ASSERT_EMPTY_AT_2      0x00080000
+#define IXP2000_UENGINE_ASSERT_EMPTY_AT_1      0x00040000
+#define IXP2000_UENGINE_ASSERT_EMPTY_AT_0      0x00000000
+#define IXP2000_UENGINE_LM_ADDR1_GLOBAL                0x00020000
+#define IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT   0x00000000
+#define IXP2000_UENGINE_LM_ADDR0_GLOBAL                0x00010000
+#define IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT   0x00000000
+
+
+#endif
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
new file mode 100644 (file)
index 0000000..263f2c3
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ *  arch/arm/include/asm/hardware/vic.h
+ *
+ *  Copyright (c) ARM Limited 2003.  All rights reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_ARM_HARDWARE_VIC_H
+#define __ASM_ARM_HARDWARE_VIC_H
+
+#define VIC_IRQ_STATUS                 0x00
+#define VIC_FIQ_STATUS                 0x04
+#define VIC_RAW_STATUS                 0x08
+#define VIC_INT_SELECT                 0x0c    /* 1 = FIQ, 0 = IRQ */
+#define VIC_INT_ENABLE                 0x10    /* 1 = enable, 0 = disable */
+#define VIC_INT_ENABLE_CLEAR           0x14
+#define VIC_INT_SOFT                   0x18
+#define VIC_INT_SOFT_CLEAR             0x1c
+#define VIC_PROTECT                    0x20
+#define VIC_VECT_ADDR                  0x30
+#define VIC_DEF_VECT_ADDR              0x34
+
+#define VIC_VECT_ADDR0                 0x100   /* 0 to 15 */
+#define VIC_VECT_CNTL0                 0x200   /* 0 to 15 */
+#define VIC_ITCR                       0x300   /* VIC test control register */
+
+#define VIC_VECT_CNTL_ENABLE           (1 << 5)
+
+#ifndef __ASSEMBLY__
+void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources);
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/hw_irq.h b/arch/arm/include/asm/hw_irq.h
new file mode 100644 (file)
index 0000000..f1a08a5
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * Nothing to see here yet
+ */
+#ifndef _ARCH_ARM_HW_IRQ_H
+#define _ARCH_ARM_HW_IRQ_H
+
+#include <asm/mach/irq.h>
+
+#endif
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
new file mode 100644 (file)
index 0000000..81f4c89
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __ASMARM_HWCAP_H
+#define __ASMARM_HWCAP_H
+
+/*
+ * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
+ */
+#define HWCAP_SWP      1
+#define HWCAP_HALF     2
+#define HWCAP_THUMB    4
+#define HWCAP_26BIT    8       /* Play it safe */
+#define HWCAP_FAST_MULT        16
+#define HWCAP_FPA      32
+#define HWCAP_VFP      64
+#define HWCAP_EDSP     128
+#define HWCAP_JAVA     256
+#define HWCAP_IWMMXT   512
+#define HWCAP_CRUNCH   1024
+#define HWCAP_THUMBEE  2048
+
+#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+/*
+ * This yields a mask that user programs can use to figure out what
+ * instruction set this cpu supports.
+ */
+#define ELF_HWCAP      (elf_hwcap)
+extern unsigned int elf_hwcap;
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/ide.h b/arch/arm/include/asm/ide.h
new file mode 100644 (file)
index 0000000..b507ce8
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  arch/arm/include/asm/ide.h
+ *
+ *  Copyright (C) 1994-1996  Linus Torvalds & authors
+ */
+
+/*
+ *  This file contains the ARM architecture specific IDE code.
+ */
+
+#ifndef __ASMARM_IDE_H
+#define __ASMARM_IDE_H
+
+#ifdef __KERNEL__
+
+#define __ide_mm_insw(port,addr,len)   readsw(port,addr,len)
+#define __ide_mm_insl(port,addr,len)   readsl(port,addr,len)
+#define __ide_mm_outsw(port,addr,len)  writesw(port,addr,len)
+#define __ide_mm_outsl(port,addr,len)  writesl(port,addr,len)
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASMARM_IDE_H */
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
new file mode 100644 (file)
index 0000000..ffe07c0
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ *  arch/arm/include/asm/io.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * 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.
+ *
+ * Modifications:
+ *  16-Sep-1996        RMK     Inlined the inx/outx functions & optimised for both
+ *                     constant addresses and variable addresses.
+ *  04-Dec-1997        RMK     Moved a lot of this stuff to the new architecture
+ *                     specific IO header files.
+ *  27-Mar-1999        PJB     Second parameter of memcpy_toio is const..
+ *  04-Apr-1999        PJB     Added check_signature.
+ *  12-Dec-1999        RMK     More cleanups
+ *  18-Jun-2000 RMK    Removed virt_to_* and friends definitions
+ *  05-Oct-2004 BJD     Moved memory string functions to use void __iomem
+ */
+#ifndef __ASM_ARM_IO_H
+#define __ASM_ARM_IO_H
+
+#ifdef __KERNEL__
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <asm/memory.h>
+
+/*
+ * ISA I/O bus memory addresses are 1:1 with the physical address.
+ */
+#define isa_virt_to_bus virt_to_phys
+#define isa_page_to_bus page_to_phys
+#define isa_bus_to_virt phys_to_virt
+
+/*
+ * Generic IO read/write.  These perform native-endian accesses.  Note
+ * that some architectures will want to re-define __raw_{read,write}w.
+ */
+extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen);
+extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen);
+extern void __raw_writesl(void __iomem *addr, const void *data, int longlen);
+
+extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen);
+extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen);
+extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
+
+#define __raw_writeb(v,a)      (__chk_io_ptr(a), *(volatile unsigned char __force  *)(a) = (v))
+#define __raw_writew(v,a)      (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))
+#define __raw_writel(v,a)      (__chk_io_ptr(a), *(volatile unsigned int __force   *)(a) = (v))
+
+#define __raw_readb(a)         (__chk_io_ptr(a), *(volatile unsigned char __force  *)(a))
+#define __raw_readw(a)         (__chk_io_ptr(a), *(volatile unsigned short __force *)(a))
+#define __raw_readl(a)         (__chk_io_ptr(a), *(volatile unsigned int __force   *)(a))
+
+/*
+ * Architecture ioremap implementation.
+ */
+#define MT_DEVICE              0
+#define MT_DEVICE_NONSHARED    1
+#define MT_DEVICE_CACHED       2
+#define MT_DEVICE_IXP2000      3
+/*
+ * types 4 onwards can be found in asm/mach/map.h and are undefined
+ * for ioremap
+ */
+
+/*
+ * __arm_ioremap takes CPU physical address.
+ * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
+ */
+extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
+extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int);
+extern void __iounmap(volatile void __iomem *addr);
+
+/*
+ * Bad read/write accesses...
+ */
+extern void __readwrite_bug(const char *fn);
+
+/*
+ * Now, pick up the machine-defined IO definitions
+ */
+#include <asm/arch/io.h>
+
+/*
+ *  IO port access primitives
+ *  -------------------------
+ *
+ * The ARM doesn't have special IO access instructions; all IO is memory
+ * mapped.  Note that these are defined to perform little endian accesses
+ * only.  Their primary purpose is to access PCI and ISA peripherals.
+ *
+ * Note that for a big endian machine, this implies that the following
+ * big endian mode connectivity is in place, as described by numerous
+ * ARM documents:
+ *
+ *    PCI:  D0-D7   D8-D15 D16-D23 D24-D31
+ *    ARM: D24-D31 D16-D23  D8-D15  D0-D7
+ *
+ * The machine specific io.h include defines __io to translate an "IO"
+ * address to a memory address.
+ *
+ * Note that we prevent GCC re-ordering or caching values in expressions
+ * by introducing sequence points into the in*() definitions.  Note that
+ * __raw_* do not guarantee this behaviour.
+ *
+ * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space.
+ */
+#ifdef __io
+#define outb(v,p)              __raw_writeb(v,__io(p))
+#define outw(v,p)              __raw_writew((__force __u16) \
+                                       cpu_to_le16(v),__io(p))
+#define outl(v,p)              __raw_writel((__force __u32) \
+                                       cpu_to_le32(v),__io(p))
+
+#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __v; })
+#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \
+                       __raw_readw(__io(p))); __v; })
+#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \
+                       __raw_readl(__io(p))); __v; })
+
+#define outsb(p,d,l)           __raw_writesb(__io(p),d,l)
+#define outsw(p,d,l)           __raw_writesw(__io(p),d,l)
+#define outsl(p,d,l)           __raw_writesl(__io(p),d,l)
+
+#define insb(p,d,l)            __raw_readsb(__io(p),d,l)
+#define insw(p,d,l)            __raw_readsw(__io(p),d,l)
+#define insl(p,d,l)            __raw_readsl(__io(p),d,l)
+#endif
+
+#define outb_p(val,port)       outb((val),(port))
+#define outw_p(val,port)       outw((val),(port))
+#define outl_p(val,port)       outl((val),(port))
+#define inb_p(port)            inb((port))
+#define inw_p(port)            inw((port))
+#define inl_p(port)            inl((port))
+
+#define outsb_p(port,from,len) outsb(port,from,len)
+#define outsw_p(port,from,len) outsw(port,from,len)
+#define outsl_p(port,from,len) outsl(port,from,len)
+#define insb_p(port,to,len)    insb(port,to,len)
+#define insw_p(port,to,len)    insw(port,to,len)
+#define insl_p(port,to,len)    insl(port,to,len)
+
+/*
+ * String version of IO memory access ops:
+ */
+extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t);
+extern void _memcpy_toio(volatile void __iomem *, const void *, size_t);
+extern void _memset_io(volatile void __iomem *, int, size_t);
+
+#define mmiowb()
+
+/*
+ *  Memory access primitives
+ *  ------------------------
+ *
+ * These perform PCI memory accesses via an ioremap region.  They don't
+ * take an address as such, but a cookie.
+ *
+ * Again, this are defined to perform little endian accesses.  See the
+ * IO port primitives for more information.
+ */
+#ifdef __mem_pci
+#define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
+#define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \
+                                       __raw_readw(__mem_pci(c))); __v; })
+#define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \
+                                       __raw_readl(__mem_pci(c))); __v; })
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
+#define readsb(p,d,l)          __raw_readsb(__mem_pci(p),d,l)
+#define readsw(p,d,l)          __raw_readsw(__mem_pci(p),d,l)
+#define readsl(p,d,l)          __raw_readsl(__mem_pci(p),d,l)
+
+#define writeb(v,c)            __raw_writeb(v,__mem_pci(c))
+#define writew(v,c)            __raw_writew((__force __u16) \
+                                       cpu_to_le16(v),__mem_pci(c))
+#define writel(v,c)            __raw_writel((__force __u32) \
+                                       cpu_to_le32(v),__mem_pci(c))
+
+#define writesb(p,d,l)         __raw_writesb(__mem_pci(p),d,l)
+#define writesw(p,d,l)         __raw_writesw(__mem_pci(p),d,l)
+#define writesl(p,d,l)         __raw_writesl(__mem_pci(p),d,l)
+
+#define memset_io(c,v,l)       _memset_io(__mem_pci(c),(v),(l))
+#define memcpy_fromio(a,c,l)   _memcpy_fromio((a),__mem_pci(c),(l))
+#define memcpy_toio(c,a,l)     _memcpy_toio(__mem_pci(c),(a),(l))
+
+#elif !defined(readb)
+
+#define readb(c)                       (__readwrite_bug("readb"),0)
+#define readw(c)                       (__readwrite_bug("readw"),0)
+#define readl(c)                       (__readwrite_bug("readl"),0)
+#define writeb(v,c)                    __readwrite_bug("writeb")
+#define writew(v,c)                    __readwrite_bug("writew")
+#define writel(v,c)                    __readwrite_bug("writel")
+
+#define check_signature(io,sig,len)    (0)
+
+#endif /* __mem_pci */
+
+/*
+ * ioremap and friends.
+ *
+ * ioremap takes a PCI memory address, as specified in
+ * Documentation/IO-mapping.txt.
+ *
+ */
+#ifndef __arch_ioremap
+#define ioremap(cookie,size)           __arm_ioremap(cookie, size, MT_DEVICE)
+#define ioremap_nocache(cookie,size)   __arm_ioremap(cookie, size, MT_DEVICE)
+#define ioremap_cached(cookie,size)    __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
+#define iounmap(cookie)                        __iounmap(cookie)
+#else
+#define ioremap(cookie,size)           __arch_ioremap((cookie), (size), MT_DEVICE)
+#define ioremap_nocache(cookie,size)   __arch_ioremap((cookie), (size), MT_DEVICE)
+#define ioremap_cached(cookie,size)    __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
+#define iounmap(cookie)                        __arch_iounmap(cookie)
+#endif
+
+/*
+ * io{read,write}{8,16,32} macros
+ */
+#ifndef ioread8
+#define ioread8(p)     ({ unsigned int __v = __raw_readb(p); __v; })
+#define ioread16(p)    ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; })
+#define ioread32(p)    ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; })
+
+#define iowrite8(v,p)  __raw_writeb(v, p)
+#define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p)
+#define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p)
+
+#define ioread8_rep(p,d,c)     __raw_readsb(p,d,c)
+#define ioread16_rep(p,d,c)    __raw_readsw(p,d,c)
+#define ioread32_rep(p,d,c)    __raw_readsl(p,d,c)
+
+#define iowrite8_rep(p,s,c)    __raw_writesb(p,s,c)
+#define iowrite16_rep(p,s,c)   __raw_writesw(p,s,c)
+#define iowrite32_rep(p,s,c)   __raw_writesl(p,s,c)
+
+extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
+extern void ioport_unmap(void __iomem *addr);
+#endif
+
+struct pci_dev;
+
+extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen);
+extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
+
+/*
+ * can the hardware map this into one segment or not, given no other
+ * constraints.
+ */
+#define BIOVEC_MERGEABLE(vec1, vec2)   \
+       ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
+
+#ifdef CONFIG_MMU
+#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+extern int valid_phys_addr_range(unsigned long addr, size_t size);
+extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
+#endif
+
+/*
+ * 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
+
+/*
+ * Register ISA memory and port locations for glibc iopl/inb/outb
+ * emulation.
+ */
+extern void register_isa_ports(unsigned int mmio, unsigned int io,
+                              unsigned int io_shift);
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_ARM_IO_H */
diff --git a/arch/arm/include/asm/ioctl.h b/arch/arm/include/asm/ioctl.h
new file mode 100644 (file)
index 0000000..b279fe0
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/ioctl.h>
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h
new file mode 100644 (file)
index 0000000..a91d8a1
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef __ASM_ARM_IOCTLS_H
+#define __ASM_ARM_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define TCGETS         0x5401
+#define TCSETS         0x5402
+#define TCSETSW                0x5403
+#define TCSETSF                0x5404
+#define TCGETA         0x5405
+#define TCSETA         0x5406
+#define TCSETAW                0x5407
+#define TCSETAF                0x5408
+#define TCSBRK         0x5409
+#define TCXONC         0x540A
+#define TCFLSH         0x540B
+#define TIOCEXCL       0x540C
+#define TIOCNXCL       0x540D
+#define TIOCSCTTY      0x540E
+#define TIOCGPGRP      0x540F
+#define TIOCSPGRP      0x5410
+#define TIOCOUTQ       0x5411
+#define TIOCSTI                0x5412
+#define TIOCGWINSZ     0x5413
+#define TIOCSWINSZ     0x5414
+#define TIOCMGET       0x5415
+#define TIOCMBIS       0x5416
+#define TIOCMBIC       0x5417
+#define TIOCMSET       0x5418
+#define TIOCGSOFTCAR   0x5419
+#define TIOCSSOFTCAR   0x541A
+#define FIONREAD       0x541B
+#define TIOCINQ                FIONREAD
+#define TIOCLINUX      0x541C
+#define TIOCCONS       0x541D
+#define TIOCGSERIAL    0x541E
+#define TIOCSSERIAL    0x541F
+#define TIOCPKT                0x5420
+#define FIONBIO                0x5421
+#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 TCGETS2                _IOR('T',0x2A, struct termios2)
+#define TCSETS2                _IOW('T',0x2B, struct termios2)
+#define TCSETSW2       _IOW('T',0x2C, struct termios2)
+#define TCSETSF2       _IOW('T',0x2D, struct termios2)
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+
+#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
+#define FIOCLEX                0x5451
+#define FIOASYNC       0x5452
+#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 */
+#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 FIOQSIZE       0x545E
+
+/* Used for packet mode */
+#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 TIOCSER_TEMT   0x01    /* Transmitter physically empty */
+
+#endif
diff --git a/arch/arm/include/asm/ipcbuf.h b/arch/arm/include/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..9768397
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __ASMARM_IPCBUF_H
+#define __ASMARM_IPCBUF_H
+
+/*
+ * The ipc64_perm structure for arm architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t and seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct ipc64_perm
+{
+       __kernel_key_t          key;
+       __kernel_uid32_t        uid;
+       __kernel_gid32_t        gid;
+       __kernel_uid32_t        cuid;
+       __kernel_gid32_t        cgid;
+       __kernel_mode_t         mode;
+       unsigned short          __pad1;
+       unsigned short          seq;
+       unsigned short          __pad2;
+       unsigned long           __unused1;
+       unsigned long           __unused2;
+};
+
+#endif /* __ASMARM_IPCBUF_H */
diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
new file mode 100644 (file)
index 0000000..9cb0190
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef __ASM_ARM_IRQ_H
+#define __ASM_ARM_IRQ_H
+
+#include <asm/arch/irqs.h>
+
+#ifndef irq_canonicalize
+#define irq_canonicalize(i)    (i)
+#endif
+
+#ifndef NR_IRQS
+#define NR_IRQS        128
+#endif
+
+/*
+ * Use this value to indicate lack of interrupt
+ * capability
+ */
+#ifndef NO_IRQ
+#define NO_IRQ ((unsigned int)(-1))
+#endif
+
+#ifndef __ASSEMBLY__
+struct irqaction;
+extern void migrate_irqs(void);
+#endif
+
+#endif
+
diff --git a/arch/arm/include/asm/irq_regs.h b/arch/arm/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/arm/include/asm/irqflags.h b/arch/arm/include/asm/irqflags.h
new file mode 100644 (file)
index 0000000..6d09974
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef __ASM_ARM_IRQFLAGS_H
+#define __ASM_ARM_IRQFLAGS_H
+
+#ifdef __KERNEL__
+
+#include <asm/ptrace.h>
+
+/*
+ * CPU interrupt mask handling.
+ */
+#if __LINUX_ARM_ARCH__ >= 6
+
+#define raw_local_irq_save(x)                                  \
+       ({                                                      \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ local_irq_save\n"     \
+       "cpsid  i"                                              \
+       : "=r" (x) : : "memory", "cc");                         \
+       })
+
+#define raw_local_irq_enable()  __asm__("cpsie i       @ __sti" : : : "memory", "cc")
+#define raw_local_irq_disable() __asm__("cpsid i       @ __cli" : : : "memory", "cc")
+#define local_fiq_enable()  __asm__("cpsie f   @ __stf" : : : "memory", "cc")
+#define local_fiq_disable() __asm__("cpsid f   @ __clf" : : : "memory", "cc")
+
+#else
+
+/*
+ * Save the current interrupt enable state & disable IRQs
+ */
+#define raw_local_irq_save(x)                                  \
+       ({                                                      \
+               unsigned long temp;                             \
+               (void) (&temp == &x);                           \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ local_irq_save\n"     \
+"      orr     %1, %0, #128\n"                                 \
+"      msr     cpsr_c, %1"                                     \
+       : "=r" (x), "=r" (temp)                                 \
+       :                                                       \
+       : "memory", "cc");                                      \
+       })
+       
+/*
+ * Enable IRQs
+ */
+#define raw_local_irq_enable()                                 \
+       ({                                                      \
+               unsigned long temp;                             \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ local_irq_enable\n"   \
+"      bic     %0, %0, #128\n"                                 \
+"      msr     cpsr_c, %0"                                     \
+       : "=r" (temp)                                           \
+       :                                                       \
+       : "memory", "cc");                                      \
+       })
+
+/*
+ * Disable IRQs
+ */
+#define raw_local_irq_disable()                                        \
+       ({                                                      \
+               unsigned long temp;                             \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ local_irq_disable\n"  \
+"      orr     %0, %0, #128\n"                                 \
+"      msr     cpsr_c, %0"                                     \
+       : "=r" (temp)                                           \
+       :                                                       \
+       : "memory", "cc");                                      \
+       })
+
+/*
+ * Enable FIQs
+ */
+#define local_fiq_enable()                                     \
+       ({                                                      \
+               unsigned long temp;                             \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ stf\n"                \
+"      bic     %0, %0, #64\n"                                  \
+"      msr     cpsr_c, %0"                                     \
+       : "=r" (temp)                                           \
+       :                                                       \
+       : "memory", "cc");                                      \
+       })
+
+/*
+ * Disable FIQs
+ */
+#define local_fiq_disable()                                    \
+       ({                                                      \
+               unsigned long temp;                             \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ clf\n"                \
+"      orr     %0, %0, #64\n"                                  \
+"      msr     cpsr_c, %0"                                     \
+       : "=r" (temp)                                           \
+       :                                                       \
+       : "memory", "cc");                                      \
+       })
+
+#endif
+
+/*
+ * Save the current interrupt enable state.
+ */
+#define raw_local_save_flags(x)                                        \
+       ({                                                      \
+       __asm__ __volatile__(                                   \
+       "mrs    %0, cpsr                @ local_save_flags"     \
+       : "=r" (x) : : "memory", "cc");                         \
+       })
+
+/*
+ * restore saved IRQ & FIQ state
+ */
+#define raw_local_irq_restore(x)                               \
+       __asm__ __volatile__(                                   \
+       "msr    cpsr_c, %0              @ local_irq_restore\n"  \
+       :                                                       \
+       : "r" (x)                                               \
+       : "memory", "cc")
+
+#define raw_irqs_disabled_flags(flags) \
+({                                     \
+       (int)((flags) & PSR_I_BIT);     \
+})
+
+#endif
+#endif
diff --git a/arch/arm/include/asm/kdebug.h b/arch/arm/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/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h
new file mode 100644 (file)
index 0000000..c8986bb
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _ARM_KEXEC_H
+#define _ARM_KEXEC_H
+
+#ifdef CONFIG_KEXEC
+
+/* Maximum physical address we can use pages from */
+#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
+/* Maximum address we can reach in physical address mode */
+#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
+/* Maximum address we can use for the control code buffer */
+#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
+
+#define KEXEC_CONTROL_CODE_SIZE        4096
+
+#define KEXEC_ARCH KEXEC_ARCH_ARM
+
+#define KEXEC_ARM_ATAGS_OFFSET  0x1000
+#define KEXEC_ARM_ZIMAGE_OFFSET 0x8000
+
+#ifndef __ASSEMBLY__
+
+struct kimage;
+/* Provide a dummy definition to avoid build failures. */
+static inline void crash_setup_regs(struct pt_regs *newregs,
+                                        struct pt_regs *oldregs) { }
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* CONFIG_KEXEC */
+
+#endif /* _ARM_KEXEC_H */
diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h
new file mode 100644 (file)
index 0000000..67af4b8
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * ARM KGDB support
+ *
+ * Author: Deepak Saxena <dsaxena@mvista.com>
+ *
+ * Copyright (C) 2002 MontaVista Software Inc.
+ *
+ */
+
+#ifndef __ARM_KGDB_H__
+#define __ARM_KGDB_H__
+
+#include <linux/ptrace.h>
+
+/*
+ * GDB assumes that we're a user process being debugged, so
+ * it will send us an SWI command to write into memory as the
+ * debug trap. When an SWI occurs, the next instruction addr is
+ * placed into R14_svc before jumping to the vector trap.
+ * This doesn't work for kernel debugging as we are already in SVC
+ * we would loose the kernel's LR, which is a bad thing. This
+ * is  bad thing.
+ *
+ * By doing this as an undefined instruction trap, we force a mode
+ * switch from SVC to UND mode, allowing us to save full kernel state.
+ *
+ * We also define a KGDB_COMPILED_BREAK which can be used to compile
+ * in breakpoints. This is important for things like sysrq-G and for
+ * the initial breakpoint from trap_init().
+ *
+ * Note to ARM HW designers: Add real trap support like SH && PPC to
+ * make our lives much much simpler. :)
+ */
+#define BREAK_INSTR_SIZE       4
+#define GDB_BREAKINST          0xef9f0001
+#define KGDB_BREAKINST         0xe7ffdefe
+#define KGDB_COMPILED_BREAK    0xe7ffdeff
+#define CACHE_FLUSH_IS_SAFE    1
+
+#ifndef        __ASSEMBLY__
+
+static inline void arch_kgdb_breakpoint(void)
+{
+       asm(".word 0xe7ffdeff");
+}
+
+extern void kgdb_handle_bus_error(void);
+extern int kgdb_fault_expected;
+
+#endif /* !__ASSEMBLY__ */
+
+/*
+ * From Kevin Hilman:
+ *
+ * gdb is expecting the following registers layout.
+ *
+ * r0-r15: 1 long word each
+ * f0-f7:  unused, 3 long words each !!
+ * fps:    unused, 1 long word
+ * cpsr:   1 long word
+ *
+ * Even though f0-f7 and fps are not used, they need to be
+ * present in the registers sent for correct processing in
+ * the host-side gdb.
+ *
+ * In particular, it is crucial that CPSR is in the right place,
+ * otherwise gdb will not be able to correctly interpret stepping over
+ * conditional branches.
+ */
+#define _GP_REGS               16
+#define _FP_REGS               8
+#define _EXTRA_REGS            2
+#define GDB_MAX_REGS           (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
+
+#define KGDB_MAX_NO_CPUS       1
+#define BUFMAX                 400
+#define NUMREGBYTES            (GDB_MAX_REGS << 2)
+#define NUMCRITREGBYTES                (32 << 2)
+
+#define _R0                    0
+#define _R1                    1
+#define _R2                    2
+#define _R3                    3
+#define _R4                    4
+#define _R5                    5
+#define _R6                    6
+#define _R7                    7
+#define _R8                    8
+#define _R9                    9
+#define _R10                   10
+#define _FP                    11
+#define _IP                    12
+#define _SPT                   13
+#define _LR                    14
+#define _PC                    15
+#define _CPSR                  (GDB_MAX_REGS - 1)
+
+/*
+ * So that we can denote the end of a frame for tracing,
+ * in the simple case:
+ */
+#define CFI_END_FRAME(func)    __CFI_END_FRAME(_PC, _SPT, func)
+
+#endif /* __ASM_KGDB_H__ */
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
new file mode 100644 (file)
index 0000000..45def13
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __ARM_KMAP_TYPES_H
+#define __ARM_KMAP_TYPES_H
+
+/*
+ * This is the "bare minimum".  AIO seems to require this.
+ */
+enum km_type {
+       KM_BOUNCE_READ,
+       KM_SKB_SUNRPC_DATA,
+       KM_SKB_DATA_SOFTIRQ,
+       KM_USER0,
+       KM_USER1,
+       KM_BIO_SRC_IRQ,
+       KM_BIO_DST_IRQ,
+       KM_PTE0,
+       KM_PTE1,
+       KM_IRQ0,
+       KM_IRQ1,
+       KM_SOFTIRQ0,
+       KM_SOFTIRQ1,
+       KM_TYPE_NR
+};
+
+#endif
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
new file mode 100644 (file)
index 0000000..a5d0d99
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * arch/arm/include/asm/kprobes.h
+ *
+ * Copyright (C) 2006, 2007 Motorola Inc.
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef _ARM_KPROBES_H
+#define _ARM_KPROBES_H
+
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/percpu.h>
+
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+#define MAX_INSN_SIZE                  2
+#define MAX_STACK_SIZE                 64      /* 32 would probably be OK */
+
+/*
+ * This undefined instruction must be unique and
+ * reserved solely for kprobes' use.
+ */
+#define KPROBE_BREAKPOINT_INSTRUCTION  0xe7f001f8
+
+#define regs_return_value(regs)                ((regs)->ARM_r0)
+#define flush_insn_slot(p)             do { } while (0)
+#define kretprobe_blacklist_size       0
+
+typedef u32 kprobe_opcode_t;
+
+struct kprobe;
+typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *);
+
+/* Architecture specific copy of original instruction. */
+struct arch_specific_insn {
+       kprobe_opcode_t         *insn;
+       kprobe_insn_handler_t   *insn_handler;
+};
+
+struct prev_kprobe {
+       struct kprobe *kp;
+       unsigned int status;
+};
+
+/* per-cpu kprobe control block */
+struct kprobe_ctlblk {
+       unsigned int kprobe_status;
+       struct prev_kprobe prev_kprobe;
+       struct pt_regs jprobe_saved_regs;
+       char jprobes_stack[MAX_STACK_SIZE];
+};
+
+void arch_remove_kprobe(struct kprobe *);
+void kretprobe_trampoline(void);
+
+int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr);
+int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
+int kprobe_exceptions_notify(struct notifier_block *self,
+                            unsigned long val, void *data);
+
+enum kprobe_insn {
+       INSN_REJECTED,
+       INSN_GOOD,
+       INSN_GOOD_NO_SLOT
+};
+
+enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
+                                       struct arch_specific_insn *);
+void __init arm_kprobe_decode_init(void);
+
+#endif /* _ARM_KPROBES_H */
diff --git a/arch/arm/include/asm/leds.h b/arch/arm/include/asm/leds.h
new file mode 100644 (file)
index 0000000..c545739
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  arch/arm/include/asm/leds.h
+ *
+ *  Copyright (C) 1998 Russell King
+ *
+ * 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.
+ *
+ *  Event-driven interface for LEDs on machines
+ *  Added led_start and led_stop- Alex Holden, 28th Dec 1998.
+ */
+#ifndef ASM_ARM_LEDS_H
+#define ASM_ARM_LEDS_H
+
+
+typedef enum {
+       led_idle_start,
+       led_idle_end,
+       led_timer,
+       led_start,
+       led_stop,
+       led_claim,              /* override idle & timer leds */
+       led_release,            /* restore idle & timer leds */
+       led_start_timer_mode,
+       led_stop_timer_mode,
+       led_green_on,
+       led_green_off,
+       led_amber_on,
+       led_amber_off,
+       led_red_on,
+       led_red_off,
+       led_blue_on,
+       led_blue_off,
+       /*
+        * I want this between led_timer and led_start, but
+        * someone has decided to export this to user space
+        */
+       led_halted
+} led_event_t;
+
+/* Use this routine to handle LEDs */
+
+#ifdef CONFIG_LEDS
+extern void (*leds_event)(led_event_t);
+#else
+#define leds_event(e)
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/limits.h b/arch/arm/include/asm/limits.h
new file mode 100644 (file)
index 0000000..08d8c66
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_PIPE_H
+#define __ASM_PIPE_H
+
+#ifndef PAGE_SIZE
+#include <asm/page.h>
+#endif
+
+#define PIPE_BUF       PAGE_SIZE
+
+#endif
+
diff --git a/arch/arm/include/asm/linkage.h b/arch/arm/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..5a25632
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN .align 0
+#define __ALIGN_STR ".align 0"
+
+#define ENDPROC(name) \
+  .type name, %function; \
+  END(name)
+
+#endif
diff --git a/arch/arm/include/asm/local.h b/arch/arm/include/asm/local.h
new file mode 100644 (file)
index 0000000..c11c530
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/local.h>
diff --git a/arch/arm/include/asm/locks.h b/arch/arm/include/asm/locks.h
new file mode 100644 (file)
index 0000000..ef4c897
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ *  arch/arm/include/asm/locks.h
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * 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.
+ *
+ *  Interrupt safe locking assembler. 
+ */
+#ifndef __ASM_PROC_LOCKS_H
+#define __ASM_PROC_LOCKS_H
+
+#if __LINUX_ARM_ARCH__ >= 6
+
+#define __down_op(ptr,fail)                    \
+       ({                                      \
+       __asm__ __volatile__(                   \
+       "@ down_op\n"                           \
+"1:    ldrex   lr, [%0]\n"                     \
+"      sub     lr, lr, %1\n"                   \
+"      strex   ip, lr, [%0]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      teq     lr, #0\n"                       \
+"      movmi   ip, %0\n"                       \
+"      blmi    " #fail                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       })
+
+#define __down_op_ret(ptr,fail)                        \
+       ({                                      \
+               unsigned int ret;               \
+       __asm__ __volatile__(                   \
+       "@ down_op_ret\n"                       \
+"1:    ldrex   lr, [%1]\n"                     \
+"      sub     lr, lr, %2\n"                   \
+"      strex   ip, lr, [%1]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      teq     lr, #0\n"                       \
+"      movmi   ip, %1\n"                       \
+"      movpl   ip, #0\n"                       \
+"      blmi    " #fail "\n"                    \
+"      mov     %0, ip"                         \
+       : "=&r" (ret)                           \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       ret;                                    \
+       })
+
+#define __up_op(ptr,wake)                      \
+       ({                                      \
+       smp_mb();                               \
+       __asm__ __volatile__(                   \
+       "@ up_op\n"                             \
+"1:    ldrex   lr, [%0]\n"                     \
+"      add     lr, lr, %1\n"                   \
+"      strex   ip, lr, [%0]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      cmp     lr, #0\n"                       \
+"      movle   ip, %0\n"                       \
+"      blle    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       })
+
+/*
+ * The value 0x01000000 supports up to 128 processors and
+ * lots of processes.  BIAS must be chosen such that sub'ing
+ * BIAS once per CPU will result in the long remaining
+ * negative.
+ */
+#define RW_LOCK_BIAS      0x01000000
+#define RW_LOCK_BIAS_STR "0x01000000"
+
+#define __down_op_write(ptr,fail)              \
+       ({                                      \
+       __asm__ __volatile__(                   \
+       "@ down_op_write\n"                     \
+"1:    ldrex   lr, [%0]\n"                     \
+"      sub     lr, lr, %1\n"                   \
+"      strex   ip, lr, [%0]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      teq     lr, #0\n"                       \
+"      movne   ip, %0\n"                       \
+"      blne    " #fail                         \
+       :                                       \
+       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       })
+
+#define __up_op_write(ptr,wake)                        \
+       ({                                      \
+       smp_mb();                               \
+       __asm__ __volatile__(                   \
+       "@ up_op_write\n"                       \
+"1:    ldrex   lr, [%0]\n"                     \
+"      adds    lr, lr, %1\n"                   \
+"      strex   ip, lr, [%0]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      movcs   ip, %0\n"                       \
+"      blcs    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
+       : "ip", "lr", "cc");                    \
+       })
+
+#define __down_op_read(ptr,fail)               \
+       __down_op(ptr, fail)
+
+#define __up_op_read(ptr,wake)                 \
+       ({                                      \
+       smp_mb();                               \
+       __asm__ __volatile__(                   \
+       "@ up_op_read\n"                        \
+"1:    ldrex   lr, [%0]\n"                     \
+"      add     lr, lr, %1\n"                   \
+"      strex   ip, lr, [%0]\n"                 \
+"      teq     ip, #0\n"                       \
+"      bne     1b\n"                           \
+"      teq     lr, #0\n"                       \
+"      moveq   ip, %0\n"                       \
+"      bleq    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       })
+
+#else
+
+#define __down_op(ptr,fail)                    \
+       ({                                      \
+       __asm__ __volatile__(                   \
+       "@ down_op\n"                           \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%0]\n"                     \
+"      subs    lr, lr, %1\n"                   \
+"      str     lr, [%0]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      movmi   ip, %0\n"                       \
+"      blmi    " #fail                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       })
+
+#define __down_op_ret(ptr,fail)                        \
+       ({                                      \
+               unsigned int ret;               \
+       __asm__ __volatile__(                   \
+       "@ down_op_ret\n"                       \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%1]\n"                     \
+"      subs    lr, lr, %2\n"                   \
+"      str     lr, [%1]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      movmi   ip, %1\n"                       \
+"      movpl   ip, #0\n"                       \
+"      blmi    " #fail "\n"                    \
+"      mov     %0, ip"                         \
+       : "=&r" (ret)                           \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       ret;                                    \
+       })
+
+#define __up_op(ptr,wake)                      \
+       ({                                      \
+       smp_mb();                               \
+       __asm__ __volatile__(                   \
+       "@ up_op\n"                             \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%0]\n"                     \
+"      adds    lr, lr, %1\n"                   \
+"      str     lr, [%0]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      movle   ip, %0\n"                       \
+"      blle    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       })
+
+/*
+ * The value 0x01000000 supports up to 128 processors and
+ * lots of processes.  BIAS must be chosen such that sub'ing
+ * BIAS once per CPU will result in the long remaining
+ * negative.
+ */
+#define RW_LOCK_BIAS      0x01000000
+#define RW_LOCK_BIAS_STR "0x01000000"
+
+#define __down_op_write(ptr,fail)              \
+       ({                                      \
+       __asm__ __volatile__(                   \
+       "@ down_op_write\n"                     \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%0]\n"                     \
+"      subs    lr, lr, %1\n"                   \
+"      str     lr, [%0]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      movne   ip, %0\n"                       \
+"      blne    " #fail                         \
+       :                                       \
+       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       })
+
+#define __up_op_write(ptr,wake)                        \
+       ({                                      \
+       __asm__ __volatile__(                   \
+       "@ up_op_write\n"                       \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%0]\n"                     \
+"      adds    lr, lr, %1\n"                   \
+"      str     lr, [%0]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      movcs   ip, %0\n"                       \
+"      blcs    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
+       : "ip", "lr", "cc");                    \
+       smp_mb();                               \
+       })
+
+#define __down_op_read(ptr,fail)               \
+       __down_op(ptr, fail)
+
+#define __up_op_read(ptr,wake)                 \
+       ({                                      \
+       smp_mb();                               \
+       __asm__ __volatile__(                   \
+       "@ up_op_read\n"                        \
+"      mrs     ip, cpsr\n"                     \
+"      orr     lr, ip, #128\n"                 \
+"      msr     cpsr_c, lr\n"                   \
+"      ldr     lr, [%0]\n"                     \
+"      adds    lr, lr, %1\n"                   \
+"      str     lr, [%0]\n"                     \
+"      msr     cpsr_c, ip\n"                   \
+"      moveq   ip, %0\n"                       \
+"      bleq    " #wake                         \
+       :                                       \
+       : "r" (ptr), "I" (1)                    \
+       : "ip", "lr", "cc");                    \
+       })
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
new file mode 100644 (file)
index 0000000..c59842d
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  arch/arm/include/asm/mach/arch.h
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * 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.
+ */
+
+#ifndef __ASSEMBLY__
+
+struct tag;
+struct meminfo;
+struct sys_timer;
+
+struct machine_desc {
+       /*
+        * Note! The first four elements are used
+        * by assembler code in head.S, head-common.S
+        */
+       unsigned int            nr;             /* architecture number  */
+       unsigned int            phys_io;        /* start of physical io */
+       unsigned int            io_pg_offst;    /* byte offset for io 
+                                                * page tabe entry      */
+
+       const char              *name;          /* architecture name    */
+       unsigned long           boot_params;    /* tagged list          */
+
+       unsigned int            video_start;    /* start of video RAM   */
+       unsigned int            video_end;      /* end of video RAM     */
+
+       unsigned int            reserve_lp0 :1; /* never has lp0        */
+       unsigned int            reserve_lp1 :1; /* never has lp1        */
+       unsigned int            reserve_lp2 :1; /* never has lp2        */
+       unsigned int            soft_reboot :1; /* soft reboot          */
+       void                    (*fixup)(struct machine_desc *,
+                                        struct tag *, char **,
+                                        struct meminfo *);
+       void                    (*map_io)(void);/* IO mapping function  */
+       void                    (*init_irq)(void);
+       struct sys_timer        *timer;         /* system tick timer    */
+       void                    (*init_machine)(void);
+};
+
+/*
+ * Set of macros to define architecture features.  This is built into
+ * a table by the linker.
+ */
+#define MACHINE_START(_type,_name)                     \
+static const struct machine_desc __mach_desc_##_type   \
+ __used                                                        \
+ __attribute__((__section__(".arch.info.init"))) = {   \
+       .nr             = MACH_TYPE_##_type,            \
+       .name           = _name,
+
+#define MACHINE_END                            \
+};
+
+#endif
diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h
new file mode 100644 (file)
index 0000000..fc7278e
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *  arch/arm/include/asm/mach/dma.h
+ *
+ *  Copyright (C) 1998-2000 Russell King
+ *
+ * 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.
+ *
+ *  This header file describes the interface between the generic DMA handler
+ *  (dma.c) and the architecture-specific DMA backends (dma-*.c)
+ */
+
+struct dma_struct;
+typedef struct dma_struct dma_t;
+
+struct dma_ops {
+       int     (*request)(dmach_t, dma_t *);           /* optional */
+       void    (*free)(dmach_t, dma_t *);              /* optional */
+       void    (*enable)(dmach_t, dma_t *);            /* mandatory */
+       void    (*disable)(dmach_t, dma_t *);           /* mandatory */
+       int     (*residue)(dmach_t, dma_t *);           /* optional */
+       int     (*setspeed)(dmach_t, dma_t *, int);     /* optional */
+       char    *type;
+};
+
+struct dma_struct {
+       void            *addr;          /* single DMA address           */
+       unsigned long   count;          /* single DMA size              */
+       struct scatterlist buf;         /* single DMA                   */
+       int             sgcount;        /* number of DMA SG             */
+       struct scatterlist *sg;         /* DMA Scatter-Gather List      */
+
+       unsigned int    active:1;       /* Transfer active              */
+       unsigned int    invalid:1;      /* Address/Count changed        */
+
+       dmamode_t       dma_mode;       /* DMA mode                     */
+       int             speed;          /* DMA speed                    */
+
+       unsigned int    lock;           /* Device is allocated          */
+       const char      *device_id;     /* Device name                  */
+
+       unsigned int    dma_base;       /* Controller base address      */
+       int             dma_irq;        /* Controller IRQ               */
+       struct scatterlist cur_sg;      /* Current controller buffer    */
+       unsigned int    state;
+
+       struct dma_ops  *d_ops;
+};
+
+/* Prototype: void arch_dma_init(dma)
+ * Purpose  : Initialise architecture specific DMA
+ * Params   : dma - pointer to array of DMA structures
+ */
+extern void arch_dma_init(dma_t *dma);
+
+extern void isa_init_dma(dma_t *dma);
diff --git a/arch/arm/include/asm/mach/flash.h b/arch/arm/include/asm/mach/flash.h
new file mode 100644 (file)
index 0000000..4ca69fe
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *  arch/arm/include/asm/mach/flash.h
+ *
+ *  Copyright (C) 2003 Russell King, All Rights Reserved.
+ *
+ * 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.
+ */
+#ifndef ASMARM_MACH_FLASH_H
+#define ASMARM_MACH_FLASH_H
+
+struct mtd_partition;
+struct mtd_info;
+
+/*
+ * map_name:   the map probe function name
+ * name:       flash device name (eg, as used with mtdparts=)
+ * width:      width of mapped device
+ * init:       method called at driver/device initialisation
+ * exit:       method called at driver/device removal
+ * set_vpp:    method called to enable or disable VPP
+ * mmcontrol:  method called to enable or disable Sync. Burst Read in OneNAND
+ * parts:      optional array of mtd_partitions for static partitioning
+ * nr_parts:   number of mtd_partitions for static partitoning
+ */
+struct flash_platform_data {
+       const char      *map_name;
+       const char      *name;
+       unsigned int    width;
+       int             (*init)(void);
+       void            (*exit)(void);
+       void            (*set_vpp)(int on);
+       void            (*mmcontrol)(struct mtd_info *mtd, int sync_read);
+       struct mtd_partition *parts;
+       unsigned int    nr_parts;
+};
+
+#endif
diff --git a/arch/arm/include/asm/mach/irda.h b/arch/arm/include/asm/mach/irda.h
new file mode 100644 (file)
index 0000000..38f77b5
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  arch/arm/include/asm/mach/irda.h
+ *
+ *  Copyright (C) 2004 Russell King.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_MACH_IRDA_H
+#define __ASM_ARM_MACH_IRDA_H
+
+struct irda_platform_data {
+       int (*startup)(struct device *);
+       void (*shutdown)(struct device *);
+       int (*set_power)(struct device *, unsigned int state);
+       void (*set_speed)(struct device *, unsigned int speed);
+};
+
+#endif
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
new file mode 100644 (file)
index 0000000..c57b52c
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  arch/arm/include/asm/mach/irq.h
+ *
+ *  Copyright (C) 1995-2000 Russell King.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_MACH_IRQ_H
+#define __ASM_ARM_MACH_IRQ_H
+
+#include <linux/irq.h>
+
+struct seq_file;
+
+/*
+ * This is internal.  Do not use it.
+ */
+extern void (*init_arch_irq)(void);
+extern void init_FIQ(void);
+extern int show_fiq_list(struct seq_file *, void *);
+
+/*
+ * Obsolete inline function for calling irq descriptor handlers.
+ */
+static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc)
+{
+       desc->handle_irq(irq, desc);
+}
+
+void set_irq_flags(unsigned int irq, unsigned int flags);
+
+#define IRQF_VALID     (1 << 0)
+#define IRQF_PROBE     (1 << 1)
+#define IRQF_NOAUTOEN  (1 << 2)
+
+/*
+ * This is for easy migration, but should be changed in the source
+ */
+#define do_bad_IRQ(irq,desc)                           \
+do {                                                   \
+       spin_lock(&desc->lock);                         \
+       handle_bad_irq(irq, desc);                      \
+       spin_unlock(&desc->lock);                       \
+} while(0)
+
+extern unsigned long irq_err_count;
+static inline void ack_bad_irq(int irq)
+{
+       irq_err_count++;
+}
+
+#endif
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
new file mode 100644 (file)
index 0000000..06f583b
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  arch/arm/include/asm/map.h
+ *
+ *  Copyright (C) 1999-2000 Russell King
+ *
+ * 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.
+ *
+ *  Page table mapping constructs and function prototypes
+ */
+#include <asm/io.h>
+
+struct map_desc {
+       unsigned long virtual;
+       unsigned long pfn;
+       unsigned long length;
+       unsigned int type;
+};
+
+/* types 0-3 are defined in asm/io.h */
+#define MT_CACHECLEAN          4
+#define MT_MINICLEAN           5
+#define MT_LOW_VECTORS         6
+#define MT_HIGH_VECTORS                7
+#define MT_MEMORY              8
+#define MT_ROM                 9
+
+#define MT_NONSHARED_DEVICE    MT_DEVICE_NONSHARED
+#define MT_IXP2000_DEVICE      MT_DEVICE_IXP2000
+
+#ifdef CONFIG_MMU
+extern void iotable_init(struct map_desc *, int);
+#else
+#define iotable_init(map,num)  do { } while (0)
+#endif
diff --git a/arch/arm/include/asm/mach/mmc.h b/arch/arm/include/asm/mach/mmc.h
new file mode 100644 (file)
index 0000000..4da332b
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ *  arch/arm/include/asm/mach/mmc.h
+ */
+#ifndef ASMARM_MACH_MMC_H
+#define ASMARM_MACH_MMC_H
+
+#include <linux/mmc/host.h>
+
+struct mmc_platform_data {
+       unsigned int ocr_mask;                  /* available voltages */
+       u32 (*translate_vdd)(struct device *, unsigned int);
+       unsigned int (*status)(struct device *);
+};
+
+#endif
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
new file mode 100644 (file)
index 0000000..32da1ae
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ *  arch/arm/include/asm/mach/pci.h
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * 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.
+ */
+
+struct pci_sys_data;
+struct pci_bus;
+
+struct hw_pci {
+       struct list_head buses;
+       int             nr_controllers;
+       int             (*setup)(int nr, struct pci_sys_data *);
+       struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
+       void            (*preinit)(void);
+       void            (*postinit)(void);
+       u8              (*swizzle)(struct pci_dev *dev, u8 *pin);
+       int             (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+};
+
+/*
+ * Per-controller structure
+ */
+struct pci_sys_data {
+       struct list_head node;
+       int             busnr;          /* primary bus number                   */
+       u64             mem_offset;     /* bus->cpu memory mapping offset       */
+       unsigned long   io_offset;      /* bus->cpu IO mapping offset           */
+       struct pci_bus  *bus;           /* PCI bus                              */
+       struct resource *resource[3];   /* Primary PCI bus resources            */
+                                       /* Bridge swizzling                     */
+       u8              (*swizzle)(struct pci_dev *, u8 *);
+                                       /* IRQ mapping                          */
+       int             (*map_irq)(struct pci_dev *, u8, u8);
+       struct hw_pci   *hw;
+};
+
+/*
+ * This is the standard PCI-PCI bridge swizzling algorithm.
+ */
+u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp);
+
+/*
+ * Call this with your hw_pci struct to initialise the PCI system.
+ */
+void pci_common_init(struct hw_pci *);
+
+/*
+ * PCI controllers
+ */
+extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
+extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
+extern void iop3xx_pci_preinit(void);
+extern void iop3xx_pci_preinit_cond(void);
+
+extern int dc21285_setup(int nr, struct pci_sys_data *);
+extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
+extern void dc21285_preinit(void);
+extern void dc21285_postinit(void);
+
+extern int via82c505_setup(int nr, struct pci_sys_data *);
+extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
+extern void via82c505_init(void *sysdata);
+
+extern int pci_v3_setup(int nr, struct pci_sys_data *);
+extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
+extern void pci_v3_preinit(void);
+extern void pci_v3_postinit(void);
diff --git a/arch/arm/include/asm/mach/serial_at91.h b/arch/arm/include/asm/mach/serial_at91.h
new file mode 100644 (file)
index 0000000..ea6d063
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  arch/arm/include/asm/mach/serial_at91.h
+ *
+ *  Based on serial_sa1100.h  by Nicolas Pitre
+ *
+ *  Copyright (C) 2002 ATMEL Rousset
+ *
+ *  Low level machine dependent UART functions.
+ */
+
+struct uart_port;
+
+/*
+ * This is a temporary structure for registering these
+ * functions; it is intended to be discarded after boot.
+ */
+struct atmel_port_fns {
+       void    (*set_mctrl)(struct uart_port *, u_int);
+       u_int   (*get_mctrl)(struct uart_port *);
+       void    (*enable_ms)(struct uart_port *);
+       void    (*pm)(struct uart_port *, u_int, u_int);
+       int     (*set_wake)(struct uart_port *, u_int);
+       int     (*open)(struct uart_port *);
+       void    (*close)(struct uart_port *);
+};
+
+#if defined(CONFIG_SERIAL_ATMEL)
+void atmel_register_uart_fns(struct atmel_port_fns *fns);
+#else
+#define atmel_register_uart_fns(fns) do { } while (0)
+#endif
+
+
diff --git a/arch/arm/include/asm/mach/serial_sa1100.h b/arch/arm/include/asm/mach/serial_sa1100.h
new file mode 100644 (file)
index 0000000..d09064b
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  arch/arm/include/asm/mach/serial_sa1100.h
+ *
+ *  Author: Nicolas Pitre
+ *
+ * Moved and changed lots, Russell King
+ *
+ * Low level machine dependent UART functions.
+ */
+
+struct uart_port;
+struct uart_info;
+
+/*
+ * This is a temporary structure for registering these
+ * functions; it is intended to be discarded after boot.
+ */
+struct sa1100_port_fns {
+       void    (*set_mctrl)(struct uart_port *, u_int);
+       u_int   (*get_mctrl)(struct uart_port *);
+       void    (*pm)(struct uart_port *, u_int, u_int);
+       int     (*set_wake)(struct uart_port *, u_int);
+};
+
+#ifdef CONFIG_SERIAL_SA1100
+void sa1100_register_uart_fns(struct sa1100_port_fns *fns);
+void sa1100_register_uart(int idx, int port);
+#else
+#define sa1100_register_uart_fns(fns) do { } while (0)
+#define sa1100_register_uart(idx,port) do { } while (0)
+#endif
diff --git a/arch/arm/include/asm/mach/sharpsl_param.h b/arch/arm/include/asm/mach/sharpsl_param.h
new file mode 100644 (file)
index 0000000..7a24ecf
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Hardware parameter area specific to Sharp SL series devices
+ *
+ * Copyright (c) 2005 Richard Purdie
+ *
+ * Based on Sharp's 2.4 kernel patches
+ *
+ * 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.
+ *
+ */
+
+struct sharpsl_param_info {
+  unsigned int comadj_keyword;
+  unsigned int comadj;
+
+  unsigned int uuid_keyword;
+  unsigned char uuid[16];
+
+  unsigned int touch_keyword;
+  unsigned int touch_xp;
+  unsigned int touch_yp;
+  unsigned int touch_xd;
+  unsigned int touch_yd;
+
+  unsigned int adadj_keyword;
+  unsigned int adadj;
+
+  unsigned int phad_keyword;
+  unsigned int phadadj;
+} __attribute__((packed));
+
+
+extern struct sharpsl_param_info sharpsl_param;
+extern void sharpsl_save_param(void);
+
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
new file mode 100644 (file)
index 0000000..b2cc1fc
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * arch/arm/include/asm/mach/time.h
+ *
+ * Copyright (C) 2004 MontaVista Software, Inc.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_MACH_TIME_H
+#define __ASM_ARM_MACH_TIME_H
+
+#include <linux/sysdev.h>
+
+/*
+ * This is our kernel timer structure.
+ *
+ * - init
+ *   Initialise the kernels jiffy timer source, claim interrupt
+ *   using setup_irq.  This is called early on during initialisation
+ *   while interrupts are still disabled on the local CPU.
+ * - suspend
+ *   Suspend the kernel jiffy timer source, if necessary.  This
+ *   is called with interrupts disabled, after all normal devices
+ *   have been suspended.  If no action is required, set this to
+ *   NULL.
+ * - resume
+ *   Resume the kernel jiffy timer source, if necessary.  This
+ *   is called with interrupts disabled before any normal devices
+ *   are resumed.  If no action is required, set this to NULL.
+ * - offset
+ *   Return the timer offset in microseconds since the last timer
+ *   interrupt.  Note: this must take account of any unprocessed
+ *   timer interrupt which may be pending.
+ */
+struct sys_timer {
+       struct sys_device       dev;
+       void                    (*init)(void);
+       void                    (*suspend)(void);
+       void                    (*resume)(void);
+#ifndef CONFIG_GENERIC_TIME
+       unsigned long           (*offset)(void);
+#endif
+};
+
+extern struct sys_timer *system_timer;
+extern void timer_tick(void);
+
+/*
+ * Kernel time keeping support.
+ */
+struct timespec;
+extern int (*set_rtc)(void);
+extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
+extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);
+
+#endif
diff --git a/arch/arm/include/asm/mach/udc_pxa2xx.h b/arch/arm/include/asm/mach/udc_pxa2xx.h
new file mode 100644 (file)
index 0000000..270902c
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/include/asm/mach/udc_pxa2xx.h
+ *
+ * This supports machine-specific differences in how the PXA2xx
+ * USB Device Controller (UDC) is wired.
+ *
+ * It is set in linux/arch/arm/mach-pxa/<machine>.c or in
+ * linux/arch/mach-ixp4xx/<machine>.c and used in
+ * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
+ */
+
+struct pxa2xx_udc_mach_info {
+        int  (*udc_is_connected)(void);                /* do we see host? */
+        void (*udc_command)(int cmd);
+#define        PXA2XX_UDC_CMD_CONNECT          0       /* let host see us */
+#define        PXA2XX_UDC_CMD_DISCONNECT       1       /* so host won't see us */
+
+       /* Boards following the design guidelines in the developer's manual,
+        * with on-chip GPIOs not Lubbock's weird hardware, can have a sane
+        * VBUS IRQ and omit the methods above.  Store the GPIO number
+        * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
+        * Note that sometimes the signals go through inverters...
+        */
+       bool    gpio_vbus_inverted;
+       u16     gpio_vbus;                      /* high == vbus present */
+       bool    gpio_pullup_inverted;
+       u16     gpio_pullup;                    /* high == pullup activated */
+};
+
diff --git a/arch/arm/include/asm/mc146818rtc.h b/arch/arm/include/asm/mc146818rtc.h
new file mode 100644 (file)
index 0000000..7b81e0c
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
+
+#include <asm/arch/irqs.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_MC146818RTC_H */
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
new file mode 100644 (file)
index 0000000..9206922
--- /dev/null
@@ -0,0 +1,334 @@
+/*
+ *  arch/arm/include/asm/memory.h
+ *
+ *  Copyright (C) 2000-2002 Russell King
+ *  modification for nommu, Hyok S. Choi, 2004
+ *
+ * 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.
+ *
+ *  Note: this file should not be included by non-asm/.h files
+ */
+#ifndef __ASM_ARM_MEMORY_H
+#define __ASM_ARM_MEMORY_H
+
+/*
+ * Allow for constants defined here to be used from assembly code
+ * by prepending the UL suffix only with actual C code compilation.
+ */
+#ifndef __ASSEMBLY__
+#define UL(x) (x##UL)
+#else
+#define UL(x) (x)
+#endif
+
+#include <linux/compiler.h>
+#include <asm/arch/memory.h>
+#include <asm/sizes.h>
+
+#ifdef CONFIG_MMU
+
+#ifndef TASK_SIZE
+/*
+ * TASK_SIZE - the maximum size of a user space task.
+ * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
+ */
+#define TASK_SIZE              UL(0xbf000000)
+#define TASK_UNMAPPED_BASE     UL(0x40000000)
+#endif
+
+/*
+ * The maximum size of a 26-bit user space task.
+ */
+#define TASK_SIZE_26           UL(0x04000000)
+
+/*
+ * Page offset: 3GB
+ */
+#ifndef PAGE_OFFSET
+#define PAGE_OFFSET            UL(0xc0000000)
+#endif
+
+/*
+ * The module space lives between the addresses given by TASK_SIZE
+ * and PAGE_OFFSET - it must be within 32MB of the kernel text.
+ */
+#define MODULE_END             (PAGE_OFFSET)
+#define MODULE_START           (MODULE_END - 16*1048576)
+
+#if TASK_SIZE > MODULE_START
+#error Top of user space clashes with start of module space
+#endif
+
+/*
+ * The XIP kernel gets mapped at the bottom of the module vm area.
+ * Since we use sections to map it, this macro replaces the physical address
+ * with its virtual address while keeping offset from the base section.
+ */
+#define XIP_VIRT_ADDR(physaddr)  (MODULE_START + ((physaddr) & 0x000fffff))
+
+/*
+ * Allow 16MB-aligned ioremap pages
+ */
+#define IOREMAP_MAX_ORDER      24
+
+#else /* CONFIG_MMU */
+
+/*
+ * The limitation of user task size can grow up to the end of free ram region.
+ * It is difficult to define and perhaps will never meet the original meaning
+ * of this define that was meant to.
+ * Fortunately, there is no reference for this in noMMU mode, for now.
+ */
+#ifndef TASK_SIZE
+#define TASK_SIZE              (CONFIG_DRAM_SIZE)
+#endif
+
+#ifndef TASK_UNMAPPED_BASE
+#define TASK_UNMAPPED_BASE     UL(0x00000000)
+#endif
+
+#ifndef PHYS_OFFSET
+#define PHYS_OFFSET            (CONFIG_DRAM_BASE)
+#endif
+
+#ifndef END_MEM
+#define END_MEM                (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
+#endif
+
+#ifndef PAGE_OFFSET
+#define PAGE_OFFSET            (PHYS_OFFSET)
+#endif
+
+/*
+ * The module can be at any place in ram in nommu mode.
+ */
+#define MODULE_END             (END_MEM)
+#define MODULE_START           (PHYS_OFFSET)
+
+#endif /* !CONFIG_MMU */
+
+/*
+ * Size of DMA-consistent memory region.  Must be multiple of 2M,
+ * between 2MB and 14MB inclusive.
+ */
+#ifndef CONSISTENT_DMA_SIZE
+#define CONSISTENT_DMA_SIZE SZ_2M
+#endif
+
+/*
+ * Physical vs virtual RAM address space conversion.  These are
+ * private definitions which should NOT be used outside memory.h
+ * files.  Use virt_to_phys/phys_to_virt/__pa/__va instead.
+ */
+#ifndef __virt_to_phys
+#define __virt_to_phys(x)      ((x) - PAGE_OFFSET + PHYS_OFFSET)
+#define __phys_to_virt(x)      ((x) - PHYS_OFFSET + PAGE_OFFSET)
+#endif
+
+/*
+ * Convert a physical address to a Page Frame Number and back
+ */
+#define        __phys_to_pfn(paddr)    ((paddr) >> PAGE_SHIFT)
+#define        __pfn_to_phys(pfn)      ((pfn) << PAGE_SHIFT)
+
+#ifndef __ASSEMBLY__
+
+/*
+ * The DMA mask corresponding to the maximum bus address allocatable
+ * using GFP_DMA.  The default here places no restriction on DMA
+ * allocations.  This must be the smallest DMA mask in the system,
+ * so a successful GFP_DMA allocation will always satisfy this.
+ */
+#ifndef ISA_DMA_THRESHOLD
+#define ISA_DMA_THRESHOLD      (0xffffffffULL)
+#endif
+
+#ifndef arch_adjust_zones
+#define arch_adjust_zones(node,size,holes) do { } while (0)
+#endif
+
+/*
+ * PFNs are used to describe any physical page; this means
+ * PFN 0 == physical address 0.
+ *
+ * This is the PFN of the first RAM page in the kernel
+ * direct-mapped view.  We assume this is the first page
+ * of RAM in the mem_map as well.
+ */
+#define PHYS_PFN_OFFSET        (PHYS_OFFSET >> PAGE_SHIFT)
+
+/*
+ * These are *only* valid on the kernel direct mapped RAM memory.
+ * Note: Drivers should NOT use these.  They are the wrong
+ * translation for translating DMA addresses.  Use the driver
+ * DMA support - see dma-mapping.h.
+ */
+static inline unsigned long virt_to_phys(void *x)
+{
+       return __virt_to_phys((unsigned long)(x));
+}
+
+static inline void *phys_to_virt(unsigned long x)
+{
+       return (void *)(__phys_to_virt((unsigned long)(x)));
+}
+
+/*
+ * Drivers should NOT use these either.
+ */
+#define __pa(x)                        __virt_to_phys((unsigned long)(x))
+#define __va(x)                        ((void *)__phys_to_virt((unsigned long)(x)))
+#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
+
+/*
+ * Virtual <-> DMA view memory address translations
+ * Again, these are *only* valid on the kernel direct mapped RAM
+ * memory.  Use of these is *deprecated* (and that doesn't mean
+ * use the __ prefixed forms instead.)  See dma-mapping.h.
+ */
+static inline __deprecated unsigned long virt_to_bus(void *x)
+{
+       return __virt_to_bus((unsigned long)x);
+}
+
+static inline __deprecated void *bus_to_virt(unsigned long x)
+{
+       return (void *)__bus_to_virt(x);
+}
+
+/*
+ * Conversion between a struct page and a physical address.
+ *
+ * Note: when converting an unknown physical address to a
+ * struct page, the resulting pointer must be validated
+ * using VALID_PAGE().  It must return an invalid struct page
+ * for any physical address not corresponding to a system
+ * RAM address.
+ *
+ *  page_to_pfn(page)  convert a struct page * to a PFN number
+ *  pfn_to_page(pfn)   convert a _valid_ PFN number to struct page *
+ *  pfn_valid(pfn)     indicates whether a PFN number is valid
+ *
+ *  virt_to_page(k)    convert a _valid_ virtual address to struct page *
+ *  virt_addr_valid(k) indicates whether a virtual address is valid
+ */
+#ifndef CONFIG_DISCONTIGMEM
+
+#define ARCH_PFN_OFFSET                PHYS_PFN_OFFSET
+
+#ifndef CONFIG_SPARSEMEM
+#define pfn_valid(pfn)         ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
+#endif
+
+#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
+
+#define PHYS_TO_NID(addr)      (0)
+
+#else /* CONFIG_DISCONTIGMEM */
+
+/*
+ * This is more complex.  We have a set of mem_map arrays spread
+ * around in memory.
+ */
+#include <linux/numa.h>
+
+#define arch_pfn_to_nid(pfn)   PFN_TO_NID(pfn)
+#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
+
+#define pfn_valid(pfn)                                         \
+       ({                                                      \
+               unsigned int nid = PFN_TO_NID(pfn);             \
+               int valid = nid < MAX_NUMNODES;                 \
+               if (valid) {                                    \
+                       pg_data_t *node = NODE_DATA(nid);       \
+                       valid = (pfn - node->node_start_pfn) <  \
+                               node->node_spanned_pages;       \
+               }                                               \
+               valid;                                          \
+       })
+
+#define virt_to_page(kaddr)                                    \
+       (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
+
+#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
+
+/*
+ * Common discontigmem stuff.
+ *  PHYS_TO_NID is used by the ARM kernel/setup.c
+ */
+#define PHYS_TO_NID(addr)      PFN_TO_NID((addr) >> PAGE_SHIFT)
+
+/*
+ * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
+ * and returns the mem_map of that node.
+ */
+#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
+
+/*
+ * Given a page frame number, find the owning node of the memory
+ * and returns the mem_map of that node.
+ */
+#define PFN_TO_MAPBASE(pfn)    NODE_MEM_MAP(PFN_TO_NID(pfn))
+
+#ifdef NODE_MEM_SIZE_BITS
+#define NODE_MEM_SIZE_MASK     ((1 << NODE_MEM_SIZE_BITS) - 1)
+
+/*
+ * Given a kernel address, find the home node of the underlying memory.
+ */
+#define KVADDR_TO_NID(addr) \
+       (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS)
+
+/*
+ * Given a page frame number, convert it to a node id.
+ */
+#define PFN_TO_NID(pfn) \
+       (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT))
+
+/*
+ * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
+ * and returns the index corresponding to the appropriate page in the
+ * node's mem_map.
+ */
+#define LOCAL_MAP_NR(addr) \
+       (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT)
+
+#endif /* NODE_MEM_SIZE_BITS */
+
+#endif /* !CONFIG_DISCONTIGMEM */
+
+/*
+ * For BIO.  "will die".  Kill me when bio_to_phys() and bvec_to_phys() die.
+ */
+#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.
+ */
+#ifndef arch_is_coherent
+#define arch_is_coherent()             0
+#endif
+
+#endif
+
+#include <asm-generic/memory_model.h>
+
+#endif
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
new file mode 100644 (file)
index 0000000..54570d2
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __ARM_MMAN_H__
+#define __ARM_MMAN_H__
+
+#include <asm-generic/mman.h>
+
+#define MAP_GROWSDOWN  0x0100          /* stack-like segment */
+#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
+#define MAP_LOCKED     0x2000          /* pages are locked */
+#define MAP_NORESERVE  0x4000          /* don't check for reservations */
+#define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
+#define MAP_NONBLOCK   0x10000         /* do not block on IO */
+
+#define MCL_CURRENT    1               /* lock all current mappings */
+#define MCL_FUTURE     2               /* lock all future mappings */
+
+#endif /* __ARM_MMAN_H__ */
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..53099d4
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __ARM_MMU_H
+#define __ARM_MMU_H
+
+#ifdef CONFIG_MMU
+
+typedef struct {
+#ifdef CONFIG_CPU_HAS_ASID
+       unsigned int id;
+#endif
+       unsigned int kvm_seq;
+} mm_context_t;
+
+#ifdef CONFIG_CPU_HAS_ASID
+#define ASID(mm)       ((mm)->context.id & 255)
+#else
+#define ASID(mm)       (0)
+#endif
+
+#else
+
+/*
+ * From nommu.h:
+ *  Copyright (C) 2002, David McCullough <davidm@snapgear.com>
+ *  modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
+ */
+typedef struct {
+       struct vm_list_struct   *vmlist;
+       unsigned long           end_brk;
+} mm_context_t;
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h
new file mode 100644 (file)
index 0000000..a301e44
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ *  arch/arm/include/asm/mmu_context.h
+ *
+ *  Copyright (C) 1996 Russell King.
+ *
+ * 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.
+ *
+ *  Changelog:
+ *   27-06-1996        RMK     Created
+ */
+#ifndef __ASM_ARM_MMU_CONTEXT_H
+#define __ASM_ARM_MMU_CONTEXT_H
+
+#include <linux/compiler.h>
+#include <asm/cacheflush.h>
+#include <asm/proc-fns.h>
+#include <asm-generic/mm_hooks.h>
+
+void __check_kvm_seq(struct mm_struct *mm);
+
+#ifdef CONFIG_CPU_HAS_ASID
+
+/*
+ * On ARMv6, we have the following structure in the Context ID:
+ *
+ * 31                         7          0
+ * +-------------------------+-----------+
+ * |      process ID         |   ASID    |
+ * +-------------------------+-----------+
+ * |              context ID             |
+ * +-------------------------------------+
+ *
+ * The ASID is used to tag entries in the CPU caches and TLBs.
+ * The context ID is used by debuggers and trace logic, and
+ * should be unique within all running processes.
+ */
+#define ASID_BITS              8
+#define ASID_MASK              ((~0) << ASID_BITS)
+#define ASID_FIRST_VERSION     (1 << ASID_BITS)
+
+extern unsigned int cpu_last_asid;
+
+void __init_new_context(struct task_struct *tsk, struct mm_struct *mm);
+void __new_context(struct mm_struct *mm);
+
+static inline void check_context(struct mm_struct *mm)
+{
+       if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
+               __new_context(mm);
+
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
+}
+
+#define init_new_context(tsk,mm)       (__init_new_context(tsk,mm),0)
+
+#else
+
+static inline void check_context(struct mm_struct *mm)
+{
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
+}
+
+#define init_new_context(tsk,mm)       0
+
+#endif
+
+#define destroy_context(mm)            do { } while(0)
+
+/*
+ * This is called when "tsk" is about to enter lazy TLB mode.
+ *
+ * mm:  describes the currently active mm context
+ * tsk: task which is entering lazy tlb
+ * cpu: cpu number which is entering lazy tlb
+ *
+ * tsk->mm will be NULL
+ */
+static inline void
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
+{
+}
+
+/*
+ * This is the actual mm switch as far as the scheduler
+ * is concerned.  No registers are touched.  We avoid
+ * calling the CPU specific function when the mm hasn't
+ * actually changed.
+ */
+static inline void
+switch_mm(struct mm_struct *prev, struct mm_struct *next,
+         struct task_struct *tsk)
+{
+#ifdef CONFIG_MMU
+       unsigned int cpu = smp_processor_id();
+
+#ifdef CONFIG_SMP
+       /* check for possible thread migration */
+       if (!cpus_empty(next->cpu_vm_mask) && !cpu_isset(cpu, next->cpu_vm_mask))
+               __flush_icache_all();
+#endif
+       if (!cpu_test_and_set(cpu, next->cpu_vm_mask) || prev != next) {
+               check_context(next);
+               cpu_switch_mm(next->pgd, next);
+               if (cache_is_vivt())
+                       cpu_clear(cpu, prev->cpu_vm_mask);
+       }
+#endif
+}
+
+#define deactivate_mm(tsk,mm)  do { } while (0)
+#define activate_mm(prev,next) switch_mm(prev, next, NULL)
+
+#endif
diff --git a/arch/arm/include/asm/mmzone.h b/arch/arm/include/asm/mmzone.h
new file mode 100644 (file)
index 0000000..f2fbb50
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *  arch/arm/include/asm/mmzone.h
+ *
+ *  1999-12-29 Nicolas Pitre           Created
+ *
+ * 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.
+ */
+#ifndef __ASM_MMZONE_H
+#define __ASM_MMZONE_H
+
+/*
+ * Currently defined in arch/arm/mm/discontig.c
+ */
+extern pg_data_t discontig_node_data[];
+
+/*
+ * Return a pointer to the node data for node n.
+ */
+#define NODE_DATA(nid)         (&discontig_node_data[nid])
+
+/*
+ * NODE_MEM_MAP gives the kaddr for the mem_map of the node.
+ */
+#define NODE_MEM_MAP(nid)      (NODE_DATA(nid)->node_mem_map)
+
+#include <asm/arch/memory.h>
+
+#endif
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
new file mode 100644 (file)
index 0000000..24b168d
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _ASM_ARM_MODULE_H
+#define _ASM_ARM_MODULE_H
+
+struct mod_arch_specific
+{
+       int foo;
+};
+
+#define Elf_Shdr       Elf32_Shdr
+#define Elf_Sym                Elf32_Sym
+#define Elf_Ehdr       Elf32_Ehdr
+
+/*
+ * Include the ARM architecture version.
+ */
+#define MODULE_ARCH_VERMAGIC   "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
+
+#endif /* _ASM_ARM_MODULE_H */
diff --git a/arch/arm/include/asm/msgbuf.h b/arch/arm/include/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..33b35b9
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _ASMARM_MSGBUF_H
+#define _ASMARM_MSGBUF_H
+
+/* 
+ * The msqid64_ds structure for arm architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct msqid64_ds {
+       struct ipc64_perm msg_perm;
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       unsigned long   __unused1;
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       unsigned long   __unused2;
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned long   __unused3;
+       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  __unused4;
+       unsigned long  __unused5;
+};
+
+#endif /* _ASMARM_MSGBUF_H */
diff --git a/arch/arm/include/asm/mtd-xip.h b/arch/arm/include/asm/mtd-xip.h
new file mode 100644 (file)
index 0000000..9eb127c
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * MTD primitives for XIP support. Architecture specific functions
+ *
+ * Do not include this file directly. It's included from linux/mtd/xip.h
+ * 
+ * Author:     Nicolas Pitre
+ * Created:    Nov 2, 2004
+ * Copyright:  (C) 2004 MontaVista Software, Inc.
+ *
+ * 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__
+#define __ARM_MTD_XIP_H__
+
+#include <asm/hardware.h>
+#include <asm/arch/mtd-xip.h>
+
+/* fill instruction prefetch */
+#define xip_iprefetch()        do { asm volatile (".rep 8; nop; .endr"); } while (0)
+
+#endif /* __ARM_MTD_XIP_H__ */
diff --git a/arch/arm/include/asm/mutex.h b/arch/arm/include/asm/mutex.h
new file mode 100644 (file)
index 0000000..93226cf
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * arch/arm/include/asm/mutex.h
+ *
+ * ARM optimized mutex locking primitives
+ *
+ * Please look into asm-generic/mutex-xchg.h for a formal definition.
+ */
+#ifndef _ASM_MUTEX_H
+#define _ASM_MUTEX_H
+
+#if __LINUX_ARM_ARCH__ < 6
+/* On pre-ARMv6 hardware the swp based implementation is the most efficient. */
+# include <asm-generic/mutex-xchg.h>
+#else
+
+/*
+ * Attempting to lock a mutex on ARMv6+ can be done with a bastardized
+ * atomic decrement (it is not a reliable atomic decrement but it satisfies
+ * the defined semantics for our purpose, while being smaller and faster
+ * than a real atomic decrement or atomic swap.  The idea is to attempt
+ * decrementing the lock value only once.  If once decremented it isn't zero,
+ * or if its store-back fails due to a dispute on the exclusive store, we
+ * simply bail out immediately through the slow path where the lock will be
+ * reattempted until it succeeds.
+ */
+static inline void
+__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
+{
+       int __ex_flag, __res;
+
+       __asm__ (
+
+               "ldrex  %0, [%2]        \n\t"
+               "sub    %0, %0, #1      \n\t"
+               "strex  %1, %0, [%2]    "
+
+               : "=&r" (__res), "=&r" (__ex_flag)
+               : "r" (&(count)->counter)
+               : "cc","memory" );
+
+       __res |= __ex_flag;
+       if (unlikely(__res != 0))
+               fail_fn(count);
+}
+
+static inline int
+__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
+{
+       int __ex_flag, __res;
+
+       __asm__ (
+
+               "ldrex  %0, [%2]        \n\t"
+               "sub    %0, %0, #1      \n\t"
+               "strex  %1, %0, [%2]    "
+
+               : "=&r" (__res), "=&r" (__ex_flag)
+               : "r" (&(count)->counter)
+               : "cc","memory" );
+
+       __res |= __ex_flag;
+       if (unlikely(__res != 0))
+               __res = fail_fn(count);
+       return __res;
+}
+
+/*
+ * Same trick is used for the unlock fast path. However the original value,
+ * rather than the result, is used to test for success in order to have
+ * better generated assembly.
+ */
+static inline void
+__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
+{
+       int __ex_flag, __res, __orig;
+
+       __asm__ (
+
+               "ldrex  %0, [%3]        \n\t"
+               "add    %1, %0, #1      \n\t"
+               "strex  %2, %1, [%3]    "
+
+               : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
+               : "r" (&(count)->counter)
+               : "cc","memory" );
+
+       __orig |= __ex_flag;
+       if (unlikely(__orig != 0))
+               fail_fn(count);
+}
+
+/*
+ * If the unlock was done on a contended lock, or if the unlock simply fails
+ * then the mutex remains locked.
+ */
+#define __mutex_slowpath_needs_to_unlock()     1
+
+/*
+ * For __mutex_fastpath_trylock we use another construct which could be
+ * described as a "single value cmpxchg".
+ *
+ * This provides the needed trylock semantics like cmpxchg would, but it is
+ * lighter and less generic than a true cmpxchg implementation.
+ */
+static inline int
+__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
+{
+       int __ex_flag, __res, __orig;
+
+       __asm__ (
+
+               "1: ldrex       %0, [%3]        \n\t"
+               "subs           %1, %0, #1      \n\t"
+               "strexeq        %2, %1, [%3]    \n\t"
+               "movlt          %0, #0          \n\t"
+               "cmpeq          %2, #0          \n\t"
+               "bgt            1b              "
+
+               : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
+               : "r" (&count->counter)
+               : "cc", "memory" );
+
+       return __orig;
+}
+
+#endif
+#endif
diff --git a/arch/arm/include/asm/nwflash.h b/arch/arm/include/asm/nwflash.h
new file mode 100644 (file)
index 0000000..04e5a55
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _FLASH_H
+#define _FLASH_H
+
+#define FLASH_MINOR             160    /* MAJOR is 10 - miscdevice */
+#define CMD_WRITE_DISABLE       0
+#define CMD_WRITE_ENABLE        0x28
+#define CMD_WRITE_BASE64K_ENABLE 0x47
+
+#endif /* _FLASH_H */
diff --git a/arch/arm/include/asm/page-nommu.h b/arch/arm/include/asm/page-nommu.h
new file mode 100644 (file)
index 0000000..3574c0d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  arch/arm/include/asm/page-nommu.h
+ *
+ *  Copyright (C) 2004 Hyok S. Choi
+ *
+ * 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.
+ */
+
+#ifndef _ASMARM_PAGE_NOMMU_H
+#define _ASMARM_PAGE_NOMMU_H
+
+#if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13
+#define KTHREAD_SIZE (8192)
+#else
+#define KTHREAD_SIZE PAGE_SIZE
+#endif
+#define get_user_page(vaddr)           __get_free_page(GFP_KERNEL)
+#define free_user_page(page, addr)     free_page(addr)
+
+#define clear_page(page)       memset((page), 0, PAGE_SIZE)
+#define copy_page(to,from)     memcpy((to), (from), PAGE_SIZE)
+
+#define clear_user_page(page, vaddr, pg)       clear_page(page)
+#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
+
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef unsigned long pte_t;
+typedef unsigned long pmd_t;
+typedef unsigned long pgd_t[2];
+typedef unsigned long pgprot_t;
+
+#define pte_val(x)      (x)
+#define pmd_val(x)      (x)
+#define pgd_val(x)     ((x)[0])
+#define pgprot_val(x)   (x)
+
+#define __pte(x)        (x)
+#define __pmd(x)        (x)
+#define __pgprot(x)     (x)
+
+extern unsigned long memory_start;
+extern unsigned long memory_end;
+
+#endif
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
new file mode 100644 (file)
index 0000000..cf2e268
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ *  arch/arm/include/asm/page.h
+ *
+ *  Copyright (C) 1995-2003 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_PAGE_H
+#define _ASMARM_PAGE_H
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT             12
+#define PAGE_SIZE              (1UL << PAGE_SHIFT)
+#define PAGE_MASK              (~(PAGE_SIZE-1))
+
+#ifndef __ASSEMBLY__
+
+#ifndef CONFIG_MMU
+
+#include "page-nommu.h"
+
+#else
+
+#include <asm/glue.h>
+
+/*
+ *     User Space Model
+ *     ================
+ *
+ *     This section selects the correct set of functions for dealing with
+ *     page-based copying and clearing for user space for the particular
+ *     processor(s) we're building for.
+ *
+ *     We have the following to choose from:
+ *       v3            - ARMv3
+ *       v4wt          - ARMv4 with writethrough cache, without minicache
+ *       v4wb          - ARMv4 with writeback cache, without minicache
+ *       v4_mc         - ARMv4 with minicache
+ *       xscale        - Xscale
+ *       xsc3          - XScalev3
+ */
+#undef _USER
+#undef MULTI_USER
+
+#ifdef CONFIG_CPU_COPY_V3
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER v3
+# endif
+#endif
+
+#ifdef CONFIG_CPU_COPY_V4WT
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER v4wt
+# endif
+#endif
+
+#ifdef CONFIG_CPU_COPY_V4WB
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER v4wb
+# endif
+#endif
+
+#ifdef CONFIG_CPU_COPY_FEROCEON
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER feroceon
+# endif
+#endif
+
+#ifdef CONFIG_CPU_SA1100
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER v4_mc
+# endif
+#endif
+
+#ifdef CONFIG_CPU_XSCALE
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER xscale_mc
+# endif
+#endif
+
+#ifdef CONFIG_CPU_XSC3
+# ifdef _USER
+#  define MULTI_USER 1
+# else
+#  define _USER xsc3_mc
+# endif
+#endif
+
+#ifdef CONFIG_CPU_COPY_V6
+# define MULTI_USER 1
+#endif
+
+#if !defined(_USER) && !defined(MULTI_USER)
+#error Unknown user operations model
+#endif
+
+struct cpu_user_fns {
+       void (*cpu_clear_user_page)(void *p, unsigned long user);
+       void (*cpu_copy_user_page)(void *to, const void *from,
+                                  unsigned long user);
+};
+
+#ifdef MULTI_USER
+extern struct cpu_user_fns cpu_user;
+
+#define __cpu_clear_user_page  cpu_user.cpu_clear_user_page
+#define __cpu_copy_user_page   cpu_user.cpu_copy_user_page
+
+#else
+
+#define __cpu_clear_user_page  __glue(_USER,_clear_user_page)
+#define __cpu_copy_user_page   __glue(_USER,_copy_user_page)
+
+extern void __cpu_clear_user_page(void *p, unsigned long user);
+extern void __cpu_copy_user_page(void *to, const void *from,
+                                unsigned long user);
+#endif
+
+#define clear_user_page(addr,vaddr,pg)  __cpu_clear_user_page(addr, vaddr)
+#define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr)
+
+#define clear_page(page)       memzero((void *)(page), PAGE_SIZE)
+extern void copy_page(void *to, const void *from);
+
+#undef STRICT_MM_TYPECHECKS
+
+#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[2]; } 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[0])
+#define pgprot_val(x)   ((x).pgprot)
+
+#define __pte(x)        ((pte_t) { (x) } )
+#define __pmd(x)        ((pmd_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[2];
+typedef unsigned long pgprot_t;
+
+#define pte_val(x)      (x)
+#define pmd_val(x)      (x)
+#define pgd_val(x)     ((x)[0])
+#define pgprot_val(x)   (x)
+
+#define __pte(x)        (x)
+#define __pmd(x)        (x)
+#define __pgprot(x)     (x)
+
+#endif /* STRICT_MM_TYPECHECKS */
+
+#endif /* CONFIG_MMU */
+
+typedef struct page *pgtable_t;
+
+#include <asm/memory.h>
+
+#endif /* !__ASSEMBLY__ */
+
+#define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
+                                VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
+/*
+ * With EABI on ARMv5 and above we must have 64-bit aligned slab pointers.
+ */
+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
+#define ARCH_SLAB_MINALIGN 8
+#endif
+
+#include <asm-generic/page.h>
+
+#endif
diff --git a/arch/arm/include/asm/param.h b/arch/arm/include/asm/param.h
new file mode 100644 (file)
index 0000000..8b24bf9
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  arch/arm/include/asm/param.h
+ *
+ *  Copyright (C) 1995-1999 Russell King
+ *
+ * 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.
+ */
+#ifndef __ASM_PARAM_H
+#define __ASM_PARAM_H
+
+#ifdef __KERNEL__
+# define HZ            CONFIG_HZ       /* Internal kernel timer frequency */
+# define USER_HZ       100             /* User interfaces are in "ticks" */
+# define CLOCKS_PER_SEC        (USER_HZ)       /* like times() */
+#else
+# define HZ            100
+#endif
+
+#define EXEC_PAGESIZE  4096
+
+#ifndef NOGROUP
+#define NOGROUP         (-1)
+#endif
+
+/* max length of hostname */
+#define MAXHOSTNAMELEN  64
+
+#endif
+
diff --git a/arch/arm/include/asm/parport.h b/arch/arm/include/asm/parport.h
new file mode 100644 (file)
index 0000000..26e94b0
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ *  arch/arm/include/asm/parport.h: ARM-specific 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 __ASMARM_PARPORT_H
+#define __ASMARM_PARPORT_H
+
+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 /* !(_ASMARM_PARPORT_H) */
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
new file mode 100644 (file)
index 0000000..2d84792
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef ASMARM_PCI_H
+#define ASMARM_PCI_H
+
+#ifdef __KERNEL__
+#include <asm-generic/pci-dma-compat.h>
+
+#include <asm/hardware.h> /* for PCIBIOS_MIN_* */
+
+#define pcibios_scan_all_fns(a, b)     0
+
+#ifdef CONFIG_PCI_HOST_ITE8152
+/* ITE bridge requires setting latency timer to avoid early bus access
+   termination by PIC bus mater devices
+*/
+extern void pcibios_set_master(struct pci_dev *dev);
+#else
+static inline void pcibios_set_master(struct pci_dev *dev)
+{
+       /* No special bus mastering setup handling */
+}
+#endif
+
+static inline void pcibios_penalize_isa_irq(int irq, int active)
+{
+       /* We don't do dynamic PCI IRQ allocation */
+}
+
+/*
+ * The PCI address space does 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)
+
+/*
+ * Whether pci_unmap_{single,page} is a nop depends upon the
+ * configuration.
+ */
+#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))
+
+#ifdef CONFIG_PCI
+static inline void pci_dma_burst_advice(struct pci_dev *pdev,
+                                       enum pci_dma_burst_strategy *strat,
+                                       unsigned long *strategy_parameter)
+{
+       *strat = PCI_DMA_BURST_INFINITY;
+       *strategy_parameter = ~0UL;
+}
+#endif
+
+#define HAVE_PCI_MMAP
+extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+                               enum pci_mmap_state mmap_state, int write_combine);
+
+extern void
+pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
+                        struct resource *res);
+
+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;
+}
+
+/*
+ * Dummy implementation; always return 0.
+ */
+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
+{
+       return 0;
+}
+
+#endif /* __KERNEL__ */
+#endif
diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..b4e32d8
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ARM_PERCPU
+#define __ARM_PERCPU
+
+#include <asm-generic/percpu.h>
+
+#endif
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
new file mode 100644 (file)
index 0000000..3dcd64b
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ *  arch/arm/include/asm/pgalloc.h
+ *
+ *  Copyright (C) 2000-2001 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_PGALLOC_H
+#define _ASMARM_PGALLOC_H
+
+#include <asm/domain.h>
+#include <asm/pgtable-hwdef.h>
+#include <asm/processor.h>
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
+
+#define check_pgt_cache()              do { } while (0)
+
+#ifdef CONFIG_MMU
+
+#define _PAGE_USER_TABLE       (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
+#define _PAGE_KERNEL_TABLE     (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
+
+/*
+ * Since we have only two-level page tables, these are trivial
+ */
+#define pmd_alloc_one(mm,addr)         ({ BUG(); ((pmd_t *)2); })
+#define pmd_free(mm, pmd)              do { } while (0)
+#define pgd_populate(mm,pmd,pte)       BUG()
+
+extern pgd_t *get_pgd_slow(struct mm_struct *mm);
+extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd);
+
+#define pgd_alloc(mm)                  get_pgd_slow(mm)
+#define pgd_free(mm, pgd)              free_pgd_slow(mm, pgd)
+
+/*
+ * Allocate one PTE table.
+ *
+ * This actually allocates two hardware PTE tables, but we wrap this up
+ * into one table thus:
+ *
+ *  +------------+
+ *  |  h/w pt 0  |
+ *  +------------+
+ *  |  h/w pt 1  |
+ *  +------------+
+ *  | Linux pt 0 |
+ *  +------------+
+ *  | Linux pt 1 |
+ *  +------------+
+ */
+static inline pte_t *
+pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
+{
+       pte_t *pte;
+
+       pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
+       if (pte) {
+               clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE);
+               pte += PTRS_PER_PTE;
+       }
+
+       return pte;
+}
+
+static inline pgtable_t
+pte_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       struct page *pte;
+
+       pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+       if (pte) {
+               void *page = page_address(pte);
+               clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE);
+               pgtable_page_ctor(pte);
+       }
+
+       return pte;
+}
+
+/*
+ * Free one PTE table.
+ */
+static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+{
+       if (pte) {
+               pte -= PTRS_PER_PTE;
+               free_page((unsigned long)pte);
+       }
+}
+
+static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
+{
+       pgtable_page_dtor(pte);
+       __free_page(pte);
+}
+
+static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval)
+{
+       pmdp[0] = __pmd(pmdval);
+       pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
+       flush_pmd_entry(pmdp);
+}
+
+/*
+ * Populate the pmdp entry with a pointer to the pte.  This pmd is part
+ * of the mm address space.
+ *
+ * Ensure that we always set both PMD entries.
+ */
+static inline void
+pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
+{
+       unsigned long pte_ptr = (unsigned long)ptep;
+
+       /*
+        * The pmd must be loaded with the physical
+        * address of the PTE table
+        */
+       pte_ptr -= PTRS_PER_PTE * sizeof(void *);
+       __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE);
+}
+
+static inline void
+pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep)
+{
+       __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);
+}
+#define pmd_pgtable(pmd) pmd_page(pmd)
+
+#endif /* CONFIG_MMU */
+
+#endif
diff --git a/arch/arm/include/asm/pgtable-hwdef.h b/arch/arm/include/asm/pgtable-hwdef.h
new file mode 100644 (file)
index 0000000..fd1521d
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ *  arch/arm/include/asm/pgtable-hwdef.h
+ *
+ *  Copyright (C) 1995-2002 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_PGTABLE_HWDEF_H
+#define _ASMARM_PGTABLE_HWDEF_H
+
+/*
+ * Hardware page table definitions.
+ *
+ * + Level 1 descriptor (PMD)
+ *   - common
+ */
+#define PMD_TYPE_MASK          (3 << 0)
+#define PMD_TYPE_FAULT         (0 << 0)
+#define PMD_TYPE_TABLE         (1 << 0)
+#define PMD_TYPE_SECT          (2 << 0)
+#define PMD_BIT4               (1 << 4)
+#define PMD_DOMAIN(x)          ((x) << 5)
+#define PMD_PROTECTION         (1 << 9)        /* v5 */
+/*
+ *   - section
+ */
+#define PMD_SECT_BUFFERABLE    (1 << 2)
+#define PMD_SECT_CACHEABLE     (1 << 3)
+#define PMD_SECT_XN            (1 << 4)        /* v6 */
+#define PMD_SECT_AP_WRITE      (1 << 10)
+#define PMD_SECT_AP_READ       (1 << 11)
+#define PMD_SECT_TEX(x)                ((x) << 12)     /* v5 */
+#define PMD_SECT_APX           (1 << 15)       /* v6 */
+#define PMD_SECT_S             (1 << 16)       /* v6 */
+#define PMD_SECT_nG            (1 << 17)       /* v6 */
+#define PMD_SECT_SUPER         (1 << 18)       /* v6 */
+
+#define PMD_SECT_UNCACHED      (0)
+#define PMD_SECT_BUFFERED      (PMD_SECT_BUFFERABLE)
+#define PMD_SECT_WT            (PMD_SECT_CACHEABLE)
+#define PMD_SECT_WB            (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
+#define PMD_SECT_MINICACHE     (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
+#define PMD_SECT_WBWA          (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
+#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
+
+/*
+ *   - coarse table (not used)
+ */
+
+/*
+ * + Level 2 descriptor (PTE)
+ *   - common
+ */
+#define PTE_TYPE_MASK          (3 << 0)
+#define PTE_TYPE_FAULT         (0 << 0)
+#define PTE_TYPE_LARGE         (1 << 0)
+#define PTE_TYPE_SMALL         (2 << 0)
+#define PTE_TYPE_EXT           (3 << 0)        /* v5 */
+#define PTE_BUFFERABLE         (1 << 2)
+#define PTE_CACHEABLE          (1 << 3)
+
+/*
+ *   - extended small page/tiny page
+ */
+#define PTE_EXT_XN             (1 << 0)        /* v6 */
+#define PTE_EXT_AP_MASK                (3 << 4)
+#define PTE_EXT_AP0            (1 << 4)
+#define PTE_EXT_AP1            (2 << 4)
+#define PTE_EXT_AP_UNO_SRO     (0 << 4)
+#define PTE_EXT_AP_UNO_SRW     (PTE_EXT_AP0)
+#define PTE_EXT_AP_URO_SRW     (PTE_EXT_AP1)
+#define PTE_EXT_AP_URW_SRW     (PTE_EXT_AP1|PTE_EXT_AP0)
+#define PTE_EXT_TEX(x)         ((x) << 6)      /* v5 */
+#define PTE_EXT_APX            (1 << 9)        /* v6 */
+#define PTE_EXT_COHERENT       (1 << 9)        /* XScale3 */
+#define PTE_EXT_SHARED         (1 << 10)       /* v6 */
+#define PTE_EXT_NG             (1 << 11)       /* v6 */
+
+/*
+ *   - small page
+ */
+#define PTE_SMALL_AP_MASK      (0xff << 4)
+#define PTE_SMALL_AP_UNO_SRO   (0x00 << 4)
+#define PTE_SMALL_AP_UNO_SRW   (0x55 << 4)
+#define PTE_SMALL_AP_URO_SRW   (0xaa << 4)
+#define PTE_SMALL_AP_URW_SRW   (0xff << 4)
+
+#endif
diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
new file mode 100644 (file)
index 0000000..b011f2e
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ *  arch/arm/include/asm/pgtable-nommu.h
+ *
+ *  Copyright (C) 1995-2002 Russell King
+ *  Copyright (C) 2004  Hyok S. Choi
+ *
+ * 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.
+ */
+#ifndef _ASMARM_PGTABLE_NOMMU_H
+#define _ASMARM_PGTABLE_NOMMU_H
+
+#ifndef __ASSEMBLY__
+
+#include <linux/slab.h>
+#include <asm/processor.h>
+#include <asm/page.h>
+
+/*
+ * Trivial page table functions.
+ */
+#define pgd_present(pgd)       (1)
+#define pgd_none(pgd)          (0)
+#define pgd_bad(pgd)           (0)
+#define pgd_clear(pgdp)
+#define kern_addr_valid(addr)  (1)
+#define        pmd_offset(a, b)        ((void *)0)
+/* FIXME */
+/*
+ * PMD_SHIFT determines the size of the area a second-level page table can map
+ * PGDIR_SHIFT determines what a third-level page table entry can map
+ */
+#define PGDIR_SHIFT            21
+
+#define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK             (~(PGDIR_SIZE-1))
+/* FIXME */
+
+#define PAGE_NONE      __pgprot(0)
+#define PAGE_SHARED    __pgprot(0)
+#define PAGE_COPY      __pgprot(0)
+#define PAGE_READONLY  __pgprot(0)
+#define PAGE_KERNEL    __pgprot(0)
+
+#define swapper_pg_dir ((pgd_t *) 0)
+
+#define __swp_type(x)          (0)
+#define __swp_offset(x)                (0)
+#define __swp_entry(typ,off)   ((swp_entry_t) { ((typ) | ((off) << 7)) })
+#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
+
+
+typedef pte_t *pte_addr_t;
+
+static inline int pte_file(pte_t pte) { return 0; }
+
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+#define ZERO_PAGE(vaddr)       (virt_to_page(0))
+
+/*
+ * Mark the prot value as uncacheable and unbufferable.
+ */
+#define pgprot_noncached(prot) __pgprot(0)
+#define pgprot_writecombine(prot) __pgprot(0)
+
+
+/*
+ * These would be in other places but having them here reduces the diffs.
+ */
+extern unsigned int kobjsize(const void *objp);
+
+/*
+ * No page table caches to initialise.
+ */
+#define pgtable_cache_init()   do { } while (0)
+#define io_remap_page_range    remap_page_range
+#define io_remap_pfn_range     remap_pfn_range
+
+
+/*
+ * All 32bit addresses are effectively valid for vmalloc...
+ * Sort of meaningless for non-VM targets.
+ */
+#define        VMALLOC_START   0
+#define        VMALLOC_END     0xffffffff
+
+#define FIRST_USER_ADDRESS      (0)
+
+#include <asm-generic/pgtable.h>
+
+#else 
+
+/*
+ * dummy tlb and user structures.
+ */
+#define v3_tlb_fns     (0)
+#define v4_tlb_fns     (0)
+#define v4wb_tlb_fns   (0)
+#define v4wbi_tlb_fns  (0)
+#define v6wbi_tlb_fns  (0)
+#define v7wbi_tlb_fns  (0)
+
+#define v3_user_fns    (0)
+#define v4_user_fns    (0)
+#define v4_mc_user_fns (0)
+#define v4wb_user_fns  (0)
+#define v4wt_user_fns  (0)
+#define v6_user_fns    (0)
+#define xscale_mc_user_fns (0)
+
+#endif /*__ASSEMBLY__*/
+
+#endif /* _ASMARM_PGTABLE_H */
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..8ab060a
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ *  arch/arm/include/asm/pgtable.h
+ *
+ *  Copyright (C) 1995-2002 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_PGTABLE_H
+#define _ASMARM_PGTABLE_H
+
+#include <asm-generic/4level-fixup.h>
+#include <asm/proc-fns.h>
+
+#ifndef CONFIG_MMU
+
+#include "pgtable-nommu.h"
+
+#else
+
+#include <asm/memory.h>
+#include <asm/arch/vmalloc.h>
+#include <asm/pgtable-hwdef.h>
+
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts.  That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ *
+ * Note that platforms may override VMALLOC_START, but they must provide
+ * VMALLOC_END.  VMALLOC_END defines the (exclusive) limit of this space,
+ * which may not overlap IO space.
+ */
+#ifndef VMALLOC_START
+#define VMALLOC_OFFSET         (8*1024*1024)
+#define VMALLOC_START          (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#endif
+
+/*
+ * Hardware-wise, we have a two level page table structure, where the first
+ * level has 4096 entries, and the second level has 256 entries.  Each entry
+ * is one 32-bit word.  Most of the bits in the second level entry are used
+ * by hardware, and there aren't any "accessed" and "dirty" bits.
+ *
+ * Linux on the other hand has a three level page table structure, which can
+ * be wrapped to fit a two level page table structure easily - using the PGD
+ * and PTE only.  However, Linux also expects one "PTE" table per page, and
+ * at least a "dirty" bit.
+ *
+ * Therefore, we tweak the implementation slightly - we tell Linux that we
+ * have 2048 entries in the first level, each of which is 8 bytes (iow, two
+ * hardware pointers to the second level.)  The second level contains two
+ * hardware PTE tables arranged contiguously, followed by Linux versions
+ * which contain the state information Linux needs.  We, therefore, end up
+ * with 512 entries in the "PTE" level.
+ *
+ * This leads to the page tables having the following layout:
+ *
+ *    pgd             pte
+ * |        |
+ * +--------+ +0
+ * |        |-----> +------------+ +0
+ * +- - - - + +4    |  h/w pt 0  |
+ * |        |-----> +------------+ +1024
+ * +--------+ +8    |  h/w pt 1  |
+ * |        |       +------------+ +2048
+ * +- - - - +       | Linux pt 0 |
+ * |        |       +------------+ +3072
+ * +--------+       | Linux pt 1 |
+ * |        |       +------------+ +4096
+ *
+ * See L_PTE_xxx below for definitions of bits in the "Linux pt", and
+ * PTE_xxx for definitions of bits appearing in the "h/w pt".
+ *
+ * PMD_xxx definitions refer to bits in the first level page table.
+ *
+ * The "dirty" bit is emulated by only granting hardware write permission
+ * iff the page is marked "writable" and "dirty" in the Linux PTE.  This
+ * means that a write to a clean page will cause a permission fault, and
+ * the Linux MM layer will mark the page dirty via handle_pte_fault().
+ * For the hardware to notice the permission change, the TLB entry must
+ * be flushed, and ptep_set_access_flags() does that for us.
+ *
+ * The "accessed" or "young" bit is emulated by a similar method; we only
+ * allow accesses to the page if the "young" bit is set.  Accesses to the
+ * page will cause a fault, and handle_pte_fault() will set the young bit
+ * for us as long as the page is marked present in the corresponding Linux
+ * PTE entry.  Again, ptep_set_access_flags() will ensure that the TLB is
+ * up to date.
+ *
+ * However, when the "young" bit is cleared, we deny access to the page
+ * by clearing the hardware PTE.  Currently Linux does not flush the TLB
+ * for us in this case, which means the TLB will retain the transation
+ * until either the TLB entry is evicted under pressure, or a context
+ * switch which changes the user space mapping occurs.
+ */
+#define PTRS_PER_PTE           512
+#define PTRS_PER_PMD           1
+#define PTRS_PER_PGD           2048
+
+/*
+ * PMD_SHIFT determines the size of the area a second-level page table can map
+ * PGDIR_SHIFT determines what a third-level page table entry can map
+ */
+#define PMD_SHIFT              21
+#define PGDIR_SHIFT            21
+
+#define LIBRARY_TEXT_START     0x0c000000
+
+#ifndef __ASSEMBLY__
+extern void __pte_error(const char *file, int line, unsigned long val);
+extern void __pmd_error(const char *file, int line, unsigned long val);
+extern void __pgd_error(const char *file, int line, unsigned long val);
+
+#define pte_ERROR(pte)         __pte_error(__FILE__, __LINE__, pte_val(pte))
+#define pmd_ERROR(pmd)         __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
+#define pgd_ERROR(pgd)         __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
+#endif /* !__ASSEMBLY__ */
+
+#define PMD_SIZE               (1UL << PMD_SHIFT)
+#define PMD_MASK               (~(PMD_SIZE-1))
+#define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK             (~(PGDIR_SIZE-1))
+
+/*
+ * This is the lowest virtual address we can permit any user space
+ * mapping to be mapped at.  This is particularly important for
+ * non-high vector CPUs.
+ */
+#define FIRST_USER_ADDRESS     PAGE_SIZE
+
+#define FIRST_USER_PGD_NR      1
+#define USER_PTRS_PER_PGD      ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR)
+
+/*
+ * section address mask and size definitions.
+ */
+#define SECTION_SHIFT          20
+#define SECTION_SIZE           (1UL << SECTION_SHIFT)
+#define SECTION_MASK           (~(SECTION_SIZE-1))
+
+/*
+ * ARMv6 supersection address mask and size definitions.
+ */
+#define SUPERSECTION_SHIFT     24
+#define SUPERSECTION_SIZE      (1UL << SUPERSECTION_SHIFT)
+#define SUPERSECTION_MASK      (~(SUPERSECTION_SIZE-1))
+
+/*
+ * "Linux" PTE definitions.
+ *
+ * We keep two sets of PTEs - the hardware and the linux version.
+ * This allows greater flexibility in the way we map the Linux bits
+ * onto the hardware tables, and allows us to have YOUNG and DIRTY
+ * bits.
+ *
+ * The PTE table pointer refers to the hardware entries; the "Linux"
+ * entries are stored 1024 bytes below.
+ */
+#define L_PTE_PRESENT          (1 << 0)
+#define L_PTE_FILE             (1 << 1)        /* only when !PRESENT */
+#define L_PTE_YOUNG            (1 << 1)
+#define L_PTE_BUFFERABLE       (1 << 2)        /* matches PTE */
+#define L_PTE_CACHEABLE                (1 << 3)        /* matches PTE */
+#define L_PTE_USER             (1 << 4)
+#define L_PTE_WRITE            (1 << 5)
+#define L_PTE_EXEC             (1 << 6)
+#define L_PTE_DIRTY            (1 << 7)
+#define L_PTE_SHARED           (1 << 10)       /* shared(v6), coherent(xsc3) */
+
+#ifndef __ASSEMBLY__
+
+/*
+ * The pgprot_* and protection_map entries will be fixed up in runtime
+ * to include the cachable and bufferable bits based on memory policy,
+ * as well as any architecture dependent bits like global/ASID and SMP
+ * shared mapping bits.
+ */
+#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE
+#define _L_PTE_READ    L_PTE_USER | L_PTE_EXEC
+
+extern pgprot_t                pgprot_user;
+extern pgprot_t                pgprot_kernel;
+
+#define PAGE_NONE      pgprot_user
+#define PAGE_COPY      __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
+#define PAGE_SHARED    __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ | \
+                                L_PTE_WRITE)
+#define PAGE_READONLY  __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
+#define PAGE_KERNEL    pgprot_kernel
+
+#define __PAGE_NONE    __pgprot(_L_PTE_DEFAULT)
+#define __PAGE_COPY    __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
+#define __PAGE_SHARED  __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE)
+#define __PAGE_READONLY        __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * The table below defines the page protection levels that we insert into our
+ * Linux page table version.  These get translated into the best that the
+ * architecture can perform.  Note that on most ARM hardware:
+ *  1) We cannot do execute protection
+ *  2) If we could do execute protection, then read is implied
+ *  3) write implies read permissions
+ */
+#define __P000  __PAGE_NONE
+#define __P001  __PAGE_READONLY
+#define __P010  __PAGE_COPY
+#define __P011  __PAGE_COPY
+#define __P100  __PAGE_READONLY
+#define __P101  __PAGE_READONLY
+#define __P110  __PAGE_COPY
+#define __P111  __PAGE_COPY
+
+#define __S000  __PAGE_NONE
+#define __S001  __PAGE_READONLY
+#define __S010  __PAGE_SHARED
+#define __S011  __PAGE_SHARED
+#define __S100  __PAGE_READONLY
+#define __S101  __PAGE_READONLY
+#define __S110  __PAGE_SHARED
+#define __S111  __PAGE_SHARED
+
+#ifndef __ASSEMBLY__
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern struct page *empty_zero_page;
+#define ZERO_PAGE(vaddr)       (empty_zero_page)
+
+#define pte_pfn(pte)           (pte_val(pte) >> PAGE_SHIFT)
+#define pfn_pte(pfn,prot)      (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
+
+#define pte_none(pte)          (!pte_val(pte))
+#define pte_clear(mm,addr,ptep)        set_pte_ext(ptep, __pte(0), 0)
+#define pte_page(pte)          (pfn_to_page(pte_pfn(pte)))
+#define pte_offset_kernel(dir,addr)    (pmd_page_vaddr(*(dir)) + __pte_index(addr))
+#define pte_offset_map(dir,addr)       (pmd_page_vaddr(*(dir)) + __pte_index(addr))
+#define pte_offset_map_nested(dir,addr)        (pmd_page_vaddr(*(dir)) + __pte_index(addr))
+#define pte_unmap(pte)         do { } while (0)
+#define pte_unmap_nested(pte)  do { } while (0)
+
+#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
+
+#define set_pte_at(mm,addr,ptep,pteval) do { \
+       set_pte_ext(ptep, pteval, (addr) >= TASK_SIZE ? 0 : PTE_EXT_NG); \
+ } while (0)
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+#define pte_present(pte)       (pte_val(pte) & L_PTE_PRESENT)
+#define pte_write(pte)         (pte_val(pte) & L_PTE_WRITE)
+#define pte_dirty(pte)         (pte_val(pte) & L_PTE_DIRTY)
+#define pte_young(pte)         (pte_val(pte) & L_PTE_YOUNG)
+#define pte_special(pte)       (0)
+
+/*
+ * The following only works if pte_present() is not true.
+ */
+#define pte_file(pte)          (pte_val(pte) & L_PTE_FILE)
+#define pte_to_pgoff(x)                (pte_val(x) >> 2)
+#define pgoff_to_pte(x)                __pte(((x) << 2) | L_PTE_FILE)
+
+#define PTE_FILE_MAX_BITS      30
+
+#define PTE_BIT_FUNC(fn,op) \
+static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
+
+PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE);
+PTE_BIT_FUNC(mkwrite,   |= L_PTE_WRITE);
+PTE_BIT_FUNC(mkclean,   &= ~L_PTE_DIRTY);
+PTE_BIT_FUNC(mkdirty,   |= L_PTE_DIRTY);
+PTE_BIT_FUNC(mkold,     &= ~L_PTE_YOUNG);
+PTE_BIT_FUNC(mkyoung,   |= L_PTE_YOUNG);
+
+static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
+
+/*
+ * Mark the prot value as uncacheable and unbufferable.
+ */
+#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE))
+#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE)
+
+#define pmd_none(pmd)          (!pmd_val(pmd))
+#define pmd_present(pmd)       (pmd_val(pmd))
+#define pmd_bad(pmd)           (pmd_val(pmd) & 2)
+
+#define copy_pmd(pmdpd,pmdps)          \
+       do {                            \
+               pmdpd[0] = pmdps[0];    \
+               pmdpd[1] = pmdps[1];    \
+               flush_pmd_entry(pmdpd); \
+       } while (0)
+
+#define pmd_clear(pmdp)                        \
+       do {                            \
+               pmdp[0] = __pmd(0);     \
+               pmdp[1] = __pmd(0);     \
+               clean_pmd_entry(pmdp);  \
+       } while (0)
+
+static inline pte_t *pmd_page_vaddr(pmd_t pmd)
+{
+       unsigned long ptr;
+
+       ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1);
+       ptr += PTRS_PER_PTE * sizeof(void *);
+
+       return __va(ptr);
+}
+
+#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
+
+/*
+ * Permanent address of a page. We never have highmem, so this is trivial.
+ */
+#define pages_to_mb(x)         ((x) >> (20 - PAGE_SHIFT))
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+#define mk_pte(page,prot)      pfn_pte(page_to_pfn(page),prot)
+
+/*
+ * The "pgd_xxx()" functions here are trivial for a folded two-level
+ * setup: the pgd is never bad, and a pmd always exists (as it's folded
+ * into the pgd entry)
+ */
+#define pgd_none(pgd)          (0)
+#define pgd_bad(pgd)           (0)
+#define pgd_present(pgd)       (1)
+#define pgd_clear(pgdp)                do { } while (0)
+#define set_pgd(pgd,pgdp)      do { } while (0)
+
+/* to find an entry in a page-table-directory */
+#define pgd_index(addr)                ((addr) >> PGDIR_SHIFT)
+
+#define pgd_offset(mm, addr)   ((mm)->pgd+pgd_index(addr))
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(addr)     pgd_offset(&init_mm, addr)
+
+/* Find an entry in the second-level page table.. */
+#define pmd_offset(dir, addr)  ((pmd_t *)(dir))
+
+/* Find an entry in the third-level page table.. */
+#define __pte_index(addr)      (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+       const unsigned long mask = L_PTE_EXEC | L_PTE_WRITE | L_PTE_USER;
+       pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
+       return pte;
+}
+
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+
+/* Encode and decode a swap entry.
+ *
+ * We support up to 32GB of swap on 4k machines
+ */
+#define __swp_type(x)          (((x).val >> 2) & 0x7f)
+#define __swp_offset(x)                ((x).val >> 9)
+#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) })
+#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(swp)        ((pte_t) { (swp).val })
+
+/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
+/* FIXME: this is not correct */
+#define kern_addr_valid(addr)  (1)
+
+#include <asm-generic/pgtable.h>
+
+/*
+ * We provide our own arch_get_unmapped_area to cope with VIPT caches.
+ */
+#define HAVE_ARCH_UNMAPPED_AREA
+
+/*
+ * remap a physical page `pfn' of size `size' with page protection `prot'
+ * into virtual address `from'
+ */
+#define io_remap_pfn_range(vma,from,pfn,size,prot) \
+               remap_pfn_range(vma, from, pfn, size, prot)
+
+#define pgtable_cache_init() do { } while (0)
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* CONFIG_MMU */
+
+#endif /* _ASMARM_PGTABLE_H */
diff --git a/arch/arm/include/asm/poll.h b/arch/arm/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/arm/include/asm/posix_types.h b/arch/arm/include/asm/posix_types.h
new file mode 100644 (file)
index 0000000..2446d23
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *  arch/arm/include/asm/posix_types.h
+ *
+ *  Copyright (C) 1996-1998 Russell King.
+ *
+ * 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.
+ *
+ *  Changelog:
+ *   27-06-1996        RMK     Created
+ */
+#ifndef __ARCH_ARM_POSIX_TYPES_H
+#define __ARCH_ARM_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 long          __kernel_ino_t;
+typedef unsigned short         __kernel_mode_t;
+typedef unsigned short         __kernel_nlink_t;
+typedef long                   __kernel_off_t;
+typedef int                    __kernel_pid_t;
+typedef unsigned short         __kernel_ipc_pid_t;
+typedef unsigned short         __kernel_uid_t;
+typedef unsigned short         __kernel_gid_t;
+typedef unsigned int           __kernel_size_t;
+typedef int                    __kernel_ssize_t;
+typedef int                    __kernel_ptrdiff_t;
+typedef long                   __kernel_time_t;
+typedef long                   __kernel_suseconds_t;
+typedef long                   __kernel_clock_t;
+typedef int                    __kernel_timer_t;
+typedef int                    __kernel_clockid_t;
+typedef int                    __kernel_daddr_t;
+typedef char *                 __kernel_caddr_t;
+typedef unsigned short         __kernel_uid16_t;
+typedef unsigned short         __kernel_gid16_t;
+typedef unsigned int           __kernel_uid32_t;
+typedef unsigned int           __kernel_gid32_t;
+
+typedef unsigned short         __kernel_old_uid_t;
+typedef unsigned short         __kernel_old_gid_t;
+typedef unsigned short         __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long              __kernel_loff_t;
+#endif
+
+typedef struct {
+       int     val[2];
+} __kernel_fsid_t;
+
+#if defined(__KERNEL__)
+
+#undef __FD_SET
+#define __FD_SET(fd, fdsetp) \
+               (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd, fdsetp) \
+               (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd, fdsetp) \
+               ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp) \
+               (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
+
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h
new file mode 100644 (file)
index 0000000..db80203
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ *  arch/arm/include/asm/proc-fns.h
+ *
+ *  Copyright (C) 1997-1999 Russell King
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * 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.
+ */
+#ifndef __ASM_PROCFNS_H
+#define __ASM_PROCFNS_H
+
+#ifdef __KERNEL__
+
+
+/*
+ * Work out if we need multiple CPU support
+ */
+#undef MULTI_CPU
+#undef CPU_NAME
+
+/*
+ * CPU_NAME - the prefix for CPU related functions
+ */
+
+#ifdef CONFIG_CPU_32
+# ifdef CONFIG_CPU_ARM610
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm6
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM7TDMI
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm7tdmi
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM710
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm7
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM720T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm720
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM740T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm740
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM9TDMI
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm9tdmi
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM920T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm920
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM922T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm922
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM925T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm925
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM926T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm926
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM940T
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm940
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM946E
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm946
+#  endif
+# endif
+# ifdef CONFIG_CPU_SA110
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_sa110
+#  endif
+# endif
+# ifdef CONFIG_CPU_SA1100
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_sa1100
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM1020
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm1020
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM1020E
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm1020e
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM1022
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm1022
+#  endif
+# endif
+# ifdef CONFIG_CPU_ARM1026
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_arm1026
+#  endif
+# endif
+# ifdef CONFIG_CPU_XSCALE
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_xscale
+#  endif
+# endif
+# ifdef CONFIG_CPU_XSC3
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_xsc3
+#  endif
+# endif
+# ifdef CONFIG_CPU_FEROCEON
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_feroceon
+#  endif
+# endif
+# ifdef CONFIG_CPU_V6
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_v6
+#  endif
+# endif
+# ifdef CONFIG_CPU_V7
+#  ifdef CPU_NAME
+#   undef  MULTI_CPU
+#   define MULTI_CPU
+#  else
+#   define CPU_NAME cpu_v7
+#  endif
+# endif
+#endif
+
+#ifndef __ASSEMBLY__
+
+#ifndef MULTI_CPU
+#include <asm/cpu-single.h>
+#else
+#include <asm/cpu-multi32.h>
+#endif
+
+#include <asm/memory.h>
+
+#ifdef CONFIG_MMU
+
+#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
+
+#define cpu_get_pgd()  \
+       ({                                              \
+               unsigned long pg;                       \
+               __asm__("mrc    p15, 0, %0, c2, c0, 0"  \
+                        : "=r" (pg) : : "cc");         \
+               pg &= ~0x3fff;                          \
+               (pgd_t *)phys_to_virt(pg);              \
+       })
+
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* __ASM_PROCFNS_H */
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
new file mode 100644 (file)
index 0000000..b01d5e7
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ *  arch/arm/include/asm/processor.h
+ *
+ *  Copyright (C) 1995-1999 Russell King
+ *
+ * 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.
+ */
+
+#ifndef __ASM_ARM_PROCESSOR_H
+#define __ASM_ARM_PROCESSOR_H
+
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
+#ifdef __KERNEL__
+
+#include <asm/ptrace.h>
+#include <asm/types.h>
+
+#ifdef __KERNEL__
+#define STACK_TOP      ((current->personality == PER_LINUX_32BIT) ? \
+                        TASK_SIZE : TASK_SIZE_26)
+#define STACK_TOP_MAX  TASK_SIZE
+#endif
+
+union debug_insn {
+       u32     arm;
+       u16     thumb;
+};
+
+struct debug_entry {
+       u32                     address;
+       union debug_insn        insn;
+};
+
+struct debug_info {
+       int                     nsaved;
+       struct debug_entry      bp[2];
+};
+
+struct thread_struct {
+                                                       /* fault info     */
+       unsigned long           address;
+       unsigned long           trap_no;
+       unsigned long           error_code;
+                                                       /* debugging      */
+       struct debug_info       debug;
+};
+
+#define INIT_THREAD  { }
+
+#ifdef CONFIG_MMU
+#define nommu_start_thread(regs) do { } while (0)
+#else
+#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data
+#endif
+
+#define start_thread(regs,pc,sp)                                       \
+({                                                                     \
+       unsigned long *stack = (unsigned long *)sp;                     \
+       set_fs(USER_DS);                                                \
+       memzero(regs->uregs, sizeof(regs->uregs));                      \
+       if (current->personality & ADDR_LIMIT_32BIT)                    \
+               regs->ARM_cpsr = USR_MODE;                              \
+       else                                                            \
+               regs->ARM_cpsr = USR26_MODE;                            \
+       if (elf_hwcap & HWCAP_THUMB && pc & 1)                          \
+               regs->ARM_cpsr |= PSR_T_BIT;                            \
+       regs->ARM_pc = pc & ~1;         /* pc */                        \
+       regs->ARM_sp = sp;              /* sp */                        \
+       regs->ARM_r2 = stack[2];        /* r2 (envp) */                 \
+       regs->ARM_r1 = stack[1];        /* r1 (argv) */                 \
+       regs->ARM_r0 = stack[0];        /* r0 (argc) */                 \
+       nommu_start_thread(regs);                                       \
+})
+
+/* Forward declaration, a strange C thing */
+struct task_struct;
+
+/* 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)
+
+unsigned long get_wchan(struct task_struct *p);
+
+#define cpu_relax()                    barrier()
+
+/*
+ * Create a new kernel thread
+ */
+extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
+
+#define task_pt_regs(p) \
+       ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
+
+#define KSTK_EIP(tsk)  task_pt_regs(tsk)->ARM_pc
+#define KSTK_ESP(tsk)  task_pt_regs(tsk)->ARM_sp
+
+/*
+ * Prefetching support - only ARMv5.
+ */
+#if __LINUX_ARM_ARCH__ >= 5
+
+#define ARCH_HAS_PREFETCH
+static inline void prefetch(const void *ptr)
+{
+       __asm__ __volatile__(
+               "pld\t%0"
+               :
+               : "o" (*(char *)ptr)
+               : "cc");
+}
+
+#define ARCH_HAS_PREFETCHW
+#define prefetchw(ptr) prefetch(ptr)
+
+#define ARCH_HAS_SPINLOCK_PREFETCH
+#define spin_lock_prefetch(x) do { } while (0)
+
+#endif
+
+#endif
+
+#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/arch/arm/include/asm/procinfo.h b/arch/arm/include/asm/procinfo.h
new file mode 100644 (file)
index 0000000..ca52e58
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  arch/arm/include/asm/procinfo.h
+ *
+ *  Copyright (C) 1996-1999 Russell King
+ *
+ * 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.
+ */
+#ifndef __ASM_PROCINFO_H
+#define __ASM_PROCINFO_H
+
+#ifdef __KERNEL__
+
+struct cpu_tlb_fns;
+struct cpu_user_fns;
+struct cpu_cache_fns;
+struct processor;
+
+/*
+ * Note!  struct processor is always defined if we're
+ * using MULTI_CPU, otherwise this entry is unused,
+ * but still exists.
+ *
+ * NOTE! The following structure is defined by assembly
+ * language, NOT C code.  For more information, check:
+ *  arch/arm/mm/proc-*.S and arch/arm/kernel/head.S
+ */
+struct proc_info_list {
+       unsigned int            cpu_val;
+       unsigned int            cpu_mask;
+       unsigned long           __cpu_mm_mmu_flags;     /* used by head.S */
+       unsigned long           __cpu_io_mmu_flags;     /* used by head.S */
+       unsigned long           __cpu_flush;            /* used by head.S */
+       const char              *arch_name;
+       const char              *elf_name;
+       unsigned int            elf_hwcap;
+       const char              *cpu_name;
+       struct processor        *proc;
+       struct cpu_tlb_fns      *tlb;
+       struct cpu_user_fns     *user;
+       struct cpu_cache_fns    *cache;
+};
+
+#else  /* __KERNEL__ */
+#include <asm/elf.h>
+#warning "Please include asm/elf.h instead"
+#endif /* __KERNEL__ */
+#endif
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..b415c0e
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ *  arch/arm/include/asm/ptrace.h
+ *
+ *  Copyright (C) 1996-2003 Russell King
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_PTRACE_H
+#define __ASM_ARM_PTRACE_H
+
+#include <asm/hwcap.h>
+
+#define PTRACE_GETREGS         12
+#define PTRACE_SETREGS         13
+#define PTRACE_GETFPREGS       14
+#define PTRACE_SETFPREGS       15
+/* PTRACE_ATTACH is 16 */
+/* PTRACE_DETACH is 17 */
+#define PTRACE_GETWMMXREGS     18
+#define PTRACE_SETWMMXREGS     19
+/* 20 is unused */
+#define PTRACE_OLDSETOPTIONS   21
+#define PTRACE_GET_THREAD_AREA 22
+#define PTRACE_SET_SYSCALL     23
+/* PTRACE_SYSCALL is 24 */
+#define PTRACE_GETCRUNCHREGS   25
+#define PTRACE_SETCRUNCHREGS   26
+
+/*
+ * PSR bits
+ */
+#define USR26_MODE     0x00000000
+#define FIQ26_MODE     0x00000001
+#define IRQ26_MODE     0x00000002
+#define SVC26_MODE     0x00000003
+#define USR_MODE       0x00000010
+#define FIQ_MODE       0x00000011
+#define IRQ_MODE       0x00000012
+#define SVC_MODE       0x00000013
+#define ABT_MODE       0x00000017
+#define UND_MODE       0x0000001b
+#define SYSTEM_MODE    0x0000001f
+#define MODE32_BIT     0x00000010
+#define MODE_MASK      0x0000001f
+#define PSR_T_BIT      0x00000020
+#define PSR_F_BIT      0x00000040
+#define PSR_I_BIT      0x00000080
+#define PSR_A_BIT      0x00000100
+#define PSR_J_BIT      0x01000000
+#define PSR_Q_BIT      0x08000000
+#define PSR_V_BIT      0x10000000
+#define PSR_C_BIT      0x20000000
+#define PSR_Z_BIT      0x40000000
+#define PSR_N_BIT      0x80000000
+#define PCMASK         0
+
+/*
+ * Groups of PSR bits
+ */
+#define PSR_f          0xff000000      /* Flags                */
+#define PSR_s          0x00ff0000      /* Status               */
+#define PSR_x          0x0000ff00      /* Extension            */
+#define PSR_c          0x000000ff      /* Control              */
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This struct defines the way the registers are stored on the
+ * stack during a system call.  Note that sizeof(struct pt_regs)
+ * has to be a multiple of 8.
+ */
+struct pt_regs {
+       long uregs[18];
+};
+
+#define ARM_cpsr       uregs[16]
+#define ARM_pc         uregs[15]
+#define ARM_lr         uregs[14]
+#define ARM_sp         uregs[13]
+#define ARM_ip         uregs[12]
+#define ARM_fp         uregs[11]
+#define ARM_r10                uregs[10]
+#define ARM_r9         uregs[9]
+#define ARM_r8         uregs[8]
+#define ARM_r7         uregs[7]
+#define ARM_r6         uregs[6]
+#define ARM_r5         uregs[5]
+#define ARM_r4         uregs[4]
+#define ARM_r3         uregs[3]
+#define ARM_r2         uregs[2]
+#define ARM_r1         uregs[1]
+#define ARM_r0         uregs[0]
+#define ARM_ORIG_r0    uregs[17]
+
+#ifdef __KERNEL__
+
+#define user_mode(regs)        \
+       (((regs)->ARM_cpsr & 0xf) == 0)
+
+#ifdef CONFIG_ARM_THUMB
+#define thumb_mode(regs) \
+       (((regs)->ARM_cpsr & PSR_T_BIT))
+#else
+#define thumb_mode(regs) (0)
+#endif
+
+#define isa_mode(regs) \
+       ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
+        (((regs)->ARM_cpsr & PSR_T_BIT) >> 5))
+
+#define processor_mode(regs) \
+       ((regs)->ARM_cpsr & MODE_MASK)
+
+#define interrupts_enabled(regs) \
+       (!((regs)->ARM_cpsr & PSR_I_BIT))
+
+#define fast_interrupts_enabled(regs) \
+       (!((regs)->ARM_cpsr & PSR_F_BIT))
+
+/* Are the current registers suitable for user mode?
+ * (used to maintain security in signal handlers)
+ */
+static inline int valid_user_regs(struct pt_regs *regs)
+{
+       if (user_mode(regs) && (regs->ARM_cpsr & PSR_I_BIT) == 0) {
+               regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
+               return 1;
+       }
+
+       /*
+        * Force CPSR to something logical...
+        */
+       regs->ARM_cpsr &= PSR_f | PSR_s | (PSR_x & ~PSR_A_BIT) | PSR_T_BIT | MODE32_BIT;
+       if (!(elf_hwcap & HWCAP_26BIT))
+               regs->ARM_cpsr |= USR_MODE;
+
+       return 0;
+}
+
+#define pc_pointer(v) \
+       ((v) & ~PCMASK)
+
+#define instruction_pointer(regs) \
+       (pc_pointer((regs)->ARM_pc))
+
+#ifdef CONFIG_SMP
+extern unsigned long profile_pc(struct pt_regs *regs);
+#else
+#define profile_pc(regs) instruction_pointer(regs)
+#endif
+
+#define predicate(x)           ((x) & 0xf0000000)
+#define PREDICATE_ALWAYS       0xe0000000
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASSEMBLY__ */
+
+#endif
+
diff --git a/arch/arm/include/asm/resource.h b/arch/arm/include/asm/resource.h
new file mode 100644 (file)
index 0000000..734b581
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ARM_RESOURCE_H
+#define _ARM_RESOURCE_H
+
+#include <asm-generic/resource.h>
+
+#endif
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
new file mode 100644 (file)
index 0000000..ca0a37d
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _ASMARM_SCATTERLIST_H
+#define _ASMARM_SCATTERLIST_H
+
+#include <asm/memory.h>
+#include <asm/types.h>
+
+struct scatterlist {
+#ifdef CONFIG_DEBUG_SG
+       unsigned long   sg_magic;
+#endif
+       unsigned long   page_link;
+       unsigned int    offset;         /* buffer offset                 */
+       dma_addr_t      dma_address;    /* dma address                   */
+       unsigned int    length;         /* length                        */
+};
+
+/*
+ * These macros should be used after a pci_map_sg call has been done
+ * to get bus addresses of each of the SG entries and their lengths.
+ * You should only work with the number of sg entries pci_map_sg
+ * returns, or alternatively stop on the first sg_dma_len(sg) which
+ * is 0.
+ */
+#define sg_dma_address(sg)      ((sg)->dma_address)
+#define sg_dma_len(sg)          ((sg)->length)
+
+#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/arch/arm/include/asm/sections.h b/arch/arm/include/asm/sections.h
new file mode 100644 (file)
index 0000000..2b8c516
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/sections.h>
diff --git a/arch/arm/include/asm/segment.h b/arch/arm/include/asm/segment.h
new file mode 100644 (file)
index 0000000..9e24c21
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_ARM_SEGMENT_H
+#define __ASM_ARM_SEGMENT_H
+
+#define __KERNEL_CS   0x0
+#define __KERNEL_DS   0x0
+
+#define __USER_CS     0x1
+#define __USER_DS     0x1
+
+#endif /* __ASM_ARM_SEGMENT_H */
+
diff --git a/arch/arm/include/asm/sembuf.h b/arch/arm/include/asm/sembuf.h
new file mode 100644 (file)
index 0000000..1c02839
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _ASMARM_SEMBUF_H
+#define _ASMARM_SEMBUF_H
+
+/* 
+ * The semid64_ds structure for arm architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct semid64_ds {
+       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
+       __kernel_time_t sem_otime;              /* last semop time */
+       unsigned long   __unused1;
+       __kernel_time_t sem_ctime;              /* last change time */
+       unsigned long   __unused2;
+       unsigned long   sem_nsems;              /* no. of semaphores in array */
+       unsigned long   __unused3;
+       unsigned long   __unused4;
+};
+
+#endif /* _ASMARM_SEMBUF_H */
diff --git a/arch/arm/include/asm/serial.h b/arch/arm/include/asm/serial.h
new file mode 100644 (file)
index 0000000..ebb0490
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ *  arch/arm/include/asm/serial.h
+ *
+ *  Copyright (C) 1996 Russell King.
+ *
+ * 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.
+ *
+ *  Changelog:
+ *   15-10-1996        RMK     Created
+ */
+
+#ifndef __ASM_SERIAL_H
+#define __ASM_SERIAL_H
+
+#define BASE_BAUD      (1843200 / 16)
+
+#endif
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
new file mode 100644 (file)
index 0000000..7bbf105
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ *  linux/include/asm/setup.h
+ *
+ *  Copyright (C) 1997-1999 Russell King
+ *
+ * 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.
+ *
+ *  Structure passed to kernel to tell it about the
+ *  hardware it's running on.  See Documentation/arm/Setup
+ *  for more info.
+ */
+#ifndef __ASMARM_SETUP_H
+#define __ASMARM_SETUP_H
+
+#include <asm/types.h>
+
+#define COMMAND_LINE_SIZE 1024
+
+/* The list ends with an ATAG_NONE node. */
+#define ATAG_NONE      0x00000000
+
+struct tag_header {
+       __u32 size;
+       __u32 tag;
+};
+
+/* The list must start with an ATAG_CORE node */
+#define ATAG_CORE      0x54410001
+
+struct tag_core {
+       __u32 flags;            /* bit 0 = read-only */
+       __u32 pagesize;
+       __u32 rootdev;
+};
+
+/* it is allowed to have multiple ATAG_MEM nodes */
+#define ATAG_MEM       0x54410002
+
+struct tag_mem32 {
+       __u32   size;
+       __u32   start;  /* physical start address */
+};
+
+/* VGA text type displays */
+#define ATAG_VIDEOTEXT 0x54410003
+
+struct tag_videotext {
+       __u8            x;
+       __u8            y;
+       __u16           video_page;
+       __u8            video_mode;
+       __u8            video_cols;
+       __u16           video_ega_bx;
+       __u8            video_lines;
+       __u8            video_isvga;
+       __u16           video_points;
+};
+
+/* describes how the ramdisk will be used in kernel */
+#define ATAG_RAMDISK   0x54410004
+
+struct tag_ramdisk {
+       __u32 flags;    /* bit 0 = load, bit 1 = prompt */
+       __u32 size;     /* decompressed ramdisk size in _kilo_ bytes */
+       __u32 start;    /* starting block of floppy-based RAM disk image */
+};
+
+/* describes where the compressed ramdisk image lives (virtual address) */
+/*
+ * this one accidentally used virtual addresses - as such,
+ * it's deprecated.
+ */
+#define ATAG_INITRD    0x54410005
+
+/* describes where the compressed ramdisk image lives (physical address) */
+#define ATAG_INITRD2   0x54420005
+
+struct tag_initrd {
+       __u32 start;    /* physical start address */
+       __u32 size;     /* size of compressed ramdisk image in bytes */
+};
+
+/* board serial number. "64 bits should be enough for everybody" */
+#define ATAG_SERIAL    0x54410006
+
+struct tag_serialnr {
+       __u32 low;
+       __u32 high;
+};
+
+/* board revision */
+#define ATAG_REVISION  0x54410007
+
+struct tag_revision {
+       __u32 rev;
+};
+
+/* initial values for vesafb-type framebuffers. see struct screen_info
+ * in include/linux/tty.h
+ */
+#define ATAG_VIDEOLFB  0x54410008
+
+struct tag_videolfb {
+       __u16           lfb_width;
+       __u16           lfb_height;
+       __u16           lfb_depth;
+       __u16           lfb_linelength;
+       __u32           lfb_base;
+       __u32           lfb_size;
+       __u8            red_size;
+       __u8            red_pos;
+       __u8            green_size;
+       __u8            green_pos;
+       __u8            blue_size;
+       __u8            blue_pos;
+       __u8            rsvd_size;
+       __u8            rsvd_pos;
+};
+
+/* command line: \0 terminated string */
+#define ATAG_CMDLINE   0x54410009
+
+struct tag_cmdline {
+       char    cmdline[1];     /* this is the minimum size */
+};
+
+/* acorn RiscPC specific information */
+#define ATAG_ACORN     0x41000101
+
+struct tag_acorn {
+       __u32 memc_control_reg;
+       __u32 vram_pages;
+       __u8 sounddefault;
+       __u8 adfsdrives;
+};
+
+/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
+#define ATAG_MEMCLK    0x41000402
+
+struct tag_memclk {
+       __u32 fmemclk;
+};
+
+struct tag {
+       struct tag_header hdr;
+       union {
+               struct tag_core         core;
+               struct tag_mem32        mem;
+               struct tag_videotext    videotext;
+               struct tag_ramdisk      ramdisk;
+               struct tag_initrd       initrd;
+               struct tag_serialnr     serialnr;
+               struct tag_revision     revision;
+               struct tag_videolfb     videolfb;
+               struct tag_cmdline      cmdline;
+
+               /*
+                * Acorn specific
+                */
+               struct tag_acorn        acorn;
+
+               /*
+                * DC21285 specific
+                */
+               struct tag_memclk       memclk;
+       } u;
+};
+
+struct tagtable {
+       __u32 tag;
+       int (*parse)(const struct tag *);
+};
+
+#define tag_member_present(tag,member)                         \
+       ((unsigned long)(&((struct tag *)0L)->member + 1)       \
+               <= (tag)->hdr.size * 4)
+
+#define tag_next(t)    ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
+#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
+
+#define for_each_tag(t,base)           \
+       for (t = base; t->hdr.size; t = tag_next(t))
+
+#ifdef __KERNEL__
+
+#define __tag __used __attribute__((__section__(".taglist.init")))
+#define __tagtable(tag, fn) \
+static struct tagtable __tagtable_##fn __tag = { tag, fn }
+
+/*
+ * Memory map description
+ */
+#ifdef CONFIG_ARCH_LH7A40X
+# define NR_BANKS 16
+#else
+# define NR_BANKS 8
+#endif
+
+struct membank {
+       unsigned long start;
+       unsigned long size;
+       int           node;
+};
+
+struct meminfo {
+       int nr_banks;
+       struct membank bank[NR_BANKS];
+};
+
+/*
+ * Early command line parameters.
+ */
+struct early_params {
+       const char *arg;
+       void (*fn)(char **p);
+};
+
+#define __early_param(name,fn)                                 \
+static struct early_params __early_##fn __used                 \
+__attribute__((__section__(".early_param.init"))) = { name, fn }
+
+#endif  /*  __KERNEL__  */
+
+#endif
diff --git a/arch/arm/include/asm/shmbuf.h b/arch/arm/include/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..2e5c67b
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASMARM_SHMBUF_H
+#define _ASMARM_SHMBUF_H
+
+/* 
+ * The shmid64_ds structure for arm architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-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 */
+       unsigned long           __unused1;
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       unsigned long           __unused2;
+       __kernel_time_t         shm_ctime;      /* last change time */
+       unsigned long           __unused3;
+       __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           __unused4;
+       unsigned long           __unused5;
+};
+
+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 /* _ASMARM_SHMBUF_H */
diff --git a/arch/arm/include/asm/shmparam.h b/arch/arm/include/asm/shmparam.h
new file mode 100644 (file)
index 0000000..a5223b3
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASMARM_SHMPARAM_H
+#define _ASMARM_SHMPARAM_H
+
+/*
+ * This should be the size of the virtually indexed cache/ways,
+ * or page size, whichever is greater since the cache aliases
+ * every size/ways bytes.
+ */
+#define        SHMLBA  (4 * PAGE_SIZE)          /* attach addr a multiple of this */
+
+/*
+ * Enforce SHMLBA in shmat
+ */
+#define __ARCH_FORCE_SHMLBA
+
+#endif /* _ASMARM_SHMPARAM_H */
diff --git a/arch/arm/include/asm/sigcontext.h b/arch/arm/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..fc0b80b
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _ASMARM_SIGCONTEXT_H
+#define _ASMARM_SIGCONTEXT_H
+
+/*
+ * Signal context structure - contains all info to do with the state
+ * before the signal handler was invoked.  Note: only add new entries
+ * to the end of the structure.
+ */
+struct sigcontext {
+       unsigned long trap_no;
+       unsigned long error_code;
+       unsigned long oldmask;
+       unsigned long arm_r0;
+       unsigned long arm_r1;
+       unsigned long arm_r2;
+       unsigned long arm_r3;
+       unsigned long arm_r4;
+       unsigned long arm_r5;
+       unsigned long arm_r6;
+       unsigned long arm_r7;
+       unsigned long arm_r8;
+       unsigned long arm_r9;
+       unsigned long arm_r10;
+       unsigned long arm_fp;
+       unsigned long arm_ip;
+       unsigned long arm_sp;
+       unsigned long arm_lr;
+       unsigned long arm_pc;
+       unsigned long arm_cpsr;
+       unsigned long fault_address;
+};
+
+
+#endif
diff --git a/arch/arm/include/asm/siginfo.h b/arch/arm/include/asm/siginfo.h
new file mode 100644 (file)
index 0000000..5e21852
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASMARM_SIGINFO_H
+#define _ASMARM_SIGINFO_H
+
+#include <asm-generic/siginfo.h>
+
+#endif
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
new file mode 100644 (file)
index 0000000..d0fb487
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef _ASMARM_SIGNAL_H
+#define _ASMARM_SIGNAL_H
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+
+#ifdef __KERNEL__
+/* 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      32
+#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__ */
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGBUS          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGUSR1                10
+#define SIGSEGV                11
+#define SIGUSR2                12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGSTKFLT      16
+#define SIGCHLD                17
+#define SIGCONT                18
+#define SIGSTOP                19
+#define SIGTSTP                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGURG         23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGIO          29
+#define SIGPOLL                SIGIO
+/*
+#define SIGLOST                29
+*/
+#define SIGPWR         30
+#define SIGSYS         31
+#define        SIGUNUSED       31
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       32
+#define SIGRTMAX       _NSIG
+
+#define SIGSWI         32
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_NOCLDSTOP                flag to turn off SIGCHLD when children stop.
+ * SA_NOCLDWAIT                flag on SIGCHLD to inhibit zombies.
+ * SA_SIGINFO          deliver the signal with SIGINFO structs
+ * SA_THIRTYTWO                delivers the signal in 32-bit mode, even if the task 
+ *                     is running in 26-bit.
+ * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
+ * SA_RESTART          flag to get restarting signals (which were the default long ago)
+ * SA_NODEFER          prevents the current signal from being masked in the handler.
+ * SA_RESETHAND                clears the handler when the signal is delivered.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_NOCLDSTOP   0x00000001
+#define SA_NOCLDWAIT   0x00000002
+#define SA_SIGINFO     0x00000004
+#define SA_THIRTYTWO   0x02000000
+#define SA_RESTORER    0x04000000
+#define SA_ONSTACK     0x08000000
+#define SA_RESTART     0x10000000
+#define SA_NODEFER     0x40000000
+#define SA_RESETHAND   0x80000000
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+
+/* 
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+#include <asm-generic/signal.h>
+
+#ifdef __KERNEL__
+struct old_sigaction {
+       __sighandler_t sa_handler;
+       old_sigset_t sa_mask;
+       unsigned long sa_flags;
+       __sigrestore_t sa_restorer;
+};
+
+struct sigaction {
+       __sighandler_t sa_handler;
+       unsigned long sa_flags;
+       __sigrestore_t sa_restorer;
+       sigset_t sa_mask;               /* mask last for extensibility */
+};
+
+struct k_sigaction {
+       struct sigaction sa;
+};
+
+#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;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+#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;
+
+#ifdef __KERNEL__
+#include <asm/sigcontext.h>
+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h
new file mode 100644 (file)
index 0000000..503843d
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* DO NOT EDIT!! - this file automatically generated
+ *                 from .s file by awk -f s2h.awk
+ */
+/*  Size definitions
+ *  Copyright (C) ARM Limited 1998. All rights reserved.
+ */
+
+#ifndef __sizes_h
+#define __sizes_h                       1
+
+/* handy sizes */
+#define SZ_16                          0x00000010
+#define SZ_256                         0x00000100
+#define SZ_512                         0x00000200
+
+#define SZ_1K                           0x00000400
+#define SZ_4K                           0x00001000
+#define SZ_8K                           0x00002000
+#define SZ_16K                          0x00004000
+#define SZ_64K                          0x00010000
+#define SZ_128K                         0x00020000
+#define SZ_256K                         0x00040000
+#define SZ_512K                         0x00080000
+
+#define SZ_1M                           0x00100000
+#define SZ_2M                           0x00200000
+#define SZ_4M                           0x00400000
+#define SZ_8M                           0x00800000
+#define SZ_16M                          0x01000000
+#define SZ_32M                          0x02000000
+#define SZ_64M                          0x04000000
+#define SZ_128M                         0x08000000
+#define SZ_256M                         0x10000000
+#define SZ_512M                         0x20000000
+
+#define SZ_1G                           0x40000000
+#define SZ_2G                           0x80000000
+
+#endif
+
+/*         END */
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
new file mode 100644 (file)
index 0000000..cc12a52
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ *  arch/arm/include/asm/smp.h
+ *
+ *  Copyright (C) 2004-2005 ARM Ltd.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_SMP_H
+#define __ASM_ARM_SMP_H
+
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/thread_info.h>
+
+#include <asm/arch/smp.h>
+
+#ifndef CONFIG_SMP
+# error "<asm/smp.h> included in non-SMP build"
+#endif
+
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+
+/*
+ * at the moment, there's not a big penalty for changing CPUs
+ * (the >big< penalty is running SMP in the first place)
+ */
+#define PROC_CHANGE_PENALTY            15
+
+struct seq_file;
+
+/*
+ * generate IPI list text
+ */
+extern void show_ipi_list(struct seq_file *p);
+
+/*
+ * Called from assembly code, this handles an IPI.
+ */
+asmlinkage void do_IPI(struct pt_regs *regs);
+
+/*
+ * Setup the SMP cpu_possible_map
+ */
+extern void smp_init_cpus(void);
+
+/*
+ * Move global data into per-processor storage.
+ */
+extern void smp_store_cpu_info(unsigned int cpuid);
+
+/*
+ * Raise an IPI cross call on CPUs in callmap.
+ */
+extern void smp_cross_call(cpumask_t callmap);
+
+/*
+ * Broadcast a timer interrupt to the other CPUs.
+ */
+extern void smp_send_timer(void);
+
+/*
+ * Broadcast a clock event to other CPUs.
+ */
+extern void smp_timer_broadcast(cpumask_t mask);
+
+/*
+ * Boot a secondary CPU, and assign it the specified idle task.
+ * This also gives us the initial stack to use for this CPU.
+ */
+extern int boot_secondary(unsigned int cpu, struct task_struct *);
+
+/*
+ * Called from platform specific assembly code, this is the
+ * secondary CPU entry point.
+ */
+asmlinkage void secondary_start_kernel(void);
+
+/*
+ * Perform platform specific initialisation of the specified CPU.
+ */
+extern void platform_secondary_init(unsigned int cpu);
+
+/*
+ * Initial data for bringing up a secondary CPU.
+ */
+struct secondary_data {
+       unsigned long pgdir;
+       void *stack;
+};
+extern struct secondary_data secondary_data;
+
+extern int __cpu_disable(void);
+extern int mach_cpu_disable(unsigned int cpu);
+
+extern void __cpu_die(unsigned int cpu);
+extern void cpu_die(void);
+
+extern void platform_cpu_die(unsigned int cpu);
+extern int platform_cpu_kill(unsigned int cpu);
+extern void platform_cpu_enable(unsigned int cpu);
+
+extern void arch_send_call_function_single_ipi(int cpu);
+extern void arch_send_call_function_ipi(cpumask_t mask);
+
+/*
+ * Local timer interrupt handling function (can be IPI'ed).
+ */
+extern void local_timer_interrupt(void);
+
+#ifdef CONFIG_LOCAL_TIMERS
+
+/*
+ * Stop a local timer interrupt.
+ */
+extern void local_timer_stop(unsigned int cpu);
+
+/*
+ * Platform provides this to acknowledge a local timer IRQ
+ */
+extern int local_timer_ack(void);
+
+#else
+
+static inline void local_timer_stop(unsigned int cpu)
+{
+}
+
+#endif
+
+/*
+ * Setup a local timer interrupt for a CPU.
+ */
+extern void local_timer_setup(unsigned int cpu);
+
+/*
+ * show local interrupt info
+ */
+extern void show_local_irqs(struct seq_file *);
+
+/*
+ * Called from assembly, this is the local timer IRQ handler
+ */
+asmlinkage void do_local_timer(struct pt_regs *);
+
+#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
new file mode 100644 (file)
index 0000000..6817be9
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef _ASMARM_SOCKET_H
+#define _ASMARM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+#define SOL_SOCKET     1
+
+#define SO_DEBUG       1
+#define SO_REUSEADDR   2
+#define SO_TYPE                3
+#define SO_ERROR       4
+#define SO_DONTROUTE   5
+#define SO_BROADCAST   6
+#define SO_SNDBUF      7
+#define SO_RCVBUF      8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE   9
+#define SO_OOBINLINE   10
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_LINGER      13
+#define SO_BSDCOMPAT   14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED    16
+#define SO_PEERCRED    17
+#define SO_RCVLOWAT    18
+#define SO_SNDLOWAT    19
+#define SO_RCVTIMEO    20
+#define SO_SNDTIMEO    21
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
+#define SO_SECURITY_ENCRYPTION_NETWORK         24
+
+#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_ACCEPTCONN          30
+
+#define SO_PEERSEC             31
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+#define SO_MARK                        36
+
+#endif /* _ASM_SOCKET_H */
diff --git a/arch/arm/include/asm/sockios.h b/arch/arm/include/asm/sockios.h
new file mode 100644 (file)
index 0000000..a2588a2
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ARCH_ARM_SOCKIOS_H
+#define __ARCH_ARM_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+#define FIOSETOWN      0x8901
+#define SIOCSPGRP      0x8902
+#define FIOGETOWN      0x8903
+#define SIOCGPGRP      0x8904
+#define SIOCATMARK     0x8905
+#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
+
+#endif
diff --git a/arch/arm/include/asm/sparsemem.h b/arch/arm/include/asm/sparsemem.h
new file mode 100644 (file)
index 0000000..2771581
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef ASMARM_SPARSEMEM_H
+#define ASMARM_SPARSEMEM_H
+
+#include <asm/memory.h>
+
+#define MAX_PHYSADDR_BITS      32
+#define MAX_PHYSMEM_BITS       32
+#define SECTION_SIZE_BITS      NODE_MEM_SIZE_BITS
+
+#endif
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
new file mode 100644 (file)
index 0000000..2b41ebb
--- /dev/null
@@ -0,0 +1,224 @@
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+#if __LINUX_ARM_ARCH__ < 6
+#error SMP not supported on pre-ARMv6 CPUs
+#endif
+
+/*
+ * ARMv6 Spin-locking.
+ *
+ * We exclusively read the old value.  If it is zero, we may have
+ * won the lock, so we try exclusively storing it.  A memory barrier
+ * is required after we get a lock, and before we release it, because
+ * V6 CPUs are assumed to have weakly ordered memory.
+ *
+ * Unlocked value: 0
+ * Locked value: 1
+ */
+
+#define __raw_spin_is_locked(x)                ((x)->lock != 0)
+#define __raw_spin_unlock_wait(lock) \
+       do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
+
+#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
+
+static inline void __raw_spin_lock(raw_spinlock_t *lock)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%1]\n"
+"      teq     %0, #0\n"
+#ifdef CONFIG_CPU_32v6K
+"      wfene\n"
+#endif
+"      strexeq %0, %2, [%1]\n"
+"      teqeq   %0, #0\n"
+"      bne     1b"
+       : "=&r" (tmp)
+       : "r" (&lock->lock), "r" (1)
+       : "cc");
+
+       smp_mb();
+}
+
+static inline int __raw_spin_trylock(raw_spinlock_t *lock)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__(
+"      ldrex   %0, [%1]\n"
+"      teq     %0, #0\n"
+"      strexeq %0, %2, [%1]"
+       : "=&r" (tmp)
+       : "r" (&lock->lock), "r" (1)
+       : "cc");
+
+       if (tmp == 0) {
+               smp_mb();
+               return 1;
+       } else {
+               return 0;
+       }
+}
+
+static inline void __raw_spin_unlock(raw_spinlock_t *lock)
+{
+       smp_mb();
+
+       __asm__ __volatile__(
+"      str     %1, [%0]\n"
+#ifdef CONFIG_CPU_32v6K
+"      mcr     p15, 0, %1, c7, c10, 4\n" /* DSB */
+"      sev"
+#endif
+       :
+       : "r" (&lock->lock), "r" (0)
+       : "cc");
+}
+
+/*
+ * RWLOCKS
+ *
+ *
+ * Write locks are easy - we just set bit 31.  When unlocking, we can
+ * just write zero since the lock is exclusively held.
+ */
+
+static inline void __raw_write_lock(raw_rwlock_t *rw)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%1]\n"
+"      teq     %0, #0\n"
+#ifdef CONFIG_CPU_32v6K
+"      wfene\n"
+#endif
+"      strexeq %0, %2, [%1]\n"
+"      teq     %0, #0\n"
+"      bne     1b"
+       : "=&r" (tmp)
+       : "r" (&rw->lock), "r" (0x80000000)
+       : "cc");
+
+       smp_mb();
+}
+
+static inline int __raw_write_trylock(raw_rwlock_t *rw)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%1]\n"
+"      teq     %0, #0\n"
+"      strexeq %0, %2, [%1]"
+       : "=&r" (tmp)
+       : "r" (&rw->lock), "r" (0x80000000)
+       : "cc");
+
+       if (tmp == 0) {
+               smp_mb();
+               return 1;
+       } else {
+               return 0;
+       }
+}
+
+static inline void __raw_write_unlock(raw_rwlock_t *rw)
+{
+       smp_mb();
+
+       __asm__ __volatile__(
+       "str    %1, [%0]\n"
+#ifdef CONFIG_CPU_32v6K
+"      mcr     p15, 0, %1, c7, c10, 4\n" /* DSB */
+"      sev\n"
+#endif
+       :
+       : "r" (&rw->lock), "r" (0)
+       : "cc");
+}
+
+/* write_can_lock - would write_trylock() succeed? */
+#define __raw_write_can_lock(x)                ((x)->lock == 0)
+
+/*
+ * Read locks are a bit more hairy:
+ *  - Exclusively load the lock value.
+ *  - Increment it.
+ *  - Store new lock value if positive, and we still own this location.
+ *    If the value is negative, we've already failed.
+ *  - If we failed to store the value, we want a negative result.
+ *  - If we failed, try again.
+ * Unlocking is similarly hairy.  We may have multiple read locks
+ * currently active.  However, we know we won't have any write
+ * locks.
+ */
+static inline void __raw_read_lock(raw_rwlock_t *rw)
+{
+       unsigned long tmp, tmp2;
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%2]\n"
+"      adds    %0, %0, #1\n"
+"      strexpl %1, %0, [%2]\n"
+#ifdef CONFIG_CPU_32v6K
+"      wfemi\n"
+#endif
+"      rsbpls  %0, %1, #0\n"
+"      bmi     1b"
+       : "=&r" (tmp), "=&r" (tmp2)
+       : "r" (&rw->lock)
+       : "cc");
+
+       smp_mb();
+}
+
+static inline void __raw_read_unlock(raw_rwlock_t *rw)
+{
+       unsigned long tmp, tmp2;
+
+       smp_mb();
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%2]\n"
+"      sub     %0, %0, #1\n"
+"      strex   %1, %0, [%2]\n"
+"      teq     %1, #0\n"
+"      bne     1b"
+#ifdef CONFIG_CPU_32v6K
+"\n    cmp     %0, #0\n"
+"      mcreq   p15, 0, %0, c7, c10, 4\n"
+"      seveq"
+#endif
+       : "=&r" (tmp), "=&r" (tmp2)
+       : "r" (&rw->lock)
+       : "cc");
+}
+
+static inline int __raw_read_trylock(raw_rwlock_t *rw)
+{
+       unsigned long tmp, tmp2 = 1;
+
+       __asm__ __volatile__(
+"1:    ldrex   %0, [%2]\n"
+"      adds    %0, %0, #1\n"
+"      strexpl %1, %0, [%2]\n"
+       : "=&r" (tmp), "+r" (tmp2)
+       : "r" (&rw->lock)
+       : "cc");
+
+       smp_mb();
+       return tmp2 == 0;
+}
+
+/* read_can_lock - would read_trylock() succeed? */
+#define __raw_read_can_lock(x)         ((x)->lock < 0x80000000)
+
+#define _raw_spin_relax(lock)  cpu_relax()
+#define _raw_read_relax(lock)  cpu_relax()
+#define _raw_write_relax(lock) cpu_relax()
+
+#endif /* __ASM_SPINLOCK_H */
diff --git a/arch/arm/include/asm/spinlock_types.h b/arch/arm/include/asm/spinlock_types.h
new file mode 100644 (file)
index 0000000..43e83f6
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __ASM_SPINLOCK_TYPES_H
+#define __ASM_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/arm/include/asm/stat.h b/arch/arm/include/asm/stat.h
new file mode 100644 (file)
index 0000000..42c0c13
--- /dev/null
@@ -0,0 +1,87 @@
+#ifndef _ASMARM_STAT_H
+#define _ASMARM_STAT_H
+
+struct __old_kernel_stat {
+       unsigned short st_dev;
+       unsigned short st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned short st_rdev;
+       unsigned long  st_size;
+       unsigned long  st_atime;
+       unsigned long  st_mtime;
+       unsigned long  st_ctime;
+};
+
+#define STAT_HAVE_NSEC 
+
+struct stat {
+#if defined(__ARMEB__)
+       unsigned short st_dev;
+       unsigned short __pad1;
+#else
+       unsigned long  st_dev;
+#endif
+       unsigned long  st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+#if defined(__ARMEB__)
+       unsigned short st_rdev;
+       unsigned short __pad2;
+#else
+       unsigned long  st_rdev;
+#endif
+       unsigned long  st_size;
+       unsigned long  st_blksize;
+       unsigned long  st_blocks;
+       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;
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ * Note: The kernel zero's the padded region because glibc might read them
+ * in the hope that the kernel has stretched to using larger sizes.
+ */
+struct stat64 {
+       unsigned long long      st_dev;
+       unsigned char   __pad0[4];
+
+#define STAT64_HAS_BROKEN_ST_INO       1
+       unsigned long   __st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned long long      st_rdev;
+       unsigned char   __pad3[4];
+
+       long long       st_size;
+       unsigned long   st_blksize;
+       unsigned long long st_blocks;   /* Number 512-byte blocks allocated. */
+
+       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;
+
+       unsigned long long      st_ino;
+};
+
+#endif
diff --git a/arch/arm/include/asm/statfs.h b/arch/arm/include/asm/statfs.h
new file mode 100644 (file)
index 0000000..a02e6a8
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASMARM_STATFS_H
+#define _ASMARM_STATFS_H
+
+#ifndef __KERNEL_STRICT_NAMES
+# include <linux/types.h>
+typedef __kernel_fsid_t        fsid_t;
+#endif
+
+struct statfs {
+       __u32 f_type;
+       __u32 f_bsize;
+       __u32 f_blocks;
+       __u32 f_bfree;
+       __u32 f_bavail;
+       __u32 f_files;
+       __u32 f_ffree;
+       __kernel_fsid_t f_fsid;
+       __u32 f_namelen;
+       __u32 f_frsize;
+       __u32 f_spare[5];
+};
+
+/*
+ * With EABI there is 4 bytes of padding added to this structure.
+ * Let's pack it so the padding goes away to simplify dual ABI support.
+ * Note that user space does NOT have to pack this structure.
+ */
+struct statfs64 {
+       __u32 f_type;
+       __u32 f_bsize;
+       __u64 f_blocks;
+       __u64 f_bfree;
+       __u64 f_bavail;
+       __u64 f_files;
+       __u64 f_ffree;
+       __kernel_fsid_t f_fsid;
+       __u32 f_namelen;
+       __u32 f_frsize;
+       __u32 f_spare[5];
+} __attribute__ ((packed,aligned(4)));
+
+#endif
diff --git a/arch/arm/include/asm/string.h b/arch/arm/include/asm/string.h
new file mode 100644 (file)
index 0000000..e50c4a3
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __ASM_ARM_STRING_H
+#define __ASM_ARM_STRING_H
+
+/*
+ * We don't do inline string functions, since the
+ * optimised inline asm versions are not small.
+ */
+
+#define __HAVE_ARCH_STRRCHR
+extern char * strrchr(const char * s, int c);
+
+#define __HAVE_ARCH_STRCHR
+extern char * strchr(const char * s, int c);
+
+#define __HAVE_ARCH_MEMCPY
+extern void * memcpy(void *, const void *, __kernel_size_t);
+
+#define __HAVE_ARCH_MEMMOVE
+extern void * memmove(void *, const void *, __kernel_size_t);
+
+#define __HAVE_ARCH_MEMCHR
+extern void * memchr(const void *, int, __kernel_size_t);
+
+#define __HAVE_ARCH_MEMZERO
+#define __HAVE_ARCH_MEMSET
+extern void * memset(void *, int, __kernel_size_t);
+
+extern void __memzero(void *ptr, __kernel_size_t n);
+
+#define memset(p,v,n)                                                  \
+       ({                                                              \
+               void *__p = (p); size_t __n = n;                        \
+               if ((__n) != 0) {                                       \
+                       if (__builtin_constant_p((v)) && (v) == 0)      \
+                               __memzero((__p),(__n));                 \
+                       else                                            \
+                               memset((__p),(v),(__n));                \
+               }                                                       \
+               (__p);                                                  \
+       })
+
+#define memzero(p,n)                                                   \
+       ({                                                              \
+               void *__p = (p); size_t __n = n;                        \
+               if ((__n) != 0)                                         \
+                       __memzero((__p),(__n));                         \
+               (__p);                                                  \
+        })
+
+#endif
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
new file mode 100644 (file)
index 0000000..cf0d0bd
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef _ASMARM_SUSPEND_H
+#define _ASMARM_SUSPEND_H
+
+#endif
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
new file mode 100644 (file)
index 0000000..514af79
--- /dev/null
@@ -0,0 +1,388 @@
+#ifndef __ASM_ARM_SYSTEM_H
+#define __ASM_ARM_SYSTEM_H
+
+#ifdef __KERNEL__
+
+#include <asm/memory.h>
+
+#define CPU_ARCH_UNKNOWN       0
+#define CPU_ARCH_ARMv3         1
+#define CPU_ARCH_ARMv4         2
+#define CPU_ARCH_ARMv4T                3
+#define CPU_ARCH_ARMv5         4
+#define CPU_ARCH_ARMv5T                5
+#define CPU_ARCH_ARMv5TE       6
+#define CPU_ARCH_ARMv5TEJ      7
+#define CPU_ARCH_ARMv6         8
+#define CPU_ARCH_ARMv7         9
+
+/*
+ * CR1 bits (CP#15 CR1)
+ */
+#define CR_M   (1 << 0)        /* MMU enable                           */
+#define CR_A   (1 << 1)        /* Alignment abort enable               */
+#define CR_C   (1 << 2)        /* Dcache enable                        */
+#define CR_W   (1 << 3)        /* Write buffer enable                  */
+#define CR_P   (1 << 4)        /* 32-bit exception handler             */
+#define CR_D   (1 << 5)        /* 32-bit data address range            */
+#define CR_L   (1 << 6)        /* Implementation defined               */
+#define CR_B   (1 << 7)        /* Big endian                           */
+#define CR_S   (1 << 8)        /* System MMU protection                */
+#define CR_R   (1 << 9)        /* ROM MMU protection                   */
+#define CR_F   (1 << 10)       /* Implementation defined               */
+#define CR_Z   (1 << 11)       /* Implementation defined               */
+#define CR_I   (1 << 12)       /* Icache enable                        */
+#define CR_V   (1 << 13)       /* Vectors relocated to 0xffff0000      */
+#define CR_RR  (1 << 14)       /* Round Robin cache replacement        */
+#define CR_L4  (1 << 15)       /* LDR pc can set T bit                 */
+#define CR_DT  (1 << 16)
+#define CR_IT  (1 << 18)
+#define CR_ST  (1 << 19)
+#define CR_FI  (1 << 21)       /* Fast interrupt (lower latency mode)  */
+#define CR_U   (1 << 22)       /* Unaligned access operation           */
+#define CR_XP  (1 << 23)       /* Extended page tables                 */
+#define CR_VE  (1 << 24)       /* Vectored interrupts                  */
+
+#define CPUID_ID       0
+#define CPUID_CACHETYPE        1
+#define CPUID_TCM      2
+#define CPUID_TLBTYPE  3
+
+/*
+ * This is used to ensure the compiler did actually allocate the register we
+ * asked it for some inline assembly sequences.  Apparently we can't trust
+ * the compiler from one version to another so a bit of paranoia won't hurt.
+ * This string is meant to be concatenated with the inline asm string and
+ * will cause compilation to stop on mismatch.
+ * (for details, see gcc PR 15089)
+ */
+#define __asmeq(x, y)  ".ifnc " x "," y " ; .err ; .endif\n\t"
+
+#ifndef __ASSEMBLY__
+
+#include <linux/linkage.h>
+#include <linux/stringify.h>
+#include <linux/irqflags.h>
+
+#ifdef CONFIG_CPU_CP15
+#define read_cpuid(reg)                                                        \
+       ({                                                              \
+               unsigned int __val;                                     \
+               asm("mrc        p15, 0, %0, c0, c0, " __stringify(reg)  \
+                   : "=r" (__val)                                      \
+                   :                                                   \
+                   : "cc");                                            \
+               __val;                                                  \
+       })
+#else
+extern unsigned int processor_id;
+#define read_cpuid(reg) (processor_id)
+#endif
+
+/*
+ * The CPU ID never changes at run time, so we might as well tell the
+ * compiler that it's constant.  Use this function to read the CPU ID
+ * rather than directly reading processor_id or read_cpuid() directly.
+ */
+static inline unsigned int read_cpuid_id(void) __attribute_const__;
+
+static inline unsigned int read_cpuid_id(void)
+{
+       return read_cpuid(CPUID_ID);
+}
+
+#define __exception    __attribute__((section(".exception.text")))
+
+struct thread_info;
+struct task_struct;
+
+/* information about the system we're running on */
+extern unsigned int system_rev;
+extern unsigned int system_serial_low;
+extern unsigned int system_serial_high;
+extern unsigned int mem_fclk_21285;
+
+struct pt_regs;
+
+void die(const char *msg, struct pt_regs *regs, int err)
+               __attribute__((noreturn));
+
+struct siginfo;
+void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
+               unsigned long err, unsigned long trap);
+
+void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
+                                      struct pt_regs *),
+                    int sig, const char *name);
+
+#define xchg(ptr,x) \
+       ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
+
+extern asmlinkage void __backtrace(void);
+extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
+
+struct mm_struct;
+extern void show_pte(struct mm_struct *mm, unsigned long addr);
+extern void __show_regs(struct pt_regs *);
+
+extern int cpu_architecture(void);
+extern void cpu_init(void);
+
+void arm_machine_restart(char mode);
+extern void (*arm_pm_restart)(char str);
+
+/*
+ * Intel's XScale3 core supports some v6 features (supersections, L2)
+ * but advertises itself as v5 as it does not support the v6 ISA.  For
+ * this reason, we need a way to explicitly test for this type of CPU.
+ */
+#ifndef CONFIG_CPU_XSC3
+#define cpu_is_xsc3()  0
+#else
+static inline int cpu_is_xsc3(void)
+{
+       extern unsigned int processor_id;
+
+       if ((processor_id & 0xffffe000) == 0x69056000)
+               return 1;
+
+       return 0;
+}
+#endif
+
+#if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3)
+#define        cpu_is_xscale() 0
+#else
+#define        cpu_is_xscale() 1
+#endif
+
+#define UDBG_UNDEFINED (1 << 0)
+#define UDBG_SYSCALL   (1 << 1)
+#define UDBG_BADABORT  (1 << 2)
+#define UDBG_SEGV      (1 << 3)
+#define UDBG_BUS       (1 << 4)
+
+extern unsigned int user_debug;
+
+#if __LINUX_ARM_ARCH__ >= 4
+#define vectors_high() (cr_alignment & CR_V)
+#else
+#define vectors_high() (0)
+#endif
+
+#if __LINUX_ARM_ARCH__ >= 7
+#define isb() __asm__ __volatile__ ("isb" : : : "memory")
+#define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
+#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
+#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
+#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
+                                   : : "r" (0) : "memory")
+#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
+                                   : : "r" (0) : "memory")
+#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
+                                   : : "r" (0) : "memory")
+#else
+#define isb() __asm__ __volatile__ ("" : : : "memory")
+#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
+                                   : : "r" (0) : "memory")
+#define dmb() __asm__ __volatile__ ("" : : : "memory")
+#endif
+
+#ifndef CONFIG_SMP
+#define mb()   do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
+#define rmb()  do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
+#define wmb()  do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
+#define smp_mb()       barrier()
+#define smp_rmb()      barrier()
+#define smp_wmb()      barrier()
+#else
+#define mb()           dmb()
+#define rmb()          dmb()
+#define wmb()          dmb()
+#define smp_mb()       dmb()
+#define smp_rmb()      dmb()
+#define smp_wmb()      dmb()
+#endif
+#define read_barrier_depends()         do { } while(0)
+#define smp_read_barrier_depends()     do { } while(0)
+
+#define set_mb(var, value)     do { var = value; smp_mb(); } while (0)
+#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
+
+extern unsigned long cr_no_alignment;  /* defined in entry-armv.S */
+extern unsigned long cr_alignment;     /* defined in entry-armv.S */
+
+static inline unsigned int get_cr(void)
+{
+       unsigned int val;
+       asm("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
+       return val;
+}
+
+static inline void set_cr(unsigned int val)
+{
+       asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
+         : : "r" (val) : "cc");
+       isb();
+}
+
+#ifndef CONFIG_SMP
+extern void adjust_cr(unsigned long mask, unsigned long set);
+#endif
+
+#define CPACC_FULL(n)          (3 << (n * 2))
+#define CPACC_SVC(n)           (1 << (n * 2))
+#define CPACC_DISABLE(n)       (0 << (n * 2))
+
+static inline unsigned int get_copro_access(void)
+{
+       unsigned int val;
+       asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
+         : "=r" (val) : : "cc");
+       return val;
+}
+
+static inline void set_copro_access(unsigned int val)
+{
+       asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
+         : : "r" (val) : "cc");
+       isb();
+}
+
+/*
+ * switch_mm() may do a full cache flush over the context switch,
+ * so enable interrupts over the context switch to avoid high
+ * latency.
+ */
+#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
+
+/*
+ * switch_to(prev, next) should switch from task `prev' to `next'
+ * `prev' will never be the same as `next'.  schedule() itself
+ * contains the memory barrier to tell GCC not to cache `current'.
+ */
+extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
+
+#define switch_to(prev,next,last)                                      \
+do {                                                                   \
+       last = __switch_to(prev,task_thread_info(prev), task_thread_info(next));        \
+} while (0)
+
+#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
+/*
+ * On the StrongARM, "swp" is terminally broken since it bypasses the
+ * cache totally.  This means that the cache becomes inconsistent, and,
+ * since we use normal loads/stores as well, this is really bad.
+ * Typically, this causes oopsen in filp_close, but could have other,
+ * more disasterous effects.  There are two work-arounds:
+ *  1. Disable interrupts and emulate the atomic swap
+ *  2. Clean the cache, perform atomic swap, flush the cache
+ *
+ * We choose (1) since its the "easiest" to achieve here and is not
+ * dependent on the processor type.
+ *
+ * NOTE that this solution won't work on an SMP system, so explcitly
+ * forbid it here.
+ */
+#define swp_is_buggy
+#endif
+
+static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+{
+       extern void __bad_xchg(volatile void *, int);
+       unsigned long ret;
+#ifdef swp_is_buggy
+       unsigned long flags;
+#endif
+#if __LINUX_ARM_ARCH__ >= 6
+       unsigned int tmp;
+#endif
+
+       switch (size) {
+#if __LINUX_ARM_ARCH__ >= 6
+       case 1:
+               asm volatile("@ __xchg1\n"
+               "1:     ldrexb  %0, [%3]\n"
+               "       strexb  %1, %2, [%3]\n"
+               "       teq     %1, #0\n"
+               "       bne     1b"
+                       : "=&r" (ret), "=&r" (tmp)
+                       : "r" (x), "r" (ptr)
+                       : "memory", "cc");
+               break;
+       case 4:
+               asm volatile("@ __xchg4\n"
+               "1:     ldrex   %0, [%3]\n"
+               "       strex   %1, %2, [%3]\n"
+               "       teq     %1, #0\n"
+               "       bne     1b"
+                       : "=&r" (ret), "=&r" (tmp)
+                       : "r" (x), "r" (ptr)
+                       : "memory", "cc");
+               break;
+#elif defined(swp_is_buggy)
+#ifdef CONFIG_SMP
+#error SMP is not supported on this platform
+#endif
+       case 1:
+               raw_local_irq_save(flags);
+               ret = *(volatile unsigned char *)ptr;
+               *(volatile unsigned char *)ptr = x;
+               raw_local_irq_restore(flags);
+               break;
+
+       case 4:
+               raw_local_irq_save(flags);
+               ret = *(volatile unsigned long *)ptr;
+               *(volatile unsigned long *)ptr = x;
+               raw_local_irq_restore(flags);
+               break;
+#else
+       case 1:
+               asm volatile("@ __xchg1\n"
+               "       swpb    %0, %1, [%2]"
+                       : "=&r" (ret)
+                       : "r" (x), "r" (ptr)
+                       : "memory", "cc");
+               break;
+       case 4:
+               asm volatile("@ __xchg4\n"
+               "       swp     %0, %1, [%2]"
+                       : "=&r" (ret)
+                       : "r" (x), "r" (ptr)
+                       : "memory", "cc");
+               break;
+#endif
+       default:
+               __bad_xchg(ptr, size), ret = 0;
+               break;
+       }
+
+       return ret;
+}
+
+extern void disable_hlt(void);
+extern void enable_hlt(void);
+
+#include <asm-generic/cmpxchg-local.h>
+
+/*
+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
+ * them available.
+ */
+#define cmpxchg_local(ptr, o, n)                                              \
+       ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
+                       (unsigned long)(n), sizeof(*(ptr))))
+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+
+#ifndef CONFIG_SMP
+#include <asm-generic/cmpxchg.h>
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#define arch_align_stack(x) (x)
+
+#endif /* __KERNEL__ */
+
+#endif
diff --git a/arch/arm/include/asm/termbits.h b/arch/arm/include/asm/termbits.h
new file mode 100644 (file)
index 0000000..f784d11
--- /dev/null
@@ -0,0 +1,197 @@
+#ifndef __ASM_ARM_TERMBITS_H
+#define __ASM_ARM_TERMBITS_H
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+};
+
+struct termios2 {
+       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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* 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 IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0000400
+#define   NL0  0000000
+#define   NL1  0000400
+#define CRDLY  0003000
+#define   CR0  0000000
+#define   CR1  0001000
+#define   CR2  0002000
+#define   CR3  0003000
+#define TABDLY 0014000
+#define   TAB0 0000000
+#define   TAB1 0004000
+#define   TAB2 0010000
+#define   TAB3 0014000
+#define   XTABS        0014000
+#define BSDLY  0020000
+#define   BS0  0000000
+#define   BS1  0020000
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+#define FFDLY  0100000
+#define   FF0  0000000
+#define   FF1  0100000
+
+/* c_cflag bit meaning */
+#define CBAUD  0010017
+#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 CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define    BOTHER 0010000
+#define    B57600 0010001
+#define   B115200 0010002
+#define   B230400 0010003
+#define   B460800 0010004
+#define   B500000 0010005
+#define   B576000 0010006
+#define   B921600 0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define CIBAUD   002003600000          /* input baud rate */
+#define CMSPAR    010000000000         /* mark or space (stick) parity */
+#define CRTSCTS          020000000000          /* flow control */
+
+#define IBSHIFT           16
+
+/* c_lflag bits */
+#define ISIG   0000001
+#define ICANON 0000002
+#define XCASE  0000004
+#define ECHO   0000010
+#define ECHOE  0000020
+#define ECHOK  0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL        0001000
+#define ECHOPRT        0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/arch/arm/include/asm/termios.h b/arch/arm/include/asm/termios.h
new file mode 100644 (file)
index 0000000..293e3f1
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef __ASM_ARM_TERMIOS_H
+#define __ASM_ARM_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+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 */
+};
+
+#ifdef __KERNEL__
+/*     intr=^C         quit=^|         erase=del       kill=^U
+       eof=^D          vtime=\0        vmin=\1         sxtc=\0
+       start=^Q        stop=^S         susp=^Z         eol=\0
+       reprint=^R      discard=^U      werase=^W       lnext=^V
+       eol2=\0
+*/
+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
+#endif
+
+/* modem lines */
+#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
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+#ifdef __KERNEL__
+
+/*
+ * Translate a "termio" structure into a "termios". Ugh.
+ */
+#define SET_LOW_TERMIOS_BITS(termios, termio, x) {             \
+       unsigned short __tmp;                                   \
+       get_user(__tmp,&(termio)->x);                           \
+       *(unsigned short *) &(termios)->x = __tmp;              \
+}
+
+#define user_termio_to_kernel_termios(termios, termio) \
+({ \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
+       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
+})
+
+/*
+ * Translate a "termios" structure into a "termio". Ugh.
+ */
+#define kernel_termios_to_user_termio(termio, termios) \
+({ \
+       put_user((termios)->c_iflag, &(termio)->c_iflag); \
+       put_user((termios)->c_oflag, &(termio)->c_oflag); \
+       put_user((termios)->c_cflag, &(termio)->c_cflag); \
+       put_user((termios)->c_lflag, &(termio)->c_lflag); \
+       put_user((termios)->c_line,  &(termio)->c_line); \
+       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
+})
+
+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
+#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/arch/arm/include/asm/therm.h b/arch/arm/include/asm/therm.h
new file mode 100644 (file)
index 0000000..f002f01
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * arch/arm/include/asm/therm.h: Definitions for Dallas Semiconductor
+ *  DS1620 thermometer driver (as used in the Rebel.com NetWinder)
+ */
+#ifndef __ASM_THERM_H
+#define __ASM_THERM_H
+
+/* ioctl numbers for /dev/therm */
+#define CMD_SET_THERMOSTATE    0x53
+#define CMD_GET_THERMOSTATE    0x54
+#define CMD_GET_STATUS         0x56
+#define CMD_GET_TEMPERATURE    0x57
+#define CMD_SET_THERMOSTATE2   0x58
+#define CMD_GET_THERMOSTATE2   0x59
+#define CMD_GET_TEMPERATURE2   0x5a
+#define CMD_GET_FAN            0x5b
+#define CMD_SET_FAN            0x5c
+
+#define FAN_OFF                        0
+#define FAN_ON                 1
+#define FAN_ALWAYS_ON          2
+
+struct therm {
+       int hi;
+       int lo;
+};
+
+#endif
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..e56fa48
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ *  arch/arm/include/asm/thread_info.h
+ *
+ *  Copyright (C) 2002 Russell King.
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_THREAD_INFO_H
+#define __ASM_ARM_THREAD_INFO_H
+
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+#include <asm/fpstate.h>
+
+#define THREAD_SIZE_ORDER      1
+#define THREAD_SIZE            8192
+#define THREAD_START_SP                (THREAD_SIZE - 8)
+
+#ifndef __ASSEMBLY__
+
+struct task_struct;
+struct exec_domain;
+
+#include <asm/types.h>
+#include <asm/domain.h>
+
+typedef unsigned long mm_segment_t;
+
+struct cpu_context_save {
+       __u32   r4;
+       __u32   r5;
+       __u32   r6;
+       __u32   r7;
+       __u32   r8;
+       __u32   r9;
+       __u32   sl;
+       __u32   fp;
+       __u32   sp;
+       __u32   pc;
+       __u32   extra[2];               /* Xscale 'acc' register, etc */
+};
+
+/*
+ * low level task data that entry.S needs immediate access to.
+ * __switch_to() assumes cpu_context follows immediately after cpu_domain.
+ */
+struct thread_info {
+       unsigned long           flags;          /* low level flags */
+       int                     preempt_count;  /* 0 => preemptable, <0 => bug */
+       mm_segment_t            addr_limit;     /* address limit */
+       struct task_struct      *task;          /* main task structure */
+       struct exec_domain      *exec_domain;   /* execution domain */
+       __u32                   cpu;            /* cpu */
+       __u32                   cpu_domain;     /* cpu domain */
+       struct cpu_context_save cpu_context;    /* cpu context */
+       __u32                   syscall;        /* syscall number */
+       __u8                    used_cp[16];    /* thread used copro */
+       unsigned long           tp_value;
+       struct crunch_state     crunchstate;
+       union fp_state          fpstate __attribute__((aligned(8)));
+       union vfp_state         vfpstate;
+#ifdef CONFIG_ARM_THUMBEE
+       unsigned long           thumbee_state;  /* ThumbEE Handler Base register */
+#endif
+       struct restart_block    restart_block;
+};
+
+#define INIT_THREAD_INFO(tsk)                                          \
+{                                                                      \
+       .task           = &tsk,                                         \
+       .exec_domain    = &default_exec_domain,                         \
+       .flags          = 0,                                            \
+       .preempt_count  = 1,                                            \
+       .addr_limit     = KERNEL_DS,                                    \
+       .cpu_domain     = domain_val(DOMAIN_USER, DOMAIN_MANAGER) |     \
+                         domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) |   \
+                         domain_val(DOMAIN_IO, DOMAIN_CLIENT),         \
+       .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
+ */
+static inline struct thread_info *current_thread_info(void) __attribute_const__;
+
+static inline struct thread_info *current_thread_info(void)
+{
+       register unsigned long sp asm ("sp");
+       return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
+}
+
+#define thread_saved_pc(tsk)   \
+       ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc)))
+#define thread_saved_fp(tsk)   \
+       ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
+
+extern void crunch_task_disable(struct thread_info *);
+extern void crunch_task_copy(struct thread_info *, void *);
+extern void crunch_task_restore(struct thread_info *, void *);
+extern void crunch_task_release(struct thread_info *);
+
+extern void iwmmxt_task_disable(struct thread_info *);
+extern void iwmmxt_task_copy(struct thread_info *, void *);
+extern void iwmmxt_task_restore(struct thread_info *, void *);
+extern void iwmmxt_task_release(struct thread_info *);
+extern void iwmmxt_task_switch(struct thread_info *);
+
+#endif
+
+/*
+ * We use bit 30 of the preempt_count to indicate that kernel
+ * preemption is occurring.  See <asm/hardirq.h>.
+ */
+#define PREEMPT_ACTIVE 0x40000000
+
+/*
+ * thread information flags:
+ *  TIF_SYSCALL_TRACE  - syscall trace active
+ *  TIF_SIGPENDING     - signal pending
+ *  TIF_NEED_RESCHED   - rescheduling necessary
+ *  TIF_USEDFPU                - FPU was used by this task this quantum (SMP)
+ *  TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
+ */
+#define TIF_SIGPENDING         0
+#define TIF_NEED_RESCHED       1
+#define TIF_SYSCALL_TRACE      8
+#define TIF_POLLING_NRFLAG     16
+#define TIF_USING_IWMMXT       17
+#define TIF_MEMDIE             18
+#define TIF_FREEZE             19
+
+#define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
+#define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
+#define _TIF_POLLING_NRFLAG    (1 << TIF_POLLING_NRFLAG)
+#define _TIF_USING_IWMMXT      (1 << TIF_USING_IWMMXT)
+#define _TIF_FREEZE            (1 << TIF_FREEZE)
+
+/*
+ * Change these and you break ASM code in entry-common.S
+ */
+#define _TIF_WORK_MASK         0x000000ff
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/arch/arm/include/asm/thread_notify.h b/arch/arm/include/asm/thread_notify.h
new file mode 100644 (file)
index 0000000..f27379d
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ *  arch/arm/include/asm/thread_notify.h
+ *
+ *  Copyright (C) 2006 Russell King.
+ *
+ * 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.
+ */
+#ifndef ASMARM_THREAD_NOTIFY_H
+#define ASMARM_THREAD_NOTIFY_H
+
+#ifdef __KERNEL__
+
+#ifndef __ASSEMBLY__
+
+#include <linux/notifier.h>
+#include <asm/thread_info.h>
+
+static inline int thread_register_notifier(struct notifier_block *n)
+{
+       extern struct atomic_notifier_head thread_notify_head;
+       return atomic_notifier_chain_register(&thread_notify_head, n);
+}
+
+static inline void thread_unregister_notifier(struct notifier_block *n)
+{
+       extern struct atomic_notifier_head thread_notify_head;
+       atomic_notifier_chain_unregister(&thread_notify_head, n);
+}
+
+static inline void thread_notify(unsigned long rc, struct thread_info *thread)
+{
+       extern struct atomic_notifier_head thread_notify_head;
+       atomic_notifier_call_chain(&thread_notify_head, rc, thread);
+}
+
+#endif
+
+/*
+ * These are the reason codes for the thread notifier.
+ */
+#define THREAD_NOTIFY_FLUSH    0
+#define THREAD_NOTIFY_RELEASE  1
+#define THREAD_NOTIFY_SWITCH   2
+
+#endif
+#endif
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
new file mode 100644 (file)
index 0000000..e50e292
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  arch/arm/include/asm/timex.h
+ *
+ *  Copyright (C) 1997,1998 Russell King
+ *
+ * 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.
+ *
+ *  Architecture Specific TIME specifications
+ */
+#ifndef _ASMARM_TIMEX_H
+#define _ASMARM_TIMEX_H
+
+#include <asm/arch/timex.h>
+
+typedef unsigned long cycles_t;
+
+static inline cycles_t get_cycles (void)
+{
+       return 0;
+}
+
+#endif
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..857f1df
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *  arch/arm/include/asm/tlb.h
+ *
+ *  Copyright (C) 2002 Russell King
+ *
+ * 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.
+ *
+ *  Experimentation shows that on a StrongARM, it appears to be faster
+ *  to use the "invalidate whole tlb" rather than "invalidate single
+ *  tlb" for this.
+ *
+ *  This appears true for both the process fork+exit case, as well as
+ *  the munmap-large-area case.
+ */
+#ifndef __ASMARM_TLB_H
+#define __ASMARM_TLB_H
+
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
+
+#ifndef CONFIG_MMU
+
+#include <linux/pagemap.h>
+#include <asm-generic/tlb.h>
+
+#else /* !CONFIG_MMU */
+
+#include <asm/pgalloc.h>
+
+/*
+ * TLB handling.  This allows us to remove pages from the page
+ * tables, and efficiently handle the TLB issues.
+ */
+struct mmu_gather {
+       struct mm_struct        *mm;
+       unsigned int            fullmm;
+};
+
+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
+
+static inline struct mmu_gather *
+tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
+{
+       struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
+
+       tlb->mm = mm;
+       tlb->fullmm = full_mm_flush;
+
+       return tlb;
+}
+
+static inline void
+tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
+{
+       if (tlb->fullmm)
+               flush_tlb_mm(tlb->mm);
+
+       /* keep the page table cache within bounds */
+       check_pgt_cache();
+
+       put_cpu_var(mmu_gathers);
+}
+
+#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
+
+/*
+ * In the case of tlb vma handling, we can optimise these away in the
+ * case where we're doing a full MM flush.  When we're doing a munmap,
+ * the vmas are adjusted to only cover the region to be torn down.
+ */
+static inline void
+tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
+{
+       if (!tlb->fullmm)
+               flush_cache_range(vma, vma->vm_start, vma->vm_end);
+}
+
+static inline void
+tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
+{
+       if (!tlb->fullmm)
+               flush_tlb_range(vma, vma->vm_start, vma->vm_end);
+}
+
+#define tlb_remove_page(tlb,page)      free_page_and_swap_cache(page)
+#define pte_free_tlb(tlb, ptep)                pte_free((tlb)->mm, ptep)
+#define pmd_free_tlb(tlb, pmdp)                pmd_free((tlb)->mm, pmdp)
+
+#define tlb_migrate_finish(mm)         do { } while (0)
+
+#endif /* CONFIG_MMU */
+#endif
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
new file mode 100644 (file)
index 0000000..0d0d40f
--- /dev/null
@@ -0,0 +1,500 @@
+/*
+ *  arch/arm/include/asm/tlbflush.h
+ *
+ *  Copyright (C) 1999-2003 Russell King
+ *
+ * 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.
+ */
+#ifndef _ASMARM_TLBFLUSH_H
+#define _ASMARM_TLBFLUSH_H
+
+
+#ifndef CONFIG_MMU
+
+#define tlb_flush(tlb) ((void) tlb)
+
+#else /* CONFIG_MMU */
+
+#include <asm/glue.h>
+
+#define TLB_V3_PAGE    (1 << 0)
+#define TLB_V4_U_PAGE  (1 << 1)
+#define TLB_V4_D_PAGE  (1 << 2)
+#define TLB_V4_I_PAGE  (1 << 3)
+#define TLB_V6_U_PAGE  (1 << 4)
+#define TLB_V6_D_PAGE  (1 << 5)
+#define TLB_V6_I_PAGE  (1 << 6)
+
+#define TLB_V3_FULL    (1 << 8)
+#define TLB_V4_U_FULL  (1 << 9)
+#define TLB_V4_D_FULL  (1 << 10)
+#define TLB_V4_I_FULL  (1 << 11)
+#define TLB_V6_U_FULL  (1 << 12)
+#define TLB_V6_D_FULL  (1 << 13)
+#define TLB_V6_I_FULL  (1 << 14)
+
+#define TLB_V6_U_ASID  (1 << 16)
+#define TLB_V6_D_ASID  (1 << 17)
+#define TLB_V6_I_ASID  (1 << 18)
+
+#define TLB_L2CLEAN_FR (1 << 29)               /* Feroceon */
+#define TLB_DCLEAN     (1 << 30)
+#define TLB_WB         (1 << 31)
+
+/*
+ *     MMU TLB Model
+ *     =============
+ *
+ *     We have the following to choose from:
+ *       v3    - ARMv3
+ *       v4    - ARMv4 without write buffer
+ *       v4wb  - ARMv4 with write buffer without I TLB flush entry instruction
+ *       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
+ */
+#undef _TLB
+#undef MULTI_TLB
+
+#define v3_tlb_flags   (TLB_V3_FULL | TLB_V3_PAGE)
+
+#ifdef CONFIG_CPU_TLB_V3
+# define v3_possible_flags     v3_tlb_flags
+# define v3_always_flags       v3_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v3
+# endif
+#else
+# define v3_possible_flags     0
+# define v3_always_flags       (-1UL)
+#endif
+
+#define v4_tlb_flags   (TLB_V4_U_FULL | TLB_V4_U_PAGE)
+
+#ifdef CONFIG_CPU_TLB_V4WT
+# define v4_possible_flags     v4_tlb_flags
+# define v4_always_flags       v4_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v4
+# endif
+#else
+# define v4_possible_flags     0
+# define v4_always_flags       (-1UL)
+#endif
+
+#define v4wbi_tlb_flags        (TLB_WB | TLB_DCLEAN | \
+                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
+                        TLB_V4_I_PAGE | TLB_V4_D_PAGE)
+
+#ifdef CONFIG_CPU_TLB_V4WBI
+# define v4wbi_possible_flags  v4wbi_tlb_flags
+# define v4wbi_always_flags    v4wbi_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v4wbi
+# endif
+#else
+# define v4wbi_possible_flags  0
+# define v4wbi_always_flags    (-1UL)
+#endif
+
+#define fr_tlb_flags   (TLB_WB | TLB_DCLEAN | TLB_L2CLEAN_FR | \
+                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
+                        TLB_V4_I_PAGE | TLB_V4_D_PAGE)
+
+#ifdef CONFIG_CPU_TLB_FEROCEON
+# define fr_possible_flags     fr_tlb_flags
+# define fr_always_flags       fr_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v4wbi
+# endif
+#else
+# define fr_possible_flags     0
+# define fr_always_flags       (-1UL)
+#endif
+
+#define v4wb_tlb_flags (TLB_WB | TLB_DCLEAN | \
+                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
+                        TLB_V4_D_PAGE)
+
+#ifdef CONFIG_CPU_TLB_V4WB
+# define v4wb_possible_flags   v4wb_tlb_flags
+# define v4wb_always_flags     v4wb_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v4wb
+# endif
+#else
+# define v4wb_possible_flags   0
+# define v4wb_always_flags     (-1UL)
+#endif
+
+#define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
+                        TLB_V6_I_FULL | TLB_V6_D_FULL | \
+                        TLB_V6_I_PAGE | TLB_V6_D_PAGE | \
+                        TLB_V6_I_ASID | TLB_V6_D_ASID)
+
+#ifdef CONFIG_CPU_TLB_V6
+# define v6wbi_possible_flags  v6wbi_tlb_flags
+# define v6wbi_always_flags    v6wbi_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v6wbi
+# endif
+#else
+# define v6wbi_possible_flags  0
+# define v6wbi_always_flags    (-1UL)
+#endif
+
+#ifdef CONFIG_CPU_TLB_V7
+# define v7wbi_possible_flags  v6wbi_tlb_flags
+# define v7wbi_always_flags    v6wbi_tlb_flags
+# ifdef _TLB
+#  define MULTI_TLB 1
+# else
+#  define _TLB v7wbi
+# endif
+#else
+# define v7wbi_possible_flags  0
+# define v7wbi_always_flags    (-1UL)
+#endif
+
+#ifndef _TLB
+#error Unknown TLB model
+#endif
+
+#ifndef __ASSEMBLY__
+
+#include <linux/sched.h>
+
+struct cpu_tlb_fns {
+       void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
+       void (*flush_kern_range)(unsigned long, unsigned long);
+       unsigned long tlb_flags;
+};
+
+/*
+ * Select the calling method
+ */
+#ifdef MULTI_TLB
+
+#define __cpu_flush_user_tlb_range     cpu_tlb.flush_user_range
+#define __cpu_flush_kern_tlb_range     cpu_tlb.flush_kern_range
+
+#else
+
+#define __cpu_flush_user_tlb_range     __glue(_TLB,_flush_user_tlb_range)
+#define __cpu_flush_kern_tlb_range     __glue(_TLB,_flush_kern_tlb_range)
+
+extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long, struct vm_area_struct *);
+extern void __cpu_flush_kern_tlb_range(unsigned long, unsigned long);
+
+#endif
+
+extern struct cpu_tlb_fns cpu_tlb;
+
+#define __cpu_tlb_flags                        cpu_tlb.tlb_flags
+
+/*
+ *     TLB Management
+ *     ==============
+ *
+ *     The arch/arm/mm/tlb-*.S files implement these methods.
+ *
+ *     The TLB specific code is expected to perform whatever tests it
+ *     needs to determine if it should invalidate the TLB for each
+ *     call.  Start addresses are inclusive and end addresses are
+ *     exclusive; it is safe to round these addresses down.
+ *
+ *     flush_tlb_all()
+ *
+ *             Invalidate the entire TLB.
+ *
+ *     flush_tlb_mm(mm)
+ *
+ *             Invalidate all TLB entries in a particular address
+ *             space.
+ *             - mm    - mm_struct describing address space
+ *
+ *     flush_tlb_range(mm,start,end)
+ *
+ *             Invalidate a range of TLB entries in the specified
+ *             address space.
+ *             - mm    - mm_struct describing address space
+ *             - start - start address (may not be aligned)
+ *             - end   - end address (exclusive, may not be aligned)
+ *
+ *     flush_tlb_page(vaddr,vma)
+ *
+ *             Invalidate the specified page in the specified address range.
+ *             - vaddr - virtual address (may not be aligned)
+ *             - vma   - vma_struct describing address range
+ *
+ *     flush_kern_tlb_page(kaddr)
+ *
+ *             Invalidate the TLB entry for the specified page.  The address
+ *             will be in the kernels virtual memory space.  Current uses
+ *             only require the D-TLB to be invalidated.
+ *             - kaddr - Kernel virtual memory address
+ */
+
+/*
+ * We optimise the code below by:
+ *  - building a set of TLB flags that might be set in __cpu_tlb_flags
+ *  - building a set of TLB flags that will always be set in __cpu_tlb_flags
+ *  - if we're going to need __cpu_tlb_flags, access it once and only once
+ *
+ * This allows us to build optimal assembly for the single-CPU type case,
+ * and as close to optimal given the compiler constrants for multi-CPU
+ * case.  We could do better for the multi-CPU case if the compiler
+ * implemented the "%?" method, but this has been discontinued due to too
+ * many people getting it wrong.
+ */
+#define possible_tlb_flags     (v3_possible_flags | \
+                                v4_possible_flags | \
+                                v4wbi_possible_flags | \
+                                fr_possible_flags | \
+                                v4wb_possible_flags | \
+                                v6wbi_possible_flags)
+
+#define always_tlb_flags       (v3_always_flags & \
+                                v4_always_flags & \
+                                v4wbi_always_flags & \
+                                fr_always_flags & \
+                                v4wb_always_flags & \
+                                v6wbi_always_flags)
+
+#define tlb_flag(f)    ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
+
+static inline void local_flush_tlb_all(void)
+{
+       const int zero = 0;
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       if (tlb_flag(TLB_WB))
+               dsb();
+
+       if (tlb_flag(TLB_V3_FULL))
+               asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
+       if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL))
+               asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
+       if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL))
+               asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
+       if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
+               asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+               isb();
+       }
+}
+
+static inline void local_flush_tlb_mm(struct mm_struct *mm)
+{
+       const int zero = 0;
+       const int asid = ASID(mm);
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       if (tlb_flag(TLB_WB))
+               dsb();
+
+       if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) {
+               if (tlb_flag(TLB_V3_FULL))
+                       asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
+               if (tlb_flag(TLB_V4_U_FULL))
+                       asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
+               if (tlb_flag(TLB_V4_D_FULL))
+                       asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
+               if (tlb_flag(TLB_V4_I_FULL))
+                       asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
+       }
+
+       if (tlb_flag(TLB_V6_U_ASID))
+               asm("mcr p15, 0, %0, c8, c7, 2" : : "r" (asid) : "cc");
+       if (tlb_flag(TLB_V6_D_ASID))
+               asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
+       if (tlb_flag(TLB_V6_I_ASID))
+               asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+       }
+}
+
+static inline void
+local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
+{
+       const int zero = 0;
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
+
+       if (tlb_flag(TLB_WB))
+               dsb();
+
+       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
+               if (tlb_flag(TLB_V3_PAGE))
+                       asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc");
+               if (tlb_flag(TLB_V4_U_PAGE))
+                       asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
+               if (tlb_flag(TLB_V4_D_PAGE))
+                       asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
+               if (tlb_flag(TLB_V4_I_PAGE))
+                       asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
+               if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
+                       asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
+       }
+
+       if (tlb_flag(TLB_V6_U_PAGE))
+               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
+       if (tlb_flag(TLB_V6_D_PAGE))
+               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
+       if (tlb_flag(TLB_V6_I_PAGE))
+               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+       }
+}
+
+static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
+{
+       const int zero = 0;
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       kaddr &= PAGE_MASK;
+
+       if (tlb_flag(TLB_WB))
+               dsb();
+
+       if (tlb_flag(TLB_V3_PAGE))
+               asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc");
+       if (tlb_flag(TLB_V4_U_PAGE))
+               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
+       if (tlb_flag(TLB_V4_D_PAGE))
+               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
+       if (tlb_flag(TLB_V4_I_PAGE))
+               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
+       if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
+               asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
+
+       if (tlb_flag(TLB_V6_U_PAGE))
+               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
+       if (tlb_flag(TLB_V6_D_PAGE))
+               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
+       if (tlb_flag(TLB_V6_I_PAGE))
+               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
+
+       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
+                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
+                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
+               /* flush the branch target cache */
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
+               dsb();
+               isb();
+       }
+}
+
+/*
+ *     flush_pmd_entry
+ *
+ *     Flush a PMD entry (word aligned, or double-word aligned) to
+ *     RAM if the TLB for the CPU we are running on requires this.
+ *     This is typically used when we are creating PMD entries.
+ *
+ *     clean_pmd_entry
+ *
+ *     Clean (but don't drain the write buffer) if the CPU requires
+ *     these operations.  This is typically used when we are removing
+ *     PMD entries.
+ */
+static inline void flush_pmd_entry(pmd_t *pmd)
+{
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       if (tlb_flag(TLB_DCLEAN))
+               asm("mcr        p15, 0, %0, c7, c10, 1  @ flush_pmd"
+                       : : "r" (pmd) : "cc");
+
+       if (tlb_flag(TLB_L2CLEAN_FR))
+               asm("mcr        p15, 1, %0, c15, c9, 1  @ L2 flush_pmd"
+                       : : "r" (pmd) : "cc");
+
+       if (tlb_flag(TLB_WB))
+               dsb();
+}
+
+static inline void clean_pmd_entry(pmd_t *pmd)
+{
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       if (tlb_flag(TLB_DCLEAN))
+               asm("mcr        p15, 0, %0, c7, c10, 1  @ flush_pmd"
+                       : : "r" (pmd) : "cc");
+
+       if (tlb_flag(TLB_L2CLEAN_FR))
+               asm("mcr        p15, 1, %0, c15, c9, 1  @ L2 flush_pmd"
+                       : : "r" (pmd) : "cc");
+}
+
+#undef tlb_flag
+#undef always_tlb_flags
+#undef possible_tlb_flags
+
+/*
+ * Convert calls to our calling convention.
+ */
+#define local_flush_tlb_range(vma,start,end)   __cpu_flush_user_tlb_range(start,end,vma)
+#define local_flush_tlb_kernel_range(s,e)      __cpu_flush_kern_tlb_range(s,e)
+
+#ifndef CONFIG_SMP
+#define flush_tlb_all          local_flush_tlb_all
+#define flush_tlb_mm           local_flush_tlb_mm
+#define flush_tlb_page         local_flush_tlb_page
+#define flush_tlb_kernel_page  local_flush_tlb_kernel_page
+#define flush_tlb_range                local_flush_tlb_range
+#define flush_tlb_kernel_range local_flush_tlb_kernel_range
+#else
+extern void flush_tlb_all(void);
+extern void flush_tlb_mm(struct mm_struct *mm);
+extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr);
+extern void flush_tlb_kernel_page(unsigned long kaddr);
+extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
+extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
+#endif
+
+/*
+ * if PG_dcache_dirty is set for the page, we need to ensure that any
+ * cache entries for the kernels virtual memory range are written
+ * back to the page.
+ */
+extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte);
+
+#endif
+
+#endif /* CONFIG_MMU */
+
+#endif
diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h
new file mode 100644 (file)
index 0000000..accbd7c
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_ARM_TOPOLOGY_H
+#define _ASM_ARM_TOPOLOGY_H
+
+#include <asm-generic/topology.h>
+
+#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
new file mode 100644 (file)
index 0000000..aa399ae
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _ASMARM_TRAP_H
+#define _ASMARM_TRAP_H
+
+#include <linux/list.h>
+
+struct undef_hook {
+       struct list_head node;
+       u32 instr_mask;
+       u32 instr_val;
+       u32 cpsr_mask;
+       u32 cpsr_val;
+       int (*fn)(struct pt_regs *regs, unsigned int instr);
+};
+
+void register_undef_hook(struct undef_hook *hook);
+void unregister_undef_hook(struct undef_hook *hook);
+
+static inline int in_exception_text(unsigned long ptr)
+{
+       extern char __exception_text_start[];
+       extern char __exception_text_end[];
+
+       return ptr >= (unsigned long)&__exception_text_start &&
+              ptr < (unsigned long)&__exception_text_end;
+}
+
+extern void __init early_trap_init(void);
+
+#endif
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
new file mode 100644 (file)
index 0000000..345df01
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __ASM_ARM_TYPES_H
+#define __ASM_ARM_TYPES_H
+
+#include <asm-generic/int-ll64.h>
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __KERNEL__
+
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
+/* Dma addresses are 32-bits wide.  */
+
+typedef u32 dma_addr_t;
+typedef u32 dma64_addr_t;
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __KERNEL__ */
+
+#endif
+
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..d0f51ff
--- /dev/null
@@ -0,0 +1,444 @@
+/*
+ *  arch/arm/include/asm/uaccess.h
+ *
+ * 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.
+ */
+#ifndef _ASMARM_UACCESS_H
+#define _ASMARM_UACCESS_H
+
+/*
+ * User space memory access functions
+ */
+#include <linux/sched.h>
+#include <asm/errno.h>
+#include <asm/memory.h>
+#include <asm/domain.h>
+#include <asm/system.h>
+
+#define VERIFY_READ 0
+#define VERIFY_WRITE 1
+
+/*
+ * The exception table consists of pairs of addresses: the first is the
+ * address of an instruction that is allowed to fault, and the second is
+ * the address at which the program should continue.  No registers are
+ * modified, so it is entirely up to the continuation code to figure out
+ * what to do.
+ *
+ * All the routines below use bits of fixup code that are out of line
+ * with the main instruction path.  This means when everything is well,
+ * we don't even have to jump over them.  Further, they do not intrude
+ * on our cache or tlb entries.
+ */
+
+struct exception_table_entry
+{
+       unsigned long insn, fixup;
+};
+
+extern int fixup_exception(struct pt_regs *regs);
+
+/*
+ * These two are intentionally not defined anywhere - if the kernel
+ * code generates any references to them, that's a bug.
+ */
+extern int __get_user_bad(void);
+extern int __put_user_bad(void);
+
+/*
+ * Note that this is actually 0x1,0000,0000
+ */
+#define KERNEL_DS      0x00000000
+#define get_ds()       (KERNEL_DS)
+
+#ifdef CONFIG_MMU
+
+#define USER_DS                TASK_SIZE
+#define get_fs()       (current_thread_info()->addr_limit)
+
+static inline void set_fs(mm_segment_t fs)
+{
+       current_thread_info()->addr_limit = fs;
+       modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
+}
+
+#define segment_eq(a,b)        ((a) == (b))
+
+#define __addr_ok(addr) ({ \
+       unsigned long flag; \
+       __asm__("cmp %2, %0; movlo %0, #0" \
+               : "=&r" (flag) \
+               : "0" (current_thread_info()->addr_limit), "r" (addr) \
+               : "cc"); \
+       (flag == 0); })
+
+/* We use 33-bit arithmetic here... */
+#define __range_ok(addr,size) ({ \
+       unsigned long flag, roksum; \
+       __chk_user_ptr(addr);   \
+       __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
+               : "=&r" (flag), "=&r" (roksum) \
+               : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
+               : "cc"); \
+       flag; })
+
+/*
+ * Single-value transfer routines.  They automatically use the right
+ * size if we just have the right pointer type.  Note that the functions
+ * which read from user space (*get_*) need to take care not to leak
+ * kernel data even if the calling code is buggy and fails to check
+ * the return value.  This means zeroing out the destination variable
+ * or buffer on error.  Normally this is done out of line by the
+ * fixup code, but there are a few places where it intrudes on the
+ * main code path.  When we only write to user space, there is no
+ * problem.
+ */
+extern int __get_user_1(void *);
+extern int __get_user_2(void *);
+extern int __get_user_4(void *);
+
+#define __get_user_x(__r2,__p,__e,__s,__i...)                          \
+          __asm__ __volatile__ (                                       \
+               __asmeq("%0", "r0") __asmeq("%1", "r2")                 \
+               "bl     __get_user_" #__s                               \
+               : "=&r" (__e), "=r" (__r2)                              \
+               : "0" (__p)                                             \
+               : __i, "cc")
+
+#define get_user(x,p)                                                  \
+       ({                                                              \
+               register const typeof(*(p)) __user *__p asm("r0") = (p);\
+               register unsigned long __r2 asm("r2");                  \
+               register int __e asm("r0");                             \
+               switch (sizeof(*(__p))) {                               \
+               case 1:                                                 \
+                       __get_user_x(__r2, __p, __e, 1, "lr");          \
+                       break;                                          \
+               case 2:                                                 \
+                       __get_user_x(__r2, __p, __e, 2, "r3", "lr");    \
+                       break;                                          \
+               case 4:                                                 \
+                       __get_user_x(__r2, __p, __e, 4, "lr");          \
+                       break;                                          \
+               default: __e = __get_user_bad(); break;                 \
+               }                                                       \
+               x = (typeof(*(p))) __r2;                                \
+               __e;                                                    \
+       })
+
+extern int __put_user_1(void *, unsigned int);
+extern int __put_user_2(void *, unsigned int);
+extern int __put_user_4(void *, unsigned int);
+extern int __put_user_8(void *, unsigned long long);
+
+#define __put_user_x(__r2,__p,__e,__s)                                 \
+          __asm__ __volatile__ (                                       \
+               __asmeq("%0", "r0") __asmeq("%2", "r2")                 \
+               "bl     __put_user_" #__s                               \
+               : "=&r" (__e)                                           \
+               : "0" (__p), "r" (__r2)                                 \
+               : "ip", "lr", "cc")
+
+#define put_user(x,p)                                                  \
+       ({                                                              \
+               register const typeof(*(p)) __r2 asm("r2") = (x);       \
+               register const typeof(*(p)) __user *__p asm("r0") = (p);\
+               register int __e asm("r0");                             \
+               switch (sizeof(*(__p))) {                               \
+               case 1:                                                 \
+                       __put_user_x(__r2, __p, __e, 1);                \
+                       break;                                          \
+               case 2:                                                 \
+                       __put_user_x(__r2, __p, __e, 2);                \
+                       break;                                          \
+               case 4:                                                 \
+                       __put_user_x(__r2, __p, __e, 4);                \
+                       break;                                          \
+               case 8:                                                 \
+                       __put_user_x(__r2, __p, __e, 8);                \
+                       break;                                          \
+               default: __e = __put_user_bad(); break;                 \
+               }                                                       \
+               __e;                                                    \
+       })
+
+#else /* CONFIG_MMU */
+
+/*
+ * uClinux has only one addr space, so has simplified address limits.
+ */
+#define USER_DS                        KERNEL_DS
+
+#define segment_eq(a,b)                (1)
+#define __addr_ok(addr)                (1)
+#define __range_ok(addr,size)  (0)
+#define get_fs()               (KERNEL_DS)
+
+static inline void set_fs(mm_segment_t fs)
+{
+}
+
+#define get_user(x,p)  __get_user(x,p)
+#define put_user(x,p)  __put_user(x,p)
+
+#endif /* CONFIG_MMU */
+
+#define access_ok(type,addr,size)      (__range_ok(addr,size) == 0)
+
+/*
+ * The "__xxx" versions of the user access functions do not verify the
+ * address space - it must have been done previously with a separate
+ * "access_ok()" call.
+ *
+ * The "xxx_error" versions set the third argument to EFAULT if an
+ * error occurs, and leave it unchanged on success.  Note that these
+ * versions are void (ie, don't return a value as such).
+ */
+#define __get_user(x,ptr)                                              \
+({                                                                     \
+       long __gu_err = 0;                                              \
+       __get_user_err((x),(ptr),__gu_err);                             \
+       __gu_err;                                                       \
+})
+
+#define __get_user_error(x,ptr,err)                                    \
+({                                                                     \
+       __get_user_err((x),(ptr),err);                                  \
+       (void) 0;                                                       \
+})
+
+#define __get_user_err(x,ptr,err)                                      \
+do {                                                                   \
+       unsigned long __gu_addr = (unsigned long)(ptr);                 \
+       unsigned long __gu_val;                                         \
+       __chk_user_ptr(ptr);                                            \
+       switch (sizeof(*(ptr))) {                                       \
+       case 1: __get_user_asm_byte(__gu_val,__gu_addr,err);    break;  \
+       case 2: __get_user_asm_half(__gu_val,__gu_addr,err);    break;  \
+       case 4: __get_user_asm_word(__gu_val,__gu_addr,err);    break;  \
+       default: (__gu_val) = __get_user_bad();                         \
+       }                                                               \
+       (x) = (__typeof__(*(ptr)))__gu_val;                             \
+} while (0)
+
+#define __get_user_asm_byte(x,addr,err)                                \
+       __asm__ __volatile__(                                   \
+       "1:     ldrbt   %1,[%2],#0\n"                           \
+       "2:\n"                                                  \
+       "       .section .fixup,\"ax\"\n"                       \
+       "       .align  2\n"                                    \
+       "3:     mov     %0, %3\n"                               \
+       "       mov     %1, #0\n"                               \
+       "       b       2b\n"                                   \
+       "       .previous\n"                                    \
+       "       .section __ex_table,\"a\"\n"                    \
+       "       .align  3\n"                                    \
+       "       .long   1b, 3b\n"                               \
+       "       .previous"                                      \
+       : "+r" (err), "=&r" (x)                                 \
+       : "r" (addr), "i" (-EFAULT)                             \
+       : "cc")
+
+#ifndef __ARMEB__
+#define __get_user_asm_half(x,__gu_addr,err)                   \
+({                                                             \
+       unsigned long __b1, __b2;                               \
+       __get_user_asm_byte(__b1, __gu_addr, err);              \
+       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
+       (x) = __b1 | (__b2 << 8);                               \
+})
+#else
+#define __get_user_asm_half(x,__gu_addr,err)                   \
+({                                                             \
+       unsigned long __b1, __b2;                               \
+       __get_user_asm_byte(__b1, __gu_addr, err);              \
+       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
+       (x) = (__b1 << 8) | __b2;                               \
+})
+#endif
+
+#define __get_user_asm_word(x,addr,err)                                \
+       __asm__ __volatile__(                                   \
+       "1:     ldrt    %1,[%2],#0\n"                           \
+       "2:\n"                                                  \
+       "       .section .fixup,\"ax\"\n"                       \
+       "       .align  2\n"                                    \
+       "3:     mov     %0, %3\n"                               \
+       "       mov     %1, #0\n"                               \
+       "       b       2b\n"                                   \
+       "       .previous\n"                                    \
+       "       .section __ex_table,\"a\"\n"                    \
+       "       .align  3\n"                                    \
+       "       .long   1b, 3b\n"                               \
+       "       .previous"                                      \
+       : "+r" (err), "=&r" (x)                                 \
+       : "r" (addr), "i" (-EFAULT)                             \
+       : "cc")
+
+#define __put_user(x,ptr)                                              \
+({                                                                     \
+       long __pu_err = 0;                                              \
+       __put_user_err((x),(ptr),__pu_err);                             \
+       __pu_err;                                                       \
+})
+
+#define __put_user_error(x,ptr,err)                                    \
+({                                                                     \
+       __put_user_err((x),(ptr),err);                                  \
+       (void) 0;                                                       \
+})
+
+#define __put_user_err(x,ptr,err)                                      \
+do {                                                                   \
+       unsigned long __pu_addr = (unsigned long)(ptr);                 \
+       __typeof__(*(ptr)) __pu_val = (x);                              \
+       __chk_user_ptr(ptr);                                            \
+       switch (sizeof(*(ptr))) {                                       \
+       case 1: __put_user_asm_byte(__pu_val,__pu_addr,err);    break;  \
+       case 2: __put_user_asm_half(__pu_val,__pu_addr,err);    break;  \
+       case 4: __put_user_asm_word(__pu_val,__pu_addr,err);    break;  \
+       case 8: __put_user_asm_dword(__pu_val,__pu_addr,err);   break;  \
+       default: __put_user_bad();                                      \
+       }                                                               \
+} while (0)
+
+#define __put_user_asm_byte(x,__pu_addr,err)                   \
+       __asm__ __volatile__(                                   \
+       "1:     strbt   %1,[%2],#0\n"                           \
+       "2:\n"                                                  \
+       "       .section .fixup,\"ax\"\n"                       \
+       "       .align  2\n"                                    \
+       "3:     mov     %0, %3\n"                               \
+       "       b       2b\n"                                   \
+       "       .previous\n"                                    \
+       "       .section __ex_table,\"a\"\n"                    \
+       "       .align  3\n"                                    \
+       "       .long   1b, 3b\n"                               \
+       "       .previous"                                      \
+       : "+r" (err)                                            \
+       : "r" (x), "r" (__pu_addr), "i" (-EFAULT)               \
+       : "cc")
+
+#ifndef __ARMEB__
+#define __put_user_asm_half(x,__pu_addr,err)                   \
+({                                                             \
+       unsigned long __temp = (unsigned long)(x);              \
+       __put_user_asm_byte(__temp, __pu_addr, err);            \
+       __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err);   \
+})
+#else
+#define __put_user_asm_half(x,__pu_addr,err)                   \
+({                                                             \
+       unsigned long __temp = (unsigned long)(x);              \
+       __put_user_asm_byte(__temp >> 8, __pu_addr, err);       \
+       __put_user_asm_byte(__temp, __pu_addr + 1, err);        \
+})
+#endif
+
+#define __put_user_asm_word(x,__pu_addr,err)                   \
+       __asm__ __volatile__(                                   \
+       "1:     strt    %1,[%2],#0\n"                           \
+       "2:\n"                                                  \
+       "       .section .fixup,\"ax\"\n"                       \
+       "       .align  2\n"                                    \
+       "3:     mov     %0, %3\n"                               \
+       "       b       2b\n"                                   \
+       "       .previous\n"                                    \
+       "       .section __ex_table,\"a\"\n"                    \
+       "       .align  3\n"                                    \
+       "       .long   1b, 3b\n"                               \
+       "       .previous"                                      \
+       : "+r" (err)                                            \
+       : "r" (x), "r" (__pu_addr), "i" (-EFAULT)               \
+       : "cc")
+
+#ifndef __ARMEB__
+#define        __reg_oper0     "%R2"
+#define        __reg_oper1     "%Q2"
+#else
+#define        __reg_oper0     "%Q2"
+#define        __reg_oper1     "%R2"
+#endif
+
+#define __put_user_asm_dword(x,__pu_addr,err)                  \
+       __asm__ __volatile__(                                   \
+       "1:     strt    " __reg_oper1 ", [%1], #4\n"            \
+       "2:     strt    " __reg_oper0 ", [%1], #0\n"            \
+       "3:\n"                                                  \
+       "       .section .fixup,\"ax\"\n"                       \
+       "       .align  2\n"                                    \
+       "4:     mov     %0, %3\n"                               \
+       "       b       3b\n"                                   \
+       "       .previous\n"                                    \
+       "       .section __ex_table,\"a\"\n"                    \
+       "       .align  3\n"                                    \
+       "       .long   1b, 4b\n"                               \
+       "       .long   2b, 4b\n"                               \
+       "       .previous"                                      \
+       : "+r" (err), "+r" (__pu_addr)                          \
+       : "r" (x), "i" (-EFAULT)                                \
+       : "cc")
+
+
+#ifdef CONFIG_MMU
+extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
+extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
+extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
+#else
+#define __copy_from_user(to,from,n)    (memcpy(to, (void __force *)from, n), 0)
+#define __copy_to_user(to,from,n)      (memcpy((void __force *)to, from, n), 0)
+#define __clear_user(addr,n)           (memset((void __force *)addr, 0, n), 0)
+#endif
+
+extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count);
+extern unsigned long __must_check __strnlen_user(const char __user *s, long n);
+
+static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+       if (access_ok(VERIFY_READ, from, n))
+               n = __copy_from_user(to, from, n);
+       else /* security hole - plug it */
+               memzero(to, n);
+       return n;
+}
+
+static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
+{
+       if (access_ok(VERIFY_WRITE, to, n))
+               n = __copy_to_user(to, from, n);
+       return n;
+}
+
+#define __copy_to_user_inatomic __copy_to_user
+#define __copy_from_user_inatomic __copy_from_user
+
+static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
+{
+       if (access_ok(VERIFY_WRITE, to, n))
+               n = __clear_user(to, n);
+       return n;
+}
+
+static inline long __must_check strncpy_from_user(char *dst, const char __user *src, long count)
+{
+       long res = -EFAULT;
+       if (access_ok(VERIFY_READ, src, 1))
+               res = __strncpy_from_user(dst, src, count);
+       return res;
+}
+
+#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
+
+static inline long __must_check strnlen_user(const char __user *s, long n)
+{
+       unsigned long res = 0;
+
+       if (__addr_ok(s))
+               res = __strnlen_user(s, n);
+
+       return res;
+}
+
+#endif /* _ASMARM_UACCESS_H */
diff --git a/arch/arm/include/asm/ucontext.h b/arch/arm/include/asm/ucontext.h
new file mode 100644 (file)
index 0000000..bf65e9f
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef _ASMARM_UCONTEXT_H
+#define _ASMARM_UCONTEXT_H
+
+#include <asm/fpstate.h>
+
+/*
+ * struct sigcontext only has room for the basic registers, but struct
+ * ucontext now has room for all registers which need to be saved and
+ * restored.  Coprocessor registers are stored in uc_regspace.  Each
+ * coprocessor's saved state should start with a documented 32-bit magic
+ * number, followed by a 32-bit word giving the coproccesor's saved size.
+ * uc_regspace may be expanded if necessary, although this takes some
+ * coordination with glibc.
+ */
+
+struct ucontext {
+       unsigned long     uc_flags;
+       struct ucontext  *uc_link;
+       stack_t           uc_stack;
+       struct sigcontext uc_mcontext;
+       sigset_t          uc_sigmask;
+       /* Allow for uc_sigmask growth.  Glibc uses a 1024-bit sigset_t.  */
+       int               __unused[32 - (sizeof (sigset_t) / sizeof (int))];
+       /* Last for extensibility.  Eight byte aligned because some
+          coprocessors require eight byte alignment.  */
+       unsigned long     uc_regspace[128] __attribute__((__aligned__(8)));
+};
+
+#ifdef __KERNEL__
+
+/*
+ * Coprocessor save state.  The magic values and specific
+ * coprocessor's layouts are part of the userspace ABI.  Each one of
+ * these should be a multiple of eight bytes and aligned to eight
+ * bytes, to prevent unpredictable padding in the signal frame.
+ */
+
+#ifdef CONFIG_CRUNCH
+#define CRUNCH_MAGIC           0x5065cf03
+#define CRUNCH_STORAGE_SIZE    (CRUNCH_SIZE + 8)
+
+struct crunch_sigframe {
+       unsigned long   magic;
+       unsigned long   size;
+       struct crunch_state     storage;
+} __attribute__((__aligned__(8)));
+#endif
+
+#ifdef CONFIG_IWMMXT
+/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
+#define IWMMXT_MAGIC           0x12ef842a
+#define IWMMXT_STORAGE_SIZE    (IWMMXT_SIZE + 8)
+
+struct iwmmxt_sigframe {
+       unsigned long   magic;
+       unsigned long   size;
+       struct iwmmxt_struct storage;
+} __attribute__((__aligned__(8)));
+#endif /* CONFIG_IWMMXT */
+
+#ifdef CONFIG_VFP
+#if __LINUX_ARM_ARCH__ < 6
+/* For ARM pre-v6, we use fstmiax and fldmiax.  This adds one extra
+ * word after the registers, and a word of padding at the end for
+ * alignment.  */
+#define VFP_MAGIC              0x56465001
+#define VFP_STORAGE_SIZE       152
+#else
+#define VFP_MAGIC              0x56465002
+#define VFP_STORAGE_SIZE       144
+#endif
+
+struct vfp_sigframe
+{
+       unsigned long           magic;
+       unsigned long           size;
+       union vfp_state         storage;
+};
+#endif /* CONFIG_VFP */
+
+/*
+ * Auxiliary signal frame.  This saves stuff like FP state.
+ * The layout of this structure is not part of the user ABI,
+ * because the config options aren't.  uc_regspace is really
+ * one of these.
+ */
+struct aux_sigframe {
+#ifdef CONFIG_CRUNCH
+       struct crunch_sigframe  crunch;
+#endif
+#ifdef CONFIG_IWMMXT
+       struct iwmmxt_sigframe  iwmmxt;
+#endif
+#if 0 && defined CONFIG_VFP /* Not yet saved.  */
+       struct vfp_sigframe     vfp;
+#endif
+       /* Something that isn't a valid magic number for any coprocessor.  */
+       unsigned long           end_magic;
+} __attribute__((__aligned__(8)));
+
+#endif
+
+#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/arch/arm/include/asm/unaligned.h b/arch/arm/include/asm/unaligned.h
new file mode 100644 (file)
index 0000000..44593a8
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _ASM_ARM_UNALIGNED_H
+#define _ASM_ARM_UNALIGNED_H
+
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+/*
+ * Select endianness
+ */
+#ifndef __ARMEB__
+#define get_unaligned  __get_unaligned_le
+#define put_unaligned  __put_unaligned_le
+#else
+#define get_unaligned  __get_unaligned_be
+#define put_unaligned  __put_unaligned_be
+#endif
+
+#endif /* _ASM_ARM_UNALIGNED_H */
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
new file mode 100644 (file)
index 0000000..f95fbb2
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ *  arch/arm/include/asm/unistd.h
+ *
+ *  Copyright (C) 2001-2005 Russell King
+ *
+ * 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.
+ *
+ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
+ * no matter what the change is.  Thanks!
+ */
+#ifndef __ASM_ARM_UNISTD_H
+#define __ASM_ARM_UNISTD_H
+
+#define __NR_OABI_SYSCALL_BASE 0x900000
+
+#if defined(__thumb__) || defined(__ARM_EABI__)
+#define __NR_SYSCALL_BASE      0
+#else
+#define __NR_SYSCALL_BASE      __NR_OABI_SYSCALL_BASE
+#endif
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_restart_syscall           (__NR_SYSCALL_BASE+  0)
+#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
+#define __NR_fork                      (__NR_SYSCALL_BASE+  2)
+#define __NR_read                      (__NR_SYSCALL_BASE+  3)
+#define __NR_write                     (__NR_SYSCALL_BASE+  4)
+#define __NR_open                      (__NR_SYSCALL_BASE+  5)
+#define __NR_close                     (__NR_SYSCALL_BASE+  6)
+                                       /* 7 was sys_waitpid */
+#define __NR_creat                     (__NR_SYSCALL_BASE+  8)
+#define __NR_link                      (__NR_SYSCALL_BASE+  9)
+#define __NR_unlink                    (__NR_SYSCALL_BASE+ 10)
+#define __NR_execve                    (__NR_SYSCALL_BASE+ 11)
+#define __NR_chdir                     (__NR_SYSCALL_BASE+ 12)
+#define __NR_time                      (__NR_SYSCALL_BASE+ 13)
+#define __NR_mknod                     (__NR_SYSCALL_BASE+ 14)
+#define __NR_chmod                     (__NR_SYSCALL_BASE+ 15)
+#define __NR_lchown                    (__NR_SYSCALL_BASE+ 16)
+                                       /* 17 was sys_break */
+                                       /* 18 was sys_stat */
+#define __NR_lseek                     (__NR_SYSCALL_BASE+ 19)
+#define __NR_getpid                    (__NR_SYSCALL_BASE+ 20)
+#define __NR_mount                     (__NR_SYSCALL_BASE+ 21)
+#define __NR_umount                    (__NR_SYSCALL_BASE+ 22)
+#define __NR_setuid                    (__NR_SYSCALL_BASE+ 23)
+#define __NR_getuid                    (__NR_SYSCALL_BASE+ 24)
+#define __NR_stime                     (__NR_SYSCALL_BASE+ 25)
+#define __NR_ptrace                    (__NR_SYSCALL_BASE+ 26)
+#define __NR_alarm                     (__NR_SYSCALL_BASE+ 27)
+                                       /* 28 was sys_fstat */
+#define __NR_pause                     (__NR_SYSCALL_BASE+ 29)
+#define __NR_utime                     (__NR_SYSCALL_BASE+ 30)
+                                       /* 31 was sys_stty */
+                                       /* 32 was sys_gtty */
+#define __NR_access                    (__NR_SYSCALL_BASE+ 33)
+#define __NR_nice                      (__NR_SYSCALL_BASE+ 34)
+                                       /* 35 was sys_ftime */
+#define __NR_sync                      (__NR_SYSCALL_BASE+ 36)
+#define __NR_kill                      (__NR_SYSCALL_BASE+ 37)
+#define __NR_rename                    (__NR_SYSCALL_BASE+ 38)
+#define __NR_mkdir                     (__NR_SYSCALL_BASE+ 39)
+#define __NR_rmdir                     (__NR_SYSCALL_BASE+ 40)
+#define __NR_dup                       (__NR_SYSCALL_BASE+ 41)
+#define __NR_pipe                      (__NR_SYSCALL_BASE+ 42)
+#define __NR_times                     (__NR_SYSCALL_BASE+ 43)
+                                       /* 44 was sys_prof */
+#define __NR_brk                       (__NR_SYSCALL_BASE+ 45)
+#define __NR_setgid                    (__NR_SYSCALL_BASE+ 46)
+#define __NR_getgid                    (__NR_SYSCALL_BASE+ 47)
+                                       /* 48 was sys_signal */
+#define __NR_geteuid                   (__NR_SYSCALL_BASE+ 49)
+#define __NR_getegid                   (__NR_SYSCALL_BASE+ 50)
+#define __NR_acct                      (__NR_SYSCALL_BASE+ 51)
+#define __NR_umount2                   (__NR_SYSCALL_BASE+ 52)
+                                       /* 53 was sys_lock */
+#define __NR_ioctl                     (__NR_SYSCALL_BASE+ 54)
+#define __NR_fcntl                     (__NR_SYSCALL_BASE+ 55)
+                                       /* 56 was sys_mpx */
+#define __NR_setpgid                   (__NR_SYSCALL_BASE+ 57)
+                                       /* 58 was sys_ulimit */
+                                       /* 59 was sys_olduname */
+#define __NR_umask                     (__NR_SYSCALL_BASE+ 60)
+#define __NR_chroot                    (__NR_SYSCALL_BASE+ 61)
+#define __NR_ustat                     (__NR_SYSCALL_BASE+ 62)
+#define __NR_dup2                      (__NR_SYSCALL_BASE+ 63)
+#define __NR_getppid                   (__NR_SYSCALL_BASE+ 64)
+#define __NR_getpgrp                   (__NR_SYSCALL_BASE+ 65)
+#define __NR_setsid                    (__NR_SYSCALL_BASE+ 66)
+#define __NR_sigaction                 (__NR_SYSCALL_BASE+ 67)
+                                       /* 68 was sys_sgetmask */
+                                       /* 69 was sys_ssetmask */
+#define __NR_setreuid                  (__NR_SYSCALL_BASE+ 70)
+#define __NR_setregid                  (__NR_SYSCALL_BASE+ 71)
+#define __NR_sigsuspend                        (__NR_SYSCALL_BASE+ 72)
+#define __NR_sigpending                        (__NR_SYSCALL_BASE+ 73)
+#define __NR_sethostname               (__NR_SYSCALL_BASE+ 74)
+#define __NR_setrlimit                 (__NR_SYSCALL_BASE+ 75)
+#define __NR_getrlimit                 (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
+#define __NR_getrusage                 (__NR_SYSCALL_BASE+ 77)
+#define __NR_gettimeofday              (__NR_SYSCALL_BASE+ 78)
+#define __NR_settimeofday              (__NR_SYSCALL_BASE+ 79)
+#define __NR_getgroups                 (__NR_SYSCALL_BASE+ 80)
+#define __NR_setgroups                 (__NR_SYSCALL_BASE+ 81)
+#define __NR_select                    (__NR_SYSCALL_BASE+ 82)
+#define __NR_symlink                   (__NR_SYSCALL_BASE+ 83)
+                                       /* 84 was sys_lstat */
+#define __NR_readlink                  (__NR_SYSCALL_BASE+ 85)
+#define __NR_uselib                    (__NR_SYSCALL_BASE+ 86)
+#define __NR_swapon                    (__NR_SYSCALL_BASE+ 87)
+#define __NR_reboot                    (__NR_SYSCALL_BASE+ 88)
+#define __NR_readdir                   (__NR_SYSCALL_BASE+ 89)
+#define __NR_mmap                      (__NR_SYSCALL_BASE+ 90)
+#define __NR_munmap                    (__NR_SYSCALL_BASE+ 91)
+#define __NR_truncate                  (__NR_SYSCALL_BASE+ 92)
+#define __NR_ftruncate                 (__NR_SYSCALL_BASE+ 93)
+#define __NR_fchmod                    (__NR_SYSCALL_BASE+ 94)
+#define __NR_fchown                    (__NR_SYSCALL_BASE+ 95)
+#define __NR_getpriority               (__NR_SYSCALL_BASE+ 96)
+#define __NR_setpriority               (__NR_SYSCALL_BASE+ 97)
+                                       /* 98 was sys_profil */
+#define __NR_statfs                    (__NR_SYSCALL_BASE+ 99)
+#define __NR_fstatfs                   (__NR_SYSCALL_BASE+100)
+                                       /* 101 was sys_ioperm */
+#define __NR_socketcall                        (__NR_SYSCALL_BASE+102)
+#define __NR_syslog                    (__NR_SYSCALL_BASE+103)
+#define __NR_setitimer                 (__NR_SYSCALL_BASE+104)
+#define __NR_getitimer                 (__NR_SYSCALL_BASE+105)
+#define __NR_stat                      (__NR_SYSCALL_BASE+106)
+#define __NR_lstat                     (__NR_SYSCALL_BASE+107)
+#define __NR_fstat                     (__NR_SYSCALL_BASE+108)
+                                       /* 109 was sys_uname */
+                                       /* 110 was sys_iopl */
+#define __NR_vhangup                   (__NR_SYSCALL_BASE+111)
+                                       /* 112 was sys_idle */
+#define __NR_syscall                   (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
+#define __NR_wait4                     (__NR_SYSCALL_BASE+114)
+#define __NR_swapoff                   (__NR_SYSCALL_BASE+115)
+#define __NR_sysinfo                   (__NR_SYSCALL_BASE+116)
+#define __NR_ipc                       (__NR_SYSCALL_BASE+117)
+#define __NR_fsync                     (__NR_SYSCALL_BASE+118)
+#define __NR_sigreturn                 (__NR_SYSCALL_BASE+119)
+#define __NR_clone                     (__NR_SYSCALL_BASE+120)
+#define __NR_setdomainname             (__NR_SYSCALL_BASE+121)
+#define __NR_uname                     (__NR_SYSCALL_BASE+122)
+                                       /* 123 was sys_modify_ldt */
+#define __NR_adjtimex                  (__NR_SYSCALL_BASE+124)
+#define __NR_mprotect                  (__NR_SYSCALL_BASE+125)
+#define __NR_sigprocmask               (__NR_SYSCALL_BASE+126)
+                                       /* 127 was sys_create_module */
+#define __NR_init_module               (__NR_SYSCALL_BASE+128)
+#define __NR_delete_module             (__NR_SYSCALL_BASE+129)
+                                       /* 130 was sys_get_kernel_syms */
+#define __NR_quotactl                  (__NR_SYSCALL_BASE+131)
+#define __NR_getpgid                   (__NR_SYSCALL_BASE+132)
+#define __NR_fchdir                    (__NR_SYSCALL_BASE+133)
+#define __NR_bdflush                   (__NR_SYSCALL_BASE+134)
+#define __NR_sysfs                     (__NR_SYSCALL_BASE+135)
+#define __NR_personality               (__NR_SYSCALL_BASE+136)
+                                       /* 137 was sys_afs_syscall */
+#define __NR_setfsuid                  (__NR_SYSCALL_BASE+138)
+#define __NR_setfsgid                  (__NR_SYSCALL_BASE+139)
+#define __NR__llseek                   (__NR_SYSCALL_BASE+140)
+#define __NR_getdents                  (__NR_SYSCALL_BASE+141)
+#define __NR__newselect                        (__NR_SYSCALL_BASE+142)
+#define __NR_flock                     (__NR_SYSCALL_BASE+143)
+#define __NR_msync                     (__NR_SYSCALL_BASE+144)
+#define __NR_readv                     (__NR_SYSCALL_BASE+145)
+#define __NR_writev                    (__NR_SYSCALL_BASE+146)
+#define __NR_getsid                    (__NR_SYSCALL_BASE+147)
+#define __NR_fdatasync                 (__NR_SYSCALL_BASE+148)
+#define __NR__sysctl                   (__NR_SYSCALL_BASE+149)
+#define __NR_mlock                     (__NR_SYSCALL_BASE+150)
+#define __NR_munlock                   (__NR_SYSCALL_BASE+151)
+#define __NR_mlockall                  (__NR_SYSCALL_BASE+152)
+#define __NR_munlockall                        (__NR_SYSCALL_BASE+153)
+#define __NR_sched_setparam            (__NR_SYSCALL_BASE+154)
+#define __NR_sched_getparam            (__NR_SYSCALL_BASE+155)
+#define __NR_sched_setscheduler                (__NR_SYSCALL_BASE+156)
+#define __NR_sched_getscheduler                (__NR_SYSCALL_BASE+157)
+#define __NR_sched_yield               (__NR_SYSCALL_BASE+158)
+#define __NR_sched_get_priority_max    (__NR_SYSCALL_BASE+159)
+#define __NR_sched_get_priority_min    (__NR_SYSCALL_BASE+160)
+#define __NR_sched_rr_get_interval     (__NR_SYSCALL_BASE+161)
+#define __NR_nanosleep                 (__NR_SYSCALL_BASE+162)
+#define __NR_mremap                    (__NR_SYSCALL_BASE+163)
+#define __NR_setresuid                 (__NR_SYSCALL_BASE+164)
+#define __NR_getresuid                 (__NR_SYSCALL_BASE+165)
+                                       /* 166 was sys_vm86 */
+                                       /* 167 was sys_query_module */
+#define __NR_poll                      (__NR_SYSCALL_BASE+168)
+#define __NR_nfsservctl                        (__NR_SYSCALL_BASE+169)
+#define __NR_setresgid                 (__NR_SYSCALL_BASE+170)
+#define __NR_getresgid                 (__NR_SYSCALL_BASE+171)
+#define __NR_prctl                     (__NR_SYSCALL_BASE+172)
+#define __NR_rt_sigreturn              (__NR_SYSCALL_BASE+173)
+#define __NR_rt_sigaction              (__NR_SYSCALL_BASE+174)
+#define __NR_rt_sigprocmask            (__NR_SYSCALL_BASE+175)
+#define __NR_rt_sigpending             (__NR_SYSCALL_BASE+176)
+#define __NR_rt_sigtimedwait           (__NR_SYSCALL_BASE+177)
+#define __NR_rt_sigqueueinfo           (__NR_SYSCALL_BASE+178)
+#define __NR_rt_sigsuspend             (__NR_SYSCALL_BASE+179)
+#define __NR_pread64                   (__NR_SYSCALL_BASE+180)
+#define __NR_pwrite64                  (__NR_SYSCALL_BASE+181)
+#define __NR_chown                     (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd                    (__NR_SYSCALL_BASE+183)
+#define __NR_capget                    (__NR_SYSCALL_BASE+184)
+#define __NR_capset                    (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack               (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile                  (__NR_SYSCALL_BASE+187)
+                                       /* 188 reserved */
+                                       /* 189 reserved */
+#define __NR_vfork                     (__NR_SYSCALL_BASE+190)
+#define __NR_ugetrlimit                        (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
+#define __NR_mmap2                     (__NR_SYSCALL_BASE+192)
+#define __NR_truncate64                        (__NR_SYSCALL_BASE+193)
+#define __NR_ftruncate64               (__NR_SYSCALL_BASE+194)
+#define __NR_stat64                    (__NR_SYSCALL_BASE+195)
+#define __NR_lstat64                   (__NR_SYSCALL_BASE+196)
+#define __NR_fstat64                   (__NR_SYSCALL_BASE+197)
+#define __NR_lchown32                  (__NR_SYSCALL_BASE+198)
+#define __NR_getuid32                  (__NR_SYSCALL_BASE+199)
+#define __NR_getgid32                  (__NR_SYSCALL_BASE+200)
+#define __NR_geteuid32                 (__NR_SYSCALL_BASE+201)
+#define __NR_getegid32                 (__NR_SYSCALL_BASE+202)
+#define __NR_setreuid32                        (__NR_SYSCALL_BASE+203)
+#define __NR_setregid32                        (__NR_SYSCALL_BASE+204)
+#define __NR_getgroups32               (__NR_SYSCALL_BASE+205)
+#define __NR_setgroups32               (__NR_SYSCALL_BASE+206)
+#define __NR_fchown32                  (__NR_SYSCALL_BASE+207)
+#define __NR_setresuid32               (__NR_SYSCALL_BASE+208)
+#define __NR_getresuid32               (__NR_SYSCALL_BASE+209)
+#define __NR_setresgid32               (__NR_SYSCALL_BASE+210)
+#define __NR_getresgid32               (__NR_SYSCALL_BASE+211)
+#define __NR_chown32                   (__NR_SYSCALL_BASE+212)
+#define __NR_setuid32                  (__NR_SYSCALL_BASE+213)
+#define __NR_setgid32                  (__NR_SYSCALL_BASE+214)
+#define __NR_setfsuid32                        (__NR_SYSCALL_BASE+215)
+#define __NR_setfsgid32                        (__NR_SYSCALL_BASE+216)
+#define __NR_getdents64                        (__NR_SYSCALL_BASE+217)
+#define __NR_pivot_root                        (__NR_SYSCALL_BASE+218)
+#define __NR_mincore                   (__NR_SYSCALL_BASE+219)
+#define __NR_madvise                   (__NR_SYSCALL_BASE+220)
+#define __NR_fcntl64                   (__NR_SYSCALL_BASE+221)
+                                       /* 222 for tux */
+                                       /* 223 is unused */
+#define __NR_gettid                    (__NR_SYSCALL_BASE+224)
+#define __NR_readahead                 (__NR_SYSCALL_BASE+225)
+#define __NR_setxattr                  (__NR_SYSCALL_BASE+226)
+#define __NR_lsetxattr                 (__NR_SYSCALL_BASE+227)
+#define __NR_fsetxattr                 (__NR_SYSCALL_BASE+228)
+#define __NR_getxattr                  (__NR_SYSCALL_BASE+229)
+#define __NR_lgetxattr                 (__NR_SYSCALL_BASE+230)
+#define __NR_fgetxattr                 (__NR_SYSCALL_BASE+231)
+#define __NR_listxattr                 (__NR_SYSCALL_BASE+232)
+#define __NR_llistxattr                        (__NR_SYSCALL_BASE+233)
+#define __NR_flistxattr                        (__NR_SYSCALL_BASE+234)
+#define __NR_removexattr               (__NR_SYSCALL_BASE+235)
+#define __NR_lremovexattr              (__NR_SYSCALL_BASE+236)
+#define __NR_fremovexattr              (__NR_SYSCALL_BASE+237)
+#define __NR_tkill                     (__NR_SYSCALL_BASE+238)
+#define __NR_sendfile64                        (__NR_SYSCALL_BASE+239)
+#define __NR_futex                     (__NR_SYSCALL_BASE+240)
+#define __NR_sched_setaffinity         (__NR_SYSCALL_BASE+241)
+#define __NR_sched_getaffinity         (__NR_SYSCALL_BASE+242)
+#define __NR_io_setup                  (__NR_SYSCALL_BASE+243)
+#define __NR_io_destroy                        (__NR_SYSCALL_BASE+244)
+#define __NR_io_getevents              (__NR_SYSCALL_BASE+245)
+#define __NR_io_submit                 (__NR_SYSCALL_BASE+246)
+#define __NR_io_cancel                 (__NR_SYSCALL_BASE+247)
+#define __NR_exit_group                        (__NR_SYSCALL_BASE+248)
+#define __NR_lookup_dcookie            (__NR_SYSCALL_BASE+249)
+#define __NR_epoll_create              (__NR_SYSCALL_BASE+250)
+#define __NR_epoll_ctl                 (__NR_SYSCALL_BASE+251)
+#define __NR_epoll_wait                        (__NR_SYSCALL_BASE+252)
+#define __NR_remap_file_pages          (__NR_SYSCALL_BASE+253)
+                                       /* 254 for set_thread_area */
+                                       /* 255 for get_thread_area */
+#define __NR_set_tid_address           (__NR_SYSCALL_BASE+256)
+#define __NR_timer_create              (__NR_SYSCALL_BASE+257)
+#define __NR_timer_settime             (__NR_SYSCALL_BASE+258)
+#define __NR_timer_gettime             (__NR_SYSCALL_BASE+259)
+#define __NR_timer_getoverrun          (__NR_SYSCALL_BASE+260)
+#define __NR_timer_delete              (__NR_SYSCALL_BASE+261)
+#define __NR_clock_settime             (__NR_SYSCALL_BASE+262)
+#define __NR_clock_gettime             (__NR_SYSCALL_BASE+263)
+#define __NR_clock_getres              (__NR_SYSCALL_BASE+264)
+#define __NR_clock_nanosleep           (__NR_SYSCALL_BASE+265)
+#define __NR_statfs64                  (__NR_SYSCALL_BASE+266)
+#define __NR_fstatfs64                 (__NR_SYSCALL_BASE+267)
+#define __NR_tgkill                    (__NR_SYSCALL_BASE+268)
+#define __NR_utimes                    (__NR_SYSCALL_BASE+269)
+#define __NR_arm_fadvise64_64          (__NR_SYSCALL_BASE+270)
+#define __NR_pciconfig_iobase          (__NR_SYSCALL_BASE+271)
+#define __NR_pciconfig_read            (__NR_SYSCALL_BASE+272)
+#define __NR_pciconfig_write           (__NR_SYSCALL_BASE+273)
+#define __NR_mq_open                   (__NR_SYSCALL_BASE+274)
+#define __NR_mq_unlink                 (__NR_SYSCALL_BASE+275)
+#define __NR_mq_timedsend              (__NR_SYSCALL_BASE+276)
+#define __NR_mq_timedreceive           (__NR_SYSCALL_BASE+277)
+#define __NR_mq_notify                 (__NR_SYSCALL_BASE+278)
+#define __NR_mq_getsetattr             (__NR_SYSCALL_BASE+279)
+#define __NR_waitid                    (__NR_SYSCALL_BASE+280)
+#define __NR_socket                    (__NR_SYSCALL_BASE+281)
+#define __NR_bind                      (__NR_SYSCALL_BASE+282)
+#define __NR_connect                   (__NR_SYSCALL_BASE+283)
+#define __NR_listen                    (__NR_SYSCALL_BASE+284)
+#define __NR_accept                    (__NR_SYSCALL_BASE+285)
+#define __NR_getsockname               (__NR_SYSCALL_BASE+286)
+#define __NR_getpeername               (__NR_SYSCALL_BASE+287)
+#define __NR_socketpair                        (__NR_SYSCALL_BASE+288)
+#define __NR_send                      (__NR_SYSCALL_BASE+289)
+#define __NR_sendto                    (__NR_SYSCALL_BASE+290)
+#define __NR_recv                      (__NR_SYSCALL_BASE+291)
+#define __NR_recvfrom                  (__NR_SYSCALL_BASE+292)
+#define __NR_shutdown                  (__NR_SYSCALL_BASE+293)
+#define __NR_setsockopt                        (__NR_SYSCALL_BASE+294)
+#define __NR_getsockopt                        (__NR_SYSCALL_BASE+295)
+#define __NR_sendmsg                   (__NR_SYSCALL_BASE+296)
+#define __NR_recvmsg                   (__NR_SYSCALL_BASE+297)
+#define __NR_semop                     (__NR_SYSCALL_BASE+298)
+#define __NR_semget                    (__NR_SYSCALL_BASE+299)
+#define __NR_semctl                    (__NR_SYSCALL_BASE+300)
+#define __NR_msgsnd                    (__NR_SYSCALL_BASE+301)
+#define __NR_msgrcv                    (__NR_SYSCALL_BASE+302)
+#define __NR_msgget                    (__NR_SYSCALL_BASE+303)
+#define __NR_msgctl                    (__NR_SYSCALL_BASE+304)
+#define __NR_shmat                     (__NR_SYSCALL_BASE+305)
+#define __NR_shmdt                     (__NR_SYSCALL_BASE+306)
+#define __NR_shmget                    (__NR_SYSCALL_BASE+307)
+#define __NR_shmctl                    (__NR_SYSCALL_BASE+308)
+#define __NR_add_key                   (__NR_SYSCALL_BASE+309)
+#define __NR_request_key               (__NR_SYSCALL_BASE+310)
+#define __NR_keyctl                    (__NR_SYSCALL_BASE+311)
+#define __NR_semtimedop                        (__NR_SYSCALL_BASE+312)
+#define __NR_vserver                   (__NR_SYSCALL_BASE+313)
+#define __NR_ioprio_set                        (__NR_SYSCALL_BASE+314)
+#define __NR_ioprio_get                        (__NR_SYSCALL_BASE+315)
+#define __NR_inotify_init              (__NR_SYSCALL_BASE+316)
+#define __NR_inotify_add_watch         (__NR_SYSCALL_BASE+317)
+#define __NR_inotify_rm_watch          (__NR_SYSCALL_BASE+318)
+#define __NR_mbind                     (__NR_SYSCALL_BASE+319)
+#define __NR_get_mempolicy             (__NR_SYSCALL_BASE+320)
+#define __NR_set_mempolicy             (__NR_SYSCALL_BASE+321)
+#define __NR_openat                    (__NR_SYSCALL_BASE+322)
+#define __NR_mkdirat                   (__NR_SYSCALL_BASE+323)
+#define __NR_mknodat                   (__NR_SYSCALL_BASE+324)
+#define __NR_fchownat                  (__NR_SYSCALL_BASE+325)
+#define __NR_futimesat                 (__NR_SYSCALL_BASE+326)
+#define __NR_fstatat64                 (__NR_SYSCALL_BASE+327)
+#define __NR_unlinkat                  (__NR_SYSCALL_BASE+328)
+#define __NR_renameat                  (__NR_SYSCALL_BASE+329)
+#define __NR_linkat                    (__NR_SYSCALL_BASE+330)
+#define __NR_symlinkat                 (__NR_SYSCALL_BASE+331)
+#define __NR_readlinkat                        (__NR_SYSCALL_BASE+332)
+#define __NR_fchmodat                  (__NR_SYSCALL_BASE+333)
+#define __NR_faccessat                 (__NR_SYSCALL_BASE+334)
+                                       /* 335 for pselect6 */
+                                       /* 336 for ppoll */
+#define __NR_unshare                   (__NR_SYSCALL_BASE+337)
+#define __NR_set_robust_list           (__NR_SYSCALL_BASE+338)
+#define __NR_get_robust_list           (__NR_SYSCALL_BASE+339)
+#define __NR_splice                    (__NR_SYSCALL_BASE+340)
+#define __NR_arm_sync_file_range       (__NR_SYSCALL_BASE+341)
+#define __NR_sync_file_range2          __NR_arm_sync_file_range
+#define __NR_tee                       (__NR_SYSCALL_BASE+342)
+#define __NR_vmsplice                  (__NR_SYSCALL_BASE+343)
+#define __NR_move_pages                        (__NR_SYSCALL_BASE+344)
+#define __NR_getcpu                    (__NR_SYSCALL_BASE+345)
+                                       /* 346 for epoll_pwait */
+#define __NR_kexec_load                        (__NR_SYSCALL_BASE+347)
+#define __NR_utimensat                 (__NR_SYSCALL_BASE+348)
+#define __NR_signalfd                  (__NR_SYSCALL_BASE+349)
+#define __NR_timerfd_create            (__NR_SYSCALL_BASE+350)
+#define __NR_eventfd                   (__NR_SYSCALL_BASE+351)
+#define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
+#define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
+#define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
+
+/*
+ * The following SWIs are ARM private.
+ */
+#define __ARM_NR_BASE                  (__NR_SYSCALL_BASE+0x0f0000)
+#define __ARM_NR_breakpoint            (__ARM_NR_BASE+1)
+#define __ARM_NR_cacheflush            (__ARM_NR_BASE+2)
+#define __ARM_NR_usr26                 (__ARM_NR_BASE+3)
+#define __ARM_NR_usr32                 (__ARM_NR_BASE+4)
+#define __ARM_NR_set_tls               (__ARM_NR_BASE+5)
+
+/*
+ * The following syscalls are obsolete and no longer available for EABI.
+ */
+#if defined(__ARM_EABI__) && !defined(__KERNEL__)
+#undef __NR_time
+#undef __NR_umount
+#undef __NR_stime
+#undef __NR_alarm
+#undef __NR_utime
+#undef __NR_getrlimit
+#undef __NR_select
+#undef __NR_readdir
+#undef __NR_mmap
+#undef __NR_socketcall
+#undef __NR_syscall
+#undef __NR_ipc
+#endif
+
+#ifdef __KERNEL__
+
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+
+#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_SYS_SOCKETCALL
+#endif
+
+/*
+ * "Conditional" syscalls
+ *
+ * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
+ * but it doesn't work on all toolchains, so we just do it by hand
+ */
+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+
+/*
+ * Unimplemented (or alternatively implemented) syscalls
+ */
+#define __IGNORE_fadvise64_64          1
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_ARM_UNISTD_H */
diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
new file mode 100644 (file)
index 0000000..825c1e7
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _ARM_USER_H
+#define _ARM_USER_H
+
+#include <asm/page.h>
+#include <asm/ptrace.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).  There are quite a number of
+   obstacles to being able to view the contents of the floating point
+   registers, and until these are solved you will not be able to view the
+   contents of them.  Actually, you can read in the core file and look at
+   the contents of the user struct to find out what the floating point
+   registers contain.
+   The actual 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 useful at some point.
+   All of the registers are stored as part of the upage.  The upage should
+   always be only one page.
+   DATA: The data area is stored.  We use current->end_text to
+   current->brk to pick up all of the user variables, plus any memory
+   that may have been malloced.  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 (esp) to
+   current->start_stack, so we round each of these off in order to be able
+   to write an integer number of pages.
+   The minimum core file size is 3 pages, or 12288 bytes.
+*/
+
+struct user_fp {
+       struct fp_reg {
+               unsigned int sign1:1;
+               unsigned int unused:15;
+               unsigned int sign2:1;
+               unsigned int exponent:14;
+               unsigned int j:1;
+               unsigned int mantissa1:31;
+               unsigned int mantissa0:32;
+       } fpregs[8];
+       unsigned int fpsr:32;
+       unsigned int fpcr:32;
+       unsigned char ftype[8];
+       unsigned int init_flag;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use. */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+  struct pt_regs regs;         /* Where the registers are actually stored */
+/* ptrace does not yet supply these.  Someday.... */
+  int u_fpvalid;               /* True if math co-processor being used. */
+                                /* for this mess. Not yet used. */
+/* The rest of this junk is to help gdb figure out what goes where */
+  unsigned long int u_tsize;   /* Text segment size (pages). */
+  unsigned long int u_dsize;   /* Data segment size (pages). */
+  unsigned long int u_ssize;   /* Stack segment size (pages). */
+  unsigned long start_code;     /* Starting virtual address of text. */
+  unsigned long start_stack;   /* Starting virtual address of stack area.
+                                  This is actually the bottom of the stack,
+                                  the top of the stack is always found in the
+                                  esp register.  */
+  long int signal;                     /* Signal that caused the core dump. */
+  int reserved;                        /* No longer used */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
+                               /* the registers. */
+  unsigned long magic;         /* To uniquely identify a core file */
+  char u_comm[32];             /* User command that was responsible */
+  int u_debugreg[8];
+  struct user_fp u_fp;         /* FP state */
+  struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
+                               /* the FP registers. */
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _ARM_USER_H */
diff --git a/arch/arm/include/asm/vfp.h b/arch/arm/include/asm/vfp.h
new file mode 100644 (file)
index 0000000..f4ab34f
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * arch/arm/include/asm/vfp.h
+ *
+ * VFP register definitions.
+ * First, the standard VFP set.
+ */
+
+#define FPSID                  cr0
+#define FPSCR                  cr1
+#define MVFR1                  cr6
+#define MVFR0                  cr7
+#define FPEXC                  cr8
+#define FPINST                 cr9
+#define FPINST2                        cr10
+
+/* FPSID bits */
+#define FPSID_IMPLEMENTER_BIT  (24)
+#define FPSID_IMPLEMENTER_MASK (0xff << FPSID_IMPLEMENTER_BIT)
+#define FPSID_SOFTWARE         (1<<23)
+#define FPSID_FORMAT_BIT       (21)
+#define FPSID_FORMAT_MASK      (0x3  << FPSID_FORMAT_BIT)
+#define FPSID_NODOUBLE         (1<<20)
+#define FPSID_ARCH_BIT         (16)
+#define FPSID_ARCH_MASK                (0xF  << FPSID_ARCH_BIT)
+#define FPSID_PART_BIT         (8)
+#define FPSID_PART_MASK                (0xFF << FPSID_PART_BIT)
+#define FPSID_VARIANT_BIT      (4)
+#define FPSID_VARIANT_MASK     (0xF  << FPSID_VARIANT_BIT)
+#define FPSID_REV_BIT          (0)
+#define FPSID_REV_MASK         (0xF  << FPSID_REV_BIT)
+
+/* FPEXC bits */
+#define FPEXC_EX               (1 << 31)
+#define FPEXC_EN               (1 << 30)
+#define FPEXC_DEX              (1 << 29)
+#define FPEXC_FP2V             (1 << 28)
+#define FPEXC_VV               (1 << 27)
+#define FPEXC_TFV              (1 << 26)
+#define FPEXC_LENGTH_BIT       (8)
+#define FPEXC_LENGTH_MASK      (7 << FPEXC_LENGTH_BIT)
+#define FPEXC_IDF              (1 << 7)
+#define FPEXC_IXF              (1 << 4)
+#define FPEXC_UFF              (1 << 3)
+#define FPEXC_OFF              (1 << 2)
+#define FPEXC_DZF              (1 << 1)
+#define FPEXC_IOF              (1 << 0)
+#define FPEXC_TRAP_MASK                (FPEXC_IDF|FPEXC_IXF|FPEXC_UFF|FPEXC_OFF|FPEXC_DZF|FPEXC_IOF)
+
+/* FPSCR bits */
+#define FPSCR_DEFAULT_NAN      (1<<25)
+#define FPSCR_FLUSHTOZERO      (1<<24)
+#define FPSCR_ROUND_NEAREST    (0<<22)
+#define FPSCR_ROUND_PLUSINF    (1<<22)
+#define FPSCR_ROUND_MINUSINF   (2<<22)
+#define FPSCR_ROUND_TOZERO     (3<<22)
+#define FPSCR_RMODE_BIT                (22)
+#define FPSCR_RMODE_MASK       (3 << FPSCR_RMODE_BIT)
+#define FPSCR_STRIDE_BIT       (20)
+#define FPSCR_STRIDE_MASK      (3 << FPSCR_STRIDE_BIT)
+#define FPSCR_LENGTH_BIT       (16)
+#define FPSCR_LENGTH_MASK      (7 << FPSCR_LENGTH_BIT)
+#define FPSCR_IOE              (1<<8)
+#define FPSCR_DZE              (1<<9)
+#define FPSCR_OFE              (1<<10)
+#define FPSCR_UFE              (1<<11)
+#define FPSCR_IXE              (1<<12)
+#define FPSCR_IDE              (1<<15)
+#define FPSCR_IOC              (1<<0)
+#define FPSCR_DZC              (1<<1)
+#define FPSCR_OFC              (1<<2)
+#define FPSCR_UFC              (1<<3)
+#define FPSCR_IXC              (1<<4)
+#define FPSCR_IDC              (1<<7)
+
+/* MVFR0 bits */
+#define MVFR0_A_SIMD_BIT       (0)
+#define MVFR0_A_SIMD_MASK      (0xf << MVFR0_A_SIMD_BIT)
+
+/* Bit patterns for decoding the packaged operation descriptors */
+#define VFPOPDESC_LENGTH_BIT   (9)
+#define VFPOPDESC_LENGTH_MASK  (0x07 << VFPOPDESC_LENGTH_BIT)
+#define VFPOPDESC_UNUSED_BIT   (24)
+#define VFPOPDESC_UNUSED_MASK  (0xFF << VFPOPDESC_UNUSED_BIT)
+#define VFPOPDESC_OPDESC_MASK  (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
new file mode 100644 (file)
index 0000000..422f3cc
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * arch/arm/include/asm/vfpmacros.h
+ *
+ * Assembler-only file containing VFP macros and register definitions.
+ */
+#include "vfp.h"
+
+@ Macros to allow building with old toolkits (with no VFP support)
+       .macro  VFPFMRX, rd, sysreg, cond
+       MRC\cond        p10, 7, \rd, \sysreg, cr0, 0    @ FMRX  \rd, \sysreg
+       .endm
+
+       .macro  VFPFMXR, sysreg, rd, cond
+       MCR\cond        p10, 7, \rd, \sysreg, cr0, 0    @ FMXR  \sysreg, \rd
+       .endm
+
+       @ read all the working registers back into the VFP
+       .macro  VFPFLDMIA, base, tmp
+#if __LINUX_ARM_ARCH__ < 6
+       LDC     p11, cr0, [\base],#33*4             @ FLDMIAX \base!, {d0-d15}
+#else
+       LDC     p11, cr0, [\base],#32*4             @ FLDMIAD \base!, {d0-d15}
+#endif
+#ifdef CONFIG_VFPv3
+       VFPFMRX \tmp, MVFR0                         @ Media and VFP Feature Register 0
+       and     \tmp, \tmp, #MVFR0_A_SIMD_MASK      @ A_SIMD field
+       cmp     \tmp, #2                            @ 32 x 64bit registers?
+       ldceql  p11, cr0, [\base],#32*4             @ FLDMIAD \base!, {d16-d31}
+       addne   \base, \base, #32*4                 @ step over unused register space
+#endif
+       .endm
+
+       @ write all the working registers out of the VFP
+       .macro  VFPFSTMIA, base, tmp
+#if __LINUX_ARM_ARCH__ < 6
+       STC     p11, cr0, [\base],#33*4             @ FSTMIAX \base!, {d0-d15}
+#else
+       STC     p11, cr0, [\base],#32*4             @ FSTMIAD \base!, {d0-d15}
+#endif
+#ifdef CONFIG_VFPv3
+       VFPFMRX \tmp, MVFR0                         @ Media and VFP Feature Register 0
+       and     \tmp, \tmp, #MVFR0_A_SIMD_MASK      @ A_SIMD field
+       cmp     \tmp, #2                            @ 32 x 64bit registers?
+       stceql  p11, cr0, [\base],#32*4             @ FSTMIAD \base!, {d16-d31}
+       addne   \base, \base, #32*4                 @ step over unused register space
+#endif
+       .endm
diff --git a/arch/arm/include/asm/vga.h b/arch/arm/include/asm/vga.h
new file mode 100644 (file)
index 0000000..1e0b913
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef ASMARM_VGA_H
+#define ASMARM_VGA_H
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#define VGA_MAP_MEM(x,s)       (PCIMEM_BASE + (x))
+
+#define vga_readb(x)   (*((volatile unsigned char *)x))
+#define vga_writeb(x,y)        (*((volatile unsigned char *)y) = (x))
+
+#endif
diff --git a/arch/arm/include/asm/xor.h b/arch/arm/include/asm/xor.h
new file mode 100644 (file)
index 0000000..7604673
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ *  arch/arm/include/asm/xor.h
+ *
+ *  Copyright (C) 2001 Russell King
+ *
+ * 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.
+ */
+#include <asm-generic/xor.h>
+
+#define __XOR(a1, a2) a1 ^= a2
+
+#define GET_BLOCK_2(dst) \
+       __asm__("ldmia  %0, {%1, %2}" \
+               : "=r" (dst), "=r" (a1), "=r" (a2) \
+               : "0" (dst))
+
+#define GET_BLOCK_4(dst) \
+       __asm__("ldmia  %0, {%1, %2, %3, %4}" \
+               : "=r" (dst), "=r" (a1), "=r" (a2), "=r" (a3), "=r" (a4) \
+               : "0" (dst))
+
+#define XOR_BLOCK_2(src) \
+       __asm__("ldmia  %0!, {%1, %2}" \
+               : "=r" (src), "=r" (b1), "=r" (b2) \
+               : "0" (src)); \
+       __XOR(a1, b1); __XOR(a2, b2);
+
+#define XOR_BLOCK_4(src) \
+       __asm__("ldmia  %0!, {%1, %2, %3, %4}" \
+               : "=r" (src), "=r" (b1), "=r" (b2), "=r" (b3), "=r" (b4) \
+               : "0" (src)); \
+       __XOR(a1, b1); __XOR(a2, b2); __XOR(a3, b3); __XOR(a4, b4)
+
+#define PUT_BLOCK_2(dst) \
+       __asm__ __volatile__("stmia     %0!, {%2, %3}" \
+               : "=r" (dst) \
+               : "0" (dst), "r" (a1), "r" (a2))
+
+#define PUT_BLOCK_4(dst) \
+       __asm__ __volatile__("stmia     %0!, {%2, %3, %4, %5}" \
+               : "=r" (dst) \
+               : "0" (dst), "r" (a1), "r" (a2), "r" (a3), "r" (a4))
+
+static void
+xor_arm4regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
+{
+       unsigned int lines = bytes / sizeof(unsigned long) / 4;
+       register unsigned int a1 __asm__("r4");
+       register unsigned int a2 __asm__("r5");
+       register unsigned int a3 __asm__("r6");
+       register unsigned int a4 __asm__("r7");
+       register unsigned int b1 __asm__("r8");
+       register unsigned int b2 __asm__("r9");
+       register unsigned int b3 __asm__("ip");
+       register unsigned int b4 __asm__("lr");
+
+       do {
+               GET_BLOCK_4(p1);
+               XOR_BLOCK_4(p2);
+               PUT_BLOCK_4(p1);
+       } while (--lines);
+}
+
+static void
+xor_arm4regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
+               unsigned long *p3)
+{
+       unsigned int lines = bytes / sizeof(unsigned long) / 4;
+       register unsigned int a1 __asm__("r4");
+       register unsigned int a2 __asm__("r5");
+       register unsigned int a3 __asm__("r6");
+       register unsigned int a4 __asm__("r7");
+       register unsigned int b1 __asm__("r8");
+       register unsigned int b2 __asm__("r9");
+       register unsigned int b3 __asm__("ip");
+       register unsigned int b4 __asm__("lr");
+
+       do {
+               GET_BLOCK_4(p1);
+               XOR_BLOCK_4(p2);
+               XOR_BLOCK_4(p3);
+               PUT_BLOCK_4(p1);
+       } while (--lines);
+}
+
+static void
+xor_arm4regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
+               unsigned long *p3, unsigned long *p4)
+{
+       unsigned int lines = bytes / sizeof(unsigned long) / 2;
+       register unsigned int a1 __asm__("r8");
+       register unsigned int a2 __asm__("r9");
+       register unsigned int b1 __asm__("ip");
+       register unsigned int b2 __asm__("lr");
+
+       do {
+               GET_BLOCK_2(p1);
+               XOR_BLOCK_2(p2);
+               XOR_BLOCK_2(p3);
+               XOR_BLOCK_2(p4);
+               PUT_BLOCK_2(p1);
+       } while (--lines);
+}
+
+static void
+xor_arm4regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
+               unsigned long *p3, unsigned long *p4, unsigned long *p5)
+{
+       unsigned int lines = bytes / sizeof(unsigned long) / 2;
+       register unsigned int a1 __asm__("r8");
+       register unsigned int a2 __asm__("r9");
+       register unsigned int b1 __asm__("ip");
+       register unsigned int b2 __asm__("lr");
+
+       do {
+               GET_BLOCK_2(p1);
+               XOR_BLOCK_2(p2);
+               XOR_BLOCK_2(p3);
+               XOR_BLOCK_2(p4);
+               XOR_BLOCK_2(p5);
+               PUT_BLOCK_2(p1);
+       } while (--lines);
+}
+
+static struct xor_block_template xor_block_arm4regs = {
+       .name   = "arm4regs",
+       .do_2   = xor_arm4regs_2,
+       .do_3   = xor_arm4regs_3,
+       .do_4   = xor_arm4regs_4,
+       .do_5   = xor_arm4regs_5,
+};
+
+#undef XOR_TRY_TEMPLATES
+#define XOR_TRY_TEMPLATES                      \
+       do {                                    \
+               xor_speed(&xor_block_arm4regs); \
+               xor_speed(&xor_block_8regs);    \
+               xor_speed(&xor_block_32regs);   \
+       } while (0)
index 7e9c00a8a4127ee35dad9507b109f13f319f23a3..1c3c6ea5f9e7e3bb7b7ce5a880a039489200d200 100644 (file)
@@ -181,7 +181,7 @@ ENTRY(lookup_processor_type)
        ldmfd   sp!, {r4 - r7, r9, pc}
 
 /*
- * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
+ * Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for
  * more information about the __proc_info and __arch_info structures.
  */
        .long   __proc_info_begin
index 1dd8ea4f9a9c5f7b13e91e2a4c87948803d539f1..2034d4dbe6ad3a3cddf20c8e9f75516021e93c92 100644 (file)
@@ -20,7 +20,7 @@
  *             r2, r3 contains the zero-extended value
  *             lr corrupted
  *
- * No other registers must be altered.  (see include/asm-arm/uaccess.h
+ * No other registers must be altered.  (see <asm/uaccess.h>
  * for specific ASM register usage).
  *
  * Note that ADDR_LIMIT is either 0 or 0xc0000000.
index 8620afe54f720da93ad062ff02df7a9e96743068..08ec7dffa52e44cf5d15b720891b0717547ad7f7 100644 (file)
@@ -20,7 +20,7 @@
  * Outputs:    r0 is the error code
  *             lr corrupted
  *
- * No other registers must be altered.  (see include/asm-arm/uaccess.h
+ * No other registers must be altered.  (see <asm/uaccess.h>
  * for specific ASM register usage).
  *
  * Note that ADDR_LIMIT is either 0 or 0xc0000000
index 5bad6b9b00d77be2dbbc1ea65f90d8d746dc6f26..a048b92cb4079a660866bdac3a25fa74a12b81e6 100644 (file)
@@ -297,7 +297,7 @@ config MTD_AT91_DATAFLASH_CARD
        help
          Enable support for the DataFlash card.
 
-config MTD_NAND_AT91_BUSWIDTH_16
+config MTD_NAND_ATMEL_BUSWIDTH_16
        bool "Enable 16-bit data bus interface to NAND flash"
        depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91CAP9ADK)
        help
index dc8b40783d94243565a1e7963941f35fdf267c13..25765f1afca9c443499b60a87e6546061f12f92e 100644 (file)
@@ -376,7 +376,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index 8ced9bc82099911445a0d459169a185455554e09..d2c5c84bf6b8ea2c43350bdfa796a9b6f20a4fb9 100644 (file)
@@ -368,7 +368,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index cae5f52f1278e1311baa90e5fe4da69880a02c8c..f5fec0a9cf49e53e215bb7ae24d9a527468d28b5 100644 (file)
@@ -283,7 +283,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index 483d436af22d84610b84b9a916748b222c35c263..b80860e313839c11b25af3c9c8bb3a41e215863a 100644 (file)
@@ -198,7 +198,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index 9762b15f658ac0238bed885ab511e43c8aed83d7..42108d02f593c24c7832bbfcd3120b6da5f068b7 100644 (file)
@@ -352,7 +352,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index 5f3094870cadcbaa5e92579cbd451b3e9ab89943..9c61576f1c8dc281341b66eb5c8ed9eeb395e47c 100644 (file)
@@ -194,7 +194,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  NAND / SmartMedia
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 static struct atmel_nand_data nand_data;
 
 #define NAND_BASE      AT91_CHIPSELECT_3
index 117cf6c9afce3534b8c904bb4915974728456dbb..1f4725972edce70a2f988a58c34c5f1ccd37e776 100644 (file)
@@ -188,7 +188,7 @@ static struct atmel_nand_data __initdata cap9adk_nand_data = {
 //     .rdy_pin        = ... not connected
        .enable_pin     = AT91_PIN_PD15,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 99b4ec3818d6d7b5d8704cf3abdeb49a34d0b0f7..33b1ccdb516d4fd101c086a49ed7232823ae9505 100644 (file)
@@ -140,14 +140,14 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitio
        return ek_nand_partition;
 }
 
-static struct at91_nand_data __initdata ek_nand_data = {
+static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
 //     .det_pin        = ... not connected
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 57a6221943ed3b82f57e69d6db53994aaf7fc9f7..3cd5f8d0e2e2789d0c1ef2984e8d89aeb02d5673 100644 (file)
@@ -148,7 +148,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 6a680795c3c83d80cea369cd85d4fee0269201d4..daf93a5880689b0ce03f214ca0e5401e9de4884c 100644 (file)
@@ -185,7 +185,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 43dfbd0d543a07c7aeb7689354e3ea506bff60b1..12bf527f93be286c828d15de8f46dac3cabf4eb4 100644 (file)
@@ -190,7 +190,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .rdy_pin        = AT91_PIN_PC15,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 6605a098011761bb32cc85b58077cfac6f866cbb..63121197f8c92573ceca028f5bfd9f1aa0464e67 100644 (file)
@@ -194,7 +194,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .rdy_pin        = AT91_PIN_PA22,
        .enable_pin     = AT91_PIN_PD15,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 45617c2012405926c9ef4655753ef47fb6e267d3..e0c07952cc34d5ae13f214eb96db30150a3ef812 100644 (file)
@@ -143,13 +143,13 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitio
 }
 
 /* det_pin is not connected */
-static struct at91_nand_data __initdata ek_nand_data = {
+static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 837aedf8ffeb891f4d181dc271f32fba441feca3..2f4ecac150d9c2b185444be697c4a46c1c11cbd0 100644 (file)
@@ -114,14 +114,14 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitio
        return ek_nand_partition;
 }
 
-static struct at91_nand_data __initdata ek_nand_data = {
+static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
 //     .det_pin        = ... not connected
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 95800d32bd49d304f6e527e8afd23fdb29174fe5..0e9649d3eda19af87ff3a1c2b3e04b758e57e271 100644 (file)
@@ -127,14 +127,14 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitio
        return ek_nand_partition;
 }
 
-static struct at91_nand_data __initdata ek_nand_data = {
+static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
 //     .det_pin        = ... not connected
        .rdy_pin        = AT91_PIN_PA22,
        .enable_pin     = AT91_PIN_PD15,
        .partition_info = nand_partitions,
-#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
        .bus_width_16   = 1,
 #else
        .bus_width_16   = 0,
index 6a90fe5578df90cb0992d56c2b334e638278aa49..8915a5fc63cdcc81e8c8b2213d2d2497c1be2001 100644 (file)
@@ -172,24 +172,29 @@ found:
 
        return clk;
 }
+EXPORT_SYMBOL(clk_get);
 
 void clk_put(struct clk *clk)
 {
 }
+EXPORT_SYMBOL(clk_put);
 
 int clk_enable(struct clk *clk)
 {
        return 0;
 }
+EXPORT_SYMBOL(clk_enable);
 
 void clk_disable(struct clk *clk)
 {
 }
+EXPORT_SYMBOL(clk_disable);
 
 unsigned long clk_get_rate(struct clk *clk)
 {
        return clk->get_rate();
 }
+EXPORT_SYMBOL(clk_get_rate);
 
 int imx_clocks_init(void)
 {
index 98ddd8a6d05fb1a6b6da716abff67b11036f39d4..c40650dcddf5b30a71a55d0ba1f72b9d8c6f0d0a 100644 (file)
@@ -251,7 +251,6 @@ void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
 {
        memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
 }
-EXPORT_SYMBOL(set_imx_fb_info);
 
 static struct resource imxfb_resources[] = {
        [0] = {
index 9635d5812bcdffcaeae078e4288b6672570e4444..baeff24ff02da1abbd5d4be8a88c4751906fd547 100644 (file)
@@ -125,7 +125,7 @@ static struct platform_device *devices[] __initdata = {
        &imx_uart2_device,
 };
 
-#ifdef CONFIG_MMC_IMX
+#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
 static int mx1ads_mmc_card_present(struct device *dev)
 {
        /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
@@ -143,7 +143,7 @@ mx1ads_init(void)
 #ifdef CONFIG_LEDS
        imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
 #endif
-#ifdef CONFIG_MMC_IMX
+#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
        /* SD/MMC card detect */
        imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
        imx_set_mmc_info(&mx1ads_mmc_info);
index e1f8de2c74a213df7101a2fb7615b7930d754a2a..b6437f47a77f820ebb64557731303dbaa9d7496c 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/timer.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
@@ -69,6 +70,8 @@ static struct platform_device rd88f6281_nand_flash = {
 
 static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
        .phy_addr       = -1,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
 };
 
 static struct mv_sata_platform_data rd88f6281_sata_data = {
index a494b71c0195b32198e5f3497e6dac9c6cc6b2ee..46b4f5a2e7f45b7c60424cba289b0f5469a875f5 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/gpio.h>
 
-#include <asm/arch-ns9xxx/board.h>
-#include <asm/arch-ns9xxx/processor-ns9360.h>
-#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
-#include <asm/arch-ns9xxx/regs-mem.h>
-#include <asm/arch-ns9xxx/regs-bbu.h>
-#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
+#include <asm/arch/board.h>
+#include <asm/arch/processor-ns9360.h>
+#include <asm/arch/regs-sys-ns9360.h>
+#include <asm/arch/regs-mem.h>
+#include <asm/arch/regs-bbu.h>
+#include <asm/arch/regs-board-a9m9750dev.h>
 
 #include "board-a9m9750dev.h"
 
index cabfb879dda973678239b6731da30a56d9b9b4cb..7bc05a4b45b89f0aa1b6e461d0b3ba16ad0c63cb 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-#include <asm/arch-ns9xxx/regs-bbu.h>
-#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch/regs-bbu.h>
+#include <asm/arch/processor-ns9360.h>
 
 #include "gpio-ns9360.h"
 
index b3c963b0c8f5414bb9713d6897a8040da3736703..ed4c83389d4afd3e0e9e8853e4d6541326fcb2b7 100644 (file)
@@ -13,9 +13,9 @@
 #include <linux/spinlock.h>
 #include <linux/module.h>
 
-#include <asm/arch-ns9xxx/gpio.h>
-#include <asm/arch-ns9xxx/processor.h>
-#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/processor.h>
+#include <asm/arch/processor-ns9360.h>
 #include <asm/bug.h>
 #include <asm/types.h>
 #include <asm/bitops.h>
index ca85d24cf39f1f11553c2ac856d08b71bb9a9ff9..d2964257797e7e8aa65e7b18df82210ed8aefbe2 100644 (file)
@@ -13,9 +13,9 @@
 #include <asm/io.h>
 #include <asm/mach/irq.h>
 #include <asm/mach-types.h>
-#include <asm/arch-ns9xxx/regs-sys-common.h>
-#include <asm/arch-ns9xxx/irqs.h>
-#include <asm/arch-ns9xxx/board.h>
+#include <asm/arch/regs-sys-common.h>
+#include <asm/arch/irqs.h>
+#include <asm/arch/board.h>
 
 #include "generic.h"
 
index 9623fff6b3bcc48f93375572402a9b16339af8d0..7714233fb0048f7beec9a9ead2af0ead613fba9c 100644 (file)
@@ -11,7 +11,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
-#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch/processor-ns9360.h>
 
 #include "board-a9m9750dev.h"
 #include "generic.h"
index fcc815bdd291d8666e770925c074ae0d63491660..bdbd0bb1a0b33ebd369a1fde2a9375bb56940963 100644 (file)
@@ -11,7 +11,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
-#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch/processor-ns9360.h>
 
 #include "board-jscc9p9360.h"
 #include "generic.h"
index 5aa5d9baf8c815774c9c9d3603480499e8ae6619..c9cce9b4e6c96810783faf02f7f9980d4befa35e 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 
-#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
-#include <asm/arch-ns9xxx/board.h>
+#include <asm/arch/regs-board-a9m9750dev.h>
+#include <asm/arch/board.h>
 
 #define DRIVER_NAME "serial8250"
 
index 2bee0b7fccbbd8cd9ed7a8d37ed59fde8398ea81..8ee81b59b35d3a2464ec95e1306200a9328ba90d 100644 (file)
@@ -14,8 +14,8 @@
 
 #include <asm/page.h>
 #include <asm/mach/map.h>
-#include <asm/arch-ns9xxx/processor-ns9360.h>
-#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
+#include <asm/arch/processor-ns9360.h>
+#include <asm/arch/regs-sys-ns9360.h>
 
 void ns9360_reset(char mode)
 {
index 4d573c9793edcb940f17de5f3d3c519bad996434..66bd58262974f5f376341546d7bfbe27d66e50d6 100644 (file)
@@ -15,9 +15,9 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 
-#include <asm/arch-ns9xxx/processor-ns9360.h>
-#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
-#include <asm/arch-ns9xxx/irqs.h>
+#include <asm/arch/processor-ns9360.h>
+#include <asm/arch/regs-sys-ns9360.h>
+#include <asm/arch/irqs.h>
 #include <asm/arch/system.h>
 #include "generic.h"
 
index d50e3650a09e9393836fca9b5cc39625688be2a5..73e9242da7ad3e0973d3373f98ccc83dd85690eb 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/irq.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
 #include <asm/leds.h>
@@ -88,6 +89,8 @@ static struct orion5x_mpp_mode rd88f5181l_fxo_mpp_modes[] __initdata = {
 
 static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
        .phy_addr       = -1,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
 };
 
 static void __init rd88f5181l_fxo_init(void)
index b56447d32e179111d51db77e3ea8a847bb0cc059..ac482019abbfbf8b656245b9373e95bca102a6e1 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/irq.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
 #include <linux/i2c.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
@@ -89,6 +90,8 @@ static struct orion5x_mpp_mode rd88f5181l_ge_mpp_modes[] __initdata = {
 
 static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
        .phy_addr       = -1,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
 };
 
 static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = {
index 1af093ff8cf342e8b05fee3014f341ee8f202875..25568c2a3d298076b17c5dd332223c778f633edd 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
@@ -92,6 +93,8 @@ static struct platform_device wnr854t_nor_flash = {
 
 static struct mv643xx_eth_platform_data wnr854t_eth_data = {
        .phy_addr       = -1,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
 };
 
 static void __init wnr854t_init(void)
index aeab55c6a82daa5196f2b124a923488b28f76bca..9b8ee8c48bf013454b90678c4a44264eba02975c 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
@@ -100,6 +101,8 @@ static struct platform_device wrt350n_v2_nor_flash = {
 
 static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = {
        .phy_addr       = -1,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
 };
 
 static void __init wrt350n_v2_init(void)
index 30023b00e476161a691aa8a5603c1a0b08fa534d..90056d56b2104dfc0b7f76f1776948a564e1b179 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <linux/irq.h>
 #include <linux/platform_device.h>
-#include <linux/ide.h>
 #include <linux/i2c.h>
 #include <linux/pwm_backlight.h>
 
index 3a6c8ec34cd96b29f3b585331ecf4a8cdf8dd3eb..ed15f876c7254cd02ea86d53b5346cfa4efc67d0 100644 (file)
@@ -187,7 +187,7 @@ config CPU_ARM926T
                ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || \
                ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || \
                ARCH_AT91SAM9G20 || ARCH_AT91CAP9 || \
-               ARCH_NS9XXX || ARCH_DAVINCI
+               ARCH_NS9XXX || ARCH_DAVINCI || ARCH_MX2
        default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || \
                ARCH_OMAP730 || ARCH_OMAP16XX || \
                ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || \
@@ -742,3 +742,11 @@ config CACHE_L2X0
        select OUTER_CACHE
        help
          This option enables the L2x0 PrimeCell.
+
+config CACHE_XSC3L2
+       bool "Enable the L2 cache on XScale3"
+       depends on CPU_XSC3
+       default y
+       select OUTER_CACHE
+       help
+         This option enables the L2 cache on XScale3.
diff --git a/arch/arm/mm/cache-xsc3l2.c b/arch/arm/mm/cache-xsc3l2.c
new file mode 100644 (file)
index 0000000..158bd96
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * arch/arm/mm/cache-xsc3l2.c - XScale3 L2 cache controller support
+ *
+ * Copyright (C) 2007 ARM Limited
+ *
+ * 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.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/system.h>
+#include <asm/cacheflush.h>
+#include <asm/io.h>
+
+#define CR_L2  (1 << 26)
+
+#define CACHE_LINE_SIZE                32
+#define CACHE_LINE_SHIFT       5
+#define CACHE_WAY_PER_SET      8
+
+#define CACHE_WAY_SIZE(l2ctype)        (8192 << (((l2ctype) >> 8) & 0xf))
+#define CACHE_SET_SIZE(l2ctype)        (CACHE_WAY_SIZE(l2ctype) >> CACHE_LINE_SHIFT)
+
+static inline int xsc3_l2_present(void)
+{
+       unsigned long l2ctype;
+
+       __asm__("mrc p15, 1, %0, c0, c0, 1" : "=r" (l2ctype));
+
+       return !!(l2ctype & 0xf8);
+}
+
+static inline void xsc3_l2_clean_mva(unsigned long addr)
+{
+       __asm__("mcr p15, 1, %0, c7, c11, 1" : : "r" (addr));
+}
+
+static inline void xsc3_l2_clean_pa(unsigned long addr)
+{
+       xsc3_l2_clean_mva(__phys_to_virt(addr));
+}
+
+static inline void xsc3_l2_inv_mva(unsigned long addr)
+{
+       __asm__("mcr p15, 1, %0, c7, c7, 1" : : "r" (addr));
+}
+
+static inline void xsc3_l2_inv_pa(unsigned long addr)
+{
+       xsc3_l2_inv_mva(__phys_to_virt(addr));
+}
+
+static inline void xsc3_l2_inv_all(void)
+{
+       unsigned long l2ctype, set_way;
+       int set, way;
+
+       __asm__("mrc p15, 1, %0, c0, c0, 1" : "=r" (l2ctype));
+
+       for (set = 0; set < CACHE_SET_SIZE(l2ctype); set++) {
+               for (way = 0; way < CACHE_WAY_PER_SET; way++) {
+                       set_way = (way << 29) | (set << 5);
+                       __asm__("mcr p15, 1, %0, c7, c11, 2" : : "r"(set_way));
+               }
+       }
+
+       dsb();
+}
+
+static void xsc3_l2_inv_range(unsigned long start, unsigned long end)
+{
+       if (start == 0 && end == -1ul) {
+               xsc3_l2_inv_all();
+               return;
+       }
+
+       /*
+        * Clean and invalidate partial first cache line.
+        */
+       if (start & (CACHE_LINE_SIZE - 1)) {
+               xsc3_l2_clean_pa(start & ~(CACHE_LINE_SIZE - 1));
+               xsc3_l2_inv_pa(start & ~(CACHE_LINE_SIZE - 1));
+               start = (start | (CACHE_LINE_SIZE - 1)) + 1;
+       }
+
+       /*
+        * Clean and invalidate partial last cache line.
+        */
+       if (end & (CACHE_LINE_SIZE - 1)) {
+               xsc3_l2_clean_pa(end & ~(CACHE_LINE_SIZE - 1));
+               xsc3_l2_inv_pa(end & ~(CACHE_LINE_SIZE - 1));
+               end &= ~(CACHE_LINE_SIZE - 1);
+       }
+
+       /*
+        * Invalidate all full cache lines between 'start' and 'end'.
+        */
+       while (start != end) {
+               xsc3_l2_inv_pa(start);
+               start += CACHE_LINE_SIZE;
+       }
+
+       dsb();
+}
+
+static void xsc3_l2_clean_range(unsigned long start, unsigned long end)
+{
+       start &= ~(CACHE_LINE_SIZE - 1);
+       while (start < end) {
+               xsc3_l2_clean_pa(start);
+               start += CACHE_LINE_SIZE;
+       }
+
+       dsb();
+}
+
+/*
+ * optimize L2 flush all operation by set/way format
+ */
+static inline void xsc3_l2_flush_all(void)
+{
+       unsigned long l2ctype, set_way;
+       int set, way;
+
+       __asm__("mrc p15, 1, %0, c0, c0, 1" : "=r" (l2ctype));
+
+       for (set = 0; set < CACHE_SET_SIZE(l2ctype); set++) {
+               for (way = 0; way < CACHE_WAY_PER_SET; way++) {
+                       set_way = (way << 29) | (set << 5);
+                       __asm__("mcr p15, 1, %0, c7, c15, 2" : : "r"(set_way));
+               }
+       }
+
+       dsb();
+}
+
+static void xsc3_l2_flush_range(unsigned long start, unsigned long end)
+{
+       if (start == 0 && end == -1ul) {
+               xsc3_l2_flush_all();
+               return;
+       }
+
+       start &= ~(CACHE_LINE_SIZE - 1);
+       while (start < end) {
+               xsc3_l2_clean_pa(start);
+               xsc3_l2_inv_pa(start);
+               start += CACHE_LINE_SIZE;
+       }
+
+       dsb();
+}
+
+static int __init xsc3_l2_init(void)
+{
+       if (!cpu_is_xsc3() || !xsc3_l2_present())
+               return 0;
+
+       if (!(get_cr() & CR_L2)) {
+               pr_info("XScale3 L2 cache enabled.\n");
+               adjust_cr(CR_L2, CR_L2);
+               xsc3_l2_inv_all();
+       }
+
+       outer_cache.inv_range = xsc3_l2_inv_range;
+       outer_cache.clean_range = xsc3_l2_clean_range;
+       outer_cache.flush_range = xsc3_l2_flush_range;
+
+       return 0;
+}
+core_initcall(xsc3_l2_init);
index e6352946dde020e04c3461b2f074972592b74710..30a69d67d673ed80f122900223249e94ec6a4890 100644 (file)
@@ -156,9 +156,9 @@ static int __init check_initrd(struct meminfo *mi)
        }
 
        if (initrd_node == -1) {
-               printk(KERN_ERR "initrd (0x%08lx - 0x%08lx) extends beyond "
+               printk(KERN_ERR "INITRD: 0x%08lx+0x%08lx extends beyond "
                       "physical memory - disabling initrd\n",
-                      phys_initrd_start, end);
+                      phys_initrd_start, phys_initrd_size);
                phys_initrd_start = phys_initrd_size = 0;
        }
 #endif
@@ -239,24 +239,32 @@ bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
        reserve_bootmem_node(pgdat, boot_pfn << PAGE_SHIFT,
                             boot_pages << PAGE_SHIFT, BOOTMEM_DEFAULT);
 
+       /*
+        * Reserve any special node zero regions.
+        */
+       if (node == 0)
+               reserve_node_zero(pgdat);
+
 #ifdef CONFIG_BLK_DEV_INITRD
        /*
         * If the initrd is in this node, reserve its memory.
         */
        if (node == initrd_node) {
-               reserve_bootmem_node(pgdat, phys_initrd_start,
-                                    phys_initrd_size, BOOTMEM_DEFAULT);
-               initrd_start = __phys_to_virt(phys_initrd_start);
-               initrd_end = initrd_start + phys_initrd_size;
+               int res = reserve_bootmem_node(pgdat, phys_initrd_start,
+                                    phys_initrd_size, BOOTMEM_EXCLUSIVE);
+
+               if (res == 0) {
+                       initrd_start = __phys_to_virt(phys_initrd_start);
+                       initrd_end = initrd_start + phys_initrd_size;
+               } else {
+                       printk(KERN_ERR
+                               "INITRD: 0x%08lx+0x%08lx overlaps in-use "
+                               "memory region - disabling initrd\n",
+                               phys_initrd_start, phys_initrd_size);
+               }
        }
 #endif
 
-       /*
-        * Finally, reserve any node zero regions.
-        */
-       if (node == 0)
-               reserve_node_zero(pgdat);
-
        /*
         * initialise the zones within this node.
         */
index 303a7ff6bfd2eeb3120164d9cc185e0973d600de..b81dbf9ffb77b3f28a9b0ad872341fdad3656ca6 100644 (file)
@@ -259,7 +259,7 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
  * caller shouldn't need to know that small detail.
  *
  * 'flags' are the extra L_PTE_ flags that you want to specify for this
- * mapping.  See include/asm-arm/proc-armv/pgtable.h for more information.
+ * mapping.  See <asm/pgtable.h> for more information.
  */
 void __iomem *
 __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
index d64f8e6f75ab19f889c4cf93586f66bb64008e37..eda733d30455d18bd97bb565d2df8540cd1eb4a4 100644 (file)
@@ -231,7 +231,7 @@ cpu_arm720_name:
                .align
 
 /*
- * See linux/include/asm-arm/procinfo.h for a definition of this structure.
+ * See <asm/procinfo.h> for a definition of this structure.
  */
        
                .section ".proc.info.init", #alloc, #execinstr
index 3533741a76f6713b8f0229570dd49123d040331b..6ff53c24510f728f1f5ae25374205de4e1223221 100644 (file)
  */
 #define CACHESIZE      32768
 
-/*
- * Run with L2 enabled.
- */
-#define L2_CACHE_ENABLE        1
-
 /*
  * This macro is used to wait for a CP15 write and is needed when we
  * have to ensure that the last operation to the coprocessor was
@@ -265,12 +260,9 @@ ENTRY(xsc3_dma_inv_range)
        tst     r0, #CACHELINESIZE - 1
        bic     r0, r0, #CACHELINESIZE - 1
        mcrne   p15, 0, r0, c7, c10, 1          @ clean L1 D line
-       mcrne   p15, 1, r0, c7, c11, 1          @ clean L2 line
        tst     r1, #CACHELINESIZE - 1
        mcrne   p15, 0, r1, c7, c10, 1          @ clean L1 D line
-       mcrne   p15, 1, r1, c7, c11, 1          @ clean L2 line
 1:     mcr     p15, 0, r0, c7, c6, 1           @ invalidate L1 D line
-       mcr     p15, 1, r0, c7, c7, 1           @ invalidate L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
@@ -288,7 +280,6 @@ ENTRY(xsc3_dma_inv_range)
 ENTRY(xsc3_dma_clean_range)
        bic     r0, r0, #CACHELINESIZE - 1
 1:     mcr     p15, 0, r0, c7, c10, 1          @ clean L1 D line
-       mcr     p15, 1, r0, c7, c11, 1          @ clean L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
@@ -306,8 +297,6 @@ ENTRY(xsc3_dma_clean_range)
 ENTRY(xsc3_dma_flush_range)
        bic     r0, r0, #CACHELINESIZE - 1
 1:     mcr     p15, 0, r0, c7, c14, 1          @ clean/invalidate L1 D line
-       mcr     p15, 1, r0, c7, c11, 1          @ clean L2 line
-       mcr     p15, 1, r0, c7, c7, 1           @ invalidate L2 line
        add     r0, r0, #CACHELINESIZE
        cmp     r0, r1
        blo     1b
@@ -347,9 +336,7 @@ ENTRY(cpu_xsc3_switch_mm)
        mcr     p15, 0, ip, c7, c5, 0           @ invalidate L1 I cache and BTB
        mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
        mcr     p15, 0, ip, c7, c5, 4           @ prefetch flush
-#ifdef L2_CACHE_ENABLE
        orr     r0, r0, #0x18                   @ cache the page table in L2
-#endif
        mcr     p15, 0, r0, c2, c0, 0           @ load page table pointer
        mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
        cpwait_ret lr, ip
@@ -378,12 +365,10 @@ ENTRY(cpu_xsc3_set_pte_ext)
        orreq   r2, r2, #PTE_EXT_AP_UNO_SRW     @ yes -> user n/a, system r/w
                                                @ combined with user -> user r/w
 
-#if L2_CACHE_ENABLE
        @ If it's cacheable, it needs to be in L2 also.
        eor     ip, r1, #L_PTE_CACHEABLE
        tst     ip, #L_PTE_CACHEABLE
        orreq   r2, r2, #PTE_EXT_TEX(0x5)
-#endif
 
        tst     r3, #L_PTE_PRESENT | L_PTE_YOUNG        @ present and young?
        movne   r2, #0                          @ no -> fault
@@ -408,9 +393,7 @@ __xsc3_setup:
        mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
        mcr     p15, 0, ip, c7, c5, 4           @ prefetch flush
        mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
-#if L2_CACHE_ENABLE
        orr     r4, r4, #0x18                   @ cache the page table in L2
-#endif
        mcr     p15, 0, r4, c2, c0, 0           @ load page table pointer
 
        mov     r0, #0                          @ don't allow CP access
@@ -418,9 +401,7 @@ __xsc3_setup:
 
        mrc     p15, 0, r0, c1, c0, 1           @ get auxiliary control reg
        and     r0, r0, #2                      @ preserve bit P bit setting
-#if L2_CACHE_ENABLE
        orr     r0, r0, #(1 << 10)              @ enable L2 for LLR cache
-#endif
        mcr     p15, 0, r0, c1, c0, 1           @ set auxiliary control reg
 
        adr     r5, xsc3_crval
@@ -429,9 +410,6 @@ __xsc3_setup:
        bic     r0, r0, r5                      @ ..V. ..R. .... ..A.
        orr     r0, r0, r6                      @ ..VI Z..S .... .C.M (mmu)
                                                @ ...I Z..S .... .... (uc)
-#if L2_CACHE_ENABLE
-       orr     r0, r0, #0x04000000             @ L2 enable
-#endif
        mov     pc, lr
 
        .size   __xsc3_setup, . - __xsc3_setup
index 4a4d02c09112f06861ba95aef761c31b9e429444..386cbd13eaf422213f929e9aca9a81e0610348a7 100644 (file)
@@ -69,7 +69,7 @@ typedef union tagFPREG {
  * This structure is exported to user space.  Do not re-order.
  * Only add new stuff to the end, and do not change the size of
  * any element.  Elements of this structure are used by user
- * space, and must match struct user_fp in include/asm-arm/user.h.
+ * space, and must match struct user_fp in <asm/user.h>.
  * We include the byte offsets below for documentation purposes.
  *
  * The size of this structure and FPREG are checked by fpmodule.c
index b8a4b94779b14d137e974f8541729cf133fea099..99060ab507eea6b85a49dde3bf86368fcbb9d305 100644 (file)
@@ -1519,6 +1519,11 @@ sys_call_table:
        .long sys_fallocate
        .long sys_timerfd_settime       /* 325 */
        .long sys_timerfd_gettime
-
+       .long sys_signalfd4
+       .long sys_eventfd2
+       .long sys_epoll_create1
+       .long sys_dup3                  /* 330 */
+       .long sys_pipe2
+       .long sys_inotify_init1
 
 syscall_table_size = (. - sys_call_table)
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
new file mode 100644 (file)
index 0000000..ccbe8ae
--- /dev/null
@@ -0,0 +1,16 @@
+include include/asm-generic/Kbuild.asm
+
+header-y += break.h
+header-y += fpu.h
+header-y += fpswa.h
+header-y += ia64regs.h
+header-y += intel_intrin.h
+header-y += perfmon_default_smpl.h
+header-y += ptrace_offsets.h
+header-y += rse.h
+header-y += ucontext.h
+
+unifdef-y += gcc_intrin.h
+unifdef-y += intrinsics.h
+unifdef-y += perfmon.h
+unifdef-y += ustack.h
diff --git a/arch/ia64/include/asm/a.out.h b/arch/ia64/include/asm/a.out.h
new file mode 100644 (file)
index 0000000..193dcfb
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _ASM_IA64_A_OUT_H
+#define _ASM_IA64_A_OUT_H
+
+/*
+ * No a.out format has been (or should be) defined so this file is
+ * just a dummy that allows us to get binfmt_elf compiled.  It
+ * probably would be better to clean up binfmt_elf.c so it does not
+ * necessarily depend on there being a.out support.
+ *
+ * Modified 1998-2002
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
+ */
+
+#include <linux/types.h>
+
+struct exec {
+       unsigned long a_info;
+       unsigned long a_text;
+       unsigned long a_data;
+       unsigned long a_bss;
+       unsigned long a_entry;
+};
+
+#define N_TXTADDR(x)   0
+#define N_DATADDR(x)   0
+#define N_BSSADDR(x)   0
+#define N_DRSIZE(x)    0
+#define N_TRSIZE(x)    0
+#define N_SYMSIZE(x)   0
+#define N_TXTOFF(x)    0
+
+#endif /* _ASM_IA64_A_OUT_H */
diff --git a/arch/ia64/include/asm/acpi-ext.h b/arch/ia64/include/asm/acpi-ext.h
new file mode 100644 (file)
index 0000000..734d137
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P.
+ *     Alex Williamson <alex.williamson@hp.com>
+ *     Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * 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.
+ *
+ * Vendor specific extensions to ACPI.
+ */
+
+#ifndef _ASM_IA64_ACPI_EXT_H
+#define _ASM_IA64_ACPI_EXT_H
+
+#include <linux/types.h>
+#include <acpi/actypes.h>
+
+extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
+
+#endif /* _ASM_IA64_ACPI_EXT_H */
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
new file mode 100644 (file)
index 0000000..0f82cc2
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ *  Copyright (C) 1999 VA Linux Systems
+ *  Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ *  Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
+ *  Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.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 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#ifndef _ASM_ACPI_H
+#define _ASM_ACPI_H
+
+#ifdef __KERNEL__
+
+#include <acpi/pdc_intel.h>
+
+#include <linux/init.h>
+#include <linux/numa.h>
+#include <asm/system.h>
+#include <asm/numa.h>
+
+#define COMPILER_DEPENDENT_INT64       long
+#define COMPILER_DEPENDENT_UINT64      unsigned long
+
+/*
+ * Calling conventions:
+ *
+ * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
+ * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
+ * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
+ * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
+ */
+#define ACPI_SYSTEM_XFACE
+#define ACPI_EXTERNAL_XFACE
+#define ACPI_INTERNAL_XFACE
+#define ACPI_INTERNAL_VAR_XFACE
+
+/* Asm macros */
+
+#define ACPI_ASM_MACROS
+#define BREAKPOINT3
+#define ACPI_DISABLE_IRQS() local_irq_disable()
+#define ACPI_ENABLE_IRQS()  local_irq_enable()
+#define ACPI_FLUSH_CPU_CACHE()
+
+static inline int
+ia64_acpi_acquire_global_lock (unsigned int *lock)
+{
+       unsigned int old, new, val;
+       do {
+               old = *lock;
+               new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
+               val = ia64_cmpxchg4_acq(lock, new, old);
+       } while (unlikely (val != old));
+       return (new < 3) ? -1 : 0;
+}
+
+static inline int
+ia64_acpi_release_global_lock (unsigned int *lock)
+{
+       unsigned int old, new, val;
+       do {
+               old = *lock;
+               new = old & ~0x3;
+               val = ia64_cmpxchg4_acq(lock, new, old);
+       } while (unlikely (val != old));
+       return old & 0x1;
+}
+
+#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq)                            \
+       ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
+
+#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq)                            \
+       ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
+
+#define acpi_disabled 0        /* ACPI always enabled on IA64 */
+#define acpi_noirq 0   /* ACPI always enabled on IA64 */
+#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
+#define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
+#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
+static inline void disable_acpi(void) { }
+
+const char *acpi_get_sysname (void);
+int acpi_request_vector (u32 int_type);
+int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
+
+/* routines for saving/restoring kernel state */
+extern int acpi_save_state_mem(void);
+extern void acpi_restore_state_mem(void);
+extern unsigned long acpi_wakeup_address;
+
+/*
+ * Record the cpei override flag and current logical cpu. This is
+ * useful for CPU removal.
+ */
+extern unsigned int can_cpei_retarget(void);
+extern unsigned int is_cpu_cpei_target(unsigned int cpu);
+extern void set_cpei_target_cpu(unsigned int cpu);
+extern unsigned int get_cpei_target_cpu(void);
+extern void prefill_possible_map(void);
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+extern int additional_cpus;
+#else
+#define additional_cpus 0
+#endif
+
+#ifdef CONFIG_ACPI_NUMA
+#if MAX_NUMNODES > 256
+#define MAX_PXM_DOMAINS MAX_NUMNODES
+#else
+#define MAX_PXM_DOMAINS (256)
+#endif
+extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
+extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
+#endif
+
+#define acpi_unlazy_tlb(x)
+
+#ifdef CONFIG_ACPI_NUMA
+extern cpumask_t early_cpu_possible_map;
+#define for_each_possible_early_cpu(cpu)  \
+       for_each_cpu_mask((cpu), early_cpu_possible_map)
+
+static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
+{
+       int low_cpu, high_cpu;
+       int cpu;
+       int next_nid = 0;
+
+       low_cpu = cpus_weight(early_cpu_possible_map);
+
+       high_cpu = max(low_cpu, min_cpus);
+       high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
+
+       for (cpu = low_cpu; cpu < high_cpu; cpu++) {
+               cpu_set(cpu, early_cpu_possible_map);
+               if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
+                       node_cpuid[cpu].nid = next_nid;
+                       next_nid++;
+                       if (next_nid >= num_online_nodes())
+                               next_nid = 0;
+               }
+       }
+}
+#endif /* CONFIG_ACPI_NUMA */
+
+#endif /*__KERNEL__*/
+
+#endif /*_ASM_ACPI_H*/
diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
new file mode 100644 (file)
index 0000000..c11fdd8
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _ASM_IA64_AGP_H
+#define _ASM_IA64_AGP_H
+
+/*
+ * IA-64 specific AGP definitions.
+ *
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+/*
+ * To avoid memory-attribute aliasing issues, we require that the AGPGART engine operate
+ * in coherent mode, which lets us map the AGP memory as normal (write-back) memory
+ * (unlike x86, where it gets mapped "write-coalescing").
+ */
+#define map_page_into_agp(page)                /* nothing */
+#define unmap_page_from_agp(page)      /* nothing */
+#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 /* _ASM_IA64_AGP_H */
diff --git a/arch/ia64/include/asm/asmmacro.h b/arch/ia64/include/asm/asmmacro.h
new file mode 100644 (file)
index 0000000..c1642fd
--- /dev/null
@@ -0,0 +1,135 @@
+#ifndef _ASM_IA64_ASMMACRO_H
+#define _ASM_IA64_ASMMACRO_H
+
+/*
+ * Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#define ENTRY(name)                            \
+       .align 32;                              \
+       .proc name;                             \
+name:
+
+#define ENTRY_MIN_ALIGN(name)                  \
+       .align 16;                              \
+       .proc name;                             \
+name:
+
+#define GLOBAL_ENTRY(name)                     \
+       .global name;                           \
+       ENTRY(name)
+
+#define END(name)                              \
+       .endp name
+
+/*
+ * Helper macros to make unwind directives more readable:
+ */
+
+/* prologue_gr: */
+#define ASM_UNW_PRLG_RP                        0x8
+#define ASM_UNW_PRLG_PFS               0x4
+#define ASM_UNW_PRLG_PSP               0x2
+#define ASM_UNW_PRLG_PR                        0x1
+#define ASM_UNW_PRLG_GRSAVE(ninputs)   (32+(ninputs))
+
+/*
+ * Helper macros for accessing user memory.
+ *
+ * When adding any new .section/.previous entries here, make sure to
+ * also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or
+ * unpleasant things will happen.
+ */
+
+       .section "__ex_table", "a"              // declare section & section attributes
+       .previous
+
+# define EX(y,x...)                            \
+       .xdata4 "__ex_table", 99f-., y-.;       \
+  [99:]        x
+# define EXCLR(y,x...)                         \
+       .xdata4 "__ex_table", 99f-., y-.+4;     \
+  [99:]        x
+
+/*
+ * Tag MCA recoverable instruction ranges.
+ */
+
+       .section "__mca_table", "a"             // declare section & section attributes
+       .previous
+
+# define MCA_RECOVER_RANGE(y)                  \
+       .xdata4 "__mca_table", y-., 99f-.;      \
+  [99:]
+
+/*
+ * Mark instructions that need a load of a virtual address patched to be
+ * a load of a physical address.  We use this either in critical performance
+ * path (ivt.S - TLB miss processing) or in places where it might not be
+ * safe to use a "tpa" instruction (mca_asm.S - error recovery).
+ */
+       .section ".data.patch.vtop", "a"        // declare section & section attributes
+       .previous
+
+#define        LOAD_PHYSICAL(pr, reg, obj)             \
+[1:](pr)movl reg = obj;                                \
+       .xdata4 ".data.patch.vtop", 1b-.
+
+/*
+ * For now, we always put in the McKinley E9 workaround.  On CPUs that don't need it,
+ * we'll patch out the work-around bundles with NOPs, so their impact is minimal.
+ */
+#define DO_MCKINLEY_E9_WORKAROUND
+
+#ifdef DO_MCKINLEY_E9_WORKAROUND
+       .section ".data.patch.mckinley_e9", "a"
+       .previous
+/* workaround for Itanium 2 Errata 9: */
+# define FSYS_RETURN                                   \
+       .xdata4 ".data.patch.mckinley_e9", 1f-.;        \
+1:{ .mib;                                              \
+       nop.m 0;                                        \
+       mov r16=ar.pfs;                                 \
+       br.call.sptk.many b7=2f;;                       \
+  };                                                   \
+2:{ .mib;                                              \
+       nop.m 0;                                        \
+       mov ar.pfs=r16;                                 \
+       br.ret.sptk.many b6;;                           \
+  }
+#else
+# define FSYS_RETURN   br.ret.sptk.many b6
+#endif
+
+/*
+ * If physical stack register size is different from DEF_NUM_STACK_REG,
+ * dynamically patch the kernel for correct size.
+ */
+       .section ".data.patch.phys_stack_reg", "a"
+       .previous
+#define LOAD_PHYS_STACK_REG_SIZE(reg)                  \
+[1:]   adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0;        \
+       .xdata4 ".data.patch.phys_stack_reg", 1b-.
+
+/*
+ * Up until early 2004, use of .align within a function caused bad unwind info.
+ * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
+ * otherwise.
+ */
+#ifdef HAVE_WORKING_TEXT_ALIGN
+# define TEXT_ALIGN(n) .align n
+#else
+# define TEXT_ALIGN(n)
+#endif
+
+#ifdef HAVE_SERIALIZE_DIRECTIVE
+# define dv_serialize_data             .serialize.data
+# define dv_serialize_instruction      .serialize.instruction
+#else
+# define dv_serialize_data
+# define dv_serialize_instruction
+#endif
+
+#endif /* _ASM_IA64_ASMMACRO_H */
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..50c2b83
--- /dev/null
@@ -0,0 +1,226 @@
+#ifndef _ASM_IA64_ATOMIC_H
+#define _ASM_IA64_ATOMIC_H
+
+/*
+ * Atomic operations that C can't guarantee us.  Useful for
+ * resource counting etc..
+ *
+ * NOTE: don't mess with the types below!  The "unsigned long" and
+ * "int" types were carefully placed so as to ensure proper operation
+ * of the macros.
+ *
+ * Copyright (C) 1998, 1999, 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+#include <linux/types.h>
+
+#include <asm/intrinsics.h>
+#include <asm/system.h>
+
+/*
+ * On IA-64, counter must always be volatile to ensure that that the
+ * memory accesses are ordered.
+ */
+typedef struct { volatile __s32 counter; } atomic_t;
+typedef struct { volatile __s64 counter; } atomic64_t;
+
+#define ATOMIC_INIT(i)         ((atomic_t) { (i) })
+#define ATOMIC64_INIT(i)       ((atomic64_t) { (i) })
+
+#define atomic_read(v)         ((v)->counter)
+#define atomic64_read(v)       ((v)->counter)
+
+#define atomic_set(v,i)                (((v)->counter) = (i))
+#define atomic64_set(v,i)      (((v)->counter) = (i))
+
+static __inline__ int
+ia64_atomic_add (int i, atomic_t *v)
+{
+       __s32 old, new;
+       CMPXCHG_BUGCHECK_DECL
+
+       do {
+               CMPXCHG_BUGCHECK(v);
+               old = atomic_read(v);
+               new = old + i;
+       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
+       return new;
+}
+
+static __inline__ int
+ia64_atomic64_add (__s64 i, atomic64_t *v)
+{
+       __s64 old, new;
+       CMPXCHG_BUGCHECK_DECL
+
+       do {
+               CMPXCHG_BUGCHECK(v);
+               old = atomic64_read(v);
+               new = old + i;
+       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
+       return new;
+}
+
+static __inline__ int
+ia64_atomic_sub (int i, atomic_t *v)
+{
+       __s32 old, new;
+       CMPXCHG_BUGCHECK_DECL
+
+       do {
+               CMPXCHG_BUGCHECK(v);
+               old = atomic_read(v);
+               new = old - i;
+       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
+       return new;
+}
+
+static __inline__ int
+ia64_atomic64_sub (__s64 i, atomic64_t *v)
+{
+       __s64 old, new;
+       CMPXCHG_BUGCHECK_DECL
+
+       do {
+               CMPXCHG_BUGCHECK(v);
+               old = atomic64_read(v);
+               new = old - i;
+       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
+       return new;
+}
+
+#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+
+#define atomic64_cmpxchg(v, old, new) \
+       (cmpxchg(&((v)->counter), old, new))
+#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
+
+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)
+
+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_return(i,v)                                         \
+({                                                                     \
+       int __ia64_aar_i = (i);                                         \
+       (__builtin_constant_p(i)                                        \
+        && (   (__ia64_aar_i ==  1) || (__ia64_aar_i ==   4)           \
+            || (__ia64_aar_i ==  8) || (__ia64_aar_i ==  16)           \
+            || (__ia64_aar_i == -1) || (__ia64_aar_i ==  -4)           \
+            || (__ia64_aar_i == -8) || (__ia64_aar_i == -16)))         \
+               ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter)       \
+               : ia64_atomic_add(__ia64_aar_i, v);                     \
+})
+
+#define atomic64_add_return(i,v)                                       \
+({                                                                     \
+       long __ia64_aar_i = (i);                                        \
+       (__builtin_constant_p(i)                                        \
+        && (   (__ia64_aar_i ==  1) || (__ia64_aar_i ==   4)           \
+            || (__ia64_aar_i ==  8) || (__ia64_aar_i ==  16)           \
+            || (__ia64_aar_i == -1) || (__ia64_aar_i ==  -4)           \
+            || (__ia64_aar_i == -8) || (__ia64_aar_i == -16)))         \
+               ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter)       \
+               : ia64_atomic64_add(__ia64_aar_i, v);                   \
+})
+
+/*
+ * Atomically add I to V and return TRUE if the resulting value is
+ * negative.
+ */
+static __inline__ int
+atomic_add_negative (int i, atomic_t *v)
+{
+       return atomic_add_return(i, v) < 0;
+}
+
+static __inline__ int
+atomic64_add_negative (__s64 i, atomic64_t *v)
+{
+       return atomic64_add_return(i, v) < 0;
+}
+
+#define atomic_sub_return(i,v)                                         \
+({                                                                     \
+       int __ia64_asr_i = (i);                                         \
+       (__builtin_constant_p(i)                                        \
+        && (   (__ia64_asr_i ==   1) || (__ia64_asr_i ==   4)          \
+            || (__ia64_asr_i ==   8) || (__ia64_asr_i ==  16)          \
+            || (__ia64_asr_i ==  -1) || (__ia64_asr_i ==  -4)          \
+            || (__ia64_asr_i ==  -8) || (__ia64_asr_i == -16)))        \
+               ? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter)      \
+               : ia64_atomic_sub(__ia64_asr_i, v);                     \
+})
+
+#define atomic64_sub_return(i,v)                                       \
+({                                                                     \
+       long __ia64_asr_i = (i);                                        \
+       (__builtin_constant_p(i)                                        \
+        && (   (__ia64_asr_i ==   1) || (__ia64_asr_i ==   4)          \
+            || (__ia64_asr_i ==   8) || (__ia64_asr_i ==  16)          \
+            || (__ia64_asr_i ==  -1) || (__ia64_asr_i ==  -4)          \
+            || (__ia64_asr_i ==  -8) || (__ia64_asr_i == -16)))        \
+               ? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter)      \
+               : ia64_atomic64_sub(__ia64_asr_i, v);                   \
+})
+
+#define atomic_dec_return(v)           atomic_sub_return(1, (v))
+#define atomic_inc_return(v)           atomic_add_return(1, (v))
+#define atomic64_dec_return(v)         atomic64_sub_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 atomic_dec_and_test(v)         (atomic_sub_return(1, (v)) == 0)
+#define atomic_inc_and_test(v)         (atomic_add_return(1, (v)) == 0)
+#define atomic64_sub_and_test(i,v)     (atomic64_sub_return((i), (v)) == 0)
+#define atomic64_dec_and_test(v)       (atomic64_sub_return(1, (v)) == 0)
+#define atomic64_inc_and_test(v)       (atomic64_add_return(1, (v)) == 0)
+
+#define atomic_add(i,v)                        atomic_add_return((i), (v))
+#define atomic_sub(i,v)                        atomic_sub_return((i), (v))
+#define atomic_inc(v)                  atomic_add(1, (v))
+#define atomic_dec(v)                  atomic_sub(1, (v))
+
+#define atomic64_add(i,v)              atomic64_add_return((i), (v))
+#define atomic64_sub(i,v)              atomic64_sub_return((i), (v))
+#define atomic64_inc(v)                        atomic64_add(1, (v))
+#define atomic64_dec(v)                        atomic64_sub(1, (v))
+
+/* Atomic operations are already serializing */
+#define smp_mb__before_atomic_dec()    barrier()
+#define smp_mb__after_atomic_dec()     barrier()
+#define smp_mb__before_atomic_inc()    barrier()
+#define smp_mb__after_atomic_inc()     barrier()
+
+#include <asm-generic/atomic.h>
+#endif /* _ASM_IA64_ATOMIC_H */
diff --git a/arch/ia64/include/asm/auxvec.h b/arch/ia64/include/asm/auxvec.h
new file mode 100644 (file)
index 0000000..23cebe5
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ASM_IA64_AUXVEC_H
+#define _ASM_IA64_AUXVEC_H
+
+/*
+ * Architecture-neutral AT_ values are in the range 0-17.  Leave some room for more of
+ * them, start the architecture-specific ones at 32.
+ */
+#define AT_SYSINFO     32
+#define AT_SYSINFO_EHDR        33
+
+#endif /* _ASM_IA64_AUXVEC_H */
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..e2ca800
--- /dev/null
@@ -0,0 +1,468 @@
+#ifndef _ASM_IA64_BITOPS_H
+#define _ASM_IA64_BITOPS_H
+
+/*
+ * Copyright (C) 1998-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ * 02/06/02 find_next_bit() and find_first_bit() added from Erich Focht's ia64
+ * O(1) scheduler patch
+ */
+
+#ifndef _LINUX_BITOPS_H
+#error only <linux/bitops.h> can be included directly
+#endif
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <asm/intrinsics.h>
+
+/**
+ * set_bit - Atomically set a bit in memory
+ * @nr: the bit to set
+ * @addr: the address to start counting from
+ *
+ * This function is atomic and may not be reordered.  See __set_bit()
+ * if you do not require the atomic guarantees.
+ * Note that @nr may be almost arbitrarily large; this function is not
+ * restricted to acting on a single-word quantity.
+ *
+ * The address must be (at least) "long" aligned.
+ * Note that there are driver (e.g., eepro100) which use these operations to
+ * operate on hw-defined data-structures, so we can't easily change these
+ * operations to force a bigger alignment.
+ *
+ * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
+ */
+static __inline__ void
+set_bit (int nr, volatile void *addr)
+{
+       __u32 bit, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       bit = 1 << (nr & 31);
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old | bit;
+       } while (cmpxchg_acq(m, old, new) != old);
+}
+
+/**
+ * __set_bit - Set a bit in memory
+ * @nr: the bit to set
+ * @addr: the address to start counting from
+ *
+ * Unlike set_bit(), this function is non-atomic and may be reordered.
+ * If it's called on the same region of memory simultaneously, the effect
+ * may be that only one operation succeeds.
+ */
+static __inline__ void
+__set_bit (int nr, volatile void *addr)
+{
+       *((__u32 *) addr + (nr >> 5)) |= (1 << (nr & 31));
+}
+
+/*
+ * clear_bit() has "acquire" semantics.
+ */
+#define smp_mb__before_clear_bit()     smp_mb()
+#define smp_mb__after_clear_bit()      do { /* skip */; } while (0)
+
+/**
+ * clear_bit - Clears a bit in memory
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * clear_bit() is atomic and may not be reordered.  However, it does
+ * not contain a memory barrier, so if it is used for locking purposes,
+ * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
+ * in order to ensure changes are visible on other processors.
+ */
+static __inline__ void
+clear_bit (int nr, volatile void *addr)
+{
+       __u32 mask, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       mask = ~(1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old & mask;
+       } while (cmpxchg_acq(m, old, new) != old);
+}
+
+/**
+ * clear_bit_unlock - Clears a bit in memory with release
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * clear_bit_unlock() is atomic and may not be reordered.  It does
+ * contain a memory barrier suitable for unlock type operations.
+ */
+static __inline__ void
+clear_bit_unlock (int nr, volatile void *addr)
+{
+       __u32 mask, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       mask = ~(1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old & mask;
+       } while (cmpxchg_rel(m, old, new) != old);
+}
+
+/**
+ * __clear_bit_unlock - Non-atomically clears a bit in memory with release
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * Similarly to clear_bit_unlock, the implementation uses a store
+ * with release semantics. See also __raw_spin_unlock().
+ */
+static __inline__ void
+__clear_bit_unlock(int nr, void *addr)
+{
+       __u32 * const m = (__u32 *) addr + (nr >> 5);
+       __u32 const new = *m & ~(1 << (nr & 31));
+
+       ia64_st4_rel_nta(m, new);
+}
+
+/**
+ * __clear_bit - Clears a bit in memory (non-atomic version)
+ * @nr: the bit to clear
+ * @addr: the address to start counting from
+ *
+ * Unlike clear_bit(), this function is non-atomic and may be reordered.
+ * If it's called on the same region of memory simultaneously, the effect
+ * may be that only one operation succeeds.
+ */
+static __inline__ void
+__clear_bit (int nr, volatile void *addr)
+{
+       *((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
+}
+
+/**
+ * change_bit - Toggle a bit in memory
+ * @nr: Bit to toggle
+ * @addr: Address to start counting from
+ *
+ * change_bit() is atomic and may not be reordered.
+ * Note that @nr may be almost arbitrarily large; this function is not
+ * restricted to acting on a single-word quantity.
+ */
+static __inline__ void
+change_bit (int nr, volatile void *addr)
+{
+       __u32 bit, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       bit = (1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old ^ bit;
+       } while (cmpxchg_acq(m, old, new) != old);
+}
+
+/**
+ * __change_bit - Toggle a bit in memory
+ * @nr: the bit to toggle
+ * @addr: the address to start counting from
+ *
+ * Unlike change_bit(), this function is non-atomic and may be reordered.
+ * If it's called on the same region of memory simultaneously, the effect
+ * may be that only one operation succeeds.
+ */
+static __inline__ void
+__change_bit (int nr, volatile void *addr)
+{
+       *((__u32 *) addr + (nr >> 5)) ^= (1 << (nr & 31));
+}
+
+/**
+ * test_and_set_bit - Set a bit and return its old value
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This operation is atomic and cannot be reordered.  
+ * It also implies the acquisition side of the memory barrier.
+ */
+static __inline__ int
+test_and_set_bit (int nr, volatile void *addr)
+{
+       __u32 bit, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       bit = 1 << (nr & 31);
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old | bit;
+       } while (cmpxchg_acq(m, old, new) != old);
+       return (old & bit) != 0;
+}
+
+/**
+ * test_and_set_bit_lock - Set a bit and return its old value for lock
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This is the same as test_and_set_bit on ia64
+ */
+#define test_and_set_bit_lock test_and_set_bit
+
+/**
+ * __test_and_set_bit - Set a bit and return its old value
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This operation is non-atomic and can be reordered.  
+ * If two examples of this operation race, one can appear to succeed
+ * but actually fail.  You must protect multiple accesses with a lock.
+ */
+static __inline__ int
+__test_and_set_bit (int nr, volatile void *addr)
+{
+       __u32 *p = (__u32 *) addr + (nr >> 5);
+       __u32 m = 1 << (nr & 31);
+       int oldbitset = (*p & m) != 0;
+
+       *p |= m;
+       return oldbitset;
+}
+
+/**
+ * test_and_clear_bit - Clear a bit and return its old value
+ * @nr: Bit to clear
+ * @addr: Address to count from
+ *
+ * This operation is atomic and cannot be reordered.  
+ * It also implies the acquisition side of the memory barrier.
+ */
+static __inline__ int
+test_and_clear_bit (int nr, volatile void *addr)
+{
+       __u32 mask, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       mask = ~(1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old & mask;
+       } while (cmpxchg_acq(m, old, new) != old);
+       return (old & ~mask) != 0;
+}
+
+/**
+ * __test_and_clear_bit - Clear a bit and return its old value
+ * @nr: Bit to clear
+ * @addr: Address to count from
+ *
+ * This operation is non-atomic and can be reordered.  
+ * If two examples of this operation race, one can appear to succeed
+ * but actually fail.  You must protect multiple accesses with a lock.
+ */
+static __inline__ int
+__test_and_clear_bit(int nr, volatile void * addr)
+{
+       __u32 *p = (__u32 *) addr + (nr >> 5);
+       __u32 m = 1 << (nr & 31);
+       int oldbitset = *p & m;
+
+       *p &= ~m;
+       return oldbitset;
+}
+
+/**
+ * test_and_change_bit - Change a bit and return its old value
+ * @nr: Bit to change
+ * @addr: Address to count from
+ *
+ * This operation is atomic and cannot be reordered.  
+ * It also implies the acquisition side of the memory barrier.
+ */
+static __inline__ int
+test_and_change_bit (int nr, volatile void *addr)
+{
+       __u32 bit, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       bit = (1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old ^ bit;
+       } while (cmpxchg_acq(m, old, new) != old);
+       return (old & bit) != 0;
+}
+
+/**
+ * __test_and_change_bit - Change a bit and return its old value
+ * @nr: Bit to change
+ * @addr: Address to count from
+ *
+ * This operation is non-atomic and can be reordered.
+ */
+static __inline__ int
+__test_and_change_bit (int nr, void *addr)
+{
+       __u32 old, bit = (1 << (nr & 31));
+       __u32 *m = (__u32 *) addr + (nr >> 5);
+
+       old = *m;
+       *m = old ^ bit;
+       return (old & bit) != 0;
+}
+
+static __inline__ int
+test_bit (int nr, const volatile void *addr)
+{
+       return 1 & (((const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
+}
+
+/**
+ * ffz - find the first zero bit in a long word
+ * @x: The long word to find the bit in
+ *
+ * Returns the bit-number (0..63) of the first (least significant) zero bit.
+ * Undefined if no zero exists, so code should check against ~0UL first...
+ */
+static inline unsigned long
+ffz (unsigned long x)
+{
+       unsigned long result;
+
+       result = ia64_popcnt(x & (~x - 1));
+       return result;
+}
+
+/**
+ * __ffs - find first bit in word.
+ * @x: The word to search
+ *
+ * Undefined if no bit exists, so code should check against 0 first.
+ */
+static __inline__ unsigned long
+__ffs (unsigned long x)
+{
+       unsigned long result;
+
+       result = ia64_popcnt((x-1) & ~x);
+       return result;
+}
+
+#ifdef __KERNEL__
+
+/*
+ * Return bit number of last (most-significant) bit set.  Undefined
+ * for x==0.  Bits are numbered from 0..63 (e.g., ia64_fls(9) == 3).
+ */
+static inline unsigned long
+ia64_fls (unsigned long x)
+{
+       long double d = x;
+       long exp;
+
+       exp = ia64_getf_exp(d);
+       return exp - 0xffff;
+}
+
+/*
+ * Find the last (most significant) bit set.  Returns 0 for x==0 and
+ * bits are numbered from 1..32 (e.g., fls(9) == 4).
+ */
+static inline int
+fls (int t)
+{
+       unsigned long x = t & 0xffffffffu;
+
+       if (!x)
+               return 0;
+       x |= x >> 1;
+       x |= x >> 2;
+       x |= x >> 4;
+       x |= x >> 8;
+       x |= x >> 16;
+       return ia64_popcnt(x);
+}
+
+/*
+ * Find the last (most significant) bit set.  Undefined for x==0.
+ * Bits are numbered from 0..63 (e.g., __fls(9) == 3).
+ */
+static inline unsigned long
+__fls (unsigned long x)
+{
+       x |= x >> 1;
+       x |= x >> 2;
+       x |= x >> 4;
+       x |= x >> 8;
+       x |= x >> 16;
+       x |= x >> 32;
+       return ia64_popcnt(x) - 1;
+}
+
+#include <asm-generic/bitops/fls64.h>
+
+/*
+ * 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
+ * ffz (man ffs): it operates on "int" values only and the result value is the
+ * bit number + 1.  ffs(0) is defined to return zero.
+ */
+#define ffs(x) __builtin_ffs(x)
+
+/*
+ * hweightN: returns the hamming weight (i.e. the number
+ * of bits set) of a N-bit word
+ */
+static __inline__ unsigned long
+hweight64 (unsigned long x)
+{
+       unsigned long result;
+       result = ia64_popcnt(x);
+       return result;
+}
+
+#define hweight32(x)   (unsigned int) hweight64((x) & 0xfffffffful)
+#define hweight16(x)   (unsigned int) hweight64((x) & 0xfffful)
+#define hweight8(x)    (unsigned int) hweight64((x) & 0xfful)
+
+#endif /* __KERNEL__ */
+
+#include <asm-generic/bitops/find.h>
+
+#ifdef __KERNEL__
+
+#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>
+#include <asm-generic/bitops/sched.h>
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_BITOPS_H */
diff --git a/arch/ia64/include/asm/break.h b/arch/ia64/include/asm/break.h
new file mode 100644 (file)
index 0000000..f034020
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _ASM_IA64_BREAK_H
+#define _ASM_IA64_BREAK_H
+
+/*
+ * IA-64 Linux break numbers.
+ *
+ * Copyright (C) 1999 Hewlett-Packard Co
+ * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+/*
+ * OS-specific debug break numbers:
+ */
+#define __IA64_BREAK_KDB               0x80100
+#define __IA64_BREAK_KPROBE            0x81000 /* .. 0x81fff */
+#define __IA64_BREAK_JPROBE            0x82000
+
+/*
+ * OS-specific break numbers:
+ */
+#define __IA64_BREAK_SYSCALL           0x100000
+
+#endif /* _ASM_IA64_BREAK_H */
diff --git a/arch/ia64/include/asm/bug.h b/arch/ia64/include/asm/bug.h
new file mode 100644 (file)
index 0000000..823616b
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ASM_IA64_BUG_H
+#define _ASM_IA64_BUG_H
+
+#ifdef CONFIG_BUG
+#define ia64_abort()   __builtin_trap()
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
+
+/* should this BUG be made generic? */
+#define HAVE_ARCH_BUG
+#endif
+
+#include <asm-generic/bug.h>
+
+#endif
diff --git a/arch/ia64/include/asm/bugs.h b/arch/ia64/include/asm/bugs.h
new file mode 100644 (file)
index 0000000..433523e
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * This is included by init/main.c to check for architecture-dependent bugs.
+ *
+ * Needs:
+ *     void check_bugs(void);
+ *
+ * Based on <asm-alpha/bugs.h>.
+ *
+ * Modified 1998, 1999, 2003
+ *     David Mosberger-Tang <davidm@hpl.hp.com>,  Hewlett-Packard Co.
+ */
+#ifndef _ASM_IA64_BUGS_H
+#define _ASM_IA64_BUGS_H
+
+#include <asm/processor.h>
+
+extern void check_bugs (void);
+
+#endif /* _ASM_IA64_BUGS_H */
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h
new file mode 100644 (file)
index 0000000..69bd41d
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASM_IA64_BYTEORDER_H
+#define _ASM_IA64_BYTEORDER_H
+
+/*
+ * Modified 1998, 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
+ */
+
+#include <asm/types.h>
+#include <asm/intrinsics.h>
+#include <linux/compiler.h>
+
+static __inline__ __attribute_const__ __u64
+__ia64_swab64 (__u64 x)
+{
+       __u64 result;
+
+       result = ia64_mux1(x, ia64_mux1_rev);
+       return result;
+}
+
+static __inline__ __attribute_const__ __u32
+__ia64_swab32 (__u32 x)
+{
+       return __ia64_swab64(x) >> 32;
+}
+
+static __inline__ __attribute_const__ __u16
+__ia64_swab16(__u16 x)
+{
+       return __ia64_swab64(x) >> 48;
+}
+
+#define __arch__swab64(x) __ia64_swab64(x)
+#define __arch__swab32(x) __ia64_swab32(x)
+#define __arch__swab16(x) __ia64_swab16(x)
+
+#define __BYTEORDER_HAS_U64__
+
+#include <linux/byteorder/little_endian.h>
+
+#endif /* _ASM_IA64_BYTEORDER_H */
diff --git a/arch/ia64/include/asm/cache.h b/arch/ia64/include/asm/cache.h
new file mode 100644 (file)
index 0000000..e7482bd
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _ASM_IA64_CACHE_H
+#define _ASM_IA64_CACHE_H
+
+
+/*
+ * Copyright (C) 1998-2000 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+/* Bytes per L1 (data) cache line.  */
+#define L1_CACHE_SHIFT         CONFIG_IA64_L1_CACHE_SHIFT
+#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
+
+#ifdef CONFIG_SMP
+# define SMP_CACHE_SHIFT       L1_CACHE_SHIFT
+# define SMP_CACHE_BYTES       L1_CACHE_BYTES
+#else
+  /*
+   * The "aligned" directive can only _increase_ alignment, so this is
+   * safe and provides an easy way to avoid wasting space on a
+   * uni-processor:
+   */
+# define SMP_CACHE_SHIFT       3
+# define SMP_CACHE_BYTES       (1 << 3)
+#endif
+
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
+#endif /* _ASM_IA64_CACHE_H */
diff --git a/arch/ia64/include/asm/cacheflush.h b/arch/ia64/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..afcfbda
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef _ASM_IA64_CACHEFLUSH_H
+#define _ASM_IA64_CACHEFLUSH_H
+
+/*
+ * Copyright (C) 2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <linux/page-flags.h>
+#include <linux/bitops.h>
+
+#include <asm/page.h>
+
+/*
+ * Cache flushing routines.  This is the kind of stuff that can be very expensive, so try
+ * to avoid them whenever possible.
+ */
+
+#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_icache_page(vma,page)            do { } while (0)
+#define flush_cache_vmap(start, end)           do { } while (0)
+#define flush_cache_vunmap(start, end)         do { } while (0)
+
+#define flush_dcache_page(page)                        \
+do {                                           \
+       clear_bit(PG_arch_1, &(page)->flags);   \
+} while (0)
+
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+
+extern void flush_icache_range (unsigned long start, unsigned long end);
+
+#define flush_icache_user_range(vma, page, user_addr, len)                                     \
+do {                                                                                           \
+       unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK);  \
+       flush_icache_range(_addr, _addr + (len));                                               \
+} while (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 /* _ASM_IA64_CACHEFLUSH_H */
diff --git a/arch/ia64/include/asm/checksum.h b/arch/ia64/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..97af155
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef _ASM_IA64_CHECKSUM_H
+#define _ASM_IA64_CHECKSUM_H
+
+/*
+ * Modified 1998, 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+/*
+ * 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);
+
+extern __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);
+
+/*
+ * Same as csum_partial, but copies from src while it checksums.
+ *
+ * Here it is even more important to align src and dst on a 32-bit (or
+ * even better 64-bit) boundary.
+ */
+extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
+                                                int len, __wsum sum,
+                                                int *errp);
+
+extern __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   1
+struct in6_addr;
+extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
+       const struct in6_addr *daddr, __u32 len, unsigned short proto,
+       __wsum csum);
+
+#endif /* _ASM_IA64_CHECKSUM_H */
diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h
new file mode 100644 (file)
index 0000000..dfcf75b
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _ASM_IA64_COMPAT_H
+#define _ASM_IA64_COMPAT_H
+/*
+ * Architecture specific compatibility types
+ */
+#include <linux/types.h>
+
+#define COMPAT_USER_HZ 100
+
+typedef u32            compat_size_t;
+typedef s32            compat_ssize_t;
+typedef s32            compat_time_t;
+typedef s32            compat_clock_t;
+typedef s32            compat_key_t;
+typedef s32            compat_pid_t;
+typedef u16            __compat_uid_t;
+typedef u16            __compat_gid_t;
+typedef u32            __compat_uid32_t;
+typedef u32            __compat_gid32_t;
+typedef u16            compat_mode_t;
+typedef u32            compat_ino_t;
+typedef u16            compat_dev_t;
+typedef s32            compat_off_t;
+typedef s64            compat_loff_t;
+typedef u16            compat_nlink_t;
+typedef u16            compat_ipc_pid_t;
+typedef s32            compat_daddr_t;
+typedef u32            compat_caddr_t;
+typedef __kernel_fsid_t        compat_fsid_t;
+typedef s32            compat_timer_t;
+
+typedef s32            compat_int_t;
+typedef s32            compat_long_t;
+typedef s64 __attribute__((aligned(4))) compat_s64;
+typedef u32            compat_uint_t;
+typedef u32            compat_ulong_t;
+typedef u64 __attribute__((aligned(4))) compat_u64;
+
+struct compat_timespec {
+       compat_time_t   tv_sec;
+       s32             tv_nsec;
+};
+
+struct compat_timeval {
+       compat_time_t   tv_sec;
+       s32             tv_usec;
+};
+
+struct compat_stat {
+       compat_dev_t    st_dev;
+       u16             __pad1;
+       compat_ino_t    st_ino;
+       compat_mode_t   st_mode;
+       compat_nlink_t  st_nlink;
+       __compat_uid_t  st_uid;
+       __compat_gid_t  st_gid;
+       compat_dev_t    st_rdev;
+       u16             __pad2;
+       u32             st_size;
+       u32             st_blksize;
+       u32             st_blocks;
+       u32             st_atime;
+       u32             st_atime_nsec;
+       u32             st_mtime;
+       u32             st_mtime_nsec;
+       u32             st_ctime;
+       u32             st_ctime_nsec;
+       u32             __unused4;
+       u32             __unused5;
+};
+
+struct compat_flock {
+       short           l_type;
+       short           l_whence;
+       compat_off_t    l_start;
+       compat_off_t    l_len;
+       compat_pid_t    l_pid;
+};
+
+#define F_GETLK64      12
+#define F_SETLK64      13
+#define F_SETLKW64     14
+
+/*
+ * IA32 uses 4 byte alignment for 64 bit quantities,
+ * so we need to pack this structure.
+ */
+struct compat_flock64 {
+       short           l_type;
+       short           l_whence;
+       compat_loff_t   l_start;
+       compat_loff_t   l_len;
+       compat_pid_t    l_pid;
+} __attribute__((packed));
+
+struct compat_statfs {
+       int             f_type;
+       int             f_bsize;
+       int             f_blocks;
+       int             f_bfree;
+       int             f_bavail;
+       int             f_files;
+       int             f_ffree;
+       compat_fsid_t   f_fsid;
+       int             f_namelen;      /* SunOS ignores this field. */
+       int             f_frsize;
+       int             f_spare[5];
+};
+
+#define COMPAT_RLIM_OLD_INFINITY       0x7fffffff
+#define COMPAT_RLIM_INFINITY           0xffffffff
+
+typedef u32            compat_old_sigset_t;    /* at least 32 bits */
+
+#define _COMPAT_NSIG           64
+#define _COMPAT_NSIG_BPW       32
+
+typedef u32            compat_sigset_word;
+
+#define COMPAT_OFF_T_MAX       0x7fffffff
+#define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
+
+struct compat_ipc64_perm {
+       compat_key_t key;
+       __compat_uid32_t uid;
+       __compat_gid32_t gid;
+       __compat_uid32_t cuid;
+       __compat_gid32_t cgid;
+       unsigned short mode;
+       unsigned short __pad1;
+       unsigned short seq;
+       unsigned short __pad2;
+       compat_ulong_t unused1;
+       compat_ulong_t unused2;
+};
+
+struct compat_semid64_ds {
+       struct compat_ipc64_perm sem_perm;
+       compat_time_t  sem_otime;
+       compat_ulong_t __unused1;
+       compat_time_t  sem_ctime;
+       compat_ulong_t __unused2;
+       compat_ulong_t sem_nsems;
+       compat_ulong_t __unused3;
+       compat_ulong_t __unused4;
+};
+
+struct compat_msqid64_ds {
+       struct compat_ipc64_perm msg_perm;
+       compat_time_t  msg_stime;
+       compat_ulong_t __unused1;
+       compat_time_t  msg_rtime;
+       compat_ulong_t __unused2;
+       compat_time_t  msg_ctime;
+       compat_ulong_t __unused3;
+       compat_ulong_t msg_cbytes;
+       compat_ulong_t msg_qnum;
+       compat_ulong_t msg_qbytes;
+       compat_pid_t   msg_lspid;
+       compat_pid_t   msg_lrpid;
+       compat_ulong_t __unused4;
+       compat_ulong_t __unused5;
+};
+
+struct compat_shmid64_ds {
+       struct compat_ipc64_perm shm_perm;
+       compat_size_t  shm_segsz;
+       compat_time_t  shm_atime;
+       compat_ulong_t __unused1;
+       compat_time_t  shm_dtime;
+       compat_ulong_t __unused2;
+       compat_time_t  shm_ctime;
+       compat_ulong_t __unused3;
+       compat_pid_t   shm_cpid;
+       compat_pid_t   shm_lpid;
+       compat_ulong_t shm_nattch;
+       compat_ulong_t __unused4;
+       compat_ulong_t __unused5;
+};
+
+/*
+ * A pointer passed in from user mode. This should not be used for syscall parameters,
+ * just declare them as pointers because the syscall entry code will have appropriately
+ * converted them already.
+ */
+typedef        u32             compat_uptr_t;
+
+static inline void __user *
+compat_ptr (compat_uptr_t uptr)
+{
+       return (void __user *) (unsigned long) uptr;
+}
+
+static inline compat_uptr_t
+ptr_to_compat(void __user *uptr)
+{
+       return (u32)(unsigned long)uptr;
+}
+
+static __inline__ void __user *
+compat_alloc_user_space (long len)
+{
+       struct pt_regs *regs = task_pt_regs(current);
+       return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);
+}
+
+#endif /* _ASM_IA64_COMPAT_H */
diff --git a/arch/ia64/include/asm/cpu.h b/arch/ia64/include/asm/cpu.h
new file mode 100644 (file)
index 0000000..fcca30b
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _ASM_IA64_CPU_H_
+#define _ASM_IA64_CPU_H_
+
+#include <linux/device.h>
+#include <linux/cpu.h>
+#include <linux/topology.h>
+#include <linux/percpu.h>
+
+struct ia64_cpu {
+       struct cpu cpu;
+};
+
+DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
+
+DECLARE_PER_CPU(int, cpu_state);
+
+#ifdef CONFIG_HOTPLUG_CPU
+extern int arch_register_cpu(int num);
+extern void arch_unregister_cpu(int);
+#endif
+
+#endif /* _ASM_IA64_CPU_H_ */
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h
new file mode 100644 (file)
index 0000000..d20b998
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Definitions for measuring cputime on ia64 machines.
+ *
+ * Based on <asm-powerpc/cputime.h>.
+ *
+ * Copyright (C) 2007 FUJITSU LIMITED
+ * Copyright (C) 2007 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.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
+ * 2 of the License, or (at your option) any later version.
+ *
+ * If we have CONFIG_VIRT_CPU_ACCOUNTING, we measure cpu time in nsec.
+ * Otherwise we measure cpu time in jiffies using the generic definitions.
+ */
+
+#ifndef __IA64_CPUTIME_H
+#define __IA64_CPUTIME_H
+
+#ifndef CONFIG_VIRT_CPU_ACCOUNTING
+#include <asm-generic/cputime.h>
+#else
+
+#include <linux/time.h>
+#include <linux/jiffies.h>
+#include <asm/processor.h>
+
+typedef u64 cputime_t;
+typedef u64 cputime64_t;
+
+#define cputime_zero                   ((cputime_t)0)
+#define cputime_max                    ((~((cputime_t)0) >> 1) - 1)
+#define cputime_add(__a, __b)          ((__a) +  (__b))
+#define cputime_sub(__a, __b)          ((__a) -  (__b))
+#define cputime_div(__a, __n)          ((__a) /  (__n))
+#define cputime_halve(__a)             ((__a) >> 1)
+#define cputime_eq(__a, __b)           ((__a) == (__b))
+#define cputime_gt(__a, __b)           ((__a) >  (__b))
+#define cputime_ge(__a, __b)           ((__a) >= (__b))
+#define cputime_lt(__a, __b)           ((__a) <  (__b))
+#define cputime_le(__a, __b)           ((__a) <= (__b))
+
+#define cputime64_zero                 ((cputime64_t)0)
+#define cputime64_add(__a, __b)                ((__a) + (__b))
+#define cputime64_sub(__a, __b)                ((__a) - (__b))
+#define cputime_to_cputime64(__ct)     (__ct)
+
+/*
+ * Convert cputime <-> jiffies (HZ)
+ */
+#define cputime_to_jiffies(__ct)       ((__ct) / (NSEC_PER_SEC / HZ))
+#define jiffies_to_cputime(__jif)      ((__jif) * (NSEC_PER_SEC / HZ))
+#define cputime64_to_jiffies64(__ct)   ((__ct) / (NSEC_PER_SEC / HZ))
+#define jiffies64_to_cputime64(__jif)  ((__jif) * (NSEC_PER_SEC / HZ))
+
+/*
+ * Convert cputime <-> milliseconds
+ */
+#define cputime_to_msecs(__ct)         ((__ct) / NSEC_PER_MSEC)
+#define msecs_to_cputime(__msecs)      ((__msecs) * NSEC_PER_MSEC)
+
+/*
+ * Convert cputime <-> seconds
+ */
+#define cputime_to_secs(__ct)          ((__ct) / NSEC_PER_SEC)
+#define secs_to_cputime(__secs)                ((__secs) * NSEC_PER_SEC)
+
+/*
+ * Convert cputime <-> timespec (nsec)
+ */
+static inline cputime_t timespec_to_cputime(const struct timespec *val)
+{
+       cputime_t ret = val->tv_sec * NSEC_PER_SEC;
+       return (ret + val->tv_nsec);
+}
+static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
+{
+       val->tv_sec  = ct / NSEC_PER_SEC;
+       val->tv_nsec = ct % NSEC_PER_SEC;
+}
+
+/*
+ * Convert cputime <-> timeval (msec)
+ */
+static inline cputime_t timeval_to_cputime(struct timeval *val)
+{
+       cputime_t ret = val->tv_sec * NSEC_PER_SEC;
+       return (ret + val->tv_usec * NSEC_PER_USEC);
+}
+static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val)
+{
+       val->tv_sec = ct / NSEC_PER_SEC;
+       val->tv_usec = (ct % NSEC_PER_SEC) / NSEC_PER_USEC;
+}
+
+/*
+ * Convert cputime <-> clock (USER_HZ)
+ */
+#define cputime_to_clock_t(__ct)       ((__ct) / (NSEC_PER_SEC / USER_HZ))
+#define clock_t_to_cputime(__x)                ((__x) * (NSEC_PER_SEC / USER_HZ))
+
+/*
+ * Convert cputime64 to clock.
+ */
+#define cputime64_to_clock_t(__ct)      cputime_to_clock_t((cputime_t)__ct)
+
+#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
+#endif /* __IA64_CPUTIME_H */
diff --git a/arch/ia64/include/asm/current.h b/arch/ia64/include/asm/current.h
new file mode 100644 (file)
index 0000000..c659f90
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef _ASM_IA64_CURRENT_H
+#define _ASM_IA64_CURRENT_H
+
+/*
+ * Modified 1998-2000
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <asm/intrinsics.h>
+
+/*
+ * In kernel mode, thread pointer (r13) is used to point to the current task
+ * structure.
+ */
+#define current        ((struct task_struct *) ia64_getreg(_IA64_REG_TP))
+
+#endif /* _ASM_IA64_CURRENT_H */
diff --git a/arch/ia64/include/asm/cyclone.h b/arch/ia64/include/asm/cyclone.h
new file mode 100644 (file)
index 0000000..88f6500
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef ASM_IA64_CYCLONE_H
+#define ASM_IA64_CYCLONE_H
+
+#ifdef CONFIG_IA64_CYCLONE
+extern int use_cyclone;
+extern void __init cyclone_setup(void);
+#else  /* CONFIG_IA64_CYCLONE */
+#define use_cyclone 0
+static inline void cyclone_setup(void)
+{
+       printk(KERN_ERR "Cyclone Counter: System not configured"
+                                       " w/ CONFIG_IA64_CYCLONE.\n");
+}
+#endif /* CONFIG_IA64_CYCLONE */
+#endif /* !ASM_IA64_CYCLONE_H */
diff --git a/arch/ia64/include/asm/delay.h b/arch/ia64/include/asm/delay.h
new file mode 100644 (file)
index 0000000..a30a62f
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef _ASM_IA64_DELAY_H
+#define _ASM_IA64_DELAY_H
+
+/*
+ * Delay routines using a pre-computed "cycles/usec" value.
+ *
+ * Copyright (C) 1998, 1999 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 VA Linux Systems
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/compiler.h>
+
+#include <asm/intrinsics.h>
+#include <asm/processor.h>
+
+static __inline__ void
+ia64_set_itm (unsigned long val)
+{
+       ia64_setreg(_IA64_REG_CR_ITM, val);
+       ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itm (void)
+{
+       unsigned long result;
+
+       result = ia64_getreg(_IA64_REG_CR_ITM);
+       ia64_srlz_d();
+       return result;
+}
+
+static __inline__ void
+ia64_set_itv (unsigned long val)
+{
+       ia64_setreg(_IA64_REG_CR_ITV, val);
+       ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itv (void)
+{
+       return ia64_getreg(_IA64_REG_CR_ITV);
+}
+
+static __inline__ void
+ia64_set_itc (unsigned long val)
+{
+       ia64_setreg(_IA64_REG_AR_ITC, val);
+       ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itc (void)
+{
+       unsigned long result;
+
+       result = ia64_getreg(_IA64_REG_AR_ITC);
+       ia64_barrier();
+#ifdef CONFIG_ITANIUM
+       while (unlikely((__s32) result == -1)) {
+               result = ia64_getreg(_IA64_REG_AR_ITC);
+               ia64_barrier();
+       }
+#endif
+       return result;
+}
+
+extern void ia64_delay_loop (unsigned long loops);
+
+static __inline__ void
+__delay (unsigned long loops)
+{
+       if (unlikely(loops < 1))
+               return;
+
+       ia64_delay_loop (loops - 1);
+}
+
+extern void udelay (unsigned long usecs);
+
+#endif /* _ASM_IA64_DELAY_H */
diff --git a/arch/ia64/include/asm/device.h b/arch/ia64/include/asm/device.h
new file mode 100644 (file)
index 0000000..3db6daf
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Arch specific extensions to struct device
+ *
+ * This file is released under the GPLv2
+ */
+#ifndef _ASM_IA64_DEVICE_H
+#define _ASM_IA64_DEVICE_H
+
+struct dev_archdata {
+#ifdef CONFIG_ACPI
+       void    *acpi_handle;
+#endif
+};
+
+#endif /* _ASM_IA64_DEVICE_H */
diff --git a/arch/ia64/include/asm/div64.h b/arch/ia64/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/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..9f0df9b
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef _ASM_IA64_DMA_MAPPING_H
+#define _ASM_IA64_DMA_MAPPING_H
+
+/*
+ * Copyright (C) 2003-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+#include <asm/machvec.h>
+#include <linux/scatterlist.h>
+
+#define dma_alloc_coherent     platform_dma_alloc_coherent
+/* coherent mem. is cheap */
+static inline void *
+dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
+                     gfp_t flag)
+{
+       return dma_alloc_coherent(dev, size, dma_handle, flag);
+}
+#define dma_free_coherent      platform_dma_free_coherent
+static inline void
+dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
+                    dma_addr_t dma_handle)
+{
+       dma_free_coherent(dev, size, cpu_addr, dma_handle);
+}
+#define dma_map_single_attrs   platform_dma_map_single_attrs
+static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
+                                       size_t size, int dir)
+{
+       return dma_map_single_attrs(dev, cpu_addr, size, dir, NULL);
+}
+#define dma_map_sg_attrs       platform_dma_map_sg_attrs
+static inline int dma_map_sg(struct device *dev, struct scatterlist *sgl,
+                            int nents, int dir)
+{
+       return dma_map_sg_attrs(dev, sgl, nents, dir, NULL);
+}
+#define dma_unmap_single_attrs platform_dma_unmap_single_attrs
+static inline void dma_unmap_single(struct device *dev, dma_addr_t cpu_addr,
+                                   size_t size, int dir)
+{
+       return dma_unmap_single_attrs(dev, cpu_addr, size, dir, NULL);
+}
+#define dma_unmap_sg_attrs     platform_dma_unmap_sg_attrs
+static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
+                               int nents, int dir)
+{
+       return dma_unmap_sg_attrs(dev, sgl, nents, dir, NULL);
+}
+#define dma_sync_single_for_cpu        platform_dma_sync_single_for_cpu
+#define dma_sync_sg_for_cpu    platform_dma_sync_sg_for_cpu
+#define dma_sync_single_for_device platform_dma_sync_single_for_device
+#define dma_sync_sg_for_device platform_dma_sync_sg_for_device
+#define dma_mapping_error      platform_dma_mapping_error
+
+#define dma_map_page(dev, pg, off, size, dir)                          \
+       dma_map_single(dev, page_address(pg) + (off), (size), (dir))
+#define dma_unmap_page(dev, dma_addr, size, dir)                       \
+       dma_unmap_single(dev, dma_addr, size, dir)
+
+/*
+ * Rest of this file is part of the "Advanced DMA API".  Use at your own risk.
+ * See Documentation/DMA-API.txt for details.
+ */
+
+#define dma_sync_single_range_for_cpu(dev, dma_handle, offset, size, dir)      \
+       dma_sync_single_for_cpu(dev, dma_handle, size, dir)
+#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir)   \
+       dma_sync_single_for_device(dev, dma_handle, size, dir)
+
+#define dma_supported          platform_dma_supported
+
+static inline int
+dma_set_mask (struct device *dev, u64 mask)
+{
+       if (!dev->dma_mask || !dma_supported(dev, mask))
+               return -EIO;
+       *dev->dma_mask = mask;
+       return 0;
+}
+
+extern int dma_get_cache_alignment(void);
+
+static inline void
+dma_cache_sync (struct device *dev, void *vaddr, size_t size,
+       enum dma_data_direction dir)
+{
+       /*
+        * IA-64 is cache-coherent, so this is mostly a no-op.  However, we do need to
+        * ensure that dma_cache_sync() enforces order, hence the mb().
+        */
+       mb();
+}
+
+#define dma_is_consistent(d, h)        (1)     /* all we do is coherent memory... */
+
+#endif /* _ASM_IA64_DMA_MAPPING_H */
diff --git a/arch/ia64/include/asm/dma.h b/arch/ia64/include/asm/dma.h
new file mode 100644 (file)
index 0000000..4d97f60
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _ASM_IA64_DMA_H
+#define _ASM_IA64_DMA_H
+
+/*
+ * Copyright (C) 1998-2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#include <asm/io.h>            /* need byte IO */
+
+extern unsigned long MAX_DMA_ADDRESS;
+
+#ifdef CONFIG_PCI
+  extern int isa_dma_bridge_buggy;
+#else
+# define isa_dma_bridge_buggy  (0)
+#endif
+
+#define free_dma(x)
+
+void dma_mark_clean(void *addr, size_t size);
+
+#endif /* _ASM_IA64_DMA_H */
diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h
new file mode 100644 (file)
index 0000000..00eb1b1
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ASM_DMI_H
+#define _ASM_DMI_H 1
+
+#include <asm/io.h>
+
+/* Use normal IO mappings for DMI */
+#define dmi_ioremap ioremap
+#define dmi_iounmap(x,l) iounmap(x)
+#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
+
+#endif
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h
new file mode 100644 (file)
index 0000000..5e0c1a6
--- /dev/null
@@ -0,0 +1,269 @@
+#ifndef _ASM_IA64_ELF_H
+#define _ASM_IA64_ELF_H
+
+/*
+ * ELF-specific definitions.
+ *
+ * Copyright (C) 1998-1999, 2002-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#include <asm/fpu.h>
+#include <asm/page.h>
+#include <asm/auxvec.h>
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ((x)->e_machine == EM_IA_64)
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS      ELFCLASS64
+#define ELF_DATA       ELFDATA2LSB
+#define ELF_ARCH       EM_IA_64
+
+#define USE_ELF_CORE_DUMP
+#define CORE_DUMP_USE_REGSET
+
+/* Least-significant four bits of ELF header's e_flags are OS-specific.  The bits are
+   interpreted as follows by Linux: */
+#define EF_IA_64_LINUX_EXECUTABLE_STACK        0x1     /* is stack (& heap) executable by default? */
+
+#define ELF_EXEC_PAGESIZE      PAGE_SIZE
+
+/*
+ * 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 + 0x800000000UL)
+
+#define PT_IA_64_UNWIND                0x70000001
+
+/* IA-64 relocations: */
+#define R_IA64_NONE            0x00    /* none */
+#define R_IA64_IMM14           0x21    /* symbol + addend, add imm14 */
+#define R_IA64_IMM22           0x22    /* symbol + addend, add imm22 */
+#define R_IA64_IMM64           0x23    /* symbol + addend, mov imm64 */
+#define R_IA64_DIR32MSB                0x24    /* symbol + addend, data4 MSB */
+#define R_IA64_DIR32LSB                0x25    /* symbol + addend, data4 LSB */
+#define R_IA64_DIR64MSB                0x26    /* symbol + addend, data8 MSB */
+#define R_IA64_DIR64LSB                0x27    /* symbol + addend, data8 LSB */
+#define R_IA64_GPREL22         0x2a    /* @gprel(sym+add), add imm22 */
+#define R_IA64_GPREL64I                0x2b    /* @gprel(sym+add), mov imm64 */
+#define R_IA64_GPREL32MSB      0x2c    /* @gprel(sym+add), data4 MSB */
+#define R_IA64_GPREL32LSB      0x2d    /* @gprel(sym+add), data4 LSB */
+#define R_IA64_GPREL64MSB      0x2e    /* @gprel(sym+add), data8 MSB */
+#define R_IA64_GPREL64LSB      0x2f    /* @gprel(sym+add), data8 LSB */
+#define R_IA64_LTOFF22         0x32    /* @ltoff(sym+add), add imm22 */
+#define R_IA64_LTOFF64I                0x33    /* @ltoff(sym+add), mov imm64 */
+#define R_IA64_PLTOFF22                0x3a    /* @pltoff(sym+add), add imm22 */
+#define R_IA64_PLTOFF64I       0x3b    /* @pltoff(sym+add), mov imm64 */
+#define R_IA64_PLTOFF64MSB     0x3e    /* @pltoff(sym+add), data8 MSB */
+#define R_IA64_PLTOFF64LSB     0x3f    /* @pltoff(sym+add), data8 LSB */
+#define R_IA64_FPTR64I         0x43    /* @fptr(sym+add), mov imm64 */
+#define R_IA64_FPTR32MSB       0x44    /* @fptr(sym+add), data4 MSB */
+#define R_IA64_FPTR32LSB       0x45    /* @fptr(sym+add), data4 LSB */
+#define R_IA64_FPTR64MSB       0x46    /* @fptr(sym+add), data8 MSB */
+#define R_IA64_FPTR64LSB       0x47    /* @fptr(sym+add), data8 LSB */
+#define R_IA64_PCREL60B                0x48    /* @pcrel(sym+add), brl */
+#define R_IA64_PCREL21B                0x49    /* @pcrel(sym+add), ptb, call */
+#define R_IA64_PCREL21M                0x4a    /* @pcrel(sym+add), chk.s */
+#define R_IA64_PCREL21F                0x4b    /* @pcrel(sym+add), fchkf */
+#define R_IA64_PCREL32MSB      0x4c    /* @pcrel(sym+add), data4 MSB */
+#define R_IA64_PCREL32LSB      0x4d    /* @pcrel(sym+add), data4 LSB */
+#define R_IA64_PCREL64MSB      0x4e    /* @pcrel(sym+add), data8 MSB */
+#define R_IA64_PCREL64LSB      0x4f    /* @pcrel(sym+add), data8 LSB */
+#define R_IA64_LTOFF_FPTR22    0x52    /* @ltoff(@fptr(s+a)), imm22 */
+#define R_IA64_LTOFF_FPTR64I   0x53    /* @ltoff(@fptr(s+a)), imm64 */
+#define R_IA64_LTOFF_FPTR32MSB 0x54    /* @ltoff(@fptr(s+a)), 4 MSB */
+#define R_IA64_LTOFF_FPTR32LSB 0x55    /* @ltoff(@fptr(s+a)), 4 LSB */
+#define R_IA64_LTOFF_FPTR64MSB 0x56    /* @ltoff(@fptr(s+a)), 8 MSB */
+#define R_IA64_LTOFF_FPTR64LSB 0x57    /* @ltoff(@fptr(s+a)), 8 LSB */
+#define R_IA64_SEGREL32MSB     0x5c    /* @segrel(sym+add), data4 MSB */
+#define R_IA64_SEGREL32LSB     0x5d    /* @segrel(sym+add), data4 LSB */
+#define R_IA64_SEGREL64MSB     0x5e    /* @segrel(sym+add), data8 MSB */
+#define R_IA64_SEGREL64LSB     0x5f    /* @segrel(sym+add), data8 LSB */
+#define R_IA64_SECREL32MSB     0x64    /* @secrel(sym+add), data4 MSB */
+#define R_IA64_SECREL32LSB     0x65    /* @secrel(sym+add), data4 LSB */
+#define R_IA64_SECREL64MSB     0x66    /* @secrel(sym+add), data8 MSB */
+#define R_IA64_SECREL64LSB     0x67    /* @secrel(sym+add), data8 LSB */
+#define R_IA64_REL32MSB                0x6c    /* data 4 + REL */
+#define R_IA64_REL32LSB                0x6d    /* data 4 + REL */
+#define R_IA64_REL64MSB                0x6e    /* data 8 + REL */
+#define R_IA64_REL64LSB                0x6f    /* data 8 + REL */
+#define R_IA64_LTV32MSB                0x74    /* symbol + addend, data4 MSB */
+#define R_IA64_LTV32LSB                0x75    /* symbol + addend, data4 LSB */
+#define R_IA64_LTV64MSB                0x76    /* symbol + addend, data8 MSB */
+#define R_IA64_LTV64LSB                0x77    /* symbol + addend, data8 LSB */
+#define R_IA64_PCREL21BI       0x79    /* @pcrel(sym+add), ptb, call */
+#define R_IA64_PCREL22         0x7a    /* @pcrel(sym+add), imm22 */
+#define R_IA64_PCREL64I                0x7b    /* @pcrel(sym+add), imm64 */
+#define R_IA64_IPLTMSB         0x80    /* dynamic reloc, imported PLT, MSB */
+#define R_IA64_IPLTLSB         0x81    /* dynamic reloc, imported PLT, LSB */
+#define R_IA64_COPY            0x84    /* dynamic reloc, data copy */
+#define R_IA64_SUB             0x85    /* -symbol + addend, add imm22 */
+#define R_IA64_LTOFF22X                0x86    /* LTOFF22, relaxable.  */
+#define R_IA64_LDXMOV          0x87    /* Use of LTOFF22X.  */
+#define R_IA64_TPREL14         0x91    /* @tprel(sym+add), add imm14 */
+#define R_IA64_TPREL22         0x92    /* @tprel(sym+add), add imm22 */
+#define R_IA64_TPREL64I                0x93    /* @tprel(sym+add), add imm64 */
+#define R_IA64_TPREL64MSB      0x96    /* @tprel(sym+add), data8 MSB */
+#define R_IA64_TPREL64LSB      0x97    /* @tprel(sym+add), data8 LSB */
+#define R_IA64_LTOFF_TPREL22   0x9a    /* @ltoff(@tprel(s+a)), add imm22 */
+#define R_IA64_DTPMOD64MSB     0xa6    /* @dtpmod(sym+add), data8 MSB */
+#define R_IA64_DTPMOD64LSB     0xa7    /* @dtpmod(sym+add), data8 LSB */
+#define R_IA64_LTOFF_DTPMOD22  0xaa    /* @ltoff(@dtpmod(s+a)), imm22 */
+#define R_IA64_DTPREL14                0xb1    /* @dtprel(sym+add), imm14 */
+#define R_IA64_DTPREL22                0xb2    /* @dtprel(sym+add), imm22 */
+#define R_IA64_DTPREL64I       0xb3    /* @dtprel(sym+add), imm64 */
+#define R_IA64_DTPREL32MSB     0xb4    /* @dtprel(sym+add), data4 MSB */
+#define R_IA64_DTPREL32LSB     0xb5    /* @dtprel(sym+add), data4 LSB */
+#define R_IA64_DTPREL64MSB     0xb6    /* @dtprel(sym+add), data8 MSB */
+#define R_IA64_DTPREL64LSB     0xb7    /* @dtprel(sym+add), data8 LSB */
+#define R_IA64_LTOFF_DTPREL22  0xba    /* @ltoff(@dtprel(s+a)), imm22 */
+
+/* IA-64 specific section flags: */
+#define SHF_IA_64_SHORT                0x10000000      /* section near gp */
+
+/*
+ * We use (abuse?) this macro to insert the (empty) vm_area that is
+ * used to map the register backing store.  I don't see any better
+ * place to do this, but we should discuss this with Linus once we can
+ * talk to him...
+ */
+extern void ia64_init_addr_space (void);
+#define ELF_PLAT_INIT(_r, load_addr)   ia64_init_addr_space()
+
+/* ELF register definitions.  This is needed for core dump support.  */
+
+/*
+ * elf_gregset_t contains the application-level state in the following order:
+ *     r0-r31
+ *     NaT bits (for r0-r31; bit N == 1 iff rN is a NaT)
+ *     predicate registers (p0-p63)
+ *     b0-b7
+ *     ip cfm psr
+ *     ar.rsc ar.bsp ar.bspstore ar.rnat
+ *     ar.ccv ar.unat ar.fpsr ar.pfs ar.lc ar.ec ar.csd ar.ssd
+ */
+#define ELF_NGREG      128     /* we really need just 72 but let's leave some headroom... */
+#define ELF_NFPREG     128     /* f0 and f1 could be omitted, but so what... */
+
+/* elf_gregset_t register offsets */
+#define ELF_GR_0_OFFSET     0
+#define ELF_NAT_OFFSET     (32 * sizeof(elf_greg_t))
+#define ELF_PR_OFFSET      (33 * sizeof(elf_greg_t))
+#define ELF_BR_0_OFFSET    (34 * sizeof(elf_greg_t))
+#define ELF_CR_IIP_OFFSET  (42 * sizeof(elf_greg_t))
+#define ELF_CFM_OFFSET     (43 * sizeof(elf_greg_t))
+#define ELF_CR_IPSR_OFFSET (44 * sizeof(elf_greg_t))
+#define ELF_GR_OFFSET(i)   (ELF_GR_0_OFFSET + i * sizeof(elf_greg_t))
+#define ELF_BR_OFFSET(i)   (ELF_BR_0_OFFSET + i * sizeof(elf_greg_t))
+#define ELF_AR_RSC_OFFSET  (45 * sizeof(elf_greg_t))
+#define ELF_AR_BSP_OFFSET  (46 * sizeof(elf_greg_t))
+#define ELF_AR_BSPSTORE_OFFSET (47 * sizeof(elf_greg_t))
+#define ELF_AR_RNAT_OFFSET (48 * sizeof(elf_greg_t))
+#define ELF_AR_CCV_OFFSET  (49 * sizeof(elf_greg_t))
+#define ELF_AR_UNAT_OFFSET (50 * sizeof(elf_greg_t))
+#define ELF_AR_FPSR_OFFSET (51 * sizeof(elf_greg_t))
+#define ELF_AR_PFS_OFFSET  (52 * sizeof(elf_greg_t))
+#define ELF_AR_LC_OFFSET   (53 * sizeof(elf_greg_t))
+#define ELF_AR_EC_OFFSET   (54 * sizeof(elf_greg_t))
+#define ELF_AR_CSD_OFFSET  (55 * sizeof(elf_greg_t))
+#define ELF_AR_SSD_OFFSET  (56 * sizeof(elf_greg_t))
+#define ELF_AR_END_OFFSET  (57 * sizeof(elf_greg_t))
+
+typedef unsigned long elf_fpxregset_t;
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct ia64_fpreg elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+
+
+struct pt_regs;        /* forward declaration... */
+extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
+#define ELF_CORE_COPY_REGS(_dest,_regs)        ia64_elf_core_copy_regs(_regs, _dest);
+
+/* This macro yields a bitmask that programs can use to figure out
+   what instruction set this CPU supports.  */
+#define ELF_HWCAP      0
+
+/* This macro yields a string that ld.so will use to load
+   implementation specific libraries for optimization.  Not terribly
+   relevant until we have real hardware to play with... */
+#define ELF_PLATFORM   NULL
+
+#define SET_PERSONALITY(ex, ibcs2)     set_personality(PER_LINUX)
+#define elf_read_implies_exec(ex, executable_stack)                                    \
+       ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
+
+struct task_struct;
+
+#define GATE_EHDR      ((const struct elfhdr *) GATE_ADDR)
+
+/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
+#define ARCH_DLINFO                                                            \
+do {                                                                           \
+       extern char __kernel_syscall_via_epc[];                                 \
+       NEW_AUX_ENT(AT_SYSINFO, (unsigned long) __kernel_syscall_via_epc);      \
+       NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR);                \
+} while (0)
+
+
+/*
+ * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the gate DSO contents.  Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the gate DSO was being used.
+ */
+#define ELF_CORE_EXTRA_PHDRS           (GATE_EHDR->e_phnum)
+#define ELF_CORE_WRITE_EXTRA_PHDRS                                             \
+do {                                                                           \
+       const struct elf_phdr *const gate_phdrs =                             \
+               (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);   \
+       int i;                                                                  \
+       Elf64_Off ofs = 0;                                                    \
+       for (i = 0; i < GATE_EHDR->e_phnum; ++i) {                              \
+               struct elf_phdr phdr = gate_phdrs[i];                         \
+               if (phdr.p_type == PT_LOAD) {                                   \
+                       phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);              \
+                       phdr.p_filesz = phdr.p_memsz;                         \
+                       if (ofs == 0) {                                       \
+                               ofs = phdr.p_offset = offset;                 \
+                       offset += phdr.p_filesz;                                \
+               }                                                             \
+               else                                                          \
+                               phdr.p_offset = ofs;                          \
+               }                                                             \
+               else                                                          \
+                       phdr.p_offset += ofs;                                   \
+               phdr.p_paddr = 0; /* match other core phdrs */                  \
+               DUMP_WRITE(&phdr, sizeof(phdr));                                \
+       }                                                                       \
+} while (0)
+#define ELF_CORE_WRITE_EXTRA_DATA                                      \
+do {                                                                   \
+       const struct elf_phdr *const gate_phdrs =                             \
+               (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);   \
+       int i;                                                          \
+       for (i = 0; i < GATE_EHDR->e_phnum; ++i) {                      \
+               if (gate_phdrs[i].p_type == PT_LOAD) {                        \
+                       DUMP_WRITE((void *) gate_phdrs[i].p_vaddr,            \
+                                  PAGE_ALIGN(gate_phdrs[i].p_memsz));        \
+                       break;                                                \
+               }                                                             \
+       }                                                               \
+} while (0)
+
+#endif /* _ASM_IA64_ELF_H */
diff --git a/arch/ia64/include/asm/emergency-restart.h b/arch/ia64/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/ia64/include/asm/errno.h b/arch/ia64/include/asm/errno.h
new file mode 100644 (file)
index 0000000..4c82b50
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/errno.h>
diff --git a/arch/ia64/include/asm/esi.h b/arch/ia64/include/asm/esi.h
new file mode 100644 (file)
index 0000000..40991c6
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * ESI service calls.
+ *
+ * Copyright (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P.
+ *     Alex Williamson <alex.williamson@hp.com>
+ */
+#ifndef esi_h
+#define esi_h
+
+#include <linux/efi.h>
+
+#define ESI_QUERY                      0x00000001
+#define ESI_OPEN_HANDLE                        0x02000000
+#define ESI_CLOSE_HANDLE               0x02000001
+
+enum esi_proc_type {
+       ESI_PROC_SERIALIZED,    /* calls need to be serialized */
+       ESI_PROC_MP_SAFE,       /* MP-safe, but not reentrant */
+       ESI_PROC_REENTRANT      /* MP-safe and reentrant */
+};
+
+extern struct ia64_sal_retval esi_call_phys (void *, u64 *);
+extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *,
+                        enum esi_proc_type,
+                        u64, u64, u64, u64, u64, u64, u64, u64);
+extern int ia64_esi_call_phys(efi_guid_t, struct ia64_sal_retval *, u64, u64,
+                              u64, u64, u64, u64, u64, u64);
+
+#endif /* esi_h */
diff --git a/arch/ia64/include/asm/fb.h b/arch/ia64/include/asm/fb.h
new file mode 100644 (file)
index 0000000..89a397c
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _ASM_FB_H_
+#define _ASM_FB_H_
+
+#include <linux/fb.h>
+#include <linux/fs.h>
+#include <linux/efi.h>
+#include <asm/page.h>
+
+static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
+                               unsigned long off)
+{
+       if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
+               vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+       else
+               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+}
+
+static inline int fb_is_primary_device(struct fb_info *info)
+{
+       return 0;
+}
+
+#endif /* _ASM_FB_H_ */
diff --git a/arch/ia64/include/asm/fcntl.h b/arch/ia64/include/asm/fcntl.h
new file mode 100644 (file)
index 0000000..1dd275d
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ASM_IA64_FCNTL_H
+#define _ASM_IA64_FCNTL_H
+/*
+ * Modified 1998-2000
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
+ */
+
+#define force_o_largefile()    \
+               (personality(current->personality) != PER_LINUX32)
+
+#include <asm-generic/fcntl.h>
+
+#endif /* _ASM_IA64_FCNTL_H */
diff --git a/arch/ia64/include/asm/fpswa.h b/arch/ia64/include/asm/fpswa.h
new file mode 100644 (file)
index 0000000..62edfce
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef _ASM_IA64_FPSWA_H
+#define _ASM_IA64_FPSWA_H
+
+/*
+ * Floating-point Software Assist
+ *
+ * Copyright (C) 1999 Intel Corporation.
+ * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 1999 Goutham Rao <goutham.rao@intel.com>
+ */
+
+typedef struct {
+       /* 4 * 128 bits */
+       unsigned long fp_lp[4*2];
+} fp_state_low_preserved_t;
+
+typedef struct {
+       /* 10 * 128 bits */
+       unsigned long fp_lv[10 * 2];
+} fp_state_low_volatile_t;
+
+typedef        struct {
+       /* 16 * 128 bits */
+       unsigned long fp_hp[16 * 2];
+} fp_state_high_preserved_t;
+
+typedef struct {
+       /* 96 * 128 bits */
+       unsigned long fp_hv[96 * 2];
+} fp_state_high_volatile_t;
+
+/**
+ * floating point state to be passed to the FP emulation library by
+ * the trap/fault handler
+ */
+typedef struct {
+       unsigned long                   bitmask_low64;
+       unsigned long                   bitmask_high64;
+       fp_state_low_preserved_t        *fp_state_low_preserved;
+       fp_state_low_volatile_t         *fp_state_low_volatile;
+       fp_state_high_preserved_t       *fp_state_high_preserved;
+       fp_state_high_volatile_t        *fp_state_high_volatile;
+} fp_state_t;
+
+typedef struct {
+       unsigned long status;
+       unsigned long err0;
+       unsigned long err1;
+       unsigned long err2;
+} fpswa_ret_t;
+
+/**
+ * function header for the Floating Point software assist
+ * library. This function is invoked by the Floating point software
+ * assist trap/fault handler.
+ */
+typedef fpswa_ret_t (*efi_fpswa_t) (unsigned long trap_type, void *bundle, unsigned long *ipsr,
+                                   unsigned long *fsr, unsigned long *isr, unsigned long *preds,
+                                   unsigned long *ifs, fp_state_t *fp_state);
+
+/**
+ * This is the FPSWA library interface as defined by EFI.  We need to pass a 
+ * pointer to the interface itself on a call to the assist library
+ */
+typedef struct {
+       unsigned int     revision;
+       unsigned int     reserved;
+       efi_fpswa_t      fpswa;
+} fpswa_interface_t;
+
+extern fpswa_interface_t *fpswa_interface;
+
+#endif /* _ASM_IA64_FPSWA_H */
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h
new file mode 100644 (file)
index 0000000..3859558
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _ASM_IA64_FPU_H
+#define _ASM_IA64_FPU_H
+
+/*
+ * Copyright (C) 1998, 1999, 2002, 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <asm/types.h>
+
+/* floating point status register: */
+#define FPSR_TRAP_VD   (1 << 0)        /* invalid op trap disabled */
+#define FPSR_TRAP_DD   (1 << 1)        /* denormal trap disabled */
+#define FPSR_TRAP_ZD   (1 << 2)        /* zero-divide trap disabled */
+#define FPSR_TRAP_OD   (1 << 3)        /* overflow trap disabled */
+#define FPSR_TRAP_UD   (1 << 4)        /* underflow trap disabled */
+#define FPSR_TRAP_ID   (1 << 5)        /* inexact trap disabled */
+#define FPSR_S0(x)     ((x) <<  6)
+#define FPSR_S1(x)     ((x) << 19)
+#define FPSR_S2(x)     (__IA64_UL(x) << 32)
+#define FPSR_S3(x)     (__IA64_UL(x) << 45)
+
+/* floating-point status field controls: */
+#define FPSF_FTZ       (1 << 0)                /* flush-to-zero */
+#define FPSF_WRE       (1 << 1)                /* widest-range exponent */
+#define FPSF_PC(x)     (((x) & 0x3) << 2)      /* precision control */
+#define FPSF_RC(x)     (((x) & 0x3) << 4)      /* rounding control */
+#define FPSF_TD                (1 << 6)                /* trap disabled */
+
+/* floating-point status field flags: */
+#define FPSF_V         (1 <<  7)               /* invalid operation flag */
+#define FPSF_D         (1 <<  8)               /* denormal/unnormal operand flag */
+#define FPSF_Z         (1 <<  9)               /* zero divide (IEEE) flag */
+#define FPSF_O         (1 << 10)               /* overflow (IEEE) flag */
+#define FPSF_U         (1 << 11)               /* underflow (IEEE) flag */
+#define FPSF_I         (1 << 12)               /* inexact (IEEE) flag) */
+
+/* floating-point rounding control: */
+#define FPRC_NEAREST   0x0
+#define FPRC_NEGINF    0x1
+#define FPRC_POSINF    0x2
+#define FPRC_TRUNC     0x3
+
+#define FPSF_DEFAULT   (FPSF_PC (0x3) | FPSF_RC (FPRC_NEAREST))
+
+/* This default value is the same as HP-UX uses.  Don't change it
+   without a very good reason.  */
+#define FPSR_DEFAULT   (FPSR_TRAP_VD | FPSR_TRAP_DD | FPSR_TRAP_ZD     \
+                        | FPSR_TRAP_OD | FPSR_TRAP_UD | FPSR_TRAP_ID   \
+                        | FPSR_S0 (FPSF_DEFAULT)                       \
+                        | FPSR_S1 (FPSF_DEFAULT | FPSF_TD | FPSF_WRE)  \
+                        | FPSR_S2 (FPSF_DEFAULT | FPSF_TD)             \
+                        | FPSR_S3 (FPSF_DEFAULT | FPSF_TD))
+
+# ifndef __ASSEMBLY__
+
+struct ia64_fpreg {
+       union {
+               unsigned long bits[2];
+               long double __dummy;    /* force 16-byte alignment */
+       } u;
+};
+
+# endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_IA64_FPU_H */
diff --git a/arch/ia64/include/asm/futex.h b/arch/ia64/include/asm/futex.h
new file mode 100644 (file)
index 0000000..c7f0f06
--- /dev/null
@@ -0,0 +1,124 @@
+#ifndef _ASM_FUTEX_H
+#define _ASM_FUTEX_H
+
+#include <linux/futex.h>
+#include <linux/uaccess.h>
+#include <asm/errno.h>
+#include <asm/system.h>
+
+#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
+do {                                                                   \
+       register unsigned long r8 __asm ("r8") = 0;                     \
+       __asm__ __volatile__(                                           \
+               "       mf;;                                    \n"     \
+               "[1:] " insn ";;                                \n"     \
+               "       .xdata4 \"__ex_table\", 1b-., 2f-.      \n"     \
+               "[2:]"                                                  \
+               : "+r" (r8), "=r" (oldval)                              \
+               : "r" (uaddr), "r" (oparg)                              \
+               : "memory");                                            \
+       ret = r8;                                                       \
+} while (0)
+
+#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
+do {                                                                   \
+       register unsigned long r8 __asm ("r8") = 0;                     \
+       int val, newval;                                                \
+       do {                                                            \
+               __asm__ __volatile__(                                   \
+                       "       mf;;                              \n"   \
+                       "[1:]   ld4 %3=[%4];;                     \n"   \
+                       "       mov %2=%3                         \n"   \
+                               insn    ";;                       \n"   \
+                       "       mov ar.ccv=%2;;                   \n"   \
+                       "[2:]   cmpxchg4.acq %1=[%4],%3,ar.ccv;;  \n"   \
+                       "       .xdata4 \"__ex_table\", 1b-., 3f-.\n"   \
+                       "       .xdata4 \"__ex_table\", 2b-., 3f-.\n"   \
+                       "[3:]"                                          \
+                       : "+r" (r8), "=r" (val), "=&r" (oldval),        \
+                          "=&r" (newval)                               \
+                       : "r" (uaddr), "r" (oparg)                      \
+                       : "memory");                                    \
+               if (unlikely (r8))                                      \
+                       break;                                          \
+       } while (unlikely (val != oldval));                             \
+       ret = r8;                                                       \
+} while (0)
+
+static inline int
+futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
+{
+       int op = (encoded_op >> 28) & 7;
+       int cmp = (encoded_op >> 24) & 15;
+       int oparg = (encoded_op << 8) >> 20;
+       int cmparg = (encoded_op << 20) >> 20;
+       int oldval = 0, ret;
+       if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
+               oparg = 1 << oparg;
+
+       if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
+               return -EFAULT;
+
+       pagefault_disable();
+
+       switch (op) {
+       case FUTEX_OP_SET:
+               __futex_atomic_op1("xchg4 %1=[%2],%3", ret, oldval, uaddr,
+                                  oparg);
+               break;
+       case FUTEX_OP_ADD:
+               __futex_atomic_op2("add %3=%3,%5", ret, oldval, uaddr, oparg);
+               break;
+       case FUTEX_OP_OR:
+               __futex_atomic_op2("or %3=%3,%5", ret, oldval, uaddr, oparg);
+               break;
+       case FUTEX_OP_ANDN:
+               __futex_atomic_op2("and %3=%3,%5", ret, oldval, uaddr,
+                                  ~oparg);
+               break;
+       case FUTEX_OP_XOR:
+               __futex_atomic_op2("xor %3=%3,%5", ret, oldval, uaddr, oparg);
+               break;
+       default:
+               ret = -ENOSYS;
+       }
+
+       pagefault_enable();
+
+       if (!ret) {
+               switch (cmp) {
+               case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
+               case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
+               case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
+               case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
+               case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
+               case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
+               default: ret = -ENOSYS;
+               }
+       }
+       return ret;
+}
+
+static inline int
+futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
+{
+       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
+               return -EFAULT;
+
+       {
+               register unsigned long r8 __asm ("r8");
+               __asm__ __volatile__(
+                       "       mf;;                                    \n"
+                       "       mov ar.ccv=%3;;                         \n"
+                       "[1:]   cmpxchg4.acq %0=[%1],%2,ar.ccv          \n"
+                       "       .xdata4 \"__ex_table\", 1b-., 2f-.      \n"
+                       "[2:]"
+                       : "=r" (r8)
+                       : "r" (uaddr), "r" (newval),
+                         "rO" ((long) (unsigned) oldval)
+                       : "memory");
+               return r8;
+       }
+}
+
+#endif /* _ASM_FUTEX_H */
diff --git a/arch/ia64/include/asm/gcc_intrin.h b/arch/ia64/include/asm/gcc_intrin.h
new file mode 100644 (file)
index 0000000..0f5b559
--- /dev/null
@@ -0,0 +1,620 @@
+#ifndef _ASM_IA64_GCC_INTRIN_H
+#define _ASM_IA64_GCC_INTRIN_H
+/*
+ *
+ * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
+ * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
+ */
+
+#include <linux/compiler.h>
+
+/* define this macro to get some asm stmts included in 'c' files */
+#define ASM_SUPPORTED
+
+/* Optimization barrier */
+/* The "volatile" is due to gcc bugs */
+#define ia64_barrier() asm volatile ("":::"memory")
+
+#define ia64_stop()    asm volatile (";;"::)
+
+#define ia64_invala_gr(regnum) asm volatile ("invala.e r%0" :: "i"(regnum))
+
+#define ia64_invala_fr(regnum) asm volatile ("invala.e f%0" :: "i"(regnum))
+
+#define ia64_flushrs() asm volatile ("flushrs;;":::"memory")
+
+#define ia64_loadrs() asm volatile ("loadrs;;":::"memory")
+
+extern void ia64_bad_param_for_setreg (void);
+extern void ia64_bad_param_for_getreg (void);
+
+#ifdef __KERNEL__
+register unsigned long ia64_r13 asm ("r13") __used;
+#endif
+
+#define ia64_native_setreg(regnum, val)                                                \
+({                                                                             \
+       switch (regnum) {                                                       \
+           case _IA64_REG_PSR_L:                                               \
+                   asm volatile ("mov psr.l=%0" :: "r"(val) : "memory");       \
+                   break;                                                      \
+           case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC:                          \
+                   asm volatile ("mov ar%0=%1" ::                              \
+                                         "i" (regnum - _IA64_REG_AR_KR0),      \
+                                         "r"(val): "memory");                  \
+                   break;                                                      \
+           case _IA64_REG_CR_DCR ... _IA64_REG_CR_LRR1:                        \
+                   asm volatile ("mov cr%0=%1" ::                              \
+                                         "i" (regnum - _IA64_REG_CR_DCR),      \
+                                         "r"(val): "memory" );                 \
+                   break;                                                      \
+           case _IA64_REG_SP:                                                  \
+                   asm volatile ("mov r12=%0" ::                               \
+                                         "r"(val): "memory");                  \
+                   break;                                                      \
+           case _IA64_REG_GP:                                                  \
+                   asm volatile ("mov gp=%0" :: "r"(val) : "memory");          \
+               break;                                                          \
+           default:                                                            \
+                   ia64_bad_param_for_setreg();                                \
+                   break;                                                      \
+       }                                                                       \
+})
+
+#define ia64_native_getreg(regnum)                                             \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+                                                                               \
+       switch (regnum) {                                                       \
+       case _IA64_REG_GP:                                                      \
+               asm volatile ("mov %0=gp" : "=r"(ia64_intri_res));              \
+               break;                                                          \
+       case _IA64_REG_IP:                                                      \
+               asm volatile ("mov %0=ip" : "=r"(ia64_intri_res));              \
+               break;                                                          \
+       case _IA64_REG_PSR:                                                     \
+               asm volatile ("mov %0=psr" : "=r"(ia64_intri_res));             \
+               break;                                                          \
+       case _IA64_REG_TP:      /* for current() */                             \
+               ia64_intri_res = ia64_r13;                                      \
+               break;                                                          \
+       case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC:                              \
+               asm volatile ("mov %0=ar%1" : "=r" (ia64_intri_res)             \
+                                     : "i"(regnum - _IA64_REG_AR_KR0));        \
+               break;                                                          \
+       case _IA64_REG_CR_DCR ... _IA64_REG_CR_LRR1:                            \
+               asm volatile ("mov %0=cr%1" : "=r" (ia64_intri_res)             \
+                                     : "i" (regnum - _IA64_REG_CR_DCR));       \
+               break;                                                          \
+       case _IA64_REG_SP:                                                      \
+               asm volatile ("mov %0=sp" : "=r" (ia64_intri_res));             \
+               break;                                                          \
+       default:                                                                \
+               ia64_bad_param_for_getreg();                                    \
+               break;                                                          \
+       }                                                                       \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_hint_pause 0
+
+#define ia64_hint(mode)                                                \
+({                                                             \
+       switch (mode) {                                         \
+       case ia64_hint_pause:                                   \
+               asm volatile ("hint @pause" ::: "memory");      \
+               break;                                          \
+       }                                                       \
+})
+
+
+/* Integer values for mux1 instruction */
+#define ia64_mux1_brcst 0
+#define ia64_mux1_mix   8
+#define ia64_mux1_shuf  9
+#define ia64_mux1_alt  10
+#define ia64_mux1_rev  11
+
+#define ia64_mux1(x, mode)                                                     \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+                                                                               \
+       switch (mode) {                                                         \
+       case ia64_mux1_brcst:                                                   \
+               asm ("mux1 %0=%1,@brcst" : "=r" (ia64_intri_res) : "r" (x));    \
+               break;                                                          \
+       case ia64_mux1_mix:                                                     \
+               asm ("mux1 %0=%1,@mix" : "=r" (ia64_intri_res) : "r" (x));      \
+               break;                                                          \
+       case ia64_mux1_shuf:                                                    \
+               asm ("mux1 %0=%1,@shuf" : "=r" (ia64_intri_res) : "r" (x));     \
+               break;                                                          \
+       case ia64_mux1_alt:                                                     \
+               asm ("mux1 %0=%1,@alt" : "=r" (ia64_intri_res) : "r" (x));      \
+               break;                                                          \
+       case ia64_mux1_rev:                                                     \
+               asm ("mux1 %0=%1,@rev" : "=r" (ia64_intri_res) : "r" (x));      \
+               break;                                                          \
+       }                                                                       \
+       ia64_intri_res;                                                         \
+})
+
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# define ia64_popcnt(x)                __builtin_popcountl(x)
+#else
+# define ia64_popcnt(x)                                                \
+  ({                                                           \
+       __u64 ia64_intri_res;                                   \
+       asm ("popcnt %0=%1" : "=r" (ia64_intri_res) : "r" (x)); \
+                                                               \
+       ia64_intri_res;                                         \
+  })
+#endif
+
+#define ia64_getf_exp(x)                                       \
+({                                                             \
+       long ia64_intri_res;                                    \
+                                                               \
+       asm ("getf.exp %0=%1" : "=r"(ia64_intri_res) : "f"(x)); \
+                                                               \
+       ia64_intri_res;                                         \
+})
+
+#define ia64_shrp(a, b, count)                                                         \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm ("shrp %0=%1,%2,%3" : "=r"(ia64_intri_res) : "r"(a), "r"(b), "i"(count));   \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_ldfs(regnum, x)                                   \
+({                                                             \
+       register double __f__ asm ("f"#regnum);                 \
+       asm volatile ("ldfs %0=[%1]" :"=f"(__f__): "r"(x));     \
+})
+
+#define ia64_ldfd(regnum, x)                                   \
+({                                                             \
+       register double __f__ asm ("f"#regnum);                 \
+       asm volatile ("ldfd %0=[%1]" :"=f"(__f__): "r"(x));     \
+})
+
+#define ia64_ldfe(regnum, x)                                   \
+({                                                             \
+       register double __f__ asm ("f"#regnum);                 \
+       asm volatile ("ldfe %0=[%1]" :"=f"(__f__): "r"(x));     \
+})
+
+#define ia64_ldf8(regnum, x)                                   \
+({                                                             \
+       register double __f__ asm ("f"#regnum);                 \
+       asm volatile ("ldf8 %0=[%1]" :"=f"(__f__): "r"(x));     \
+})
+
+#define ia64_ldf_fill(regnum, x)                               \
+({                                                             \
+       register double __f__ asm ("f"#regnum);                 \
+       asm volatile ("ldf.fill %0=[%1]" :"=f"(__f__): "r"(x)); \
+})
+
+#define ia64_st4_rel_nta(m, val)                                       \
+({                                                                     \
+       asm volatile ("st4.rel.nta [%0] = %1\n\t" :: "r"(m), "r"(val)); \
+})
+
+#define ia64_stfs(x, regnum)                                           \
+({                                                                     \
+       register double __f__ asm ("f"#regnum);                         \
+       asm volatile ("stfs [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
+})
+
+#define ia64_stfd(x, regnum)                                           \
+({                                                                     \
+       register double __f__ asm ("f"#regnum);                         \
+       asm volatile ("stfd [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
+})
+
+#define ia64_stfe(x, regnum)                                           \
+({                                                                     \
+       register double __f__ asm ("f"#regnum);                         \
+       asm volatile ("stfe [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
+})
+
+#define ia64_stf8(x, regnum)                                           \
+({                                                                     \
+       register double __f__ asm ("f"#regnum);                         \
+       asm volatile ("stf8 [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
+})
+
+#define ia64_stf_spill(x, regnum)                                              \
+({                                                                             \
+       register double __f__ asm ("f"#regnum);                                 \
+       asm volatile ("stf.spill [%0]=%1" :: "r"(x), "f"(__f__) : "memory");    \
+})
+
+#define ia64_fetchadd4_acq(p, inc)                                             \
+({                                                                             \
+                                                                               \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("fetchadd4.acq %0=[%1],%2"                                \
+                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
+                               : "memory");                                    \
+                                                                               \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_fetchadd4_rel(p, inc)                                             \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("fetchadd4.rel %0=[%1],%2"                                \
+                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
+                               : "memory");                                    \
+                                                                               \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_fetchadd8_acq(p, inc)                                             \
+({                                                                             \
+                                                                               \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("fetchadd8.acq %0=[%1],%2"                                \
+                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
+                               : "memory");                                    \
+                                                                               \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_fetchadd8_rel(p, inc)                                             \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("fetchadd8.rel %0=[%1],%2"                                \
+                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
+                               : "memory");                                    \
+                                                                               \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_xchg1(ptr,x)                                                      \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("xchg1 %0=[%1],%2"                                        \
+                     : "=r" (ia64_intri_res) : "r" (ptr), "r" (x) : "memory"); \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_xchg2(ptr,x)                                              \
+({                                                                     \
+       __u64 ia64_intri_res;                                           \
+       asm volatile ("xchg2 %0=[%1],%2" : "=r" (ia64_intri_res)        \
+                     : "r" (ptr), "r" (x) : "memory");                 \
+       ia64_intri_res;                                                 \
+})
+
+#define ia64_xchg4(ptr,x)                                              \
+({                                                                     \
+       __u64 ia64_intri_res;                                           \
+       asm volatile ("xchg4 %0=[%1],%2" : "=r" (ia64_intri_res)        \
+                     : "r" (ptr), "r" (x) : "memory");                 \
+       ia64_intri_res;                                                 \
+})
+
+#define ia64_xchg8(ptr,x)                                              \
+({                                                                     \
+       __u64 ia64_intri_res;                                           \
+       asm volatile ("xchg8 %0=[%1],%2" : "=r" (ia64_intri_res)        \
+                     : "r" (ptr), "r" (x) : "memory");                 \
+       ia64_intri_res;                                                 \
+})
+
+#define ia64_cmpxchg1_acq(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg1.acq %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg1_rel(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg1.rel %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg2_acq(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg2.acq %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg2_rel(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+                                                                                       \
+       asm volatile ("cmpxchg2.rel %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg4_acq(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg4.acq %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg4_rel(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg4.rel %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg8_acq(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+       asm volatile ("cmpxchg8.acq %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_cmpxchg8_rel(ptr, new, old)                                               \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
+                                                                                       \
+       asm volatile ("cmpxchg8.rel %0=[%1],%2,ar.ccv":                                 \
+                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
+       ia64_intri_res;                                                                 \
+})
+
+#define ia64_mf()      asm volatile ("mf" ::: "memory")
+#define ia64_mfa()     asm volatile ("mf.a" ::: "memory")
+
+#define ia64_invala() asm volatile ("invala" ::: "memory")
+
+#define ia64_native_thash(addr)                                                        \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("thash %0=%1" : "=r"(ia64_intri_res) : "r" (addr));       \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_srlz_i()  asm volatile (";; srlz.i ;;" ::: "memory")
+#define ia64_srlz_d()  asm volatile (";; srlz.d" ::: "memory");
+
+#ifdef HAVE_SERIALIZE_DIRECTIVE
+# define ia64_dv_serialize_data()              asm volatile (".serialize.data");
+# define ia64_dv_serialize_instruction()       asm volatile (".serialize.instruction");
+#else
+# define ia64_dv_serialize_data()
+# define ia64_dv_serialize_instruction()
+#endif
+
+#define ia64_nop(x)    asm volatile ("nop %0"::"i"(x));
+
+#define ia64_itci(addr)        asm volatile ("itc.i %0;;" :: "r"(addr) : "memory")
+
+#define ia64_itcd(addr)        asm volatile ("itc.d %0;;" :: "r"(addr) : "memory")
+
+
+#define ia64_itri(trnum, addr) asm volatile ("itr.i itr[%0]=%1"                                \
+                                            :: "r"(trnum), "r"(addr) : "memory")
+
+#define ia64_itrd(trnum, addr) asm volatile ("itr.d dtr[%0]=%1"                                \
+                                            :: "r"(trnum), "r"(addr) : "memory")
+
+#define ia64_tpa(addr)                                                         \
+({                                                                             \
+       __u64 ia64_pa;                                                          \
+       asm volatile ("tpa %0 = %1" : "=r"(ia64_pa) : "r"(addr) : "memory");    \
+       ia64_pa;                                                                \
+})
+
+#define __ia64_set_dbr(index, val)                                             \
+       asm volatile ("mov dbr[%0]=%1" :: "r"(index), "r"(val) : "memory")
+
+#define ia64_set_ibr(index, val)                                               \
+       asm volatile ("mov ibr[%0]=%1" :: "r"(index), "r"(val) : "memory")
+
+#define ia64_set_pkr(index, val)                                               \
+       asm volatile ("mov pkr[%0]=%1" :: "r"(index), "r"(val) : "memory")
+
+#define ia64_set_pmc(index, val)                                               \
+       asm volatile ("mov pmc[%0]=%1" :: "r"(index), "r"(val) : "memory")
+
+#define ia64_set_pmd(index, val)                                               \
+       asm volatile ("mov pmd[%0]=%1" :: "r"(index), "r"(val) : "memory")
+
+#define ia64_native_set_rr(index, val)                                                 \
+       asm volatile ("mov rr[%0]=%1" :: "r"(index), "r"(val) : "memory");
+
+#define ia64_native_get_cpuid(index)                                                   \
+({                                                                                     \
+       __u64 ia64_intri_res;                                                           \
+       asm volatile ("mov %0=cpuid[%r1]" : "=r"(ia64_intri_res) : "rO"(index));        \
+       ia64_intri_res;                                                                 \
+})
+
+#define __ia64_get_dbr(index)                                                  \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=dbr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_get_ibr(index)                                                    \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=ibr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_get_pkr(index)                                                    \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=pkr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_get_pmc(index)                                                    \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=pmc[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
+       ia64_intri_res;                                                         \
+})
+
+
+#define ia64_native_get_pmd(index)                                             \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=pmd[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_native_get_rr(index)                                              \
+({                                                                             \
+       __u64 ia64_intri_res;                                                   \
+       asm volatile ("mov %0=rr[%1]" : "=r"(ia64_intri_res) : "r" (index));    \
+       ia64_intri_res;                                                         \
+})
+
+#define ia64_native_fc(addr)   asm volatile ("fc %0" :: "r"(addr) : "memory")
+
+
+#define ia64_sync_i()  asm volatile (";; sync.i" ::: "memory")
+
+#define ia64_native_ssm(mask)  asm volatile ("ssm %0":: "i"((mask)) : "memory")
+#define ia64_native_rsm(mask)  asm volatile ("rsm %0":: "i"((mask)) : "memory")
+#define ia64_sum(mask) asm volatile ("sum %0":: "i"((mask)) : "memory")
+#define ia64_rum(mask) asm volatile ("rum %0":: "i"((mask)) : "memory")
+
+#define ia64_ptce(addr)        asm volatile ("ptc.e %0" :: "r"(addr))
+
+#define ia64_native_ptcga(addr, size)                                          \
+do {                                                                           \
+       asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory");       \
+       ia64_dv_serialize_data();                                               \
+} while (0)
+
+#define ia64_ptcl(addr, size)                                                  \
+do {                                                                           \
+       asm volatile ("ptc.l %0,%1" :: "r"(addr), "r"(size) : "memory");        \
+       ia64_dv_serialize_data();                                               \
+} while (0)
+
+#define ia64_ptri(addr, size)                                          \
+       asm volatile ("ptr.i %0,%1" :: "r"(addr), "r"(size) : "memory")
+
+#define ia64_ptrd(addr, size)                                          \
+       asm volatile ("ptr.d %0,%1" :: "r"(addr), "r"(size) : "memory")
+
+#define ia64_ttag(addr)                                                        \
+({                                                                       \
+       __u64 ia64_intri_res;                                              \
+       asm volatile ("ttag %0=%1" : "=r"(ia64_intri_res) : "r" (addr));   \
+       ia64_intri_res;                                                  \
+})
+
+
+/* Values for lfhint in ia64_lfetch and ia64_lfetch_fault */
+
+#define ia64_lfhint_none   0
+#define ia64_lfhint_nt1    1
+#define ia64_lfhint_nt2    2
+#define ia64_lfhint_nta    3
+
+#define ia64_lfetch(lfhint, y)                                 \
+({                                                             \
+        switch (lfhint) {                                      \
+        case ia64_lfhint_none:                                 \
+                asm volatile ("lfetch [%0]" : : "r"(y));       \
+                break;                                         \
+        case ia64_lfhint_nt1:                                  \
+                asm volatile ("lfetch.nt1 [%0]" : : "r"(y));   \
+                break;                                         \
+        case ia64_lfhint_nt2:                                  \
+                asm volatile ("lfetch.nt2 [%0]" : : "r"(y));   \
+                break;                                         \
+        case ia64_lfhint_nta:                                  \
+                asm volatile ("lfetch.nta [%0]" : : "r"(y));   \
+                break;                                         \
+        }                                                      \
+})
+
+#define ia64_lfetch_excl(lfhint, y)                                    \
+({                                                                     \
+        switch (lfhint) {                                              \
+        case ia64_lfhint_none:                                         \
+                asm volatile ("lfetch.excl [%0]" :: "r"(y));           \
+                break;                                                 \
+        case ia64_lfhint_nt1:                                          \
+                asm volatile ("lfetch.excl.nt1 [%0]" :: "r"(y));       \
+                break;                                                 \
+        case ia64_lfhint_nt2:                                          \
+                asm volatile ("lfetch.excl.nt2 [%0]" :: "r"(y));       \
+                break;                                                 \
+        case ia64_lfhint_nta:                                          \
+                asm volatile ("lfetch.excl.nta [%0]" :: "r"(y));       \
+                break;                                                 \
+        }                                                              \
+})
+
+#define ia64_lfetch_fault(lfhint, y)                                   \
+({                                                                     \
+        switch (lfhint) {                                              \
+        case ia64_lfhint_none:                                         \
+                asm volatile ("lfetch.fault [%0]" : : "r"(y));         \
+                break;                                                 \
+        case ia64_lfhint_nt1:                                          \
+                asm volatile ("lfetch.fault.nt1 [%0]" : : "r"(y));     \
+                break;                                                 \
+        case ia64_lfhint_nt2:                                          \
+                asm volatile ("lfetch.fault.nt2 [%0]" : : "r"(y));     \
+                break;                                                 \
+        case ia64_lfhint_nta:                                          \
+                asm volatile ("lfetch.fault.nta [%0]" : : "r"(y));     \
+                break;                                                 \
+        }                                                              \
+})
+
+#define ia64_lfetch_fault_excl(lfhint, y)                              \
+({                                                                     \
+        switch (lfhint) {                                              \
+        case ia64_lfhint_none:                                         \
+                asm volatile ("lfetch.fault.excl [%0]" :: "r"(y));     \
+                break;                                                 \
+        case ia64_lfhint_nt1:                                          \
+                asm volatile ("lfetch.fault.excl.nt1 [%0]" :: "r"(y)); \
+                break;                                                 \
+        case ia64_lfhint_nt2:                                          \
+                asm volatile ("lfetch.fault.excl.nt2 [%0]" :: "r"(y)); \
+                break;                                                 \
+        case ia64_lfhint_nta:                                          \
+                asm volatile ("lfetch.fault.excl.nta [%0]" :: "r"(y)); \
+                break;                                                 \
+        }                                                              \
+})
+
+#define ia64_native_intrin_local_irq_restore(x)                        \
+do {                                                           \
+       asm volatile (";;   cmp.ne p6,p7=%0,r0;;"               \
+                     "(p6) ssm psr.i;"                         \
+                     "(p7) rsm psr.i;;"                        \
+                     "(p6) srlz.d"                             \
+                     :: "r"((x)) : "p6", "p7", "memory");      \
+} while (0)
+
+#endif /* _ASM_IA64_GCC_INTRIN_H */
diff --git a/arch/ia64/include/asm/hardirq.h b/arch/ia64/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..140e495
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _ASM_IA64_HARDIRQ_H
+#define _ASM_IA64_HARDIRQ_H
+
+/*
+ * Modified 1998-2002, 2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+#include <asm/processor.h>
+
+/*
+ * No irq_cpustat_t for IA-64.  The data is held in the per-CPU data structure.
+ */
+
+#define __ARCH_IRQ_STAT        1
+
+#define local_softirq_pending()                (local_cpu_data->softirq_pending)
+
+#define HARDIRQ_BITS   14
+
+/*
+ * The hardirq mask has to be large enough to have space for potentially all IRQ sources
+ * in the system nesting on a single CPU:
+ */
+#if (1 << HARDIRQ_BITS) < NR_IRQS
+# error HARDIRQ_BITS is too low!
+#endif
+
+extern void __iomem *ipi_base_addr;
+
+void ack_bad_irq(unsigned int irq);
+
+#endif /* _ASM_IA64_HARDIRQ_H */
diff --git a/arch/ia64/include/asm/hpsim.h b/arch/ia64/include/asm/hpsim.h
new file mode 100644 (file)
index 0000000..892ab19
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASMIA64_HPSIM_H
+#define _ASMIA64_HPSIM_H
+
+#ifndef CONFIG_HP_SIMSERIAL_CONSOLE
+static inline int simcons_register(void) { return 1; }
+#else
+int simcons_register(void);
+#endif
+
+struct tty_driver;
+extern struct tty_driver *hp_simserial_driver;
+
+void ia64_ssc_connect_irq(long intr, long irq);
+void ia64_ctl_trace(long on);
+
+#endif
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
new file mode 100644 (file)
index 0000000..da55c63
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef _ASM_IA64_HUGETLB_H
+#define _ASM_IA64_HUGETLB_H
+
+#include <asm/page.h>
+
+
+void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
+                           unsigned long end, unsigned long floor,
+                           unsigned long ceiling);
+
+int prepare_hugepage_range(struct file *file,
+                       unsigned long addr, unsigned long len);
+
+static inline int is_hugepage_only_range(struct mm_struct *mm,
+                                        unsigned long addr,
+                                        unsigned long len)
+{
+       return (REGION_NUMBER(addr) == RGN_HPAGE ||
+               REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
+}
+
+static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
+{
+}
+
+static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
+                                  pte_t *ptep, pte_t pte)
+{
+       set_pte_at(mm, addr, ptep, pte);
+}
+
+static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
+                                           unsigned long addr, pte_t *ptep)
+{
+       return ptep_get_and_clear(mm, addr, ptep);
+}
+
+static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
+                                        unsigned long addr, pte_t *ptep)
+{
+}
+
+static inline int huge_pte_none(pte_t pte)
+{
+       return pte_none(pte);
+}
+
+static inline pte_t huge_pte_wrprotect(pte_t pte)
+{
+       return pte_wrprotect(pte);
+}
+
+static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
+                                          unsigned long addr, pte_t *ptep)
+{
+       ptep_set_wrprotect(mm, addr, ptep);
+}
+
+static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+                                            unsigned long addr, pte_t *ptep,
+                                            pte_t pte, int dirty)
+{
+       return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
+}
+
+static inline pte_t huge_ptep_get(pte_t *ptep)
+{
+       return *ptep;
+}
+
+static inline int arch_prepare_hugepage(struct page *page)
+{
+       return 0;
+}
+
+static inline void arch_release_hugepage(struct page *page)
+{
+}
+
+#endif /* _ASM_IA64_HUGETLB_H */
diff --git a/arch/ia64/include/asm/hw_irq.h b/arch/ia64/include/asm/hw_irq.h
new file mode 100644 (file)
index 0000000..5c99cbc
--- /dev/null
@@ -0,0 +1,192 @@
+#ifndef _ASM_IA64_HW_IRQ_H
+#define _ASM_IA64_HW_IRQ_H
+
+/*
+ * Copyright (C) 2001-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <linux/interrupt.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/profile.h>
+
+#include <asm/machvec.h>
+#include <asm/ptrace.h>
+#include <asm/smp.h>
+
+#ifndef CONFIG_PARAVIRT
+typedef u8 ia64_vector;
+#else
+typedef u16 ia64_vector;
+#endif
+
+/*
+ * 0 special
+ *
+ * 1,3-14 are reserved from firmware
+ *
+ * 16-255 (vectored external interrupts) are available
+ *
+ * 15 spurious interrupt (see IVR)
+ *
+ * 16 lowest priority, 255 highest priority
+ *
+ * 15 classes of 16 interrupts each.
+ */
+#define IA64_MIN_VECTORED_IRQ           16
+#define IA64_MAX_VECTORED_IRQ          255
+#define IA64_NUM_VECTORS               256
+
+#define AUTO_ASSIGN                    -1
+
+#define IA64_SPURIOUS_INT_VECTOR       0x0f
+
+/*
+ * Vectors 0x10-0x1f are used for low priority interrupts, e.g. CMCI.
+ */
+#define IA64_CPEP_VECTOR               0x1c    /* corrected platform error polling vector */
+#define IA64_CMCP_VECTOR               0x1d    /* corrected machine-check polling vector */
+#define IA64_CPE_VECTOR                        0x1e    /* corrected platform error interrupt vector */
+#define IA64_CMC_VECTOR                        0x1f    /* corrected machine-check interrupt vector */
+/*
+ * Vectors 0x20-0x2f are reserved for legacy ISA IRQs.
+ * Use vectors 0x30-0xe7 as the default device vector range for ia64.
+ * Platforms may choose to reduce this range in platform_irq_setup, but the
+ * platform range must fall within
+ *     [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR]
+ */
+extern int ia64_first_device_vector;
+extern int ia64_last_device_vector;
+
+#define IA64_DEF_FIRST_DEVICE_VECTOR   0x30
+#define IA64_DEF_LAST_DEVICE_VECTOR    0xe7
+#define IA64_FIRST_DEVICE_VECTOR       ia64_first_device_vector
+#define IA64_LAST_DEVICE_VECTOR                ia64_last_device_vector
+#define IA64_MAX_DEVICE_VECTORS                (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1)
+#define IA64_NUM_DEVICE_VECTORS                (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1)
+
+#define IA64_MCA_RENDEZ_VECTOR         0xe8    /* MCA rendez interrupt */
+#define IA64_PERFMON_VECTOR            0xee    /* performance monitor interrupt vector */
+#define IA64_TIMER_VECTOR              0xef    /* use highest-prio group 15 interrupt for timer */
+#define        IA64_MCA_WAKEUP_VECTOR          0xf0    /* MCA wakeup (must be >MCA_RENDEZ_VECTOR) */
+#define IA64_IPI_LOCAL_TLB_FLUSH       0xfc    /* SMP flush local TLB */
+#define IA64_IPI_RESCHEDULE            0xfd    /* SMP reschedule */
+#define IA64_IPI_VECTOR                        0xfe    /* inter-processor interrupt vector */
+
+/* Used for encoding redirected irqs */
+
+#define IA64_IRQ_REDIRECTED            (1 << 31)
+
+/* IA64 inter-cpu interrupt related definitions */
+
+#define IA64_IPI_DEFAULT_BASE_ADDR     0xfee00000
+
+/* Delivery modes for inter-cpu interrupts */
+enum {
+        IA64_IPI_DM_INT =       0x0,    /* pend an external interrupt */
+        IA64_IPI_DM_PMI =       0x2,    /* pend a PMI */
+        IA64_IPI_DM_NMI =       0x4,    /* pend an NMI (vector 2) */
+        IA64_IPI_DM_INIT =      0x5,    /* pend an INIT interrupt */
+        IA64_IPI_DM_EXTINT =    0x7,    /* pend an 8259-compatible interrupt. */
+};
+
+extern __u8 isa_irq_to_vector_map[16];
+#define isa_irq_to_vector(x)   isa_irq_to_vector_map[(x)]
+
+struct irq_cfg {
+       ia64_vector vector;
+       cpumask_t domain;
+       cpumask_t old_domain;
+       unsigned move_cleanup_count;
+       u8 move_in_progress : 1;
+};
+extern spinlock_t vector_lock;
+extern struct irq_cfg irq_cfg[NR_IRQS];
+#define irq_to_domain(x)       irq_cfg[(x)].domain
+DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
+
+extern struct hw_interrupt_type irq_type_ia64_lsapic;  /* CPU-internal interrupt controller */
+
+#ifdef CONFIG_PARAVIRT_GUEST
+#include <asm/paravirt.h>
+#else
+#define ia64_register_ipi      ia64_native_register_ipi
+#define assign_irq_vector      ia64_native_assign_irq_vector
+#define free_irq_vector                ia64_native_free_irq_vector
+#define register_percpu_irq    ia64_native_register_percpu_irq
+#define ia64_resend_irq                ia64_native_resend_irq
+#endif
+
+extern void ia64_native_register_ipi(void);
+extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
+extern int ia64_native_assign_irq_vector (int irq);    /* allocate a free vector */
+extern void ia64_native_free_irq_vector (int vector);
+extern int reserve_irq_vector (int vector);
+extern void __setup_vector_irq(int cpu);
+extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
+extern void ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action);
+extern int check_irq_used (int irq);
+extern void destroy_and_reserve_irq (unsigned int irq);
+
+#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
+extern int irq_prepare_move(int irq, int cpu);
+extern void irq_complete_move(unsigned int irq);
+#else
+static inline int irq_prepare_move(int irq, int cpu) { return 0; }
+static inline void irq_complete_move(unsigned int irq) {}
+#endif
+
+static inline void ia64_native_resend_irq(unsigned int vector)
+{
+       platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
+}
+
+/*
+ * Default implementations for the irq-descriptor API:
+ */
+
+extern irq_desc_t irq_desc[NR_IRQS];
+
+#ifndef CONFIG_IA64_GENERIC
+static inline ia64_vector __ia64_irq_to_vector(int irq)
+{
+       return irq_cfg[irq].vector;
+}
+
+static inline unsigned int
+__ia64_local_vector_to_irq (ia64_vector vec)
+{
+       return __get_cpu_var(vector_irq)[vec];
+}
+#endif
+
+/*
+ * Next follows the irq descriptor interface.  On IA-64, each CPU supports 256 interrupt
+ * vectors.  On smaller systems, there is a one-to-one correspondence between interrupt
+ * vectors and the Linux irq numbers.  However, larger systems may have multiple interrupt
+ * domains meaning that the translation from vector number to irq number depends on the
+ * interrupt domain that a CPU belongs to.  This API abstracts such platform-dependent
+ * differences and provides a uniform means to translate between vector and irq numbers
+ * and to obtain the irq descriptor for a given irq number.
+ */
+
+/* Extract the IA-64 vector that corresponds to IRQ.  */
+static inline ia64_vector
+irq_to_vector (int irq)
+{
+       return platform_irq_to_vector(irq);
+}
+
+/*
+ * Convert the local IA-64 vector to the corresponding irq number.  This translation is
+ * done in the context of the interrupt domain that the currently executing CPU belongs
+ * to.
+ */
+static inline unsigned int
+local_vector_to_irq (ia64_vector vec)
+{
+       return platform_local_vector_to_irq(vec);
+}
+
+#endif /* _ASM_IA64_HW_IRQ_H */
diff --git a/arch/ia64/include/asm/ia32.h b/arch/ia64/include/asm/ia32.h
new file mode 100644 (file)
index 0000000..2390ee1
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef _ASM_IA64_IA32_H
+#define _ASM_IA64_IA32_H
+
+
+#include <asm/ptrace.h>
+#include <asm/signal.h>
+
+#define IA32_NR_syscalls               285     /* length of syscall table */
+#define IA32_PAGE_SHIFT                        12      /* 4KB pages */
+
+#ifndef __ASSEMBLY__
+
+# ifdef CONFIG_IA32_SUPPORT
+
+#define IA32_PAGE_OFFSET       0xc0000000
+
+extern void ia32_cpu_init (void);
+extern void ia32_mem_init (void);
+extern void ia32_gdt_init (void);
+extern int ia32_exception (struct pt_regs *regs, unsigned long isr);
+extern int ia32_intercept (struct pt_regs *regs, unsigned long isr);
+extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs);
+
+# endif /* !CONFIG_IA32_SUPPORT */
+
+/* Declare this unconditionally, so we don't get warnings for unreachable code.  */
+extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
+                             sigset_t *set, struct pt_regs *regs);
+#if PAGE_SHIFT > IA32_PAGE_SHIFT
+extern int ia32_copy_ia64_partial_page_list(struct task_struct *,
+                                       unsigned long);
+extern void ia32_drop_ia64_partial_page_list(struct task_struct *);
+#else
+# define ia32_copy_ia64_partial_page_list(a1, a2)      0
+# define ia32_drop_ia64_partial_page_list(a1)  do { ; } while (0)
+#endif
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_IA32_H */
diff --git a/arch/ia64/include/asm/ia64regs.h b/arch/ia64/include/asm/ia64regs.h
new file mode 100644 (file)
index 0000000..1757f1c
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2002,2003 Intel Corp.
+ *      Jun Nakajima <jun.nakajima@intel.com>
+ *      Suresh Siddha <suresh.b.siddha@intel.com>
+ */
+
+#ifndef _ASM_IA64_IA64REGS_H
+#define _ASM_IA64_IA64REGS_H
+
+/*
+ * Register Names for getreg() and setreg().
+ *
+ * The "magic" numbers happen to match the values used by the Intel compiler's
+ * getreg()/setreg() intrinsics.
+ */
+
+/* Special Registers */
+
+#define _IA64_REG_IP           1016    /* getreg only */
+#define _IA64_REG_PSR          1019
+#define _IA64_REG_PSR_L                1019
+
+/* General Integer Registers */
+
+#define _IA64_REG_GP           1025    /* R1 */
+#define _IA64_REG_R8           1032    /* R8 */
+#define _IA64_REG_R9           1033    /* R9 */
+#define _IA64_REG_SP           1036    /* R12 */
+#define _IA64_REG_TP           1037    /* R13 */
+
+/* Application Registers */
+
+#define _IA64_REG_AR_KR0       3072
+#define _IA64_REG_AR_KR1       3073
+#define _IA64_REG_AR_KR2       3074
+#define _IA64_REG_AR_KR3       3075
+#define _IA64_REG_AR_KR4       3076
+#define _IA64_REG_AR_KR5       3077
+#define _IA64_REG_AR_KR6       3078
+#define _IA64_REG_AR_KR7       3079
+#define _IA64_REG_AR_RSC       3088
+#define _IA64_REG_AR_BSP       3089
+#define _IA64_REG_AR_BSPSTORE  3090
+#define _IA64_REG_AR_RNAT      3091
+#define _IA64_REG_AR_FCR       3093
+#define _IA64_REG_AR_EFLAG     3096
+#define _IA64_REG_AR_CSD       3097
+#define _IA64_REG_AR_SSD       3098
+#define _IA64_REG_AR_CFLAG     3099
+#define _IA64_REG_AR_FSR       3100
+#define _IA64_REG_AR_FIR       3101
+#define _IA64_REG_AR_FDR       3102
+#define _IA64_REG_AR_CCV       3104
+#define _IA64_REG_AR_UNAT      3108
+#define _IA64_REG_AR_FPSR      3112
+#define _IA64_REG_AR_ITC       3116
+#define _IA64_REG_AR_PFS       3136
+#define _IA64_REG_AR_LC                3137
+#define _IA64_REG_AR_EC                3138
+
+/* Control Registers */
+
+#define _IA64_REG_CR_DCR       4096
+#define _IA64_REG_CR_ITM       4097
+#define _IA64_REG_CR_IVA       4098
+#define _IA64_REG_CR_PTA       4104
+#define _IA64_REG_CR_IPSR      4112
+#define _IA64_REG_CR_ISR       4113
+#define _IA64_REG_CR_IIP       4115
+#define _IA64_REG_CR_IFA       4116
+#define _IA64_REG_CR_ITIR      4117
+#define _IA64_REG_CR_IIPA      4118
+#define _IA64_REG_CR_IFS       4119
+#define _IA64_REG_CR_IIM       4120
+#define _IA64_REG_CR_IHA       4121
+#define _IA64_REG_CR_LID       4160
+#define _IA64_REG_CR_IVR       4161    /* getreg only */
+#define _IA64_REG_CR_TPR       4162
+#define _IA64_REG_CR_EOI       4163
+#define _IA64_REG_CR_IRR0      4164    /* getreg only */
+#define _IA64_REG_CR_IRR1      4165    /* getreg only */
+#define _IA64_REG_CR_IRR2      4166    /* getreg only */
+#define _IA64_REG_CR_IRR3      4167    /* getreg only */
+#define _IA64_REG_CR_ITV       4168
+#define _IA64_REG_CR_PMV       4169
+#define _IA64_REG_CR_CMCV      4170
+#define _IA64_REG_CR_LRR0      4176
+#define _IA64_REG_CR_LRR1      4177
+
+/* Indirect Registers for getindreg() and setindreg() */
+
+#define _IA64_REG_INDR_CPUID   9000    /* getindreg only */
+#define _IA64_REG_INDR_DBR     9001
+#define _IA64_REG_INDR_IBR     9002
+#define _IA64_REG_INDR_PKR     9003
+#define _IA64_REG_INDR_PMC     9004
+#define _IA64_REG_INDR_PMD     9005
+#define _IA64_REG_INDR_RR      9006
+
+#endif /* _ASM_IA64_IA64REGS_H */
diff --git a/arch/ia64/include/asm/intel_intrin.h b/arch/ia64/include/asm/intel_intrin.h
new file mode 100644 (file)
index 0000000..53cec57
--- /dev/null
@@ -0,0 +1,161 @@
+#ifndef _ASM_IA64_INTEL_INTRIN_H
+#define _ASM_IA64_INTEL_INTRIN_H
+/*
+ * Intel Compiler Intrinsics
+ *
+ * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
+ * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
+ * Copyright (C) 2005,2006 Hongjiu Lu <hongjiu.lu@intel.com>
+ *
+ */
+#include <ia64intrin.h>
+
+#define ia64_barrier()         __memory_barrier()
+
+#define ia64_stop()    /* Nothing: As of now stop bit is generated for each
+                        * intrinsic
+                        */
+
+#define ia64_native_getreg     __getReg
+#define ia64_native_setreg     __setReg
+
+#define ia64_hint              __hint
+#define ia64_hint_pause                __hint_pause
+
+#define ia64_mux1_brcst                _m64_mux1_brcst
+#define ia64_mux1_mix          _m64_mux1_mix
+#define ia64_mux1_shuf         _m64_mux1_shuf
+#define ia64_mux1_alt          _m64_mux1_alt
+#define ia64_mux1_rev          _m64_mux1_rev
+
+#define ia64_mux1(x,v)         _m_to_int64(_m64_mux1(_m_from_int64(x), (v)))
+#define ia64_popcnt            _m64_popcnt
+#define ia64_getf_exp          __getf_exp
+#define ia64_shrp              _m64_shrp
+
+#define ia64_tpa               __tpa
+#define ia64_invala            __invala
+#define ia64_invala_gr         __invala_gr
+#define ia64_invala_fr         __invala_fr
+#define ia64_nop               __nop
+#define ia64_sum               __sum
+#define ia64_native_ssm                __ssm
+#define ia64_rum               __rum
+#define ia64_native_rsm                __rsm
+#define ia64_native_fc                 __fc
+
+#define ia64_ldfs              __ldfs
+#define ia64_ldfd              __ldfd
+#define ia64_ldfe              __ldfe
+#define ia64_ldf8              __ldf8
+#define ia64_ldf_fill          __ldf_fill
+
+#define ia64_stfs              __stfs
+#define ia64_stfd              __stfd
+#define ia64_stfe              __stfe
+#define ia64_stf8              __stf8
+#define ia64_stf_spill         __stf_spill
+
+#define ia64_mf                        __mf
+#define ia64_mfa               __mfa
+
+#define ia64_fetchadd4_acq     __fetchadd4_acq
+#define ia64_fetchadd4_rel     __fetchadd4_rel
+#define ia64_fetchadd8_acq     __fetchadd8_acq
+#define ia64_fetchadd8_rel     __fetchadd8_rel
+
+#define ia64_xchg1             _InterlockedExchange8
+#define ia64_xchg2             _InterlockedExchange16
+#define ia64_xchg4             _InterlockedExchange
+#define ia64_xchg8             _InterlockedExchange64
+
+#define ia64_cmpxchg1_rel      _InterlockedCompareExchange8_rel
+#define ia64_cmpxchg1_acq      _InterlockedCompareExchange8_acq
+#define ia64_cmpxchg2_rel      _InterlockedCompareExchange16_rel
+#define ia64_cmpxchg2_acq      _InterlockedCompareExchange16_acq
+#define ia64_cmpxchg4_rel      _InterlockedCompareExchange_rel
+#define ia64_cmpxchg4_acq      _InterlockedCompareExchange_acq
+#define ia64_cmpxchg8_rel      _InterlockedCompareExchange64_rel
+#define ia64_cmpxchg8_acq      _InterlockedCompareExchange64_acq
+
+#define __ia64_set_dbr(index, val)     \
+               __setIndReg(_IA64_REG_INDR_DBR, index, val)
+#define ia64_set_ibr(index, val)       \
+               __setIndReg(_IA64_REG_INDR_IBR, index, val)
+#define ia64_set_pkr(index, val)       \
+               __setIndReg(_IA64_REG_INDR_PKR, index, val)
+#define ia64_set_pmc(index, val)       \
+               __setIndReg(_IA64_REG_INDR_PMC, index, val)
+#define ia64_set_pmd(index, val)       \
+               __setIndReg(_IA64_REG_INDR_PMD, index, val)
+#define ia64_native_set_rr(index, val) \
+               __setIndReg(_IA64_REG_INDR_RR, index, val)
+
+#define ia64_native_get_cpuid(index)   \
+               __getIndReg(_IA64_REG_INDR_CPUID, index)
+#define __ia64_get_dbr(index)          __getIndReg(_IA64_REG_INDR_DBR, index)
+#define ia64_get_ibr(index)            __getIndReg(_IA64_REG_INDR_IBR, index)
+#define ia64_get_pkr(index)            __getIndReg(_IA64_REG_INDR_PKR, index)
+#define ia64_get_pmc(index)            __getIndReg(_IA64_REG_INDR_PMC, index)
+#define ia64_native_get_pmd(index)     __getIndReg(_IA64_REG_INDR_PMD, index)
+#define ia64_native_get_rr(index)      __getIndReg(_IA64_REG_INDR_RR, index)
+
+#define ia64_srlz_d            __dsrlz
+#define ia64_srlz_i            __isrlz
+
+#define ia64_dv_serialize_data()
+#define ia64_dv_serialize_instruction()
+
+#define ia64_st1_rel           __st1_rel
+#define ia64_st2_rel           __st2_rel
+#define ia64_st4_rel           __st4_rel
+#define ia64_st8_rel           __st8_rel
+
+/* FIXME: need st4.rel.nta intrinsic */
+#define ia64_st4_rel_nta       __st4_rel
+
+#define ia64_ld1_acq           __ld1_acq
+#define ia64_ld2_acq           __ld2_acq
+#define ia64_ld4_acq           __ld4_acq
+#define ia64_ld8_acq           __ld8_acq
+
+#define ia64_sync_i            __synci
+#define ia64_native_thash      __thash
+#define ia64_native_ttag       __ttag
+#define ia64_itcd              __itcd
+#define ia64_itci              __itci
+#define ia64_itrd              __itrd
+#define ia64_itri              __itri
+#define ia64_ptce              __ptce
+#define ia64_ptcl              __ptcl
+#define ia64_native_ptcg       __ptcg
+#define ia64_native_ptcga      __ptcga
+#define ia64_ptri              __ptri
+#define ia64_ptrd              __ptrd
+#define ia64_dep_mi            _m64_dep_mi
+
+/* Values for lfhint in __lfetch and __lfetch_fault */
+
+#define ia64_lfhint_none       __lfhint_none
+#define ia64_lfhint_nt1                __lfhint_nt1
+#define ia64_lfhint_nt2                __lfhint_nt2
+#define ia64_lfhint_nta                __lfhint_nta
+
+#define ia64_lfetch            __lfetch
+#define ia64_lfetch_excl       __lfetch_excl
+#define ia64_lfetch_fault      __lfetch_fault
+#define ia64_lfetch_fault_excl __lfetch_fault_excl
+
+#define ia64_native_intrin_local_irq_restore(x)                \
+do {                                                   \
+       if ((x) != 0) {                                 \
+               ia64_native_ssm(IA64_PSR_I);            \
+               ia64_srlz_d();                          \
+       } else {                                        \
+               ia64_native_rsm(IA64_PSR_I);            \
+       }                                               \
+} while (0)
+
+#define __builtin_trap()       __break(0);
+
+#endif /* _ASM_IA64_INTEL_INTRIN_H */
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
new file mode 100644 (file)
index 0000000..47d686d
--- /dev/null
@@ -0,0 +1,241 @@
+#ifndef _ASM_IA64_INTRINSICS_H
+#define _ASM_IA64_INTRINSICS_H
+
+/*
+ * Compiler-dependent intrinsics.
+ *
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#ifndef __ASSEMBLY__
+
+/* include compiler specific intrinsics */
+#include <asm/ia64regs.h>
+#ifdef __INTEL_COMPILER
+# include <asm/intel_intrin.h>
+#else
+# include <asm/gcc_intrin.h>
+#endif
+
+#define ia64_native_get_psr_i()        (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I)
+
+#define ia64_native_set_rr0_to_rr4(val0, val1, val2, val3, val4)       \
+do {                                                                   \
+       ia64_native_set_rr(0x0000000000000000UL, (val0));               \
+       ia64_native_set_rr(0x2000000000000000UL, (val1));               \
+       ia64_native_set_rr(0x4000000000000000UL, (val2));               \
+       ia64_native_set_rr(0x6000000000000000UL, (val3));               \
+       ia64_native_set_rr(0x8000000000000000UL, (val4));               \
+} while (0)
+
+/*
+ * Force an unresolved reference if someone tries to use
+ * ia64_fetch_and_add() with a bad value.
+ */
+extern unsigned long __bad_size_for_ia64_fetch_and_add (void);
+extern unsigned long __bad_increment_for_ia64_fetch_and_add (void);
+
+#define IA64_FETCHADD(tmp,v,n,sz,sem)                                          \
+({                                                                             \
+       switch (sz) {                                                           \
+             case 4:                                                           \
+               tmp = ia64_fetchadd4_##sem((unsigned int *) v, n);              \
+               break;                                                          \
+                                                                               \
+             case 8:                                                           \
+               tmp = ia64_fetchadd8_##sem((unsigned long *) v, n);             \
+               break;                                                          \
+                                                                               \
+             default:                                                          \
+               __bad_size_for_ia64_fetch_and_add();                            \
+       }                                                                       \
+})
+
+#define ia64_fetchadd(i,v,sem)                                                         \
+({                                                                                     \
+       __u64 _tmp;                                                                     \
+       volatile __typeof__(*(v)) *_v = (v);                                            \
+       /* Can't use a switch () here: gcc isn't always smart enough for that... */     \
+       if ((i) == -16)                                                                 \
+               IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v)), sem);                        \
+       else if ((i) == -8)                                                             \
+               IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v)), sem);                         \
+       else if ((i) == -4)                                                             \
+               IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v)), sem);                         \
+       else if ((i) == -1)                                                             \
+               IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v)), sem);                         \
+       else if ((i) == 1)                                                              \
+               IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v)), sem);                          \
+       else if ((i) == 4)                                                              \
+               IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v)), sem);                          \
+       else if ((i) == 8)                                                              \
+               IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v)), sem);                          \
+       else if ((i) == 16)                                                             \
+               IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v)), sem);                         \
+       else                                                                            \
+               _tmp = __bad_increment_for_ia64_fetch_and_add();                        \
+       (__typeof__(*(v))) (_tmp);      /* return old value */                          \
+})
+
+#define ia64_fetch_and_add(i,v)        (ia64_fetchadd(i, v, rel) + (i)) /* return new value */
+
+/*
+ * This function doesn't exist, so you'll get a linker error if
+ * something tries to do an invalid xchg().
+ */
+extern void ia64_xchg_called_with_bad_pointer (void);
+
+#define __xchg(x,ptr,size)                                             \
+({                                                                     \
+       unsigned long __xchg_result;                                    \
+                                                                       \
+       switch (size) {                                                 \
+             case 1:                                                   \
+               __xchg_result = ia64_xchg1((__u8 *)ptr, x);             \
+               break;                                                  \
+                                                                       \
+             case 2:                                                   \
+               __xchg_result = ia64_xchg2((__u16 *)ptr, x);            \
+               break;                                                  \
+                                                                       \
+             case 4:                                                   \
+               __xchg_result = ia64_xchg4((__u32 *)ptr, x);            \
+               break;                                                  \
+                                                                       \
+             case 8:                                                   \
+               __xchg_result = ia64_xchg8((__u64 *)ptr, x);            \
+               break;                                                  \
+             default:                                                  \
+               ia64_xchg_called_with_bad_pointer();                    \
+       }                                                               \
+       __xchg_result;                                                  \
+})
+
+#define xchg(ptr,x)                                                         \
+  ((__typeof__(*(ptr))) __xchg ((unsigned long) (x), (ptr), 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.
+ */
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+/*
+ * This function doesn't exist, so you'll get a linker error
+ * if something tries to do an invalid cmpxchg().
+ */
+extern long ia64_cmpxchg_called_with_bad_pointer (void);
+
+#define ia64_cmpxchg(sem,ptr,old,new,size)                                             \
+({                                                                                     \
+       __u64 _o_, _r_;                                                                 \
+                                                                                       \
+       switch (size) {                                                                 \
+             case 1: _o_ = (__u8 ) (long) (old); break;                                \
+             case 2: _o_ = (__u16) (long) (old); break;                                \
+             case 4: _o_ = (__u32) (long) (old); break;                                \
+             case 8: _o_ = (__u64) (long) (old); break;                                \
+             default: break;                                                           \
+       }                                                                               \
+       switch (size) {                                                                 \
+             case 1:                                                                   \
+               _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_);                      \
+               break;                                                                  \
+                                                                                       \
+             case 2:                                                                   \
+              _r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_);                      \
+               break;                                                                  \
+                                                                                       \
+             case 4:                                                                   \
+               _r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_);                     \
+               break;                                                                  \
+                                                                                       \
+             case 8:                                                                   \
+               _r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_);                     \
+               break;                                                                  \
+                                                                                       \
+             default:                                                                  \
+               _r_ = ia64_cmpxchg_called_with_bad_pointer();                           \
+               break;                                                                  \
+       }                                                                               \
+       (__typeof__(old)) _r_;                                                          \
+})
+
+#define cmpxchg_acq(ptr, o, n) \
+       ia64_cmpxchg(acq, (ptr), (o), (n), sizeof(*(ptr)))
+#define cmpxchg_rel(ptr, o, n) \
+       ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr)))
+
+/* for compatibility with other platforms: */
+#define cmpxchg(ptr, o, n)     cmpxchg_acq((ptr), (o), (n))
+#define cmpxchg64(ptr, o, n)   cmpxchg_acq((ptr), (o), (n))
+
+#define cmpxchg_local          cmpxchg
+#define cmpxchg64_local                cmpxchg64
+
+#ifdef CONFIG_IA64_DEBUG_CMPXCHG
+# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128;
+# define CMPXCHG_BUGCHECK(v)                                                   \
+  do {                                                                         \
+       if (_cmpxchg_bugcheck_count-- <= 0) {                                   \
+               void *ip;                                                       \
+               extern int printk(const char *fmt, ...);                        \
+               ip = (void *) ia64_getreg(_IA64_REG_IP);                        \
+               printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));  \
+               break;                                                          \
+       }                                                                       \
+  } while (0)
+#else /* !CONFIG_IA64_DEBUG_CMPXCHG */
+# define CMPXCHG_BUGCHECK_DECL
+# define CMPXCHG_BUGCHECK(v)
+#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */
+
+#endif
+
+#ifdef __KERNEL__
+#include <asm/paravirt_privop.h>
+#endif
+
+#ifndef __ASSEMBLY__
+#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__)
+#define IA64_INTRINSIC_API(name)       pv_cpu_ops.name
+#define IA64_INTRINSIC_MACRO(name)     paravirt_ ## name
+#else
+#define IA64_INTRINSIC_API(name)       ia64_native_ ## name
+#define IA64_INTRINSIC_MACRO(name)     ia64_native_ ## name
+#endif
+
+/************************************************/
+/* Instructions paravirtualized for correctness */
+/************************************************/
+/* fc, thash, get_cpuid, get_pmd, get_eflags, set_eflags */
+/* Note that "ttag" and "cover" are also privilege-sensitive; "ttag"
+ * is not currently used (though it may be in a long-format VHPT system!)
+ */
+#define ia64_fc                                IA64_INTRINSIC_API(fc)
+#define ia64_thash                     IA64_INTRINSIC_API(thash)
+#define ia64_get_cpuid                 IA64_INTRINSIC_API(get_cpuid)
+#define ia64_get_pmd                   IA64_INTRINSIC_API(get_pmd)
+
+
+/************************************************/
+/* Instructions paravirtualized for performance */
+/************************************************/
+#define ia64_ssm                       IA64_INTRINSIC_MACRO(ssm)
+#define ia64_rsm                       IA64_INTRINSIC_MACRO(rsm)
+#define ia64_getreg                    IA64_INTRINSIC_API(getreg)
+#define ia64_setreg                    IA64_INTRINSIC_API(setreg)
+#define ia64_set_rr                    IA64_INTRINSIC_API(set_rr)
+#define ia64_get_rr                    IA64_INTRINSIC_API(get_rr)
+#define ia64_ptcga                     IA64_INTRINSIC_API(ptcga)
+#define ia64_get_psr_i                 IA64_INTRINSIC_API(get_psr_i)
+#define ia64_intrin_local_irq_restore  \
+       IA64_INTRINSIC_API(intrin_local_irq_restore)
+#define ia64_set_rr0_to_rr4            IA64_INTRINSIC_API(set_rr0_to_rr4)
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_INTRINSICS_H */
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
new file mode 100644 (file)
index 0000000..260a85a
--- /dev/null
@@ -0,0 +1,459 @@
+#ifndef _ASM_IA64_IO_H
+#define _ASM_IA64_IO_H
+
+/*
+ * This file contains the definitions for the emulated IO instructions
+ * inb/inw/inl/outb/outw/outl and the "string versions" of the same
+ * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
+ * versions of the single-IO instructions (inb_p/inw_p/..).
+ *
+ * This file is not meant to be obfuscating: it's just complicated to
+ * (a) handle it all in a way that makes gcc able to optimize it as
+ * well as possible and (b) trying to avoid writing the same thing
+ * over and over again with slight variations and possibly making a
+ * mistake somewhere.
+ *
+ * Copyright (C) 1998-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
+ */
+
+/* We don't use IO slowdowns on the ia64, but.. */
+#define __SLOW_DOWN_IO do { } while (0)
+#define SLOW_DOWN_IO   do { } while (0)
+
+#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)
+
+/*
+ * The legacy I/O space defined by the ia64 architecture supports only 65536 ports, but
+ * large machines may have multiple other I/O spaces so we can't place any a priori limit
+ * on IO_SPACE_LIMIT.  These additional spaces are described in ACPI.
+ */
+#define IO_SPACE_LIMIT         0xffffffffffffffffUL
+
+#define MAX_IO_SPACES_BITS             8
+#define MAX_IO_SPACES                  (1UL << MAX_IO_SPACES_BITS)
+#define IO_SPACE_BITS                  24
+#define IO_SPACE_SIZE                  (1UL << IO_SPACE_BITS)
+
+#define IO_SPACE_NR(port)              ((port) >> IO_SPACE_BITS)
+#define IO_SPACE_BASE(space)           ((space) << IO_SPACE_BITS)
+#define IO_SPACE_PORT(port)            ((port) & (IO_SPACE_SIZE - 1))
+
+#define IO_SPACE_SPARSE_ENCODING(p)    ((((p) >> 2) << 12) | ((p) & 0xfff))
+
+struct io_space {
+       unsigned long mmio_base;        /* base in MMIO space */
+       int sparse;
+};
+
+extern struct io_space io_space[];
+extern unsigned int num_io_spaces;
+
+# ifdef __KERNEL__
+
+/*
+ * All MMIO iomem cookies are in region 6; anything less is a PIO cookie:
+ *     0xCxxxxxxxxxxxxxxx      MMIO cookie (return from ioremap)
+ *     0x000000001SPPPPPP      PIO cookie (S=space number, P..P=port)
+ *
+ * ioread/writeX() uses the leading 1 in PIO cookies (PIO_OFFSET) to catch
+ * code that uses bare port numbers without the prerequisite pci_iomap().
+ */
+#define PIO_OFFSET             (1UL << (MAX_IO_SPACES_BITS + IO_SPACE_BITS))
+#define PIO_MASK               (PIO_OFFSET - 1)
+#define PIO_RESERVED           __IA64_UNCACHED_OFFSET
+#define HAVE_ARCH_PIO_SIZE
+
+#include <asm/intrinsics.h>
+#include <asm/machvec.h>
+#include <asm/page.h>
+#include <asm/system.h>
+#include <asm-generic/iomap.h>
+
+/*
+ * Change virtual addresses to physical addresses and vv.
+ */
+static inline unsigned long
+virt_to_phys (volatile void *address)
+{
+       return (unsigned long) address - PAGE_OFFSET;
+}
+
+static inline void*
+phys_to_virt (unsigned long address)
+{
+       return (void *) (address + PAGE_OFFSET);
+}
+
+#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
+extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */
+extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
+
+/*
+ * The following two macros are deprecated and scheduled for removal.
+ * Please use the PCI-DMA interface defined in <asm/pci.h> instead.
+ */
+#define bus_to_virt    phys_to_virt
+#define virt_to_bus    virt_to_phys
+#define page_to_bus    page_to_phys
+
+# endif /* KERNEL */
+
+/*
+ * Memory fence w/accept.  This should never be used in code that is
+ * not IA-64 specific.
+ */
+#define __ia64_mf_a()  ia64_mfa()
+
+/**
+ * ___ia64_mmiowb - I/O write barrier
+ *
+ * Ensure ordering of I/O space writes.  This will make sure that writes
+ * following the barrier will arrive after all previous writes.  For most
+ * ia64 platforms, this is a simple 'mf.a' instruction.
+ *
+ * See Documentation/DocBook/deviceiobook.tmpl for more information.
+ */
+static inline void ___ia64_mmiowb(void)
+{
+       ia64_mfa();
+}
+
+static inline void*
+__ia64_mk_io_addr (unsigned long port)
+{
+       struct io_space *space;
+       unsigned long offset;
+
+       space = &io_space[IO_SPACE_NR(port)];
+       port = IO_SPACE_PORT(port);
+       if (space->sparse)
+               offset = IO_SPACE_SPARSE_ENCODING(port);
+       else
+               offset = port;
+
+       return (void *) (space->mmio_base | offset);
+}
+
+#define __ia64_inb     ___ia64_inb
+#define __ia64_inw     ___ia64_inw
+#define __ia64_inl     ___ia64_inl
+#define __ia64_outb    ___ia64_outb
+#define __ia64_outw    ___ia64_outw
+#define __ia64_outl    ___ia64_outl
+#define __ia64_readb   ___ia64_readb
+#define __ia64_readw   ___ia64_readw
+#define __ia64_readl   ___ia64_readl
+#define __ia64_readq   ___ia64_readq
+#define __ia64_readb_relaxed   ___ia64_readb
+#define __ia64_readw_relaxed   ___ia64_readw
+#define __ia64_readl_relaxed   ___ia64_readl
+#define __ia64_readq_relaxed   ___ia64_readq
+#define __ia64_writeb  ___ia64_writeb
+#define __ia64_writew  ___ia64_writew
+#define __ia64_writel  ___ia64_writel
+#define __ia64_writeq  ___ia64_writeq
+#define __ia64_mmiowb  ___ia64_mmiowb
+
+/*
+ * For the in/out routines, we need to do "mf.a" _after_ doing the I/O access to ensure
+ * that the access has completed before executing other I/O accesses.  Since we're doing
+ * the accesses through an uncachable (UC) translation, the CPU will execute them in
+ * program order.  However, we still need to tell the compiler not to shuffle them around
+ * during optimization, which is why we use "volatile" pointers.
+ */
+
+static inline unsigned int
+___ia64_inb (unsigned long port)
+{
+       volatile unsigned char *addr = __ia64_mk_io_addr(port);
+       unsigned char ret;
+
+       ret = *addr;
+       __ia64_mf_a();
+       return ret;
+}
+
+static inline unsigned int
+___ia64_inw (unsigned long port)
+{
+       volatile unsigned short *addr = __ia64_mk_io_addr(port);
+       unsigned short ret;
+
+       ret = *addr;
+       __ia64_mf_a();
+       return ret;
+}
+
+static inline unsigned int
+___ia64_inl (unsigned long port)
+{
+       volatile unsigned int *addr = __ia64_mk_io_addr(port);
+       unsigned int ret;
+
+       ret = *addr;
+       __ia64_mf_a();
+       return ret;
+}
+
+static inline void
+___ia64_outb (unsigned char val, unsigned long port)
+{
+       volatile unsigned char *addr = __ia64_mk_io_addr(port);
+
+       *addr = val;
+       __ia64_mf_a();
+}
+
+static inline void
+___ia64_outw (unsigned short val, unsigned long port)
+{
+       volatile unsigned short *addr = __ia64_mk_io_addr(port);
+
+       *addr = val;
+       __ia64_mf_a();
+}
+
+static inline void
+___ia64_outl (unsigned int val, unsigned long port)
+{
+       volatile unsigned int *addr = __ia64_mk_io_addr(port);
+
+       *addr = val;
+       __ia64_mf_a();
+}
+
+static inline void
+__insb (unsigned long port, void *dst, unsigned long count)
+{
+       unsigned char *dp = dst;
+
+       while (count--)
+               *dp++ = platform_inb(port);
+}
+
+static inline void
+__insw (unsigned long port, void *dst, unsigned long count)
+{
+       unsigned short *dp = dst;
+
+       while (count--)
+               *dp++ = platform_inw(port);
+}
+
+static inline void
+__insl (unsigned long port, void *dst, unsigned long count)
+{
+       unsigned int *dp = dst;
+
+       while (count--)
+               *dp++ = platform_inl(port);
+}
+
+static inline void
+__outsb (unsigned long port, const void *src, unsigned long count)
+{
+       const unsigned char *sp = src;
+
+       while (count--)
+               platform_outb(*sp++, port);
+}
+
+static inline void
+__outsw (unsigned long port, const void *src, unsigned long count)
+{
+       const unsigned short *sp = src;
+
+       while (count--)
+               platform_outw(*sp++, port);
+}
+
+static inline void
+__outsl (unsigned long port, const void *src, unsigned long count)
+{
+       const unsigned int *sp = src;
+
+       while (count--)
+               platform_outl(*sp++, port);
+}
+
+/*
+ * Unfortunately, some platforms are broken and do not follow the IA-64 architecture
+ * specification regarding legacy I/O support.  Thus, we have to make these operations
+ * platform dependent...
+ */
+#define __inb          platform_inb
+#define __inw          platform_inw
+#define __inl          platform_inl
+#define __outb         platform_outb
+#define __outw         platform_outw
+#define __outl         platform_outl
+#define __mmiowb       platform_mmiowb
+
+#define inb(p)         __inb(p)
+#define inw(p)         __inw(p)
+#define inl(p)         __inl(p)
+#define insb(p,d,c)    __insb(p,d,c)
+#define insw(p,d,c)    __insw(p,d,c)
+#define insl(p,d,c)    __insl(p,d,c)
+#define outb(v,p)      __outb(v,p)
+#define outw(v,p)      __outw(v,p)
+#define outl(v,p)      __outl(v,p)
+#define outsb(p,s,c)   __outsb(p,s,c)
+#define outsw(p,s,c)   __outsw(p,s,c)
+#define outsl(p,s,c)   __outsl(p,s,c)
+#define mmiowb()       __mmiowb()
+
+/*
+ * The address passed to these functions are ioremap()ped already.
+ *
+ * We need these to be machine vectors since some platforms don't provide
+ * DMA coherence via PIO reads (PCI drivers and the spec imply that this is
+ * a good idea).  Writes are ok though for all existing ia64 platforms (and
+ * hopefully it'll stay that way).
+ */
+static inline unsigned char
+___ia64_readb (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned char __force *)addr;
+}
+
+static inline unsigned short
+___ia64_readw (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned short __force *)addr;
+}
+
+static inline unsigned int
+___ia64_readl (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned int __force *) addr;
+}
+
+static inline unsigned long
+___ia64_readq (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned long __force *) addr;
+}
+
+static inline void
+__writeb (unsigned char val, volatile void __iomem *addr)
+{
+       *(volatile unsigned char __force *) addr = val;
+}
+
+static inline void
+__writew (unsigned short val, volatile void __iomem *addr)
+{
+       *(volatile unsigned short __force *) addr = val;
+}
+
+static inline void
+__writel (unsigned int val, volatile void __iomem *addr)
+{
+       *(volatile unsigned int __force *) addr = val;
+}
+
+static inline void
+__writeq (unsigned long val, volatile void __iomem *addr)
+{
+       *(volatile unsigned long __force *) addr = val;
+}
+
+#define __readb                platform_readb
+#define __readw                platform_readw
+#define __readl                platform_readl
+#define __readq                platform_readq
+#define __readb_relaxed        platform_readb_relaxed
+#define __readw_relaxed        platform_readw_relaxed
+#define __readl_relaxed        platform_readl_relaxed
+#define __readq_relaxed        platform_readq_relaxed
+
+#define readb(a)       __readb((a))
+#define readw(a)       __readw((a))
+#define readl(a)       __readl((a))
+#define readq(a)       __readq((a))
+#define readb_relaxed(a)       __readb_relaxed((a))
+#define readw_relaxed(a)       __readw_relaxed((a))
+#define readl_relaxed(a)       __readl_relaxed((a))
+#define readq_relaxed(a)       __readq_relaxed((a))
+#define __raw_readb    readb
+#define __raw_readw    readw
+#define __raw_readl    readl
+#define __raw_readq    readq
+#define __raw_readb_relaxed    readb_relaxed
+#define __raw_readw_relaxed    readw_relaxed
+#define __raw_readl_relaxed    readl_relaxed
+#define __raw_readq_relaxed    readq_relaxed
+#define writeb(v,a)    __writeb((v), (a))
+#define writew(v,a)    __writew((v), (a))
+#define writel(v,a)    __writel((v), (a))
+#define writeq(v,a)    __writeq((v), (a))
+#define __raw_writeb   writeb
+#define __raw_writew   writew
+#define __raw_writel   writel
+#define __raw_writeq   writeq
+
+#ifndef inb_p
+# define inb_p         inb
+#endif
+#ifndef inw_p
+# define inw_p         inw
+#endif
+#ifndef inl_p
+# define inl_p         inl
+#endif
+
+#ifndef outb_p
+# define outb_p                outb
+#endif
+#ifndef outw_p
+# define outw_p                outw
+#endif
+#ifndef outl_p
+# define outl_p                outl
+#endif
+
+# ifdef __KERNEL__
+
+extern void __iomem * ioremap(unsigned long offset, unsigned long size);
+extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
+extern void iounmap (volatile void __iomem *addr);
+
+/*
+ * String version of IO memory access ops:
+ */
+extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n);
+extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
+extern void memset_io(volatile void __iomem *s, int c, long n);
+
+# endif /* __KERNEL__ */
+
+/*
+ * Enabling BIO_VMERGE_BOUNDARY forces us to turn off I/O MMU bypassing.  It is said that
+ * BIO-level virtual merging can give up to 4% performance boost (not verified for ia64).
+ * On the other hand, we know that I/O MMU bypassing gives ~8% performance improvement on
+ * SPECweb-like workloads on zx1-based machines.  Thus, for now we favor I/O MMU bypassing
+ * over BIO-level virtual merging.
+ */
+extern unsigned long ia64_max_iommu_merge_mask;
+#if 1
+#define BIO_VMERGE_BOUNDARY    0
+#else
+/*
+ * It makes no sense at all to have this BIO_VMERGE_BOUNDARY macro here.  Should be
+ * replaced by dma_merge_mask() or something of that sort.  Note: the only way
+ * BIO_VMERGE_BOUNDARY is used is to mask off bits.  Effectively, our definition gets
+ * expanded into:
+ *
+ *     addr & ((ia64_max_iommu_merge_mask + 1) - 1) == (addr & ia64_max_iommu_vmerge_mask)
+ *
+ * which is precisely what we want.
+ */
+#define BIO_VMERGE_BOUNDARY    (ia64_max_iommu_merge_mask + 1)
+#endif
+
+#endif /* _ASM_IA64_IO_H */
diff --git a/arch/ia64/include/asm/ioctl.h b/arch/ia64/include/asm/ioctl.h
new file mode 100644 (file)
index 0000000..b279fe0
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/ioctl.h>
diff --git a/arch/ia64/include/asm/ioctls.h b/arch/ia64/include/asm/ioctls.h
new file mode 100644 (file)
index 0000000..f41b636
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef _ASM_IA64_IOCTLS_H
+#define _ASM_IA64_IOCTLS_H
+
+/*
+ * Based on <asm-i386/ioctls.h>
+ *
+ * Modified 1998, 1999, 2002
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <asm/ioctl.h>
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define TCGETS         0x5401
+#define TCSETS         0x5402  /* Clashes with SNDCTL_TMR_START sound ioctl */
+#define TCSETSW                0x5403
+#define TCSETSF                0x5404
+#define TCGETA         0x5405
+#define TCSETA         0x5406
+#define TCSETAW                0x5407
+#define TCSETAF                0x5408
+#define TCSBRK         0x5409
+#define TCXONC         0x540A
+#define TCFLSH         0x540B
+#define TIOCEXCL       0x540C
+#define TIOCNXCL       0x540D
+#define TIOCSCTTY      0x540E
+#define TIOCGPGRP      0x540F
+#define TIOCSPGRP      0x5410
+#define TIOCOUTQ       0x5411
+#define TIOCSTI                0x5412
+#define TIOCGWINSZ     0x5413
+#define TIOCSWINSZ     0x5414
+#define TIOCMGET       0x5415
+#define TIOCMBIS       0x5416
+#define TIOCMBIC       0x5417
+#define TIOCMSET       0x5418
+#define TIOCGSOFTCAR   0x5419
+#define TIOCSSOFTCAR   0x541A
+#define FIONREAD       0x541B
+#define TIOCINQ                FIONREAD
+#define TIOCLINUX      0x541C
+#define TIOCCONS       0x541D
+#define TIOCGSERIAL    0x541E
+#define TIOCSSERIAL    0x541F
+#define TIOCPKT                0x5420
+#define FIONBIO                0x5421
+#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 TCGETS2                _IOR('T',0x2A, struct termios2)
+#define TCSETS2                _IOW('T',0x2B, struct termios2)
+#define TCSETSW2       _IOW('T',0x2C, struct termios2)
+#define TCSETSF2       _IOW('T',0x2D, struct termios2)
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+
+#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
+#define FIOCLEX                0x5451
+#define FIOASYNC       0x5452
+#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 */
+#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 */
+#define FIOQSIZE       0x5460
+
+/* Used for packet mode */
+#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 TIOCSER_TEMT    0x01   /* Transmitter physically empty */
+
+#endif /* _ASM_IA64_IOCTLS_H */
diff --git a/arch/ia64/include/asm/iosapic.h b/arch/ia64/include/asm/iosapic.h
new file mode 100644 (file)
index 0000000..b9c102e
--- /dev/null
@@ -0,0 +1,126 @@
+#ifndef __ASM_IA64_IOSAPIC_H
+#define __ASM_IA64_IOSAPIC_H
+
+#define        IOSAPIC_REG_SELECT      0x0
+#define        IOSAPIC_WINDOW          0x10
+#define        IOSAPIC_EOI             0x40
+
+#define        IOSAPIC_VERSION         0x1
+
+/*
+ * Redirection table entry
+ */
+#define        IOSAPIC_RTE_LOW(i)      (0x10+i*2)
+#define        IOSAPIC_RTE_HIGH(i)     (0x11+i*2)
+
+#define        IOSAPIC_DEST_SHIFT              16
+
+/*
+ * Delivery mode
+ */
+#define        IOSAPIC_DELIVERY_SHIFT          8
+#define        IOSAPIC_FIXED                   0x0
+#define        IOSAPIC_LOWEST_PRIORITY 0x1
+#define        IOSAPIC_PMI                     0x2
+#define        IOSAPIC_NMI                     0x4
+#define        IOSAPIC_INIT                    0x5
+#define        IOSAPIC_EXTINT                  0x7
+
+/*
+ * Interrupt polarity
+ */
+#define        IOSAPIC_POLARITY_SHIFT          13
+#define        IOSAPIC_POL_HIGH                0
+#define        IOSAPIC_POL_LOW         1
+
+/*
+ * Trigger mode
+ */
+#define        IOSAPIC_TRIGGER_SHIFT           15
+#define        IOSAPIC_EDGE                    0
+#define        IOSAPIC_LEVEL                   1
+
+/*
+ * Mask bit
+ */
+
+#define        IOSAPIC_MASK_SHIFT              16
+#define        IOSAPIC_MASK                    (1<<IOSAPIC_MASK_SHIFT)
+
+#define IOSAPIC_VECTOR_MASK            0xffffff00
+
+#ifndef __ASSEMBLY__
+
+#ifdef CONFIG_IOSAPIC
+
+#define NR_IOSAPICS                    256
+
+#ifdef CONFIG_PARAVIRT_GUEST
+#include <asm/paravirt.h>
+#else
+#define iosapic_pcat_compat_init       ia64_native_iosapic_pcat_compat_init
+#define __iosapic_read                 __ia64_native_iosapic_read
+#define __iosapic_write                        __ia64_native_iosapic_write
+#define iosapic_get_irq_chip           ia64_native_iosapic_get_irq_chip
+#endif
+
+extern void __init ia64_native_iosapic_pcat_compat_init(void);
+extern struct irq_chip *ia64_native_iosapic_get_irq_chip(unsigned long trigger);
+
+static inline unsigned int
+__ia64_native_iosapic_read(char __iomem *iosapic, unsigned int reg)
+{
+       writel(reg, iosapic + IOSAPIC_REG_SELECT);
+       return readl(iosapic + IOSAPIC_WINDOW);
+}
+
+static inline void
+__ia64_native_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
+{
+       writel(reg, iosapic + IOSAPIC_REG_SELECT);
+       writel(val, iosapic + IOSAPIC_WINDOW);
+}
+
+static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
+{
+       writel(vector, iosapic + IOSAPIC_EOI);
+}
+
+extern void __init iosapic_system_init (int pcat_compat);
+extern int __devinit iosapic_init (unsigned long address,
+                                   unsigned int gsi_base);
+#ifdef CONFIG_HOTPLUG
+extern int iosapic_remove (unsigned int gsi_base);
+#else
+#define iosapic_remove(gsi_base)                               (-EINVAL)
+#endif /* CONFIG_HOTPLUG */
+extern int gsi_to_irq (unsigned int gsi);
+extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
+                                 unsigned long trigger);
+extern void iosapic_unregister_intr (unsigned int irq);
+extern void __devinit iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
+                                     unsigned long polarity,
+                                     unsigned long trigger);
+extern int __init iosapic_register_platform_intr (u32 int_type,
+                                          unsigned int gsi,
+                                          int pmi_vector,
+                                          u16 eid, u16 id,
+                                          unsigned long polarity,
+                                          unsigned long trigger);
+
+#ifdef CONFIG_NUMA
+extern void __devinit map_iosapic_to_node (unsigned int, int);
+#endif
+#else
+#define iosapic_system_init(pcat_compat)                       do { } while (0)
+#define iosapic_init(address,gsi_base)                         (-EINVAL)
+#define iosapic_remove(gsi_base)                               (-ENODEV)
+#define iosapic_register_intr(gsi,polarity,trigger)            (gsi)
+#define iosapic_unregister_intr(irq)                           do { } while (0)
+#define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0)
+#define iosapic_register_platform_intr(type,gsi,pmi,eid,id, \
+       polarity,trigger)                                       (gsi)
+#endif
+
+# endif /* !__ASSEMBLY__ */
+#endif /* __ASM_IA64_IOSAPIC_H */
diff --git a/arch/ia64/include/asm/ipcbuf.h b/arch/ia64/include/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..079899a
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _ASM_IA64_IPCBUF_H
+#define _ASM_IA64_IPCBUF_H
+
+/*
+ * The ipc64_perm structure for IA-64 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 /* _ASM_IA64_IPCBUF_H */
diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h
new file mode 100644 (file)
index 0000000..3627116
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _ASM_IA64_IRQ_H
+#define _ASM_IA64_IRQ_H
+
+/*
+ * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *     Stephane Eranian <eranian@hpl.hp.com>
+ *
+ * 11/24/98    S.Eranian       updated TIMER_IRQ and irq_canonicalize
+ * 01/20/99    S.Eranian       added keyboard interrupt
+ * 02/29/00     D.Mosberger    moved most things into hw_irq.h
+ */
+
+#include <linux/types.h>
+#include <linux/cpumask.h>
+#include <asm-ia64/nr-irqs.h>
+
+static __inline__ int
+irq_canonicalize (int irq)
+{
+       /*
+        * We do the legacy thing here of pretending that irqs < 16
+        * are 8259 irqs.  This really shouldn't be necessary at all,
+        * but we keep it here as serial.c still uses it...
+        */
+       return ((irq == 2) ? 9 : irq);
+}
+
+extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
+bool is_affinity_mask_valid(cpumask_t cpumask);
+
+#define is_affinity_mask_valid is_affinity_mask_valid
+
+#endif /* _ASM_IA64_IRQ_H */
diff --git a/arch/ia64/include/asm/irq_regs.h b/arch/ia64/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/ia64/include/asm/kdebug.h b/arch/ia64/include/asm/kdebug.h
new file mode 100644 (file)
index 0000000..d11a698
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef _IA64_KDEBUG_H
+#define _IA64_KDEBUG_H 1
+/*
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) Intel Corporation, 2005
+ *
+ * 2005-Apr     Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
+ *              <anil.s.keshavamurthy@intel.com> adopted from
+ *              include/asm-x86_64/kdebug.h
+ *
+ * 2005-Oct    Keith Owens <kaos@sgi.com>.  Expand notify_die to cover more
+ *             events.
+ */
+
+enum die_val {
+       DIE_BREAK = 1,
+       DIE_FAULT,
+       DIE_OOPS,
+       DIE_MACHINE_HALT,
+       DIE_MACHINE_RESTART,
+       DIE_MCA_MONARCH_ENTER,
+       DIE_MCA_MONARCH_PROCESS,
+       DIE_MCA_MONARCH_LEAVE,
+       DIE_MCA_SLAVE_ENTER,
+       DIE_MCA_SLAVE_PROCESS,
+       DIE_MCA_SLAVE_LEAVE,
+       DIE_MCA_RENDZVOUS_ENTER,
+       DIE_MCA_RENDZVOUS_PROCESS,
+       DIE_MCA_RENDZVOUS_LEAVE,
+       DIE_MCA_NEW_TIMEOUT,
+       DIE_INIT_ENTER,
+       DIE_INIT_MONARCH_ENTER,
+       DIE_INIT_MONARCH_PROCESS,
+       DIE_INIT_MONARCH_LEAVE,
+       DIE_INIT_SLAVE_ENTER,
+       DIE_INIT_SLAVE_PROCESS,
+       DIE_INIT_SLAVE_LEAVE,
+       DIE_KDEBUG_ENTER,
+       DIE_KDEBUG_LEAVE,
+       DIE_KDUMP_ENTER,
+       DIE_KDUMP_LEAVE,
+};
+
+#endif
diff --git a/arch/ia64/include/asm/kexec.h b/arch/ia64/include/asm/kexec.h
new file mode 100644 (file)
index 0000000..541be83
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _ASM_IA64_KEXEC_H
+#define _ASM_IA64_KEXEC_H
+
+
+/* Maximum physical address we can use pages from */
+#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
+/* Maximum address we can reach in physical address mode */
+#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
+/* 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)
+
+/* The native architecture */
+#define KEXEC_ARCH KEXEC_ARCH_IA_64
+
+#define kexec_flush_icache_page(page) do { \
+                unsigned long page_addr = (unsigned long)page_address(page); \
+                flush_icache_range(page_addr, page_addr + PAGE_SIZE); \
+        } while(0)
+
+extern struct kimage *ia64_kimage;
+extern const unsigned int relocate_new_kernel_size;
+extern void relocate_new_kernel(unsigned long, unsigned long,
+               struct ia64_boot_param *, unsigned long);
+static inline void
+crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs)
+{
+}
+extern struct resource efi_memmap_res;
+extern struct resource boot_param_res;
+extern void kdump_smp_send_stop(void);
+extern void kdump_smp_send_init(void);
+extern void kexec_disable_iosapic(void);
+extern void crash_save_this_cpu(void);
+struct rsvd_region;
+extern unsigned long kdump_find_rsvd_region(unsigned long size,
+               struct rsvd_region *rsvd_regions, int n);
+extern void kdump_cpu_freeze(struct unw_frame_info *info, void *arg);
+extern int kdump_status[];
+extern atomic_t kdump_cpu_freezed;
+extern atomic_t kdump_in_progress;
+
+#endif /* _ASM_IA64_KEXEC_H */
diff --git a/arch/ia64/include/asm/kmap_types.h b/arch/ia64/include/asm/kmap_types.h
new file mode 100644 (file)
index 0000000..5d1658a
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _ASM_IA64_KMAP_TYPES_H
+#define _ASM_IA64_KMAP_TYPES_H
+
+
+#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 /* _ASM_IA64_KMAP_TYPES_H */
diff --git a/arch/ia64/include/asm/kprobes.h b/arch/ia64/include/asm/kprobes.h
new file mode 100644 (file)
index 0000000..dbf83fb
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef _ASM_KPROBES_H
+#define _ASM_KPROBES_H
+/*
+ *  Kernel Probes (KProbes)
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) IBM Corporation, 2002, 2004
+ * Copyright (C) Intel Corporation, 2005
+ *
+ * 2005-Apr     Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
+ *              <anil.s.keshavamurthy@intel.com> adapted from i386
+ */
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/percpu.h>
+#include <asm/break.h>
+
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+#define MAX_INSN_SIZE   2      /* last half is for kprobe-booster */
+#define BREAK_INST     (long)(__IA64_BREAK_KPROBE << 6)
+#define NOP_M_INST     (long)(1<<27)
+#define BRL_INST(i1, i2) ((long)((0xcL << 37) |        /* brl */ \
+                               (0x1L << 12) |  /* many */ \
+                               (((i1) & 1) << 36) | ((i2) << 13))) /* imm */
+
+typedef union cmp_inst {
+       struct {
+       unsigned long long qp : 6;
+       unsigned long long p1 : 6;
+       unsigned long long c  : 1;
+       unsigned long long r2 : 7;
+       unsigned long long r3 : 7;
+       unsigned long long p2 : 6;
+       unsigned long long ta : 1;
+       unsigned long long x2 : 2;
+       unsigned long long tb : 1;
+       unsigned long long opcode : 4;
+       unsigned long long reserved : 23;
+       }f;
+       unsigned long long l;
+} cmp_inst_t;
+
+struct kprobe;
+
+typedef struct _bundle {
+       struct {
+               unsigned long long template : 5;
+               unsigned long long slot0 : 41;
+               unsigned long long slot1_p0 : 64-46;
+       } quad0;
+       struct {
+               unsigned long long slot1_p1 : 41 - (64-46);
+               unsigned long long slot2 : 41;
+       } quad1;
+} __attribute__((__aligned__(16)))  bundle_t;
+
+struct prev_kprobe {
+       struct kprobe *kp;
+       unsigned long status;
+};
+
+#define        MAX_PARAM_RSE_SIZE      (0x60+0x60/0x3f)
+/* per-cpu kprobe control block */
+#define ARCH_PREV_KPROBE_SZ 2
+struct kprobe_ctlblk {
+       unsigned long kprobe_status;
+       struct pt_regs jprobe_saved_regs;
+       unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
+       unsigned long *bsp;
+       unsigned long cfm;
+       atomic_t prev_kprobe_index;
+       struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
+};
+
+#define kretprobe_blacklist_size 0
+
+#define SLOT0_OPCODE_SHIFT     (37)
+#define SLOT1_p1_OPCODE_SHIFT  (37 - (64-46))
+#define SLOT2_OPCODE_SHIFT     (37)
+
+#define INDIRECT_CALL_OPCODE           (1)
+#define IP_RELATIVE_CALL_OPCODE                (5)
+#define IP_RELATIVE_BRANCH_OPCODE      (4)
+#define IP_RELATIVE_PREDICT_OPCODE     (7)
+#define LONG_BRANCH_OPCODE             (0xC)
+#define LONG_CALL_OPCODE               (0xD)
+#define flush_insn_slot(p)             do { } while (0)
+
+typedef struct kprobe_opcode {
+       bundle_t bundle;
+} kprobe_opcode_t;
+
+struct fnptr {
+       unsigned long ip;
+       unsigned long gp;
+};
+
+/* Architecture specific copy of original instruction*/
+struct arch_specific_insn {
+       /* copy of the instruction to be emulated */
+       kprobe_opcode_t *insn;
+ #define INST_FLAG_FIX_RELATIVE_IP_ADDR                1
+ #define INST_FLAG_FIX_BRANCH_REG              2
+ #define INST_FLAG_BREAK_INST                  4
+ #define INST_FLAG_BOOSTABLE                   8
+       unsigned long inst_flag;
+       unsigned short target_br_reg;
+       unsigned short slot;
+};
+
+extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
+extern int kprobe_exceptions_notify(struct notifier_block *self,
+                                   unsigned long val, void *data);
+
+extern void invalidate_stacked_regs(void);
+extern void flush_register_stack(void);
+extern void arch_remove_kprobe(struct kprobe *p);
+
+#endif                         /* _ASM_KPROBES_H */
diff --git a/arch/ia64/include/asm/kregs.h b/arch/ia64/include/asm/kregs.h
new file mode 100644 (file)
index 0000000..aefcdfe
--- /dev/null
@@ -0,0 +1,165 @@
+#ifndef _ASM_IA64_KREGS_H
+#define _ASM_IA64_KREGS_H
+
+/*
+ * Copyright (C) 2001-2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+/*
+ * This file defines the kernel register usage convention used by Linux/ia64.
+ */
+
+/*
+ * Kernel registers:
+ */
+#define IA64_KR_IO_BASE                0       /* ar.k0: legacy I/O base address */
+#define IA64_KR_TSSD           1       /* ar.k1: IVE uses this as the TSSD */
+#define IA64_KR_PER_CPU_DATA   3       /* ar.k3: physical per-CPU base */
+#define IA64_KR_CURRENT_STACK  4       /* ar.k4: what's mapped in IA64_TR_CURRENT_STACK */
+#define IA64_KR_FPU_OWNER      5       /* ar.k5: fpu-owner (UP only, at the moment) */
+#define IA64_KR_CURRENT                6       /* ar.k6: "current" task pointer */
+#define IA64_KR_PT_BASE                7       /* ar.k7: page table base address (physical) */
+
+#define _IA64_KR_PASTE(x,y)    x##y
+#define _IA64_KR_PREFIX(n)     _IA64_KR_PASTE(ar.k, n)
+#define IA64_KR(n)             _IA64_KR_PREFIX(IA64_KR_##n)
+
+/*
+ * Translation registers:
+ */
+#define IA64_TR_KERNEL         0       /* itr0, dtr0: maps kernel image (code & data) */
+#define IA64_TR_PALCODE                1       /* itr1: maps PALcode as required by EFI */
+#define IA64_TR_CURRENT_STACK  1       /* dtr1: maps kernel's memory- & register-stacks */
+
+#define IA64_TR_ALLOC_BASE     2       /* itr&dtr: Base of dynamic TR resource*/
+#define IA64_TR_ALLOC_MAX      32      /* Max number for dynamic use*/
+
+/* Processor status register bits: */
+#define IA64_PSR_BE_BIT                1
+#define IA64_PSR_UP_BIT                2
+#define IA64_PSR_AC_BIT                3
+#define IA64_PSR_MFL_BIT       4
+#define IA64_PSR_MFH_BIT       5
+#define IA64_PSR_IC_BIT                13
+#define IA64_PSR_I_BIT         14
+#define IA64_PSR_PK_BIT                15
+#define IA64_PSR_DT_BIT                17
+#define IA64_PSR_DFL_BIT       18
+#define IA64_PSR_DFH_BIT       19
+#define IA64_PSR_SP_BIT                20
+#define IA64_PSR_PP_BIT                21
+#define IA64_PSR_DI_BIT                22
+#define IA64_PSR_SI_BIT                23
+#define IA64_PSR_DB_BIT                24
+#define IA64_PSR_LP_BIT                25
+#define IA64_PSR_TB_BIT                26
+#define IA64_PSR_RT_BIT                27
+/* The following are not affected by save_flags()/restore_flags(): */
+#define IA64_PSR_CPL0_BIT      32
+#define IA64_PSR_CPL1_BIT      33
+#define IA64_PSR_IS_BIT                34
+#define IA64_PSR_MC_BIT                35
+#define IA64_PSR_IT_BIT                36
+#define IA64_PSR_ID_BIT                37
+#define IA64_PSR_DA_BIT                38
+#define IA64_PSR_DD_BIT                39
+#define IA64_PSR_SS_BIT                40
+#define IA64_PSR_RI_BIT                41
+#define IA64_PSR_ED_BIT                43
+#define IA64_PSR_BN_BIT                44
+#define IA64_PSR_IA_BIT                45
+
+/* A mask of PSR bits that we generally don't want to inherit across a clone2() or an
+   execve().  Only list flags here that need to be cleared/set for BOTH clone2() and
+   execve().  */
+#define IA64_PSR_BITS_TO_CLEAR (IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_DB | IA64_PSR_LP | \
+                                IA64_PSR_TB  | IA64_PSR_ID  | IA64_PSR_DA | IA64_PSR_DD | \
+                                IA64_PSR_SS  | IA64_PSR_ED  | IA64_PSR_IA)
+#define IA64_PSR_BITS_TO_SET   (IA64_PSR_DFH | IA64_PSR_SP)
+
+#define IA64_PSR_BE    (__IA64_UL(1) << IA64_PSR_BE_BIT)
+#define IA64_PSR_UP    (__IA64_UL(1) << IA64_PSR_UP_BIT)
+#define IA64_PSR_AC    (__IA64_UL(1) << IA64_PSR_AC_BIT)
+#define IA64_PSR_MFL   (__IA64_UL(1) << IA64_PSR_MFL_BIT)
+#define IA64_PSR_MFH   (__IA64_UL(1) << IA64_PSR_MFH_BIT)
+#define IA64_PSR_IC    (__IA64_UL(1) << IA64_PSR_IC_BIT)
+#define IA64_PSR_I     (__IA64_UL(1) << IA64_PSR_I_BIT)
+#define IA64_PSR_PK    (__IA64_UL(1) << IA64_PSR_PK_BIT)
+#define IA64_PSR_DT    (__IA64_UL(1) << IA64_PSR_DT_BIT)
+#define IA64_PSR_DFL   (__IA64_UL(1) << IA64_PSR_DFL_BIT)
+#define IA64_PSR_DFH   (__IA64_UL(1) << IA64_PSR_DFH_BIT)
+#define IA64_PSR_SP    (__IA64_UL(1) << IA64_PSR_SP_BIT)
+#define IA64_PSR_PP    (__IA64_UL(1) << IA64_PSR_PP_BIT)
+#define IA64_PSR_DI    (__IA64_UL(1) << IA64_PSR_DI_BIT)
+#define IA64_PSR_SI    (__IA64_UL(1) << IA64_PSR_SI_BIT)
+#define IA64_PSR_DB    (__IA64_UL(1) << IA64_PSR_DB_BIT)
+#define IA64_PSR_LP    (__IA64_UL(1) << IA64_PSR_LP_BIT)
+#define IA64_PSR_TB    (__IA64_UL(1) << IA64_PSR_TB_BIT)
+#define IA64_PSR_RT    (__IA64_UL(1) << IA64_PSR_RT_BIT)
+/* The following are not affected by save_flags()/restore_flags(): */
+#define IA64_PSR_CPL   (__IA64_UL(3) << IA64_PSR_CPL0_BIT)
+#define IA64_PSR_IS    (__IA64_UL(1) << IA64_PSR_IS_BIT)
+#define IA64_PSR_MC    (__IA64_UL(1) << IA64_PSR_MC_BIT)
+#define IA64_PSR_IT    (__IA64_UL(1) << IA64_PSR_IT_BIT)
+#define IA64_PSR_ID    (__IA64_UL(1) << IA64_PSR_ID_BIT)
+#define IA64_PSR_DA    (__IA64_UL(1) << IA64_PSR_DA_BIT)
+#define IA64_PSR_DD    (__IA64_UL(1) << IA64_PSR_DD_BIT)
+#define IA64_PSR_SS    (__IA64_UL(1) << IA64_PSR_SS_BIT)
+#define IA64_PSR_RI    (__IA64_UL(3) << IA64_PSR_RI_BIT)
+#define IA64_PSR_ED    (__IA64_UL(1) << IA64_PSR_ED_BIT)
+#define IA64_PSR_BN    (__IA64_UL(1) << IA64_PSR_BN_BIT)
+#define IA64_PSR_IA    (__IA64_UL(1) << IA64_PSR_IA_BIT)
+
+/* User mask bits: */
+#define IA64_PSR_UM    (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL | IA64_PSR_MFH)
+
+/* Default Control Register */
+#define IA64_DCR_PP_BIT                 0      /* privileged performance monitor default */
+#define IA64_DCR_BE_BIT                 1      /* big-endian default */
+#define IA64_DCR_LC_BIT                 2      /* ia32 lock-check enable */
+#define IA64_DCR_DM_BIT                 8      /* defer TLB miss faults */
+#define IA64_DCR_DP_BIT                 9      /* defer page-not-present faults */
+#define IA64_DCR_DK_BIT                10      /* defer key miss faults */
+#define IA64_DCR_DX_BIT                11      /* defer key permission faults */
+#define IA64_DCR_DR_BIT                12      /* defer access right faults */
+#define IA64_DCR_DA_BIT                13      /* defer access bit faults */
+#define IA64_DCR_DD_BIT                14      /* defer debug faults */
+
+#define IA64_DCR_PP    (__IA64_UL(1) << IA64_DCR_PP_BIT)
+#define IA64_DCR_BE    (__IA64_UL(1) << IA64_DCR_BE_BIT)
+#define IA64_DCR_LC    (__IA64_UL(1) << IA64_DCR_LC_BIT)
+#define IA64_DCR_DM    (__IA64_UL(1) << IA64_DCR_DM_BIT)
+#define IA64_DCR_DP    (__IA64_UL(1) << IA64_DCR_DP_BIT)
+#define IA64_DCR_DK    (__IA64_UL(1) << IA64_DCR_DK_BIT)
+#define IA64_DCR_DX    (__IA64_UL(1) << IA64_DCR_DX_BIT)
+#define IA64_DCR_DR    (__IA64_UL(1) << IA64_DCR_DR_BIT)
+#define IA64_DCR_DA    (__IA64_UL(1) << IA64_DCR_DA_BIT)
+#define IA64_DCR_DD    (__IA64_UL(1) << IA64_DCR_DD_BIT)
+
+/* Interrupt Status Register */
+#define IA64_ISR_X_BIT         32      /* execute access */
+#define IA64_ISR_W_BIT         33      /* write access */
+#define IA64_ISR_R_BIT         34      /* read access */
+#define IA64_ISR_NA_BIT                35      /* non-access */
+#define IA64_ISR_SP_BIT                36      /* speculative load exception */
+#define IA64_ISR_RS_BIT                37      /* mandatory register-stack exception */
+#define IA64_ISR_IR_BIT                38      /* invalid register frame exception */
+#define IA64_ISR_CODE_MASK     0xf
+
+#define IA64_ISR_X     (__IA64_UL(1) << IA64_ISR_X_BIT)
+#define IA64_ISR_W     (__IA64_UL(1) << IA64_ISR_W_BIT)
+#define IA64_ISR_R     (__IA64_UL(1) << IA64_ISR_R_BIT)
+#define IA64_ISR_NA    (__IA64_UL(1) << IA64_ISR_NA_BIT)
+#define IA64_ISR_SP    (__IA64_UL(1) << IA64_ISR_SP_BIT)
+#define IA64_ISR_RS    (__IA64_UL(1) << IA64_ISR_RS_BIT)
+#define IA64_ISR_IR    (__IA64_UL(1) << IA64_ISR_IR_BIT)
+
+/* ISR code field for non-access instructions */
+#define IA64_ISR_CODE_TPA      0
+#define IA64_ISR_CODE_FC       1
+#define IA64_ISR_CODE_PROBE    2
+#define IA64_ISR_CODE_TAK      3
+#define IA64_ISR_CODE_LFETCH   4
+#define IA64_ISR_CODE_PROBEF   5
+
+#endif /* _ASM_IA64_kREGS_H */
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h
new file mode 100644 (file)
index 0000000..f38472a
--- /dev/null
@@ -0,0 +1,211 @@
+#ifndef __ASM_IA64_KVM_H
+#define __ASM_IA64_KVM_H
+
+/*
+ * kvm structure definitions  for ia64
+ *
+ * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+#include <asm/types.h>
+
+#include <linux/ioctl.h>
+
+/* Architectural interrupt line count. */
+#define KVM_NR_INTERRUPTS 256
+
+#define KVM_IOAPIC_NUM_PINS  48
+
+struct kvm_ioapic_state {
+       __u64 base_address;
+       __u32 ioregsel;
+       __u32 id;
+       __u32 irr;
+       __u32 pad;
+       union {
+               __u64 bits;
+               struct {
+                       __u8 vector;
+                       __u8 delivery_mode:3;
+                       __u8 dest_mode:1;
+                       __u8 delivery_status:1;
+                       __u8 polarity:1;
+                       __u8 remote_irr:1;
+                       __u8 trig_mode:1;
+                       __u8 mask:1;
+                       __u8 reserve:7;
+                       __u8 reserved[4];
+                       __u8 dest_id;
+               } fields;
+       } redirtbl[KVM_IOAPIC_NUM_PINS];
+};
+
+#define KVM_IRQCHIP_PIC_MASTER   0
+#define KVM_IRQCHIP_PIC_SLAVE    1
+#define KVM_IRQCHIP_IOAPIC       2
+
+#define KVM_CONTEXT_SIZE       8*1024
+
+struct kvm_fpreg {
+       union {
+               unsigned long bits[2];
+               long double __dummy;    /* force 16-byte alignment */
+       } u;
+};
+
+union context {
+       /* 8K size */
+       char    dummy[KVM_CONTEXT_SIZE];
+       struct {
+               unsigned long       psr;
+               unsigned long       pr;
+               unsigned long       caller_unat;
+               unsigned long       pad;
+               unsigned long       gr[32];
+               unsigned long       ar[128];
+               unsigned long       br[8];
+               unsigned long       cr[128];
+               unsigned long       rr[8];
+               unsigned long       ibr[8];
+               unsigned long       dbr[8];
+               unsigned long       pkr[8];
+               struct kvm_fpreg   fr[128];
+       };
+};
+
+struct thash_data {
+       union {
+               struct {
+                       unsigned long p    :  1; /* 0 */
+                       unsigned long rv1  :  1; /* 1 */
+                       unsigned long ma   :  3; /* 2-4 */
+                       unsigned long a    :  1; /* 5 */
+                       unsigned long d    :  1; /* 6 */
+                       unsigned long pl   :  2; /* 7-8 */
+                       unsigned long ar   :  3; /* 9-11 */
+                       unsigned long ppn  : 38; /* 12-49 */
+                       unsigned long rv2  :  2; /* 50-51 */
+                       unsigned long ed   :  1; /* 52 */
+                       unsigned long ig1  : 11; /* 53-63 */
+               };
+               struct {
+                       unsigned long __rv1 : 53;     /* 0-52 */
+                       unsigned long contiguous : 1; /*53 */
+                       unsigned long tc : 1;         /* 54 TR or TC */
+                       unsigned long cl : 1;
+                       /* 55 I side or D side cache line */
+                       unsigned long len  :  4;      /* 56-59 */
+                       unsigned long io  : 1;  /* 60 entry is for io or not */
+                       unsigned long nomap : 1;
+                       /* 61 entry cann't be inserted into machine TLB.*/
+                       unsigned long checked : 1;
+                       /* 62 for VTLB/VHPT sanity check */
+                       unsigned long invalid : 1;
+                       /* 63 invalid entry */
+               };
+               unsigned long page_flags;
+       };                  /* same for VHPT and TLB */
+
+       union {
+               struct {
+                       unsigned long rv3  :  2;
+                       unsigned long ps   :  6;
+                       unsigned long key  : 24;
+                       unsigned long rv4  : 32;
+               };
+               unsigned long itir;
+       };
+       union {
+               struct {
+                       unsigned long ig2  :  12;
+                       unsigned long vpn  :  49;
+                       unsigned long vrn  :   3;
+               };
+               unsigned long ifa;
+               unsigned long vadr;
+               struct {
+                       unsigned long tag  :  63;
+                       unsigned long ti   :  1;
+               };
+               unsigned long etag;
+       };
+       union {
+               struct thash_data *next;
+               unsigned long rid;
+               unsigned long gpaddr;
+       };
+};
+
+#define        NITRS   8
+#define NDTRS  8
+
+struct saved_vpd {
+       unsigned long  vhpi;
+       unsigned long  vgr[16];
+       unsigned long  vbgr[16];
+       unsigned long  vnat;
+       unsigned long  vbnat;
+       unsigned long  vcpuid[5];
+       unsigned long  vpsr;
+       unsigned long  vpr;
+       unsigned long  vcr[128];
+};
+
+struct kvm_regs {
+       char *saved_guest;
+       char *saved_stack;
+       struct saved_vpd vpd;
+       /*Arch-regs*/
+       int mp_state;
+       unsigned long vmm_rr;
+       /* TR and TC.  */
+       struct thash_data itrs[NITRS];
+       struct thash_data dtrs[NDTRS];
+       /* Bit is set if there is a tr/tc for the region.  */
+       unsigned char itr_regions;
+       unsigned char dtr_regions;
+       unsigned char tc_regions;
+
+       char irq_check;
+       unsigned long saved_itc;
+       unsigned long itc_check;
+       unsigned long timer_check;
+       unsigned long timer_pending;
+       unsigned long last_itc;
+
+       unsigned long vrr[8];
+       unsigned long ibr[8];
+       unsigned long dbr[8];
+       unsigned long insvc[4];         /* Interrupt in service.  */
+       unsigned long xtp;
+
+       unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
+       unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
+       unsigned long metaphysical_saved_rr0; /* from kvm_arch          */
+       unsigned long metaphysical_saved_rr4; /* from kvm_arch          */
+       unsigned long fp_psr;       /*used for lazy float register */
+       unsigned long saved_gp;
+       /*for phycial  emulation */
+};
+
+struct kvm_sregs {
+};
+
+struct kvm_fpu {
+};
+
+#endif
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
new file mode 100644 (file)
index 0000000..1efe513
--- /dev/null
@@ -0,0 +1,527 @@
+/*
+ * kvm_host.h: used for kvm module, and hold ia64-specific sections.
+ *
+ * Copyright (C) 2007, Intel Corporation.
+ *
+ * Xiantao Zhang <xiantao.zhang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+#ifndef __ASM_KVM_HOST_H
+#define __ASM_KVM_HOST_H
+
+
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/kvm.h>
+#include <linux/kvm_para.h>
+#include <linux/kvm_types.h>
+
+#include <asm/pal.h>
+#include <asm/sal.h>
+
+#define KVM_MAX_VCPUS 4
+#define KVM_MEMORY_SLOTS 32
+/* memory slots that does not exposed to userspace */
+#define KVM_PRIVATE_MEM_SLOTS 4
+
+#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
+
+/* define exit reasons from vmm to kvm*/
+#define EXIT_REASON_VM_PANIC           0
+#define EXIT_REASON_MMIO_INSTRUCTION   1
+#define EXIT_REASON_PAL_CALL           2
+#define EXIT_REASON_SAL_CALL           3
+#define EXIT_REASON_SWITCH_RR6         4
+#define EXIT_REASON_VM_DESTROY         5
+#define EXIT_REASON_EXTERNAL_INTERRUPT 6
+#define EXIT_REASON_IPI                        7
+#define EXIT_REASON_PTC_G              8
+
+/*Define vmm address space and vm data space.*/
+#define KVM_VMM_SIZE (16UL<<20)
+#define KVM_VMM_SHIFT 24
+#define KVM_VMM_BASE 0xD000000000000000UL
+#define VMM_SIZE (8UL<<20)
+
+/*
+ * Define vm_buffer, used by PAL Services, base address.
+ * Note: vmbuffer is in the VMM-BLOCK, the size must be < 8M
+ */
+#define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
+#define KVM_VM_BUFFER_SIZE (8UL<<20)
+
+/*Define Virtual machine data layout.*/
+#define KVM_VM_DATA_SHIFT  24
+#define KVM_VM_DATA_SIZE (1UL << KVM_VM_DATA_SHIFT)
+#define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VMM_SIZE)
+
+
+#define KVM_P2M_BASE    KVM_VM_DATA_BASE
+#define KVM_P2M_OFS     0
+#define KVM_P2M_SIZE    (8UL << 20)
+
+#define KVM_VHPT_BASE   (KVM_P2M_BASE + KVM_P2M_SIZE)
+#define KVM_VHPT_OFS    KVM_P2M_SIZE
+#define KVM_VHPT_BLOCK_SIZE   (2UL << 20)
+#define VHPT_SHIFT      18
+#define VHPT_SIZE       (1UL << VHPT_SHIFT)
+#define VHPT_NUM_ENTRIES (1<<(VHPT_SHIFT-5))
+
+#define KVM_VTLB_BASE   (KVM_VHPT_BASE+KVM_VHPT_BLOCK_SIZE)
+#define KVM_VTLB_OFS    (KVM_VHPT_OFS+KVM_VHPT_BLOCK_SIZE)
+#define KVM_VTLB_BLOCK_SIZE   (1UL<<20)
+#define VTLB_SHIFT      17
+#define VTLB_SIZE       (1UL<<VTLB_SHIFT)
+#define VTLB_NUM_ENTRIES (1<<(VTLB_SHIFT-5))
+
+#define KVM_VPD_BASE   (KVM_VTLB_BASE+KVM_VTLB_BLOCK_SIZE)
+#define KVM_VPD_OFS    (KVM_VTLB_OFS+KVM_VTLB_BLOCK_SIZE)
+#define KVM_VPD_BLOCK_SIZE   (2UL<<20)
+#define VPD_SHIFT       16
+#define VPD_SIZE        (1UL<<VPD_SHIFT)
+
+#define KVM_VCPU_BASE   (KVM_VPD_BASE+KVM_VPD_BLOCK_SIZE)
+#define KVM_VCPU_OFS    (KVM_VPD_OFS+KVM_VPD_BLOCK_SIZE)
+#define KVM_VCPU_BLOCK_SIZE   (2UL<<20)
+#define VCPU_SHIFT 18
+#define VCPU_SIZE (1UL<<VCPU_SHIFT)
+#define MAX_VCPU_NUM KVM_VCPU_BLOCK_SIZE/VCPU_SIZE
+
+#define KVM_VM_BASE     (KVM_VCPU_BASE+KVM_VCPU_BLOCK_SIZE)
+#define KVM_VM_OFS      (KVM_VCPU_OFS+KVM_VCPU_BLOCK_SIZE)
+#define KVM_VM_BLOCK_SIZE     (1UL<<19)
+
+#define KVM_MEM_DIRTY_LOG_BASE (KVM_VM_BASE+KVM_VM_BLOCK_SIZE)
+#define KVM_MEM_DIRTY_LOG_OFS  (KVM_VM_OFS+KVM_VM_BLOCK_SIZE)
+#define KVM_MEM_DIRTY_LOG_SIZE (1UL<<19)
+
+/* Get vpd, vhpt, tlb, vcpu, base*/
+#define VPD_ADDR(n) (KVM_VPD_BASE+n*VPD_SIZE)
+#define VHPT_ADDR(n) (KVM_VHPT_BASE+n*VHPT_SIZE)
+#define VTLB_ADDR(n) (KVM_VTLB_BASE+n*VTLB_SIZE)
+#define VCPU_ADDR(n) (KVM_VCPU_BASE+n*VCPU_SIZE)
+
+/*IO section definitions*/
+#define IOREQ_READ      1
+#define IOREQ_WRITE     0
+
+#define STATE_IOREQ_NONE        0
+#define STATE_IOREQ_READY       1
+#define STATE_IOREQ_INPROCESS   2
+#define STATE_IORESP_READY      3
+
+/*Guest Physical address layout.*/
+#define GPFN_MEM        (0UL << 60) /* Guest pfn is normal mem */
+#define GPFN_FRAME_BUFFER   (1UL << 60) /* VGA framebuffer */
+#define GPFN_LOW_MMIO       (2UL << 60) /* Low MMIO range */
+#define GPFN_PIB        (3UL << 60) /* PIB base */
+#define GPFN_IOSAPIC        (4UL << 60) /* IOSAPIC base */
+#define GPFN_LEGACY_IO      (5UL << 60) /* Legacy I/O base */
+#define GPFN_GFW        (6UL << 60) /* Guest Firmware */
+#define GPFN_HIGH_MMIO      (7UL << 60) /* High MMIO range */
+
+#define GPFN_IO_MASK        (7UL << 60) /* Guest pfn is I/O type */
+#define GPFN_INV_MASK       (1UL << 63) /* Guest pfn is invalid */
+#define INVALID_MFN       (~0UL)
+#define MEM_G   (1UL << 30)
+#define MEM_M   (1UL << 20)
+#define MMIO_START       (3 * MEM_G)
+#define MMIO_SIZE        (512 * MEM_M)
+#define VGA_IO_START     0xA0000UL
+#define VGA_IO_SIZE      0x20000
+#define LEGACY_IO_START  (MMIO_START + MMIO_SIZE)
+#define LEGACY_IO_SIZE   (64 * MEM_M)
+#define IO_SAPIC_START   0xfec00000UL
+#define IO_SAPIC_SIZE    0x100000
+#define PIB_START 0xfee00000UL
+#define PIB_SIZE 0x200000
+#define GFW_START        (4 * MEM_G - 16 * MEM_M)
+#define GFW_SIZE         (16 * MEM_M)
+
+/*Deliver mode, defined for ioapic.c*/
+#define dest_Fixed IOSAPIC_FIXED
+#define dest_LowestPrio IOSAPIC_LOWEST_PRIORITY
+
+#define NMI_VECTOR                     2
+#define ExtINT_VECTOR                  0
+#define NULL_VECTOR                    (-1)
+#define IA64_SPURIOUS_INT_VECTOR       0x0f
+
+#define VCPU_LID(v) (((u64)(v)->vcpu_id) << 24)
+
+/*
+ *Delivery mode
+ */
+#define SAPIC_DELIV_SHIFT      8
+#define SAPIC_FIXED            0x0
+#define SAPIC_LOWEST_PRIORITY  0x1
+#define SAPIC_PMI              0x2
+#define SAPIC_NMI              0x4
+#define SAPIC_INIT             0x5
+#define SAPIC_EXTINT           0x7
+
+/*
+ * vcpu->requests bit members for arch
+ */
+#define KVM_REQ_PTC_G          32
+#define KVM_REQ_RESUME         33
+
+#define KVM_PAGES_PER_HPAGE    1
+
+struct kvm;
+struct kvm_vcpu;
+struct kvm_guest_debug{
+};
+
+struct kvm_mmio_req {
+       uint64_t addr;          /*  physical address            */
+       uint64_t size;          /*  size in bytes               */
+       uint64_t data;          /*  data (or paddr of data)     */
+       uint8_t state:4;
+       uint8_t dir:1;          /*  1=read, 0=write             */
+};
+
+/*Pal data struct */
+struct kvm_pal_call{
+       /*In area*/
+       uint64_t gr28;
+       uint64_t gr29;
+       uint64_t gr30;
+       uint64_t gr31;
+       /*Out area*/
+       struct ia64_pal_retval ret;
+};
+
+/* Sal data structure */
+struct kvm_sal_call{
+       /*In area*/
+       uint64_t in0;
+       uint64_t in1;
+       uint64_t in2;
+       uint64_t in3;
+       uint64_t in4;
+       uint64_t in5;
+       uint64_t in6;
+       uint64_t in7;
+       struct sal_ret_values ret;
+};
+
+/*Guest change rr6*/
+struct kvm_switch_rr6 {
+       uint64_t old_rr;
+       uint64_t new_rr;
+};
+
+union ia64_ipi_a{
+       unsigned long val;
+       struct {
+               unsigned long rv  : 3;
+               unsigned long ir  : 1;
+               unsigned long eid : 8;
+               unsigned long id  : 8;
+               unsigned long ib_base : 44;
+       };
+};
+
+union ia64_ipi_d {
+       unsigned long val;
+       struct {
+               unsigned long vector : 8;
+               unsigned long dm  : 3;
+               unsigned long ig  : 53;
+       };
+};
+
+/*ipi check exit data*/
+struct kvm_ipi_data{
+       union ia64_ipi_a addr;
+       union ia64_ipi_d data;
+};
+
+/*global purge data*/
+struct kvm_ptc_g {
+       unsigned long vaddr;
+       unsigned long rr;
+       unsigned long ps;
+       struct kvm_vcpu *vcpu;
+};
+
+/*Exit control data */
+struct exit_ctl_data{
+       uint32_t exit_reason;
+       uint32_t vm_status;
+       union {
+               struct kvm_mmio_req     ioreq;
+               struct kvm_pal_call     pal_data;
+               struct kvm_sal_call     sal_data;
+               struct kvm_switch_rr6   rr_data;
+               struct kvm_ipi_data     ipi_data;
+               struct kvm_ptc_g        ptc_g_data;
+       } u;
+};
+
+union pte_flags {
+       unsigned long val;
+       struct {
+               unsigned long p    :  1; /*0      */
+               unsigned long      :  1; /* 1     */
+               unsigned long ma   :  3; /* 2-4   */
+               unsigned long a    :  1; /* 5     */
+               unsigned long d    :  1; /* 6     */
+               unsigned long pl   :  2; /* 7-8   */
+               unsigned long ar   :  3; /* 9-11  */
+               unsigned long ppn  : 38; /* 12-49 */
+               unsigned long      :  2; /* 50-51 */
+               unsigned long ed   :  1; /* 52    */
+       };
+};
+
+union ia64_pta {
+       unsigned long val;
+       struct {
+               unsigned long ve : 1;
+               unsigned long reserved0 : 1;
+               unsigned long size : 6;
+               unsigned long vf : 1;
+               unsigned long reserved1 : 6;
+               unsigned long base : 49;
+       };
+};
+
+struct thash_cb {
+       /* THASH base information */
+       struct thash_data       *hash; /* hash table pointer */
+       union ia64_pta          pta;
+       int           num;
+};
+
+struct kvm_vcpu_stat {
+};
+
+struct kvm_vcpu_arch {
+       int launched;
+       int last_exit;
+       int last_run_cpu;
+       int vmm_tr_slot;
+       int vm_tr_slot;
+
+#define KVM_MP_STATE_RUNNABLE          0
+#define KVM_MP_STATE_UNINITIALIZED     1
+#define KVM_MP_STATE_INIT_RECEIVED     2
+#define KVM_MP_STATE_HALTED            3
+       int mp_state;
+
+#define MAX_PTC_G_NUM                  3
+       int ptc_g_count;
+       struct kvm_ptc_g ptc_g_data[MAX_PTC_G_NUM];
+
+       /*halt timer to wake up sleepy vcpus*/
+       struct hrtimer hlt_timer;
+       long ht_active;
+
+       struct kvm_lapic *apic;    /* kernel irqchip context */
+       struct vpd *vpd;
+
+       /* Exit data for vmm_transition*/
+       struct exit_ctl_data exit_data;
+
+       cpumask_t cache_coherent_map;
+
+       unsigned long vmm_rr;
+       unsigned long host_rr6;
+       unsigned long psbits[8];
+       unsigned long cr_iipa;
+       unsigned long cr_isr;
+       unsigned long vsa_base;
+       unsigned long dirty_log_lock_pa;
+       unsigned long __gp;
+       /* TR and TC.  */
+       struct thash_data itrs[NITRS];
+       struct thash_data dtrs[NDTRS];
+       /* Bit is set if there is a tr/tc for the region.  */
+       unsigned char itr_regions;
+       unsigned char dtr_regions;
+       unsigned char tc_regions;
+       /* purge all */
+       unsigned long ptce_base;
+       unsigned long ptce_count[2];
+       unsigned long ptce_stride[2];
+       /* itc/itm */
+       unsigned long last_itc;
+       long itc_offset;
+       unsigned long itc_check;
+       unsigned long timer_check;
+       unsigned long timer_pending;
+
+       unsigned long vrr[8];
+       unsigned long ibr[8];
+       unsigned long dbr[8];
+       unsigned long insvc[4];         /* Interrupt in service.  */
+       unsigned long xtp;
+
+       unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
+       unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
+       unsigned long metaphysical_saved_rr0; /* from kvm_arch          */
+       unsigned long metaphysical_saved_rr4; /* from kvm_arch          */
+       unsigned long fp_psr;       /*used for lazy float register */
+       unsigned long saved_gp;
+       /*for phycial  emulation */
+       int mode_flags;
+       struct thash_cb vtlb;
+       struct thash_cb vhpt;
+       char irq_check;
+       char irq_new_pending;
+
+       unsigned long opcode;
+       unsigned long cause;
+       union context host;
+       union context guest;
+};
+
+struct kvm_vm_stat {
+       u64 remote_tlb_flush;
+};
+
+struct kvm_sal_data {
+       unsigned long boot_ip;
+       unsigned long boot_gp;
+};
+
+struct kvm_arch {
+       unsigned long   vm_base;
+       unsigned long   metaphysical_rr0;
+       unsigned long   metaphysical_rr4;
+       unsigned long   vmm_init_rr;
+       unsigned long   vhpt_base;
+       unsigned long   vtlb_base;
+       unsigned long   vpd_base;
+       spinlock_t dirty_log_lock;
+       struct kvm_ioapic *vioapic;
+       struct kvm_vm_stat stat;
+       struct kvm_sal_data rdv_sal_data;
+};
+
+union cpuid3_t {
+       u64 value;
+       struct {
+               u64 number : 8;
+               u64 revision : 8;
+               u64 model : 8;
+               u64 family : 8;
+               u64 archrev : 8;
+               u64 rv : 24;
+       };
+};
+
+struct kvm_pt_regs {
+       /* The following registers are saved by SAVE_MIN: */
+       unsigned long b6;  /* scratch */
+       unsigned long b7;  /* scratch */
+
+       unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
+       unsigned long ar_ssd; /* reserved for future use (scratch) */
+
+       unsigned long r8;  /* scratch (return value register 0) */
+       unsigned long r9;  /* scratch (return value register 1) */
+       unsigned long r10; /* scratch (return value register 2) */
+       unsigned long r11; /* scratch (return value register 3) */
+
+       unsigned long cr_ipsr; /* interrupted task's psr */
+       unsigned long cr_iip;  /* interrupted task's instruction pointer */
+       unsigned long cr_ifs;  /* interrupted task's function state */
+
+       unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
+       unsigned long ar_pfs;  /* prev function state  */
+       unsigned long ar_rsc;  /* RSE configuration */
+       /* The following two are valid only if cr_ipsr.cpl > 0: */
+       unsigned long ar_rnat;  /* RSE NaT */
+       unsigned long ar_bspstore; /* RSE bspstore */
+
+       unsigned long pr;  /* 64 predicate registers (1 bit each) */
+       unsigned long b0;  /* return pointer (bp) */
+       unsigned long loadrs;  /* size of dirty partition << 16 */
+
+       unsigned long r1;  /* the gp pointer */
+       unsigned long r12; /* interrupted task's memory stack pointer */
+       unsigned long r13; /* thread pointer */
+
+       unsigned long ar_fpsr;  /* floating point status (preserved) */
+       unsigned long r15;  /* scratch */
+
+       /* The remaining registers are NOT saved for system calls.  */
+       unsigned long r14;  /* scratch */
+       unsigned long r2;  /* scratch */
+       unsigned long r3;  /* scratch */
+       unsigned long r16;  /* scratch */
+       unsigned long r17;  /* scratch */
+       unsigned long r18;  /* scratch */
+       unsigned long r19;  /* scratch */
+       unsigned long r20;  /* scratch */
+       unsigned long r21;  /* scratch */
+       unsigned long r22;  /* scratch */
+       unsigned long r23;  /* scratch */
+       unsigned long r24;  /* scratch */
+       unsigned long r25;  /* scratch */
+       unsigned long r26;  /* scratch */
+       unsigned long r27;  /* scratch */
+       unsigned long r28;  /* scratch */
+       unsigned long r29;  /* scratch */
+       unsigned long r30;  /* scratch */
+       unsigned long r31;  /* scratch */
+       unsigned long ar_ccv;  /* compare/exchange value (scratch) */
+
+       /*
+        * Floating point registers that the kernel considers scratch:
+        */
+       struct ia64_fpreg f6;  /* scratch */
+       struct ia64_fpreg f7;  /* scratch */
+       struct ia64_fpreg f8;  /* scratch */
+       struct ia64_fpreg f9;  /* scratch */
+       struct ia64_fpreg f10;  /* scratch */
+       struct ia64_fpreg f11;  /* scratch */
+
+       unsigned long r4;  /* preserved */
+       unsigned long r5;  /* preserved */
+       unsigned long r6;  /* preserved */
+       unsigned long r7;  /* preserved */
+       unsigned long eml_unat;    /* used for emulating instruction */
+       unsigned long pad0;     /* alignment pad */
+};
+
+static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v)
+{
+       return (struct kvm_pt_regs *) ((unsigned long) v + IA64_STK_OFFSET) - 1;
+}
+
+typedef int kvm_vmm_entry(void);
+typedef void kvm_tramp_entry(union context *host, union context *guest);
+
+struct kvm_vmm_info{
+       struct module   *module;
+       kvm_vmm_entry   *vmm_entry;
+       kvm_tramp_entry *tramp_entry;
+       unsigned long   vmm_ivt;
+};
+
+int kvm_highest_pending_irq(struct kvm_vcpu *vcpu);
+int kvm_emulate_halt(struct kvm_vcpu *vcpu);
+int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
+void kvm_sal_emul(struct kvm_vcpu *vcpu);
+
+static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {}
+
+#endif
diff --git a/arch/ia64/include/asm/kvm_para.h b/arch/ia64/include/asm/kvm_para.h
new file mode 100644 (file)
index 0000000..0d6d8ca
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __IA64_KVM_PARA_H
+#define __IA64_KVM_PARA_H
+
+/*
+ * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+static inline unsigned int kvm_arch_para_features(void)
+{
+       return 0;
+}
+
+#endif
diff --git a/arch/ia64/include/asm/libata-portmap.h b/arch/ia64/include/asm/libata-portmap.h
new file mode 100644 (file)
index 0000000..0e00c9a
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __ASM_IA64_LIBATA_PORTMAP_H
+#define __ASM_IA64_LIBATA_PORTMAP_H
+
+#define ATA_PRIMARY_CMD                0x1F0
+#define ATA_PRIMARY_CTL                0x3F6
+#define ATA_PRIMARY_IRQ(dev)   isa_irq_to_vector(14)
+
+#define ATA_SECONDARY_CMD      0x170
+#define ATA_SECONDARY_CTL      0x376
+#define ATA_SECONDARY_IRQ(dev) isa_irq_to_vector(15)
+
+#endif
diff --git a/arch/ia64/include/asm/linkage.h b/arch/ia64/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..ef22a45
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#ifndef __ASSEMBLY__
+
+#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
+
+#else
+
+#include <asm/asmmacro.h>
+
+#endif
+
+#endif
diff --git a/arch/ia64/include/asm/local.h b/arch/ia64/include/asm/local.h
new file mode 100644 (file)
index 0000000..c11c530
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/local.h>
diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h
new file mode 100644 (file)
index 0000000..2b850cc
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+ * Machine vector for IA-64.
+ *
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
+ * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
+ * Copyright (C) 1999-2001, 2003-2004 Hewlett-Packard Co.
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+#ifndef _ASM_IA64_MACHVEC_H
+#define _ASM_IA64_MACHVEC_H
+
+#include <linux/types.h>
+
+/* forward declarations: */
+struct device;
+struct pt_regs;
+struct scatterlist;
+struct page;
+struct mm_struct;
+struct pci_bus;
+struct task_struct;
+struct pci_dev;
+struct msi_desc;
+struct dma_attrs;
+
+typedef void ia64_mv_setup_t (char **);
+typedef void ia64_mv_cpu_init_t (void);
+typedef void ia64_mv_irq_init_t (void);
+typedef void ia64_mv_send_ipi_t (int, int, int, int);
+typedef void ia64_mv_timer_interrupt_t (int, void *);
+typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
+typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
+typedef u8 ia64_mv_irq_to_vector (int);
+typedef unsigned int ia64_mv_local_vector_to_irq (u8);
+typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
+typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
+                                      u8 size);
+typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val,
+                                       u8 size);
+typedef void ia64_mv_migrate_t(struct task_struct * task);
+typedef void ia64_mv_pci_fixup_bus_t (struct pci_bus *);
+typedef void ia64_mv_kernel_launch_event_t(void);
+
+/* DMA-mapping interface: */
+typedef void ia64_mv_dma_init (void);
+typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, gfp_t);
+typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t);
+typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int);
+typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int);
+typedef int ia64_mv_dma_map_sg (struct device *, struct scatterlist *, int, int);
+typedef void ia64_mv_dma_unmap_sg (struct device *, struct scatterlist *, int, int);
+typedef void ia64_mv_dma_sync_single_for_cpu (struct device *, dma_addr_t, size_t, int);
+typedef void ia64_mv_dma_sync_sg_for_cpu (struct device *, struct scatterlist *, int, int);
+typedef void ia64_mv_dma_sync_single_for_device (struct device *, dma_addr_t, size_t, int);
+typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist *, int, int);
+typedef int ia64_mv_dma_mapping_error(struct device *, dma_addr_t dma_addr);
+typedef int ia64_mv_dma_supported (struct device *, u64);
+
+typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *);
+typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *);
+typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
+typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
+
+/*
+ * WARNING: The legacy I/O space is _architected_.  Platforms are
+ * expected to follow this architected model (see Section 10.7 in the
+ * IA-64 Architecture Software Developer's Manual).  Unfortunately,
+ * some broken machines do not follow that model, which is why we have
+ * to make the inX/outX operations part of the machine vector.
+ * Platform designers should follow the architected model whenever
+ * possible.
+ */
+typedef unsigned int ia64_mv_inb_t (unsigned long);
+typedef unsigned int ia64_mv_inw_t (unsigned long);
+typedef unsigned int ia64_mv_inl_t (unsigned long);
+typedef void ia64_mv_outb_t (unsigned char, unsigned long);
+typedef void ia64_mv_outw_t (unsigned short, unsigned long);
+typedef void ia64_mv_outl_t (unsigned int, unsigned long);
+typedef void ia64_mv_mmiowb_t (void);
+typedef unsigned char ia64_mv_readb_t (const volatile void __iomem *);
+typedef unsigned short ia64_mv_readw_t (const volatile void __iomem *);
+typedef unsigned int ia64_mv_readl_t (const volatile void __iomem *);
+typedef unsigned long ia64_mv_readq_t (const volatile void __iomem *);
+typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *);
+typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
+typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
+typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
+
+typedef int ia64_mv_setup_msi_irq_t (struct pci_dev *pdev, struct msi_desc *);
+typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
+
+static inline void
+machvec_noop (void)
+{
+}
+
+static inline void
+machvec_noop_mm (struct mm_struct *mm)
+{
+}
+
+static inline void
+machvec_noop_task (struct task_struct *task)
+{
+}
+
+static inline void
+machvec_noop_bus (struct pci_bus *bus)
+{
+}
+
+extern void machvec_setup (char **);
+extern void machvec_timer_interrupt (int, void *);
+extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
+extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);
+extern void machvec_tlb_migrate_finish (struct mm_struct *);
+
+# if defined (CONFIG_IA64_HP_SIM)
+#  include <asm/machvec_hpsim.h>
+# elif defined (CONFIG_IA64_DIG)
+#  include <asm/machvec_dig.h>
+# elif defined (CONFIG_IA64_HP_ZX1)
+#  include <asm/machvec_hpzx1.h>
+# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
+#  include <asm/machvec_hpzx1_swiotlb.h>
+# elif defined (CONFIG_IA64_SGI_SN2)
+#  include <asm/machvec_sn2.h>
+# elif defined (CONFIG_IA64_SGI_UV)
+#  include <asm/machvec_uv.h>
+# elif defined (CONFIG_IA64_GENERIC)
+
+# ifdef MACHVEC_PLATFORM_HEADER
+#  include MACHVEC_PLATFORM_HEADER
+# else
+#  define platform_name                ia64_mv.name
+#  define platform_setup       ia64_mv.setup
+#  define platform_cpu_init    ia64_mv.cpu_init
+#  define platform_irq_init    ia64_mv.irq_init
+#  define platform_send_ipi    ia64_mv.send_ipi
+#  define platform_timer_interrupt     ia64_mv.timer_interrupt
+#  define platform_global_tlb_purge    ia64_mv.global_tlb_purge
+#  define platform_tlb_migrate_finish  ia64_mv.tlb_migrate_finish
+#  define platform_dma_init            ia64_mv.dma_init
+#  define platform_dma_alloc_coherent  ia64_mv.dma_alloc_coherent
+#  define platform_dma_free_coherent   ia64_mv.dma_free_coherent
+#  define platform_dma_map_single_attrs        ia64_mv.dma_map_single_attrs
+#  define platform_dma_unmap_single_attrs      ia64_mv.dma_unmap_single_attrs
+#  define platform_dma_map_sg_attrs    ia64_mv.dma_map_sg_attrs
+#  define platform_dma_unmap_sg_attrs  ia64_mv.dma_unmap_sg_attrs
+#  define platform_dma_sync_single_for_cpu ia64_mv.dma_sync_single_for_cpu
+#  define platform_dma_sync_sg_for_cpu ia64_mv.dma_sync_sg_for_cpu
+#  define platform_dma_sync_single_for_device ia64_mv.dma_sync_single_for_device
+#  define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
+#  define platform_dma_mapping_error           ia64_mv.dma_mapping_error
+#  define platform_dma_supported       ia64_mv.dma_supported
+#  define platform_irq_to_vector       ia64_mv.irq_to_vector
+#  define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
+#  define platform_pci_get_legacy_mem  ia64_mv.pci_get_legacy_mem
+#  define platform_pci_legacy_read     ia64_mv.pci_legacy_read
+#  define platform_pci_legacy_write    ia64_mv.pci_legacy_write
+#  define platform_inb         ia64_mv.inb
+#  define platform_inw         ia64_mv.inw
+#  define platform_inl         ia64_mv.inl
+#  define platform_outb                ia64_mv.outb
+#  define platform_outw                ia64_mv.outw
+#  define platform_outl                ia64_mv.outl
+#  define platform_mmiowb      ia64_mv.mmiowb
+#  define platform_readb        ia64_mv.readb
+#  define platform_readw        ia64_mv.readw
+#  define platform_readl        ia64_mv.readl
+#  define platform_readq        ia64_mv.readq
+#  define platform_readb_relaxed        ia64_mv.readb_relaxed
+#  define platform_readw_relaxed        ia64_mv.readw_relaxed
+#  define platform_readl_relaxed        ia64_mv.readl_relaxed
+#  define platform_readq_relaxed        ia64_mv.readq_relaxed
+#  define platform_migrate             ia64_mv.migrate
+#  define platform_setup_msi_irq       ia64_mv.setup_msi_irq
+#  define platform_teardown_msi_irq    ia64_mv.teardown_msi_irq
+#  define platform_pci_fixup_bus       ia64_mv.pci_fixup_bus
+#  define platform_kernel_launch_event ia64_mv.kernel_launch_event
+# endif
+
+/* __attribute__((__aligned__(16))) is required to make size of the
+ * structure multiple of 16 bytes.
+ * This will fillup the holes created because of section 3.3.1 in
+ * Software Conventions guide.
+ */
+struct ia64_machine_vector {
+       const char *name;
+       ia64_mv_setup_t *setup;
+       ia64_mv_cpu_init_t *cpu_init;
+       ia64_mv_irq_init_t *irq_init;
+       ia64_mv_send_ipi_t *send_ipi;
+       ia64_mv_timer_interrupt_t *timer_interrupt;
+       ia64_mv_global_tlb_purge_t *global_tlb_purge;
+       ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish;
+       ia64_mv_dma_init *dma_init;
+       ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
+       ia64_mv_dma_free_coherent *dma_free_coherent;
+       ia64_mv_dma_map_single_attrs *dma_map_single_attrs;
+       ia64_mv_dma_unmap_single_attrs *dma_unmap_single_attrs;
+       ia64_mv_dma_map_sg_attrs *dma_map_sg_attrs;
+       ia64_mv_dma_unmap_sg_attrs *dma_unmap_sg_attrs;
+       ia64_mv_dma_sync_single_for_cpu *dma_sync_single_for_cpu;
+       ia64_mv_dma_sync_sg_for_cpu *dma_sync_sg_for_cpu;
+       ia64_mv_dma_sync_single_for_device *dma_sync_single_for_device;
+       ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
+       ia64_mv_dma_mapping_error *dma_mapping_error;
+       ia64_mv_dma_supported *dma_supported;
+       ia64_mv_irq_to_vector *irq_to_vector;
+       ia64_mv_local_vector_to_irq *local_vector_to_irq;
+       ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
+       ia64_mv_pci_legacy_read_t *pci_legacy_read;
+       ia64_mv_pci_legacy_write_t *pci_legacy_write;
+       ia64_mv_inb_t *inb;
+       ia64_mv_inw_t *inw;
+       ia64_mv_inl_t *inl;
+       ia64_mv_outb_t *outb;
+       ia64_mv_outw_t *outw;
+       ia64_mv_outl_t *outl;
+       ia64_mv_mmiowb_t *mmiowb;
+       ia64_mv_readb_t *readb;
+       ia64_mv_readw_t *readw;
+       ia64_mv_readl_t *readl;
+       ia64_mv_readq_t *readq;
+       ia64_mv_readb_relaxed_t *readb_relaxed;
+       ia64_mv_readw_relaxed_t *readw_relaxed;
+       ia64_mv_readl_relaxed_t *readl_relaxed;
+       ia64_mv_readq_relaxed_t *readq_relaxed;
+       ia64_mv_migrate_t *migrate;
+       ia64_mv_setup_msi_irq_t *setup_msi_irq;
+       ia64_mv_teardown_msi_irq_t *teardown_msi_irq;
+       ia64_mv_pci_fixup_bus_t *pci_fixup_bus;
+       ia64_mv_kernel_launch_event_t *kernel_launch_event;
+} __attribute__((__aligned__(16))); /* align attrib? see above comment */
+
+#define MACHVEC_INIT(name)                     \
+{                                              \
+       #name,                                  \
+       platform_setup,                         \
+       platform_cpu_init,                      \
+       platform_irq_init,                      \
+       platform_send_ipi,                      \
+       platform_timer_interrupt,               \
+       platform_global_tlb_purge,              \
+       platform_tlb_migrate_finish,            \
+       platform_dma_init,                      \
+       platform_dma_alloc_coherent,            \
+       platform_dma_free_coherent,             \
+       platform_dma_map_single_attrs,          \
+       platform_dma_unmap_single_attrs,        \
+       platform_dma_map_sg_attrs,              \
+       platform_dma_unmap_sg_attrs,            \
+       platform_dma_sync_single_for_cpu,       \
+       platform_dma_sync_sg_for_cpu,           \
+       platform_dma_sync_single_for_device,    \
+       platform_dma_sync_sg_for_device,        \
+       platform_dma_mapping_error,                     \
+       platform_dma_supported,                 \
+       platform_irq_to_vector,                 \
+       platform_local_vector_to_irq,           \
+       platform_pci_get_legacy_mem,            \
+       platform_pci_legacy_read,               \
+       platform_pci_legacy_write,              \
+       platform_inb,                           \
+       platform_inw,                           \
+       platform_inl,                           \
+       platform_outb,                          \
+       platform_outw,                          \
+       platform_outl,                          \
+       platform_mmiowb,                        \
+       platform_readb,                         \
+       platform_readw,                         \
+       platform_readl,                         \
+       platform_readq,                         \
+       platform_readb_relaxed,                 \
+       platform_readw_relaxed,                 \
+       platform_readl_relaxed,                 \
+       platform_readq_relaxed,                 \
+       platform_migrate,                       \
+       platform_setup_msi_irq,                 \
+       platform_teardown_msi_irq,              \
+       platform_pci_fixup_bus,                 \
+       platform_kernel_launch_event            \
+}
+
+extern struct ia64_machine_vector ia64_mv;
+extern void machvec_init (const char *name);
+extern void machvec_init_from_cmdline(const char *cmdline);
+
+# else
+#  error Unknown configuration.  Update arch/ia64/include/asm/machvec.h.
+# endif /* CONFIG_IA64_GENERIC */
+
+/*
+ * Declare default routines which aren't declared anywhere else:
+ */
+extern ia64_mv_dma_init                        swiotlb_init;
+extern ia64_mv_dma_alloc_coherent      swiotlb_alloc_coherent;
+extern ia64_mv_dma_free_coherent       swiotlb_free_coherent;
+extern ia64_mv_dma_map_single          swiotlb_map_single;
+extern ia64_mv_dma_map_single_attrs    swiotlb_map_single_attrs;
+extern ia64_mv_dma_unmap_single                swiotlb_unmap_single;
+extern ia64_mv_dma_unmap_single_attrs  swiotlb_unmap_single_attrs;
+extern ia64_mv_dma_map_sg              swiotlb_map_sg;
+extern ia64_mv_dma_map_sg_attrs                swiotlb_map_sg_attrs;
+extern ia64_mv_dma_unmap_sg            swiotlb_unmap_sg;
+extern ia64_mv_dma_unmap_sg_attrs      swiotlb_unmap_sg_attrs;
+extern ia64_mv_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu;
+extern ia64_mv_dma_sync_sg_for_cpu     swiotlb_sync_sg_for_cpu;
+extern ia64_mv_dma_sync_single_for_device swiotlb_sync_single_for_device;
+extern ia64_mv_dma_sync_sg_for_device  swiotlb_sync_sg_for_device;
+extern ia64_mv_dma_mapping_error       swiotlb_dma_mapping_error;
+extern ia64_mv_dma_supported           swiotlb_dma_supported;
+
+/*
+ * Define default versions so we can extend machvec for new platforms without having
+ * to update the machvec files for all existing platforms.
+ */
+#ifndef platform_setup
+# define platform_setup                        machvec_setup
+#endif
+#ifndef platform_cpu_init
+# define platform_cpu_init             machvec_noop
+#endif
+#ifndef platform_irq_init
+# define platform_irq_init             machvec_noop
+#endif
+
+#ifndef platform_send_ipi
+# define platform_send_ipi             ia64_send_ipi   /* default to architected version */
+#endif
+#ifndef platform_timer_interrupt
+# define platform_timer_interrupt      machvec_timer_interrupt
+#endif
+#ifndef platform_global_tlb_purge
+# define platform_global_tlb_purge     ia64_global_tlb_purge /* default to architected version */
+#endif
+#ifndef platform_tlb_migrate_finish
+# define platform_tlb_migrate_finish   machvec_noop_mm
+#endif
+#ifndef platform_kernel_launch_event
+# define platform_kernel_launch_event  machvec_noop
+#endif
+#ifndef platform_dma_init
+# define platform_dma_init             swiotlb_init
+#endif
+#ifndef platform_dma_alloc_coherent
+# define platform_dma_alloc_coherent   swiotlb_alloc_coherent
+#endif
+#ifndef platform_dma_free_coherent
+# define platform_dma_free_coherent    swiotlb_free_coherent
+#endif
+#ifndef platform_dma_map_single_attrs
+# define platform_dma_map_single_attrs swiotlb_map_single_attrs
+#endif
+#ifndef platform_dma_unmap_single_attrs
+# define platform_dma_unmap_single_attrs       swiotlb_unmap_single_attrs
+#endif
+#ifndef platform_dma_map_sg_attrs
+# define platform_dma_map_sg_attrs     swiotlb_map_sg_attrs
+#endif
+#ifndef platform_dma_unmap_sg_attrs
+# define platform_dma_unmap_sg_attrs   swiotlb_unmap_sg_attrs
+#endif
+#ifndef platform_dma_sync_single_for_cpu
+# define platform_dma_sync_single_for_cpu      swiotlb_sync_single_for_cpu
+#endif
+#ifndef platform_dma_sync_sg_for_cpu
+# define platform_dma_sync_sg_for_cpu          swiotlb_sync_sg_for_cpu
+#endif
+#ifndef platform_dma_sync_single_for_device
+# define platform_dma_sync_single_for_device   swiotlb_sync_single_for_device
+#endif
+#ifndef platform_dma_sync_sg_for_device
+# define platform_dma_sync_sg_for_device       swiotlb_sync_sg_for_device
+#endif
+#ifndef platform_dma_mapping_error
+# define platform_dma_mapping_error            swiotlb_dma_mapping_error
+#endif
+#ifndef platform_dma_supported
+# define  platform_dma_supported       swiotlb_dma_supported
+#endif
+#ifndef platform_irq_to_vector
+# define platform_irq_to_vector                __ia64_irq_to_vector
+#endif
+#ifndef platform_local_vector_to_irq
+# define platform_local_vector_to_irq  __ia64_local_vector_to_irq
+#endif
+#ifndef platform_pci_get_legacy_mem
+# define platform_pci_get_legacy_mem   ia64_pci_get_legacy_mem
+#endif
+#ifndef platform_pci_legacy_read
+# define platform_pci_legacy_read      ia64_pci_legacy_read
+extern int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size);
+#endif
+#ifndef platform_pci_legacy_write
+# define platform_pci_legacy_write     ia64_pci_legacy_write
+extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size);
+#endif
+#ifndef platform_inb
+# define platform_inb          __ia64_inb
+#endif
+#ifndef platform_inw
+# define platform_inw          __ia64_inw
+#endif
+#ifndef platform_inl
+# define platform_inl          __ia64_inl
+#endif
+#ifndef platform_outb
+# define platform_outb         __ia64_outb
+#endif
+#ifndef platform_outw
+# define platform_outw         __ia64_outw
+#endif
+#ifndef platform_outl
+# define platform_outl         __ia64_outl
+#endif
+#ifndef platform_mmiowb
+# define platform_mmiowb       __ia64_mmiowb
+#endif
+#ifndef platform_readb
+# define platform_readb                __ia64_readb
+#endif
+#ifndef platform_readw
+# define platform_readw                __ia64_readw
+#endif
+#ifndef platform_readl
+# define platform_readl                __ia64_readl
+#endif
+#ifndef platform_readq
+# define platform_readq                __ia64_readq
+#endif
+#ifndef platform_readb_relaxed
+# define platform_readb_relaxed        __ia64_readb_relaxed
+#endif
+#ifndef platform_readw_relaxed
+# define platform_readw_relaxed        __ia64_readw_relaxed
+#endif
+#ifndef platform_readl_relaxed
+# define platform_readl_relaxed        __ia64_readl_relaxed
+#endif
+#ifndef platform_readq_relaxed
+# define platform_readq_relaxed        __ia64_readq_relaxed
+#endif
+#ifndef platform_migrate
+# define platform_migrate machvec_noop_task
+#endif
+#ifndef platform_setup_msi_irq
+# define platform_setup_msi_irq                ((ia64_mv_setup_msi_irq_t*)NULL)
+#endif
+#ifndef platform_teardown_msi_irq
+# define platform_teardown_msi_irq     ((ia64_mv_teardown_msi_irq_t*)NULL)
+#endif
+#ifndef platform_pci_fixup_bus
+# define platform_pci_fixup_bus        machvec_noop_bus
+#endif
+
+#endif /* _ASM_IA64_MACHVEC_H */
diff --git a/arch/ia64/include/asm/machvec_dig.h b/arch/ia64/include/asm/machvec_dig.h
new file mode 100644 (file)
index 0000000..8a0752f
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASM_IA64_MACHVEC_DIG_h
+#define _ASM_IA64_MACHVEC_DIG_h
+
+extern ia64_mv_setup_t dig_setup;
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name          "dig"
+#define platform_setup         dig_setup
+
+#endif /* _ASM_IA64_MACHVEC_DIG_h */
diff --git a/arch/ia64/include/asm/machvec_hpsim.h b/arch/ia64/include/asm/machvec_hpsim.h
new file mode 100644 (file)
index 0000000..cf72fc8
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _ASM_IA64_MACHVEC_HPSIM_h
+#define _ASM_IA64_MACHVEC_HPSIM_h
+
+extern ia64_mv_setup_t hpsim_setup;
+extern ia64_mv_irq_init_t hpsim_irq_init;
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name          "hpsim"
+#define platform_setup         hpsim_setup
+#define platform_irq_init      hpsim_irq_init
+
+#endif /* _ASM_IA64_MACHVEC_HPSIM_h */
diff --git a/arch/ia64/include/asm/machvec_hpzx1.h b/arch/ia64/include/asm/machvec_hpzx1.h
new file mode 100644 (file)
index 0000000..2f57f51
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _ASM_IA64_MACHVEC_HPZX1_h
+#define _ASM_IA64_MACHVEC_HPZX1_h
+
+extern ia64_mv_setup_t                 dig_setup;
+extern ia64_mv_dma_alloc_coherent      sba_alloc_coherent;
+extern ia64_mv_dma_free_coherent       sba_free_coherent;
+extern ia64_mv_dma_map_single_attrs    sba_map_single_attrs;
+extern ia64_mv_dma_unmap_single_attrs  sba_unmap_single_attrs;
+extern ia64_mv_dma_map_sg_attrs                sba_map_sg_attrs;
+extern ia64_mv_dma_unmap_sg_attrs      sba_unmap_sg_attrs;
+extern ia64_mv_dma_supported           sba_dma_supported;
+extern ia64_mv_dma_mapping_error       sba_dma_mapping_error;
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name                          "hpzx1"
+#define platform_setup                         dig_setup
+#define platform_dma_init                      machvec_noop
+#define platform_dma_alloc_coherent            sba_alloc_coherent
+#define platform_dma_free_coherent             sba_free_coherent
+#define platform_dma_map_single_attrs          sba_map_single_attrs
+#define platform_dma_unmap_single_attrs                sba_unmap_single_attrs
+#define platform_dma_map_sg_attrs              sba_map_sg_attrs
+#define platform_dma_unmap_sg_attrs            sba_unmap_sg_attrs
+#define platform_dma_sync_single_for_cpu       machvec_dma_sync_single
+#define platform_dma_sync_sg_for_cpu           machvec_dma_sync_sg
+#define platform_dma_sync_single_for_device    machvec_dma_sync_single
+#define platform_dma_sync_sg_for_device                machvec_dma_sync_sg
+#define platform_dma_supported                 sba_dma_supported
+#define platform_dma_mapping_error             sba_dma_mapping_error
+
+#endif /* _ASM_IA64_MACHVEC_HPZX1_h */
diff --git a/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h b/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h
new file mode 100644 (file)
index 0000000..a842cdd
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
+#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
+
+extern ia64_mv_setup_t                         dig_setup;
+extern ia64_mv_dma_alloc_coherent              hwsw_alloc_coherent;
+extern ia64_mv_dma_free_coherent               hwsw_free_coherent;
+extern ia64_mv_dma_map_single_attrs            hwsw_map_single_attrs;
+extern ia64_mv_dma_unmap_single_attrs          hwsw_unmap_single_attrs;
+extern ia64_mv_dma_map_sg_attrs                        hwsw_map_sg_attrs;
+extern ia64_mv_dma_unmap_sg_attrs              hwsw_unmap_sg_attrs;
+extern ia64_mv_dma_supported                   hwsw_dma_supported;
+extern ia64_mv_dma_mapping_error               hwsw_dma_mapping_error;
+extern ia64_mv_dma_sync_single_for_cpu         hwsw_sync_single_for_cpu;
+extern ia64_mv_dma_sync_sg_for_cpu             hwsw_sync_sg_for_cpu;
+extern ia64_mv_dma_sync_single_for_device      hwsw_sync_single_for_device;
+extern ia64_mv_dma_sync_sg_for_device          hwsw_sync_sg_for_device;
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name                          "hpzx1_swiotlb"
+
+#define platform_setup                         dig_setup
+#define platform_dma_init                      machvec_noop
+#define platform_dma_alloc_coherent            hwsw_alloc_coherent
+#define platform_dma_free_coherent             hwsw_free_coherent
+#define platform_dma_map_single_attrs          hwsw_map_single_attrs
+#define platform_dma_unmap_single_attrs                hwsw_unmap_single_attrs
+#define platform_dma_map_sg_attrs              hwsw_map_sg_attrs
+#define platform_dma_unmap_sg_attrs            hwsw_unmap_sg_attrs
+#define platform_dma_supported                 hwsw_dma_supported
+#define platform_dma_mapping_error             hwsw_dma_mapping_error
+#define platform_dma_sync_single_for_cpu       hwsw_sync_single_for_cpu
+#define platform_dma_sync_sg_for_cpu           hwsw_sync_sg_for_cpu
+#define platform_dma_sync_single_for_device    hwsw_sync_single_for_device
+#define platform_dma_sync_sg_for_device                hwsw_sync_sg_for_device
+
+#endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */
diff --git a/arch/ia64/include/asm/machvec_init.h b/arch/ia64/include/asm/machvec_init.h
new file mode 100644 (file)
index 0000000..7f21249
--- /dev/null
@@ -0,0 +1,33 @@
+#include <asm/machvec.h>
+
+extern ia64_mv_send_ipi_t ia64_send_ipi;
+extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
+extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
+extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
+extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
+extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read;
+extern ia64_mv_pci_legacy_write_t ia64_pci_legacy_write;
+
+extern ia64_mv_inb_t __ia64_inb;
+extern ia64_mv_inw_t __ia64_inw;
+extern ia64_mv_inl_t __ia64_inl;
+extern ia64_mv_outb_t __ia64_outb;
+extern ia64_mv_outw_t __ia64_outw;
+extern ia64_mv_outl_t __ia64_outl;
+extern ia64_mv_mmiowb_t __ia64_mmiowb;
+extern ia64_mv_readb_t __ia64_readb;
+extern ia64_mv_readw_t __ia64_readw;
+extern ia64_mv_readl_t __ia64_readl;
+extern ia64_mv_readq_t __ia64_readq;
+extern ia64_mv_readb_t __ia64_readb_relaxed;
+extern ia64_mv_readw_t __ia64_readw_relaxed;
+extern ia64_mv_readl_t __ia64_readl_relaxed;
+extern ia64_mv_readq_t __ia64_readq_relaxed;
+
+#define MACHVEC_HELPER(name)                                                                   \
+ struct ia64_machine_vector machvec_##name __attribute__ ((unused, __section__ (".machvec")))  \
+       = MACHVEC_INIT(name);
+
+#define MACHVEC_DEFINE(name)   MACHVEC_HELPER(name)
+
+MACHVEC_DEFINE(MACHVEC_PLATFORM_NAME)
diff --git a/arch/ia64/include/asm/machvec_sn2.h b/arch/ia64/include/asm/machvec_sn2.h
new file mode 100644 (file)
index 0000000..781308e
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2002-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify it 
+ * under the terms of version 2 of the GNU General Public License 
+ * as published by the Free Software Foundation.
+ * 
+ * This program is distributed in the hope that it would be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
+ * 
+ * Further, this software is distributed without any warranty that it is 
+ * free of the rightful claim of any third person regarding infringement 
+ * or the like.  Any license provided herein, whether implied or 
+ * otherwise, applies only to this software file.  Patent licenses, if 
+ * any, provided herein do not apply to combinations of this program with 
+ * other software, or any other product whatsoever.
+ * 
+ * You should have received a copy of the GNU General Public 
+ * License along with this program; if not, write the Free Software 
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ * 
+ * For further information regarding this notice, see: 
+ * 
+ * http://oss.sgi.com/projects/GenInfo/NoticeExplan
+ */
+
+#ifndef _ASM_IA64_MACHVEC_SN2_H
+#define _ASM_IA64_MACHVEC_SN2_H
+
+extern ia64_mv_setup_t sn_setup;
+extern ia64_mv_cpu_init_t sn_cpu_init;
+extern ia64_mv_irq_init_t sn_irq_init;
+extern ia64_mv_send_ipi_t sn2_send_IPI;
+extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
+extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
+extern ia64_mv_tlb_migrate_finish_t    sn_tlb_migrate_finish;
+extern ia64_mv_irq_to_vector sn_irq_to_vector;
+extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq;
+extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem;
+extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read;
+extern ia64_mv_pci_legacy_write_t sn_pci_legacy_write;
+extern ia64_mv_inb_t __sn_inb;
+extern ia64_mv_inw_t __sn_inw;
+extern ia64_mv_inl_t __sn_inl;
+extern ia64_mv_outb_t __sn_outb;
+extern ia64_mv_outw_t __sn_outw;
+extern ia64_mv_outl_t __sn_outl;
+extern ia64_mv_mmiowb_t __sn_mmiowb;
+extern ia64_mv_readb_t __sn_readb;
+extern ia64_mv_readw_t __sn_readw;
+extern ia64_mv_readl_t __sn_readl;
+extern ia64_mv_readq_t __sn_readq;
+extern ia64_mv_readb_t __sn_readb_relaxed;
+extern ia64_mv_readw_t __sn_readw_relaxed;
+extern ia64_mv_readl_t __sn_readl_relaxed;
+extern ia64_mv_readq_t __sn_readq_relaxed;
+extern ia64_mv_dma_alloc_coherent      sn_dma_alloc_coherent;
+extern ia64_mv_dma_free_coherent       sn_dma_free_coherent;
+extern ia64_mv_dma_map_single_attrs    sn_dma_map_single_attrs;
+extern ia64_mv_dma_unmap_single_attrs  sn_dma_unmap_single_attrs;
+extern ia64_mv_dma_map_sg_attrs                sn_dma_map_sg_attrs;
+extern ia64_mv_dma_unmap_sg_attrs      sn_dma_unmap_sg_attrs;
+extern ia64_mv_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu;
+extern ia64_mv_dma_sync_sg_for_cpu     sn_dma_sync_sg_for_cpu;
+extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device;
+extern ia64_mv_dma_sync_sg_for_device  sn_dma_sync_sg_for_device;
+extern ia64_mv_dma_mapping_error       sn_dma_mapping_error;
+extern ia64_mv_dma_supported           sn_dma_supported;
+extern ia64_mv_migrate_t               sn_migrate;
+extern ia64_mv_kernel_launch_event_t   sn_kernel_launch_event;
+extern ia64_mv_setup_msi_irq_t         sn_setup_msi_irq;
+extern ia64_mv_teardown_msi_irq_t      sn_teardown_msi_irq;
+extern ia64_mv_pci_fixup_bus_t         sn_pci_fixup_bus;
+
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name                  "sn2"
+#define platform_setup                 sn_setup
+#define platform_cpu_init              sn_cpu_init
+#define platform_irq_init              sn_irq_init
+#define platform_send_ipi              sn2_send_IPI
+#define platform_timer_interrupt       sn_timer_interrupt
+#define platform_global_tlb_purge       sn2_global_tlb_purge
+#define platform_tlb_migrate_finish    sn_tlb_migrate_finish
+#define platform_pci_fixup             sn_pci_fixup
+#define platform_inb                   __sn_inb
+#define platform_inw                   __sn_inw
+#define platform_inl                   __sn_inl
+#define platform_outb                  __sn_outb
+#define platform_outw                  __sn_outw
+#define platform_outl                  __sn_outl
+#define platform_mmiowb                        __sn_mmiowb
+#define platform_readb                 __sn_readb
+#define platform_readw                 __sn_readw
+#define platform_readl                 __sn_readl
+#define platform_readq                 __sn_readq
+#define platform_readb_relaxed         __sn_readb_relaxed
+#define platform_readw_relaxed         __sn_readw_relaxed
+#define platform_readl_relaxed         __sn_readl_relaxed
+#define platform_readq_relaxed         __sn_readq_relaxed
+#define platform_irq_to_vector         sn_irq_to_vector
+#define platform_local_vector_to_irq   sn_local_vector_to_irq
+#define platform_pci_get_legacy_mem    sn_pci_get_legacy_mem
+#define platform_pci_legacy_read       sn_pci_legacy_read
+#define platform_pci_legacy_write      sn_pci_legacy_write
+#define platform_dma_init              machvec_noop
+#define platform_dma_alloc_coherent    sn_dma_alloc_coherent
+#define platform_dma_free_coherent     sn_dma_free_coherent
+#define platform_dma_map_single_attrs  sn_dma_map_single_attrs
+#define platform_dma_unmap_single_attrs        sn_dma_unmap_single_attrs
+#define platform_dma_map_sg_attrs      sn_dma_map_sg_attrs
+#define platform_dma_unmap_sg_attrs    sn_dma_unmap_sg_attrs
+#define platform_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu
+#define platform_dma_sync_sg_for_cpu   sn_dma_sync_sg_for_cpu
+#define platform_dma_sync_single_for_device sn_dma_sync_single_for_device
+#define platform_dma_sync_sg_for_device        sn_dma_sync_sg_for_device
+#define platform_dma_mapping_error             sn_dma_mapping_error
+#define platform_dma_supported         sn_dma_supported
+#define platform_migrate               sn_migrate
+#define platform_kernel_launch_event    sn_kernel_launch_event
+#ifdef CONFIG_PCI_MSI
+#define platform_setup_msi_irq         sn_setup_msi_irq
+#define platform_teardown_msi_irq      sn_teardown_msi_irq
+#else
+#define platform_setup_msi_irq         ((ia64_mv_setup_msi_irq_t*)NULL)
+#define platform_teardown_msi_irq      ((ia64_mv_teardown_msi_irq_t*)NULL)
+#endif
+#define platform_pci_fixup_bus         sn_pci_fixup_bus
+
+#include <asm/sn/io.h>
+
+#endif /* _ASM_IA64_MACHVEC_SN2_H */
diff --git a/arch/ia64/include/asm/machvec_uv.h b/arch/ia64/include/asm/machvec_uv.h
new file mode 100644 (file)
index 0000000..2931447
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ *
+ * SGI UV Core Functions
+ *
+ * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_MACHVEC_UV_H
+#define _ASM_IA64_MACHVEC_UV_H
+
+extern ia64_mv_setup_t uv_setup;
+
+/*
+ * This stuff has dual use!
+ *
+ * For a generic kernel, the macros are used to initialize the
+ * platform's machvec structure.  When compiling a non-generic kernel,
+ * the macros are used directly.
+ */
+#define platform_name                  "uv"
+#define platform_setup                 uv_setup
+
+#endif /* _ASM_IA64_MACHVEC_UV_H */
diff --git a/arch/ia64/include/asm/mc146818rtc.h b/arch/ia64/include/asm/mc146818rtc.h
new file mode 100644 (file)
index 0000000..407787a
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _ASM_IA64_MC146818RTC_H
+#define _ASM_IA64_MC146818RTC_H
+
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+
+/* empty include file to satisfy the include in genrtc.c */
+
+#endif /* _ASM_IA64_MC146818RTC_H */
diff --git a/arch/ia64/include/asm/mca.h b/arch/ia64/include/asm/mca.h
new file mode 100644 (file)
index 0000000..18a4321
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * File:       mca.h
+ * Purpose:    Machine check handling specific defines
+ *
+ * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
+ * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
+ * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
+ * Copyright (C) Russ Anderson <rja@sgi.com>
+ */
+
+#ifndef _ASM_IA64_MCA_H
+#define _ASM_IA64_MCA_H
+
+#if !defined(__ASSEMBLY__)
+
+#include <linux/interrupt.h>
+#include <linux/types.h>
+
+#include <asm/param.h>
+#include <asm/sal.h>
+#include <asm/processor.h>
+#include <asm/mca_asm.h>
+
+#define IA64_MCA_RENDEZ_TIMEOUT                (20 * 1000)     /* value in milliseconds - 20 seconds */
+
+typedef struct ia64_fptr {
+       unsigned long fp;
+       unsigned long gp;
+} ia64_fptr_t;
+
+typedef union cmcv_reg_u {
+       u64     cmcv_regval;
+       struct  {
+               u64     cmcr_vector             : 8;
+               u64     cmcr_reserved1          : 4;
+               u64     cmcr_ignored1           : 1;
+               u64     cmcr_reserved2          : 3;
+               u64     cmcr_mask               : 1;
+               u64     cmcr_ignored2           : 47;
+       } cmcv_reg_s;
+
+} cmcv_reg_t;
+
+#define cmcv_mask              cmcv_reg_s.cmcr_mask
+#define cmcv_vector            cmcv_reg_s.cmcr_vector
+
+enum {
+       IA64_MCA_RENDEZ_CHECKIN_NOTDONE =       0x0,
+       IA64_MCA_RENDEZ_CHECKIN_DONE    =       0x1,
+       IA64_MCA_RENDEZ_CHECKIN_INIT    =       0x2,
+       IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA  =       0x3,
+};
+
+/* Information maintained by the MC infrastructure */
+typedef struct ia64_mc_info_s {
+       u64             imi_mca_handler;
+       size_t          imi_mca_handler_size;
+       u64             imi_monarch_init_handler;
+       size_t          imi_monarch_init_handler_size;
+       u64             imi_slave_init_handler;
+       size_t          imi_slave_init_handler_size;
+       u8              imi_rendez_checkin[NR_CPUS];
+
+} ia64_mc_info_t;
+
+/* Handover state from SAL to OS and vice versa, for both MCA and INIT events.
+ * Besides the handover state, it also contains some saved registers from the
+ * time of the event.
+ * Note: mca_asm.S depends on the precise layout of this structure.
+ */
+
+struct ia64_sal_os_state {
+
+       /* SAL to OS */
+       u64                     os_gp;                  /* GP of the os registered with the SAL, physical */
+       u64                     pal_proc;               /* PAL_PROC entry point, physical */
+       u64                     sal_proc;               /* SAL_PROC entry point, physical */
+       u64                     rv_rc;                  /* MCA - Rendezvous state, INIT - reason code */
+       u64                     proc_state_param;       /* from R18 */
+       u64                     monarch;                /* 1 for a monarch event, 0 for a slave */
+
+       /* common */
+       u64                     sal_ra;                 /* Return address in SAL, physical */
+       u64                     sal_gp;                 /* GP of the SAL - physical */
+       pal_min_state_area_t    *pal_min_state;         /* from R17.  physical in asm, virtual in C */
+       /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK).
+        * Note: if the MCA/INIT recovery code wants to resume to a new context
+        * then it must change these values to reflect the new kernel stack.
+        */
+       u64                     prev_IA64_KR_CURRENT;   /* previous value of IA64_KR(CURRENT) */
+       u64                     prev_IA64_KR_CURRENT_STACK;
+       struct task_struct      *prev_task;             /* previous task, NULL if it is not useful */
+       /* Some interrupt registers are not saved in minstate, pt_regs or
+        * switch_stack.  Because MCA/INIT can occur when interrupts are
+        * disabled, we need to save the additional interrupt registers over
+        * MCA/INIT and resume.
+        */
+       u64                     isr;
+       u64                     ifa;
+       u64                     itir;
+       u64                     iipa;
+       u64                     iim;
+       u64                     iha;
+
+       /* OS to SAL */
+       u64                     os_status;              /* OS status to SAL, enum below */
+       u64                     context;                /* 0 if return to same context
+                                                          1 if return to new context */
+};
+
+enum {
+       IA64_MCA_CORRECTED      =       0x0,    /* Error has been corrected by OS_MCA */
+       IA64_MCA_WARM_BOOT      =       -1,     /* Warm boot of the system need from SAL */
+       IA64_MCA_COLD_BOOT      =       -2,     /* Cold boot of the system need from SAL */
+       IA64_MCA_HALT           =       -3      /* System to be halted by SAL */
+};
+
+enum {
+       IA64_INIT_RESUME        =       0x0,    /* Resume after return from INIT */
+       IA64_INIT_WARM_BOOT     =       -1,     /* Warm boot of the system need from SAL */
+};
+
+enum {
+       IA64_MCA_SAME_CONTEXT   =       0x0,    /* SAL to return to same context */
+       IA64_MCA_NEW_CONTEXT    =       -1      /* SAL to return to new context */
+};
+
+/* Per-CPU MCA state that is too big for normal per-CPU variables.  */
+
+struct ia64_mca_cpu {
+       u64 mca_stack[KERNEL_STACK_SIZE/8];
+       u64 init_stack[KERNEL_STACK_SIZE/8];
+};
+
+/* Array of physical addresses of each CPU's MCA area.  */
+extern unsigned long __per_cpu_mca[NR_CPUS];
+
+extern int cpe_vector;
+extern int ia64_cpe_irq;
+extern void ia64_mca_init(void);
+extern void ia64_mca_cpu_init(void *);
+extern void ia64_os_mca_dispatch(void);
+extern void ia64_os_mca_dispatch_end(void);
+extern void ia64_mca_ucmc_handler(struct pt_regs *, struct ia64_sal_os_state *);
+extern void ia64_init_handler(struct pt_regs *,
+                             struct switch_stack *,
+                             struct ia64_sal_os_state *);
+extern void ia64_monarch_init_handler(void);
+extern void ia64_slave_init_handler(void);
+extern void ia64_mca_cmc_vector_setup(void);
+extern int  ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *));
+extern void ia64_unreg_MCA_extension(void);
+extern u64 ia64_get_rnat(u64 *);
+extern void ia64_mca_printk(const char * fmt, ...)
+        __attribute__ ((format (printf, 1, 2)));
+
+struct ia64_mca_notify_die {
+       struct ia64_sal_os_state *sos;
+       int *monarch_cpu;
+       int *data;
+};
+
+DECLARE_PER_CPU(u64, ia64_mca_pal_base);
+
+#else  /* __ASSEMBLY__ */
+
+#define IA64_MCA_CORRECTED     0x0     /* Error has been corrected by OS_MCA */
+#define IA64_MCA_WARM_BOOT     -1      /* Warm boot of the system need from SAL */
+#define IA64_MCA_COLD_BOOT     -2      /* Cold boot of the system need from SAL */
+#define IA64_MCA_HALT          -3      /* System to be halted by SAL */
+
+#define IA64_INIT_RESUME       0x0     /* Resume after return from INIT */
+#define IA64_INIT_WARM_BOOT    -1      /* Warm boot of the system need from SAL */
+
+#define IA64_MCA_SAME_CONTEXT  0x0     /* SAL to return to same context */
+#define IA64_MCA_NEW_CONTEXT   -1      /* SAL to return to new context */
+
+#endif /* !__ASSEMBLY__ */
+#endif /* _ASM_IA64_MCA_H */
diff --git a/arch/ia64/include/asm/mca_asm.h b/arch/ia64/include/asm/mca_asm.h
new file mode 100644 (file)
index 0000000..dd2a5b1
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * File:       mca_asm.h
+ * Purpose:    Machine check handling specific defines
+ *
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
+ * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
+ * Copyright (C) 2000 Hewlett-Packard Co.
+ * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 2002 Intel Corp.
+ * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
+ * Copyright (C) 2005 Silicon Graphics, Inc
+ * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
+ */
+#ifndef _ASM_IA64_MCA_ASM_H
+#define _ASM_IA64_MCA_ASM_H
+
+#define PSR_IC         13
+#define PSR_I          14
+#define        PSR_DT          17
+#define PSR_RT         27
+#define PSR_MC         35
+#define PSR_IT         36
+#define PSR_BN         44
+
+/*
+ * This macro converts a instruction virtual address to a physical address
+ * Right now for simulation purposes the virtual addresses are
+ * direct mapped to physical addresses.
+ *     1. Lop off bits 61 thru 63 in the virtual address
+ */
+#define INST_VA_TO_PA(addr)                                                    \
+       dep     addr    = 0, addr, 61, 3
+/*
+ * This macro converts a data virtual address to a physical address
+ * Right now for simulation purposes the virtual addresses are
+ * direct mapped to physical addresses.
+ *     1. Lop off bits 61 thru 63 in the virtual address
+ */
+#define DATA_VA_TO_PA(addr)                                                    \
+       tpa     addr    = addr
+/*
+ * This macro converts a data physical address to a virtual address
+ * Right now for simulation purposes the virtual addresses are
+ * direct mapped to physical addresses.
+ *     1. Put 0x7 in bits 61 thru 63.
+ */
+#define DATA_PA_TO_VA(addr,temp)                                                       \
+       mov     temp    = 0x7   ;;                                                      \
+       dep     addr    = temp, addr, 61, 3
+
+#define GET_THIS_PADDR(reg, var)               \
+       mov     reg = IA64_KR(PER_CPU_DATA);;   \
+        addl   reg = THIS_CPU(var), reg
+
+/*
+ * This macro jumps to the instruction at the given virtual address
+ * and starts execution in physical mode with all the address
+ * translations turned off.
+ *     1.      Save the current psr
+ *     2.      Make sure that all the upper 32 bits are off
+ *
+ *     3.      Clear the interrupt enable and interrupt state collection bits
+ *             in the psr before updating the ipsr and iip.
+ *
+ *     4.      Turn off the instruction, data and rse translation bits of the psr
+ *             and store the new value into ipsr
+ *             Also make sure that the interrupts are disabled.
+ *             Ensure that we are in little endian mode.
+ *             [psr.{rt, it, dt, i, be} = 0]
+ *
+ *     5.      Get the physical address corresponding to the virtual address
+ *             of the next instruction bundle and put it in iip.
+ *             (Using magic numbers 24 and 40 in the deposint instruction since
+ *              the IA64_SDK code directly maps to lower 24bits as physical address
+ *              from a virtual address).
+ *
+ *     6.      Do an rfi to move the values from ipsr to psr and iip to ip.
+ */
+#define  PHYSICAL_MODE_ENTER(temp1, temp2, start_addr, old_psr)                                \
+       mov     old_psr = psr;                                                          \
+       ;;                                                                              \
+       dep     old_psr = 0, old_psr, 32, 32;                                           \
+                                                                                       \
+       mov     ar.rsc = 0 ;                                                            \
+       ;;                                                                              \
+       srlz.d;                                                                         \
+       mov     temp2 = ar.bspstore;                                                    \
+       ;;                                                                              \
+       DATA_VA_TO_PA(temp2);                                                           \
+       ;;                                                                              \
+       mov     temp1 = ar.rnat;                                                        \
+       ;;                                                                              \
+       mov     ar.bspstore = temp2;                                                    \
+       ;;                                                                              \
+       mov     ar.rnat = temp1;                                                        \
+       mov     temp1 = psr;                                                            \
+       mov     temp2 = psr;                                                            \
+       ;;                                                                              \
+                                                                                       \
+       dep     temp2 = 0, temp2, PSR_IC, 2;                                            \
+       ;;                                                                              \
+       mov     psr.l = temp2;                                                          \
+       ;;                                                                              \
+       srlz.d;                                                                         \
+       dep     temp1 = 0, temp1, 32, 32;                                               \
+       ;;                                                                              \
+       dep     temp1 = 0, temp1, PSR_IT, 1;                                            \
+       ;;                                                                              \
+       dep     temp1 = 0, temp1, PSR_DT, 1;                                            \
+       ;;                                                                              \
+       dep     temp1 = 0, temp1, PSR_RT, 1;                                            \
+       ;;                                                                              \
+       dep     temp1 = 0, temp1, PSR_I, 1;                                             \
+       ;;                                                                              \
+       dep     temp1 = 0, temp1, PSR_IC, 1;                                            \
+       ;;                                                                              \
+       dep     temp1 = -1, temp1, PSR_MC, 1;                                           \
+       ;;                                                                              \
+       mov     cr.ipsr = temp1;                                                        \
+       ;;                                                                              \
+       LOAD_PHYSICAL(p0, temp2, start_addr);                                           \
+       ;;                                                                              \
+       mov     cr.iip = temp2;                                                         \
+       mov     cr.ifs = r0;                                                            \
+       DATA_VA_TO_PA(sp);                                                              \
+       DATA_VA_TO_PA(gp);                                                              \
+       ;;                                                                              \
+       srlz.i;                                                                         \
+       ;;                                                                              \
+       nop     1;                                                                      \
+       nop     2;                                                                      \
+       nop     1;                                                                      \
+       nop     2;                                                                      \
+       rfi;                                                                            \
+       ;;
+
+/*
+ * This macro jumps to the instruction at the given virtual address
+ * and starts execution in virtual mode with all the address
+ * translations turned on.
+ *     1.      Get the old saved psr
+ *
+ *     2.      Clear the interrupt state collection bit in the current psr.
+ *
+ *     3.      Set the instruction translation bit back in the old psr
+ *             Note we have to do this since we are right now saving only the
+ *             lower 32-bits of old psr.(Also the old psr has the data and
+ *             rse translation bits on)
+ *
+ *     4.      Set ipsr to this old_psr with "it" bit set and "bn" = 1.
+ *
+ *     5.      Reset the current thread pointer (r13).
+ *
+ *     6.      Set iip to the virtual address of the next instruction bundle.
+ *
+ *     7.      Do an rfi to move ipsr to psr and iip to ip.
+ */
+
+#define VIRTUAL_MODE_ENTER(temp1, temp2, start_addr, old_psr)  \
+       mov     temp2 = psr;                                    \
+       ;;                                                      \
+       mov     old_psr = temp2;                                \
+       ;;                                                      \
+       dep     temp2 = 0, temp2, PSR_IC, 2;                    \
+       ;;                                                      \
+       mov     psr.l = temp2;                                  \
+       mov     ar.rsc = 0;                                     \
+       ;;                                                      \
+       srlz.d;                                                 \
+       mov     r13 = ar.k6;                                    \
+       mov     temp2 = ar.bspstore;                            \
+       ;;                                                      \
+       DATA_PA_TO_VA(temp2,temp1);                             \
+       ;;                                                      \
+       mov     temp1 = ar.rnat;                                \
+       ;;                                                      \
+       mov     ar.bspstore = temp2;                            \
+       ;;                                                      \
+       mov     ar.rnat = temp1;                                \
+       ;;                                                      \
+       mov     temp1 = old_psr;                                \
+       ;;                                                      \
+       mov     temp2 = 1;                                      \
+       ;;                                                      \
+       dep     temp1 = temp2, temp1, PSR_IC, 1;                \
+       ;;                                                      \
+       dep     temp1 = temp2, temp1, PSR_IT, 1;                \
+       ;;                                                      \
+       dep     temp1 = temp2, temp1, PSR_DT, 1;                \
+       ;;                                                      \
+       dep     temp1 = temp2, temp1, PSR_RT, 1;                \
+       ;;                                                      \
+       dep     temp1 = temp2, temp1, PSR_BN, 1;                \
+       ;;                                                      \
+                                                               \
+       mov     cr.ipsr = temp1;                                \
+       movl    temp2 = start_addr;                             \
+       ;;                                                      \
+       mov     cr.iip = temp2;                                 \
+       movl    gp = __gp                                       \
+       ;;                                                      \
+       DATA_PA_TO_VA(sp, temp1);                               \
+       srlz.i;                                                 \
+       ;;                                                      \
+       nop     1;                                              \
+       nop     2;                                              \
+       nop     1;                                              \
+       rfi                                                     \
+       ;;
+
+/*
+ * The MCA and INIT stacks in struct ia64_mca_cpu look like normal kernel
+ * stacks, except that the SAL/OS state and a switch_stack are stored near the
+ * top of the MCA/INIT stack.  To support concurrent entry to MCA or INIT, as
+ * well as MCA over INIT, each event needs its own SAL/OS state.  All entries
+ * are 16 byte aligned.
+ *
+ *      +---------------------------+
+ *      |          pt_regs          |
+ *      +---------------------------+
+ *      |        switch_stack       |
+ *      +---------------------------+
+ *      |        SAL/OS state       |
+ *      +---------------------------+
+ *      |    16 byte scratch area   |
+ *      +---------------------------+ <-------- SP at start of C MCA handler
+ *      |           .....           |
+ *      +---------------------------+
+ *      | RBS for MCA/INIT handler  |
+ *      +---------------------------+
+ *      | struct task for MCA/INIT  |
+ *      +---------------------------+ <-------- Bottom of MCA/INIT stack
+ */
+
+#define ALIGN16(x)                     ((x)&~15)
+#define MCA_PT_REGS_OFFSET             ALIGN16(KERNEL_STACK_SIZE-IA64_PT_REGS_SIZE)
+#define MCA_SWITCH_STACK_OFFSET                ALIGN16(MCA_PT_REGS_OFFSET-IA64_SWITCH_STACK_SIZE)
+#define MCA_SOS_OFFSET                 ALIGN16(MCA_SWITCH_STACK_OFFSET-IA64_SAL_OS_STATE_SIZE)
+#define MCA_SP_OFFSET                  ALIGN16(MCA_SOS_OFFSET-16)
+
+#endif /* _ASM_IA64_MCA_ASM_H */
diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h
new file mode 100644 (file)
index 0000000..7245a57
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef meminit_h
+#define meminit_h
+
+/*
+ * 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.
+ */
+
+
+/*
+ * Entries defined so far:
+ *     - boot param structure itself
+ *     - memory map
+ *     - initrd (optional)
+ *     - command line string
+ *     - kernel code & data
+ *     - crash dumping code reserved region
+ *     - Kernel memory map built from EFI memory map
+ *     - ELF core header
+ *
+ * More could be added if necessary
+ */
+#define IA64_MAX_RSVD_REGIONS 8
+
+struct rsvd_region {
+       unsigned long start;    /* virtual address of beginning of element */
+       unsigned long end;      /* virtual address of end of element + 1 */
+};
+
+extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
+extern int num_rsvd_regions;
+
+extern void find_memory (void);
+extern void reserve_memory (void);
+extern void find_initrd (void);
+extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
+extern int filter_memory (unsigned long start, unsigned long end, void *arg);
+extern unsigned long efi_memmap_init(unsigned long *s, unsigned long *e);
+extern int find_max_min_low_pfn (unsigned long , unsigned long, void *);
+
+extern unsigned long vmcore_find_descriptor_size(unsigned long address);
+extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end);
+
+/*
+ * For rounding an address to the next IA64_GRANULE_SIZE or order
+ */
+#define GRANULEROUNDDOWN(n)    ((n) & ~(IA64_GRANULE_SIZE-1))
+#define GRANULEROUNDUP(n)      (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
+#define ORDERROUNDDOWN(n)      ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1))
+
+#ifdef CONFIG_NUMA
+  extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
+#else
+# define call_pernode_memory(start, len, func) (*func)(start, len, 0)
+#endif
+
+#define IGNORE_PFN0    1       /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
+
+extern int register_active_ranges(u64 start, u64 len, int nid);
+
+#ifdef CONFIG_VIRTUAL_MEM_MAP
+# define LARGE_GAP     0x40000000 /* Use virtual mem map if hole is > than this */
+  extern unsigned long vmalloc_end;
+  extern struct page *vmem_map;
+  extern int find_largest_hole (u64 start, u64 end, void *arg);
+  extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
+  extern int vmemmap_find_next_valid_pfn(int, int);
+#else
+static inline int vmemmap_find_next_valid_pfn(int node, int i)
+{
+       return i + 1;
+}
+#endif
+#endif /* meminit_h */
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
new file mode 100644 (file)
index 0000000..c73b878
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _ASM_IA64_MMAN_H
+#define _ASM_IA64_MMAN_H
+
+/*
+ * Based on <asm-i386/mman.h>.
+ *
+ * Modified 1998-2000, 2002
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <asm-generic/mman.h>
+
+#define MAP_GROWSDOWN  0x00100         /* stack-like segment */
+#define MAP_GROWSUP    0x00200         /* register stack-like segment */
+#define MAP_DENYWRITE  0x00800         /* ETXTBSY */
+#define MAP_EXECUTABLE 0x01000         /* mark it as an executable */
+#define MAP_LOCKED     0x02000         /* pages are locked */
+#define MAP_NORESERVE  0x04000         /* don't check for reservations */
+#define MAP_POPULATE   0x08000         /* populate (prefault) pagetables */
+#define MAP_NONBLOCK   0x10000         /* do not block on IO */
+
+#define MCL_CURRENT    1               /* lock all current mappings */
+#define MCL_FUTURE     2               /* lock all future mappings */
+
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+#define arch_mmap_check        ia64_mmap_check
+int ia64_mmap_check(unsigned long addr, unsigned long len,
+               unsigned long flags);
+#endif
+#endif
+
+#endif /* _ASM_IA64_MMAN_H */
diff --git a/arch/ia64/include/asm/mmu.h b/arch/ia64/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..611432b
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __MMU_H
+#define __MMU_H
+
+/*
+ * Type for a context number.  We declare it volatile to ensure proper
+ * ordering when it's accessed outside of spinlock'd critical sections
+ * (e.g., as done in activate_mm() and init_new_context()).
+ */
+typedef volatile unsigned long mm_context_t;
+
+typedef unsigned long nv_mm_context_t;
+
+#endif
diff --git a/arch/ia64/include/asm/mmu_context.h b/arch/ia64/include/asm/mmu_context.h
new file mode 100644 (file)
index 0000000..040bc87
--- /dev/null
@@ -0,0 +1,198 @@
+#ifndef _ASM_IA64_MMU_CONTEXT_H
+#define _ASM_IA64_MMU_CONTEXT_H
+
+/*
+ * Copyright (C) 1998-2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+/*
+ * Routines to manage the allocation of task context numbers.  Task context
+ * numbers are used to reduce or eliminate the need to perform TLB flushes
+ * due to context switches.  Context numbers are implemented using ia-64
+ * region ids.  Since the IA-64 TLB does not consider the region number when
+ * performing a TLB lookup, we need to assign a unique region id to each
+ * region in a process.  We use the least significant three bits in aregion
+ * id for this purpose.
+ */
+
+#define IA64_REGION_ID_KERNEL  0 /* the kernel's region id (tlb.c depends on this being 0) */
+
+#define ia64_rid(ctx,addr)     (((ctx) << 3) | (addr >> 61))
+
+# include <asm/page.h>
+# ifndef __ASSEMBLY__
+
+#include <linux/compiler.h>
+#include <linux/percpu.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+
+#include <asm/processor.h>
+#include <asm-generic/mm_hooks.h>
+
+struct ia64_ctx {
+       spinlock_t lock;
+       unsigned int next;      /* next context number to use */
+       unsigned int limit;     /* available free range */
+       unsigned int max_ctx;   /* max. context value supported by all CPUs */
+                               /* call wrap_mmu_context when next >= max */
+       unsigned long *bitmap;  /* bitmap size is max_ctx+1 */
+       unsigned long *flushmap;/* pending rid to be flushed */
+};
+
+extern struct ia64_ctx ia64_ctx;
+DECLARE_PER_CPU(u8, ia64_need_tlb_flush);
+
+extern void mmu_context_init (void);
+extern void wrap_mmu_context (struct mm_struct *mm);
+
+static inline void
+enter_lazy_tlb (struct mm_struct *mm, struct task_struct *tsk)
+{
+}
+
+/*
+ * When the context counter wraps around all TLBs need to be flushed because
+ * an old context number might have been reused. This is signalled by the
+ * ia64_need_tlb_flush per-CPU variable, which is checked in the routine
+ * below. Called by activate_mm(). <efocht@ess.nec.de>
+ */
+static inline void
+delayed_tlb_flush (void)
+{
+       extern void local_flush_tlb_all (void);
+       unsigned long flags;
+
+       if (unlikely(__ia64_per_cpu_var(ia64_need_tlb_flush))) {
+               spin_lock_irqsave(&ia64_ctx.lock, flags);
+               if (__ia64_per_cpu_var(ia64_need_tlb_flush)) {
+                       local_flush_tlb_all();
+                       __ia64_per_cpu_var(ia64_need_tlb_flush) = 0;
+               }
+               spin_unlock_irqrestore(&ia64_ctx.lock, flags);
+       }
+}
+
+static inline nv_mm_context_t
+get_mmu_context (struct mm_struct *mm)
+{
+       unsigned long flags;
+       nv_mm_context_t context = mm->context;
+
+       if (likely(context))
+               goto out;
+
+       spin_lock_irqsave(&ia64_ctx.lock, flags);
+       /* re-check, now that we've got the lock: */
+       context = mm->context;
+       if (context == 0) {
+               cpus_clear(mm->cpu_vm_mask);
+               if (ia64_ctx.next >= ia64_ctx.limit) {
+                       ia64_ctx.next = find_next_zero_bit(ia64_ctx.bitmap,
+                                       ia64_ctx.max_ctx, ia64_ctx.next);
+                       ia64_ctx.limit = find_next_bit(ia64_ctx.bitmap,
+                                       ia64_ctx.max_ctx, ia64_ctx.next);
+                       if (ia64_ctx.next >= ia64_ctx.max_ctx)
+                               wrap_mmu_context(mm);
+               }
+               mm->context = context = ia64_ctx.next++;
+               __set_bit(context, ia64_ctx.bitmap);
+       }
+       spin_unlock_irqrestore(&ia64_ctx.lock, flags);
+out:
+       /*
+        * Ensure we're not starting to use "context" before any old
+        * uses of it are gone from our TLB.
+        */
+       delayed_tlb_flush();
+
+       return context;
+}
+
+/*
+ * Initialize context number to some sane value.  MM is guaranteed to be a
+ * brand-new address-space, so no TLB flushing is needed, ever.
+ */
+static inline int
+init_new_context (struct task_struct *p, struct mm_struct *mm)
+{
+       mm->context = 0;
+       return 0;
+}
+
+static inline void
+destroy_context (struct mm_struct *mm)
+{
+       /* Nothing to do.  */
+}
+
+static inline void
+reload_context (nv_mm_context_t context)
+{
+       unsigned long rid;
+       unsigned long rid_incr = 0;
+       unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
+
+       old_rr4 = ia64_get_rr(RGN_BASE(RGN_HPAGE));
+       rid = context << 3;     /* make space for encoding the region number */
+       rid_incr = 1 << 8;
+
+       /* encode the region id, preferred page size, and VHPT enable bit: */
+       rr0 = (rid << 8) | (PAGE_SHIFT << 2) | 1;
+       rr1 = rr0 + 1*rid_incr;
+       rr2 = rr0 + 2*rid_incr;
+       rr3 = rr0 + 3*rid_incr;
+       rr4 = rr0 + 4*rid_incr;
+#ifdef  CONFIG_HUGETLB_PAGE
+       rr4 = (rr4 & (~(0xfcUL))) | (old_rr4 & 0xfc);
+
+#  if RGN_HPAGE != 4
+#    error "reload_context assumes RGN_HPAGE is 4"
+#  endif
+#endif
+
+       ia64_set_rr0_to_rr4(rr0, rr1, rr2, rr3, rr4);
+       ia64_srlz_i();                  /* srlz.i implies srlz.d */
+}
+
+/*
+ * Must be called with preemption off
+ */
+static inline void
+activate_context (struct mm_struct *mm)
+{
+       nv_mm_context_t context;
+
+       do {
+               context = get_mmu_context(mm);
+               if (!cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
+                       cpu_set(smp_processor_id(), mm->cpu_vm_mask);
+               reload_context(context);
+               /*
+                * in the unlikely event of a TLB-flush by another thread,
+                * redo the load.
+                */
+       } while (unlikely(context != mm->context));
+}
+
+#define deactivate_mm(tsk,mm)  do { } while (0)
+
+/*
+ * Switch from address space PREV to address space NEXT.
+ */
+static inline void
+activate_mm (struct mm_struct *prev, struct mm_struct *next)
+{
+       /*
+        * We may get interrupts here, but that's OK because interrupt
+        * handlers cannot touch user-space.
+        */
+       ia64_set_kr(IA64_KR_PT_BASE, __pa(next->pgd));
+       activate_context(next);
+}
+
+#define switch_mm(prev_mm,next_mm,next_task)   activate_mm(prev_mm, next_mm)
+
+# endif /* ! __ASSEMBLY__ */
+#endif /* _ASM_IA64_MMU_CONTEXT_H */
diff --git a/arch/ia64/include/asm/mmzone.h b/arch/ia64/include/asm/mmzone.h
new file mode 100644 (file)
index 0000000..34efe88
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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) 2000,2003 Silicon Graphics, Inc.  All rights reserved.
+ * Copyright (c) 2002 NEC Corp.
+ * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
+ * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
+ */
+#ifndef _ASM_IA64_MMZONE_H
+#define _ASM_IA64_MMZONE_H
+
+#include <linux/numa.h>
+#include <asm/page.h>
+#include <asm/meminit.h>
+
+#ifdef CONFIG_NUMA
+
+static inline int pfn_to_nid(unsigned long pfn)
+{
+#ifdef CONFIG_NUMA
+       extern int paddr_to_nid(unsigned long);
+       int nid = paddr_to_nid(pfn << PAGE_SHIFT);
+       if (nid < 0)
+               return 0;
+       else
+               return nid;
+#else
+       return 0;
+#endif
+}
+
+#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
+extern int early_pfn_to_nid(unsigned long pfn);
+#endif
+
+#ifdef CONFIG_IA64_DIG /* DIG systems are small */
+# define MAX_PHYSNODE_ID       8
+# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 8)
+#else /* sn2 is the biggest case, so we use that if !DIG */
+# define MAX_PHYSNODE_ID       2048
+# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 4)
+#endif
+
+#else /* CONFIG_NUMA */
+# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 4)
+#endif /* CONFIG_NUMA */
+
+#endif /* _ASM_IA64_MMZONE_H */
diff --git a/arch/ia64/include/asm/module.h b/arch/ia64/include/asm/module.h
new file mode 100644 (file)
index 0000000..d2da61e
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _ASM_IA64_MODULE_H
+#define _ASM_IA64_MODULE_H
+
+/*
+ * IA-64-specific support for kernel module loader.
+ *
+ * Copyright (C) 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+struct elf64_shdr;                     /* forward declration */
+
+struct mod_arch_specific {
+       struct elf64_shdr *core_plt;    /* core PLT section */
+       struct elf64_shdr *init_plt;    /* init PLT section */
+       struct elf64_shdr *got;         /* global offset table */
+       struct elf64_shdr *opd;         /* official procedure descriptors */
+       struct elf64_shdr *unwind;      /* unwind-table section */
+       unsigned long gp;               /* global-pointer for module */
+
+       void *core_unw_table;           /* core unwind-table cookie returned by unwinder */
+       void *init_unw_table;           /* init unwind-table cookie returned by unwinder */
+       unsigned int next_got_entry;    /* index of next available got entry */
+};
+
+#define Elf_Shdr       Elf64_Shdr
+#define Elf_Sym                Elf64_Sym
+#define Elf_Ehdr       Elf64_Ehdr
+
+#define MODULE_PROC_FAMILY     "ia64"
+#define MODULE_ARCH_VERMAGIC   MODULE_PROC_FAMILY \
+       "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
+
+#define ARCH_SHF_SMALL SHF_IA_64_SHORT
+
+#endif /* _ASM_IA64_MODULE_H */
diff --git a/arch/ia64/include/asm/msgbuf.h b/arch/ia64/include/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..6c64c0d
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _ASM_IA64_MSGBUF_H
+#define _ASM_IA64_MSGBUF_H
+
+/*
+ * The msqid64_ds structure for IA-64 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 /* _ASM_IA64_MSGBUF_H */
diff --git a/arch/ia64/include/asm/mutex.h b/arch/ia64/include/asm/mutex.h
new file mode 100644 (file)
index 0000000..bed73a6
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * ia64 implementation of the mutex fastpath.
+ *
+ * Copyright (C) 2006 Ken Chen <kenneth.w.chen@intel.com>
+ *
+ */
+
+#ifndef _ASM_MUTEX_H
+#define _ASM_MUTEX_H
+
+/**
+ *  __mutex_fastpath_lock - try to take the lock by moving the count
+ *                          from 1 to a 0 value
+ *  @count: pointer of type atomic_t
+ *  @fail_fn: function to call if the original value was not 1
+ *
+ * Change the count from 1 to a value lower than 1, and call <fail_fn> if
+ * it wasn't 1 originally. This function MUST leave the value lower than
+ * 1 even when the "1" assertion wasn't true.
+ */
+static inline void
+__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
+{
+       if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
+               fail_fn(count);
+}
+
+/**
+ *  __mutex_fastpath_lock_retval - try to take the lock by moving the count
+ *                                 from 1 to a 0 value
+ *  @count: pointer of type atomic_t
+ *  @fail_fn: function to call if the original value was not 1
+ *
+ * Change the count from 1 to a value lower than 1, and call <fail_fn> if
+ * it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
+ * or anything the slow path function returns.
+ */
+static inline int
+__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
+{
+       if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
+               return fail_fn(count);
+       return 0;
+}
+
+/**
+ *  __mutex_fastpath_unlock - try to promote the count from 0 to 1
+ *  @count: pointer of type atomic_t
+ *  @fail_fn: function to call if the original value was not 0
+ *
+ * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
+ * In the failure case, this function is allowed to either set the value to
+ * 1, or to set it to a value lower than 1.
+ *
+ * If the implementation sets it to a value of lower than 1, then the
+ * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
+ * to return 0 otherwise.
+ */
+static inline void
+__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
+{
+       int ret = ia64_fetchadd4_rel(count, 1);
+       if (unlikely(ret < 0))
+               fail_fn(count);
+}
+
+#define __mutex_slowpath_needs_to_unlock()             1
+
+/**
+ * __mutex_fastpath_trylock - try to acquire the mutex, without waiting
+ *
+ *  @count: pointer of type atomic_t
+ *  @fail_fn: fallback function
+ *
+ * Change the count from 1 to a value lower than 1, and return 0 (failure)
+ * if it wasn't 1 originally, or return 1 (success) otherwise. This function
+ * MUST leave the value lower than 1 even when the "1" assertion wasn't true.
+ * Additionally, if the value was < 0 originally, this function must not leave
+ * it to 0 on failure.
+ *
+ * If the architecture has no effective trylock variant, it should call the
+ * <fail_fn> spinlock-based trylock variant unconditionally.
+ */
+static inline int
+__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
+{
+       if (cmpxchg_acq(count, 1, 0) == 1)
+               return 1;
+       return 0;
+}
+
+#endif
diff --git a/arch/ia64/include/asm/native/inst.h b/arch/ia64/include/asm/native/inst.h
new file mode 100644 (file)
index 0000000..c8efbf7
--- /dev/null
@@ -0,0 +1,175 @@
+/******************************************************************************
+ * arch/ia64/include/asm/native/inst.h
+ *
+ * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#define DO_SAVE_MIN            IA64_NATIVE_DO_SAVE_MIN
+
+#define __paravirt_switch_to                   ia64_native_switch_to
+#define __paravirt_leave_syscall               ia64_native_leave_syscall
+#define __paravirt_work_processed_syscall      ia64_native_work_processed_syscall
+#define __paravirt_leave_kernel                        ia64_native_leave_kernel
+#define __paravirt_pending_syscall_end         ia64_work_pending_syscall_end
+#define __paravirt_work_processed_syscall_target \
+                                               ia64_work_processed_syscall
+
+#ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
+# define PARAVIRT_POISON       0xdeadbeefbaadf00d
+# define CLOBBER(clob)                         \
+       ;;                                      \
+       movl clob = PARAVIRT_POISON;            \
+       ;;
+#else
+# define CLOBBER(clob)         /* nothing */
+#endif
+
+#define MOV_FROM_IFA(reg)      \
+       mov reg = cr.ifa
+
+#define MOV_FROM_ITIR(reg)     \
+       mov reg = cr.itir
+
+#define MOV_FROM_ISR(reg)      \
+       mov reg = cr.isr
+
+#define MOV_FROM_IHA(reg)      \
+       mov reg = cr.iha
+
+#define MOV_FROM_IPSR(pred, reg)       \
+(pred) mov reg = cr.ipsr
+
+#define MOV_FROM_IIM(reg)      \
+       mov reg = cr.iim
+
+#define MOV_FROM_IIP(reg)      \
+       mov reg = cr.iip
+
+#define MOV_FROM_IVR(reg, clob)        \
+       mov reg = cr.ivr        \
+       CLOBBER(clob)
+
+#define MOV_FROM_PSR(pred, reg, clob)  \
+(pred) mov reg = psr                   \
+       CLOBBER(clob)
+
+#define MOV_TO_IFA(reg, clob)  \
+       mov cr.ifa = reg        \
+       CLOBBER(clob)
+
+#define MOV_TO_ITIR(pred, reg, clob)   \
+(pred) mov cr.itir = reg               \
+       CLOBBER(clob)
+
+#define MOV_TO_IHA(pred, reg, clob)    \
+(pred) mov cr.iha = reg                \
+       CLOBBER(clob)
+
+#define MOV_TO_IPSR(pred, reg, clob)           \
+(pred) mov cr.ipsr = reg                       \
+       CLOBBER(clob)
+
+#define MOV_TO_IFS(pred, reg, clob)    \
+(pred) mov cr.ifs = reg                \
+       CLOBBER(clob)
+
+#define MOV_TO_IIP(reg, clob)  \
+       mov cr.iip = reg        \
+       CLOBBER(clob)
+
+#define MOV_TO_KR(kr, reg, clob0, clob1)       \
+       mov IA64_KR(kr) = reg                   \
+       CLOBBER(clob0)                          \
+       CLOBBER(clob1)
+
+#define ITC_I(pred, reg, clob) \
+(pred) itc.i reg               \
+       CLOBBER(clob)
+
+#define ITC_D(pred, reg, clob) \
+(pred) itc.d reg               \
+       CLOBBER(clob)
+
+#define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
+(pred_i) itc.i reg;                            \
+(pred_d) itc.d reg                             \
+       CLOBBER(clob)
+
+#define THASH(pred, reg0, reg1, clob)          \
+(pred) thash reg0 = reg1                       \
+       CLOBBER(clob)
+
+#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1)           \
+       ssm psr.ic | PSR_DEFAULT_BITS                                   \
+       CLOBBER(clob0)                                                  \
+       CLOBBER(clob1)                                                  \
+       ;;                                                              \
+       srlz.i /* guarantee that interruption collectin is on */        \
+       ;;
+
+#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1)    \
+       ssm psr.ic                              \
+       CLOBBER(clob0)                          \
+       CLOBBER(clob1)                          \
+       ;;                                      \
+       srlz.d
+
+#define RSM_PSR_IC(clob)       \
+       rsm psr.ic              \
+       CLOBBER(clob)
+
+#define SSM_PSR_I(pred, pred_clob, clob)       \
+(pred) ssm psr.i                               \
+       CLOBBER(clob)
+
+#define RSM_PSR_I(pred, clob0, clob1)  \
+(pred) rsm psr.i                       \
+       CLOBBER(clob0)                  \
+       CLOBBER(clob1)
+
+#define RSM_PSR_I_IC(clob0, clob1, clob2)      \
+       rsm psr.i | psr.ic                      \
+       CLOBBER(clob0)                          \
+       CLOBBER(clob1)                          \
+       CLOBBER(clob2)
+
+#define RSM_PSR_DT             \
+       rsm psr.dt
+
+#define SSM_PSR_DT_AND_SRLZ_I  \
+       ssm psr.dt              \
+       ;;                      \
+       srlz.i
+
+#define BSW_0(clob0, clob1, clob2)     \
+       bsw.0                           \
+       CLOBBER(clob0)                  \
+       CLOBBER(clob1)                  \
+       CLOBBER(clob2)
+
+#define BSW_1(clob0, clob1)    \
+       bsw.1                   \
+       CLOBBER(clob0)          \
+       CLOBBER(clob1)
+
+#define COVER  \
+       cover
+
+#define RFI    \
+       rfi
diff --git a/arch/ia64/include/asm/native/irq.h b/arch/ia64/include/asm/native/irq.h
new file mode 100644 (file)
index 0000000..887a228
--- /dev/null
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * arch/ia64/include/asm/native/irq.h
+ *
+ * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _ASM_IA64_NATIVE_IRQ_H
+#define _ASM_IA64_NATIVE_IRQ_H
+
+#define NR_VECTORS     256
+
+#if (NR_VECTORS + 32 * NR_CPUS) < 1024
+#define IA64_NATIVE_NR_IRQS (NR_VECTORS + 32 * NR_CPUS)
+#else
+#define IA64_NATIVE_NR_IRQS 1024
+#endif
+
+#endif /* _ASM_IA64_NATIVE_IRQ_H */
diff --git a/arch/ia64/include/asm/nodedata.h b/arch/ia64/include/asm/nodedata.h
new file mode 100644 (file)
index 0000000..2fb337b
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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) 2000 Silicon Graphics, Inc.  All rights reserved.
+ * Copyright (c) 2002 NEC Corp.
+ * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
+ * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
+ */
+#ifndef _ASM_IA64_NODEDATA_H
+#define _ASM_IA64_NODEDATA_H
+
+#include <linux/numa.h>
+
+#include <asm/percpu.h>
+#include <asm/mmzone.h>
+
+#ifdef CONFIG_NUMA
+
+/*
+ * Node Data. One of these structures is located on each node of a NUMA system.
+ */
+
+struct pglist_data;
+struct ia64_node_data {
+       short                   active_cpu_count;
+       short                   node;
+       struct pglist_data      *pg_data_ptrs[MAX_NUMNODES];
+};
+
+
+/*
+ * Return a pointer to the node_data structure for the executing cpu.
+ */
+#define local_node_data                (local_cpu_data->node_data)
+
+/*
+ * Given a node id, return a pointer to the pg_data_t for the node.
+ *
+ * NODE_DATA   - should be used in all code not related to system
+ *               initialization. It uses pernode data structures to minimize
+ *               offnode memory references. However, these structure are not 
+ *               present during boot. This macro can be used once cpu_init
+ *               completes.
+ */
+#define NODE_DATA(nid)         (local_node_data->pg_data_ptrs[nid])
+
+/*
+ * LOCAL_DATA_ADDR - This is to calculate the address of other node's
+ *                  "local_node_data" at hot-plug phase. The local_node_data
+ *                  is pointed by per_cpu_page. Kernel usually use it for
+ *                  just executing cpu. However, when new node is hot-added,
+ *                  the addresses of local data for other nodes are necessary
+ *                  to update all of them.
+ */
+#define LOCAL_DATA_ADDR(pgdat)                         \
+       ((struct ia64_node_data *)((u64)(pgdat) +       \
+                                  L1_CACHE_ALIGN(sizeof(struct pglist_data))))
+
+#endif /* CONFIG_NUMA */
+
+#endif /* _ASM_IA64_NODEDATA_H */
diff --git a/arch/ia64/include/asm/numa.h b/arch/ia64/include/asm/numa.h
new file mode 100644 (file)
index 0000000..3499ff5
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ *
+ * This file contains NUMA specific prototypes and definitions.
+ *
+ * 2002/08/05 Erich Focht <efocht@ess.nec.de>
+ *
+ */
+#ifndef _ASM_IA64_NUMA_H
+#define _ASM_IA64_NUMA_H
+
+
+#ifdef CONFIG_NUMA
+
+#include <linux/cache.h>
+#include <linux/cpumask.h>
+#include <linux/numa.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+
+#include <asm/mmzone.h>
+
+#define NUMA_NO_NODE   -1
+
+extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
+extern pg_data_t *pgdat_list[MAX_NUMNODES];
+
+/* Stuff below this line could be architecture independent */
+
+extern int num_node_memblks;           /* total number of memory chunks */
+
+/*
+ * List of node memory chunks. Filled when parsing SRAT table to
+ * obtain information about memory nodes.
+*/
+
+struct node_memblk_s {
+       unsigned long start_paddr;
+       unsigned long size;
+       int nid;                /* which logical node contains this chunk? */
+       int bank;               /* which mem bank on this node */
+};
+
+struct node_cpuid_s {
+       u16     phys_id;        /* id << 8 | eid */
+       int     nid;            /* logical node containing this CPU */
+};
+
+extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
+extern struct node_cpuid_s node_cpuid[NR_CPUS];
+
+/*
+ * ACPI 2.0 SLIT (System Locality Information Table)
+ * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
+ *
+ * This is a matrix with "distances" between nodes, they should be
+ * proportional to the memory access latency ratios.
+ */
+
+extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
+#define node_distance(from,to) (numa_slit[(from) * num_online_nodes() + (to)])
+
+extern int paddr_to_nid(unsigned long paddr);
+
+#define local_nodeid (cpu_to_node_map[smp_processor_id()])
+
+extern void map_cpu_to_node(int cpu, int nid);
+extern void unmap_cpu_from_node(int cpu, int nid);
+
+
+#else /* !CONFIG_NUMA */
+#define map_cpu_to_node(cpu, nid)      do{}while(0)
+#define unmap_cpu_from_node(cpu, nid)  do{}while(0)
+
+#define paddr_to_nid(addr)     0
+
+#endif /* CONFIG_NUMA */
+
+#endif /* _ASM_IA64_NUMA_H */
diff --git a/arch/ia64/include/asm/page.h b/arch/ia64/include/asm/page.h
new file mode 100644 (file)
index 0000000..5f271bc
--- /dev/null
@@ -0,0 +1,223 @@
+#ifndef _ASM_IA64_PAGE_H
+#define _ASM_IA64_PAGE_H
+/*
+ * Pagetable related stuff.
+ *
+ * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <asm/intrinsics.h>
+#include <asm/types.h>
+
+/*
+ * The top three bits of an IA64 address are its Region Number.
+ * Different regions are assigned to different purposes.
+ */
+#define RGN_SHIFT      (61)
+#define RGN_BASE(r)    (__IA64_UL_CONST(r)<<RGN_SHIFT)
+#define RGN_BITS       (RGN_BASE(-1))
+
+#define RGN_KERNEL     7       /* Identity mapped region */
+#define RGN_UNCACHED    6      /* Identity mapped I/O region */
+#define RGN_GATE       5       /* Gate page, Kernel text, etc */
+#define RGN_HPAGE      4       /* For Huge TLB pages */
+
+/*
+ * PAGE_SHIFT determines the actual kernel page size.
+ */
+#if defined(CONFIG_IA64_PAGE_SIZE_4KB)
+# define PAGE_SHIFT    12
+#elif defined(CONFIG_IA64_PAGE_SIZE_8KB)
+# define PAGE_SHIFT    13
+#elif defined(CONFIG_IA64_PAGE_SIZE_16KB)
+# define PAGE_SHIFT    14
+#elif defined(CONFIG_IA64_PAGE_SIZE_64KB)
+# define PAGE_SHIFT    16
+#else
+# error Unsupported page size!
+#endif
+
+#define PAGE_SIZE              (__IA64_UL_CONST(1) << PAGE_SHIFT)
+#define PAGE_MASK              (~(PAGE_SIZE - 1))
+
+#define PERCPU_PAGE_SHIFT      16      /* log2() of max. size of per-CPU area */
+#define PERCPU_PAGE_SIZE       (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT)
+
+
+#ifdef CONFIG_HUGETLB_PAGE
+# define HPAGE_REGION_BASE     RGN_BASE(RGN_HPAGE)
+# define HPAGE_SHIFT           hpage_shift
+# define HPAGE_SHIFT_DEFAULT   28      /* check ia64 SDM for architecture supported size */
+# define HPAGE_SIZE            (__IA64_UL_CONST(1) << HPAGE_SHIFT)
+# define HPAGE_MASK            (~(HPAGE_SIZE - 1))
+
+# define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
+#endif /* CONFIG_HUGETLB_PAGE */
+
+#ifdef __ASSEMBLY__
+# define __pa(x)               ((x) - PAGE_OFFSET)
+# define __va(x)               ((x) + PAGE_OFFSET)
+#else /* !__ASSEMBLY */
+#  define STRICT_MM_TYPECHECKS
+
+extern void clear_page (void *page);
+extern void copy_page (void *to, void *from);
+
+/*
+ * clear_user_page() and copy_user_page() can't be inline functions because
+ * flush_dcache_page() can't be defined until later...
+ */
+#define clear_user_page(addr, vaddr, page)     \
+do {                                           \
+       clear_page(addr);                       \
+       flush_dcache_page(page);                \
+} while (0)
+
+#define copy_user_page(to, from, vaddr, page)  \
+do {                                           \
+       copy_page((to), (from));                \
+       flush_dcache_page(page);                \
+} while (0)
+
+
+#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr)         \
+({                                                                     \
+       struct page *page = alloc_page_vma(                             \
+               GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr);  \
+       if (page)                                                       \
+               flush_dcache_page(page);                                \
+       page;                                                           \
+})
+
+#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
+
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
+
+#ifdef CONFIG_VIRTUAL_MEM_MAP
+extern int ia64_pfn_valid (unsigned long pfn);
+#else
+# define ia64_pfn_valid(pfn) 1
+#endif
+
+#ifdef CONFIG_VIRTUAL_MEM_MAP
+extern struct page *vmem_map;
+#ifdef CONFIG_DISCONTIGMEM
+# define page_to_pfn(page)     ((unsigned long) (page - vmem_map))
+# define pfn_to_page(pfn)      (vmem_map + (pfn))
+#else
+# include <asm-generic/memory_model.h>
+#endif
+#else
+# include <asm-generic/memory_model.h>
+#endif
+
+#ifdef CONFIG_FLATMEM
+# define pfn_valid(pfn)                (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
+#elif defined(CONFIG_DISCONTIGMEM)
+extern unsigned long min_low_pfn;
+extern unsigned long max_low_pfn;
+# define pfn_valid(pfn)                (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
+#endif
+
+#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
+#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
+
+typedef union ia64_va {
+       struct {
+               unsigned long off : 61;         /* intra-region offset */
+               unsigned long reg :  3;         /* region number */
+       } f;
+       unsigned long l;
+       void *p;
+} ia64_va;
+
+/*
+ * Note: These macros depend on the fact that PAGE_OFFSET has all
+ * region bits set to 1 and all other bits set to zero.  They are
+ * expressed in this way to ensure they result in a single "dep"
+ * instruction.
+ */
+#define __pa(x)                ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
+#define __va(x)                ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
+
+#define REGION_NUMBER(x)       ({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
+#define REGION_OFFSET(x)       ({ia64_va _v; _v.l = (long) (x); _v.f.off;})
+
+#ifdef CONFIG_HUGETLB_PAGE
+# define htlbpage_to_page(x)   (((unsigned long) REGION_NUMBER(x) << 61)                       \
+                                | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
+# define HUGETLB_PAGE_ORDER    (HPAGE_SHIFT - PAGE_SHIFT)
+extern unsigned int hpage_shift;
+#endif
+
+static __inline__ int
+get_order (unsigned long size)
+{
+       long double d = size - 1;
+       long order;
+
+       order = ia64_getf_exp(d);
+       order = order - PAGE_SHIFT - 0xffff + 1;
+       if (order < 0)
+               order = 0;
+       return order;
+}
+
+#endif /* !__ASSEMBLY__ */
+
+#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;
+#ifdef CONFIG_PGTABLE_4
+  typedef struct { unsigned long pud; } pud_t;
+#endif
+  typedef struct { unsigned long pgd; } pgd_t;
+  typedef struct { unsigned long pgprot; } pgprot_t;
+  typedef struct page *pgtable_t;
+
+# define pte_val(x)    ((x).pte)
+# define pmd_val(x)    ((x).pmd)
+#ifdef CONFIG_PGTABLE_4
+# define pud_val(x)    ((x).pud)
+#endif
+# define pgd_val(x)    ((x).pgd)
+# define pgprot_val(x) ((x).pgprot)
+
+# define __pte(x)      ((pte_t) { (x) } )
+# define __pgprot(x)   ((pgprot_t) { (x) } )
+
+#else /* !STRICT_MM_TYPECHECKS */
+  /*
+   * .. while these make it easier on the compiler
+   */
+# ifndef __ASSEMBLY__
+    typedef unsigned long pte_t;
+    typedef unsigned long pmd_t;
+    typedef unsigned long pgd_t;
+    typedef unsigned long pgprot_t;
+    typedef struct page *pgtable_t;
+# endif
+
+# 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 */
+
+#define PAGE_OFFSET                    RGN_BASE(RGN_KERNEL)
+
+#define VM_DATA_DEFAULT_FLAGS          (VM_READ | VM_WRITE |                                   \
+                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |                \
+                                        (((current->personality & READ_IMPLIES_EXEC) != 0)     \
+                                         ? VM_EXEC : 0))
+
+#endif /* _ASM_IA64_PAGE_H */
diff --git a/arch/ia64/include/asm/pal.h b/arch/ia64/include/asm/pal.h
new file mode 100644 (file)
index 0000000..67b0290
--- /dev/null
@@ -0,0 +1,1827 @@
+#ifndef _ASM_IA64_PAL_H
+#define _ASM_IA64_PAL_H
+
+/*
+ * Processor Abstraction Layer definitions.
+ *
+ * This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0
+ * chapter 11 IA-64 Processor Abstraction Layer
+ *
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *     Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 1999 VA Linux Systems
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
+ * Copyright (C) 2008 Silicon Graphics, Inc. (SGI)
+ *
+ * 99/10/01    davidm  Make sure we pass zero for reserved parameters.
+ * 00/03/07    davidm  Updated pal_cache_flush() to be in sync with PAL v2.6.
+ * 00/03/23     cfleck  Modified processor min-state save area to match updated PAL & SAL info
+ * 00/05/24     eranian Updated to latest PAL spec, fix structures bugs, added
+ * 00/05/25    eranian Support for stack calls, and static physical calls
+ * 00/06/18    eranian Support for stacked physical calls
+ * 06/10/26    rja     Support for Intel Itanium Architecture Software Developer's
+ *                     Manual Rev 2.2 (Jan 2006)
+ */
+
+/*
+ * Note that some of these calls use a static-register only calling
+ * convention which has nothing to do with the regular calling
+ * convention.
+ */
+#define PAL_CACHE_FLUSH                1       /* flush i/d cache */
+#define PAL_CACHE_INFO         2       /* get detailed i/d cache info */
+#define PAL_CACHE_INIT         3       /* initialize i/d cache */
+#define PAL_CACHE_SUMMARY      4       /* get summary of cache hierarchy */
+#define PAL_MEM_ATTRIB         5       /* list supported memory attributes */
+#define PAL_PTCE_INFO          6       /* purge TLB info */
+#define PAL_VM_INFO            7       /* return supported virtual memory features */
+#define PAL_VM_SUMMARY         8       /* return summary on supported vm features */
+#define PAL_BUS_GET_FEATURES   9       /* return processor bus interface features settings */
+#define PAL_BUS_SET_FEATURES   10      /* set processor bus features */
+#define PAL_DEBUG_INFO         11      /* get number of debug registers */
+#define PAL_FIXED_ADDR         12      /* get fixed component of processors's directed address */
+#define PAL_FREQ_BASE          13      /* base frequency of the platform */
+#define PAL_FREQ_RATIOS                14      /* ratio of processor, bus and ITC frequency */
+#define PAL_PERF_MON_INFO      15      /* return performance monitor info */
+#define PAL_PLATFORM_ADDR      16      /* set processor interrupt block and IO port space addr */
+#define PAL_PROC_GET_FEATURES  17      /* get configurable processor features & settings */
+#define PAL_PROC_SET_FEATURES  18      /* enable/disable configurable processor features */
+#define PAL_RSE_INFO           19      /* return rse information */
+#define PAL_VERSION            20      /* return version of PAL code */
+#define PAL_MC_CLEAR_LOG       21      /* clear all processor log info */
+#define PAL_MC_DRAIN           22      /* drain operations which could result in an MCA */
+#define PAL_MC_EXPECTED                23      /* set/reset expected MCA indicator */
+#define PAL_MC_DYNAMIC_STATE   24      /* get processor dynamic state */
+#define PAL_MC_ERROR_INFO      25      /* get processor MCA info and static state */
+#define PAL_MC_RESUME          26      /* Return to interrupted process */
+#define PAL_MC_REGISTER_MEM    27      /* Register memory for PAL to use during MCAs and inits */
+#define PAL_HALT               28      /* enter the low power HALT state */
+#define PAL_HALT_LIGHT         29      /* enter the low power light halt state*/
+#define PAL_COPY_INFO          30      /* returns info needed to relocate PAL */
+#define PAL_CACHE_LINE_INIT    31      /* init tags & data of cache line */
+#define PAL_PMI_ENTRYPOINT     32      /* register PMI memory entry points with the processor */
+#define PAL_ENTER_IA_32_ENV    33      /* enter IA-32 system environment */
+#define PAL_VM_PAGE_SIZE       34      /* return vm TC and page walker page sizes */
+
+#define PAL_MEM_FOR_TEST       37      /* get amount of memory needed for late processor test */
+#define PAL_CACHE_PROT_INFO    38      /* get i/d cache protection info */
+#define PAL_REGISTER_INFO      39      /* return AR and CR register information*/
+#define PAL_SHUTDOWN           40      /* enter processor shutdown state */
+#define PAL_PREFETCH_VISIBILITY        41      /* Make Processor Prefetches Visible */
+#define PAL_LOGICAL_TO_PHYSICAL 42     /* returns information on logical to physical processor mapping */
+#define PAL_CACHE_SHARED_INFO  43      /* returns information on caches shared by logical processor */
+#define PAL_GET_HW_POLICY      48      /* Get current hardware resource sharing policy */
+#define PAL_SET_HW_POLICY      49      /* Set current hardware resource sharing policy */
+#define PAL_VP_INFO            50      /* Information about virtual processor features */
+#define PAL_MC_HW_TRACKING     51      /* Hardware tracking status */
+
+#define PAL_COPY_PAL           256     /* relocate PAL procedures and PAL PMI */
+#define PAL_HALT_INFO          257     /* return the low power capabilities of processor */
+#define PAL_TEST_PROC          258     /* perform late processor self-test */
+#define PAL_CACHE_READ         259     /* read tag & data of cacheline for diagnostic testing */
+#define PAL_CACHE_WRITE                260     /* write tag & data of cacheline for diagnostic testing */
+#define PAL_VM_TR_READ         261     /* read contents of translation register */
+#define PAL_GET_PSTATE         262     /* get the current P-state */
+#define PAL_SET_PSTATE         263     /* set the P-state */
+#define PAL_BRAND_INFO         274     /* Processor branding information */
+
+#define PAL_GET_PSTATE_TYPE_LASTSET    0
+#define PAL_GET_PSTATE_TYPE_AVGANDRESET        1
+#define PAL_GET_PSTATE_TYPE_AVGNORESET 2
+#define PAL_GET_PSTATE_TYPE_INSTANT    3
+
+#define PAL_MC_ERROR_INJECT    276     /* Injects processor error or returns injection capabilities */
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+#include <asm/fpu.h>
+
+/*
+ * Data types needed to pass information into PAL procedures and
+ * interpret information returned by them.
+ */
+
+/* Return status from the PAL procedure */
+typedef s64                            pal_status_t;
+
+#define PAL_STATUS_SUCCESS             0       /* No error */
+#define PAL_STATUS_UNIMPLEMENTED       (-1)    /* Unimplemented procedure */
+#define PAL_STATUS_EINVAL              (-2)    /* Invalid argument */
+#define PAL_STATUS_ERROR               (-3)    /* Error */
+#define PAL_STATUS_CACHE_INIT_FAIL     (-4)    /* Could not initialize the
+                                                * specified level and type of
+                                                * cache without sideeffects
+                                                * and "restrict" was 1
+                                                */
+#define PAL_STATUS_REQUIRES_MEMORY     (-9)    /* Call requires PAL memory buffer */
+
+/* Processor cache level in the hierarchy */
+typedef u64                            pal_cache_level_t;
+#define PAL_CACHE_LEVEL_L0             0       /* L0 */
+#define PAL_CACHE_LEVEL_L1             1       /* L1 */
+#define PAL_CACHE_LEVEL_L2             2       /* L2 */
+
+
+/* Processor cache type at a particular level in the hierarchy */
+
+typedef u64                            pal_cache_type_t;
+#define PAL_CACHE_TYPE_INSTRUCTION     1       /* Instruction cache */
+#define PAL_CACHE_TYPE_DATA            2       /* Data or unified cache */
+#define PAL_CACHE_TYPE_INSTRUCTION_DATA        3       /* Both Data & Instruction */
+
+
+#define PAL_CACHE_FLUSH_INVALIDATE     1       /* Invalidate clean lines */
+#define PAL_CACHE_FLUSH_CHK_INTRS      2       /* check for interrupts/mc while flushing */
+
+/* Processor cache line size in bytes  */
+typedef int                            pal_cache_line_size_t;
+
+/* Processor cache line state */
+typedef u64                            pal_cache_line_state_t;
+#define PAL_CACHE_LINE_STATE_INVALID   0       /* Invalid */
+#define PAL_CACHE_LINE_STATE_SHARED    1       /* Shared */
+#define PAL_CACHE_LINE_STATE_EXCLUSIVE 2       /* Exclusive */
+#define PAL_CACHE_LINE_STATE_MODIFIED  3       /* Modified */
+
+typedef struct pal_freq_ratio {
+       u32 den, num;           /* numerator & denominator */
+} itc_ratio, proc_ratio;
+
+typedef        union  pal_cache_config_info_1_s {
+       struct {
+               u64             u               : 1,    /* 0 Unified cache ? */
+                               at              : 2,    /* 2-1 Cache mem attr*/
+                               reserved        : 5,    /* 7-3 Reserved */
+                               associativity   : 8,    /* 16-8 Associativity*/
+                               line_size       : 8,    /* 23-17 Line size */
+                               stride          : 8,    /* 31-24 Stride */
+                               store_latency   : 8,    /*39-32 Store latency*/
+                               load_latency    : 8,    /* 47-40 Load latency*/
+                               store_hints     : 8,    /* 55-48 Store hints*/
+                               load_hints      : 8;    /* 63-56 Load hints */
+       } pcci1_bits;
+       u64                     pcci1_data;
+} pal_cache_config_info_1_t;
+
+typedef        union  pal_cache_config_info_2_s {
+       struct {
+               u32             cache_size;             /*cache size in bytes*/
+
+
+               u32             alias_boundary  : 8,    /* 39-32 aliased addr
+                                                        * separation for max
+                                                        * performance.
+                                                        */
+                               tag_ls_bit      : 8,    /* 47-40 LSb of addr*/
+                               tag_ms_bit      : 8,    /* 55-48 MSb of addr*/
+                               reserved        : 8;    /* 63-56 Reserved */
+       } pcci2_bits;
+       u64                     pcci2_data;
+} pal_cache_config_info_2_t;
+
+
+typedef struct pal_cache_config_info_s {
+       pal_status_t                    pcci_status;
+       pal_cache_config_info_1_t       pcci_info_1;
+       pal_cache_config_info_2_t       pcci_info_2;
+       u64                             pcci_reserved;
+} pal_cache_config_info_t;
+
+#define pcci_ld_hints          pcci_info_1.pcci1_bits.load_hints
+#define pcci_st_hints          pcci_info_1.pcci1_bits.store_hints
+#define pcci_ld_latency                pcci_info_1.pcci1_bits.load_latency
+#define pcci_st_latency                pcci_info_1.pcci1_bits.store_latency
+#define pcci_stride            pcci_info_1.pcci1_bits.stride
+#define pcci_line_size         pcci_info_1.pcci1_bits.line_size
+#define pcci_assoc             pcci_info_1.pcci1_bits.associativity
+#define pcci_cache_attr                pcci_info_1.pcci1_bits.at
+#define pcci_unified           pcci_info_1.pcci1_bits.u
+#define pcci_tag_msb           pcci_info_2.pcci2_bits.tag_ms_bit
+#define pcci_tag_lsb           pcci_info_2.pcci2_bits.tag_ls_bit
+#define pcci_alias_boundary    pcci_info_2.pcci2_bits.alias_boundary
+#define pcci_cache_size                pcci_info_2.pcci2_bits.cache_size
+
+
+
+/* Possible values for cache attributes */
+
+#define PAL_CACHE_ATTR_WT              0       /* Write through cache */
+#define PAL_CACHE_ATTR_WB              1       /* Write back cache */
+#define PAL_CACHE_ATTR_WT_OR_WB                2       /* Either write thru or write
+                                                * back depending on TLB
+                                                * memory attributes
+                                                */
+
+
+/* Possible values for cache hints */
+
+#define PAL_CACHE_HINT_TEMP_1          0       /* Temporal level 1 */
+#define PAL_CACHE_HINT_NTEMP_1         1       /* Non-temporal level 1 */
+#define PAL_CACHE_HINT_NTEMP_ALL       3       /* Non-temporal all levels */
+
+/* Processor cache protection  information */
+typedef union pal_cache_protection_element_u {
+       u32                     pcpi_data;
+       struct {
+               u32             data_bits       : 8, /* # data bits covered by
+                                                     * each unit of protection
+                                                     */
+
+                               tagprot_lsb     : 6, /* Least -do- */
+                               tagprot_msb     : 6, /* Most Sig. tag address
+                                                     * bit that this
+                                                     * protection covers.
+                                                     */
+                               prot_bits       : 6, /* # of protection bits */
+                               method          : 4, /* Protection method */
+                               t_d             : 2; /* Indicates which part
+                                                     * of the cache this
+                                                     * protection encoding
+                                                     * applies.
+                                                     */
+       } pcp_info;
+} pal_cache_protection_element_t;
+
+#define pcpi_cache_prot_part   pcp_info.t_d
+#define pcpi_prot_method       pcp_info.method
+#define pcpi_prot_bits         pcp_info.prot_bits
+#define pcpi_tagprot_msb       pcp_info.tagprot_msb
+#define pcpi_tagprot_lsb       pcp_info.tagprot_lsb
+#define pcpi_data_bits         pcp_info.data_bits
+
+/* Processor cache part encodings */
+#define PAL_CACHE_PROT_PART_DATA       0       /* Data protection  */
+#define PAL_CACHE_PROT_PART_TAG                1       /* Tag  protection */
+#define PAL_CACHE_PROT_PART_TAG_DATA   2       /* Tag+data protection (tag is
+                                                * more significant )
+                                                */
+#define PAL_CACHE_PROT_PART_DATA_TAG   3       /* Data+tag protection (data is
+                                                * more significant )
+                                                */
+#define PAL_CACHE_PROT_PART_MAX                6
+
+
+typedef struct pal_cache_protection_info_s {
+       pal_status_t                    pcpi_status;
+       pal_cache_protection_element_t  pcp_info[PAL_CACHE_PROT_PART_MAX];
+} pal_cache_protection_info_t;
+
+
+/* Processor cache protection method encodings */
+#define PAL_CACHE_PROT_METHOD_NONE             0       /* No protection */
+#define PAL_CACHE_PROT_METHOD_ODD_PARITY       1       /* Odd parity */
+#define PAL_CACHE_PROT_METHOD_EVEN_PARITY      2       /* Even parity */
+#define PAL_CACHE_PROT_METHOD_ECC              3       /* ECC protection */
+
+
+/* Processor cache line identification in the hierarchy */
+typedef union pal_cache_line_id_u {
+       u64                     pclid_data;
+       struct {
+               u64             cache_type      : 8,    /* 7-0 cache type */
+                               level           : 8,    /* 15-8 level of the
+                                                        * cache in the
+                                                        * hierarchy.
+                                                        */
+                               way             : 8,    /* 23-16 way in the set
+                                                        */
+                               part            : 8,    /* 31-24 part of the
+                                                        * cache
+                                                        */
+                               reserved        : 32;   /* 63-32 is reserved*/
+       } pclid_info_read;
+       struct {
+               u64             cache_type      : 8,    /* 7-0 cache type */
+                               level           : 8,    /* 15-8 level of the
+                                                        * cache in the
+                                                        * hierarchy.
+                                                        */
+                               way             : 8,    /* 23-16 way in the set
+                                                        */
+                               part            : 8,    /* 31-24 part of the
+                                                        * cache
+                                                        */
+                               mesi            : 8,    /* 39-32 cache line
+                                                        * state
+                                                        */
+                               start           : 8,    /* 47-40 lsb of data to
+                                                        * invert
+                                                        */
+                               length          : 8,    /* 55-48 #bits to
+                                                        * invert
+                                                        */
+                               trigger         : 8;    /* 63-56 Trigger error
+                                                        * by doing a load
+                                                        * after the write
+                                                        */
+
+       } pclid_info_write;
+} pal_cache_line_id_u_t;
+
+#define pclid_read_part                pclid_info_read.part
+#define pclid_read_way         pclid_info_read.way
+#define pclid_read_level       pclid_info_read.level
+#define pclid_read_cache_type  pclid_info_read.cache_type
+
+#define pclid_write_trigger    pclid_info_write.trigger
+#define pclid_write_length     pclid_info_write.length
+#define pclid_write_start      pclid_info_write.start
+#define pclid_write_mesi       pclid_info_write.mesi
+#define pclid_write_part       pclid_info_write.part
+#define pclid_write_way                pclid_info_write.way
+#define pclid_write_level      pclid_info_write.level
+#define pclid_write_cache_type pclid_info_write.cache_type
+
+/* Processor cache line part encodings */
+#define PAL_CACHE_LINE_ID_PART_DATA            0       /* Data */
+#define PAL_CACHE_LINE_ID_PART_TAG             1       /* Tag */
+#define PAL_CACHE_LINE_ID_PART_DATA_PROT       2       /* Data protection */
+#define PAL_CACHE_LINE_ID_PART_TAG_PROT                3       /* Tag protection */
+#define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT   4       /* Data+tag
+                                                        * protection
+                                                        */
+typedef struct pal_cache_line_info_s {
+       pal_status_t            pcli_status;            /* Return status of the read cache line
+                                                        * info call.
+                                                        */
+       u64                     pcli_data;              /* 64-bit data, tag, protection bits .. */
+       u64                     pcli_data_len;          /* data length in bits */
+       pal_cache_line_state_t  pcli_cache_line_state;  /* mesi state */
+
+} pal_cache_line_info_t;
+
+
+/* Machine Check related crap */
+
+/* Pending event status bits  */
+typedef u64                                    pal_mc_pending_events_t;
+
+#define PAL_MC_PENDING_MCA                     (1 << 0)
+#define PAL_MC_PENDING_INIT                    (1 << 1)
+
+/* Error information type */
+typedef u64                                    pal_mc_info_index_t;
+
+#define PAL_MC_INFO_PROCESSOR                  0       /* Processor */
+#define PAL_MC_INFO_CACHE_CHECK                        1       /* Cache check */
+#define PAL_MC_INFO_TLB_CHECK                  2       /* Tlb check */
+#define PAL_MC_INFO_BUS_CHECK                  3       /* Bus check */
+#define PAL_MC_INFO_REQ_ADDR                   4       /* Requestor address */
+#define PAL_MC_INFO_RESP_ADDR                  5       /* Responder address */
+#define PAL_MC_INFO_TARGET_ADDR                        6       /* Target address */
+#define PAL_MC_INFO_IMPL_DEP                   7       /* Implementation
+                                                        * dependent
+                                                        */
+
+#define PAL_TLB_CHECK_OP_PURGE                 8
+
+typedef struct pal_process_state_info_s {
+       u64             reserved1       : 2,
+                       rz              : 1,    /* PAL_CHECK processor
+                                                * rendezvous
+                                                * successful.
+                                                */
+
+                       ra              : 1,    /* PAL_CHECK attempted
+                                                * a rendezvous.
+                                                */
+                       me              : 1,    /* Distinct multiple
+                                                * errors occurred
+                                                */
+
+                       mn              : 1,    /* Min. state save
+                                                * area has been
+                                                * registered with PAL
+                                                */
+
+                       sy              : 1,    /* Storage integrity
+                                                * synched
+                                                */
+
+
+                       co              : 1,    /* Continuable */
+                       ci              : 1,    /* MC isolated */
+                       us              : 1,    /* Uncontained storage
+                                                * damage.
+                                                */
+
+
+                       hd              : 1,    /* Non-essential hw
+                                                * lost (no loss of
+                                                * functionality)
+                                                * causing the
+                                                * processor to run in
+                                                * degraded mode.
+                                                */
+
+                       tl              : 1,    /* 1 => MC occurred
+                                                * after an instr was
+                                                * executed but before
+                                                * the trap that
+                                                * resulted from instr
+                                                * execution was
+                                                * generated.
+                                                * (Trap Lost )
+                                                */
+                       mi              : 1,    /* More information available
+                                                * call PAL_MC_ERROR_INFO
+                                                */
+                       pi              : 1,    /* Precise instruction pointer */
+                       pm              : 1,    /* Precise min-state save area */
+
+                       dy              : 1,    /* Processor dynamic
+                                                * state valid
+                                                */
+
+
+                       in              : 1,    /* 0 = MC, 1 = INIT */
+                       rs              : 1,    /* RSE valid */
+                       cm              : 1,    /* MC corrected */
+                       ex              : 1,    /* MC is expected */
+                       cr              : 1,    /* Control regs valid*/
+                       pc              : 1,    /* Perf cntrs valid */
+                       dr              : 1,    /* Debug regs valid */
+                       tr              : 1,    /* Translation regs
+                                                * valid
+                                                */
+                       rr              : 1,    /* Region regs valid */
+                       ar              : 1,    /* App regs valid */
+                       br              : 1,    /* Branch regs valid */
+                       pr              : 1,    /* Predicate registers
+                                                * valid
+                                                */
+
+                       fp              : 1,    /* fp registers valid*/
+                       b1              : 1,    /* Preserved bank one
+                                                * general registers
+                                                * are valid
+                                                */
+                       b0              : 1,    /* Preserved bank zero
+                                                * general registers
+                                                * are valid
+                                                */
+                       gr              : 1,    /* General registers
+                                                * are valid
+                                                * (excl. banked regs)
+                                                */
+                       dsize           : 16,   /* size of dynamic
+                                                * state returned
+                                                * by the processor
+                                                */
+
+                       se              : 1,    /* Shared error.  MCA in a
+                                                  shared structure */
+                       reserved2       : 10,
+                       cc              : 1,    /* Cache check */
+                       tc              : 1,    /* TLB check */
+                       bc              : 1,    /* Bus check */
+                       rc              : 1,    /* Register file check */
+                       uc              : 1;    /* Uarch check */
+
+} pal_processor_state_info_t;
+
+typedef struct pal_cache_check_info_s {
+       u64             op              : 4,    /* Type of cache
+                                                * operation that
+                                                * caused the machine
+                                                * check.
+                                                */
+                       level           : 2,    /* Cache level */
+                       reserved1       : 2,
+                       dl              : 1,    /* Failure in data part
+                                                * of cache line
+                                                */
+                       tl              : 1,    /* Failure in tag part
+                                                * of cache line
+                                                */
+                       dc              : 1,    /* Failure in dcache */
+                       ic              : 1,    /* Failure in icache */
+                       mesi            : 3,    /* Cache line state */
+                       mv              : 1,    /* mesi valid */
+                       way             : 5,    /* Way in which the
+                                                * error occurred
+                                                */
+                       wiv             : 1,    /* Way field valid */
+                       reserved2       : 1,
+                       dp              : 1,    /* Data poisoned on MBE */
+                       reserved3       : 6,
+                       hlth            : 2,    /* Health indicator */
+
+                       index           : 20,   /* Cache line index */
+                       reserved4       : 2,
+
+                       is              : 1,    /* instruction set (1 == ia32) */
+                       iv              : 1,    /* instruction set field valid */
+                       pl              : 2,    /* privilege level */
+                       pv              : 1,    /* privilege level field valid */
+                       mcc             : 1,    /* Machine check corrected */
+                       tv              : 1,    /* Target address
+                                                * structure is valid
+                                                */
+                       rq              : 1,    /* Requester identifier
+                                                * structure is valid
+                                                */
+                       rp              : 1,    /* Responder identifier
+                                                * structure is valid
+                                                */
+                       pi              : 1;    /* Precise instruction pointer
+                                                * structure is valid
+                                                */
+} pal_cache_check_info_t;
+
+typedef struct pal_tlb_check_info_s {
+
+       u64             tr_slot         : 8,    /* Slot# of TR where
+                                                * error occurred
+                                                */
+                       trv             : 1,    /* tr_slot field is valid */
+                       reserved1       : 1,
+                       level           : 2,    /* TLB level where failure occurred */
+                       reserved2       : 4,
+                       dtr             : 1,    /* Fail in data TR */
+                       itr             : 1,    /* Fail in inst TR */
+                       dtc             : 1,    /* Fail in data TC */
+                       itc             : 1,    /* Fail in inst. TC */
+                       op              : 4,    /* Cache operation */
+                       reserved3       : 6,
+                       hlth            : 2,    /* Health indicator */
+                       reserved4       : 22,
+
+                       is              : 1,    /* instruction set (1 == ia32) */
+                       iv              : 1,    /* instruction set field valid */
+                       pl              : 2,    /* privilege level */
+                       pv              : 1,    /* privilege level field valid */
+                       mcc             : 1,    /* Machine check corrected */
+                       tv              : 1,    /* Target address
+                                                * structure is valid
+                                                */
+                       rq              : 1,    /* Requester identifier
+                                                * structure is valid
+                                                */
+                       rp              : 1,    /* Responder identifier
+                                                * structure is valid
+                                                */
+                       pi              : 1;    /* Precise instruction pointer
+                                                * structure is valid
+                                                */
+} pal_tlb_check_info_t;
+
+typedef struct pal_bus_check_info_s {
+       u64             size            : 5,    /* Xaction size */
+                       ib              : 1,    /* Internal bus error */
+                       eb              : 1,    /* External bus error */
+                       cc              : 1,    /* Error occurred
+                                                * during cache-cache
+                                                * transfer.
+                                                */
+                       type            : 8,    /* Bus xaction type*/
+                       sev             : 5,    /* Bus error severity*/
+                       hier            : 2,    /* Bus hierarchy level */
+                       dp              : 1,    /* Data poisoned on MBE */
+                       bsi             : 8,    /* Bus error status
+                                                * info
+                                                */
+                       reserved2       : 22,
+
+                       is              : 1,    /* instruction set (1 == ia32) */
+                       iv              : 1,    /* instruction set field valid */
+                       pl              : 2,    /* privilege level */
+                       pv              : 1,    /* privilege level field valid */
+                       mcc             : 1,    /* Machine check corrected */
+                       tv              : 1,    /* Target address
+                                                * structure is valid
+                                                */
+                       rq              : 1,    /* Requester identifier
+                                                * structure is valid
+                                                */
+                       rp              : 1,    /* Responder identifier
+                                                * structure is valid
+                                                */
+                       pi              : 1;    /* Precise instruction pointer
+                                                * structure is valid
+                                                */
+} pal_bus_check_info_t;
+
+typedef struct pal_reg_file_check_info_s {
+       u64             id              : 4,    /* Register file identifier */
+                       op              : 4,    /* Type of register
+                                                * operation that
+                                                * caused the machine
+                                                * check.
+                                                */
+                       reg_num         : 7,    /* Register number */
+                       rnv             : 1,    /* reg_num valid */
+                       reserved2       : 38,
+
+                       is              : 1,    /* instruction set (1 == ia32) */
+                       iv              : 1,    /* instruction set field valid */
+                       pl              : 2,    /* privilege level */
+                       pv              : 1,    /* privilege level field valid */
+                       mcc             : 1,    /* Machine check corrected */
+                       reserved3       : 3,
+                       pi              : 1;    /* Precise instruction pointer
+                                                * structure is valid
+                                                */
+} pal_reg_file_check_info_t;
+
+typedef struct pal_uarch_check_info_s {
+       u64             sid             : 5,    /* Structure identification */
+                       level           : 3,    /* Level of failure */
+                       array_id        : 4,    /* Array identification */
+                       op              : 4,    /* Type of
+                                                * operation that
+                                                * caused the machine
+                                                * check.
+                                                */
+                       way             : 6,    /* Way of structure */
+                       wv              : 1,    /* way valid */
+                       xv              : 1,    /* index valid */
+                       reserved1       : 6,
+                       hlth            : 2,    /* Health indicator */
+                       index           : 8,    /* Index or set of the uarch
+                                                * structure that failed.
+                                                */
+                       reserved2       : 24,
+
+                       is              : 1,    /* instruction set (1 == ia32) */
+                       iv              : 1,    /* instruction set field valid */
+                       pl              : 2,    /* privilege level */
+                       pv              : 1,    /* privilege level field valid */
+                       mcc             : 1,    /* Machine check corrected */
+                       tv              : 1,    /* Target address
+                                                * structure is valid
+                                                */
+                       rq              : 1,    /* Requester identifier
+                                                * structure is valid
+                                                */
+                       rp              : 1,    /* Responder identifier
+                                                * structure is valid
+                                                */
+                       pi              : 1;    /* Precise instruction pointer
+                                                * structure is valid
+                                                */
+} pal_uarch_check_info_t;
+
+typedef union pal_mc_error_info_u {
+       u64                             pmei_data;
+       pal_processor_state_info_t      pme_processor;
+       pal_cache_check_info_t          pme_cache;
+       pal_tlb_check_info_t            pme_tlb;
+       pal_bus_check_info_t            pme_bus;
+       pal_reg_file_check_info_t       pme_reg_file;
+       pal_uarch_check_info_t          pme_uarch;
+} pal_mc_error_info_t;
+
+#define pmci_proc_unknown_check                        pme_processor.uc
+#define pmci_proc_bus_check                    pme_processor.bc
+#define pmci_proc_tlb_check                    pme_processor.tc
+#define pmci_proc_cache_check                  pme_processor.cc
+#define pmci_proc_dynamic_state_size           pme_processor.dsize
+#define pmci_proc_gpr_valid                    pme_processor.gr
+#define pmci_proc_preserved_bank0_gpr_valid    pme_processor.b0
+#define pmci_proc_preserved_bank1_gpr_valid    pme_processor.b1
+#define pmci_proc_fp_valid                     pme_processor.fp
+#define pmci_proc_predicate_regs_valid         pme_processor.pr
+#define pmci_proc_branch_regs_valid            pme_processor.br
+#define pmci_proc_app_regs_valid               pme_processor.ar
+#define pmci_proc_region_regs_valid            pme_processor.rr
+#define pmci_proc_translation_regs_valid       pme_processor.tr
+#define pmci_proc_debug_regs_valid             pme_processor.dr
+#define pmci_proc_perf_counters_valid          pme_processor.pc
+#define pmci_proc_control_regs_valid           pme_processor.cr
+#define pmci_proc_machine_check_expected       pme_processor.ex
+#define pmci_proc_machine_check_corrected      pme_processor.cm
+#define pmci_proc_rse_valid                    pme_processor.rs
+#define pmci_proc_machine_check_or_init                pme_processor.in
+#define pmci_proc_dynamic_state_valid          pme_processor.dy
+#define pmci_proc_operation                    pme_processor.op
+#define pmci_proc_trap_lost                    pme_processor.tl
+#define pmci_proc_hardware_damage              pme_processor.hd
+#define pmci_proc_uncontained_storage_damage   pme_processor.us
+#define pmci_proc_machine_check_isolated       pme_processor.ci
+#define pmci_proc_continuable                  pme_processor.co
+#define pmci_proc_storage_intergrity_synced    pme_processor.sy
+#define pmci_proc_min_state_save_area_regd     pme_processor.mn
+#define        pmci_proc_distinct_multiple_errors      pme_processor.me
+#define pmci_proc_pal_attempted_rendezvous     pme_processor.ra
+#define pmci_proc_pal_rendezvous_complete      pme_processor.rz
+
+
+#define pmci_cache_level                       pme_cache.level
+#define pmci_cache_line_state                  pme_cache.mesi
+#define pmci_cache_line_state_valid            pme_cache.mv
+#define pmci_cache_line_index                  pme_cache.index
+#define pmci_cache_instr_cache_fail            pme_cache.ic
+#define pmci_cache_data_cache_fail             pme_cache.dc
+#define pmci_cache_line_tag_fail               pme_cache.tl
+#define pmci_cache_line_data_fail              pme_cache.dl
+#define pmci_cache_operation                   pme_cache.op
+#define pmci_cache_way_valid                   pme_cache.wv
+#define pmci_cache_target_address_valid                pme_cache.tv
+#define pmci_cache_way                         pme_cache.way
+#define pmci_cache_mc                          pme_cache.mc
+
+#define pmci_tlb_instr_translation_cache_fail  pme_tlb.itc
+#define pmci_tlb_data_translation_cache_fail   pme_tlb.dtc
+#define pmci_tlb_instr_translation_reg_fail    pme_tlb.itr
+#define pmci_tlb_data_translation_reg_fail     pme_tlb.dtr
+#define pmci_tlb_translation_reg_slot          pme_tlb.tr_slot
+#define pmci_tlb_mc                            pme_tlb.mc
+
+#define pmci_bus_status_info                   pme_bus.bsi
+#define pmci_bus_req_address_valid             pme_bus.rq
+#define pmci_bus_resp_address_valid            pme_bus.rp
+#define pmci_bus_target_address_valid          pme_bus.tv
+#define pmci_bus_error_severity                        pme_bus.sev
+#define pmci_bus_transaction_type              pme_bus.type
+#define pmci_bus_cache_cache_transfer          pme_bus.cc
+#define pmci_bus_transaction_size              pme_bus.size
+#define pmci_bus_internal_error                        pme_bus.ib
+#define pmci_bus_external_error                        pme_bus.eb
+#define pmci_bus_mc                            pme_bus.mc
+
+/*
+ * NOTE: this min_state_save area struct only includes the 1KB
+ * architectural state save area.  The other 3 KB is scratch space
+ * for PAL.
+ */
+
+typedef struct pal_min_state_area_s {
+       u64     pmsa_nat_bits;          /* nat bits for saved GRs  */
+       u64     pmsa_gr[15];            /* GR1  - GR15             */
+       u64     pmsa_bank0_gr[16];      /* GR16 - GR31             */
+       u64     pmsa_bank1_gr[16];      /* GR16 - GR31             */
+       u64     pmsa_pr;                /* predicate registers     */
+       u64     pmsa_br0;               /* branch register 0       */
+       u64     pmsa_rsc;               /* ar.rsc                  */
+       u64     pmsa_iip;               /* cr.iip                  */
+       u64     pmsa_ipsr;              /* cr.ipsr                 */
+       u64     pmsa_ifs;               /* cr.ifs                  */
+       u64     pmsa_xip;               /* previous iip            */
+       u64     pmsa_xpsr;              /* previous psr            */
+       u64     pmsa_xfs;               /* previous ifs            */
+       u64     pmsa_br1;               /* branch register 1       */
+       u64     pmsa_reserved[70];      /* pal_min_state_area should total to 1KB */
+} pal_min_state_area_t;
+
+
+struct ia64_pal_retval {
+       /*
+        * A zero status value indicates call completed without error.
+        * A negative status value indicates reason of call failure.
+        * A positive status value indicates success but an
+        * informational value should be printed (e.g., "reboot for
+        * change to take effect").
+        */
+       s64 status;
+       u64 v0;
+       u64 v1;
+       u64 v2;
+};
+
+/*
+ * Note: Currently unused PAL arguments are generally labeled
+ * "reserved" so the value specified in the PAL documentation
+ * (generally 0) MUST be passed.  Reserved parameters are not optional
+ * parameters.
+ */
+extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
+extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
+extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
+extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
+extern void ia64_save_scratch_fpregs (struct ia64_fpreg *);
+extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
+
+#define PAL_CALL(iprv,a0,a1,a2,a3) do {                        \
+       struct ia64_fpreg fr[6];                        \
+       ia64_save_scratch_fpregs(fr);                   \
+       iprv = ia64_pal_call_static(a0, a1, a2, a3);    \
+       ia64_load_scratch_fpregs(fr);                   \
+} while (0)
+
+#define PAL_CALL_STK(iprv,a0,a1,a2,a3) do {            \
+       struct ia64_fpreg fr[6];                        \
+       ia64_save_scratch_fpregs(fr);                   \
+       iprv = ia64_pal_call_stacked(a0, a1, a2, a3);   \
+       ia64_load_scratch_fpregs(fr);                   \
+} while (0)
+
+#define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do {                   \
+       struct ia64_fpreg fr[6];                                \
+       ia64_save_scratch_fpregs(fr);                           \
+       iprv = ia64_pal_call_phys_static(a0, a1, a2, a3);       \
+       ia64_load_scratch_fpregs(fr);                           \
+} while (0)
+
+#define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do {               \
+       struct ia64_fpreg fr[6];                                \
+       ia64_save_scratch_fpregs(fr);                           \
+       iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3);      \
+       ia64_load_scratch_fpregs(fr);                           \
+} while (0)
+
+typedef int (*ia64_pal_handler) (u64, ...);
+extern ia64_pal_handler ia64_pal;
+extern void ia64_pal_handler_init (void *);
+
+extern ia64_pal_handler ia64_pal;
+
+extern pal_cache_config_info_t         l0d_cache_config_info;
+extern pal_cache_config_info_t         l0i_cache_config_info;
+extern pal_cache_config_info_t         l1_cache_config_info;
+extern pal_cache_config_info_t         l2_cache_config_info;
+
+extern pal_cache_protection_info_t     l0d_cache_protection_info;
+extern pal_cache_protection_info_t     l0i_cache_protection_info;
+extern pal_cache_protection_info_t     l1_cache_protection_info;
+extern pal_cache_protection_info_t     l2_cache_protection_info;
+
+extern pal_cache_config_info_t         pal_cache_config_info_get(pal_cache_level_t,
+                                                                 pal_cache_type_t);
+
+extern pal_cache_protection_info_t     pal_cache_protection_info_get(pal_cache_level_t,
+                                                                     pal_cache_type_t);
+
+
+extern void                            pal_error(int);
+
+
+/* Useful wrappers for the current list of pal procedures */
+
+typedef union pal_bus_features_u {
+       u64     pal_bus_features_val;
+       struct {
+               u64     pbf_reserved1                           :       29;
+               u64     pbf_req_bus_parking                     :       1;
+               u64     pbf_bus_lock_mask                       :       1;
+               u64     pbf_enable_half_xfer_rate               :       1;
+               u64     pbf_reserved2                           :       20;
+               u64     pbf_enable_shared_line_replace          :       1;
+               u64     pbf_enable_exclusive_line_replace       :       1;
+               u64     pbf_disable_xaction_queueing            :       1;
+               u64     pbf_disable_resp_err_check              :       1;
+               u64     pbf_disable_berr_check                  :       1;
+               u64     pbf_disable_bus_req_internal_err_signal :       1;
+               u64     pbf_disable_bus_req_berr_signal         :       1;
+               u64     pbf_disable_bus_init_event_check        :       1;
+               u64     pbf_disable_bus_init_event_signal       :       1;
+               u64     pbf_disable_bus_addr_err_check          :       1;
+               u64     pbf_disable_bus_addr_err_signal         :       1;
+               u64     pbf_disable_bus_data_err_check          :       1;
+       } pal_bus_features_s;
+} pal_bus_features_u_t;
+
+extern void pal_bus_features_print (u64);
+
+/* Provide information about configurable processor bus features */
+static inline s64
+ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
+                          pal_bus_features_u_t *features_status,
+                          pal_bus_features_u_t *features_control)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0);
+       if (features_avail)
+               features_avail->pal_bus_features_val = iprv.v0;
+       if (features_status)
+               features_status->pal_bus_features_val = iprv.v1;
+       if (features_control)
+               features_control->pal_bus_features_val = iprv.v2;
+       return iprv.status;
+}
+
+/* Enables/disables specific processor bus features */
+static inline s64
+ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
+       return iprv.status;
+}
+
+/* Get detailed cache information */
+static inline s64
+ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf)
+{
+       struct ia64_pal_retval iprv;
+
+       PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
+
+       if (iprv.status == 0) {
+               conf->pcci_status                 = iprv.status;
+               conf->pcci_info_1.pcci1_data      = iprv.v0;
+               conf->pcci_info_2.pcci2_data      = iprv.v1;
+               conf->pcci_reserved               = iprv.v2;
+       }
+       return iprv.status;
+
+}
+
+/* Get detailed cche protection information */
+static inline s64
+ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot)
+{
+       struct ia64_pal_retval iprv;
+
+       PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
+
+       if (iprv.status == 0) {
+               prot->pcpi_status           = iprv.status;
+               prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff;
+               prot->pcp_info[1].pcpi_data = iprv.v0 >> 32;
+               prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff;
+               prot->pcp_info[3].pcpi_data = iprv.v1 >> 32;
+               prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
+               prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
+       }
+       return iprv.status;
+}
+
+/*
+ * Flush the processor instruction or data caches.  *PROGRESS must be
+ * initialized to zero before calling this for the first time..
+ */
+static inline s64
+ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
+       if (vector)
+               *vector = iprv.v0;
+       *progress = iprv.v1;
+       return iprv.status;
+}
+
+
+/* Initialize the processor controlled caches */
+static inline s64
+ia64_pal_cache_init (u64 level, u64 cache_type, u64 rest)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, rest);
+       return iprv.status;
+}
+
+/* Initialize the tags and data of a data or unified cache line of
+ * processor controlled cache to known values without the availability
+ * of backing memory.
+ */
+static inline s64
+ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
+       return iprv.status;
+}
+
+
+/* Read the data and tag of a processor controlled cache line for diags */
+static inline s64
+ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data,
+                               physical_addr, 0);
+       return iprv.status;
+}
+
+/* Return summary information about the hierarchy of caches controlled by the processor */
+static inline s64
+ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_CACHE_SUMMARY, 0, 0, 0);
+       if (cache_levels)
+               *cache_levels = iprv.v0;
+       if (unique_caches)
+               *unique_caches = iprv.v1;
+       return iprv.status;
+}
+
+/* Write the data and tag of a processor-controlled cache line for diags */
+static inline s64
+ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data,
+                               physical_addr, data);
+       return iprv.status;
+}
+
+
+/* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
+static inline s64
+ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
+                   u64 *buffer_size, u64 *buffer_align)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
+       if (buffer_size)
+               *buffer_size = iprv.v0;
+       if (buffer_align)
+               *buffer_align = iprv.v1;
+       return iprv.status;
+}
+
+/* Copy relocatable PAL procedures from ROM to memory */
+static inline s64
+ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
+       if (pal_proc_offset)
+               *pal_proc_offset = iprv.v0;
+       return iprv.status;
+}
+
+/* Return the number of instruction and data debug register pairs */
+static inline s64
+ia64_pal_debug_info (u64 *inst_regs,  u64 *data_regs)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
+       if (inst_regs)
+               *inst_regs = iprv.v0;
+       if (data_regs)
+               *data_regs = iprv.v1;
+
+       return iprv.status;
+}
+
+#ifdef TBD
+/* Switch from IA64-system environment to IA-32 system environment */
+static inline s64
+ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
+       return iprv.status;
+}
+#endif
+
+/* Get unique geographical address of this processor on its bus */
+static inline s64
+ia64_pal_fixed_addr (u64 *global_unique_addr)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
+       if (global_unique_addr)
+               *global_unique_addr = iprv.v0;
+       return iprv.status;
+}
+
+/* Get base frequency of the platform if generated by the processor */
+static inline s64
+ia64_pal_freq_base (u64 *platform_base_freq)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
+       if (platform_base_freq)
+               *platform_base_freq = iprv.v0;
+       return iprv.status;
+}
+
+/*
+ * Get the ratios for processor frequency, bus frequency and interval timer to
+ * to base frequency of the platform
+ */
+static inline s64
+ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
+                     struct pal_freq_ratio *itc_ratio)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
+       if (proc_ratio)
+               *(u64 *)proc_ratio = iprv.v0;
+       if (bus_ratio)
+               *(u64 *)bus_ratio = iprv.v1;
+       if (itc_ratio)
+               *(u64 *)itc_ratio = iprv.v2;
+       return iprv.status;
+}
+
+/*
+ * Get the current hardware resource sharing policy of the processor
+ */
+static inline s64
+ia64_pal_get_hw_policy (u64 proc_num, u64 *cur_policy, u64 *num_impacted,
+                       u64 *la)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_GET_HW_POLICY, proc_num, 0, 0);
+       if (cur_policy)
+               *cur_policy = iprv.v0;
+       if (num_impacted)
+               *num_impacted = iprv.v1;
+       if (la)
+               *la = iprv.v2;
+       return iprv.status;
+}
+
+/* Make the processor enter HALT or one of the implementation dependent low
+ * power states where prefetching and execution are suspended and cache and
+ * TLB coherency is not maintained.
+ */
+static inline s64
+ia64_pal_halt (u64 halt_state)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
+       return iprv.status;
+}
+
+typedef union pal_power_mgmt_info_u {
+       u64                     ppmi_data;
+       struct {
+              u64              exit_latency            : 16,
+                               entry_latency           : 16,
+                               power_consumption       : 28,
+                               im                      : 1,
+                               co                      : 1,
+                               reserved                : 2;
+       } pal_power_mgmt_info_s;
+} pal_power_mgmt_info_u_t;
+
+/* Return information about processor's optional power management capabilities. */
+static inline s64
+ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
+       return iprv.status;
+}
+
+/* Get the current P-state information */
+static inline s64
+ia64_pal_get_pstate (u64 *pstate_index, unsigned long type)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_GET_PSTATE, type, 0, 0);
+       *pstate_index = iprv.v0;
+       return iprv.status;
+}
+
+/* Set the P-state */
+static inline s64
+ia64_pal_set_pstate (u64 pstate_index)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0);
+       return iprv.status;
+}
+
+/* Processor branding information*/
+static inline s64
+ia64_pal_get_brand_info (char *brand_info)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
+       return iprv.status;
+}
+
+/* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
+ * suspended, but cache and TLB coherency is maintained.
+ */
+static inline s64
+ia64_pal_halt_light (void)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
+       return iprv.status;
+}
+
+/* Clear all the processor error logging   registers and reset the indicator that allows
+ * the error logging registers to be written. This procedure also checks the pending
+ * machine check bit and pending INIT bit and reports their states.
+ */
+static inline s64
+ia64_pal_mc_clear_log (u64 *pending_vector)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
+       if (pending_vector)
+               *pending_vector = iprv.v0;
+       return iprv.status;
+}
+
+/* Ensure that all outstanding transactions in a processor are completed or that any
+ * MCA due to thes outstanding transaction is taken.
+ */
+static inline s64
+ia64_pal_mc_drain (void)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
+       return iprv.status;
+}
+
+/* Return the machine check dynamic processor state */
+static inline s64
+ia64_pal_mc_dynamic_state (u64 info_type, u64 dy_buffer, u64 *size)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, info_type, dy_buffer, 0);
+       if (size)
+               *size = iprv.v0;
+       return iprv.status;
+}
+
+/* Return processor machine check information */
+static inline s64
+ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
+       if (size)
+               *size = iprv.v0;
+       if (error_info)
+               *error_info = iprv.v1;
+       return iprv.status;
+}
+
+/* Injects the requested processor error or returns info on
+ * supported injection capabilities for current processor implementation
+ */
+static inline s64
+ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info,
+                       u64 err_data_buffer, u64 *capabilities, u64 *resources)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
+                         err_struct_info, err_data_buffer);
+       if (capabilities)
+               *capabilities= iprv.v0;
+       if (resources)
+               *resources= iprv.v1;
+       return iprv.status;
+}
+
+static inline s64
+ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info,
+                       u64 err_data_buffer, u64 *capabilities, u64 *resources)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
+                         err_struct_info, err_data_buffer);
+       if (capabilities)
+               *capabilities= iprv.v0;
+       if (resources)
+               *resources= iprv.v1;
+       return iprv.status;
+}
+
+/* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
+ * attempt to correct any expected machine checks.
+ */
+static inline s64
+ia64_pal_mc_expected (u64 expected, u64 *previous)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
+       if (previous)
+               *previous = iprv.v0;
+       return iprv.status;
+}
+
+typedef union pal_hw_tracking_u {
+       u64                     pht_data;
+       struct {
+               u64             itc     :4,     /* Instruction cache tracking */
+                               dct     :4,     /* Date cache tracking */
+                               itt     :4,     /* Instruction TLB tracking */
+                               ddt     :4,     /* Data TLB tracking */
+                               reserved:48;
+       } pal_hw_tracking_s;
+} pal_hw_tracking_u_t;
+
+/*
+ * Hardware tracking status.
+ */
+static inline s64
+ia64_pal_mc_hw_tracking (u64 *status)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_HW_TRACKING, 0, 0, 0);
+       if (status)
+               *status = iprv.v0;
+       return iprv.status;
+}
+
+/* Register a platform dependent location with PAL to which it can save
+ * minimal processor state in the event of a machine check or initialization
+ * event.
+ */
+static inline s64
+ia64_pal_mc_register_mem (u64 physical_addr, u64 size, u64 *req_size)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, size, 0);
+       if (req_size)
+               *req_size = iprv.v0;
+       return iprv.status;
+}
+
+/* Restore minimal architectural processor state, set CMC interrupt if necessary
+ * and resume execution
+ */
+static inline s64
+ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
+       return iprv.status;
+}
+
+/* Return the memory attributes implemented by the processor */
+static inline s64
+ia64_pal_mem_attrib (u64 *mem_attrib)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
+       if (mem_attrib)
+               *mem_attrib = iprv.v0 & 0xff;
+       return iprv.status;
+}
+
+/* Return the amount of memory needed for second phase of processor
+ * self-test and the required alignment of memory.
+ */
+static inline s64
+ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_MEM_FOR_TEST, 0, 0, 0);
+       if (bytes_needed)
+               *bytes_needed = iprv.v0;
+       if (alignment)
+               *alignment = iprv.v1;
+       return iprv.status;
+}
+
+typedef union pal_perf_mon_info_u {
+       u64                       ppmi_data;
+       struct {
+              u64              generic         : 8,
+                               width           : 8,
+                               cycles          : 8,
+                               retired         : 8,
+                               reserved        : 32;
+       } pal_perf_mon_info_s;
+} pal_perf_mon_info_u_t;
+
+/* Return the performance monitor information about what can be counted
+ * and how to configure the monitors to count the desired events.
+ */
+static inline s64
+ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
+       if (pm_info)
+               pm_info->ppmi_data = iprv.v0;
+       return iprv.status;
+}
+
+/* Specifies the physical address of the processor interrupt block
+ * and I/O port space.
+ */
+static inline s64
+ia64_pal_platform_addr (u64 type, u64 physical_addr)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
+       return iprv.status;
+}
+
+/* Set the SAL PMI entrypoint in memory */
+static inline s64
+ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
+       return iprv.status;
+}
+
+struct pal_features_s;
+/* Provide information about configurable processor features */
+static inline s64
+ia64_pal_proc_get_features (u64 *features_avail,
+                           u64 *features_status,
+                           u64 *features_control,
+                           u64 features_set)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, features_set, 0);
+       if (iprv.status == 0) {
+               *features_avail   = iprv.v0;
+               *features_status  = iprv.v1;
+               *features_control = iprv.v2;
+       }
+       return iprv.status;
+}
+
+/* Enable/disable processor dependent features */
+static inline s64
+ia64_pal_proc_set_features (u64 feature_select)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
+       return iprv.status;
+}
+
+/*
+ * Put everything in a struct so we avoid the global offset table whenever
+ * possible.
+ */
+typedef struct ia64_ptce_info_s {
+       u64             base;
+       u32             count[2];
+       u32             stride[2];
+} ia64_ptce_info_t;
+
+/* Return the information required for the architected loop used to purge
+ * (initialize) the entire TC
+ */
+static inline s64
+ia64_get_ptce (ia64_ptce_info_t *ptce)
+{
+       struct ia64_pal_retval iprv;
+
+       if (!ptce)
+               return -1;
+
+       PAL_CALL(iprv, PAL_PTCE_INFO, 0, 0, 0);
+       if (iprv.status == 0) {
+               ptce->base = iprv.v0;
+               ptce->count[0] = iprv.v1 >> 32;
+               ptce->count[1] = iprv.v1 & 0xffffffff;
+               ptce->stride[0] = iprv.v2 >> 32;
+               ptce->stride[1] = iprv.v2 & 0xffffffff;
+       }
+       return iprv.status;
+}
+
+/* Return info about implemented application and control registers. */
+static inline s64
+ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
+       if (reg_info_1)
+               *reg_info_1 = iprv.v0;
+       if (reg_info_2)
+               *reg_info_2 = iprv.v1;
+       return iprv.status;
+}
+
+typedef union pal_hints_u {
+       u64                     ph_data;
+       struct {
+              u64              si              : 1,
+                               li              : 1,
+                               reserved        : 62;
+       } pal_hints_s;
+} pal_hints_u_t;
+
+/* Return information about the register stack and RSE for this processor
+ * implementation.
+ */
+static inline s64
+ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
+       if (num_phys_stacked)
+               *num_phys_stacked = iprv.v0;
+       if (hints)
+               hints->ph_data = iprv.v1;
+       return iprv.status;
+}
+
+/*
+ * Set the current hardware resource sharing policy of the processor
+ */
+static inline s64
+ia64_pal_set_hw_policy (u64 policy)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_SET_HW_POLICY, policy, 0, 0);
+       return iprv.status;
+}
+
+/* Cause the processor to enter        SHUTDOWN state, where prefetching and execution are
+ * suspended, but cause cache and TLB coherency to be maintained.
+ * This is usually called in IA-32 mode.
+ */
+static inline s64
+ia64_pal_shutdown (void)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
+       return iprv.status;
+}
+
+/* Perform the second phase of processor self-test. */
+static inline s64
+ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
+       if (self_test_state)
+               *self_test_state = iprv.v0;
+       return iprv.status;
+}
+
+typedef union  pal_version_u {
+       u64     pal_version_val;
+       struct {
+               u64     pv_pal_b_rev            :       8;
+               u64     pv_pal_b_model          :       8;
+               u64     pv_reserved1            :       8;
+               u64     pv_pal_vendor           :       8;
+               u64     pv_pal_a_rev            :       8;
+               u64     pv_pal_a_model          :       8;
+               u64     pv_reserved2            :       16;
+       } pal_version_s;
+} pal_version_u_t;
+
+
+/*
+ * Return PAL version information.  While the documentation states that
+ * PAL_VERSION can be called in either physical or virtual mode, some
+ * implementations only allow physical calls.  We don't call it very often,
+ * so the overhead isn't worth eliminating.
+ */
+static inline s64
+ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
+       if (pal_min_version)
+               pal_min_version->pal_version_val = iprv.v0;
+
+       if (pal_cur_version)
+               pal_cur_version->pal_version_val = iprv.v1;
+
+       return iprv.status;
+}
+
+typedef union pal_tc_info_u {
+       u64                     pti_val;
+       struct {
+              u64              num_sets        :       8,
+                               associativity   :       8,
+                               num_entries     :       16,
+                               pf              :       1,
+                               unified         :       1,
+                               reduce_tr       :       1,
+                               reserved        :       29;
+       } pal_tc_info_s;
+} pal_tc_info_u_t;
+
+#define tc_reduce_tr           pal_tc_info_s.reduce_tr
+#define tc_unified             pal_tc_info_s.unified
+#define tc_pf                  pal_tc_info_s.pf
+#define tc_num_entries         pal_tc_info_s.num_entries
+#define tc_associativity       pal_tc_info_s.associativity
+#define tc_num_sets            pal_tc_info_s.num_sets
+
+
+/* Return information about the virtual memory characteristics of the processor
+ * implementation.
+ */
+static inline s64
+ia64_pal_vm_info (u64 tc_level, u64 tc_type,  pal_tc_info_u_t *tc_info, u64 *tc_pages)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_VM_INFO, tc_level, tc_type, 0);
+       if (tc_info)
+               tc_info->pti_val = iprv.v0;
+       if (tc_pages)
+               *tc_pages = iprv.v1;
+       return iprv.status;
+}
+
+/* Get page size information about the virtual memory characteristics of the processor
+ * implementation.
+ */
+static inline s64
+ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_VM_PAGE_SIZE, 0, 0, 0);
+       if (tr_pages)
+               *tr_pages = iprv.v0;
+       if (vw_pages)
+               *vw_pages = iprv.v1;
+       return iprv.status;
+}
+
+typedef union pal_vm_info_1_u {
+       u64                     pvi1_val;
+       struct {
+               u64             vw              : 1,
+                               phys_add_size   : 7,
+                               key_size        : 8,
+                               max_pkr         : 8,
+                               hash_tag_id     : 8,
+                               max_dtr_entry   : 8,
+                               max_itr_entry   : 8,
+                               max_unique_tcs  : 8,
+                               num_tc_levels   : 8;
+       } pal_vm_info_1_s;
+} pal_vm_info_1_u_t;
+
+#define PAL_MAX_PURGES         0xFFFF          /* all ones is means unlimited */
+
+typedef union pal_vm_info_2_u {
+       u64                     pvi2_val;
+       struct {
+               u64             impl_va_msb     : 8,
+                               rid_size        : 8,
+                               max_purges      : 16,
+                               reserved        : 32;
+       } pal_vm_info_2_s;
+} pal_vm_info_2_u_t;
+
+/* Get summary information about the virtual memory characteristics of the processor
+ * implementation.
+ */
+static inline s64
+ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
+       if (vm_info_1)
+               vm_info_1->pvi1_val = iprv.v0;
+       if (vm_info_2)
+               vm_info_2->pvi2_val = iprv.v1;
+       return iprv.status;
+}
+
+typedef union pal_vp_info_u {
+       u64                     pvi_val;
+       struct {
+               u64             index:          48,     /* virtual feature set info */
+                               vmm_id:         16;     /* feature set id */
+       } pal_vp_info_s;
+} pal_vp_info_u_t;
+
+/*
+ * Returns infomation about virtual processor features
+ */
+static inline s64
+ia64_pal_vp_info (u64 feature_set, u64 vp_buffer, u64 *vp_info, u64 *vmm_id)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_VP_INFO, feature_set, vp_buffer, 0);
+       if (vp_info)
+               *vp_info = iprv.v0;
+       if (vmm_id)
+               *vmm_id = iprv.v1;
+       return iprv.status;
+}
+
+typedef union pal_itr_valid_u {
+       u64                     piv_val;
+       struct {
+              u64              access_rights_valid     : 1,
+                               priv_level_valid        : 1,
+                               dirty_bit_valid         : 1,
+                               mem_attr_valid          : 1,
+                               reserved                : 60;
+       } pal_tr_valid_s;
+} pal_tr_valid_u_t;
+
+/* Read a translation register */
+static inline s64
+ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)ia64_tpa(tr_buffer));
+       if (tr_valid)
+               tr_valid->piv_val = iprv.v0;
+       return iprv.status;
+}
+
+/*
+ * PAL_PREFETCH_VISIBILITY transaction types
+ */
+#define PAL_VISIBILITY_VIRTUAL         0
+#define PAL_VISIBILITY_PHYSICAL                1
+
+/*
+ * PAL_PREFETCH_VISIBILITY return codes
+ */
+#define PAL_VISIBILITY_OK              1
+#define PAL_VISIBILITY_OK_REMOTE_NEEDED        0
+#define PAL_VISIBILITY_INVAL_ARG       -2
+#define PAL_VISIBILITY_ERROR           -3
+
+static inline s64
+ia64_pal_prefetch_visibility (s64 trans_type)
+{
+       struct ia64_pal_retval iprv;
+       PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0);
+       return iprv.status;
+}
+
+/* data structure for getting information on logical to physical mappings */
+typedef union pal_log_overview_u {
+       struct {
+               u64     num_log         :16,    /* Total number of logical
+                                                * processors on this die
+                                                */
+                       tpc             :8,     /* Threads per core */
+                       reserved3       :8,     /* Reserved */
+                       cpp             :8,     /* Cores per processor */
+                       reserved2       :8,     /* Reserved */
+                       ppid            :8,     /* Physical processor ID */
+                       reserved1       :8;     /* Reserved */
+       } overview_bits;
+       u64 overview_data;
+} pal_log_overview_t;
+
+typedef union pal_proc_n_log_info1_u{
+       struct {
+               u64     tid             :16,    /* Thread id */
+                       reserved2       :16,    /* Reserved */
+                       cid             :16,    /* Core id */
+                       reserved1       :16;    /* Reserved */
+       } ppli1_bits;
+       u64     ppli1_data;
+} pal_proc_n_log_info1_t;
+
+typedef union pal_proc_n_log_info2_u {
+       struct {
+               u64     la              :16,    /* Logical address */
+                       reserved        :48;    /* Reserved */
+       } ppli2_bits;
+       u64     ppli2_data;
+} pal_proc_n_log_info2_t;
+
+typedef struct pal_logical_to_physical_s
+{
+       pal_log_overview_t overview;
+       pal_proc_n_log_info1_t ppli1;
+       pal_proc_n_log_info2_t ppli2;
+} pal_logical_to_physical_t;
+
+#define overview_num_log       overview.overview_bits.num_log
+#define overview_tpc           overview.overview_bits.tpc
+#define overview_cpp           overview.overview_bits.cpp
+#define overview_ppid          overview.overview_bits.ppid
+#define log1_tid               ppli1.ppli1_bits.tid
+#define log1_cid               ppli1.ppli1_bits.cid
+#define log2_la                        ppli2.ppli2_bits.la
+
+/* Get information on logical to physical processor mappings. */
+static inline s64
+ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
+{
+       struct ia64_pal_retval iprv;
+
+       PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
+
+       if (iprv.status == PAL_STATUS_SUCCESS)
+       {
+               mapping->overview.overview_data = iprv.v0;
+               mapping->ppli1.ppli1_data = iprv.v1;
+               mapping->ppli2.ppli2_data = iprv.v2;
+       }
+
+       return iprv.status;
+}
+
+typedef struct pal_cache_shared_info_s
+{
+       u64 num_shared;
+       pal_proc_n_log_info1_t ppli1;
+       pal_proc_n_log_info2_t ppli2;
+} pal_cache_shared_info_t;
+
+/* Get information on logical to physical processor mappings. */
+static inline s64
+ia64_pal_cache_shared_info(u64 level,
+               u64 type,
+               u64 proc_number,
+               pal_cache_shared_info_t *info)
+{
+       struct ia64_pal_retval iprv;
+
+       PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
+
+       if (iprv.status == PAL_STATUS_SUCCESS) {
+               info->num_shared = iprv.v0;
+               info->ppli1.ppli1_data = iprv.v1;
+               info->ppli2.ppli2_data = iprv.v2;
+       }
+
+       return iprv.status;
+}
+#endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_IA64_PAL_H */
diff --git a/arch/ia64/include/asm/param.h b/arch/ia64/include/asm/param.h
new file mode 100644 (file)
index 0000000..0964c32
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _ASM_IA64_PARAM_H
+#define _ASM_IA64_PARAM_H
+
+/*
+ * Fundamental kernel parameters.
+ *
+ * Based on <asm-i386/param.h>.
+ *
+ * Modified 1998, 1999, 2002-2003
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#define EXEC_PAGESIZE  65536
+
+#ifndef NOGROUP
+# define NOGROUP       (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64      /* max length of hostname */
+
+#ifdef __KERNEL__
+# define HZ            CONFIG_HZ
+# define USER_HZ       HZ
+# define CLOCKS_PER_SEC        HZ      /* frequency at which times() counts */
+#else
+   /*
+    * Technically, this is wrong, but some old apps still refer to it.  The proper way to
+    * get the HZ value is via sysconf(_SC_CLK_TCK).
+    */
+# define HZ 1024
+#endif
+
+#endif /* _ASM_IA64_PARAM_H */
diff --git a/arch/ia64/include/asm/paravirt.h b/arch/ia64/include/asm/paravirt.h
new file mode 100644 (file)
index 0000000..660cab0
--- /dev/null
@@ -0,0 +1,253 @@
+/******************************************************************************
+ * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+#ifndef __ASM_PARAVIRT_H
+#define __ASM_PARAVIRT_H
+
+#ifdef CONFIG_PARAVIRT_GUEST
+
+#define PARAVIRT_HYPERVISOR_TYPE_DEFAULT       0
+#define PARAVIRT_HYPERVISOR_TYPE_XEN           1
+
+#ifndef __ASSEMBLY__
+
+#include <asm/hw_irq.h>
+#include <asm/meminit.h>
+
+/******************************************************************************
+ * general info
+ */
+struct pv_info {
+       unsigned int kernel_rpl;
+       int paravirt_enabled;
+       const char *name;
+};
+
+extern struct pv_info pv_info;
+
+static inline int paravirt_enabled(void)
+{
+       return pv_info.paravirt_enabled;
+}
+
+static inline unsigned int get_kernel_rpl(void)
+{
+       return pv_info.kernel_rpl;
+}
+
+/******************************************************************************
+ * initialization hooks.
+ */
+struct rsvd_region;
+
+struct pv_init_ops {
+       void (*banner)(void);
+
+       int (*reserve_memory)(struct rsvd_region *region);
+
+       void (*arch_setup_early)(void);
+       void (*arch_setup_console)(char **cmdline_p);
+       int (*arch_setup_nomca)(void);
+
+       void (*post_smp_prepare_boot_cpu)(void);
+};
+
+extern struct pv_init_ops pv_init_ops;
+
+static inline void paravirt_banner(void)
+{
+       if (pv_init_ops.banner)
+               pv_init_ops.banner();
+}
+
+static inline int paravirt_reserve_memory(struct rsvd_region *region)
+{
+       if (pv_init_ops.reserve_memory)
+               return pv_init_ops.reserve_memory(region);
+       return 0;
+}
+
+static inline void paravirt_arch_setup_early(void)
+{
+       if (pv_init_ops.arch_setup_early)
+               pv_init_ops.arch_setup_early();
+}
+
+static inline void paravirt_arch_setup_console(char **cmdline_p)
+{
+       if (pv_init_ops.arch_setup_console)
+               pv_init_ops.arch_setup_console(cmdline_p);
+}
+
+static inline int paravirt_arch_setup_nomca(void)
+{
+       if (pv_init_ops.arch_setup_nomca)
+               return pv_init_ops.arch_setup_nomca();
+       return 0;
+}
+
+static inline void paravirt_post_smp_prepare_boot_cpu(void)
+{
+       if (pv_init_ops.post_smp_prepare_boot_cpu)
+               pv_init_ops.post_smp_prepare_boot_cpu();
+}
+
+/******************************************************************************
+ * replacement of iosapic operations.
+ */
+
+struct pv_iosapic_ops {
+       void (*pcat_compat_init)(void);
+
+       struct irq_chip *(*get_irq_chip)(unsigned long trigger);
+
+       unsigned int (*__read)(char __iomem *iosapic, unsigned int reg);
+       void (*__write)(char __iomem *iosapic, unsigned int reg, u32 val);
+};
+
+extern struct pv_iosapic_ops pv_iosapic_ops;
+
+static inline void
+iosapic_pcat_compat_init(void)
+{
+       if (pv_iosapic_ops.pcat_compat_init)
+               pv_iosapic_ops.pcat_compat_init();
+}
+
+static inline struct irq_chip*
+iosapic_get_irq_chip(unsigned long trigger)
+{
+       return pv_iosapic_ops.get_irq_chip(trigger);
+}
+
+static inline unsigned int
+__iosapic_read(char __iomem *iosapic, unsigned int reg)
+{
+       return pv_iosapic_ops.__read(iosapic, reg);
+}
+
+static inline void
+__iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
+{
+       return pv_iosapic_ops.__write(iosapic, reg, val);
+}
+
+/******************************************************************************
+ * replacement of irq operations.
+ */
+
+struct pv_irq_ops {
+       void (*register_ipi)(void);
+
+       int (*assign_irq_vector)(int irq);
+       void (*free_irq_vector)(int vector);
+
+       void (*register_percpu_irq)(ia64_vector vec,
+                                   struct irqaction *action);
+
+       void (*resend_irq)(unsigned int vector);
+};
+
+extern struct pv_irq_ops pv_irq_ops;
+
+static inline void
+ia64_register_ipi(void)
+{
+       pv_irq_ops.register_ipi();
+}
+
+static inline int
+assign_irq_vector(int irq)
+{
+       return pv_irq_ops.assign_irq_vector(irq);
+}
+
+static inline void
+free_irq_vector(int vector)
+{
+       return pv_irq_ops.free_irq_vector(vector);
+}
+
+static inline void
+register_percpu_irq(ia64_vector vec, struct irqaction *action)
+{
+       pv_irq_ops.register_percpu_irq(vec, action);
+}
+
+static inline void
+ia64_resend_irq(unsigned int vector)
+{
+       pv_irq_ops.resend_irq(vector);
+}
+
+/******************************************************************************
+ * replacement of time operations.
+ */
+
+extern struct itc_jitter_data_t itc_jitter_data;
+extern volatile int time_keeper_id;
+
+struct pv_time_ops {
+       void (*init_missing_ticks_accounting)(int cpu);
+       int (*do_steal_accounting)(unsigned long *new_itm);
+
+       void (*clocksource_resume)(void);
+};
+
+extern struct pv_time_ops pv_time_ops;
+
+static inline void
+paravirt_init_missing_ticks_accounting(int cpu)
+{
+       if (pv_time_ops.init_missing_ticks_accounting)
+               pv_time_ops.init_missing_ticks_accounting(cpu);
+}
+
+static inline int
+paravirt_do_steal_accounting(unsigned long *new_itm)
+{
+       return pv_time_ops.do_steal_accounting(new_itm);
+}
+
+#endif /* !__ASSEMBLY__ */
+
+#else
+/* fallback for native case */
+
+#ifndef __ASSEMBLY__
+
+#define paravirt_banner()                              do { } while (0)
+#define paravirt_reserve_memory(region)                        0
+
+#define paravirt_arch_setup_early()                    do { } while (0)
+#define paravirt_arch_setup_console(cmdline_p)         do { } while (0)
+#define paravirt_arch_setup_nomca()                    0
+#define paravirt_post_smp_prepare_boot_cpu()           do { } while (0)
+
+#define paravirt_init_missing_ticks_accounting(cpu)    do { } while (0)
+#define paravirt_do_steal_accounting(new_itm)          0
+
+#endif /* __ASSEMBLY__ */
+
+
+#endif /* CONFIG_PARAVIRT_GUEST */
+
+#endif /* __ASM_PARAVIRT_H */
diff --git a/arch/ia64/include/asm/paravirt_privop.h b/arch/ia64/include/asm/paravirt_privop.h
new file mode 100644 (file)
index 0000000..d577aac
--- /dev/null
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef _ASM_IA64_PARAVIRT_PRIVOP_H
+#define _ASM_IA64_PARAVIRT_PRIVOP_H
+
+#ifdef CONFIG_PARAVIRT
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+#include <asm/kregs.h> /* for IA64_PSR_I */
+
+/******************************************************************************
+ * replacement of intrinsics operations.
+ */
+
+struct pv_cpu_ops {
+       void (*fc)(unsigned long addr);
+       unsigned long (*thash)(unsigned long addr);
+       unsigned long (*get_cpuid)(int index);
+       unsigned long (*get_pmd)(int index);
+       unsigned long (*getreg)(int reg);
+       void (*setreg)(int reg, unsigned long val);
+       void (*ptcga)(unsigned long addr, unsigned long size);
+       unsigned long (*get_rr)(unsigned long index);
+       void (*set_rr)(unsigned long index, unsigned long val);
+       void (*set_rr0_to_rr4)(unsigned long val0, unsigned long val1,
+                              unsigned long val2, unsigned long val3,
+                              unsigned long val4);
+       void (*ssm_i)(void);
+       void (*rsm_i)(void);
+       unsigned long (*get_psr_i)(void);
+       void (*intrin_local_irq_restore)(unsigned long flags);
+};
+
+extern struct pv_cpu_ops pv_cpu_ops;
+
+extern void ia64_native_setreg_func(int regnum, unsigned long val);
+extern unsigned long ia64_native_getreg_func(int regnum);
+
+/************************************************/
+/* Instructions paravirtualized for performance */
+/************************************************/
+
+/* mask for ia64_native_ssm/rsm() must be constant.("i" constraing).
+ * static inline function doesn't satisfy it. */
+#define paravirt_ssm(mask)                     \
+       do {                                    \
+               if ((mask) == IA64_PSR_I)       \
+                       pv_cpu_ops.ssm_i();     \
+               else                            \
+                       ia64_native_ssm(mask);  \
+       } while (0)
+
+#define paravirt_rsm(mask)                     \
+       do {                                    \
+               if ((mask) == IA64_PSR_I)       \
+                       pv_cpu_ops.rsm_i();     \
+               else                            \
+                       ia64_native_rsm(mask);  \
+       } while (0)
+
+/******************************************************************************
+ * replacement of hand written assembly codes.
+ */
+struct pv_cpu_asm_switch {
+       unsigned long switch_to;
+       unsigned long leave_syscall;
+       unsigned long work_processed_syscall;
+       unsigned long leave_kernel;
+};
+void paravirt_cpu_asm_init(const struct pv_cpu_asm_switch *cpu_asm_switch);
+
+#endif /* __ASSEMBLY__ */
+
+#define IA64_PARAVIRT_ASM_FUNC(name)   paravirt_ ## name
+
+#else
+
+/* fallback for native case */
+#define IA64_PARAVIRT_ASM_FUNC(name)   ia64_native_ ## name
+
+#endif /* CONFIG_PARAVIRT */
+
+/* these routines utilize privilege-sensitive or performance-sensitive
+ * privileged instructions so the code must be replaced with
+ * paravirtualized versions */
+#define ia64_switch_to                 IA64_PARAVIRT_ASM_FUNC(switch_to)
+#define ia64_leave_syscall             IA64_PARAVIRT_ASM_FUNC(leave_syscall)
+#define ia64_work_processed_syscall    \
+       IA64_PARAVIRT_ASM_FUNC(work_processed_syscall)
+#define ia64_leave_kernel              IA64_PARAVIRT_ASM_FUNC(leave_kernel)
+
+#endif /* _ASM_IA64_PARAVIRT_PRIVOP_H */
diff --git a/arch/ia64/include/asm/parport.h b/arch/ia64/include/asm/parport.h
new file mode 100644 (file)
index 0000000..67e16ad
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * 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_IA64_PARPORT_H
+#define _ASM_IA64_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_IA64_PARPORT_H */
diff --git a/arch/ia64/include/asm/patch.h b/arch/ia64/include/asm/patch.h
new file mode 100644 (file)
index 0000000..295fe6a
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _ASM_IA64_PATCH_H
+#define _ASM_IA64_PATCH_H
+
+/*
+ * Copyright (C) 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ * There are a number of reasons for patching instructions.  Rather than duplicating code
+ * all over the place, we put the common stuff here.  Reasons for patching: in-kernel
+ * module-loader, virtual-to-physical patch-list, McKinley Errata 9 workaround, and gate
+ * shared library.  Undoubtedly, some of these reasons will disappear and others will
+ * be added over time.
+ */
+#include <linux/elf.h>
+#include <linux/types.h>
+
+extern void ia64_patch (u64 insn_addr, u64 mask, u64 val);     /* patch any insn slot */
+extern void ia64_patch_imm64 (u64 insn_addr, u64 val);         /* patch "movl" w/abs. value*/
+extern void ia64_patch_imm60 (u64 insn_addr, u64 val);         /* patch "brl" w/ip-rel value */
+
+extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end);
+extern void ia64_patch_vtop (unsigned long start, unsigned long end);
+extern void ia64_patch_phys_stack_reg(unsigned long val);
+extern void ia64_patch_rse (unsigned long start, unsigned long end);
+extern void ia64_patch_gate (void);
+
+#endif /* _ASM_IA64_PATCH_H */
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
new file mode 100644 (file)
index 0000000..0149097
--- /dev/null
@@ -0,0 +1,167 @@
+#ifndef _ASM_IA64_PCI_H
+#define _ASM_IA64_PCI_H
+
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#include <asm/io.h>
+#include <asm/scatterlist.h>
+#include <asm/hw_irq.h>
+
+/*
+ * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
+ * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
+ * loader.
+ */
+#define pcibios_assign_all_busses()     0
+#define pcibios_scan_all_fns(a, b)     0
+
+#define PCIBIOS_MIN_IO         0x1000
+#define PCIBIOS_MIN_MEM                0x10000000
+
+void pcibios_config_init(void);
+
+struct pci_dev;
+
+/*
+ * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct
+ * correspondence between device bus addresses and CPU physical addresses.
+ * Platforms with a hardware I/O MMU _must_ turn this off to suppress the
+ * bounce buffer handling code in the block and network device layers.
+ * Platforms with separate bus address spaces _must_ turn this off and provide
+ * a device DMA mapping implementation that takes care of the necessary
+ * address translation.
+ *
+ * For now, the ia64 platforms which may have separate/multiple bus address
+ * spaces all have I/O MMUs which support the merging of physically
+ * discontiguous buffers, so we can use that as the sole factor to determine
+ * the setting of PCI_DMA_BUS_IS_PHYS.
+ */
+extern unsigned long ia64_max_iommu_merge_mask;
+#define PCI_DMA_BUS_IS_PHYS    (ia64_max_iommu_merge_mask == ~0UL)
+
+static inline void
+pcibios_set_master (struct pci_dev *dev)
+{
+       /* No special bus mastering setup handling */
+}
+
+static inline void
+pcibios_penalize_isa_irq (int irq, int active)
+{
+       /* We don't do dynamic PCI IRQ allocation */
+}
+
+#include <asm-generic/pci-dma-compat.h>
+
+/* 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))
+
+#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_MULTIPLE;
+       *strategy_parameter = cacheline_size;
+}
+#endif
+
+#define HAVE_PCI_MMAP
+extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
+                               enum pci_mmap_state mmap_state, int write_combine);
+#define HAVE_PCI_LEGACY
+extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
+                                     struct vm_area_struct *vma);
+extern ssize_t pci_read_legacy_io(struct kobject *kobj,
+                                 struct bin_attribute *bin_attr,
+                                 char *buf, loff_t off, size_t count);
+extern ssize_t pci_write_legacy_io(struct kobject *kobj,
+                                  struct bin_attribute *bin_attr,
+                                  char *buf, loff_t off, size_t count);
+extern int pci_mmap_legacy_mem(struct kobject *kobj,
+                              struct bin_attribute *attr,
+                              struct vm_area_struct *vma);
+
+#define pci_get_legacy_mem platform_pci_get_legacy_mem
+#define pci_legacy_read platform_pci_legacy_read
+#define pci_legacy_write platform_pci_legacy_write
+
+struct pci_window {
+       struct resource resource;
+       u64 offset;
+};
+
+struct pci_controller {
+       void *acpi_handle;
+       void *iommu;
+       int segment;
+       int node;               /* nearest node with memory or -1 for global allocation */
+
+       unsigned int windows;
+       struct pci_window *window;
+
+       void *platform_data;
+};
+
+#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
+#define pci_domain_nr(busdev)    (PCI_CONTROLLER(busdev)->segment)
+
+extern struct pci_ops pci_root_ops;
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+       return (pci_domain_nr(bus) != 0);
+}
+
+extern void pcibios_resource_to_bus(struct pci_dev *dev,
+               struct pci_bus_region *region, struct resource *res);
+
+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 pcibios_scan_all_fns(a, b)     0
+
+#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
+{
+       return channel ? isa_irq_to_vector(15) : isa_irq_to_vector(14);
+}
+
+#endif /* _ASM_IA64_PCI_H */
diff --git a/arch/ia64/include/asm/percpu.h b/arch/ia64/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..77f30b6
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef _ASM_IA64_PERCPU_H
+#define _ASM_IA64_PERCPU_H
+
+/*
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
+
+#ifdef __ASSEMBLY__
+# define THIS_CPU(var) (per_cpu__##var)  /* use this to mark accesses to per-CPU variables... */
+#else /* !__ASSEMBLY__ */
+
+
+#include <linux/threads.h>
+
+#ifdef CONFIG_SMP
+
+#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
+# define PER_CPU_ATTRIBUTES    __attribute__((__model__ (__small__)))
+#endif
+
+#define __my_cpu_offset        __ia64_per_cpu_var(local_per_cpu_offset)
+
+extern void *per_cpu_init(void);
+
+#else /* ! SMP */
+
+#define PER_CPU_ATTRIBUTES     __attribute__((__section__(".data.percpu")))
+
+#define per_cpu_init()                         (__phys_per_cpu_start)
+
+#endif /* SMP */
+
+/*
+ * Be extremely careful when taking the address of this variable!  Due to virtual
+ * remapping, it is different from the canonical address returned by __get_cpu_var(var)!
+ * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
+ * more efficient.
+ */
+#define __ia64_per_cpu_var(var)        per_cpu__##var
+
+#include <asm-generic/percpu.h>
+
+/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
+DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_PERCPU_H */
diff --git a/arch/ia64/include/asm/perfmon.h b/arch/ia64/include/asm/perfmon.h
new file mode 100644 (file)
index 0000000..7f3333d
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * Copyright (C) 2001-2003 Hewlett-Packard Co
+ *               Stephane Eranian <eranian@hpl.hp.com>
+ */
+
+#ifndef _ASM_IA64_PERFMON_H
+#define _ASM_IA64_PERFMON_H
+
+/*
+ * perfmon comamnds supported on all CPU models
+ */
+#define PFM_WRITE_PMCS         0x01
+#define PFM_WRITE_PMDS         0x02
+#define PFM_READ_PMDS          0x03
+#define PFM_STOP               0x04
+#define PFM_START              0x05
+#define PFM_ENABLE             0x06 /* obsolete */
+#define PFM_DISABLE            0x07 /* obsolete */
+#define PFM_CREATE_CONTEXT     0x08
+#define PFM_DESTROY_CONTEXT    0x09 /* obsolete use close() */
+#define PFM_RESTART            0x0a
+#define PFM_PROTECT_CONTEXT    0x0b /* obsolete */
+#define PFM_GET_FEATURES       0x0c
+#define PFM_DEBUG              0x0d
+#define PFM_UNPROTECT_CONTEXT  0x0e /* obsolete */
+#define PFM_GET_PMC_RESET_VAL  0x0f
+#define PFM_LOAD_CONTEXT       0x10
+#define PFM_UNLOAD_CONTEXT     0x11
+
+/*
+ * PMU model specific commands (may not be supported on all PMU models)
+ */
+#define PFM_WRITE_IBRS         0x20
+#define PFM_WRITE_DBRS         0x21
+
+/*
+ * context flags
+ */
+#define PFM_FL_NOTIFY_BLOCK             0x01   /* block task on user level notifications */
+#define PFM_FL_SYSTEM_WIDE      0x02   /* create a system wide context */
+#define PFM_FL_OVFL_NO_MSG      0x80   /* do not post overflow/end messages for notification */
+
+/*
+ * event set flags
+ */
+#define PFM_SETFL_EXCL_IDLE      0x01   /* exclude idle task (syswide only) XXX: DO NOT USE YET */
+
+/*
+ * PMC flags
+ */
+#define PFM_REGFL_OVFL_NOTIFY  0x1     /* send notification on overflow */
+#define PFM_REGFL_RANDOM       0x2     /* randomize sampling interval   */
+
+/*
+ * PMD/PMC/IBR/DBR return flags (ignored on input)
+ *
+ * Those flags are used on output and must be checked in case EAGAIN is returned
+ * by any of the calls using a pfarg_reg_t or pfarg_dbreg_t structure.
+ */
+#define PFM_REG_RETFL_NOTAVAIL (1UL<<31) /* set if register is implemented but not available */
+#define PFM_REG_RETFL_EINVAL   (1UL<<30) /* set if register entry is invalid */
+#define PFM_REG_RETFL_MASK     (PFM_REG_RETFL_NOTAVAIL|PFM_REG_RETFL_EINVAL)
+
+#define PFM_REG_HAS_ERROR(flag)        (((flag) & PFM_REG_RETFL_MASK) != 0)
+
+typedef unsigned char pfm_uuid_t[16];  /* custom sampling buffer identifier type */
+
+/*
+ * Request structure used to define a context
+ */
+typedef struct {
+       pfm_uuid_t     ctx_smpl_buf_id;  /* which buffer format to use (if needed) */
+       unsigned long  ctx_flags;        /* noblock/block */
+       unsigned short ctx_nextra_sets;  /* number of extra event sets (you always get 1) */
+       unsigned short ctx_reserved1;    /* for future use */
+       int            ctx_fd;           /* return arg: unique identification for context */
+       void           *ctx_smpl_vaddr;  /* return arg: virtual address of sampling buffer, is used */
+       unsigned long  ctx_reserved2[11];/* for future use */
+} pfarg_context_t;
+
+/*
+ * Request structure used to write/read a PMC or PMD
+ */
+typedef struct {
+       unsigned int    reg_num;           /* which register */
+       unsigned short  reg_set;           /* event set for this register */
+       unsigned short  reg_reserved1;     /* for future use */
+
+       unsigned long   reg_value;         /* initial pmc/pmd value */
+       unsigned long   reg_flags;         /* input: pmc/pmd flags, return: reg error */
+
+       unsigned long   reg_long_reset;    /* reset after buffer overflow notification */
+       unsigned long   reg_short_reset;   /* reset after counter overflow */
+
+       unsigned long   reg_reset_pmds[4]; /* which other counters to reset on overflow */
+       unsigned long   reg_random_seed;   /* seed value when randomization is used */
+       unsigned long   reg_random_mask;   /* bitmask used to limit random value */
+       unsigned long   reg_last_reset_val;/* return: PMD last reset value */
+
+       unsigned long   reg_smpl_pmds[4];  /* which pmds are accessed when PMC overflows */
+       unsigned long   reg_smpl_eventid;  /* opaque sampling event identifier */
+
+       unsigned long   reg_reserved2[3];   /* for future use */
+} pfarg_reg_t;
+
+typedef struct {
+       unsigned int    dbreg_num;              /* which debug register */
+       unsigned short  dbreg_set;              /* event set for this register */
+       unsigned short  dbreg_reserved1;        /* for future use */
+       unsigned long   dbreg_value;            /* value for debug register */
+       unsigned long   dbreg_flags;            /* return: dbreg error */
+       unsigned long   dbreg_reserved2[1];     /* for future use */
+} pfarg_dbreg_t;
+
+typedef struct {
+       unsigned int    ft_version;     /* perfmon: major [16-31], minor [0-15] */
+       unsigned int    ft_reserved;    /* reserved for future use */
+       unsigned long   reserved[4];    /* for future use */
+} pfarg_features_t;
+
+typedef struct {
+       pid_t           load_pid;          /* process to load the context into */
+       unsigned short  load_set;          /* first event set to load */
+       unsigned short  load_reserved1;    /* for future use */
+       unsigned long   load_reserved2[3]; /* for future use */
+} pfarg_load_t;
+
+typedef struct {
+       int             msg_type;               /* generic message header */
+       int             msg_ctx_fd;             /* generic message header */
+       unsigned long   msg_ovfl_pmds[4];       /* which PMDs overflowed */
+       unsigned short  msg_active_set;         /* active set at the time of overflow */
+       unsigned short  msg_reserved1;          /* for future use */
+       unsigned int    msg_reserved2;          /* for future use */
+       unsigned long   msg_tstamp;             /* for perf tuning/debug */
+} pfm_ovfl_msg_t;
+
+typedef struct {
+       int             msg_type;               /* generic message header */
+       int             msg_ctx_fd;             /* generic message header */
+       unsigned long   msg_tstamp;             /* for perf tuning */
+} pfm_end_msg_t;
+
+typedef struct {
+       int             msg_type;               /* type of the message */
+       int             msg_ctx_fd;             /* unique identifier for the context */
+       unsigned long   msg_tstamp;             /* for perf tuning */
+} pfm_gen_msg_t;
+
+#define PFM_MSG_OVFL   1       /* an overflow happened */
+#define PFM_MSG_END    2       /* task to which context was attached ended */
+
+typedef union {
+       pfm_ovfl_msg_t  pfm_ovfl_msg;
+       pfm_end_msg_t   pfm_end_msg;
+       pfm_gen_msg_t   pfm_gen_msg;
+} pfm_msg_t;
+
+/*
+ * Define the version numbers for both perfmon as a whole and the sampling buffer format.
+ */
+#define PFM_VERSION_MAJ                 2U
+#define PFM_VERSION_MIN                 0U
+#define PFM_VERSION             (((PFM_VERSION_MAJ&0xffff)<<16)|(PFM_VERSION_MIN & 0xffff))
+#define PFM_VERSION_MAJOR(x)    (((x)>>16) & 0xffff)
+#define PFM_VERSION_MINOR(x)    ((x) & 0xffff)
+
+
+/*
+ * miscellaneous architected definitions
+ */
+#define PMU_FIRST_COUNTER      4       /* first counting monitor (PMC/PMD) */
+#define PMU_MAX_PMCS           256     /* maximum architected number of PMC registers */
+#define PMU_MAX_PMDS           256     /* maximum architected number of PMD registers */
+
+#ifdef __KERNEL__
+
+extern long perfmonctl(int fd, int cmd, void *arg, int narg);
+
+typedef struct {
+       void (*handler)(int irq, void *arg, struct pt_regs *regs);
+} pfm_intr_handler_desc_t;
+
+extern void pfm_save_regs (struct task_struct *);
+extern void pfm_load_regs (struct task_struct *);
+
+extern void pfm_exit_thread(struct task_struct *);
+extern int  pfm_use_debug_registers(struct task_struct *);
+extern int  pfm_release_debug_registers(struct task_struct *);
+extern void pfm_syst_wide_update_task(struct task_struct *, unsigned long info, int is_ctxswin);
+extern void pfm_inherit(struct task_struct *task, struct pt_regs *regs);
+extern void pfm_init_percpu(void);
+extern void pfm_handle_work(void);
+extern int  pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *h);
+extern int  pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *h);
+
+
+
+/*
+ * Reset PMD register flags
+ */
+#define PFM_PMD_SHORT_RESET    0
+#define PFM_PMD_LONG_RESET     1
+
+typedef union {
+       unsigned int val;
+       struct {
+               unsigned int notify_user:1;     /* notify user program of overflow */
+               unsigned int reset_ovfl_pmds:1; /* reset overflowed PMDs */
+               unsigned int block_task:1;      /* block monitored task on kernel exit */
+               unsigned int mask_monitoring:1; /* mask monitors via PMCx.plm */
+               unsigned int reserved:28;       /* for future use */
+       } bits;
+} pfm_ovfl_ctrl_t;
+
+typedef struct {
+       unsigned char   ovfl_pmd;                       /* index of overflowed PMD  */
+       unsigned char   ovfl_notify;                    /* =1 if monitor requested overflow notification */
+       unsigned short  active_set;                     /* event set active at the time of the overflow */
+       pfm_ovfl_ctrl_t ovfl_ctrl;                      /* return: perfmon controls to set by handler */
+
+       unsigned long   pmd_last_reset;                 /* last reset value of of the PMD */
+       unsigned long   smpl_pmds[4];                   /* bitmask of other PMD of interest on overflow */
+       unsigned long   smpl_pmds_values[PMU_MAX_PMDS]; /* values for the other PMDs of interest */
+       unsigned long   pmd_value;                      /* current 64-bit value of the PMD */
+       unsigned long   pmd_eventid;                    /* eventid associated with PMD */
+} pfm_ovfl_arg_t;
+
+
+typedef struct {
+       char            *fmt_name;
+       pfm_uuid_t      fmt_uuid;
+       size_t          fmt_arg_size;
+       unsigned long   fmt_flags;
+
+       int             (*fmt_validate)(struct task_struct *task, unsigned int flags, int cpu, void *arg);
+       int             (*fmt_getsize)(struct task_struct *task, unsigned int flags, int cpu, void *arg, unsigned long *size);
+       int             (*fmt_init)(struct task_struct *task, void *buf, unsigned int flags, int cpu, void *arg);
+       int             (*fmt_handler)(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct pt_regs *regs, unsigned long stamp);
+       int             (*fmt_restart)(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, struct pt_regs *regs);
+       int             (*fmt_restart_active)(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, struct pt_regs *regs);
+       int             (*fmt_exit)(struct task_struct *task, void *buf, struct pt_regs *regs);
+
+       struct list_head fmt_list;
+} pfm_buffer_fmt_t;
+
+extern int pfm_register_buffer_fmt(pfm_buffer_fmt_t *fmt);
+extern int pfm_unregister_buffer_fmt(pfm_uuid_t uuid);
+
+/*
+ * perfmon interface exported to modules
+ */
+extern int pfm_mod_read_pmds(struct task_struct *, void *req, unsigned int nreq, struct pt_regs *regs);
+extern int pfm_mod_write_pmcs(struct task_struct *, void *req, unsigned int nreq, struct pt_regs *regs);
+extern int pfm_mod_write_ibrs(struct task_struct *task, void *req, unsigned int nreq, struct pt_regs *regs);
+extern int pfm_mod_write_dbrs(struct task_struct *task, void *req, unsigned int nreq, struct pt_regs *regs);
+
+/*
+ * describe the content of the local_cpu_date->pfm_syst_info field
+ */
+#define PFM_CPUINFO_SYST_WIDE  0x1     /* if set a system wide session exists */
+#define PFM_CPUINFO_DCR_PP     0x2     /* if set the system wide session has started */
+#define PFM_CPUINFO_EXCL_IDLE  0x4     /* the system wide session excludes the idle task */
+
+/*
+ * sysctl control structure. visible to sampling formats
+ */
+typedef struct {
+       int     debug;          /* turn on/off debugging via syslog */
+       int     debug_ovfl;     /* turn on/off debug printk in overflow handler */
+       int     fastctxsw;      /* turn on/off fast (unsecure) ctxsw */
+       int     expert_mode;    /* turn on/off value checking */
+} pfm_sysctl_t;
+extern pfm_sysctl_t pfm_sysctl;
+
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_PERFMON_H */
diff --git a/arch/ia64/include/asm/perfmon_default_smpl.h b/arch/ia64/include/asm/perfmon_default_smpl.h
new file mode 100644 (file)
index 0000000..48822c0
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *               Stephane Eranian <eranian@hpl.hp.com>
+ *
+ * This file implements the default sampling buffer format
+ * for Linux/ia64 perfmon subsystem.
+ */
+#ifndef __PERFMON_DEFAULT_SMPL_H__
+#define __PERFMON_DEFAULT_SMPL_H__ 1
+
+#define PFM_DEFAULT_SMPL_UUID { \
+               0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97}
+
+/*
+ * format specific parameters (passed at context creation)
+ */
+typedef struct {
+       unsigned long buf_size;         /* size of the buffer in bytes */
+       unsigned int  flags;            /* buffer specific flags */
+       unsigned int  res1;             /* for future use */
+       unsigned long reserved[2];      /* for future use */
+} pfm_default_smpl_arg_t;
+
+/*
+ * combined context+format specific structure. Can be passed
+ * to PFM_CONTEXT_CREATE
+ */
+typedef struct {
+       pfarg_context_t         ctx_arg;
+       pfm_default_smpl_arg_t  buf_arg;
+} pfm_default_smpl_ctx_arg_t;
+
+/*
+ * This header is at the beginning of the sampling buffer returned to the user.
+ * It is directly followed by the first record.
+ */
+typedef struct {
+       unsigned long   hdr_count;              /* how many valid entries */
+       unsigned long   hdr_cur_offs;           /* current offset from top of buffer */
+       unsigned long   hdr_reserved2;          /* reserved for future use */
+
+       unsigned long   hdr_overflows;          /* how many times the buffer overflowed */
+       unsigned long   hdr_buf_size;           /* how many bytes in the buffer */
+
+       unsigned int    hdr_version;            /* contains perfmon version (smpl format diffs) */
+       unsigned int    hdr_reserved1;          /* for future use */
+       unsigned long   hdr_reserved[10];       /* for future use */
+} pfm_default_smpl_hdr_t;
+
+/*
+ * Entry header in the sampling buffer.  The header is directly followed
+ * with the values of the PMD registers of interest saved in increasing 
+ * index order: PMD4, PMD5, and so on. How many PMDs are present depends 
+ * on how the session was programmed.
+ *
+ * In the case where multiple counters overflow at the same time, multiple
+ * entries are written consecutively.
+ *
+ * last_reset_value member indicates the initial value of the overflowed PMD. 
+ */
+typedef struct {
+        int             pid;                    /* thread id (for NPTL, this is gettid()) */
+        unsigned char   reserved1[3];           /* reserved for future use */
+        unsigned char   ovfl_pmd;               /* index of overflowed PMD */
+
+        unsigned long   last_reset_val;         /* initial value of overflowed PMD */
+        unsigned long   ip;                     /* where did the overflow interrupt happened  */
+        unsigned long   tstamp;                 /* ar.itc when entering perfmon intr. handler */
+
+        unsigned short  cpu;                    /* cpu on which the overfow occured */
+        unsigned short  set;                    /* event set active when overflow ocurred   */
+        int                    tgid;                   /* thread group id (for NPTL, this is getpid()) */
+} pfm_default_smpl_entry_t;
+
+#define PFM_DEFAULT_MAX_PMDS           64 /* how many pmds supported by data structures (sizeof(unsigned long) */
+#define PFM_DEFAULT_MAX_ENTRY_SIZE     (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS))
+#define PFM_DEFAULT_SMPL_MIN_BUF_SIZE  (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE)
+
+#define PFM_DEFAULT_SMPL_VERSION_MAJ   2U
+#define PFM_DEFAULT_SMPL_VERSION_MIN   0U
+#define PFM_DEFAULT_SMPL_VERSION       (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff))
+
+#endif /* __PERFMON_DEFAULT_SMPL_H__ */
diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h
new file mode 100644 (file)
index 0000000..b9ac1a6
--- /dev/null
@@ -0,0 +1,122 @@
+#ifndef _ASM_IA64_PGALLOC_H
+#define _ASM_IA64_PGALLOC_H
+
+/*
+ * This file contains the functions and defines necessary to allocate
+ * page tables.
+ *
+ * This hopefully works with any (fixed) ia-64 page-size, as defined
+ * in <asm/page.h> (currently 8192).
+ *
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com>
+ */
+
+
+#include <linux/compiler.h>
+#include <linux/mm.h>
+#include <linux/page-flags.h>
+#include <linux/threads.h>
+#include <linux/quicklist.h>
+
+#include <asm/mmu_context.h>
+
+static inline pgd_t *pgd_alloc(struct mm_struct *mm)
+{
+       return quicklist_alloc(0, GFP_KERNEL, NULL);
+}
+
+static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
+{
+       quicklist_free(0, NULL, pgd);
+}
+
+#ifdef CONFIG_PGTABLE_4
+static inline void
+pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
+{
+       pgd_val(*pgd_entry) = __pa(pud);
+}
+
+static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       return quicklist_alloc(0, GFP_KERNEL, NULL);
+}
+
+static inline void pud_free(struct mm_struct *mm, pud_t *pud)
+{
+       quicklist_free(0, NULL, pud);
+}
+#define __pud_free_tlb(tlb, pud)       pud_free((tlb)->mm, pud)
+#endif /* CONFIG_PGTABLE_4 */
+
+static inline void
+pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
+{
+       pud_val(*pud_entry) = __pa(pmd);
+}
+
+static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       return quicklist_alloc(0, GFP_KERNEL, NULL);
+}
+
+static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
+{
+       quicklist_free(0, NULL, pmd);
+}
+
+#define __pmd_free_tlb(tlb, pmd)       pmd_free((tlb)->mm, pmd)
+
+static inline void
+pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
+{
+       pmd_val(*pmd_entry) = page_to_phys(pte);
+}
+#define pmd_pgtable(pmd) pmd_page(pmd)
+
+static inline void
+pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
+{
+       pmd_val(*pmd_entry) = __pa(pte);
+}
+
+static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       struct page *page;
+       void *pg;
+
+       pg = quicklist_alloc(0, GFP_KERNEL, NULL);
+       if (!pg)
+               return NULL;
+       page = virt_to_page(pg);
+       pgtable_page_ctor(page);
+       return page;
+}
+
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
+                                         unsigned long addr)
+{
+       return quicklist_alloc(0, GFP_KERNEL, NULL);
+}
+
+static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
+{
+       pgtable_page_dtor(pte);
+       quicklist_free_page(0, NULL, pte);
+}
+
+static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+{
+       quicklist_free(0, NULL, pte);
+}
+
+static inline void check_pgt_cache(void)
+{
+       quicklist_trim(0, NULL, 25, 16);
+}
+
+#define __pte_free_tlb(tlb, pte)       pte_free((tlb)->mm, pte)
+
+#endif                         /* _ASM_IA64_PGALLOC_H */
diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..7a9bff4
--- /dev/null
@@ -0,0 +1,615 @@
+#ifndef _ASM_IA64_PGTABLE_H
+#define _ASM_IA64_PGTABLE_H
+
+/*
+ * This file contains the functions and defines necessary to modify and use
+ * the IA-64 page table tree.
+ *
+ * This hopefully works with any (fixed) IA-64 page-size, as defined
+ * in <asm/page.h>.
+ *
+ * Copyright (C) 1998-2005 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#include <asm/mman.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/types.h>
+
+#define IA64_MAX_PHYS_BITS     50      /* max. number of physical address bits (architected) */
+
+/*
+ * First, define the various bits in a PTE.  Note that the PTE format
+ * matches the VHPT short format, the firt doubleword of the VHPD long
+ * format, and the first doubleword of the TLB insertion format.
+ */
+#define _PAGE_P_BIT            0
+#define _PAGE_A_BIT            5
+#define _PAGE_D_BIT            6
+
+#define _PAGE_P                        (1 << _PAGE_P_BIT)      /* page present bit */
+#define _PAGE_MA_WB            (0x0 <<  2)     /* write back memory attribute */
+#define _PAGE_MA_UC            (0x4 <<  2)     /* uncacheable memory attribute */
+#define _PAGE_MA_UCE           (0x5 <<  2)     /* UC exported attribute */
+#define _PAGE_MA_WC            (0x6 <<  2)     /* write coalescing memory attribute */
+#define _PAGE_MA_NAT           (0x7 <<  2)     /* not-a-thing attribute */
+#define _PAGE_MA_MASK          (0x7 <<  2)
+#define _PAGE_PL_0             (0 <<  7)       /* privilege level 0 (kernel) */
+#define _PAGE_PL_1             (1 <<  7)       /* privilege level 1 (unused) */
+#define _PAGE_PL_2             (2 <<  7)       /* privilege level 2 (unused) */
+#define _PAGE_PL_3             (3 <<  7)       /* privilege level 3 (user) */
+#define _PAGE_PL_MASK          (3 <<  7)
+#define _PAGE_AR_R             (0 <<  9)       /* read only */
+#define _PAGE_AR_RX            (1 <<  9)       /* read & execute */
+#define _PAGE_AR_RW            (2 <<  9)       /* read & write */
+#define _PAGE_AR_RWX           (3 <<  9)       /* read, write & execute */
+#define _PAGE_AR_R_RW          (4 <<  9)       /* read / read & write */
+#define _PAGE_AR_RX_RWX                (5 <<  9)       /* read & exec / read, write & exec */
+#define _PAGE_AR_RWX_RW                (6 <<  9)       /* read, write & exec / read & write */
+#define _PAGE_AR_X_RX          (7 <<  9)       /* exec & promote / read & exec */
+#define _PAGE_AR_MASK          (7 <<  9)
+#define _PAGE_AR_SHIFT         9
+#define _PAGE_A                        (1 << _PAGE_A_BIT)      /* page accessed bit */
+#define _PAGE_D                        (1 << _PAGE_D_BIT)      /* page dirty bit */
+#define _PAGE_PPN_MASK         (((__IA64_UL(1) << IA64_MAX_PHYS_BITS) - 1) & ~0xfffUL)
+#define _PAGE_ED               (__IA64_UL(1) << 52)    /* exception deferral */
+#define _PAGE_PROTNONE         (__IA64_UL(1) << 63)
+
+/* Valid only for a PTE with the present bit cleared: */
+#define _PAGE_FILE             (1 << 1)                /* see swap & file pte remarks below */
+
+#define _PFN_MASK              _PAGE_PPN_MASK
+/* Mask of bits which may be changed by pte_modify(); the odd bits are there for _PAGE_PROTNONE */
+#define _PAGE_CHG_MASK (_PAGE_P | _PAGE_PROTNONE | _PAGE_PL_MASK | _PAGE_AR_MASK | _PAGE_ED)
+
+#define _PAGE_SIZE_4K  12
+#define _PAGE_SIZE_8K  13
+#define _PAGE_SIZE_16K 14
+#define _PAGE_SIZE_64K 16
+#define _PAGE_SIZE_256K        18
+#define _PAGE_SIZE_1M  20
+#define _PAGE_SIZE_4M  22
+#define _PAGE_SIZE_16M 24
+#define _PAGE_SIZE_64M 26
+#define _PAGE_SIZE_256M        28
+#define _PAGE_SIZE_1G  30
+#define _PAGE_SIZE_4G  32
+
+#define __ACCESS_BITS          _PAGE_ED | _PAGE_A | _PAGE_P | _PAGE_MA_WB
+#define __DIRTY_BITS_NO_ED     _PAGE_A | _PAGE_P | _PAGE_D | _PAGE_MA_WB
+#define __DIRTY_BITS           _PAGE_ED | __DIRTY_BITS_NO_ED
+
+/*
+ * How many pointers will a page table level hold expressed in shift
+ */
+#define PTRS_PER_PTD_SHIFT     (PAGE_SHIFT-3)
+
+/*
+ * Definitions for fourth level:
+ */
+#define PTRS_PER_PTE   (__IA64_UL(1) << (PTRS_PER_PTD_SHIFT))
+
+/*
+ * Definitions for third level:
+ *
+ * PMD_SHIFT determines the size of the area a third-level page table
+ * can map.
+ */
+#define PMD_SHIFT      (PAGE_SHIFT + (PTRS_PER_PTD_SHIFT))
+#define PMD_SIZE       (1UL << PMD_SHIFT)
+#define PMD_MASK       (~(PMD_SIZE-1))
+#define PTRS_PER_PMD   (1UL << (PTRS_PER_PTD_SHIFT))
+
+#ifdef CONFIG_PGTABLE_4
+/*
+ * Definitions for second level:
+ *
+ * PUD_SHIFT determines the size of the area a second-level page table
+ * can map.
+ */
+#define PUD_SHIFT      (PMD_SHIFT + (PTRS_PER_PTD_SHIFT))
+#define PUD_SIZE       (1UL << PUD_SHIFT)
+#define PUD_MASK       (~(PUD_SIZE-1))
+#define PTRS_PER_PUD   (1UL << (PTRS_PER_PTD_SHIFT))
+#endif
+
+/*
+ * Definitions for first level:
+ *
+ * PGDIR_SHIFT determines what a first-level page table entry can map.
+ */
+#ifdef CONFIG_PGTABLE_4
+#define PGDIR_SHIFT            (PUD_SHIFT + (PTRS_PER_PTD_SHIFT))
+#else
+#define PGDIR_SHIFT            (PMD_SHIFT + (PTRS_PER_PTD_SHIFT))
+#endif
+#define PGDIR_SIZE             (__IA64_UL(1) << PGDIR_SHIFT)
+#define PGDIR_MASK             (~(PGDIR_SIZE-1))
+#define PTRS_PER_PGD_SHIFT     PTRS_PER_PTD_SHIFT
+#define PTRS_PER_PGD           (1UL << PTRS_PER_PGD_SHIFT)
+#define USER_PTRS_PER_PGD      (5*PTRS_PER_PGD/8)      /* regions 0-4 are user regions */
+#define FIRST_USER_ADDRESS     0
+
+/*
+ * 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_PROTNONE | _PAGE_A)
+#define PAGE_SHARED    __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RW)
+#define PAGE_READONLY  __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R)
+#define PAGE_COPY      __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R)
+#define PAGE_COPY_EXEC __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
+#define PAGE_GATE      __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX)
+#define PAGE_KERNEL    __pgprot(__DIRTY_BITS  | _PAGE_PL_0 | _PAGE_AR_RWX)
+#define PAGE_KERNELRX  __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX)
+
+# ifndef __ASSEMBLY__
+
+#include <linux/sched.h>       /* for mm_struct */
+#include <linux/bitops.h>
+#include <asm/cacheflush.h>
+#include <asm/mmu_context.h>
+#include <asm/processor.h>
+
+/*
+ * Next come the mappings that determine how mmap() protection bits
+ * (PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE) get implemented.  The
+ * _P version gets used for a private shared memory segment, the _S
+ * version gets used for a shared memory segment with MAP_SHARED on.
+ * In a private shared memory segment, we do a copy-on-write if a task
+ * attempts to write to the page.
+ */
+       /* xwr */
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_READONLY   /* write to priv pg -> copy & make writable */
+#define __P011 PAGE_READONLY   /* ditto */
+#define __P100 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_X_RX)
+#define __P101 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
+#define __P110 PAGE_COPY_EXEC
+#define __P111 PAGE_COPY_EXEC
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_SHARED     /* we don't have (and don't need) write-only */
+#define __S011 PAGE_SHARED
+#define __S100 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_X_RX)
+#define __S101 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
+#define __S110 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX)
+#define __S111 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX)
+
+#define pgd_ERROR(e)   printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
+#ifdef CONFIG_PGTABLE_4
+#define pud_ERROR(e)   printk("%s:%d: bad pud %016lx.\n", __FILE__, __LINE__, pud_val(e))
+#endif
+#define pmd_ERROR(e)   printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
+#define pte_ERROR(e)   printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
+
+
+/*
+ * Some definitions to translate between mem_map, PTEs, and page addresses:
+ */
+
+
+/* Quick test to see if ADDR is a (potentially) valid physical address. */
+static inline long
+ia64_phys_addr_valid (unsigned long addr)
+{
+       return (addr & (local_cpu_data->unimpl_pa_mask)) == 0;
+}
+
+/*
+ * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
+ * memory.  For the return value to be meaningful, ADDR must be >=
+ * PAGE_OFFSET.  This operation can be relatively expensive (e.g.,
+ * require a hash-, or multi-level tree-lookup or something of that
+ * sort) but it guarantees to return TRUE only if accessing the page
+ * at that address does not cause an error.  Note that there may be
+ * addresses for which kern_addr_valid() returns FALSE even though an
+ * access would not cause an error (e.g., this is typically true for
+ * memory mapped I/O regions.
+ *
+ * XXX Need to implement this for IA-64.
+ */
+#define kern_addr_valid(addr)  (1)
+
+
+/*
+ * Now come the defines and routines to manage and access the three-level
+ * page table.
+ */
+
+
+#define VMALLOC_START          (RGN_BASE(RGN_GATE) + 0x200000000UL)
+#ifdef CONFIG_VIRTUAL_MEM_MAP
+# define VMALLOC_END_INIT      (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9)))
+# define VMALLOC_END           vmalloc_end
+  extern unsigned long vmalloc_end;
+#else
+#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_SPARSEMEM_VMEMMAP)
+/* SPARSEMEM_VMEMMAP uses half of vmalloc... */
+# define VMALLOC_END           (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10)))
+# define vmemmap               ((struct page *)VMALLOC_END)
+#else
+# define VMALLOC_END           (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9)))
+#endif
+#endif
+
+/* fs/proc/kcore.c */
+#define        kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE))
+#define        kc_offset_to_vaddr(o) ((o) + RGN_BASE(RGN_GATE))
+
+#define RGN_MAP_SHIFT (PGDIR_SHIFT + PTRS_PER_PGD_SHIFT - 3)
+#define RGN_MAP_LIMIT  ((1UL << RGN_MAP_SHIFT) - PAGE_SIZE)    /* per region addr limit */
+
+/*
+ * Conversion functions: convert page frame number (pfn) and a protection value to a page
+ * table entry (pte).
+ */
+#define pfn_pte(pfn, pgprot) \
+({ pte_t __pte; pte_val(__pte) = ((pfn) << PAGE_SHIFT) | pgprot_val(pgprot); __pte; })
+
+/* Extract pfn from pte.  */
+#define pte_pfn(_pte)          ((pte_val(_pte) & _PFN_MASK) >> PAGE_SHIFT)
+
+#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
+
+/* This takes a physical page address that is used by the remapping functions */
+#define mk_pte_phys(physpage, pgprot) \
+({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
+
+#define pte_modify(_pte, newprot) \
+       (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK)))
+
+#define pte_none(pte)                  (!pte_val(pte))
+#define pte_present(pte)               (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE))
+#define pte_clear(mm,addr,pte)         (pte_val(*(pte)) = 0UL)
+/* pte_page() returns the "struct page *" corresponding to the PTE: */
+#define pte_page(pte)                  virt_to_page(((pte_val(pte) & _PFN_MASK) + PAGE_OFFSET))
+
+#define pmd_none(pmd)                  (!pmd_val(pmd))
+#define pmd_bad(pmd)                   (!ia64_phys_addr_valid(pmd_val(pmd)))
+#define pmd_present(pmd)               (pmd_val(pmd) != 0UL)
+#define pmd_clear(pmdp)                        (pmd_val(*(pmdp)) = 0UL)
+#define pmd_page_vaddr(pmd)            ((unsigned long) __va(pmd_val(pmd) & _PFN_MASK))
+#define pmd_page(pmd)                  virt_to_page((pmd_val(pmd) + PAGE_OFFSET))
+
+#define pud_none(pud)                  (!pud_val(pud))
+#define pud_bad(pud)                   (!ia64_phys_addr_valid(pud_val(pud)))
+#define pud_present(pud)               (pud_val(pud) != 0UL)
+#define pud_clear(pudp)                        (pud_val(*(pudp)) = 0UL)
+#define pud_page_vaddr(pud)            ((unsigned long) __va(pud_val(pud) & _PFN_MASK))
+#define pud_page(pud)                  virt_to_page((pud_val(pud) + PAGE_OFFSET))
+
+#ifdef CONFIG_PGTABLE_4
+#define pgd_none(pgd)                  (!pgd_val(pgd))
+#define pgd_bad(pgd)                   (!ia64_phys_addr_valid(pgd_val(pgd)))
+#define pgd_present(pgd)               (pgd_val(pgd) != 0UL)
+#define pgd_clear(pgdp)                        (pgd_val(*(pgdp)) = 0UL)
+#define pgd_page_vaddr(pgd)            ((unsigned long) __va(pgd_val(pgd) & _PFN_MASK))
+#define pgd_page(pgd)                  virt_to_page((pgd_val(pgd) + PAGE_OFFSET))
+#endif
+
+/*
+ * The following have defined behavior only work if pte_present() is true.
+ */
+#define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4)
+#define pte_exec(pte)          ((pte_val(pte) & _PAGE_AR_RX) != 0)
+#define pte_dirty(pte)         ((pte_val(pte) & _PAGE_D) != 0)
+#define pte_young(pte)         ((pte_val(pte) & _PAGE_A) != 0)
+#define pte_file(pte)          ((pte_val(pte) & _PAGE_FILE) != 0)
+#define pte_special(pte)       0
+
+/*
+ * Note: we convert AR_RWX to AR_RX and AR_RW to AR_R by clearing the 2nd bit in the
+ * access rights:
+ */
+#define pte_wrprotect(pte)     (__pte(pte_val(pte) & ~_PAGE_AR_RW))
+#define pte_mkwrite(pte)       (__pte(pte_val(pte) | _PAGE_AR_RW))
+#define pte_mkold(pte)         (__pte(pte_val(pte) & ~_PAGE_A))
+#define pte_mkyoung(pte)       (__pte(pte_val(pte) | _PAGE_A))
+#define pte_mkclean(pte)       (__pte(pte_val(pte) & ~_PAGE_D))
+#define pte_mkdirty(pte)       (__pte(pte_val(pte) | _PAGE_D))
+#define pte_mkhuge(pte)                (__pte(pte_val(pte)))
+#define pte_mkspecial(pte)     (pte)
+
+/*
+ * Because ia64's Icache and Dcache is not coherent (on a cpu), we need to
+ * sync icache and dcache when we insert *new* executable page.
+ *  __ia64_sync_icache_dcache() check Pg_arch_1 bit and flush icache
+ * if necessary.
+ *
+ *  set_pte() is also called by the kernel, but we can expect that the kernel
+ *  flushes icache explicitly if necessary.
+ */
+#define pte_present_exec_user(pte)\
+       ((pte_val(pte) & (_PAGE_P | _PAGE_PL_MASK | _PAGE_AR_RX)) == \
+               (_PAGE_P | _PAGE_PL_3 | _PAGE_AR_RX))
+
+extern void __ia64_sync_icache_dcache(pte_t pteval);
+static inline void set_pte(pte_t *ptep, pte_t pteval)
+{
+       /* page is present && page is user  && page is executable
+        * && (page swapin or new page or page migraton
+        *      || copy_on_write with page copying.)
+        */
+       if (pte_present_exec_user(pteval) &&
+           (!pte_present(*ptep) ||
+               pte_pfn(*ptep) != pte_pfn(pteval)))
+               /* load_module() calles flush_icache_range() explicitly*/
+               __ia64_sync_icache_dcache(pteval);
+       *ptep = pteval;
+}
+
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+/*
+ * Make page protection values cacheable, uncacheable, or write-
+ * combining.  Note that "protection" is really a misnomer here as the
+ * protection value contains the memory attribute bits, dirty bits, and
+ * various other bits as well.
+ */
+#define pgprot_cacheable(prot)         __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WB)
+#define pgprot_noncached(prot)         __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_UC)
+#define pgprot_writecombine(prot)      __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC)
+
+struct file;
+extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
+                                    unsigned long size, pgprot_t vma_prot);
+#define __HAVE_PHYS_MEM_ACCESS_PROT
+
+static inline unsigned long
+pgd_index (unsigned long address)
+{
+       unsigned long region = address >> 61;
+       unsigned long l1index = (address >> PGDIR_SHIFT) & ((PTRS_PER_PGD >> 3) - 1);
+
+       return (region << (PAGE_SHIFT - 6)) | l1index;
+}
+
+/* The offset in the 1-level directory is given by the 3 region bits
+   (61..63) and the level-1 bits.  */
+static inline pgd_t*
+pgd_offset (const struct mm_struct *mm, unsigned long address)
+{
+       return mm->pgd + pgd_index(address);
+}
+
+/* In the kernel's mapped region we completely ignore the region number
+   (since we know it's in region number 5). */
+#define pgd_offset_k(addr) \
+       (init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
+
+/* Look up a pgd entry in the gate area.  On IA-64, the gate-area
+   resides in the kernel-mapped segment, hence we use pgd_offset_k()
+   here.  */
+#define pgd_offset_gate(mm, addr)      pgd_offset_k(addr)
+
+#ifdef CONFIG_PGTABLE_4
+/* Find an entry in the second-level page table.. */
+#define pud_offset(dir,addr) \
+       ((pud_t *) pgd_page_vaddr(*(dir)) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
+#endif
+
+/* Find an entry in the third-level page table.. */
+#define pmd_offset(dir,addr) \
+       ((pmd_t *) pud_page_vaddr(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
+
+/*
+ * Find an entry in the third-level page table.  This looks more complicated than it
+ * should be because some platforms place page tables in high memory.
+ */
+#define pte_index(addr)                (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+#define pte_offset_kernel(dir,addr)    ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_offset_map(dir,addr)       pte_offset_kernel(dir, addr)
+#define pte_offset_map_nested(dir,addr)        pte_offset_map(dir, addr)
+#define pte_unmap(pte)                 do { } while (0)
+#define pte_unmap_nested(pte)          do { } while (0)
+
+/* atomic versions of the some PTE manipulations: */
+
+static inline int
+ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
+{
+#ifdef CONFIG_SMP
+       if (!pte_young(*ptep))
+               return 0;
+       return test_and_clear_bit(_PAGE_A_BIT, ptep);
+#else
+       pte_t pte = *ptep;
+       if (!pte_young(pte))
+               return 0;
+       set_pte_at(vma->vm_mm, addr, ptep, pte_mkold(pte));
+       return 1;
+#endif
+}
+
+static inline pte_t
+ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+{
+#ifdef CONFIG_SMP
+       return __pte(xchg((long *) ptep, 0));
+#else
+       pte_t pte = *ptep;
+       pte_clear(mm, addr, ptep);
+       return pte;
+#endif
+}
+
+static inline void
+ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+{
+#ifdef CONFIG_SMP
+       unsigned long new, old;
+
+       do {
+               old = pte_val(*ptep);
+               new = pte_val(pte_wrprotect(__pte (old)));
+       } while (cmpxchg((unsigned long *) ptep, old, new) != old);
+#else
+       pte_t old_pte = *ptep;
+       set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
+#endif
+}
+
+static inline int
+pte_same (pte_t a, pte_t b)
+{
+       return pte_val(a) == pte_val(b);
+}
+
+#define update_mmu_cache(vma, address, pte) do { } while (0)
+
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+extern void paging_init (void);
+
+/*
+ * Note: The macros below rely on the fact that MAX_SWAPFILES_SHIFT <= number of
+ *      bits in the swap-type field of the swap pte.  It would be nice to
+ *      enforce that, but we can't easily include <linux/swap.h> here.
+ *      (Of course, better still would be to define MAX_SWAPFILES_SHIFT here...).
+ *
+ * Format of swap pte:
+ *     bit   0   : present bit (must be zero)
+ *     bit   1   : _PAGE_FILE (must be zero)
+ *     bits  2- 8: swap-type
+ *     bits  9-62: swap offset
+ *     bit  63   : _PAGE_PROTNONE bit
+ *
+ * Format of file pte:
+ *     bit   0   : present bit (must be zero)
+ *     bit   1   : _PAGE_FILE (must be one)
+ *     bits  2-62: file_offset/PAGE_SIZE
+ *     bit  63   : _PAGE_PROTNONE bit
+ */
+#define __swp_type(entry)              (((entry).val >> 2) & 0x7f)
+#define __swp_offset(entry)            (((entry).val << 1) >> 10)
+#define __swp_entry(type,offset)       ((swp_entry_t) { ((type) << 2) | ((long) (offset) << 9) })
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
+
+#define PTE_FILE_MAX_BITS              61
+#define pte_to_pgoff(pte)              ((pte_val(pte) << 1) >> 3)
+#define pgoff_to_pte(off)              ((pte_t) { ((off) << 2) | _PAGE_FILE })
+
+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)                \
+               remap_pfn_range(vma, vaddr, pfn, size, prot)
+
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
+extern struct page *zero_page_memmap_ptr;
+#define ZERO_PAGE(vaddr) (zero_page_memmap_ptr)
+
+/* We provide our own get_unmapped_area to cope with VA holes for userland */
+#define HAVE_ARCH_UNMAPPED_AREA
+
+#ifdef CONFIG_HUGETLB_PAGE
+#define HUGETLB_PGDIR_SHIFT    (HPAGE_SHIFT + 2*(PAGE_SHIFT-3))
+#define HUGETLB_PGDIR_SIZE     (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT)
+#define HUGETLB_PGDIR_MASK     (~(HUGETLB_PGDIR_SIZE-1))
+#endif
+
+
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+/*
+ * Update PTEP with ENTRY, which is guaranteed to be a less
+ * restrictive PTE.  That is, ENTRY may have the ACCESSED, DIRTY, and
+ * WRITABLE bits turned on, when the value at PTEP did not.  The
+ * WRITABLE bit may only be turned if SAFELY_WRITABLE is TRUE.
+ *
+ * SAFELY_WRITABLE is TRUE if we can update the value at PTEP without
+ * having to worry about races.  On SMP machines, there are only two
+ * cases where this is true:
+ *
+ *     (1) *PTEP has the PRESENT bit turned OFF
+ *     (2) ENTRY has the DIRTY bit turned ON
+ *
+ * On ia64, we could implement this routine with a cmpxchg()-loop
+ * which ORs in the _PAGE_A/_PAGE_D bit if they're set in ENTRY.
+ * However, like on x86, we can get a more streamlined version by
+ * observing that it is OK to drop ACCESSED bit updates when
+ * SAFELY_WRITABLE is FALSE.  Besides being rare, all that would do is
+ * result in an extra Access-bit fault, which would then turn on the
+ * ACCESSED bit in the low-level fault handler (iaccess_bit or
+ * daccess_bit in ivt.S).
+ */
+#ifdef CONFIG_SMP
+# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
+({                                                                     \
+       int __changed = !pte_same(*(__ptep), __entry);                  \
+       if (__changed && __safely_writable) {                           \
+               set_pte(__ptep, __entry);                               \
+               flush_tlb_page(__vma, __addr);                          \
+       }                                                               \
+       __changed;                                                      \
+})
+#else
+# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
+({                                                                     \
+       int __changed = !pte_same(*(__ptep), __entry);                  \
+       if (__changed) {                                                \
+               set_pte_at((__vma)->vm_mm, (__addr), __ptep, __entry);  \
+               flush_tlb_page(__vma, __addr);                          \
+       }                                                               \
+       __changed;                                                      \
+})
+#endif
+
+#  ifdef CONFIG_VIRTUAL_MEM_MAP
+  /* arch mem_map init routine is needed due to holes in a virtual mem_map */
+#   define __HAVE_ARCH_MEMMAP_INIT
+    extern void memmap_init (unsigned long size, int nid, unsigned long zone,
+                            unsigned long start_pfn);
+#  endif /* CONFIG_VIRTUAL_MEM_MAP */
+# endif /* !__ASSEMBLY__ */
+
+/*
+ * Identity-mapped regions use a large page size.  We'll call such large pages
+ * "granules".  If you can think of a better name that's unambiguous, let me
+ * know...
+ */
+#if defined(CONFIG_IA64_GRANULE_64MB)
+# define IA64_GRANULE_SHIFT    _PAGE_SIZE_64M
+#elif defined(CONFIG_IA64_GRANULE_16MB)
+# define IA64_GRANULE_SHIFT    _PAGE_SIZE_16M
+#endif
+#define IA64_GRANULE_SIZE      (1 << IA64_GRANULE_SHIFT)
+/*
+ * log2() of the page size we use to map the kernel image (IA64_TR_KERNEL):
+ */
+#define KERNEL_TR_PAGE_SHIFT   _PAGE_SIZE_64M
+#define KERNEL_TR_PAGE_SIZE    (1 << KERNEL_TR_PAGE_SHIFT)
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()   do { } while (0)
+
+/* These tell get_user_pages() that the first gate page is accessible from user-level.  */
+#define FIXADDR_USER_START     GATE_ADDR
+#ifdef HAVE_BUGGY_SEGREL
+# define FIXADDR_USER_END      (GATE_ADDR + 2*PAGE_SIZE)
+#else
+# define FIXADDR_USER_END      (GATE_ADDR + 2*PERCPU_PAGE_SIZE)
+#endif
+
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PGD_OFFSET_GATE
+
+
+#ifndef CONFIG_PGTABLE_4
+#include <asm-generic/pgtable-nopud.h>
+#endif
+#include <asm-generic/pgtable.h>
+
+#endif /* _ASM_IA64_PGTABLE_H */
diff --git a/arch/ia64/include/asm/poll.h b/arch/ia64/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/ia64/include/asm/posix_types.h b/arch/ia64/include/asm/posix_types.h
new file mode 100644 (file)
index 0000000..1788556
--- /dev/null
@@ -0,0 +1,126 @@
+#ifndef _ASM_IA64_POSIX_TYPES_H
+#define _ASM_IA64_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.
+ *
+ * Based on <asm-alpha/posix_types.h>.
+ *
+ * Modified 1998-2000, 2003
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+typedef unsigned long  __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_timer_t;
+typedef int            __kernel_clockid_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 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 /* _ASM_IA64_POSIX_TYPES_H */
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
new file mode 100644 (file)
index 0000000..f88fa05
--- /dev/null
@@ -0,0 +1,771 @@
+#ifndef _ASM_IA64_PROCESSOR_H
+#define _ASM_IA64_PROCESSOR_H
+
+/*
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *     Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
+ *
+ * 11/24/98    S.Eranian       added ia64_set_iva()
+ * 12/03/99    D. Mosberger    implement thread_saved_pc() via kernel unwind API
+ * 06/16/00    A. Mallick      added csd/ssd/tssd for ia32 support
+ */
+
+
+#include <asm/intrinsics.h>
+#include <asm/kregs.h>
+#include <asm/ptrace.h>
+#include <asm/ustack.h>
+
+#define IA64_NUM_PHYS_STACK_REG        96
+#define IA64_NUM_DBG_REGS      8
+
+#define DEFAULT_MAP_BASE       __IA64_UL_CONST(0x2000000000000000)
+#define DEFAULT_TASK_SIZE      __IA64_UL_CONST(0xa000000000000000)
+
+/*
+ * TASK_SIZE really is a mis-named.  It really is the maximum user
+ * space address (plus one).  On IA-64, there are five regions of 2TB
+ * each (assuming 8KB page size), for a total of 8TB of user virtual
+ * address space.
+ */
+#define TASK_SIZE_OF(tsk)      ((tsk)->thread.task_size)
+#define TASK_SIZE              TASK_SIZE_OF(current)
+
+/*
+ * This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE     (current->thread.map_base)
+
+#define IA64_THREAD_FPH_VALID  (__IA64_UL(1) << 0)     /* floating-point high state valid? */
+#define IA64_THREAD_DBG_VALID  (__IA64_UL(1) << 1)     /* debug registers valid? */
+#define IA64_THREAD_PM_VALID   (__IA64_UL(1) << 2)     /* performance registers valid? */
+#define IA64_THREAD_UAC_NOPRINT        (__IA64_UL(1) << 3)     /* don't log unaligned accesses */
+#define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4)     /* generate SIGBUS on unaligned acc. */
+#define IA64_THREAD_MIGRATION  (__IA64_UL(1) << 5)     /* require migration
+                                                          sync at ctx sw */
+#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6)  /* don't log any fpswa faults */
+#define IA64_THREAD_FPEMU_SIGFPE  (__IA64_UL(1) << 7)  /* send a SIGFPE for fpswa faults */
+
+#define IA64_THREAD_UAC_SHIFT  3
+#define IA64_THREAD_UAC_MASK   (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
+#define IA64_THREAD_FPEMU_SHIFT        6
+#define IA64_THREAD_FPEMU_MASK (IA64_THREAD_FPEMU_NOPRINT | IA64_THREAD_FPEMU_SIGFPE)
+
+
+/*
+ * This shift should be large enough to be able to represent 1000000000/itc_freq with good
+ * accuracy while being small enough to fit 10*1000000000<<IA64_NSEC_PER_CYC_SHIFT in 64 bits
+ * (this will give enough slack to represent 10 seconds worth of time as a scaled number).
+ */
+#define IA64_NSEC_PER_CYC_SHIFT        30
+
+#ifndef __ASSEMBLY__
+
+#include <linux/cache.h>
+#include <linux/compiler.h>
+#include <linux/threads.h>
+#include <linux/types.h>
+
+#include <asm/fpu.h>
+#include <asm/page.h>
+#include <asm/percpu.h>
+#include <asm/rse.h>
+#include <asm/unwind.h>
+#include <asm/atomic.h>
+#ifdef CONFIG_NUMA
+#include <asm/nodedata.h>
+#endif
+
+/* like above but expressed as bitfields for more efficient access: */
+struct ia64_psr {
+       __u64 reserved0 : 1;
+       __u64 be : 1;
+       __u64 up : 1;
+       __u64 ac : 1;
+       __u64 mfl : 1;
+       __u64 mfh : 1;
+       __u64 reserved1 : 7;
+       __u64 ic : 1;
+       __u64 i : 1;
+       __u64 pk : 1;
+       __u64 reserved2 : 1;
+       __u64 dt : 1;
+       __u64 dfl : 1;
+       __u64 dfh : 1;
+       __u64 sp : 1;
+       __u64 pp : 1;
+       __u64 di : 1;
+       __u64 si : 1;
+       __u64 db : 1;
+       __u64 lp : 1;
+       __u64 tb : 1;
+       __u64 rt : 1;
+       __u64 reserved3 : 4;
+       __u64 cpl : 2;
+       __u64 is : 1;
+       __u64 mc : 1;
+       __u64 it : 1;
+       __u64 id : 1;
+       __u64 da : 1;
+       __u64 dd : 1;
+       __u64 ss : 1;
+       __u64 ri : 2;
+       __u64 ed : 1;
+       __u64 bn : 1;
+       __u64 reserved4 : 19;
+};
+
+union ia64_isr {
+       __u64  val;
+       struct {
+               __u64 code : 16;
+               __u64 vector : 8;
+               __u64 reserved1 : 8;
+               __u64 x : 1;
+               __u64 w : 1;
+               __u64 r : 1;
+               __u64 na : 1;
+               __u64 sp : 1;
+               __u64 rs : 1;
+               __u64 ir : 1;
+               __u64 ni : 1;
+               __u64 so : 1;
+               __u64 ei : 2;
+               __u64 ed : 1;
+               __u64 reserved2 : 20;
+       };
+};
+
+union ia64_lid {
+       __u64 val;
+       struct {
+               __u64  rv  : 16;
+               __u64  eid : 8;
+               __u64  id  : 8;
+               __u64  ig  : 32;
+       };
+};
+
+union ia64_tpr {
+       __u64 val;
+       struct {
+               __u64 ig0 : 4;
+               __u64 mic : 4;
+               __u64 rsv : 8;
+               __u64 mmi : 1;
+               __u64 ig1 : 47;
+       };
+};
+
+union ia64_itir {
+       __u64 val;
+       struct {
+               __u64 rv3  :  2; /* 0-1 */
+               __u64 ps   :  6; /* 2-7 */
+               __u64 key  : 24; /* 8-31 */
+               __u64 rv4  : 32; /* 32-63 */
+       };
+};
+
+union  ia64_rr {
+       __u64 val;
+       struct {
+               __u64  ve       :  1;  /* enable hw walker */
+               __u64  reserved0:  1;  /* reserved */
+               __u64  ps       :  6;  /* log page size */
+               __u64  rid      : 24;  /* region id */
+               __u64  reserved1: 32;  /* reserved */
+       };
+};
+
+/*
+ * CPU type, hardware bug flags, and per-CPU state.  Frequently used
+ * state comes earlier:
+ */
+struct cpuinfo_ia64 {
+       __u32 softirq_pending;
+       __u64 itm_delta;        /* # of clock cycles between clock ticks */
+       __u64 itm_next;         /* interval timer mask value to use for next clock tick */
+       __u64 nsec_per_cyc;     /* (1000000000<<IA64_NSEC_PER_CYC_SHIFT)/itc_freq */
+       __u64 unimpl_va_mask;   /* mask of unimplemented virtual address bits (from PAL) */
+       __u64 unimpl_pa_mask;   /* mask of unimplemented physical address bits (from PAL) */
+       __u64 itc_freq;         /* frequency of ITC counter */
+       __u64 proc_freq;        /* frequency of processor */
+       __u64 cyc_per_usec;     /* itc_freq/1000000 */
+       __u64 ptce_base;
+       __u32 ptce_count[2];
+       __u32 ptce_stride[2];
+       struct task_struct *ksoftirqd;  /* kernel softirq daemon for this CPU */
+
+#ifdef CONFIG_SMP
+       __u64 loops_per_jiffy;
+       int cpu;
+       __u32 socket_id;        /* physical processor socket id */
+       __u16 core_id;          /* core id */
+       __u16 thread_id;        /* thread id */
+       __u16 num_log;          /* Total number of logical processors on
+                                * this socket that were successfully booted */
+       __u8  cores_per_socket; /* Cores per processor socket */
+       __u8  threads_per_core; /* Threads per core */
+#endif
+
+       /* CPUID-derived information: */
+       __u64 ppn;
+       __u64 features;
+       __u8 number;
+       __u8 revision;
+       __u8 model;
+       __u8 family;
+       __u8 archrev;
+       char vendor[16];
+       char *model_name;
+
+#ifdef CONFIG_NUMA
+       struct ia64_node_data *node_data;
+#endif
+};
+
+DECLARE_PER_CPU(struct cpuinfo_ia64, cpu_info);
+
+/*
+ * The "local" data variable.  It refers to the per-CPU data of the currently executing
+ * CPU, much like "current" points to the per-task data of the currently executing task.
+ * Do not use the address of local_cpu_data, since it will be different from
+ * cpu_data(smp_processor_id())!
+ */
+#define local_cpu_data         (&__ia64_per_cpu_var(cpu_info))
+#define cpu_data(cpu)          (&per_cpu(cpu_info, cpu))
+
+extern void print_cpu_info (struct cpuinfo_ia64 *);
+
+typedef struct {
+       unsigned long seg;
+} mm_segment_t;
+
+#define SET_UNALIGN_CTL(task,value)                                                            \
+({                                                                                             \
+       (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_UAC_MASK)                  \
+                               | (((value) << IA64_THREAD_UAC_SHIFT) & IA64_THREAD_UAC_MASK)); \
+       0;                                                                                      \
+})
+#define GET_UNALIGN_CTL(task,addr)                                                             \
+({                                                                                             \
+       put_user(((task)->thread.flags & IA64_THREAD_UAC_MASK) >> IA64_THREAD_UAC_SHIFT,        \
+                (int __user *) (addr));                                                        \
+})
+
+#define SET_FPEMU_CTL(task,value)                                                              \
+({                                                                                             \
+       (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_FPEMU_MASK)                \
+                         | (((value) << IA64_THREAD_FPEMU_SHIFT) & IA64_THREAD_FPEMU_MASK));   \
+       0;                                                                                      \
+})
+#define GET_FPEMU_CTL(task,addr)                                                               \
+({                                                                                             \
+       put_user(((task)->thread.flags & IA64_THREAD_FPEMU_MASK) >> IA64_THREAD_FPEMU_SHIFT,    \
+                (int __user *) (addr));                                                        \
+})
+
+#ifdef CONFIG_IA32_SUPPORT
+struct desc_struct {
+       unsigned int a, b;
+};
+
+#define desc_empty(desc)               (!((desc)->a | (desc)->b))
+#define desc_equal(desc1, desc2)       (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
+
+#define GDT_ENTRY_TLS_ENTRIES  3
+#define GDT_ENTRY_TLS_MIN      6
+#define GDT_ENTRY_TLS_MAX      (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
+
+#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
+
+struct ia64_partial_page_list;
+#endif
+
+struct thread_struct {
+       __u32 flags;                    /* various thread flags (see IA64_THREAD_*) */
+       /* writing on_ustack is performance-critical, so it's worth spending 8 bits on it... */
+       __u8 on_ustack;                 /* executing on user-stacks? */
+       __u8 pad[3];
+       __u64 ksp;                      /* kernel stack pointer */
+       __u64 map_base;                 /* base address for get_unmapped_area() */
+       __u64 task_size;                /* limit for task size */
+       __u64 rbs_bot;                  /* the base address for the RBS */
+       int last_fph_cpu;               /* CPU that may hold the contents of f32-f127 */
+
+#ifdef CONFIG_IA32_SUPPORT
+       __u64 eflag;                    /* IA32 EFLAGS reg */
+       __u64 fsr;                      /* IA32 floating pt status reg */
+       __u64 fcr;                      /* IA32 floating pt control reg */
+       __u64 fir;                      /* IA32 fp except. instr. reg */
+       __u64 fdr;                      /* IA32 fp except. data reg */
+       __u64 old_k1;                   /* old value of ar.k1 */
+       __u64 old_iob;                  /* old IOBase value */
+       struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */
+        /* cached TLS descriptors. */
+       struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
+
+# define INIT_THREAD_IA32      .eflag =        0,                      \
+                               .fsr =          0,                      \
+                               .fcr =          0x17800000037fULL,      \
+                               .fir =          0,                      \
+                               .fdr =          0,                      \
+                               .old_k1 =       0,                      \
+                               .old_iob =      0,                      \
+                               .ppl =          NULL,
+#else
+# define INIT_THREAD_IA32
+#endif /* CONFIG_IA32_SUPPORT */
+#ifdef CONFIG_PERFMON
+       void *pfm_context;                   /* pointer to detailed PMU context */
+       unsigned long pfm_needs_checking;    /* when >0, pending perfmon work on kernel exit */
+# define INIT_THREAD_PM                .pfm_context =          NULL,     \
+                               .pfm_needs_checking =   0UL,
+#else
+# define INIT_THREAD_PM
+#endif
+       __u64 dbr[IA64_NUM_DBG_REGS];
+       __u64 ibr[IA64_NUM_DBG_REGS];
+       struct ia64_fpreg fph[96];      /* saved/loaded on demand */
+};
+
+#define INIT_THREAD {                                          \
+       .flags =        0,                                      \
+       .on_ustack =    0,                                      \
+       .ksp =          0,                                      \
+       .map_base =     DEFAULT_MAP_BASE,                       \
+       .rbs_bot =      STACK_TOP - DEFAULT_USER_STACK_SIZE,    \
+       .task_size =    DEFAULT_TASK_SIZE,                      \
+       .last_fph_cpu =  -1,                                    \
+       INIT_THREAD_IA32                                        \
+       INIT_THREAD_PM                                          \
+       .dbr =          {0, },                                  \
+       .ibr =          {0, },                                  \
+       .fph =          {{{{0}}}, }                             \
+}
+
+#define start_thread(regs,new_ip,new_sp) do {                                                  \
+       set_fs(USER_DS);                                                                        \
+       regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL))                \
+                        & ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS));              \
+       regs->cr_iip = new_ip;                                                                  \
+       regs->ar_rsc = 0xf;             /* eager mode, privilege level 3 */                     \
+       regs->ar_rnat = 0;                                                                      \
+       regs->ar_bspstore = current->thread.rbs_bot;                                            \
+       regs->ar_fpsr = FPSR_DEFAULT;                                                           \
+       regs->loadrs = 0;                                                                       \
+       regs->r8 = get_dumpable(current->mm);   /* set "don't zap registers" flag */            \
+       regs->r12 = new_sp - 16;        /* allocate 16 byte scratch area */                     \
+       if (unlikely(!get_dumpable(current->mm))) {                                                     \
+               /*                                                                              \
+                * Zap scratch regs to avoid leaking bits between processes with different      \
+                * uid/privileges.                                                              \
+                */                                                                             \
+               regs->ar_pfs = 0; regs->b0 = 0; regs->pr = 0;                                   \
+               regs->r1 = 0; regs->r9  = 0; regs->r11 = 0; regs->r13 = 0; regs->r15 = 0;       \
+       }                                                                                       \
+} while (0)
+
+/* Forward declarations, a strange C thing... */
+struct mm_struct;
+struct task_struct;
+
+/*
+ * Free all resources held by a thread. This is called after the
+ * parent of DEAD_TASK has collected the exit status of the task via
+ * wait().
+ */
+#define release_thread(dead_task)
+
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
+
+/*
+ * This is the mechanism for creating a new kernel thread.
+ *
+ * NOTE 1: Only a kernel-only process (ie the swapper or direct
+ * descendants who haven't done an "execve()") should use this: it
+ * will work within a system call from a "real" process, but the
+ * process memory space will not be free'd until both the parent and
+ * the child have exited.
+ *
+ * NOTE 2: This MUST NOT be an inlined function.  Otherwise, we get
+ * into trouble in init/main.c when the child thread returns to
+ * do_basic_setup() and the timing is such that free_initmem() has
+ * been called already.
+ */
+extern pid_t kernel_thread (int (*fn)(void *), void *arg, unsigned long flags);
+
+/* Get wait channel for task P.  */
+extern unsigned long get_wchan (struct task_struct *p);
+
+/* Return instruction pointer of blocked task TSK.  */
+#define KSTK_EIP(tsk)                                  \
+  ({                                                   \
+       struct pt_regs *_regs = task_pt_regs(tsk);      \
+       _regs->cr_iip + ia64_psr(_regs)->ri;            \
+  })
+
+/* Return stack pointer of blocked task TSK.  */
+#define KSTK_ESP(tsk)  ((tsk)->thread.ksp)
+
+extern void ia64_getreg_unknown_kr (void);
+extern void ia64_setreg_unknown_kr (void);
+
+#define ia64_get_kr(regnum)                                    \
+({                                                             \
+       unsigned long r = 0;                                    \
+                                                               \
+       switch (regnum) {                                       \
+           case 0: r = ia64_getreg(_IA64_REG_AR_KR0); break;   \
+           case 1: r = ia64_getreg(_IA64_REG_AR_KR1); break;   \
+           case 2: r = ia64_getreg(_IA64_REG_AR_KR2); break;   \
+           case 3: r = ia64_getreg(_IA64_REG_AR_KR3); break;   \
+           case 4: r = ia64_getreg(_IA64_REG_AR_KR4); break;   \
+           case 5: r = ia64_getreg(_IA64_REG_AR_KR5); break;   \
+           case 6: r = ia64_getreg(_IA64_REG_AR_KR6); break;   \
+           case 7: r = ia64_getreg(_IA64_REG_AR_KR7); break;   \
+           default: ia64_getreg_unknown_kr(); break;           \
+       }                                                       \
+       r;                                                      \
+})
+
+#define ia64_set_kr(regnum, r)                                         \
+({                                                             \
+       switch (regnum) {                                       \
+           case 0: ia64_setreg(_IA64_REG_AR_KR0, r); break;    \
+           case 1: ia64_setreg(_IA64_REG_AR_KR1, r); break;    \
+           case 2: ia64_setreg(_IA64_REG_AR_KR2, r); break;    \
+           case 3: ia64_setreg(_IA64_REG_AR_KR3, r); break;    \
+           case 4: ia64_setreg(_IA64_REG_AR_KR4, r); break;    \
+           case 5: ia64_setreg(_IA64_REG_AR_KR5, r); break;    \
+           case 6: ia64_setreg(_IA64_REG_AR_KR6, r); break;    \
+           case 7: ia64_setreg(_IA64_REG_AR_KR7, r); break;    \
+           default: ia64_setreg_unknown_kr(); break;           \
+       }                                                       \
+})
+
+/*
+ * The following three macros can't be inline functions because we don't have struct
+ * task_struct at this point.
+ */
+
+/*
+ * Return TRUE if task T owns the fph partition of the CPU we're running on.
+ * Must be called from code that has preemption disabled.
+ */
+#define ia64_is_local_fpu_owner(t)                                                             \
+({                                                                                             \
+       struct task_struct *__ia64_islfo_task = (t);                                            \
+       (__ia64_islfo_task->thread.last_fph_cpu == smp_processor_id()                           \
+        && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER));        \
+})
+
+/*
+ * Mark task T as owning the fph partition of the CPU we're running on.
+ * Must be called from code that has preemption disabled.
+ */
+#define ia64_set_local_fpu_owner(t) do {                                               \
+       struct task_struct *__ia64_slfo_task = (t);                                     \
+       __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id();                     \
+       ia64_set_kr(IA64_KR_FPU_OWNER, (unsigned long) __ia64_slfo_task);               \
+} while (0)
+
+/* Mark the fph partition of task T as being invalid on all CPUs.  */
+#define ia64_drop_fpu(t)       ((t)->thread.last_fph_cpu = -1)
+
+extern void __ia64_init_fpu (void);
+extern void __ia64_save_fpu (struct ia64_fpreg *fph);
+extern void __ia64_load_fpu (struct ia64_fpreg *fph);
+extern void ia64_save_debug_regs (unsigned long *save_area);
+extern void ia64_load_debug_regs (unsigned long *save_area);
+
+#ifdef CONFIG_IA32_SUPPORT
+extern void ia32_save_state (struct task_struct *task);
+extern void ia32_load_state (struct task_struct *task);
+#endif
+
+#define ia64_fph_enable()      do { ia64_rsm(IA64_PSR_DFH); ia64_srlz_d(); } while (0)
+#define ia64_fph_disable()     do { ia64_ssm(IA64_PSR_DFH); ia64_srlz_d(); } while (0)
+
+/* load fp 0.0 into fph */
+static inline void
+ia64_init_fpu (void) {
+       ia64_fph_enable();
+       __ia64_init_fpu();
+       ia64_fph_disable();
+}
+
+/* save f32-f127 at FPH */
+static inline void
+ia64_save_fpu (struct ia64_fpreg *fph) {
+       ia64_fph_enable();
+       __ia64_save_fpu(fph);
+       ia64_fph_disable();
+}
+
+/* load f32-f127 from FPH */
+static inline void
+ia64_load_fpu (struct ia64_fpreg *fph) {
+       ia64_fph_enable();
+       __ia64_load_fpu(fph);
+       ia64_fph_disable();
+}
+
+static inline __u64
+ia64_clear_ic (void)
+{
+       __u64 psr;
+       psr = ia64_getreg(_IA64_REG_PSR);
+       ia64_stop();
+       ia64_rsm(IA64_PSR_I | IA64_PSR_IC);
+       ia64_srlz_i();
+       return psr;
+}
+
+/*
+ * Restore the psr.
+ */
+static inline void
+ia64_set_psr (__u64 psr)
+{
+       ia64_stop();
+       ia64_setreg(_IA64_REG_PSR_L, psr);
+       ia64_srlz_i();
+}
+
+/*
+ * Insert a translation into an instruction and/or data translation
+ * register.
+ */
+static inline void
+ia64_itr (__u64 target_mask, __u64 tr_num,
+         __u64 vmaddr, __u64 pte,
+         __u64 log_page_size)
+{
+       ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
+       ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
+       ia64_stop();
+       if (target_mask & 0x1)
+               ia64_itri(tr_num, pte);
+       if (target_mask & 0x2)
+               ia64_itrd(tr_num, pte);
+}
+
+/*
+ * Insert a translation into the instruction and/or data translation
+ * cache.
+ */
+static inline void
+ia64_itc (__u64 target_mask, __u64 vmaddr, __u64 pte,
+         __u64 log_page_size)
+{
+       ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
+       ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
+       ia64_stop();
+       /* as per EAS2.6, itc must be the last instruction in an instruction group */
+       if (target_mask & 0x1)
+               ia64_itci(pte);
+       if (target_mask & 0x2)
+               ia64_itcd(pte);
+}
+
+/*
+ * Purge a range of addresses from instruction and/or data translation
+ * register(s).
+ */
+static inline void
+ia64_ptr (__u64 target_mask, __u64 vmaddr, __u64 log_size)
+{
+       if (target_mask & 0x1)
+               ia64_ptri(vmaddr, (log_size << 2));
+       if (target_mask & 0x2)
+               ia64_ptrd(vmaddr, (log_size << 2));
+}
+
+/* Set the interrupt vector address.  The address must be suitably aligned (32KB).  */
+static inline void
+ia64_set_iva (void *ivt_addr)
+{
+       ia64_setreg(_IA64_REG_CR_IVA, (__u64) ivt_addr);
+       ia64_srlz_i();
+}
+
+/* Set the page table address and control bits.  */
+static inline void
+ia64_set_pta (__u64 pta)
+{
+       /* Note: srlz.i implies srlz.d */
+       ia64_setreg(_IA64_REG_CR_PTA, pta);
+       ia64_srlz_i();
+}
+
+static inline void
+ia64_eoi (void)
+{
+       ia64_setreg(_IA64_REG_CR_EOI, 0);
+       ia64_srlz_d();
+}
+
+#define cpu_relax()    ia64_hint(ia64_hint_pause)
+
+static inline int
+ia64_get_irr(unsigned int vector)
+{
+       unsigned int reg = vector / 64;
+       unsigned int bit = vector % 64;
+       u64 irr;
+
+       switch (reg) {
+       case 0: irr = ia64_getreg(_IA64_REG_CR_IRR0); break;
+       case 1: irr = ia64_getreg(_IA64_REG_CR_IRR1); break;
+       case 2: irr = ia64_getreg(_IA64_REG_CR_IRR2); break;
+       case 3: irr = ia64_getreg(_IA64_REG_CR_IRR3); break;
+       }
+
+       return test_bit(bit, &irr);
+}
+
+static inline void
+ia64_set_lrr0 (unsigned long val)
+{
+       ia64_setreg(_IA64_REG_CR_LRR0, val);
+       ia64_srlz_d();
+}
+
+static inline void
+ia64_set_lrr1 (unsigned long val)
+{
+       ia64_setreg(_IA64_REG_CR_LRR1, val);
+       ia64_srlz_d();
+}
+
+
+/*
+ * Given the address to which a spill occurred, return the unat bit
+ * number that corresponds to this address.
+ */
+static inline __u64
+ia64_unat_pos (void *spill_addr)
+{
+       return ((__u64) spill_addr >> 3) & 0x3f;
+}
+
+/*
+ * Set the NaT bit of an integer register which was spilled at address
+ * SPILL_ADDR.  UNAT is the mask to be updated.
+ */
+static inline void
+ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat)
+{
+       __u64 bit = ia64_unat_pos(spill_addr);
+       __u64 mask = 1UL << bit;
+
+       *unat = (*unat & ~mask) | (nat << bit);
+}
+
+/*
+ * Return saved PC of a blocked thread.
+ * Note that the only way T can block is through a call to schedule() -> switch_to().
+ */
+static inline unsigned long
+thread_saved_pc (struct task_struct *t)
+{
+       struct unw_frame_info info;
+       unsigned long ip;
+
+       unw_init_from_blocked_task(&info, t);
+       if (unw_unwind(&info) < 0)
+               return 0;
+       unw_get_ip(&info, &ip);
+       return ip;
+}
+
+/*
+ * Get the current instruction/program counter value.
+ */
+#define current_text_addr() \
+       ({ void *_pc; _pc = (void *)ia64_getreg(_IA64_REG_IP); _pc; })
+
+static inline __u64
+ia64_get_ivr (void)
+{
+       __u64 r;
+       ia64_srlz_d();
+       r = ia64_getreg(_IA64_REG_CR_IVR);
+       ia64_srlz_d();
+       return r;
+}
+
+static inline void
+ia64_set_dbr (__u64 regnum, __u64 value)
+{
+       __ia64_set_dbr(regnum, value);
+#ifdef CONFIG_ITANIUM
+       ia64_srlz_d();
+#endif
+}
+
+static inline __u64
+ia64_get_dbr (__u64 regnum)
+{
+       __u64 retval;
+
+       retval = __ia64_get_dbr(regnum);
+#ifdef CONFIG_ITANIUM
+       ia64_srlz_d();
+#endif
+       return retval;
+}
+
+static inline __u64
+ia64_rotr (__u64 w, __u64 n)
+{
+       return (w >> n) | (w << (64 - n));
+}
+
+#define ia64_rotl(w,n) ia64_rotr((w), (64) - (n))
+
+/*
+ * Take a mapped kernel address and return the equivalent address
+ * in the region 7 identity mapped virtual area.
+ */
+static inline void *
+ia64_imva (void *addr)
+{
+       void *result;
+       result = (void *) ia64_tpa(addr);
+       return __va(result);
+}
+
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+#define ARCH_HAS_SPINLOCK_PREFETCH
+#define PREFETCH_STRIDE                        L1_CACHE_BYTES
+
+static inline void
+prefetch (const void *x)
+{
+        ia64_lfetch(ia64_lfhint_none, x);
+}
+
+static inline void
+prefetchw (const void *x)
+{
+       ia64_lfetch_excl(ia64_lfhint_none, x);
+}
+
+#define spin_lock_prefetch(x)  prefetchw(x)
+
+extern unsigned long boot_option_idle_override;
+extern unsigned long idle_halt;
+extern unsigned long idle_nomwait;
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_PROCESSOR_H */
diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..15f8dcf
--- /dev/null
@@ -0,0 +1,364 @@
+#ifndef _ASM_IA64_PTRACE_H
+#define _ASM_IA64_PTRACE_H
+
+/*
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *     Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 2003 Intel Co
+ *     Suresh Siddha <suresh.b.siddha@intel.com>
+ *     Fenghua Yu <fenghua.yu@intel.com>
+ *     Arun Sharma <arun.sharma@intel.com>
+ *
+ * 12/07/98    S. Eranian      added pt_regs & switch_stack
+ * 12/21/98    D. Mosberger    updated to match latest code
+ *  6/17/99    D. Mosberger    added second unat member to "struct switch_stack"
+ *
+ */
+/*
+ * When a user process is blocked, its state looks as follows:
+ *
+ *            +----------------------+ ------- IA64_STK_OFFSET
+ *                   |                      |   ^
+ *            | struct pt_regs       |  |
+ *           |                      |   |
+ *            +----------------------+  |
+ *           |                      |   |
+ *                   |    memory stack      |   |
+ *           | (growing downwards)  |   |
+ *           //.....................//  |
+ *                                      |
+ *           //.....................//  |
+ *           |                      |   |
+ *            +----------------------+  |
+ *            | struct switch_stack  |  |
+ *           |                      |   |
+ *           +----------------------+   |
+ *           |                      |   |
+ *           //.....................//  |
+ *                                      |
+ *           //.....................//  |
+ *           |                      |   |
+ *           |  register stack      |   |
+ *           | (growing upwards)    |   |
+ *            |                             |   |
+ *           +----------------------+   |  --- IA64_RBS_OFFSET
+ *            |  struct thread_info  |  |  ^
+ *           +----------------------+   |  |
+ *           |                      |   |  |
+ *            |  struct task_struct  |  |  |
+ * current -> |                             |   |  |
+ *           +----------------------+ -------
+ *
+ * Note that ar.ec is not saved explicitly in pt_reg or switch_stack.
+ * This is because ar.ec is saved as part of ar.pfs.
+ */
+
+
+#include <asm/fpu.h>
+
+#ifdef __KERNEL__
+#ifndef ASM_OFFSETS_C
+#include <asm/asm-offsets.h>
+#endif
+
+/*
+ * Base-2 logarithm of number of pages to allocate per task structure
+ * (including register backing store and memory stack):
+ */
+#if defined(CONFIG_IA64_PAGE_SIZE_4KB)
+# define KERNEL_STACK_SIZE_ORDER               3
+#elif defined(CONFIG_IA64_PAGE_SIZE_8KB)
+# define KERNEL_STACK_SIZE_ORDER               2
+#elif defined(CONFIG_IA64_PAGE_SIZE_16KB)
+# define KERNEL_STACK_SIZE_ORDER               1
+#else
+# define KERNEL_STACK_SIZE_ORDER               0
+#endif
+
+#define IA64_RBS_OFFSET                        ((IA64_TASK_SIZE + IA64_THREAD_INFO_SIZE + 31) & ~31)
+#define IA64_STK_OFFSET                        ((1 << KERNEL_STACK_SIZE_ORDER)*PAGE_SIZE)
+
+#define KERNEL_STACK_SIZE              IA64_STK_OFFSET
+
+#endif /* __KERNEL__ */
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This struct defines the way the registers are saved on system
+ * calls.
+ *
+ * We don't save all floating point register because the kernel
+ * is compiled to use only a very small subset, so the other are
+ * untouched.
+ *
+ * THIS STRUCTURE MUST BE A MULTIPLE 16-BYTE IN SIZE
+ * (because the memory stack pointer MUST ALWAYS be aligned this way)
+ *
+ */
+struct pt_regs {
+       /* The following registers are saved by SAVE_MIN: */
+       unsigned long b6;               /* scratch */
+       unsigned long b7;               /* scratch */
+
+       unsigned long ar_csd;           /* used by cmp8xchg16 (scratch) */
+       unsigned long ar_ssd;           /* reserved for future use (scratch) */
+
+       unsigned long r8;               /* scratch (return value register 0) */
+       unsigned long r9;               /* scratch (return value register 1) */
+       unsigned long r10;              /* scratch (return value register 2) */
+       unsigned long r11;              /* scratch (return value register 3) */
+
+       unsigned long cr_ipsr;          /* interrupted task's psr */
+       unsigned long cr_iip;           /* interrupted task's instruction pointer */
+       /*
+        * interrupted task's function state; if bit 63 is cleared, it
+        * contains syscall's ar.pfs.pfm:
+        */
+       unsigned long cr_ifs;
+
+       unsigned long ar_unat;          /* interrupted task's NaT register (preserved) */
+       unsigned long ar_pfs;           /* prev function state  */
+       unsigned long ar_rsc;           /* RSE configuration */
+       /* The following two are valid only if cr_ipsr.cpl > 0 || ti->flags & _TIF_MCA_INIT */
+       unsigned long ar_rnat;          /* RSE NaT */
+       unsigned long ar_bspstore;      /* RSE bspstore */
+
+       unsigned long pr;               /* 64 predicate registers (1 bit each) */
+       unsigned long b0;               /* return pointer (bp) */
+       unsigned long loadrs;           /* size of dirty partition << 16 */
+
+       unsigned long r1;               /* the gp pointer */
+       unsigned long r12;              /* interrupted task's memory stack pointer */
+       unsigned long r13;              /* thread pointer */
+
+       unsigned long ar_fpsr;          /* floating point status (preserved) */
+       unsigned long r15;              /* scratch */
+
+       /* The remaining registers are NOT saved for system calls.  */
+
+       unsigned long r14;              /* scratch */
+       unsigned long r2;               /* scratch */
+       unsigned long r3;               /* scratch */
+
+       /* The following registers are saved by SAVE_REST: */
+       unsigned long r16;              /* scratch */
+       unsigned long r17;              /* scratch */
+       unsigned long r18;              /* scratch */
+       unsigned long r19;              /* scratch */
+       unsigned long r20;              /* scratch */
+       unsigned long r21;              /* scratch */
+       unsigned long r22;              /* scratch */
+       unsigned long r23;              /* scratch */
+       unsigned long r24;              /* scratch */
+       unsigned long r25;              /* scratch */
+       unsigned long r26;              /* scratch */
+       unsigned long r27;              /* scratch */
+       unsigned long r28;              /* scratch */
+       unsigned long r29;              /* scratch */
+       unsigned long r30;              /* scratch */
+       unsigned long r31;              /* scratch */
+
+       unsigned long ar_ccv;           /* compare/exchange value (scratch) */
+
+       /*
+        * Floating point registers that the kernel considers scratch:
+        */
+       struct ia64_fpreg f6;           /* scratch */
+       struct ia64_fpreg f7;           /* scratch */
+       struct ia64_fpreg f8;           /* scratch */
+       struct ia64_fpreg f9;           /* scratch */
+       struct ia64_fpreg f10;          /* scratch */
+       struct ia64_fpreg f11;          /* scratch */
+};
+
+/*
+ * This structure contains the addition registers that need to
+ * preserved across a context switch.  This generally consists of
+ * "preserved" registers.
+ */
+struct switch_stack {
+       unsigned long caller_unat;      /* user NaT collection register (preserved) */
+       unsigned long ar_fpsr;          /* floating-point status register */
+
+       struct ia64_fpreg f2;           /* preserved */
+       struct ia64_fpreg f3;           /* preserved */
+       struct ia64_fpreg f4;           /* preserved */
+       struct ia64_fpreg f5;           /* preserved */
+
+       struct ia64_fpreg f12;          /* scratch, but untouched by kernel */
+       struct ia64_fpreg f13;          /* scratch, but untouched by kernel */
+       struct ia64_fpreg f14;          /* scratch, but untouched by kernel */
+       struct ia64_fpreg f15;          /* scratch, but untouched by kernel */
+       struct ia64_fpreg f16;          /* preserved */
+       struct ia64_fpreg f17;          /* preserved */
+       struct ia64_fpreg f18;          /* preserved */
+       struct ia64_fpreg f19;          /* preserved */
+       struct ia64_fpreg f20;          /* preserved */
+       struct ia64_fpreg f21;          /* preserved */
+       struct ia64_fpreg f22;          /* preserved */
+       struct ia64_fpreg f23;          /* preserved */
+       struct ia64_fpreg f24;          /* preserved */
+       struct ia64_fpreg f25;          /* preserved */
+       struct ia64_fpreg f26;          /* preserved */
+       struct ia64_fpreg f27;          /* preserved */
+       struct ia64_fpreg f28;          /* preserved */
+       struct ia64_fpreg f29;          /* preserved */
+       struct ia64_fpreg f30;          /* preserved */
+       struct ia64_fpreg f31;          /* preserved */
+
+       unsigned long r4;               /* preserved */
+       unsigned long r5;               /* preserved */
+       unsigned long r6;               /* preserved */
+       unsigned long r7;               /* preserved */
+
+       unsigned long b0;               /* so we can force a direct return in copy_thread */
+       unsigned long b1;
+       unsigned long b2;
+       unsigned long b3;
+       unsigned long b4;
+       unsigned long b5;
+
+       unsigned long ar_pfs;           /* previous function state */
+       unsigned long ar_lc;            /* loop counter (preserved) */
+       unsigned long ar_unat;          /* NaT bits for r4-r7 */
+       unsigned long ar_rnat;          /* RSE NaT collection register */
+       unsigned long ar_bspstore;      /* RSE dirty base (preserved) */
+       unsigned long pr;               /* 64 predicate registers (1 bit each) */
+};
+
+#ifdef __KERNEL__
+
+#include <asm/current.h>
+#include <asm/page.h>
+
+/*
+ * We use the ia64_psr(regs)->ri to determine which of the three
+ * instructions in bundle (16 bytes) took the sample. Generate
+ * the canonical representation by adding to instruction pointer.
+ */
+# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri)
+
+#define regs_return_value(regs) ((regs)->r8)
+
+/* Conserve space in histogram by encoding slot bits in address
+ * bits 2 and 3 rather than bits 0 and 1.
+ */
+#define profile_pc(regs)                                               \
+({                                                                     \
+       unsigned long __ip = instruction_pointer(regs);                 \
+       (__ip & ~3UL) + ((__ip & 3UL) << 2);                            \
+})
+
+  /* given a pointer to a task_struct, return the user's pt_regs */
+# define task_pt_regs(t)               (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
+# define ia64_psr(regs)                        ((struct ia64_psr *) &(regs)->cr_ipsr)
+# define user_mode(regs)               (((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0)
+# define user_stack(task,regs) ((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs))
+# define fsys_mode(task,regs)                                  \
+  ({                                                           \
+         struct task_struct *_task = (task);                   \
+         struct pt_regs *_regs = (regs);                       \
+         !user_mode(_regs) && user_stack(_task, _regs);        \
+  })
+
+  /*
+   * System call handlers that, upon successful completion, need to return a negative value
+   * should call force_successful_syscall_return() right before returning.  On architectures
+   * where the syscall convention provides for a separate error flag (e.g., alpha, ia64,
+   * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error
+   * flag will not get set.  On architectures which do not support a separate error flag,
+   * the macro is a no-op and the spurious error condition needs to be filtered out by some
+   * other means (e.g., in user-level, by passing an extra argument to the syscall handler,
+   * or something along those lines).
+   *
+   * On ia64, we can clear the user's pt_regs->r8 to force a successful syscall.
+   */
+# define force_successful_syscall_return()     (task_pt_regs(current)->r8 = 0)
+
+  struct task_struct;                  /* forward decl */
+  struct unw_frame_info;               /* forward decl */
+
+  extern void show_regs (struct pt_regs *);
+  extern void ia64_do_show_stack (struct unw_frame_info *, void *);
+  extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
+                                             unsigned long *);
+  extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long,
+                        unsigned long, long *);
+  extern long ia64_poke (struct task_struct *, struct switch_stack *, unsigned long,
+                        unsigned long, long);
+  extern void ia64_flush_fph (struct task_struct *);
+  extern void ia64_sync_fph (struct task_struct *);
+  extern void ia64_sync_krbs(void);
+  extern long ia64_sync_user_rbs (struct task_struct *, struct switch_stack *,
+                                 unsigned long, unsigned long);
+
+  /* get nat bits for scratch registers such that bit N==1 iff scratch register rN is a NaT */
+  extern unsigned long ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat);
+  /* put nat bits for scratch registers such that scratch register rN is a NaT iff bit N==1 */
+  extern unsigned long ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat);
+
+  extern void ia64_increment_ip (struct pt_regs *pt);
+  extern void ia64_decrement_ip (struct pt_regs *pt);
+
+  extern void ia64_ptrace_stop(void);
+  #define arch_ptrace_stop(code, info) \
+       ia64_ptrace_stop()
+  #define arch_ptrace_stop_needed(code, info) \
+       (!test_thread_flag(TIF_RESTORE_RSE))
+
+  extern void ptrace_attach_sync_user_rbs (struct task_struct *);
+  #define arch_ptrace_attach(child) \
+       ptrace_attach_sync_user_rbs(child)
+
+  #define arch_has_single_step()  (1)
+  extern void user_enable_single_step(struct task_struct *);
+  extern void user_disable_single_step(struct task_struct *);
+
+  #define arch_has_block_step()   (1)
+  extern void user_enable_block_step(struct task_struct *);
+
+#endif /* !__KERNEL__ */
+
+/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
+struct pt_all_user_regs {
+       unsigned long nat;
+       unsigned long cr_iip;
+       unsigned long cfm;
+       unsigned long cr_ipsr;
+       unsigned long pr;
+
+       unsigned long gr[32];
+       unsigned long br[8];
+       unsigned long ar[128];
+       struct ia64_fpreg fr[128];
+};
+
+#endif /* !__ASSEMBLY__ */
+
+/* indices to application-registers array in pt_all_user_regs */
+#define PT_AUR_RSC     16
+#define PT_AUR_BSP     17
+#define PT_AUR_BSPSTORE        18
+#define PT_AUR_RNAT    19
+#define PT_AUR_CCV     32
+#define PT_AUR_UNAT    36
+#define PT_AUR_FPSR    40
+#define PT_AUR_PFS     64
+#define PT_AUR_LC      65
+#define PT_AUR_EC      66
+
+/*
+ * The numbers chosen here are somewhat arbitrary but absolutely MUST
+ * not overlap with any of the number assigned in <linux/ptrace.h>.
+ */
+#define PTRACE_SINGLEBLOCK     12      /* resume execution until next branch */
+#define PTRACE_OLD_GETSIGINFO  13      /* (replaced by PTRACE_GETSIGINFO in <linux/ptrace.h>)  */
+#define PTRACE_OLD_SETSIGINFO  14      /* (replaced by PTRACE_SETSIGINFO in <linux/ptrace.h>)  */
+#define PTRACE_GETREGS         18      /* get all registers (pt_all_user_regs) in one shot */
+#define PTRACE_SETREGS         19      /* set all registers (pt_all_user_regs) in one shot */
+
+#define PTRACE_OLDSETOPTIONS   21
+
+#endif /* _ASM_IA64_PTRACE_H */
diff --git a/arch/ia64/include/asm/ptrace_offsets.h b/arch/ia64/include/asm/ptrace_offsets.h
new file mode 100644 (file)
index 0000000..b712773
--- /dev/null
@@ -0,0 +1,268 @@
+#ifndef _ASM_IA64_PTRACE_OFFSETS_H
+#define _ASM_IA64_PTRACE_OFFSETS_H
+
+/*
+ * Copyright (C) 1999, 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+/*
+ * The "uarea" that can be accessed via PEEKUSER and POKEUSER is a
+ * virtual structure that would have the following definition:
+ *
+ *     struct uarea {
+ *             struct ia64_fpreg fph[96];              // f32-f127
+ *             unsigned long nat_bits;
+ *             unsigned long empty1;
+ *             struct ia64_fpreg f2;                   // f2-f5
+ *                     :
+ *             struct ia64_fpreg f5;
+ *             struct ia64_fpreg f10;                  // f10-f31
+ *                     :
+ *             struct ia64_fpreg f31;
+ *             unsigned long r4;                       // r4-r7
+ *                     :
+ *             unsigned long r7;
+ *             unsigned long b1;                       // b1-b5
+ *                     :
+ *             unsigned long b5;
+ *             unsigned long ar_ec;
+ *             unsigned long ar_lc;
+ *             unsigned long empty2[5];
+ *             unsigned long cr_ipsr;
+ *             unsigned long cr_iip;
+ *             unsigned long cfm;
+ *             unsigned long ar_unat;
+ *             unsigned long ar_pfs;
+ *             unsigned long ar_rsc;
+ *             unsigned long ar_rnat;
+ *             unsigned long ar_bspstore;
+ *             unsigned long pr;
+ *             unsigned long b6;
+ *             unsigned long ar_bsp;
+ *             unsigned long r1;
+ *             unsigned long r2;
+ *             unsigned long r3;
+ *             unsigned long r12;
+ *             unsigned long r13;
+ *             unsigned long r14;
+ *             unsigned long r15;
+ *             unsigned long r8;
+ *             unsigned long r9;
+ *             unsigned long r10;
+ *             unsigned long r11;
+ *             unsigned long r16;
+ *                     :
+ *             unsigned long r31;
+ *             unsigned long ar_ccv;
+ *             unsigned long ar_fpsr;
+ *             unsigned long b0;
+ *             unsigned long b7;
+ *             unsigned long f6;
+ *             unsigned long f7;
+ *             unsigned long f8;
+ *             unsigned long f9;
+ *             unsigned long ar_csd;
+ *             unsigned long ar_ssd;
+ *             unsigned long rsvd1[710];
+ *             unsigned long dbr[8];
+ *             unsigned long rsvd2[504];
+ *             unsigned long ibr[8];
+ *             unsigned long rsvd3[504];
+ *             unsigned long pmd[4];
+ *     }
+ */
+
+/* fph: */
+#define PT_F32                 0x0000
+#define PT_F33                 0x0010
+#define PT_F34                 0x0020
+#define PT_F35                 0x0030
+#define PT_F36                 0x0040
+#define PT_F37                 0x0050
+#define PT_F38                 0x0060
+#define PT_F39                 0x0070
+#define PT_F40                 0x0080
+#define PT_F41                 0x0090
+#define PT_F42                 0x00a0
+#define PT_F43                 0x00b0
+#define PT_F44                 0x00c0
+#define PT_F45                 0x00d0
+#define PT_F46                 0x00e0
+#define PT_F47                 0x00f0
+#define PT_F48                 0x0100
+#define PT_F49                 0x0110
+#define PT_F50                 0x0120
+#define PT_F51                 0x0130
+#define PT_F52                 0x0140
+#define PT_F53                 0x0150
+#define PT_F54                 0x0160
+#define PT_F55                 0x0170
+#define PT_F56                 0x0180
+#define PT_F57                 0x0190
+#define PT_F58                 0x01a0
+#define PT_F59                 0x01b0
+#define PT_F60                 0x01c0
+#define PT_F61                 0x01d0
+#define PT_F62                 0x01e0
+#define PT_F63                 0x01f0
+#define PT_F64                 0x0200
+#define PT_F65                 0x0210
+#define PT_F66                 0x0220
+#define PT_F67                 0x0230
+#define PT_F68                 0x0240
+#define PT_F69                 0x0250
+#define PT_F70                 0x0260
+#define PT_F71                 0x0270
+#define PT_F72                 0x0280
+#define PT_F73                 0x0290
+#define PT_F74                 0x02a0
+#define PT_F75                 0x02b0
+#define PT_F76                 0x02c0
+#define PT_F77                 0x02d0
+#define PT_F78                 0x02e0
+#define PT_F79                 0x02f0
+#define PT_F80                 0x0300
+#define PT_F81                 0x0310
+#define PT_F82                 0x0320
+#define PT_F83                 0x0330
+#define PT_F84                 0x0340
+#define PT_F85                 0x0350
+#define PT_F86                 0x0360
+#define PT_F87                 0x0370
+#define PT_F88                 0x0380
+#define PT_F89                 0x0390
+#define PT_F90                 0x03a0
+#define PT_F91                 0x03b0
+#define PT_F92                 0x03c0
+#define PT_F93                 0x03d0
+#define PT_F94                 0x03e0
+#define PT_F95                 0x03f0
+#define PT_F96                 0x0400
+#define PT_F97                 0x0410
+#define PT_F98                 0x0420
+#define PT_F99                 0x0430
+#define PT_F100                        0x0440
+#define PT_F101                        0x0450
+#define PT_F102                        0x0460
+#define PT_F103                        0x0470
+#define PT_F104                        0x0480
+#define PT_F105                        0x0490
+#define PT_F106                        0x04a0
+#define PT_F107                        0x04b0
+#define PT_F108                        0x04c0
+#define PT_F109                        0x04d0
+#define PT_F110                        0x04e0
+#define PT_F111                        0x04f0
+#define PT_F112                        0x0500
+#define PT_F113                        0x0510
+#define PT_F114                        0x0520
+#define PT_F115                        0x0530
+#define PT_F116                        0x0540
+#define PT_F117                        0x0550
+#define PT_F118                        0x0560
+#define PT_F119                        0x0570
+#define PT_F120                        0x0580
+#define PT_F121                        0x0590
+#define PT_F122                        0x05a0
+#define PT_F123                        0x05b0
+#define PT_F124                        0x05c0
+#define PT_F125                        0x05d0
+#define PT_F126                        0x05e0
+#define PT_F127                        0x05f0
+
+#define PT_NAT_BITS            0x0600
+
+#define PT_F2                  0x0610
+#define PT_F3                  0x0620
+#define PT_F4                  0x0630
+#define PT_F5                  0x0640
+#define PT_F10                 0x0650
+#define PT_F11                 0x0660
+#define PT_F12                 0x0670
+#define PT_F13                 0x0680
+#define PT_F14                 0x0690
+#define PT_F15                 0x06a0
+#define PT_F16                 0x06b0
+#define PT_F17                 0x06c0
+#define PT_F18                 0x06d0
+#define PT_F19                 0x06e0
+#define PT_F20                 0x06f0
+#define PT_F21                 0x0700
+#define PT_F22                 0x0710
+#define PT_F23                 0x0720
+#define PT_F24                 0x0730
+#define PT_F25                 0x0740
+#define PT_F26                 0x0750
+#define PT_F27                 0x0760
+#define PT_F28                 0x0770
+#define PT_F29                 0x0780
+#define PT_F30                 0x0790
+#define PT_F31                 0x07a0
+#define PT_R4                  0x07b0
+#define PT_R5                  0x07b8
+#define PT_R6                  0x07c0
+#define PT_R7                  0x07c8
+
+#define PT_B1                  0x07d8
+#define PT_B2                  0x07e0
+#define PT_B3                  0x07e8
+#define PT_B4                  0x07f0
+#define PT_B5                  0x07f8
+
+#define PT_AR_EC               0x0800
+#define PT_AR_LC               0x0808
+
+#define PT_CR_IPSR             0x0830
+#define PT_CR_IIP              0x0838
+#define PT_CFM                 0x0840
+#define PT_AR_UNAT             0x0848
+#define PT_AR_PFS              0x0850
+#define PT_AR_RSC              0x0858
+#define PT_AR_RNAT             0x0860
+#define PT_AR_BSPSTORE         0x0868
+#define PT_PR                  0x0870
+#define PT_B6                  0x0878
+#define PT_AR_BSP              0x0880  /* note: this points to the *end* of the backing store! */
+#define PT_R1                  0x0888
+#define PT_R2                  0x0890
+#define PT_R3                  0x0898
+#define PT_R12                 0x08a0
+#define PT_R13                 0x08a8
+#define PT_R14                 0x08b0
+#define PT_R15                 0x08b8
+#define PT_R8                  0x08c0
+#define PT_R9                  0x08c8
+#define PT_R10                 0x08d0
+#define PT_R11                 0x08d8
+#define PT_R16                 0x08e0
+#define PT_R17                 0x08e8
+#define PT_R18                 0x08f0
+#define PT_R19                 0x08f8
+#define PT_R20                 0x0900
+#define PT_R21                 0x0908
+#define PT_R22                 0x0910
+#define PT_R23                 0x0918
+#define PT_R24                 0x0920
+#define PT_R25                 0x0928
+#define PT_R26                 0x0930
+#define PT_R27                 0x0938
+#define PT_R28                 0x0940
+#define PT_R29                 0x0948
+#define PT_R30                 0x0950
+#define PT_R31                 0x0958
+#define PT_AR_CCV              0x0960
+#define PT_AR_FPSR             0x0968
+#define PT_B0                  0x0970
+#define PT_B7                  0x0978
+#define PT_F6                  0x0980
+#define PT_F7                  0x0990
+#define PT_F8                  0x09a0
+#define PT_F9                  0x09b0
+#define PT_AR_CSD              0x09c0
+#define PT_AR_SSD              0x09c8
+
+#define PT_DBR                 0x2000  /* data breakpoint registers */
+#define PT_IBR                 0x3000  /* instruction breakpoint registers */
+#define PT_PMD                 0x4000  /* performance monitoring counters */
+
+#endif /* _ASM_IA64_PTRACE_OFFSETS_H */
diff --git a/arch/ia64/include/asm/resource.h b/arch/ia64/include/asm/resource.h
new file mode 100644 (file)
index 0000000..ba2272a
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _ASM_IA64_RESOURCE_H
+#define _ASM_IA64_RESOURCE_H
+
+#include <asm/ustack.h>
+#include <asm-generic/resource.h>
+
+#endif /* _ASM_IA64_RESOURCE_H */
diff --git a/arch/ia64/include/asm/rse.h b/arch/ia64/include/asm/rse.h
new file mode 100644 (file)
index 0000000..02830a3
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _ASM_IA64_RSE_H
+#define _ASM_IA64_RSE_H
+
+/*
+ * Copyright (C) 1998, 1999 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ * Register stack engine related helper functions.  This file may be
+ * used in applications, so be careful about the name-space and give
+ * some consideration to non-GNU C compilers (though __inline__ is
+ * fine).
+ */
+
+static __inline__ unsigned long
+ia64_rse_slot_num (unsigned long *addr)
+{
+       return (((unsigned long) addr) >> 3) & 0x3f;
+}
+
+/*
+ * Return TRUE if ADDR is the address of an RNAT slot.
+ */
+static __inline__ unsigned long
+ia64_rse_is_rnat_slot (unsigned long *addr)
+{
+       return ia64_rse_slot_num(addr) == 0x3f;
+}
+
+/*
+ * Returns the address of the RNAT slot that covers the slot at
+ * address SLOT_ADDR.
+ */
+static __inline__ unsigned long *
+ia64_rse_rnat_addr (unsigned long *slot_addr)
+{
+       return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3));
+}
+
+/*
+ * Calculate the number of registers in the dirty partition starting at BSPSTORE and
+ * ending at BSP.  This isn't simply (BSP-BSPSTORE)/8 because every 64th slot stores
+ * ar.rnat.
+ */
+static __inline__ unsigned long
+ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp)
+{
+       unsigned long slots = (bsp - bspstore);
+
+       return slots - (ia64_rse_slot_num(bspstore) + slots)/0x40;
+}
+
+/*
+ * The inverse of the above: given bspstore and the number of
+ * registers, calculate ar.bsp.
+ */
+static __inline__ unsigned long *
+ia64_rse_skip_regs (unsigned long *addr, long num_regs)
+{
+       long delta = ia64_rse_slot_num(addr) + num_regs;
+
+       if (num_regs < 0)
+               delta -= 0x3e;
+       return addr + num_regs + delta/0x3f;
+}
+
+#endif /* _ASM_IA64_RSE_H */
diff --git a/arch/ia64/include/asm/rwsem.h b/arch/ia64/include/asm/rwsem.h
new file mode 100644 (file)
index 0000000..fbee74b
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * R/W semaphores for ia64
+ *
+ * Copyright (C) 2003 Ken Chen <kenneth.w.chen@intel.com>
+ * Copyright (C) 2003 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 2005 Christoph Lameter <clameter@sgi.com>
+ *
+ * Based on asm-i386/rwsem.h and other architecture implementation.
+ *
+ * The MSW of the count is the negated number of active writers and
+ * waiting lockers, and the LSW is the total number of active locks.
+ *
+ * The lock count is initialized to 0 (no active and no waiting lockers).
+ *
+ * When a writer subtracts WRITE_BIAS, it'll get 0xffffffff00000001 for
+ * the case of an uncontended lock. Readers increment by 1 and see a positive
+ * value when uncontended, negative if there are writers (and maybe) readers
+ * waiting (in which case it goes to sleep).
+ */
+
+#ifndef _ASM_IA64_RWSEM_H
+#define _ASM_IA64_RWSEM_H
+
+#ifndef _LINUX_RWSEM_H
+#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
+#endif
+
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
+#include <asm/intrinsics.h>
+
+/*
+ * the semaphore definition
+ */
+struct rw_semaphore {
+       signed long             count;
+       spinlock_t              wait_lock;
+       struct list_head        wait_list;
+};
+
+#define RWSEM_UNLOCKED_VALUE           __IA64_UL_CONST(0x0000000000000000)
+#define RWSEM_ACTIVE_BIAS              __IA64_UL_CONST(0x0000000000000001)
+#define RWSEM_ACTIVE_MASK              __IA64_UL_CONST(0x00000000ffffffff)
+#define RWSEM_WAITING_BIAS             -__IA64_UL_CONST(0x0000000100000000)
+#define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
+#define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+
+#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)
+
+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 *sem);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
+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);
+}
+
+/*
+ * lock for reading
+ */
+static inline void
+__down_read (struct rw_semaphore *sem)
+{
+       long result = ia64_fetchadd8_acq((unsigned long *)&sem->count, 1);
+
+       if (result < 0)
+               rwsem_down_read_failed(sem);
+}
+
+/*
+ * lock for writing
+ */
+static inline void
+__down_write (struct rw_semaphore *sem)
+{
+       long old, new;
+
+       do {
+               old = sem->count;
+               new = old + RWSEM_ACTIVE_WRITE_BIAS;
+       } while (cmpxchg_acq(&sem->count, old, new) != old);
+
+       if (old != 0)
+               rwsem_down_write_failed(sem);
+}
+
+/*
+ * unlock after reading
+ */
+static inline void
+__up_read (struct rw_semaphore *sem)
+{
+       long result = ia64_fetchadd8_rel((unsigned long *)&sem->count, -1);
+
+       if (result < 0 && (--result & RWSEM_ACTIVE_MASK) == 0)
+               rwsem_wake(sem);
+}
+
+/*
+ * unlock after writing
+ */
+static inline void
+__up_write (struct rw_semaphore *sem)
+{
+       long old, new;
+
+       do {
+               old = sem->count;
+               new = old - RWSEM_ACTIVE_WRITE_BIAS;
+       } while (cmpxchg_rel(&sem->count, old, new) != old);
+
+       if (new < 0 && (new & RWSEM_ACTIVE_MASK) == 0)
+               rwsem_wake(sem);
+}
+
+/*
+ * trylock for reading -- returns 1 if successful, 0 if contention
+ */
+static inline int
+__down_read_trylock (struct rw_semaphore *sem)
+{
+       long tmp;
+       while ((tmp = sem->count) >= 0) {
+               if (tmp == cmpxchg_acq(&sem->count, tmp, tmp+1)) {
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * trylock for writing -- returns 1 if successful, 0 if contention
+ */
+static inline int
+__down_write_trylock (struct rw_semaphore *sem)
+{
+       long tmp = cmpxchg_acq(&sem->count, RWSEM_UNLOCKED_VALUE,
+                             RWSEM_ACTIVE_WRITE_BIAS);
+       return tmp == RWSEM_UNLOCKED_VALUE;
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void
+__downgrade_write (struct rw_semaphore *sem)
+{
+       long old, new;
+
+       do {
+               old = sem->count;
+               new = old - RWSEM_WAITING_BIAS;
+       } while (cmpxchg_rel(&sem->count, old, new) != old);
+
+       if (old < 0)
+               rwsem_downgrade_wake(sem);
+}
+
+/*
+ * Implement atomic add functionality.  These used to be "inline" functions, but GCC v3.1
+ * doesn't quite optimize this stuff right and ends up with bad calls to fetchandadd.
+ */
+#define rwsem_atomic_add(delta, sem)   atomic64_add(delta, (atomic64_t *)(&(sem)->count))
+#define rwsem_atomic_update(delta, sem)        atomic64_add_return(delta, (atomic64_t *)(&(sem)->count))
+
+static inline int rwsem_is_locked(struct rw_semaphore *sem)
+{
+       return (sem->count != 0);
+}
+
+#endif /* _ASM_IA64_RWSEM_H */
diff --git a/arch/ia64/include/asm/sal.h b/arch/ia64/include/asm/sal.h
new file mode 100644 (file)
index 0000000..89594b4
--- /dev/null
@@ -0,0 +1,905 @@
+#ifndef _ASM_IA64_SAL_H
+#define _ASM_IA64_SAL_H
+
+/*
+ * System Abstraction Layer definitions.
+ *
+ * This is based on version 2.5 of the manual "IA-64 System
+ * Abstraction Layer".
+ *
+ * Copyright (C) 2001 Intel
+ * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
+ * Copyright (C) 2001 Fred Lewis <frederick.v.lewis@intel.com>
+ * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
+ *
+ * 02/01/04 J. Hall Updated Error Record Structures to conform to July 2001
+ *                 revision of the SAL spec.
+ * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000
+ *                  revision of the SAL spec.
+ * 99/09/29 davidm     Updated for SAL 2.6.
+ * 00/03/29 cfleck      Updated SAL Error Logging info for processor (SAL 2.6)
+ *                      (plus examples of platform error info structures from smariset @ Intel)
+ */
+
+#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT         0
+#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT   1
+#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT   2
+#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT                3
+
+#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK       (1<<IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT)
+#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT)
+#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT)
+#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT      (1<<IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT)
+
+#ifndef __ASSEMBLY__
+
+#include <linux/bcd.h>
+#include <linux/spinlock.h>
+#include <linux/efi.h>
+
+#include <asm/pal.h>
+#include <asm/system.h>
+#include <asm/fpu.h>
+
+extern spinlock_t sal_lock;
+
+/* SAL spec _requires_ eight args for each call. */
+#define __IA64_FW_CALL(entry,result,a0,a1,a2,a3,a4,a5,a6,a7)   \
+       result = (*entry)(a0,a1,a2,a3,a4,a5,a6,a7)
+
+# define IA64_FW_CALL(entry,result,args...) do {               \
+       unsigned long __ia64_sc_flags;                          \
+       struct ia64_fpreg __ia64_sc_fr[6];                      \
+       ia64_save_scratch_fpregs(__ia64_sc_fr);                 \
+       spin_lock_irqsave(&sal_lock, __ia64_sc_flags);          \
+       __IA64_FW_CALL(entry, result, args);                    \
+       spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags);     \
+       ia64_load_scratch_fpregs(__ia64_sc_fr);                 \
+} while (0)
+
+# define SAL_CALL(result,args...)                      \
+       IA64_FW_CALL(ia64_sal, result, args);
+
+# define SAL_CALL_NOLOCK(result,args...) do {          \
+       unsigned long __ia64_scn_flags;                 \
+       struct ia64_fpreg __ia64_scn_fr[6];             \
+       ia64_save_scratch_fpregs(__ia64_scn_fr);        \
+       local_irq_save(__ia64_scn_flags);               \
+       __IA64_FW_CALL(ia64_sal, result, args);         \
+       local_irq_restore(__ia64_scn_flags);            \
+       ia64_load_scratch_fpregs(__ia64_scn_fr);        \
+} while (0)
+
+# define SAL_CALL_REENTRANT(result,args...) do {       \
+       struct ia64_fpreg __ia64_scs_fr[6];             \
+       ia64_save_scratch_fpregs(__ia64_scs_fr);        \
+       preempt_disable();                              \
+       __IA64_FW_CALL(ia64_sal, result, args);         \
+       preempt_enable();                               \
+       ia64_load_scratch_fpregs(__ia64_scs_fr);        \
+} while (0)
+
+#define SAL_SET_VECTORS                        0x01000000
+#define SAL_GET_STATE_INFO             0x01000001
+#define SAL_GET_STATE_INFO_SIZE                0x01000002
+#define SAL_CLEAR_STATE_INFO           0x01000003
+#define SAL_MC_RENDEZ                  0x01000004
+#define SAL_MC_SET_PARAMS              0x01000005
+#define SAL_REGISTER_PHYSICAL_ADDR     0x01000006
+
+#define SAL_CACHE_FLUSH                        0x01000008
+#define SAL_CACHE_INIT                 0x01000009
+#define SAL_PCI_CONFIG_READ            0x01000010
+#define SAL_PCI_CONFIG_WRITE           0x01000011
+#define SAL_FREQ_BASE                  0x01000012
+#define SAL_PHYSICAL_ID_INFO           0x01000013
+
+#define SAL_UPDATE_PAL                 0x01000020
+
+struct ia64_sal_retval {
+       /*
+        * A zero status value indicates call completed without error.
+        * A negative status value indicates reason of call failure.
+        * A positive status value indicates success but an
+        * informational value should be printed (e.g., "reboot for
+        * change to take effect").
+        */
+       s64 status;
+       u64 v0;
+       u64 v1;
+       u64 v2;
+};
+
+typedef struct ia64_sal_retval (*ia64_sal_handler) (u64, ...);
+
+enum {
+       SAL_FREQ_BASE_PLATFORM = 0,
+       SAL_FREQ_BASE_INTERVAL_TIMER = 1,
+       SAL_FREQ_BASE_REALTIME_CLOCK = 2
+};
+
+/*
+ * The SAL system table is followed by a variable number of variable
+ * length descriptors.  The structure of these descriptors follows
+ * below.
+ * The defininition follows SAL specs from July 2000
+ */
+struct ia64_sal_systab {
+       u8 signature[4];        /* should be "SST_" */
+       u32 size;               /* size of this table in bytes */
+       u8 sal_rev_minor;
+       u8 sal_rev_major;
+       u16 entry_count;        /* # of entries in variable portion */
+       u8 checksum;
+       u8 reserved1[7];
+       u8 sal_a_rev_minor;
+       u8 sal_a_rev_major;
+       u8 sal_b_rev_minor;
+       u8 sal_b_rev_major;
+       /* oem_id & product_id: terminating NUL is missing if string is exactly 32 bytes long. */
+       u8 oem_id[32];
+       u8 product_id[32];      /* ASCII product id  */
+       u8 reserved2[8];
+};
+
+enum sal_systab_entry_type {
+       SAL_DESC_ENTRY_POINT = 0,
+       SAL_DESC_MEMORY = 1,
+       SAL_DESC_PLATFORM_FEATURE = 2,
+       SAL_DESC_TR = 3,
+       SAL_DESC_PTC = 4,
+       SAL_DESC_AP_WAKEUP = 5
+};
+
+/*
+ * Entry type: Size:
+ *     0       48
+ *     1       32
+ *     2       16
+ *     3       32
+ *     4       16
+ *     5       16
+ */
+#define SAL_DESC_SIZE(type)    "\060\040\020\040\020\020"[(unsigned) type]
+
+typedef struct ia64_sal_desc_entry_point {
+       u8 type;
+       u8 reserved1[7];
+       u64 pal_proc;
+       u64 sal_proc;
+       u64 gp;
+       u8 reserved2[16];
+}ia64_sal_desc_entry_point_t;
+
+typedef struct ia64_sal_desc_memory {
+       u8 type;
+       u8 used_by_sal; /* needs to be mapped for SAL? */
+       u8 mem_attr;            /* current memory attribute setting */
+       u8 access_rights;       /* access rights set up by SAL */
+       u8 mem_attr_mask;       /* mask of supported memory attributes */
+       u8 reserved1;
+       u8 mem_type;            /* memory type */
+       u8 mem_usage;           /* memory usage */
+       u64 addr;               /* physical address of memory */
+       u32 length;     /* length (multiple of 4KB pages) */
+       u32 reserved2;
+       u8 oem_reserved[8];
+} ia64_sal_desc_memory_t;
+
+typedef struct ia64_sal_desc_platform_feature {
+       u8 type;
+       u8 feature_mask;
+       u8 reserved1[14];
+} ia64_sal_desc_platform_feature_t;
+
+typedef struct ia64_sal_desc_tr {
+       u8 type;
+       u8 tr_type;             /* 0 == instruction, 1 == data */
+       u8 regnum;              /* translation register number */
+       u8 reserved1[5];
+       u64 addr;               /* virtual address of area covered */
+       u64 page_size;          /* encoded page size */
+       u8 reserved2[8];
+} ia64_sal_desc_tr_t;
+
+typedef struct ia64_sal_desc_ptc {
+       u8 type;
+       u8 reserved1[3];
+       u32 num_domains;        /* # of coherence domains */
+       u64 domain_info;        /* physical address of domain info table */
+} ia64_sal_desc_ptc_t;
+
+typedef struct ia64_sal_ptc_domain_info {
+       u64 proc_count;         /* number of processors in domain */
+       u64 proc_list;          /* physical address of LID array */
+} ia64_sal_ptc_domain_info_t;
+
+typedef struct ia64_sal_ptc_domain_proc_entry {
+       u64 id  : 8;            /* id of processor */
+       u64 eid : 8;            /* eid of processor */
+} ia64_sal_ptc_domain_proc_entry_t;
+
+
+#define IA64_SAL_AP_EXTERNAL_INT 0
+
+typedef struct ia64_sal_desc_ap_wakeup {
+       u8 type;
+       u8 mechanism;           /* 0 == external interrupt */
+       u8 reserved1[6];
+       u64 vector;             /* interrupt vector in range 0x10-0xff */
+} ia64_sal_desc_ap_wakeup_t ;
+
+extern ia64_sal_handler ia64_sal;
+extern struct ia64_sal_desc_ptc *ia64_ptc_domain_info;
+
+extern unsigned short sal_revision;    /* supported SAL spec revision */
+extern unsigned short sal_version;     /* SAL version; OEM dependent */
+#define SAL_VERSION_CODE(major, minor) ((BIN2BCD(major) << 8) | BIN2BCD(minor))
+
+extern const char *ia64_sal_strerror (long status);
+extern void ia64_sal_init (struct ia64_sal_systab *sal_systab);
+
+/* SAL information type encodings */
+enum {
+       SAL_INFO_TYPE_MCA  = 0,         /* Machine check abort information */
+        SAL_INFO_TYPE_INIT = 1,                /* Init information */
+        SAL_INFO_TYPE_CMC  = 2,                /* Corrected machine check information */
+        SAL_INFO_TYPE_CPE  = 3         /* Corrected platform error information */
+};
+
+/* Encodings for machine check parameter types */
+enum {
+       SAL_MC_PARAM_RENDEZ_INT    = 1, /* Rendezvous interrupt */
+       SAL_MC_PARAM_RENDEZ_WAKEUP = 2, /* Wakeup */
+       SAL_MC_PARAM_CPE_INT       = 3  /* Corrected Platform Error Int */
+};
+
+/* Encodings for rendezvous mechanisms */
+enum {
+       SAL_MC_PARAM_MECHANISM_INT = 1, /* Use interrupt */
+       SAL_MC_PARAM_MECHANISM_MEM = 2  /* Use memory synchronization variable*/
+};
+
+/* Encodings for vectors which can be registered by the OS with SAL */
+enum {
+       SAL_VECTOR_OS_MCA         = 0,
+       SAL_VECTOR_OS_INIT        = 1,
+       SAL_VECTOR_OS_BOOT_RENDEZ = 2
+};
+
+/* Encodings for mca_opt parameter sent to SAL_MC_SET_PARAMS */
+#define        SAL_MC_PARAM_RZ_ALWAYS          0x1
+#define        SAL_MC_PARAM_BINIT_ESCALATE     0x10
+
+/*
+ * Definition of the SAL Error Log from the SAL spec
+ */
+
+/* SAL Error Record Section GUID Definitions */
+#define SAL_PROC_DEV_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_MEM_DEV_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf2, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_SEL_DEV_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf3, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_PCI_BUS_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf4, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf5, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_PCI_COMP_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf6, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_SPECIFIC_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf7, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf8, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define SAL_PLAT_BUS_ERR_SECT_GUID  \
+    EFI_GUID(0xe429faf9, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
+#define PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID \
+    EFI_GUID(0x6cb0a200, 0x893a, 0x11da, 0x96, 0xd2, 0x0, 0x10, 0x83, 0xff, \
+               0xca, 0x4d)
+
+#define MAX_CACHE_ERRORS       6
+#define MAX_TLB_ERRORS         6
+#define MAX_BUS_ERRORS         1
+
+/* Definition of version  according to SAL spec for logging purposes */
+typedef struct sal_log_revision {
+       u8 minor;               /* BCD (0..99) */
+       u8 major;               /* BCD (0..99) */
+} sal_log_revision_t;
+
+/* Definition of timestamp according to SAL spec for logging purposes */
+typedef struct sal_log_timestamp {
+       u8 slh_second;          /* Second (0..59) */
+       u8 slh_minute;          /* Minute (0..59) */
+       u8 slh_hour;            /* Hour (0..23) */
+       u8 slh_reserved;
+       u8 slh_day;             /* Day (1..31) */
+       u8 slh_month;           /* Month (1..12) */
+       u8 slh_year;            /* Year (00..99) */
+       u8 slh_century;         /* Century (19, 20, 21, ...) */
+} sal_log_timestamp_t;
+
+/* Definition of log record  header structures */
+typedef struct sal_log_record_header {
+       u64 id;                         /* Unique monotonically increasing ID */
+       sal_log_revision_t revision;    /* Major and Minor revision of header */
+       u8 severity;                    /* Error Severity */
+       u8 validation_bits;             /* 0: platform_guid, 1: !timestamp */
+       u32 len;                        /* Length of this error log in bytes */
+       sal_log_timestamp_t timestamp;  /* Timestamp */
+       efi_guid_t platform_guid;       /* Unique OEM Platform ID */
+} sal_log_record_header_t;
+
+#define sal_log_severity_recoverable   0
+#define sal_log_severity_fatal         1
+#define sal_log_severity_corrected     2
+
+/* Definition of log section header structures */
+typedef struct sal_log_sec_header {
+    efi_guid_t guid;                   /* Unique Section ID */
+    sal_log_revision_t revision;       /* Major and Minor revision of Section */
+    u16 reserved;
+    u32 len;                           /* Section length */
+} sal_log_section_hdr_t;
+
+typedef struct sal_log_mod_error_info {
+       struct {
+               u64 check_info              : 1,
+                   requestor_identifier    : 1,
+                   responder_identifier    : 1,
+                   target_identifier       : 1,
+                   precise_ip              : 1,
+                   reserved                : 59;
+       } valid;
+       u64 check_info;
+       u64 requestor_identifier;
+       u64 responder_identifier;
+       u64 target_identifier;
+       u64 precise_ip;
+} sal_log_mod_error_info_t;
+
+typedef struct sal_processor_static_info {
+       struct {
+               u64 minstate        : 1,
+                   br              : 1,
+                   cr              : 1,
+                   ar              : 1,
+                   rr              : 1,
+                   fr              : 1,
+                   reserved        : 58;
+       } valid;
+       pal_min_state_area_t min_state_area;
+       u64 br[8];
+       u64 cr[128];
+       u64 ar[128];
+       u64 rr[8];
+       struct ia64_fpreg __attribute__ ((packed)) fr[128];
+} sal_processor_static_info_t;
+
+struct sal_cpuid_info {
+       u64 regs[5];
+       u64 reserved;
+};
+
+typedef struct sal_log_processor_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 proc_error_map      : 1,
+                   proc_state_param    : 1,
+                   proc_cr_lid         : 1,
+                   psi_static_struct   : 1,
+                   num_cache_check     : 4,
+                   num_tlb_check       : 4,
+                   num_bus_check       : 4,
+                   num_reg_file_check  : 4,
+                   num_ms_check        : 4,
+                   cpuid_info          : 1,
+                   reserved1           : 39;
+       } valid;
+       u64 proc_error_map;
+       u64 proc_state_parameter;
+       u64 proc_cr_lid;
+       /*
+        * The rest of this structure consists of variable-length arrays, which can't be
+        * expressed in C.
+        */
+       sal_log_mod_error_info_t info[0];
+       /*
+        * This is what the rest looked like if C supported variable-length arrays:
+        *
+        * sal_log_mod_error_info_t cache_check_info[.valid.num_cache_check];
+        * sal_log_mod_error_info_t tlb_check_info[.valid.num_tlb_check];
+        * sal_log_mod_error_info_t bus_check_info[.valid.num_bus_check];
+        * sal_log_mod_error_info_t reg_file_check_info[.valid.num_reg_file_check];
+        * sal_log_mod_error_info_t ms_check_info[.valid.num_ms_check];
+        * struct sal_cpuid_info cpuid_info;
+        * sal_processor_static_info_t processor_static_info;
+        */
+} sal_log_processor_info_t;
+
+/* Given a sal_log_processor_info_t pointer, return a pointer to the processor_static_info: */
+#define SAL_LPI_PSI_INFO(l)                                                                    \
+({     sal_log_processor_info_t *_l = (l);                                                     \
+       ((sal_processor_static_info_t *)                                                        \
+        ((char *) _l->info + ((_l->valid.num_cache_check + _l->valid.num_tlb_check             \
+                               + _l->valid.num_bus_check + _l->valid.num_reg_file_check        \
+                               + _l->valid.num_ms_check) * sizeof(sal_log_mod_error_info_t)    \
+                              + sizeof(struct sal_cpuid_info))));                              \
+})
+
+/* platform error log structures */
+
+typedef struct sal_log_mem_dev_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 error_status    : 1,
+                   physical_addr   : 1,
+                   addr_mask       : 1,
+                   node            : 1,
+                   card            : 1,
+                   module          : 1,
+                   bank            : 1,
+                   device          : 1,
+                   row             : 1,
+                   column          : 1,
+                   bit_position    : 1,
+                   requestor_id    : 1,
+                   responder_id    : 1,
+                   target_id       : 1,
+                   bus_spec_data   : 1,
+                   oem_id          : 1,
+                   oem_data        : 1,
+                   reserved        : 47;
+       } valid;
+       u64 error_status;
+       u64 physical_addr;
+       u64 addr_mask;
+       u16 node;
+       u16 card;
+       u16 module;
+       u16 bank;
+       u16 device;
+       u16 row;
+       u16 column;
+       u16 bit_position;
+       u64 requestor_id;
+       u64 responder_id;
+       u64 target_id;
+       u64 bus_spec_data;
+       u8 oem_id[16];
+       u8 oem_data[1];                 /* Variable length data */
+} sal_log_mem_dev_err_info_t;
+
+typedef struct sal_log_sel_dev_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 record_id       : 1,
+                   record_type     : 1,
+                   generator_id    : 1,
+                   evm_rev         : 1,
+                   sensor_type     : 1,
+                   sensor_num      : 1,
+                   event_dir       : 1,
+                   event_data1     : 1,
+                   event_data2     : 1,
+                   event_data3     : 1,
+                   reserved        : 54;
+       } valid;
+       u16 record_id;
+       u8 record_type;
+       u8 timestamp[4];
+       u16 generator_id;
+       u8 evm_rev;
+       u8 sensor_type;
+       u8 sensor_num;
+       u8 event_dir;
+       u8 event_data1;
+       u8 event_data2;
+       u8 event_data3;
+} sal_log_sel_dev_err_info_t;
+
+typedef struct sal_log_pci_bus_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 err_status      : 1,
+                   err_type        : 1,
+                   bus_id          : 1,
+                   bus_address     : 1,
+                   bus_data        : 1,
+                   bus_cmd         : 1,
+                   requestor_id    : 1,
+                   responder_id    : 1,
+                   target_id       : 1,
+                   oem_data        : 1,
+                   reserved        : 54;
+       } valid;
+       u64 err_status;
+       u16 err_type;
+       u16 bus_id;
+       u32 reserved;
+       u64 bus_address;
+       u64 bus_data;
+       u64 bus_cmd;
+       u64 requestor_id;
+       u64 responder_id;
+       u64 target_id;
+       u8 oem_data[1];                 /* Variable length data */
+} sal_log_pci_bus_err_info_t;
+
+typedef struct sal_log_smbios_dev_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 event_type      : 1,
+                   length          : 1,
+                   time_stamp      : 1,
+                   data            : 1,
+                   reserved1       : 60;
+       } valid;
+       u8 event_type;
+       u8 length;
+       u8 time_stamp[6];
+       u8 data[1];                     /* data of variable length, length == slsmb_length */
+} sal_log_smbios_dev_err_info_t;
+
+typedef struct sal_log_pci_comp_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 err_status      : 1,
+                   comp_info       : 1,
+                   num_mem_regs    : 1,
+                   num_io_regs     : 1,
+                   reg_data_pairs  : 1,
+                   oem_data        : 1,
+                   reserved        : 58;
+       } valid;
+       u64 err_status;
+       struct {
+               u16 vendor_id;
+               u16 device_id;
+               u8 class_code[3];
+               u8 func_num;
+               u8 dev_num;
+               u8 bus_num;
+               u8 seg_num;
+               u8 reserved[5];
+       } comp_info;
+       u32 num_mem_regs;
+       u32 num_io_regs;
+       u64 reg_data_pairs[1];
+       /*
+        * array of address/data register pairs is num_mem_regs + num_io_regs elements
+        * long.  Each array element consists of a u64 address followed by a u64 data
+        * value.  The oem_data array immediately follows the reg_data_pairs array
+        */
+       u8 oem_data[1];                 /* Variable length data */
+} sal_log_pci_comp_err_info_t;
+
+typedef struct sal_log_plat_specific_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 err_status      : 1,
+                   guid            : 1,
+                   oem_data        : 1,
+                   reserved        : 61;
+       } valid;
+       u64 err_status;
+       efi_guid_t guid;
+       u8 oem_data[1];                 /* platform specific variable length data */
+} sal_log_plat_specific_err_info_t;
+
+typedef struct sal_log_host_ctlr_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 err_status      : 1,
+                   requestor_id    : 1,
+                   responder_id    : 1,
+                   target_id       : 1,
+                   bus_spec_data   : 1,
+                   oem_data        : 1,
+                   reserved        : 58;
+       } valid;
+       u64 err_status;
+       u64 requestor_id;
+       u64 responder_id;
+       u64 target_id;
+       u64 bus_spec_data;
+       u8 oem_data[1];                 /* Variable length OEM data */
+} sal_log_host_ctlr_err_info_t;
+
+typedef struct sal_log_plat_bus_err_info {
+       sal_log_section_hdr_t header;
+       struct {
+               u64 err_status      : 1,
+                   requestor_id    : 1,
+                   responder_id    : 1,
+                   target_id       : 1,
+                   bus_spec_data   : 1,
+                   oem_data        : 1,
+                   reserved        : 58;
+       } valid;
+       u64 err_status;
+       u64 requestor_id;
+       u64 responder_id;
+       u64 target_id;
+       u64 bus_spec_data;
+       u8 oem_data[1];                 /* Variable length OEM data */
+} sal_log_plat_bus_err_info_t;
+
+/* Overall platform error section structure */
+typedef union sal_log_platform_err_info {
+       sal_log_mem_dev_err_info_t mem_dev_err;
+       sal_log_sel_dev_err_info_t sel_dev_err;
+       sal_log_pci_bus_err_info_t pci_bus_err;
+       sal_log_smbios_dev_err_info_t smbios_dev_err;
+       sal_log_pci_comp_err_info_t pci_comp_err;
+       sal_log_plat_specific_err_info_t plat_specific_err;
+       sal_log_host_ctlr_err_info_t host_ctlr_err;
+       sal_log_plat_bus_err_info_t plat_bus_err;
+} sal_log_platform_err_info_t;
+
+/* SAL log over-all, multi-section error record structure (processor+platform) */
+typedef struct err_rec {
+       sal_log_record_header_t sal_elog_header;
+       sal_log_processor_info_t proc_err;
+       sal_log_platform_err_info_t plat_err;
+       u8 oem_data_pad[1024];
+} ia64_err_rec_t;
+
+/*
+ * Now define a couple of inline functions for improved type checking
+ * and convenience.
+ */
+
+extern s64 ia64_sal_cache_flush (u64 cache_type);
+extern void __init check_sal_cache_flush (void);
+
+/* Initialize all the processor and platform level instruction and data caches */
+static inline s64
+ia64_sal_cache_init (void)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_CACHE_INIT, 0, 0, 0, 0, 0, 0, 0);
+       return isrv.status;
+}
+
+/*
+ * Clear the processor and platform information logged by SAL with respect to the machine
+ * state at the time of MCA's, INITs, CMCs, or CPEs.
+ */
+static inline s64
+ia64_sal_clear_state_info (u64 sal_info_type)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_REENTRANT(isrv, SAL_CLEAR_STATE_INFO, sal_info_type, 0,
+                     0, 0, 0, 0, 0);
+       return isrv.status;
+}
+
+
+/* Get the processor and platform information logged by SAL with respect to the machine
+ * state at the time of the MCAs, INITs, CMCs, or CPEs.
+ */
+static inline u64
+ia64_sal_get_state_info (u64 sal_info_type, u64 *sal_info)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_REENTRANT(isrv, SAL_GET_STATE_INFO, sal_info_type, 0,
+                     sal_info, 0, 0, 0, 0);
+       if (isrv.status)
+               return 0;
+
+       return isrv.v0;
+}
+
+/*
+ * Get the maximum size of the information logged by SAL with respect to the machine state
+ * at the time of MCAs, INITs, CMCs, or CPEs.
+ */
+static inline u64
+ia64_sal_get_state_info_size (u64 sal_info_type)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_REENTRANT(isrv, SAL_GET_STATE_INFO_SIZE, sal_info_type, 0,
+                     0, 0, 0, 0, 0);
+       if (isrv.status)
+               return 0;
+       return isrv.v0;
+}
+
+/*
+ * Causes the processor to go into a spin loop within SAL where SAL awaits a wakeup from
+ * the monarch processor.  Must not lock, because it will not return on any cpu until the
+ * monarch processor sends a wake up.
+ */
+static inline s64
+ia64_sal_mc_rendez (void)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_NOLOCK(isrv, SAL_MC_RENDEZ, 0, 0, 0, 0, 0, 0, 0);
+       return isrv.status;
+}
+
+/*
+ * Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during
+ * the machine check rendezvous sequence as well as the mechanism to wake up the
+ * non-monarch processor at the end of machine check processing.
+ * Returns the complete ia64_sal_retval because some calls return more than just a status
+ * value.
+ */
+static inline struct ia64_sal_retval
+ia64_sal_mc_set_params (u64 param_type, u64 i_or_m, u64 i_or_m_val, u64 timeout, u64 rz_always)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_MC_SET_PARAMS, param_type, i_or_m, i_or_m_val,
+                timeout, rz_always, 0, 0);
+       return isrv;
+}
+
+/* Read from PCI configuration space */
+static inline s64
+ia64_sal_pci_config_read (u64 pci_config_addr, int type, u64 size, u64 *value)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_PCI_CONFIG_READ, pci_config_addr, size, type, 0, 0, 0, 0);
+       if (value)
+               *value = isrv.v0;
+       return isrv.status;
+}
+
+/* Write to PCI configuration space */
+static inline s64
+ia64_sal_pci_config_write (u64 pci_config_addr, int type, u64 size, u64 value)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_PCI_CONFIG_WRITE, pci_config_addr, size, value,
+                type, 0, 0, 0);
+       return isrv.status;
+}
+
+/*
+ * Register physical addresses of locations needed by SAL when SAL procedures are invoked
+ * in virtual mode.
+ */
+static inline s64
+ia64_sal_register_physical_addr (u64 phys_entry, u64 phys_addr)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_REGISTER_PHYSICAL_ADDR, phys_entry, phys_addr,
+                0, 0, 0, 0, 0);
+       return isrv.status;
+}
+
+/*
+ * Register software dependent code locations within SAL. These locations are handlers or
+ * entry points where SAL will pass control for the specified event. These event handlers
+ * are for the bott rendezvous, MCAs and INIT scenarios.
+ */
+static inline s64
+ia64_sal_set_vectors (u64 vector_type,
+                     u64 handler_addr1, u64 gp1, u64 handler_len1,
+                     u64 handler_addr2, u64 gp2, u64 handler_len2)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_SET_VECTORS, vector_type,
+                       handler_addr1, gp1, handler_len1,
+                       handler_addr2, gp2, handler_len2);
+
+       return isrv.status;
+}
+
+/* Update the contents of PAL block in the non-volatile storage device */
+static inline s64
+ia64_sal_update_pal (u64 param_buf, u64 scratch_buf, u64 scratch_buf_size,
+                    u64 *error_code, u64 *scratch_buf_size_needed)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL(isrv, SAL_UPDATE_PAL, param_buf, scratch_buf, scratch_buf_size,
+                0, 0, 0, 0);
+       if (error_code)
+               *error_code = isrv.v0;
+       if (scratch_buf_size_needed)
+               *scratch_buf_size_needed = isrv.v1;
+       return isrv.status;
+}
+
+/* Get physical processor die mapping in the platform. */
+static inline s64
+ia64_sal_physical_id_info(u16 *splid)
+{
+       struct ia64_sal_retval isrv;
+
+       if (sal_revision < SAL_VERSION_CODE(3,2))
+               return -1;
+
+       SAL_CALL(isrv, SAL_PHYSICAL_ID_INFO, 0, 0, 0, 0, 0, 0, 0);
+       if (splid)
+               *splid = isrv.v0;
+       return isrv.status;
+}
+
+extern unsigned long sal_platform_features;
+
+extern int (*salinfo_platform_oemdata)(const u8 *, u8 **, u64 *);
+
+struct sal_ret_values {
+       long r8; long r9; long r10; long r11;
+};
+
+#define IA64_SAL_OEMFUNC_MIN           0x02000000
+#define IA64_SAL_OEMFUNC_MAX           0x03ffffff
+
+extern int ia64_sal_oemcall(struct ia64_sal_retval *, u64, u64, u64, u64, u64,
+                           u64, u64, u64);
+extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
+                                  u64, u64, u64, u64, u64);
+extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
+                                     u64, u64, u64, u64, u64);
+extern long
+ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
+                   unsigned long *drift_info);
+#ifdef CONFIG_HOTPLUG_CPU
+/*
+ * System Abstraction Layer Specification
+ * Section 3.2.5.1: OS_BOOT_RENDEZ to SAL return State.
+ * Note: region regs are stored first in head.S _start. Hence they must
+ * stay up front.
+ */
+struct sal_to_os_boot {
+       u64 rr[8];              /* Region Registers */
+       u64 br[6];              /* br0:
+                                * return addr into SAL boot rendez routine */
+       u64 gr1;                /* SAL:GP */
+       u64 gr12;               /* SAL:SP */
+       u64 gr13;               /* SAL: Task Pointer */
+       u64 fpsr;
+       u64 pfs;
+       u64 rnat;
+       u64 unat;
+       u64 bspstore;
+       u64 dcr;                /* Default Control Register */
+       u64 iva;
+       u64 pta;
+       u64 itv;
+       u64 pmv;
+       u64 cmcv;
+       u64 lrr[2];
+       u64 gr[4];
+       u64 pr;                 /* Predicate registers */
+       u64 lc;                 /* Loop Count */
+       struct ia64_fpreg fp[20];
+};
+
+/*
+ * Global array allocated for NR_CPUS at boot time
+ */
+extern struct sal_to_os_boot sal_boot_rendez_state[NR_CPUS];
+
+extern void ia64_jump_to_sal(struct sal_to_os_boot *);
+#endif
+
+extern void ia64_sal_handler_init(void *entry_point, void *gpval);
+
+#define PALO_MAX_TLB_PURGES    0xFFFF
+#define PALO_SIG       "PALO"
+
+struct palo_table {
+       u8  signature[4];       /* Should be "PALO" */
+       u32 length;
+       u8  minor_revision;
+       u8  major_revision;
+       u8  checksum;
+       u8  reserved1[5];
+       u16 max_tlb_purges;
+       u8  reserved2[6];
+};
+
+#define NPTCG_FROM_PAL                 0
+#define NPTCG_FROM_PALO                        1
+#define NPTCG_FROM_KERNEL_PARAMETER    2
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_IA64_SAL_H */
diff --git a/arch/ia64/include/asm/scatterlist.h b/arch/ia64/include/asm/scatterlist.h
new file mode 100644 (file)
index 0000000..d6f5787
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef _ASM_IA64_SCATTERLIST_H
+#define _ASM_IA64_SCATTERLIST_H
+
+/*
+ * Modified 1998-1999, 2001-2002, 2004
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#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;    /* buffer length */
+
+       dma_addr_t dma_address;
+       unsigned int dma_length;
+};
+
+/*
+ * It used to be that ISA_DMA_THRESHOLD had something to do with the
+ * DMA-limits of ISA-devices.  Nowadays, its only remaining use (apart
+ * from the aha1542.c driver, which isn't 64-bit clean anyhow) is to
+ * tell the block-layer (via BLK_BOUNCE_ISA) what the max. physical
+ * address of a page is that is allocated with GFP_DMA.  On IA-64,
+ * that's 4GB - 1.
+ */
+#define ISA_DMA_THRESHOLD      0xffffffff
+
+#define sg_dma_len(sg)         ((sg)->dma_length)
+#define sg_dma_address(sg)     ((sg)->dma_address)
+
+#define        ARCH_HAS_SG_CHAIN
+
+#endif /* _ASM_IA64_SCATTERLIST_H */
diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h
new file mode 100644 (file)
index 0000000..7286e4a
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _ASM_IA64_SECTIONS_H
+#define _ASM_IA64_SECTIONS_H
+
+/*
+ * Copyright (C) 1998-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <asm-generic/sections.h>
+
+extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[];
+extern char __start___vtop_patchlist[], __end___vtop_patchlist[];
+extern char __start___rse_patchlist[], __end___rse_patchlist[];
+extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[];
+extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[];
+extern char __start_gate_section[];
+extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[];
+extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
+extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
+extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
+extern char __start_unwind[], __end_unwind[];
+extern char __start_ivt_text[], __end_ivt_text[];
+
+#endif /* _ASM_IA64_SECTIONS_H */
+
diff --git a/arch/ia64/include/asm/segment.h b/arch/ia64/include/asm/segment.h
new file mode 100644 (file)
index 0000000..b89e2b3
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_IA64_SEGMENT_H
+#define _ASM_IA64_SEGMENT_H
+
+/* Only here because we have some old header files that expect it.. */
+
+#endif /* _ASM_IA64_SEGMENT_H */
diff --git a/arch/ia64/include/asm/sembuf.h b/arch/ia64/include/asm/sembuf.h
new file mode 100644 (file)
index 0000000..1340fbc
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _ASM_IA64_SEMBUF_H
+#define _ASM_IA64_SEMBUF_H
+
+/*
+ * The semid64_ds structure for IA-64 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 /* _ASM_IA64_SEMBUF_H */
diff --git a/arch/ia64/include/asm/serial.h b/arch/ia64/include/asm/serial.h
new file mode 100644 (file)
index 0000000..068be11
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Derived from the i386 version.
+ */
+
+/*
+ * 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 )
+
+/*
+ * All legacy serial ports should be enumerated via ACPI namespace, so
+ * we need not list them here.
+ */
diff --git a/arch/ia64/include/asm/setup.h b/arch/ia64/include/asm/setup.h
new file mode 100644 (file)
index 0000000..4399a44
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __IA64_SETUP_H
+#define __IA64_SETUP_H
+
+#define COMMAND_LINE_SIZE      2048
+
+#endif
diff --git a/arch/ia64/include/asm/shmbuf.h b/arch/ia64/include/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..585002a
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef _ASM_IA64_SHMBUF_H
+#define _ASM_IA64_SHMBUF_H
+
+/*
+ * The shmid64_ds structure for IA-64 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 /* _ASM_IA64_SHMBUF_H */
diff --git a/arch/ia64/include/asm/shmparam.h b/arch/ia64/include/asm/shmparam.h
new file mode 100644 (file)
index 0000000..d07508d
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ASM_IA64_SHMPARAM_H
+#define _ASM_IA64_SHMPARAM_H
+
+/*
+ * SHMLBA controls minimum alignment at which shared memory segments
+ * get attached.  The IA-64 architecture says that there may be a
+ * performance degradation when there are virtual aliases within 1MB.
+ * To reduce the chance of this, we set SHMLBA to 1MB. --davidm 00/12/20
+ */
+#define        SHMLBA  (1024*1024)
+
+#endif /* _ASM_IA64_SHMPARAM_H */
diff --git a/arch/ia64/include/asm/sigcontext.h b/arch/ia64/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..57ff777
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef _ASM_IA64_SIGCONTEXT_H
+#define _ASM_IA64_SIGCONTEXT_H
+
+/*
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <asm/fpu.h>
+
+#define IA64_SC_FLAG_ONSTACK_BIT               0       /* is handler running on signal stack? */
+#define IA64_SC_FLAG_IN_SYSCALL_BIT            1       /* did signal interrupt a syscall? */
+#define IA64_SC_FLAG_FPH_VALID_BIT             2       /* is state in f[32]-f[127] valid? */
+
+#define IA64_SC_FLAG_ONSTACK           (1 << IA64_SC_FLAG_ONSTACK_BIT)
+#define IA64_SC_FLAG_IN_SYSCALL                (1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
+#define IA64_SC_FLAG_FPH_VALID         (1 << IA64_SC_FLAG_FPH_VALID_BIT)
+
+# ifndef __ASSEMBLY__
+
+/*
+ * Note on handling of register backing store: sc_ar_bsp contains the address that would
+ * be found in ar.bsp after executing a "cover" instruction the context in which the
+ * signal was raised.  If signal delivery required switching to an alternate signal stack
+ * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
+ * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
+ * original one.  In this case, sc_rbs_base contains the base address of the new register
+ * backing store.  The number of registers in the dirty partition can be calculated as:
+ *
+ *   ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
+ *
+ */
+
+struct sigcontext {
+       unsigned long           sc_flags;       /* see manifest constants above */
+       unsigned long           sc_nat;         /* bit i == 1 iff scratch reg gr[i] is a NaT */
+       stack_t                 sc_stack;       /* previously active stack */
+
+       unsigned long           sc_ip;          /* instruction pointer */
+       unsigned long           sc_cfm;         /* current frame marker */
+       unsigned long           sc_um;          /* user mask bits */
+       unsigned long           sc_ar_rsc;      /* register stack configuration register */
+       unsigned long           sc_ar_bsp;      /* backing store pointer */
+       unsigned long           sc_ar_rnat;     /* RSE NaT collection register */
+       unsigned long           sc_ar_ccv;      /* compare and exchange compare value register */
+       unsigned long           sc_ar_unat;     /* ar.unat of interrupted context */
+       unsigned long           sc_ar_fpsr;     /* floating-point status register */
+       unsigned long           sc_ar_pfs;      /* previous function state */
+       unsigned long           sc_ar_lc;       /* loop count register */
+       unsigned long           sc_pr;          /* predicate registers */
+       unsigned long           sc_br[8];       /* branch registers */
+       /* Note: sc_gr[0] is used as the "uc_link" member of ucontext_t */
+       unsigned long           sc_gr[32];      /* general registers (static partition) */
+       struct ia64_fpreg       sc_fr[128];     /* floating-point registers */
+
+       unsigned long           sc_rbs_base;    /* NULL or new base of sighandler's rbs */
+       unsigned long           sc_loadrs;      /* see description above */
+
+       unsigned long           sc_ar25;        /* cmp8xchg16 uses this */
+       unsigned long           sc_ar26;        /* rsvd for scratch use */
+       unsigned long           sc_rsvd[12];    /* reserved for future use */
+       /*
+        * The mask must come last so we can increase _NSIG_WORDS
+        * without breaking binary compatibility.
+        */
+       sigset_t                sc_mask;        /* signal mask to restore after handler returns */
+};
+
+# endif /* __ASSEMBLY__ */
+#endif /* _ASM_IA64_SIGCONTEXT_H */
diff --git a/arch/ia64/include/asm/siginfo.h b/arch/ia64/include/asm/siginfo.h
new file mode 100644 (file)
index 0000000..9294e4b
--- /dev/null
@@ -0,0 +1,139 @@
+#ifndef _ASM_IA64_SIGINFO_H
+#define _ASM_IA64_SIGINFO_H
+
+/*
+ * Based on <asm-i386/siginfo.h>.
+ *
+ * Modified 1998-2002
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
+
+#define HAVE_ARCH_SIGINFO_T
+#define HAVE_ARCH_COPY_SIGINFO
+#define HAVE_ARCH_COPY_SIGINFO_TO_USER
+
+#include <asm-generic/siginfo.h>
+
+typedef struct siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+       int __pad0;
+
+       union {
+               int _pad[SI_PAD_SIZE];
+
+               /* kill() */
+               struct {
+                       pid_t _pid;             /* sender's pid */
+                       uid_t _uid;             /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       timer_t _tid;           /* timer id */
+                       int _overrun;           /* overrun count */
+                       char _pad[sizeof(__ARCH_SI_UID_T) - sizeof(int)];
+                       sigval_t _sigval;       /* must overlay ._rt._sigval! */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       pid_t _pid;             /* sender's pid */
+                       uid_t _uid;             /* sender's uid */
+                       sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       pid_t _pid;             /* which child */
+                       uid_t _uid;             /* sender's uid */
+                       int _status;            /* exit code */
+                       clock_t _utime;
+                       clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       void __user *_addr;     /* faulting insn/memory ref. */
+                       int _imm;               /* immediate value for "break" */
+                       unsigned int _flags;    /* see below */
+                       unsigned long _isr;     /* isr */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       long _band;     /* POLL_IN, POLL_OUT, POLL_MSG (XPG requires a "long") */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} siginfo_t;
+
+#define si_imm         _sifields._sigfault._imm        /* as per UNIX SysV ABI spec */
+#define si_flags       _sifields._sigfault._flags
+/*
+ * si_isr is valid for SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP provided that
+ * si_code is non-zero and __ISR_VALID is set in si_flags.
+ */
+#define si_isr         _sifields._sigfault._isr
+
+/*
+ * Flag values for si_flags:
+ */
+#define __ISR_VALID_BIT        0
+#define __ISR_VALID    (1 << __ISR_VALID_BIT)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_BADIADDR   (__SI_FAULT|9)  /* unimplemented instruction address */
+#define __ILL_BREAK    (__SI_FAULT|10) /* illegal break */
+#define __ILL_BNDMOD   (__SI_FAULT|11) /* bundle-update (modification) in progress */
+#undef NSIGILL
+#define NSIGILL                11
+
+/*
+ * SIGFPE si_codes
+ */
+#define __FPE_DECOVF   (__SI_FAULT|9)  /* decimal overflow */
+#define __FPE_DECDIV   (__SI_FAULT|10) /* decimal division by zero */
+#define __FPE_DECERR   (__SI_FAULT|11) /* packed decimal error */
+#define __FPE_INVASC   (__SI_FAULT|12) /* invalid ASCII digit */
+#define __FPE_INVDEC   (__SI_FAULT|13) /* invalid decimal digit */
+#undef NSIGFPE
+#define NSIGFPE                13
+
+/*
+ * SIGSEGV si_codes
+ */
+#define __SEGV_PSTKOVF (__SI_FAULT|3)  /* paragraph stack overflow */
+#undef NSIGSEGV
+#define NSIGSEGV       3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRANCH    (__SI_FAULT|3)  /* process taken branch trap */
+#define TRAP_HWBKPT    (__SI_FAULT|4)  /* hardware breakpoint or watchpoint */
+#undef NSIGTRAP
+#define NSIGTRAP       4
+
+#ifdef __KERNEL__
+#include <linux/string.h>
+
+static inline void
+copy_siginfo (siginfo_t *to, siginfo_t *from)
+{
+       if (from->si_code < 0)
+               memcpy(to, from, sizeof(siginfo_t));
+       else
+               /* _sigchld is currently the largest know union member */
+               memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigchld));
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_SIGINFO_H */
diff --git a/arch/ia64/include/asm/signal.h b/arch/ia64/include/asm/signal.h
new file mode 100644 (file)
index 0000000..4f5ca56
--- /dev/null
@@ -0,0 +1,160 @@
+#ifndef _ASM_IA64_SIGNAL_H
+#define _ASM_IA64_SIGNAL_H
+
+/*
+ * Modified 1998-2001, 2003
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ *
+ * Unfortunately, this file is being included by bits/signal.h in
+ * glibc-2.x.  Hence the #ifdef __KERNEL__ ugliness.
+ */
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGBUS          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGUSR1                10
+#define SIGSEGV                11
+#define SIGUSR2                12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGSTKFLT      16
+#define SIGCHLD                17
+#define SIGCONT                18
+#define SIGSTOP                19
+#define SIGTSTP                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGURG         23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGIO          29
+#define SIGPOLL                SIGIO
+/*
+#define SIGLOST                29
+*/
+#define SIGPWR         30
+#define SIGSYS         31
+/* signal 31 is no longer "unused", but the SIGUNUSED macro remains for backwards compatibility */
+#define        SIGUNUSED       31
+
+/* 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_NOCLDSTOP   0x00000001
+#define SA_NOCLDWAIT   0x00000002
+#define SA_SIGINFO     0x00000004
+#define SA_ONSTACK     0x08000000
+#define SA_RESTART     0x10000000
+#define SA_NODEFER     0x40000000
+#define SA_RESETHAND   0x80000000
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+#define SA_RESTORER    0x04000000
+
+/*
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+/*
+ * The minimum stack size needs to be fairly large because we want to
+ * be sure that an app compiled for today's CPUs will continue to run
+ * on all future CPU models.  The CPU model matters because the signal
+ * frame needs to have space for the complete machine state, including
+ * all physical stacked registers.  The number of physical stacked
+ * registers is CPU model dependent, but given that the width of
+ * ar.rsc.loadrs is 14 bits, we can assume that they'll never take up
+ * more than 16KB of space.
+ */
+#if 1
+  /*
+   * This is a stupid typo: the value was _meant_ to be 131072 (0x20000), but I typed it
+   * in wrong. ;-(  To preserve backwards compatibility, we leave the kernel at the
+   * incorrect value and fix libc only.
+   */
+# define MINSIGSTKSZ   131027  /* min. stack size for sigaltstack() */
+#else
+# define MINSIGSTKSZ   131072  /* min. stack size for sigaltstack() */
+#endif
+#define SIGSTKSZ       262144  /* default stack size for sigaltstack() */
+
+#ifdef __KERNEL__
+
+#define _NSIG          64
+#define _NSIG_BPW      64
+#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
+
+#endif /* __KERNEL__ */
+
+#include <asm-generic/signal.h>
+
+# ifndef __ASSEMBLY__
+
+#  include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+
+typedef struct sigaltstack {
+       void __user *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+#ifdef __KERNEL__
+
+/* Most things should be clean enough to redefine this at will, if care
+   is taken to make libc match.  */
+
+typedef unsigned long old_sigset_t;
+
+typedef struct {
+       unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+struct sigaction {
+       __sighandler_t sa_handler;
+       unsigned long sa_flags;
+       sigset_t sa_mask;               /* mask last for extensibility */
+};
+
+struct k_sigaction {
+       struct sigaction sa;
+};
+
+#  include <asm/sigcontext.h>
+
+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
+
+#endif /* __KERNEL__ */
+
+# endif /* !__ASSEMBLY__ */
+#endif /* _ASM_IA64_SIGNAL_H */
diff --git a/arch/ia64/include/asm/smp.h b/arch/ia64/include/asm/smp.h
new file mode 100644 (file)
index 0000000..12d96e0
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * SMP Support
+ *
+ * Copyright (C) 1999 VA Linux Systems
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P.
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *     Bjorn Helgaas <bjorn.helgaas@hp.com>
+ */
+#ifndef _ASM_IA64_SMP_H
+#define _ASM_IA64_SMP_H
+
+#include <linux/init.h>
+#include <linux/threads.h>
+#include <linux/kernel.h>
+#include <linux/cpumask.h>
+#include <linux/bitops.h>
+#include <linux/irqreturn.h>
+
+#include <asm/io.h>
+#include <asm/param.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+
+static inline unsigned int
+ia64_get_lid (void)
+{
+       union {
+               struct {
+                       unsigned long reserved : 16;
+                       unsigned long eid : 8;
+                       unsigned long id : 8;
+                       unsigned long ignored : 32;
+               } f;
+               unsigned long bits;
+       } lid;
+
+       lid.bits = ia64_getreg(_IA64_REG_CR_LID);
+       return lid.f.id << 8 | lid.f.eid;
+}
+
+#define hard_smp_processor_id()                ia64_get_lid()
+
+#ifdef CONFIG_SMP
+
+#define XTP_OFFSET             0x1e0008
+
+#define SMP_IRQ_REDIRECTION    (1 << 0)
+#define SMP_IPI_REDIRECTION    (1 << 1)
+
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+
+extern struct smp_boot_data {
+       int cpu_count;
+       int cpu_phys_id[NR_CPUS];
+} smp_boot_data __initdata;
+
+extern char no_int_routing __devinitdata;
+
+extern cpumask_t cpu_online_map;
+extern cpumask_t cpu_core_map[NR_CPUS];
+DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
+extern int smp_num_siblings;
+extern void __iomem *ipi_base_addr;
+extern unsigned char smp_int_redirect;
+
+extern volatile int ia64_cpu_to_sapicid[];
+#define cpu_physical_id(i)     ia64_cpu_to_sapicid[i]
+
+extern unsigned long ap_wakeup_vector;
+
+/*
+ * Function to map hard smp processor id to logical id.  Slow, so don't use this in
+ * performance-critical code.
+ */
+static inline int
+cpu_logical_id (int cpuid)
+{
+       int i;
+
+       for (i = 0; i < NR_CPUS; ++i)
+               if (cpu_physical_id(i) == cpuid)
+                       break;
+       return i;
+}
+
+/*
+ * XTP control functions:
+ *     min_xtp   : route all interrupts to this CPU
+ *     normal_xtp: nominal XTP value
+ *     max_xtp   : never deliver interrupts to this CPU.
+ */
+
+static inline void
+min_xtp (void)
+{
+       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+               writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
+}
+
+static inline void
+normal_xtp (void)
+{
+       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+               writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
+}
+
+static inline void
+max_xtp (void)
+{
+       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+               writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
+}
+
+/* Upping and downing of CPUs */
+extern int __cpu_disable (void);
+extern void __cpu_die (unsigned int cpu);
+extern void cpu_die (void) __attribute__ ((noreturn));
+extern void __init smp_build_cpu_map(void);
+
+extern void __init init_smp_config (void);
+extern void smp_do_timer (struct pt_regs *regs);
+
+extern irqreturn_t handle_IPI(int irq, void *dev_id);
+extern void smp_send_reschedule (int cpu);
+extern void identify_siblings (struct cpuinfo_ia64 *);
+extern int is_multithreading_enabled(void);
+
+extern void arch_send_call_function_single_ipi(int cpu);
+extern void arch_send_call_function_ipi(cpumask_t mask);
+
+#else /* CONFIG_SMP */
+
+#define cpu_logical_id(i)              0
+#define cpu_physical_id(i)             ia64_get_lid()
+
+#endif /* CONFIG_SMP */
+#endif /* _ASM_IA64_SMP_H */
diff --git a/arch/ia64/include/asm/sn/acpi.h b/arch/ia64/include/asm/sn/acpi.h
new file mode 100644 (file)
index 0000000..9ce2801
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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) 2006 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_ACPI_H
+#define _ASM_IA64_SN_ACPI_H
+
+#include "acpi/acglobal.h"
+
+extern int sn_acpi_rev;
+#define SN_ACPI_BASE_SUPPORT()   (sn_acpi_rev >= 0x20101)
+
+#endif /* _ASM_IA64_SN_ACPI_H */
diff --git a/arch/ia64/include/asm/sn/addrs.h b/arch/ia64/include/asm/sn/addrs.h
new file mode 100644 (file)
index 0000000..e715c79
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * 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) 1992-1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_ADDRS_H
+#define _ASM_IA64_SN_ADDRS_H
+
+#include <asm/percpu.h>
+#include <asm/sn/types.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/pda.h>
+
+/*
+ *  Memory/SHUB Address Format:
+ *  +-+---------+--+--------------+
+ *  |0|  NASID  |AS| NodeOffset   |
+ *  +-+---------+--+--------------+
+ *
+ *  NASID: (low NASID bit is 0) Memory and SHUB MMRs
+ *   AS: 2-bit Address Space Identifier. Used only if low NASID bit is 0
+ *     00: Local Resources and MMR space
+ *           Top bit of NodeOffset
+ *               0: Local resources space
+ *                  node id:
+ *                        0: IA64/NT compatibility space
+ *                        2: Local MMR Space
+ *                        4: Local memory, regardless of local node id
+ *               1: Global MMR space
+ *     01: GET space.
+ *     10: AMO space.
+ *     11: Cacheable memory space.
+ *
+ *   NodeOffset: byte offset
+ *
+ *
+ *  TIO address format:
+ *  +-+----------+--+--------------+
+ *  |0|  NASID   |AS| Nodeoffset   |
+ *  +-+----------+--+--------------+
+ *
+ *  NASID: (low NASID bit is 1) TIO
+ *   AS: 2-bit Chiplet Identifier
+ *     00: TIO LB (Indicates TIO MMR access.)
+ *     01: TIO ICE (indicates coretalk space access.)
+ * 
+ *   NodeOffset: top bit must be set.
+ *
+ *
+ * Note that in both of the above address formats, the low
+ * NASID bit indicates if the reference is to the SHUB or TIO MMRs.
+ */
+
+
+/*
+ * Define basic shift & mask constants for manipulating NASIDs and AS values.
+ */
+#define NASID_BITMASK          (sn_hub_info->nasid_bitmask)
+#define NASID_SHIFT            (sn_hub_info->nasid_shift)
+#define AS_SHIFT               (sn_hub_info->as_shift)
+#define AS_BITMASK             0x3UL
+
+#define NASID_MASK              ((u64)NASID_BITMASK << NASID_SHIFT)
+#define AS_MASK                        ((u64)AS_BITMASK << AS_SHIFT)
+
+
+/*
+ * AS values. These are the same on both SHUB1 & SHUB2.
+ */
+#define AS_GET_VAL             1UL
+#define AS_AMO_VAL             2UL
+#define AS_CAC_VAL             3UL
+#define AS_GET_SPACE           (AS_GET_VAL << AS_SHIFT)
+#define AS_AMO_SPACE           (AS_AMO_VAL << AS_SHIFT)
+#define AS_CAC_SPACE           (AS_CAC_VAL << AS_SHIFT)
+
+
+/* 
+ * Virtual Mode Local & Global MMR space.  
+ */
+#define SH1_LOCAL_MMR_OFFSET   0x8000000000UL
+#define SH2_LOCAL_MMR_OFFSET   0x0200000000UL
+#define LOCAL_MMR_OFFSET       (is_shub2() ? SH2_LOCAL_MMR_OFFSET : SH1_LOCAL_MMR_OFFSET)
+#define LOCAL_MMR_SPACE                (__IA64_UNCACHED_OFFSET | LOCAL_MMR_OFFSET)
+#define LOCAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | LOCAL_MMR_OFFSET)
+
+#define SH1_GLOBAL_MMR_OFFSET  0x0800000000UL
+#define SH2_GLOBAL_MMR_OFFSET  0x0300000000UL
+#define GLOBAL_MMR_OFFSET      (is_shub2() ? SH2_GLOBAL_MMR_OFFSET : SH1_GLOBAL_MMR_OFFSET)
+#define GLOBAL_MMR_SPACE       (__IA64_UNCACHED_OFFSET | GLOBAL_MMR_OFFSET)
+
+/*
+ * Physical mode addresses
+ */
+#define GLOBAL_PHYS_MMR_SPACE  (RGN_BASE(RGN_HPAGE) | GLOBAL_MMR_OFFSET)
+
+
+/*
+ * Clear region & AS bits.
+ */
+#define TO_PHYS_MASK           (~(RGN_BITS | AS_MASK))
+
+
+/*
+ * Misc NASID manipulation.
+ */
+#define NASID_SPACE(n)         ((u64)(n) << NASID_SHIFT)
+#define REMOTE_ADDR(n,a)       (NASID_SPACE(n) | (a))
+#define NODE_OFFSET(x)         ((x) & (NODE_ADDRSPACE_SIZE - 1))
+#define NODE_ADDRSPACE_SIZE     (1UL << AS_SHIFT)
+#define NASID_GET(x)           (int) (((u64) (x) >> NASID_SHIFT) & NASID_BITMASK)
+#define LOCAL_MMR_ADDR(a)      (LOCAL_MMR_SPACE | (a))
+#define GLOBAL_MMR_ADDR(n,a)   (GLOBAL_MMR_SPACE | REMOTE_ADDR(n,a))
+#define GLOBAL_MMR_PHYS_ADDR(n,a) (GLOBAL_PHYS_MMR_SPACE | REMOTE_ADDR(n,a))
+#define GLOBAL_CAC_ADDR(n,a)   (CAC_BASE | REMOTE_ADDR(n,a))
+#define CHANGE_NASID(n,x)      ((void *)(((u64)(x) & ~NASID_MASK) | NASID_SPACE(n)))
+#define IS_TIO_NASID(n)                ((n) & 1)
+
+
+/* non-II mmr's start at top of big window space (4G) */
+#define BWIN_TOP               0x0000000100000000UL
+
+/*
+ * general address defines
+ */
+#define CAC_BASE               (PAGE_OFFSET | AS_CAC_SPACE)
+#define AMO_BASE               (__IA64_UNCACHED_OFFSET | AS_AMO_SPACE)
+#define AMO_PHYS_BASE          (RGN_BASE(RGN_HPAGE) | AS_AMO_SPACE)
+#define GET_BASE               (PAGE_OFFSET | AS_GET_SPACE)
+
+/*
+ * Convert Memory addresses between various addressing modes.
+ */
+#define TO_PHYS(x)             (TO_PHYS_MASK & (x))
+#define TO_CAC(x)              (CAC_BASE     | TO_PHYS(x))
+#ifdef CONFIG_SGI_SN
+#define TO_AMO(x)              (AMO_BASE     | TO_PHYS(x))
+#define TO_GET(x)              (GET_BASE     | TO_PHYS(x))
+#else
+#define TO_AMO(x)              ({ BUG(); x; })
+#define TO_GET(x)              ({ BUG(); x; })
+#endif
+
+/*
+ * Covert from processor physical address to II/TIO physical address:
+ *     II - squeeze out the AS bits
+ *     TIO- requires a chiplet id in bits 38-39.  For DMA to memory,
+ *           the chiplet id is zero.  If we implement TIO-TIO dma, we might need
+ *           to insert a chiplet id into this macro.  However, it is our belief
+ *           right now that this chiplet id will be ICE, which is also zero.
+ */
+#define SH1_TIO_PHYS_TO_DMA(x)                                                 \
+       ((((u64)(NASID_GET(x))) << 40) | NODE_OFFSET(x))
+
+#define SH2_NETWORK_BANK_OFFSET(x)                                     \
+        ((u64)(x) & ((1UL << (sn_hub_info->nasid_shift - 4)) -1))
+
+#define SH2_NETWORK_BANK_SELECT(x)                                     \
+        ((((u64)(x) & (0x3UL << (sn_hub_info->nasid_shift - 4)))       \
+               >> (sn_hub_info->nasid_shift - 4)) << 36)
+
+#define SH2_NETWORK_ADDRESS(x)                                                 \
+       (SH2_NETWORK_BANK_OFFSET(x) | SH2_NETWORK_BANK_SELECT(x))
+
+#define SH2_TIO_PHYS_TO_DMA(x)                                                 \
+        (((u64)(NASID_GET(x)) << 40) |         SH2_NETWORK_ADDRESS(x))
+
+#define PHYS_TO_TIODMA(x)                                              \
+       (is_shub1() ? SH1_TIO_PHYS_TO_DMA(x) : SH2_TIO_PHYS_TO_DMA(x))
+
+#define PHYS_TO_DMA(x)                                                 \
+       ((((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x))
+
+
+/*
+ * Macros to test for address type.
+ */
+#define IS_AMO_ADDRESS(x)      (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_BASE)
+#define IS_AMO_PHYS_ADDRESS(x) (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_PHYS_BASE)
+
+
+/*
+ * The following definitions pertain to the IO special address
+ * space.  They define the location of the big and little windows
+ * of any given node.
+ */
+#define BWIN_SIZE_BITS                 29      /* big window size: 512M */
+#define TIO_BWIN_SIZE_BITS             30      /* big window size: 1G */
+#define NODE_SWIN_BASE(n, w)           ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \
+               : RAW_NODE_SWIN_BASE(n, w))
+#define TIO_SWIN_BASE(n, w)            (TIO_IO_BASE(n) + \
+                                           ((u64) (w) << TIO_SWIN_SIZE_BITS))
+#define NODE_IO_BASE(n)                        (GLOBAL_MMR_SPACE | NASID_SPACE(n))
+#define TIO_IO_BASE(n)                  (__IA64_UNCACHED_OFFSET | NASID_SPACE(n))
+#define BWIN_SIZE                      (1UL << BWIN_SIZE_BITS)
+#define NODE_BWIN_BASE0(n)             (NODE_IO_BASE(n) + BWIN_SIZE)
+#define NODE_BWIN_BASE(n, w)           (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS))
+#define RAW_NODE_SWIN_BASE(n, w)       (NODE_IO_BASE(n) + ((u64) (w) << SWIN_SIZE_BITS))
+#define BWIN_WIDGET_MASK               0x7
+#define BWIN_WINDOWNUM(x)              (((x) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
+#define SH1_IS_BIG_WINDOW_ADDR(x)      ((x) & BWIN_TOP)
+
+#define TIO_BWIN_WINDOW_SELECT_MASK    0x7
+#define TIO_BWIN_WINDOWNUM(x)          (((x) >> TIO_BWIN_SIZE_BITS) & TIO_BWIN_WINDOW_SELECT_MASK)
+
+#define TIO_HWIN_SHIFT_BITS            33
+#define TIO_HWIN(x)                    (NODE_OFFSET(x) >> TIO_HWIN_SHIFT_BITS)
+
+/*
+ * The following definitions pertain to the IO special address
+ * space.  They define the location of the big and little windows
+ * of any given node.
+ */
+
+#define SWIN_SIZE_BITS                 24
+#define        SWIN_WIDGET_MASK                0xF
+
+#define TIO_SWIN_SIZE_BITS             28
+#define TIO_SWIN_SIZE                  (1UL << TIO_SWIN_SIZE_BITS)
+#define TIO_SWIN_WIDGET_MASK           0x3
+
+/*
+ * Convert smallwindow address to xtalk address.
+ *
+ * 'addr' can be physical or virtual address, but will be converted
+ * to Xtalk address in the range 0 -> SWINZ_SIZEMASK
+ */
+#define        SWIN_WIDGETNUM(x)               (((x)  >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK)
+#define TIO_SWIN_WIDGETNUM(x)          (((x)  >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK)
+
+
+/*
+ * The following macros produce the correct base virtual address for
+ * the hub registers. The REMOTE_HUB_* macro produce
+ * the address for the specified hub's registers.  The intent is
+ * that the appropriate PI, MD, NI, or II register would be substituted
+ * for x.
+ *
+ *   WARNING:
+ *     When certain Hub chip workaround are defined, it's not sufficient
+ *     to dereference the *_HUB_ADDR() macros.  You should instead use
+ *     HUB_L() and HUB_S() if you must deal with pointers to hub registers.
+ *     Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S().
+ *     They're always safe.
+ */
+/* Shub1 TIO & MMR addressing macros */
+#define SH1_TIO_IOSPACE_ADDR(n,x)                                      \
+       GLOBAL_MMR_ADDR(n,x)
+
+#define SH1_REMOTE_BWIN_MMR(n,x)                                       \
+       GLOBAL_MMR_ADDR(n,x)
+
+#define SH1_REMOTE_SWIN_MMR(n,x)                                       \
+       (NODE_SWIN_BASE(n,1) + 0x800000UL + (x))
+
+#define SH1_REMOTE_MMR(n,x)                                            \
+       (SH1_IS_BIG_WINDOW_ADDR(x) ? SH1_REMOTE_BWIN_MMR(n,x) :         \
+               SH1_REMOTE_SWIN_MMR(n,x))
+
+/* Shub1 TIO & MMR addressing macros */
+#define SH2_TIO_IOSPACE_ADDR(n,x)                                      \
+       ((__IA64_UNCACHED_OFFSET | REMOTE_ADDR(n,x) | 1UL << (NASID_SHIFT - 2)))
+
+#define SH2_REMOTE_MMR(n,x)                                            \
+       GLOBAL_MMR_ADDR(n,x)
+
+
+/* TIO & MMR addressing macros that work on both shub1 & shub2 */
+#define TIO_IOSPACE_ADDR(n,x)                                          \
+       ((u64 *)(is_shub1() ? SH1_TIO_IOSPACE_ADDR(n,x) :               \
+                SH2_TIO_IOSPACE_ADDR(n,x)))
+
+#define SH_REMOTE_MMR(n,x)                                             \
+       (is_shub1() ? SH1_REMOTE_MMR(n,x) : SH2_REMOTE_MMR(n,x))
+
+#define REMOTE_HUB_ADDR(n,x)                                           \
+       (IS_TIO_NASID(n) ?  ((volatile u64*)TIO_IOSPACE_ADDR(n,x)) :    \
+        ((volatile u64*)SH_REMOTE_MMR(n,x)))
+
+
+#define HUB_L(x)                       (*((volatile typeof(*x) *)x))
+#define        HUB_S(x,d)                      (*((volatile typeof(*x) *)x) = (d))
+
+#define REMOTE_HUB_L(n, a)             HUB_L(REMOTE_HUB_ADDR((n), (a)))
+#define REMOTE_HUB_S(n, a, d)          HUB_S(REMOTE_HUB_ADDR((n), (a)), (d))
+
+/*
+ * Coretalk address breakdown
+ */
+#define CTALK_NASID_SHFT               40
+#define CTALK_NASID_MASK               (0x3FFFULL << CTALK_NASID_SHFT)
+#define CTALK_CID_SHFT                 38
+#define CTALK_CID_MASK                 (0x3ULL << CTALK_CID_SHFT)
+#define CTALK_NODE_OFFSET              0x3FFFFFFFFF
+
+#endif /* _ASM_IA64_SN_ADDRS_H */
diff --git a/arch/ia64/include/asm/sn/arch.h b/arch/ia64/include/asm/sn/arch.h
new file mode 100644 (file)
index 0000000..7caa1f4
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * 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.
+ *
+ * SGI specific setup.
+ *
+ * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc.  All rights reserved.
+ * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
+ */
+#ifndef _ASM_IA64_SN_ARCH_H
+#define _ASM_IA64_SN_ARCH_H
+
+#include <linux/numa.h>
+#include <asm/types.h>
+#include <asm/percpu.h>
+#include <asm/sn/types.h>
+#include <asm/sn/sn_cpuid.h>
+
+/*
+ * This is the maximum number of NUMALINK nodes that can be part of a single
+ * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in
+ * remote partitions are NOT included in this number.
+ * The number of compact nodes cannot exceed size of a coherency domain.
+ * The purpose of this define is to specify a node count that includes
+ * all C/M/TIO nodes in an SSI system.
+ *
+ * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes.
+ *
+ *     Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade
+ *     to ACPI3.0, this limit will be removed. The notion of "compact nodes"
+ *     should be deleted and TIOs should be included in MAX_NUMNODES.
+ */
+#define MAX_TIO_NODES          MAX_NUMNODES
+#define MAX_COMPACT_NODES      (MAX_NUMNODES + MAX_TIO_NODES)
+
+/*
+ * Maximum number of nodes in all partitions and in all coherency domains.
+ * This is the total number of nodes accessible in the numalink fabric. It
+ * includes all C & M bricks, plus all TIOs.
+ *
+ * This value is also the value of the maximum number of NASIDs in the numalink
+ * fabric.
+ */
+#define MAX_NUMALINK_NODES     16384
+
+/*
+ * The following defines attributes of the HUB chip. These attributes are
+ * frequently referenced. They are kept in the per-cpu data areas of each cpu.
+ * They are kept together in a struct to minimize cache misses.
+ */
+struct sn_hub_info_s {
+       u8 shub2;
+       u8 nasid_shift;
+       u8 as_shift;
+       u8 shub_1_1_found;
+       u16 nasid_bitmask;
+};
+DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
+#define sn_hub_info    (&__get_cpu_var(__sn_hub_info))
+#define is_shub2()     (sn_hub_info->shub2)
+#define is_shub1()     (sn_hub_info->shub2 == 0)
+
+/*
+ * Use this macro to test if shub 1.1 wars should be enabled
+ */
+#define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found)
+
+
+/*
+ * Compact node ID to nasid mappings kept in the per-cpu data areas of each
+ * cpu.
+ */
+DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]);
+#define sn_cnodeid_to_nasid    (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
+
+
+extern u8 sn_partition_id;
+extern u8 sn_system_size;
+extern u8 sn_sharing_domain_size;
+extern u8 sn_region_size;
+
+extern void sn_flush_all_caches(long addr, long bytes);
+extern bool sn_cpu_disable_allowed(int cpu);
+
+#endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/arch/ia64/include/asm/sn/bte.h b/arch/ia64/include/asm/sn/bte.h
new file mode 100644 (file)
index 0000000..a0d214f
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * 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) 2000-2007 Silicon Graphics, Inc.  All Rights Reserved.
+ */
+
+
+#ifndef _ASM_IA64_SN_BTE_H
+#define _ASM_IA64_SN_BTE_H
+
+#include <linux/timer.h>
+#include <linux/spinlock.h>
+#include <linux/cache.h>
+#include <asm/sn/pda.h>
+#include <asm/sn/types.h>
+#include <asm/sn/shub_mmr.h>
+
+#define IBCT_NOTIFY             (0x1UL << 4)
+#define IBCT_ZFIL_MODE          (0x1UL << 0)
+
+/* #define BTE_DEBUG */
+/* #define BTE_DEBUG_VERBOSE */
+
+#ifdef BTE_DEBUG
+#  define BTE_PRINTK(x) printk x       /* Terse */
+#  ifdef BTE_DEBUG_VERBOSE
+#    define BTE_PRINTKV(x) printk x    /* Verbose */
+#  else
+#    define BTE_PRINTKV(x)
+#  endif /* BTE_DEBUG_VERBOSE */
+#else
+#  define BTE_PRINTK(x)
+#  define BTE_PRINTKV(x)
+#endif /* BTE_DEBUG */
+
+
+/* BTE status register only supports 16 bits for length field */
+#define BTE_LEN_BITS (16)
+#define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1)
+#define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES)
+
+
+/* Define hardware */
+#define BTES_PER_NODE (is_shub2() ? 4 : 2)
+#define MAX_BTES_PER_NODE 4
+
+#define BTE2OFF_CTRL   0
+#define BTE2OFF_SRC    (SH2_BT_ENG_SRC_ADDR_0 - SH2_BT_ENG_CSR_0)
+#define BTE2OFF_DEST   (SH2_BT_ENG_DEST_ADDR_0 - SH2_BT_ENG_CSR_0)
+#define BTE2OFF_NOTIFY (SH2_BT_ENG_NOTIF_ADDR_0 - SH2_BT_ENG_CSR_0)
+
+#define BTE_BASE_ADDR(interface)                               \
+    (is_shub2() ? (interface == 0) ? SH2_BT_ENG_CSR_0 :                \
+                 (interface == 1) ? SH2_BT_ENG_CSR_1 :         \
+                 (interface == 2) ? SH2_BT_ENG_CSR_2 :         \
+                                    SH2_BT_ENG_CSR_3           \
+               : (interface == 0) ? IIO_IBLS0 : IIO_IBLS1)
+
+#define BTE_SOURCE_ADDR(base)                                  \
+    (is_shub2() ? base + (BTE2OFF_SRC/8)                       \
+               : base + (BTEOFF_SRC/8))
+
+#define BTE_DEST_ADDR(base)                                    \
+    (is_shub2() ? base + (BTE2OFF_DEST/8)                      \
+               : base + (BTEOFF_DEST/8))
+
+#define BTE_CTRL_ADDR(base)                                    \
+    (is_shub2() ? base + (BTE2OFF_CTRL/8)                      \
+               : base + (BTEOFF_CTRL/8))
+
+#define BTE_NOTIF_ADDR(base)                                   \
+    (is_shub2() ? base + (BTE2OFF_NOTIFY/8)                    \
+               : base + (BTEOFF_NOTIFY/8))
+
+/* Define hardware modes */
+#define BTE_NOTIFY IBCT_NOTIFY
+#define BTE_NORMAL BTE_NOTIFY
+#define BTE_ZERO_FILL (BTE_NOTIFY | IBCT_ZFIL_MODE)
+/* Use a reserved bit to let the caller specify a wait for any BTE */
+#define BTE_WACQUIRE 0x4000
+/* Use the BTE on the node with the destination memory */
+#define BTE_USE_DEST (BTE_WACQUIRE << 1)
+/* Use any available BTE interface on any node for the transfer */
+#define BTE_USE_ANY (BTE_USE_DEST << 1)
+/* macro to force the IBCT0 value valid */
+#define BTE_VALID_MODE(x) ((x) & (IBCT_NOTIFY | IBCT_ZFIL_MODE))
+
+#define BTE_ACTIVE             (IBLS_BUSY | IBLS_ERROR)
+#define BTE_WORD_AVAILABLE     (IBLS_BUSY << 1)
+#define BTE_WORD_BUSY          (~BTE_WORD_AVAILABLE)
+
+/*
+ * Some macros to simplify reading.
+ * Start with macros to locate the BTE control registers.
+ */
+#define BTE_LNSTAT_LOAD(_bte)                                          \
+                       HUB_L(_bte->bte_base_addr)
+#define BTE_LNSTAT_STORE(_bte, _x)                                     \
+                       HUB_S(_bte->bte_base_addr, (_x))
+#define BTE_SRC_STORE(_bte, _x)                                                \
+({                                                                     \
+               u64 __addr = ((_x) & ~AS_MASK);                         \
+               if (is_shub2())                                         \
+                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
+               HUB_S(_bte->bte_source_addr, __addr);                   \
+})
+#define BTE_DEST_STORE(_bte, _x)                                       \
+({                                                                     \
+               u64 __addr = ((_x) & ~AS_MASK);                         \
+               if (is_shub2())                                         \
+                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
+               HUB_S(_bte->bte_destination_addr, __addr);              \
+})
+#define BTE_CTRL_STORE(_bte, _x)                                       \
+                       HUB_S(_bte->bte_control_addr, (_x))
+#define BTE_NOTIF_STORE(_bte, _x)                                      \
+({                                                                     \
+               u64 __addr = ia64_tpa((_x) & ~AS_MASK);                 \
+               if (is_shub2())                                         \
+                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
+               HUB_S(_bte->bte_notify_addr, __addr);                   \
+})
+
+#define BTE_START_TRANSFER(_bte, _len, _mode)                          \
+       is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \
+               : BTE_LNSTAT_STORE(_bte, _len);                         \
+                 BTE_CTRL_STORE(_bte, _mode)
+
+/* Possible results from bte_copy and bte_unaligned_copy */
+/* The following error codes map into the BTE hardware codes
+ * IIO_ICRB_ECODE_* (in shubio.h). The hardware uses
+ * an error code of 0 (IIO_ICRB_ECODE_DERR), but we want zero
+ * to mean BTE_SUCCESS, so add one (BTEFAIL_OFFSET) to the error
+ * codes to give the following error codes.
+ */
+#define BTEFAIL_OFFSET 1
+
+typedef enum {
+       BTE_SUCCESS,            /* 0 is success */
+       BTEFAIL_DIR,            /* Directory error due to IIO access*/
+       BTEFAIL_POISON,         /* poison error on IO access (write to poison page) */
+       BTEFAIL_WERR,           /* Write error (ie WINV to a Read only line) */
+       BTEFAIL_ACCESS,         /* access error (protection violation) */
+       BTEFAIL_PWERR,          /* Partial Write Error */
+       BTEFAIL_PRERR,          /* Partial Read Error */
+       BTEFAIL_TOUT,           /* CRB Time out */
+       BTEFAIL_XTERR,          /* Incoming xtalk pkt had error bit */
+       BTEFAIL_NOTAVAIL,       /* BTE not available */
+} bte_result_t;
+
+#define BTEFAIL_SH2_RESP_SHORT 0x1     /* bit 000001 */
+#define BTEFAIL_SH2_RESP_LONG  0x2     /* bit 000010 */
+#define BTEFAIL_SH2_RESP_DSP   0x4     /* bit 000100 */
+#define BTEFAIL_SH2_RESP_ACCESS        0x8     /* bit 001000 */
+#define BTEFAIL_SH2_CRB_TO     0x10    /* bit 010000 */
+#define BTEFAIL_SH2_NACK_LIMIT 0x20    /* bit 100000 */
+#define BTEFAIL_SH2_ALL                0x3F    /* bit 111111 */
+
+#define        BTE_ERR_BITS    0x3FUL
+#define        BTE_ERR_SHIFT   36
+#define BTE_ERR_MASK   (BTE_ERR_BITS << BTE_ERR_SHIFT)
+
+#define BTE_ERROR_RETRY(value)                                         \
+       (is_shub2() ? (value != BTEFAIL_SH2_CRB_TO)                     \
+               : (value != BTEFAIL_TOUT))
+
+/*
+ * On shub1 BTE_ERR_MASK will always be false, so no need for is_shub2()
+ */
+#define BTE_SHUB2_ERROR(_status)                                       \
+       ((_status & BTE_ERR_MASK)                                       \
+          ? (((_status >> BTE_ERR_SHIFT) & BTE_ERR_BITS) | IBLS_ERROR) \
+          : _status)
+
+#define BTE_GET_ERROR_STATUS(_status)                                  \
+       (BTE_SHUB2_ERROR(_status) & ~IBLS_ERROR)
+
+#define BTE_VALID_SH2_ERROR(value)                                     \
+       ((value >= BTEFAIL_SH2_RESP_SHORT) && (value <= BTEFAIL_SH2_ALL))
+
+/*
+ * Structure defining a bte.  An instance of this
+ * structure is created in the nodepda for each
+ * bte on that node (as defined by BTES_PER_NODE)
+ * This structure contains everything necessary
+ * to work with a BTE.
+ */
+struct bteinfo_s {
+       volatile u64 notify ____cacheline_aligned;
+       u64 *bte_base_addr ____cacheline_aligned;
+       u64 *bte_source_addr;
+       u64 *bte_destination_addr;
+       u64 *bte_control_addr;
+       u64 *bte_notify_addr;
+       spinlock_t spinlock;
+       cnodeid_t bte_cnode;    /* cnode                            */
+       int bte_error_count;    /* Number of errors encountered     */
+       int bte_num;            /* 0 --> BTE0, 1 --> BTE1           */
+       int cleanup_active;     /* Interface is locked for cleanup  */
+       volatile bte_result_t bh_error; /* error while processing   */
+       volatile u64 *most_rcnt_na;
+       struct bteinfo_s *btes_to_try[MAX_BTES_PER_NODE];
+};
+
+
+/*
+ * Function prototypes (functions defined in bte.c, used elsewhere)
+ */
+extern bte_result_t bte_copy(u64, u64, u64, u64, void *);
+extern bte_result_t bte_unaligned_copy(u64, u64, u64, u64);
+extern void bte_error_handler(unsigned long);
+
+#define bte_zero(dest, len, mode, notification) \
+       bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)
+
+/*
+ * The following is the prefered way of calling bte_unaligned_copy
+ * If the copy is fully cache line aligned, then bte_copy is
+ * used instead.  Since bte_copy is inlined, this saves a call
+ * stack.  NOTE: bte_copy is called synchronously and does block
+ * until the transfer is complete.  In order to get the asynch
+ * version of bte_copy, you must perform this check yourself.
+ */
+#define BTE_UNALIGNED_COPY(src, dest, len, mode)                        \
+       (((len & L1_CACHE_MASK) || (src & L1_CACHE_MASK) ||             \
+         (dest & L1_CACHE_MASK)) ?                                     \
+        bte_unaligned_copy(src, dest, len, mode) :                     \
+        bte_copy(src, dest, len, mode, NULL))
+
+
+#endif /* _ASM_IA64_SN_BTE_H */
diff --git a/arch/ia64/include/asm/sn/clksupport.h b/arch/ia64/include/asm/sn/clksupport.h
new file mode 100644 (file)
index 0000000..d340c36
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ */
+
+/*
+ * This file contains definitions for accessing a platform supported high resolution
+ * clock. The clock is monitonically increasing and can be accessed from any node
+ * in the system. The clock is synchronized across nodes - all nodes see the
+ * same value.
+ * 
+ *     RTC_COUNTER_ADDR - contains the address of the counter 
+ *
+ */
+
+#ifndef _ASM_IA64_SN_CLKSUPPORT_H
+#define _ASM_IA64_SN_CLKSUPPORT_H
+
+extern unsigned long sn_rtc_cycles_per_second;
+
+#define RTC_COUNTER_ADDR       ((long *)LOCAL_MMR_ADDR(SH_RTC))
+
+#define rtc_time()             (*RTC_COUNTER_ADDR)
+
+#endif /* _ASM_IA64_SN_CLKSUPPORT_H */
diff --git a/arch/ia64/include/asm/sn/geo.h b/arch/ia64/include/asm/sn/geo.h
new file mode 100644 (file)
index 0000000..f083c94
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_GEO_H
+#define _ASM_IA64_SN_GEO_H
+
+/* The geoid_t implementation below is based loosely on the pcfg_t
+   implementation in sys/SN/promcfg.h. */
+
+/* Type declaractions */
+
+/* Size of a geoid_t structure (must be before decl. of geoid_u) */
+#define GEOID_SIZE     8       /* Would 16 be better?  The size can
+                                  be different on different platforms. */
+
+#define MAX_SLOTS      0xf     /* slots per module */
+#define MAX_SLABS      0xf     /* slabs per slot */
+
+typedef unsigned char  geo_type_t;
+
+/* Fields common to all substructures */
+typedef struct geo_common_s {
+    moduleid_t module;         /* The module (box) this h/w lives in */
+    geo_type_t type;           /* What type of h/w is named by this geoid_t */
+    slabid_t   slab:4;         /* slab (ASIC), 0 .. 15 within slot */
+    slotid_t   slot:4;         /* slot (Blade), 0 .. 15 within module */
+} geo_common_t;
+
+/* Additional fields for particular types of hardware */
+typedef struct geo_node_s {
+    geo_common_t       common;         /* No additional fields needed */
+} geo_node_t;
+
+typedef struct geo_rtr_s {
+    geo_common_t       common;         /* No additional fields needed */
+} geo_rtr_t;
+
+typedef struct geo_iocntl_s {
+    geo_common_t       common;         /* No additional fields needed */
+} geo_iocntl_t;
+
+typedef struct geo_pcicard_s {
+    geo_iocntl_t       common;
+    char               bus;    /* Bus/widget number */
+    char               slot;   /* PCI slot number */
+} geo_pcicard_t;
+
+/* Subcomponents of a node */
+typedef struct geo_cpu_s {
+    geo_node_t node;
+    char       slice;          /* Which CPU on the node */
+} geo_cpu_t;
+
+typedef struct geo_mem_s {
+    geo_node_t node;
+    char       membus;         /* The memory bus on the node */
+    char       memslot;        /* The memory slot on the bus */
+} geo_mem_t;
+
+
+typedef union geoid_u {
+    geo_common_t       common;
+    geo_node_t         node;
+    geo_iocntl_t       iocntl;
+    geo_pcicard_t      pcicard;
+    geo_rtr_t          rtr;
+    geo_cpu_t          cpu;
+    geo_mem_t          mem;
+    char               padsize[GEOID_SIZE];
+} geoid_t;
+
+
+/* Preprocessor macros */
+
+#define GEO_MAX_LEN    48      /* max. formatted length, plus some pad:
+                                  module/001c07/slab/5/node/memory/2/slot/4 */
+
+/* Values for geo_type_t */
+#define GEO_TYPE_INVALID       0
+#define GEO_TYPE_MODULE                1
+#define GEO_TYPE_NODE          2
+#define GEO_TYPE_RTR           3
+#define GEO_TYPE_IOCNTL                4
+#define GEO_TYPE_IOCARD                5
+#define GEO_TYPE_CPU           6
+#define GEO_TYPE_MEM           7
+#define GEO_TYPE_MAX           (GEO_TYPE_MEM+1)
+
+/* Parameter for hwcfg_format_geoid_compt() */
+#define GEO_COMPT_MODULE       1
+#define GEO_COMPT_SLAB         2
+#define GEO_COMPT_IOBUS                3
+#define GEO_COMPT_IOSLOT       4
+#define GEO_COMPT_CPU          5
+#define GEO_COMPT_MEMBUS       6
+#define GEO_COMPT_MEMSLOT      7
+
+#define GEO_INVALID_STR                "<invalid>"
+
+#define INVALID_NASID           ((nasid_t)-1)
+#define INVALID_CNODEID         ((cnodeid_t)-1)
+#define INVALID_PNODEID         ((pnodeid_t)-1)
+#define INVALID_SLAB            (slabid_t)-1
+#define INVALID_SLOT            (slotid_t)-1
+#define INVALID_MODULE          ((moduleid_t)-1)
+
+static inline slabid_t geo_slab(geoid_t g)
+{
+       return (g.common.type == GEO_TYPE_INVALID) ?
+               INVALID_SLAB : g.common.slab;
+}
+
+static inline slotid_t geo_slot(geoid_t g)
+{
+       return (g.common.type == GEO_TYPE_INVALID) ?
+               INVALID_SLOT : g.common.slot;
+}
+
+static inline moduleid_t geo_module(geoid_t g)
+{
+       return (g.common.type == GEO_TYPE_INVALID) ?
+               INVALID_MODULE : g.common.module;
+}
+
+extern geoid_t cnodeid_get_geoid(cnodeid_t cnode);
+
+#endif /* _ASM_IA64_SN_GEO_H */
diff --git a/arch/ia64/include/asm/sn/intr.h b/arch/ia64/include/asm/sn/intr.h
new file mode 100644 (file)
index 0000000..e0487aa
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_INTR_H
+#define _ASM_IA64_SN_INTR_H
+
+#include <linux/rcupdate.h>
+#include <asm/sn/types.h>
+
+#define SGI_UART_VECTOR                0xe9
+
+/* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */
+#define SGI_XPC_ACTIVATE       0x30
+#define SGI_II_ERROR           0x31
+#define SGI_XBOW_ERROR         0x32
+#define SGI_PCIASIC_ERROR      0x33
+#define SGI_ACPI_SCI_INT       0x34
+#define SGI_TIOCA_ERROR                0x35
+#define SGI_TIO_ERROR          0x36
+#define SGI_TIOCX_ERROR                0x37
+#define SGI_MMTIMER_VECTOR     0x38
+#define SGI_XPC_NOTIFY         0xe7
+
+#define IA64_SN2_FIRST_DEVICE_VECTOR   0x3c
+#define IA64_SN2_LAST_DEVICE_VECTOR    0xe6
+
+#define SN2_IRQ_RESERVED       0x1
+#define SN2_IRQ_CONNECTED      0x2
+#define SN2_IRQ_SHARED         0x4
+
+// The SN PROM irq struct
+struct sn_irq_info {
+       struct sn_irq_info *irq_next;   /* deprecated DO NOT USE     */
+       short           irq_nasid;      /* Nasid IRQ is assigned to  */
+       int             irq_slice;      /* slice IRQ is assigned to  */
+       int             irq_cpuid;      /* kernel logical cpuid      */
+       int             irq_irq;        /* the IRQ number */
+       int             irq_int_bit;    /* Bridge interrupt pin */
+                                       /* <0 means MSI */
+       u64     irq_xtalkaddr;  /* xtalkaddr IRQ is sent to  */
+       int             irq_bridge_type;/* pciio asic type (pciio.h) */
+       void           *irq_bridge;     /* bridge generating irq     */
+       void           *irq_pciioinfo;  /* associated pciio_info_t   */
+       int             irq_last_intr;  /* For Shub lb lost intr WAR */
+       int             irq_cookie;     /* unique cookie             */
+       int             irq_flags;      /* flags */
+       int             irq_share_cnt;  /* num devices sharing IRQ   */
+       struct list_head        list;   /* list of sn_irq_info structs */
+       struct rcu_head         rcu;    /* rcu callback list */
+};
+
+extern void sn_send_IPI_phys(int, long, int, int);
+extern u64 sn_intr_alloc(nasid_t, int,
+                             struct sn_irq_info *,
+                             int, nasid_t, int);
+extern void sn_intr_free(nasid_t, int, struct sn_irq_info *);
+extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int);
+extern void sn_set_err_irq_affinity(unsigned int);
+extern struct list_head **sn_irq_lh;
+
+#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
+
+#endif /* _ASM_IA64_SN_INTR_H */
diff --git a/arch/ia64/include/asm/sn/io.h b/arch/ia64/include/asm/sn/io.h
new file mode 100644 (file)
index 0000000..41c73a7
--- /dev/null
@@ -0,0 +1,274 @@
+/* 
+ * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_SN_IO_H
+#define _ASM_SN_IO_H
+#include <linux/compiler.h>
+#include <asm/intrinsics.h>
+
+extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
+extern void __sn_mmiowb(void); /* Forward definition */
+
+extern int num_cnodes;
+
+#define __sn_mf_a()   ia64_mfa()
+
+extern void sn_dma_flush(unsigned long);
+
+#define __sn_inb ___sn_inb
+#define __sn_inw ___sn_inw
+#define __sn_inl ___sn_inl
+#define __sn_outb ___sn_outb
+#define __sn_outw ___sn_outw
+#define __sn_outl ___sn_outl
+#define __sn_readb ___sn_readb
+#define __sn_readw ___sn_readw
+#define __sn_readl ___sn_readl
+#define __sn_readq ___sn_readq
+#define __sn_readb_relaxed ___sn_readb_relaxed
+#define __sn_readw_relaxed ___sn_readw_relaxed
+#define __sn_readl_relaxed ___sn_readl_relaxed
+#define __sn_readq_relaxed ___sn_readq_relaxed
+
+/*
+ * Convenience macros for setting/clearing bits using the above accessors
+ */
+
+#define __sn_setq_relaxed(addr, val) \
+       writeq((__sn_readq_relaxed(addr) | (val)), (addr))
+#define __sn_clrq_relaxed(addr, val) \
+       writeq((__sn_readq_relaxed(addr) & ~(val)), (addr))
+
+/*
+ * The following routines are SN Platform specific, called when
+ * a reference is made to inX/outX set macros.  SN Platform
+ * inX set of macros ensures that Posted DMA writes on the
+ * Bridge is flushed.
+ *
+ * The routines should be self explainatory.
+ */
+
+static inline unsigned int
+___sn_inb (unsigned long port)
+{
+       volatile unsigned char *addr;
+       unsigned char ret = -1;
+
+       if ((addr = sn_io_addr(port))) {
+               ret = *addr;
+               __sn_mf_a();
+               sn_dma_flush((unsigned long)addr);
+       }
+       return ret;
+}
+
+static inline unsigned int
+___sn_inw (unsigned long port)
+{
+       volatile unsigned short *addr;
+       unsigned short ret = -1;
+
+       if ((addr = sn_io_addr(port))) {
+               ret = *addr;
+               __sn_mf_a();
+               sn_dma_flush((unsigned long)addr);
+       }
+       return ret;
+}
+
+static inline unsigned int
+___sn_inl (unsigned long port)
+{
+       volatile unsigned int *addr;
+       unsigned int ret = -1;
+
+       if ((addr = sn_io_addr(port))) {
+               ret = *addr;
+               __sn_mf_a();
+               sn_dma_flush((unsigned long)addr);
+       }
+       return ret;
+}
+
+static inline void
+___sn_outb (unsigned char val, unsigned long port)
+{
+       volatile unsigned char *addr;
+
+       if ((addr = sn_io_addr(port))) {
+               *addr = val;
+               __sn_mmiowb();
+       }
+}
+
+static inline void
+___sn_outw (unsigned short val, unsigned long port)
+{
+       volatile unsigned short *addr;
+
+       if ((addr = sn_io_addr(port))) {
+               *addr = val;
+               __sn_mmiowb();
+       }
+}
+
+static inline void
+___sn_outl (unsigned int val, unsigned long port)
+{
+       volatile unsigned int *addr;
+
+       if ((addr = sn_io_addr(port))) {
+               *addr = val;
+               __sn_mmiowb();
+       }
+}
+
+/*
+ * The following routines are SN Platform specific, called when 
+ * a reference is made to readX/writeX set macros.  SN Platform 
+ * readX set of macros ensures that Posted DMA writes on the 
+ * Bridge is flushed.
+ * 
+ * The routines should be self explainatory.
+ */
+
+static inline unsigned char
+___sn_readb (const volatile void __iomem *addr)
+{
+       unsigned char val;
+
+       val = *(volatile unsigned char __force *)addr;
+       __sn_mf_a();
+       sn_dma_flush((unsigned long)addr);
+        return val;
+}
+
+static inline unsigned short
+___sn_readw (const volatile void __iomem *addr)
+{
+       unsigned short val;
+
+       val = *(volatile unsigned short __force *)addr;
+       __sn_mf_a();
+       sn_dma_flush((unsigned long)addr);
+        return val;
+}
+
+static inline unsigned int
+___sn_readl (const volatile void __iomem *addr)
+{
+       unsigned int val;
+
+       val = *(volatile unsigned int __force *)addr;
+       __sn_mf_a();
+       sn_dma_flush((unsigned long)addr);
+        return val;
+}
+
+static inline unsigned long
+___sn_readq (const volatile void __iomem *addr)
+{
+       unsigned long val;
+
+       val = *(volatile unsigned long __force *)addr;
+       __sn_mf_a();
+       sn_dma_flush((unsigned long)addr);
+        return val;
+}
+
+/*
+ * For generic and SN2 kernels, we have a set of fast access
+ * PIO macros. These macros are provided on SN Platform
+ * because the normal inX and readX macros perform an
+ * additional task of flushing Post DMA request on the Bridge.
+ *
+ * These routines should be self explainatory.
+ */
+
+static inline unsigned int
+sn_inb_fast (unsigned long port)
+{
+       volatile unsigned char *addr = (unsigned char *)port;
+       unsigned char ret;
+
+       ret = *addr;
+       __sn_mf_a();
+       return ret;
+}
+
+static inline unsigned int
+sn_inw_fast (unsigned long port)
+{
+       volatile unsigned short *addr = (unsigned short *)port;
+       unsigned short ret;
+
+       ret = *addr;
+       __sn_mf_a();
+       return ret;
+}
+
+static inline unsigned int
+sn_inl_fast (unsigned long port)
+{
+       volatile unsigned int *addr = (unsigned int *)port;
+       unsigned int ret;
+
+       ret = *addr;
+       __sn_mf_a();
+       return ret;
+}
+
+static inline unsigned char
+___sn_readb_relaxed (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned char __force *)addr;
+}
+
+static inline unsigned short
+___sn_readw_relaxed (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned short __force *)addr;
+}
+
+static inline unsigned int
+___sn_readl_relaxed (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned int __force *) addr;
+}
+
+static inline unsigned long
+___sn_readq_relaxed (const volatile void __iomem *addr)
+{
+       return *(volatile unsigned long __force *) addr;
+}
+
+struct pci_dev;
+
+static inline int
+sn_pci_set_vchan(struct pci_dev *pci_dev, unsigned long *addr, int vchan)
+{
+
+       if (vchan > 1) {
+               return -1;
+       }
+
+       if (!(*addr >> 32))     /* Using a mask here would be cleaner */
+               return 0;       /* but this generates better code */
+
+       if (vchan == 1) {
+               /* Set Bit 57 */
+               *addr |= (1UL << 57);
+       } else {
+               /* Clear Bit 57 */
+               *addr &= ~(1UL << 57);
+       }
+
+       return 0;
+}
+
+#endif /* _ASM_SN_IO_H */
diff --git a/arch/ia64/include/asm/sn/ioc3.h b/arch/ia64/include/asm/sn/ioc3.h
new file mode 100644 (file)
index 0000000..95ed6cc
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2005 Silicon Graphics, Inc.
+ */
+#ifndef IA64_SN_IOC3_H
+#define IA64_SN_IOC3_H
+
+/* serial port register map */
+struct ioc3_serialregs {
+       uint32_t sscr;
+       uint32_t stpir;
+       uint32_t stcir;
+       uint32_t srpir;
+       uint32_t srcir;
+       uint32_t srtr;
+       uint32_t shadow;
+};
+
+/* SUPERIO uart register map */
+struct ioc3_uartregs {
+       char iu_lcr;
+       union {
+               char iir;       /* read only */
+               char fcr;       /* write only */
+       } u3;
+       union {
+               char ier;       /* DLAB == 0 */
+               char dlm;       /* DLAB == 1 */
+       } u2;
+       union {
+               char rbr;       /* read only, DLAB == 0 */
+               char thr;       /* write only, DLAB == 0 */
+               char dll;       /* DLAB == 1 */
+       } u1;
+       char iu_scr;
+       char iu_msr;
+       char iu_lsr;
+       char iu_mcr;
+};
+
+#define iu_rbr u1.rbr
+#define iu_thr u1.thr
+#define iu_dll u1.dll
+#define iu_ier u2.ier
+#define iu_dlm u2.dlm
+#define iu_iir u3.iir
+#define iu_fcr u3.fcr
+
+struct ioc3_sioregs {
+       char fill[0x170];
+       struct ioc3_uartregs uartb;
+       struct ioc3_uartregs uarta;
+};
+
+/* PCI IO/mem space register map */
+struct ioc3 {
+       uint32_t pci_id;
+       uint32_t pci_scr;
+       uint32_t pci_rev;
+       uint32_t pci_lat;
+       uint32_t pci_addr;
+       uint32_t pci_err_addr_l;
+       uint32_t pci_err_addr_h;
+
+       uint32_t sio_ir;
+       /* these registers are read-only for general kernel code. To
+        * modify them use the functions in ioc3.c
+        */
+       uint32_t sio_ies;
+       uint32_t sio_iec;
+       uint32_t sio_cr;
+       uint32_t int_out;
+       uint32_t mcr;
+       uint32_t gpcr_s;
+       uint32_t gpcr_c;
+       uint32_t gpdr;
+       uint32_t gppr[9];
+       char fill[0x4c];
+
+       /* serial port registers */
+       uint32_t sbbr_h;
+       uint32_t sbbr_l;
+
+       struct ioc3_serialregs port_a;
+       struct ioc3_serialregs port_b;
+       char fill1[0x1ff10];
+       /* superio registers */
+       struct ioc3_sioregs sregs;
+};
+
+/* These don't exist on the ioc3 serial card... */
+#define eier   fill1[8]
+#define eisr   fill1[4]
+
+#define PCI_LAT                        0xc     /* Latency Timer */
+#define PCI_SCR_DROP_MODE_EN   0x00008000 /* drop pios on parity err */
+#define UARTA_BASE             0x178
+#define UARTB_BASE             0x170
+
+
+/* bitmasks for serial RX status byte */
+#define RXSB_OVERRUN           0x01    /* char(s) lost */
+#define RXSB_PAR_ERR           0x02    /* parity error */
+#define RXSB_FRAME_ERR         0x04    /* framing error */
+#define RXSB_BREAK             0x08    /* break character */
+#define RXSB_CTS               0x10    /* state of CTS */
+#define RXSB_DCD               0x20    /* state of DCD */
+#define RXSB_MODEM_VALID       0x40    /* DCD, CTS and OVERRUN are valid */
+#define RXSB_DATA_VALID                0x80    /* FRAME_ERR PAR_ERR & BREAK valid */
+
+/* bitmasks for serial TX control byte */
+#define TXCB_INT_WHEN_DONE     0x20    /* interrupt after this byte is sent */
+#define TXCB_INVALID           0x00    /* byte is invalid */
+#define TXCB_VALID             0x40    /* byte is valid */
+#define TXCB_MCR               0x80    /* data<7:0> to modem cntrl register */
+#define TXCB_DELAY             0xc0    /* delay data<7:0> mSec */
+
+/* bitmasks for SBBR_L */
+#define SBBR_L_SIZE            0x00000001      /* 0 1KB rings, 1 4KB rings */
+
+/* bitmasks for SSCR_<A:B> */
+#define SSCR_RX_THRESHOLD      0x000001ff      /* hiwater mark */
+#define SSCR_TX_TIMER_BUSY     0x00010000      /* TX timer in progress */
+#define SSCR_HFC_EN            0x00020000      /* h/w flow cntrl enabled */
+#define SSCR_RX_RING_DCD       0x00040000      /* postRX record on delta-DCD */
+#define SSCR_RX_RING_CTS       0x00080000      /* postRX record on delta-CTS */
+#define SSCR_HIGH_SPD          0x00100000      /* 4X speed */
+#define SSCR_DIAG              0x00200000      /* bypass clock divider */
+#define SSCR_RX_DRAIN          0x08000000      /* drain RX buffer to memory */
+#define SSCR_DMA_EN            0x10000000      /* enable ring buffer DMA */
+#define SSCR_DMA_PAUSE         0x20000000      /* pause DMA */
+#define SSCR_PAUSE_STATE       0x40000000      /* set when PAUSE takes effect*/
+#define SSCR_RESET             0x80000000      /* reset DMA channels */
+
+/* all producer/comsumer pointers are the same bitfield */
+#define PROD_CONS_PTR_4K       0x00000ff8      /* for 4K buffers */
+#define PROD_CONS_PTR_1K       0x000003f8      /* for 1K buffers */
+#define PROD_CONS_PTR_OFF      3
+
+/* bitmasks for SRCIR_<A:B> */
+#define SRCIR_ARM              0x80000000      /* arm RX timer */
+
+/* bitmasks for SHADOW_<A:B> */
+#define SHADOW_DR              0x00000001      /* data ready */
+#define SHADOW_OE              0x00000002      /* overrun error */
+#define SHADOW_PE              0x00000004      /* parity error */
+#define SHADOW_FE              0x00000008      /* framing error */
+#define SHADOW_BI              0x00000010      /* break interrupt */
+#define SHADOW_THRE            0x00000020      /* transmit holding reg empty */
+#define SHADOW_TEMT            0x00000040      /* transmit shift reg empty */
+#define SHADOW_RFCE            0x00000080      /* char in RX fifo has error */
+#define SHADOW_DCTS            0x00010000      /* delta clear to send */
+#define SHADOW_DDCD            0x00080000      /* delta data carrier detect */
+#define SHADOW_CTS             0x00100000      /* clear to send */
+#define SHADOW_DCD             0x00800000      /* data carrier detect */
+#define SHADOW_DTR             0x01000000      /* data terminal ready */
+#define SHADOW_RTS             0x02000000      /* request to send */
+#define SHADOW_OUT1            0x04000000      /* 16550 OUT1 bit */
+#define SHADOW_OUT2            0x08000000      /* 16550 OUT2 bit */
+#define SHADOW_LOOP            0x10000000      /* loopback enabled */
+
+/* bitmasks for SRTR_<A:B> */
+#define SRTR_CNT               0x00000fff      /* reload value for RX timer */
+#define SRTR_CNT_VAL           0x0fff0000      /* current value of RX timer */
+#define SRTR_CNT_VAL_SHIFT     16
+#define SRTR_HZ                        16000           /* SRTR clock frequency */
+
+/* bitmasks for SIO_IR, SIO_IEC and SIO_IES  */
+#define SIO_IR_SA_TX_MT                0x00000001      /* Serial port A TX empty */
+#define SIO_IR_SA_RX_FULL      0x00000002      /* port A RX buf full */
+#define SIO_IR_SA_RX_HIGH      0x00000004      /* port A RX hiwat */
+#define SIO_IR_SA_RX_TIMER     0x00000008      /* port A RX timeout */
+#define SIO_IR_SA_DELTA_DCD    0x00000010      /* port A delta DCD */
+#define SIO_IR_SA_DELTA_CTS    0x00000020      /* port A delta CTS */
+#define SIO_IR_SA_INT          0x00000040      /* port A pass-thru intr */
+#define SIO_IR_SA_TX_EXPLICIT  0x00000080      /* port A explicit TX thru */
+#define SIO_IR_SA_MEMERR       0x00000100      /* port A PCI error */
+#define SIO_IR_SB_TX_MT                0x00000200
+#define SIO_IR_SB_RX_FULL      0x00000400
+#define SIO_IR_SB_RX_HIGH      0x00000800
+#define SIO_IR_SB_RX_TIMER     0x00001000
+#define SIO_IR_SB_DELTA_DCD    0x00002000
+#define SIO_IR_SB_DELTA_CTS    0x00004000
+#define SIO_IR_SB_INT          0x00008000
+#define SIO_IR_SB_TX_EXPLICIT  0x00010000
+#define SIO_IR_SB_MEMERR       0x00020000
+#define SIO_IR_PP_INT          0x00040000      /* P port pass-thru intr */
+#define SIO_IR_PP_INTA         0x00080000      /* PP context A thru */
+#define SIO_IR_PP_INTB         0x00100000      /* PP context B thru */
+#define SIO_IR_PP_MEMERR       0x00200000      /* PP PCI error */
+#define SIO_IR_KBD_INT         0x00400000      /* kbd/mouse intr */
+#define SIO_IR_RT_INT          0x08000000      /* RT output pulse */
+#define SIO_IR_GEN_INT1                0x10000000      /* RT input pulse */
+#define SIO_IR_GEN_INT_SHIFT   28
+
+/* per device interrupt masks */
+#define SIO_IR_SA              (SIO_IR_SA_TX_MT | \
+                                SIO_IR_SA_RX_FULL | \
+                                SIO_IR_SA_RX_HIGH | \
+                                SIO_IR_SA_RX_TIMER | \
+                                SIO_IR_SA_DELTA_DCD | \
+                                SIO_IR_SA_DELTA_CTS | \
+                                SIO_IR_SA_INT | \
+                                SIO_IR_SA_TX_EXPLICIT | \
+                                SIO_IR_SA_MEMERR)
+
+#define SIO_IR_SB              (SIO_IR_SB_TX_MT | \
+                                SIO_IR_SB_RX_FULL | \
+                                SIO_IR_SB_RX_HIGH | \
+                                SIO_IR_SB_RX_TIMER | \
+                                SIO_IR_SB_DELTA_DCD | \
+                                SIO_IR_SB_DELTA_CTS | \
+                                SIO_IR_SB_INT | \
+                                SIO_IR_SB_TX_EXPLICIT | \
+                                SIO_IR_SB_MEMERR)
+
+#define SIO_IR_PP              (SIO_IR_PP_INT | SIO_IR_PP_INTA | \
+                                SIO_IR_PP_INTB | SIO_IR_PP_MEMERR)
+#define SIO_IR_RT              (SIO_IR_RT_INT | SIO_IR_GEN_INT1)
+
+/* bitmasks for SIO_CR */
+#define SIO_CR_CMD_PULSE_SHIFT 15
+#define SIO_CR_SER_A_BASE_SHIFT 1
+#define SIO_CR_SER_B_BASE_SHIFT 8
+#define SIO_CR_ARB_DIAG                0x00380000      /* cur !enet PCI requet (ro) */
+#define SIO_CR_ARB_DIAG_TXA    0x00000000
+#define SIO_CR_ARB_DIAG_RXA    0x00080000
+#define SIO_CR_ARB_DIAG_TXB    0x00100000
+#define SIO_CR_ARB_DIAG_RXB    0x00180000
+#define SIO_CR_ARB_DIAG_PP     0x00200000
+#define SIO_CR_ARB_DIAG_IDLE   0x00400000      /* 0 -> active request (ro) */
+
+/* defs for some of the generic I/O pins */
+#define GPCR_PHY_RESET         0x20    /* pin is output to PHY reset */
+#define GPCR_UARTB_MODESEL     0x40    /* pin is output to port B mode sel */
+#define GPCR_UARTA_MODESEL     0x80    /* pin is output to port A mode sel */
+
+#define GPPR_PHY_RESET_PIN     5       /* GIO pin controlling phy reset */
+#define GPPR_UARTB_MODESEL_PIN 6       /* GIO pin cntrling uartb modeselect */
+#define GPPR_UARTA_MODESEL_PIN 7       /* GIO pin cntrling uarta modeselect */
+
+#endif /* IA64_SN_IOC3_H */
diff --git a/arch/ia64/include/asm/sn/klconfig.h b/arch/ia64/include/asm/sn/klconfig.h
new file mode 100644 (file)
index 0000000..bcbf209
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * 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.
+ *
+ * Derived from IRIX <sys/SN/klconfig.h>.
+ *
+ * Copyright (C) 1992-1997,1999,2001-2004 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (C) 1999 by Ralf Baechle
+ */
+#ifndef _ASM_IA64_SN_KLCONFIG_H
+#define _ASM_IA64_SN_KLCONFIG_H
+
+/*
+ * The KLCONFIG structures store info about the various BOARDs found
+ * during Hardware Discovery. In addition, it stores info about the
+ * components found on the BOARDs.
+ */
+
+typedef s32 klconf_off_t;
+
+
+/* Functions/macros needed to use this structure */
+
+typedef struct kl_config_hdr {
+       char            pad[20];
+       klconf_off_t    ch_board_info;  /* the link list of boards */
+       char            pad0[88];
+} kl_config_hdr_t;
+
+
+#define NODE_OFFSET_TO_LBOARD(nasid,off)        (lboard_t*)(GLOBAL_CAC_ADDR((nasid), (off)))
+
+/*
+ * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD
+ * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to 
+ * the LOCAL/current NODE. REMOTE means it is attached to a different
+ * node.(TBD - Need a way to treat ROUTER boards.)
+ *
+ * There are 2 different structures to represent these boards -
+ * lboard - Local board, rboard - remote board. These 2 structures
+ * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer
+ * Figure below). The first byte of the rboard or lboard structure
+ * is used to find out its type - no unions are used.
+ * If it is a lboard, then the config info of this board will be found
+ * on the local node. (LOCAL NODE BASE + offset value gives pointer to 
+ * the structure.
+ * If it is a rboard, the local structure contains the node number
+ * and the offset of the beginning of the LINKED LIST on the remote node.
+ * The details of the hardware on a remote node can be built locally,
+ * if required, by reading the LINKED LIST on the remote node and 
+ * ignoring all the rboards on that node.
+ *
+ * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the 
+ * First board info on the remote node. The remote node list is 
+ * traversed as the local list, using the REMOTE BASE ADDRESS and not
+ * the local base address and ignoring all rboard values.
+ *
+ * 
+ KLCONFIG
+
+ +------------+      +------------+      +------------+      +------------+
+ |  lboard    |  +-->|   lboard   |  +-->|   rboard   |  +-->|   lboard   |
+ +------------+  |   +------------+  |   +------------+  |   +------------+
+ | board info |  |   | board info |  |   |errinfo,bptr|  |   | board info |
+ +------------+  |   +------------+  |   +------------+  |   +------------+
+ | offset     |--+   |  offset    |--+   |  offset    |--+   |offset=NULL |
+ +------------+      +------------+      +------------+      +------------+
+
+
+ +------------+
+ | board info |
+ +------------+       +--------------------------------+
+ | compt 1    |------>| type, rev, diaginfo, size ...  |  (CPU)
+ +------------+       +--------------------------------+
+ | compt 2    |--+
+ +------------+  |    +--------------------------------+
+ |  ...       |  +--->| type, rev, diaginfo, size ...  |  (MEM_BANK)
+ +------------+       +--------------------------------+
+ | errinfo    |--+
+ +------------+  |    +--------------------------------+
+                 +--->|r/l brd errinfo,compt err flags |
+                      +--------------------------------+
+
+ *
+ * Each BOARD consists of COMPONENTs and the BOARD structure has 
+ * pointers (offsets) to its COMPONENT structure.
+ * The COMPONENT structure has version info, size and speed info, revision,
+ * error info and the NIC info. This structure can accommodate any
+ * BOARD with arbitrary COMPONENT composition.
+ *
+ * The ERRORINFO part of each BOARD has error information
+ * that describes errors about the BOARD itself. It also has flags to
+ * indicate the COMPONENT(s) on the board that have errors. The error 
+ * information specific to the COMPONENT is present in the respective 
+ * COMPONENT structure.
+ *
+ * The ERRORINFO structure is also treated like a COMPONENT, ie. the 
+ * BOARD has pointers(offset) to the ERRORINFO structure. The rboard
+ * structure also has a pointer to the ERRORINFO structure. This is 
+ * the place to store ERRORINFO about a REMOTE NODE, if the HUB on
+ * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where 
+ * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can
+ * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info 
+ * which is present on the REMOTE NODE.(TBD)
+ * REMOTE ERRINFO can be stored on any of the nearest nodes 
+ * or on all the nearest nodes.(TBD)
+ * Like BOARD structures, REMOTE ERRINFO structures can be built locally
+ * using the rboard errinfo pointer.
+ *
+ * In order to get useful information from this Data organization, a set of
+ * interface routines are provided (TBD). The important thing to remember while
+ * manipulating the structures, is that, the NODE number information should
+ * be used. If the NODE is non-zero (remote) then each offset should
+ * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR. 
+ * This includes offsets for BOARDS, COMPONENTS and ERRORINFO.
+ * 
+ * Note that these structures do not provide much info about connectivity.
+ * That info will be part of HWGRAPH, which is an extension of the cfg_t
+ * data structure. (ref IP27prom/cfg.h) It has to be extended to include
+ * the IO part of the Network(TBD).
+ *
+ * The data structures below define the above concepts.
+ */
+
+
+/*
+ * BOARD classes
+ */
+
+#define KLCLASS_MASK   0xf0   
+#define KLCLASS_NONE   0x00
+#define KLCLASS_NODE   0x10             /* CPU, Memory and HUB board */
+#define KLCLASS_CPU    KLCLASS_NODE    
+#define KLCLASS_IO     0x20             /* BaseIO, 4 ch SCSI, ethernet, FDDI 
+                                           and the non-graphics widget boards */
+#define KLCLASS_ROUTER 0x30             /* Router board */
+#define KLCLASS_MIDPLANE 0x40            /* We need to treat this as a board
+                                            so that we can record error info */
+#define KLCLASS_IOBRICK        0x70            /* IP35 iobrick */
+#define KLCLASS_MAX    8               /* Bump this if a new CLASS is added */
+
+#define KLCLASS(_x) ((_x) & KLCLASS_MASK)
+
+
+/*
+ * board types
+ */
+
+#define KLTYPE_MASK    0x0f
+#define KLTYPE(_x)      ((_x) & KLTYPE_MASK)
+
+#define KLTYPE_SNIA    (KLCLASS_CPU | 0x1)
+#define KLTYPE_TIO     (KLCLASS_CPU | 0x2)
+
+#define KLTYPE_ROUTER     (KLCLASS_ROUTER | 0x1)
+#define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
+#define KLTYPE_REPEATER_ROUTER (KLCLASS_ROUTER | 0x4)
+
+#define KLTYPE_IOBRICK_XBOW    (KLCLASS_MIDPLANE | 0x2)
+
+#define KLTYPE_IOBRICK         (KLCLASS_IOBRICK | 0x0)
+#define KLTYPE_NBRICK          (KLCLASS_IOBRICK | 0x4)
+#define KLTYPE_PXBRICK         (KLCLASS_IOBRICK | 0x6)
+#define KLTYPE_IXBRICK         (KLCLASS_IOBRICK | 0x7)
+#define KLTYPE_CGBRICK         (KLCLASS_IOBRICK | 0x8)
+#define KLTYPE_OPUSBRICK       (KLCLASS_IOBRICK | 0x9)
+#define KLTYPE_SABRICK          (KLCLASS_IOBRICK | 0xa)
+#define KLTYPE_IABRICK         (KLCLASS_IOBRICK | 0xb)
+#define KLTYPE_PABRICK          (KLCLASS_IOBRICK | 0xc)
+#define KLTYPE_GABRICK         (KLCLASS_IOBRICK | 0xd)
+
+
+/* 
+ * board structures
+ */
+
+#define MAX_COMPTS_PER_BRD 24
+
+typedef struct lboard_s {
+       klconf_off_t    brd_next_any;     /* Next BOARD */
+       unsigned char   struct_type;      /* type of structure, local or remote */
+       unsigned char   brd_type;         /* type+class */
+       unsigned char   brd_sversion;     /* version of this structure */
+        unsigned char  brd_brevision;    /* board revision */
+        unsigned char  brd_promver;      /* board prom version, if any */
+       unsigned char   brd_flags;        /* Enabled, Disabled etc */
+       unsigned char   brd_slot;         /* slot number */
+       unsigned short  brd_debugsw;      /* Debug switches */
+       geoid_t         brd_geoid;        /* geo id */
+       partid_t        brd_partition;    /* Partition number */
+        unsigned short         brd_diagval;      /* diagnostic value */
+        unsigned short         brd_diagparm;     /* diagnostic parameter */
+        unsigned char  brd_inventory;    /* inventory history */
+        unsigned char  brd_numcompts;    /* Number of components */
+        nic_t          brd_nic;          /* Number in CAN */
+       nasid_t         brd_nasid;        /* passed parameter */
+       klconf_off_t    brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */
+       klconf_off_t    brd_errinfo;      /* Board's error information */
+       struct lboard_s *brd_parent;      /* Logical parent for this brd */
+       char            pad0[4];
+       unsigned char   brd_confidence;   /* confidence that the board is bad */
+       nasid_t         brd_owner;        /* who owns this board */
+       unsigned char   brd_nic_flags;    /* To handle 8 more NICs */
+       char            pad1[24];         /* future expansion */
+       char            brd_name[32];
+       nasid_t         brd_next_same_host; /* host of next brd w/same nasid */
+       klconf_off_t    brd_next_same;    /* Next BOARD with same nasid */
+} lboard_t;
+
+/*
+ * Generic info structure. This stores common info about a 
+ * component.
+ */
+typedef struct klinfo_s {                  /* Generic info */
+        unsigned char   struct_type;       /* type of this structure */
+        unsigned char   struct_version;    /* version of this structure */
+        unsigned char   flags;            /* Enabled, disabled etc */
+        unsigned char   revision;         /* component revision */
+        unsigned short  diagval;          /* result of diagnostics */
+        unsigned short  diagparm;         /* diagnostic parameter */
+        unsigned char   inventory;        /* previous inventory status */
+        unsigned short  partid;                   /* widget part number */
+       nic_t           nic;              /* MUst be aligned properly */
+        unsigned char   physid;           /* physical id of component */
+        unsigned int    virtid;           /* virtual id as seen by system */
+       unsigned char   widid;            /* Widget id - if applicable */
+       nasid_t         nasid;            /* node number - from parent */
+       char            pad1;             /* pad out structure. */
+       char            pad2;             /* pad out structure. */
+       void            *data;
+        klconf_off_t   errinfo;          /* component specific errors */
+        unsigned short  pad3;             /* pci fields have moved over to */
+        unsigned short  pad4;             /* klbri_t */
+} klinfo_t ;
+
+
+static inline lboard_t *find_lboard_next(lboard_t * brd)
+{
+       if (brd && brd->brd_next_any)
+               return NODE_OFFSET_TO_LBOARD(NASID_GET(brd), brd->brd_next_any);
+        return NULL;
+}
+
+#endif /* _ASM_IA64_SN_KLCONFIG_H */
diff --git a/arch/ia64/include/asm/sn/l1.h b/arch/ia64/include/asm/sn/l1.h
new file mode 100644 (file)
index 0000000..344bf44
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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) 1992-1997,2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
+ */
+
+#ifndef _ASM_IA64_SN_L1_H
+#define _ASM_IA64_SN_L1_H
+
+/* brick type response codes */
+#define L1_BRICKTYPE_PX         0x23            /* # */
+#define L1_BRICKTYPE_PE         0x25            /* % */
+#define L1_BRICKTYPE_N_p0       0x26            /* & */
+#define L1_BRICKTYPE_IP45       0x34            /* 4 */
+#define L1_BRICKTYPE_IP41       0x35            /* 5 */
+#define L1_BRICKTYPE_TWISTER    0x36            /* 6 */ /* IP53 & ROUTER */
+#define L1_BRICKTYPE_IX         0x3d            /* = */
+#define L1_BRICKTYPE_IP34       0x61            /* a */
+#define L1_BRICKTYPE_GA                0x62            /* b */
+#define L1_BRICKTYPE_C          0x63            /* c */
+#define L1_BRICKTYPE_OPUS_TIO  0x66            /* f */
+#define L1_BRICKTYPE_I          0x69            /* i */
+#define L1_BRICKTYPE_N          0x6e            /* n */
+#define L1_BRICKTYPE_OPUS       0x6f           /* o */
+#define L1_BRICKTYPE_P          0x70            /* p */
+#define L1_BRICKTYPE_R          0x72            /* r */
+#define L1_BRICKTYPE_CHI_CG     0x76            /* v */
+#define L1_BRICKTYPE_X          0x78            /* x */
+#define L1_BRICKTYPE_X2         0x79            /* y */
+#define L1_BRICKTYPE_SA                0x5e            /* ^ */
+#define L1_BRICKTYPE_PA                0x6a            /* j */
+#define L1_BRICKTYPE_IA                0x6b            /* k */
+#define L1_BRICKTYPE_ATHENA    0x2b            /* + */
+#define L1_BRICKTYPE_DAYTONA   0x7a            /* z */
+#define L1_BRICKTYPE_1932      0x2c            /* . */
+#define L1_BRICKTYPE_191010    0x2e            /* , */
+
+/* board type response codes */
+#define L1_BOARDTYPE_IP69       0x0100          /* CA */
+#define L1_BOARDTYPE_IP63       0x0200          /* CB */
+#define L1_BOARDTYPE_BASEIO     0x0300          /* IB */
+#define L1_BOARDTYPE_PCIE2SLOT  0x0400          /* IC */
+#define L1_BOARDTYPE_PCIX3SLOT  0x0500          /* ID */
+#define L1_BOARDTYPE_PCIXPCIE4SLOT 0x0600       /* IE */
+#define L1_BOARDTYPE_ABACUS     0x0700          /* AB */
+#define L1_BOARDTYPE_DAYTONA    0x0800          /* AD */
+#define L1_BOARDTYPE_INVAL      (-1)            /* invalid brick type */
+
+#endif /* _ASM_IA64_SN_L1_H */
diff --git a/arch/ia64/include/asm/sn/leds.h b/arch/ia64/include/asm/sn/leds.h
new file mode 100644 (file)
index 0000000..66cf8c4
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_LEDS_H
+#define _ASM_IA64_SN_LEDS_H
+
+#include <asm/sn/addrs.h>
+#include <asm/sn/pda.h>
+#include <asm/sn/shub_mmr.h>
+
+#define LED0           (LOCAL_MMR_ADDR(SH_REAL_JUNK_BUS_LED0))
+#define LED_CPU_SHIFT  16
+
+#define LED_CPU_HEARTBEAT      0x01
+#define LED_CPU_ACTIVITY       0x02
+#define LED_ALWAYS_SET         0x00
+
+/*
+ * Basic macros for flashing the LEDS on an SGI SN.
+ */
+
+static __inline__ void
+set_led_bits(u8 value, u8 mask)
+{
+       pda->led_state = (pda->led_state & ~mask) | (value & mask);
+       *pda->led_address = (short) pda->led_state;
+}
+
+#endif /* _ASM_IA64_SN_LEDS_H */
+
diff --git a/arch/ia64/include/asm/sn/module.h b/arch/ia64/include/asm/sn/module.h
new file mode 100644 (file)
index 0000000..734e980
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * 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) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_MODULE_H
+#define _ASM_IA64_SN_MODULE_H
+
+/* parameter for format_module_id() */
+#define MODULE_FORMAT_BRIEF    1
+#define MODULE_FORMAT_LONG     2
+#define MODULE_FORMAT_LCD      3
+
+/*
+ *     Module id format
+ *
+ *     31-16   Rack ID (encoded class, group, number - 16-bit unsigned int)
+ *      15-8   Brick type (8-bit ascii character)
+ *       7-0   Bay (brick position in rack (0-63) - 8-bit unsigned int)
+ *
+ */
+
+/*
+ * Macros for getting the brick type
+ */
+#define MODULE_BTYPE_MASK      0xff00
+#define MODULE_BTYPE_SHFT      8
+#define MODULE_GET_BTYPE(_m)   (((_m) & MODULE_BTYPE_MASK) >> MODULE_BTYPE_SHFT)
+#define MODULE_BT_TO_CHAR(_b)  ((char)(_b))
+#define MODULE_GET_BTCHAR(_m)  (MODULE_BT_TO_CHAR(MODULE_GET_BTYPE(_m)))
+
+/*
+ * Macros for getting the rack ID.
+ */
+#define MODULE_RACK_MASK       0xffff0000
+#define MODULE_RACK_SHFT       16
+#define MODULE_GET_RACK(_m)    (((_m) & MODULE_RACK_MASK) >> MODULE_RACK_SHFT)
+
+/*
+ * Macros for getting the brick position
+ */
+#define MODULE_BPOS_MASK       0x00ff
+#define MODULE_BPOS_SHFT       0
+#define MODULE_GET_BPOS(_m)    (((_m) & MODULE_BPOS_MASK) >> MODULE_BPOS_SHFT)
+
+/*
+ * Macros for encoding and decoding rack IDs
+ * A rack number consists of three parts:
+ *   class (0==CPU/mixed, 1==I/O), group, number
+ *
+ * Rack number is stored just as it is displayed on the screen:
+ * a 3-decimal-digit number.
+ */
+#define RACK_CLASS_DVDR         100
+#define RACK_GROUP_DVDR         10
+#define RACK_NUM_DVDR           1
+
+#define RACK_CREATE_RACKID(_c, _g, _n)  ((_c) * RACK_CLASS_DVDR +       \
+        (_g) * RACK_GROUP_DVDR + (_n) * RACK_NUM_DVDR)
+
+#define RACK_GET_CLASS(_r)              ((_r) / RACK_CLASS_DVDR)
+#define RACK_GET_GROUP(_r)              (((_r) - RACK_GET_CLASS(_r) *   \
+            RACK_CLASS_DVDR) / RACK_GROUP_DVDR)
+#define RACK_GET_NUM(_r)                (((_r) - RACK_GET_CLASS(_r) *   \
+            RACK_CLASS_DVDR - RACK_GET_GROUP(_r) *      \
+            RACK_GROUP_DVDR) / RACK_NUM_DVDR)
+
+/*
+ * Macros for encoding and decoding rack IDs
+ * A rack number consists of three parts:
+ *   class      1 bit, 0==CPU/mixed, 1==I/O
+ *   group      2 bits for CPU/mixed, 3 bits for I/O
+ *   number     3 bits for CPU/mixed, 2 bits for I/O (1 based)
+ */
+#define RACK_GROUP_BITS(_r)     (RACK_GET_CLASS(_r) ? 3 : 2)
+#define RACK_NUM_BITS(_r)       (RACK_GET_CLASS(_r) ? 2 : 3)
+
+#define RACK_CLASS_MASK(_r)     0x20
+#define RACK_CLASS_SHFT(_r)     5
+#define RACK_ADD_CLASS(_r, _c)  \
+        ((_r) |= (_c) << RACK_CLASS_SHFT(_r) & RACK_CLASS_MASK(_r))
+
+#define RACK_GROUP_SHFT(_r)     RACK_NUM_BITS(_r)
+#define RACK_GROUP_MASK(_r)     \
+        ( (((unsigned)1<<RACK_GROUP_BITS(_r)) - 1) << RACK_GROUP_SHFT(_r) )
+#define RACK_ADD_GROUP(_r, _g)  \
+        ((_r) |= (_g) << RACK_GROUP_SHFT(_r) & RACK_GROUP_MASK(_r))
+
+#define RACK_NUM_SHFT(_r)       0
+#define RACK_NUM_MASK(_r)       \
+        ( (((unsigned)1<<RACK_NUM_BITS(_r)) - 1) << RACK_NUM_SHFT(_r) )
+#define RACK_ADD_NUM(_r, _n)    \
+        ((_r) |= ((_n) - 1) << RACK_NUM_SHFT(_r) & RACK_NUM_MASK(_r))
+
+
+/*
+ * Brick type definitions
+ */
+#define MAX_BRICK_TYPES         256 /* brick type is stored as uchar */
+
+extern char brick_types[];
+
+#define MODULE_CBRICK           0
+#define MODULE_RBRICK           1
+#define MODULE_IBRICK           2
+#define MODULE_KBRICK           3
+#define MODULE_XBRICK           4
+#define MODULE_DBRICK           5
+#define MODULE_PBRICK           6
+#define MODULE_NBRICK           7
+#define MODULE_PEBRICK          8
+#define MODULE_PXBRICK          9
+#define MODULE_IXBRICK          10
+#define MODULE_CGBRICK         11
+#define MODULE_OPUSBRICK        12
+#define MODULE_SABRICK         13      /* TIO BringUp Brick */
+#define MODULE_IABRICK         14
+#define MODULE_PABRICK         15
+#define MODULE_GABRICK         16
+#define MODULE_OPUS_TIO                17      /* OPUS TIO Riser */
+
+extern char brick_types[];
+extern void format_module_id(char *, moduleid_t, int);
+
+#endif /* _ASM_IA64_SN_MODULE_H */
diff --git a/arch/ia64/include/asm/sn/mspec.h b/arch/ia64/include/asm/sn/mspec.h
new file mode 100644 (file)
index 0000000..c1d3c50
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *
+ * 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) 2001-2008 Silicon Graphics, Inc.  All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_MSPEC_H
+#define _ASM_IA64_SN_MSPEC_H
+
+#define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */
+
+#define FETCHOP_LOAD           0
+#define FETCHOP_INCREMENT      8
+#define FETCHOP_DECREMENT      16
+#define FETCHOP_CLEAR          24
+
+#define FETCHOP_STORE          0
+#define FETCHOP_AND            24
+#define FETCHOP_OR             32
+
+#define FETCHOP_CLEAR_CACHE    56
+
+#define FETCHOP_LOAD_OP(addr, op) ( \
+         *(volatile long *)((char*) (addr) + (op)))
+
+#define FETCHOP_STORE_OP(addr, op, x) ( \
+         *(volatile long *)((char*) (addr) + (op)) = (long) (x))
+
+#ifdef __KERNEL__
+
+/*
+ * Each Atomic Memory Operation (amo, formerly known as fetchop)
+ * variable is 64 bytes long.  The first 8 bytes are used.  The
+ * remaining 56 bytes are unaddressable due to the operation taking
+ * that portion of the address.
+ *
+ * NOTE: The amo structure _MUST_ be placed in either the first or second
+ * half of the cache line.  The cache line _MUST NOT_ be used for anything
+ * other than additional amo entries.  This is because there are two
+ * addresses which reference the same physical cache line.  One will
+ * be a cached entry with the memory type bits all set.  This address
+ * may be loaded into processor cache.  The amo will be referenced
+ * uncached via the memory special memory type.  If any portion of the
+ * cached cache-line is modified, when that line is flushed, it will
+ * overwrite the uncached value in physical memory and lead to
+ * inconsistency.
+ */
+struct amo {
+        u64 variable;
+        u64 unused[7];
+};
+
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_SN_MSPEC_H */
diff --git a/arch/ia64/include/asm/sn/nodepda.h b/arch/ia64/include/asm/sn/nodepda.h
new file mode 100644 (file)
index 0000000..ee118b9
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_NODEPDA_H
+#define _ASM_IA64_SN_NODEPDA_H
+
+
+#include <asm/irq.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/intr.h>
+#include <asm/sn/bte.h>
+
+/*
+ * NUMA Node-Specific Data structures are defined in this file.
+ * In particular, this is the location of the node PDA.
+ * A pointer to the right node PDA is saved in each CPU PDA.
+ */
+
+/*
+ * Node-specific data structure.
+ *
+ * One of these structures is allocated on each node of a NUMA system.
+ *
+ * This structure provides a convenient way of keeping together 
+ * all per-node data structures. 
+ */
+struct phys_cpuid {
+       short                   nasid;
+       char                    subnode;
+       char                    slice;
+};
+
+struct nodepda_s {
+       void            *pdinfo;        /* Platform-dependent per-node info */
+
+       /*
+        * The BTEs on this node are shared by the local cpus
+        */
+       struct bteinfo_s        bte_if[MAX_BTES_PER_NODE];      /* Virtual Interface */
+       struct timer_list       bte_recovery_timer;
+       spinlock_t              bte_recovery_lock;
+
+       /* 
+        * Array of pointers to the nodepdas for each node.
+        */
+       struct nodepda_s        *pernode_pdaindr[MAX_COMPACT_NODES]; 
+
+       /*
+        * Array of physical cpu identifiers. Indexed by cpuid.
+        */
+       struct phys_cpuid       phys_cpuid[NR_CPUS];
+       spinlock_t              ptc_lock ____cacheline_aligned_in_smp;
+};
+
+typedef struct nodepda_s nodepda_t;
+
+/*
+ * Access Functions for node PDA.
+ * Since there is one nodepda for each node, we need a convenient mechanism
+ * to access these nodepdas without cluttering code with #ifdefs.
+ * The next set of definitions provides this.
+ * Routines are expected to use 
+ *
+ *     sn_nodepda   - to access node PDA for the node on which code is running
+ *     NODEPDA(cnodeid)   - to access node PDA for cnodeid
+ */
+
+DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda);
+#define sn_nodepda             (__get_cpu_var(__sn_nodepda))
+#define        NODEPDA(cnodeid)        (sn_nodepda->pernode_pdaindr[cnodeid])
+
+/*
+ * Check if given a compact node id the corresponding node has all the
+ * cpus disabled. 
+ */
+#define is_headless_node(cnodeid)      (nr_cpus_node(cnodeid) == 0)
+
+#endif /* _ASM_IA64_SN_NODEPDA_H */
diff --git a/arch/ia64/include/asm/sn/pcibr_provider.h b/arch/ia64/include/asm/sn/pcibr_provider.h
new file mode 100644 (file)
index 0000000..da205b7
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * 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) 1992-1997,2000-2006 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
+#define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
+
+#include <asm/sn/intr.h>
+#include <asm/sn/pcibus_provider_defs.h>
+
+/* Workarounds */
+#define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */
+
+#define BUSTYPE_MASK                    0x1
+
+/* Macros given a pcibus structure */
+#define IS_PCIX(ps)     ((ps)->pbi_bridge_mode & BUSTYPE_MASK)
+#define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \
+                asic == PCIIO_ASIC_TYPE_TIOCP)
+#define IS_PIC_SOFT(ps)     (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC)
+#define IS_TIOCP_SOFT(ps)   (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_TIOCP)
+
+
+/*
+ * The different PCI Bridge types supported on the SGI Altix platforms
+ */
+#define PCIBR_BRIDGETYPE_UNKNOWN       -1
+#define PCIBR_BRIDGETYPE_PIC            2
+#define PCIBR_BRIDGETYPE_TIOCP          3
+
+/*
+ * Bridge 64bit Direct Map Attributes
+ */
+#define PCI64_ATTR_PREF                 (1ull << 59)
+#define PCI64_ATTR_PREC                 (1ull << 58)
+#define PCI64_ATTR_VIRTUAL              (1ull << 57)
+#define PCI64_ATTR_BAR                  (1ull << 56)
+#define PCI64_ATTR_SWAP                 (1ull << 55)
+#define PCI64_ATTR_VIRTUAL1             (1ull << 54)
+
+#define PCI32_LOCAL_BASE                0
+#define PCI32_MAPPED_BASE               0x40000000
+#define PCI32_DIRECT_BASE               0x80000000
+
+#define IS_PCI32_MAPPED(x)              ((u64)(x) < PCI32_DIRECT_BASE && \
+                                         (u64)(x) >= PCI32_MAPPED_BASE)
+#define IS_PCI32_DIRECT(x)              ((u64)(x) >= PCI32_MAPPED_BASE)
+
+
+/*
+ * Bridge PMU Address Transaltion Entry Attibutes
+ */
+#define PCI32_ATE_V                     (0x1 << 0)
+#define PCI32_ATE_CO                    (0x1 << 1)     /* PIC ASIC ONLY */
+#define PCI32_ATE_PIO                   (0x1 << 1)     /* TIOCP ASIC ONLY */
+#define PCI32_ATE_MSI                   (0x1 << 2)
+#define PCI32_ATE_PREF                  (0x1 << 3)
+#define PCI32_ATE_BAR                   (0x1 << 4)
+#define PCI32_ATE_ADDR_SHFT             12
+
+#define MINIMAL_ATES_REQUIRED(addr, size) \
+       (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
+
+#define MINIMAL_ATE_FLAG(addr, size) \
+       (MINIMAL_ATES_REQUIRED((u64)addr, size) ? 1 : 0)
+
+/* bit 29 of the pci address is the SWAP bit */
+#define ATE_SWAPSHIFT                   29
+#define ATE_SWAP_ON(x)                  ((x) |= (1 << ATE_SWAPSHIFT))
+#define ATE_SWAP_OFF(x)                 ((x) &= ~(1 << ATE_SWAPSHIFT))
+
+/*
+ * I/O page size
+ */
+#if PAGE_SIZE < 16384
+#define IOPFNSHIFT                      12      /* 4K per mapped page */
+#else
+#define IOPFNSHIFT                      14      /* 16K per mapped page */
+#endif
+
+#define IOPGSIZE                        (1 << IOPFNSHIFT)
+#define IOPG(x)                         ((x) >> IOPFNSHIFT)
+#define IOPGOFF(x)                      ((x) & (IOPGSIZE-1))
+
+#define PCIBR_DEV_SWAP_DIR              (1ull << 19)
+#define PCIBR_CTRL_PAGE_SIZE            (0x1 << 21)
+
+/*
+ * PMU resources.
+ */
+struct ate_resource{
+       u64 *ate;
+       u64 num_ate;
+       u64 lowest_free_index;
+};
+
+struct pcibus_info {
+       struct pcibus_bussoft   pbi_buscommon;   /* common header */
+       u32                pbi_moduleid;
+       short                   pbi_bridge_type;
+       short                   pbi_bridge_mode;
+
+       struct ate_resource     pbi_int_ate_resource;
+       u64                pbi_int_ate_size;
+
+       u64                pbi_dir_xbase;
+       char                    pbi_hub_xid;
+
+       u64                pbi_devreg[8];
+
+       u32             pbi_valid_devices;
+       u32             pbi_enabled_devices;
+
+       spinlock_t              pbi_lock;
+};
+
+extern int  pcibr_init_provider(void);
+extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *);
+extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type);
+extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type);
+extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
+
+/*
+ * prototypes for the bridge asic register access routines in pcibr_reg.c
+ */
+extern void             pcireg_control_bit_clr(struct pcibus_info *, u64);
+extern void             pcireg_control_bit_set(struct pcibus_info *, u64);
+extern u64         pcireg_tflush_get(struct pcibus_info *);
+extern u64         pcireg_intr_status_get(struct pcibus_info *);
+extern void             pcireg_intr_enable_bit_clr(struct pcibus_info *, u64);
+extern void             pcireg_intr_enable_bit_set(struct pcibus_info *, u64);
+extern void             pcireg_intr_addr_addr_set(struct pcibus_info *, int, u64);
+extern void             pcireg_force_intr_set(struct pcibus_info *, int);
+extern u64         pcireg_wrb_flush_get(struct pcibus_info *, int);
+extern void             pcireg_int_ate_set(struct pcibus_info *, int, u64);
+extern u64 __iomem *   pcireg_int_ate_addr(struct pcibus_info *, int);
+extern void            pcibr_force_interrupt(struct sn_irq_info *sn_irq_info);
+extern void            pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info);
+extern int             pcibr_ate_alloc(struct pcibus_info *, int);
+extern void            pcibr_ate_free(struct pcibus_info *, int);
+extern void            ate_write(struct pcibus_info *, int, int, u64);
+extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
+                                void *resp, char **ssdt);
+extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
+                                 int action, void *resp);
+extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
+#endif
diff --git a/arch/ia64/include/asm/sn/pcibus_provider_defs.h b/arch/ia64/include/asm/sn/pcibus_provider_defs.h
new file mode 100644 (file)
index 0000000..8f7c83d
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
+#define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
+
+/*
+ * SN pci asic types.  Do not ever renumber these or reuse values.  The
+ * values must agree with what prom thinks they are.
+ */
+
+#define PCIIO_ASIC_TYPE_UNKNOWN        0
+#define PCIIO_ASIC_TYPE_PPB    1
+#define PCIIO_ASIC_TYPE_PIC    2
+#define PCIIO_ASIC_TYPE_TIOCP  3
+#define PCIIO_ASIC_TYPE_TIOCA  4
+#define PCIIO_ASIC_TYPE_TIOCE  5
+
+#define PCIIO_ASIC_MAX_TYPES   6
+
+/*
+ * Common pciio bus provider data.  There should be one of these as the
+ * first field in any pciio based provider soft structure (e.g. pcibr_soft
+ * tioca_soft, etc).
+ */
+
+struct pcibus_bussoft {
+       u32             bs_asic_type;   /* chipset type */
+       u32             bs_xid;         /* xwidget id */
+       u32             bs_persist_busnum; /* Persistent Bus Number */
+       u32             bs_persist_segment; /* Segment Number */
+       u64             bs_legacy_io;   /* legacy io pio addr */
+       u64             bs_legacy_mem;  /* legacy mem pio addr */
+       u64             bs_base;        /* widget base */
+       struct xwidget_info     *bs_xwidget_info;
+};
+
+struct pci_controller;
+/*
+ * SN pci bus indirection
+ */
+
+struct sn_pcibus_provider {
+       dma_addr_t      (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags);
+       dma_addr_t      (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags);
+       void            (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
+       void *          (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *);
+       void            (*force_interrupt)(struct sn_irq_info *);
+       void            (*target_interrupt)(struct sn_irq_info *);
+};
+
+/*
+ * Flags used by the map interfaces
+ * bits 3:0 specifies format of passed in address
+ * bit  4   specifies that address is to be used for MSI
+ */
+
+#define SN_DMA_ADDRTYPE(x)     ((x) & 0xf)
+#define     SN_DMA_ADDR_PHYS   1       /* address is an xio address. */
+#define     SN_DMA_ADDR_XIO    2       /* address is phys memory */
+#define SN_DMA_MSI             0x10    /* Bus address is to be used for MSI */
+
+extern struct sn_pcibus_provider *sn_pci_provider[];
+#endif                         /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */
diff --git a/arch/ia64/include/asm/sn/pcidev.h b/arch/ia64/include/asm/sn/pcidev.h
new file mode 100644 (file)
index 0000000..1c2382c
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * 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) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PCI_PCIDEV_H
+#define _ASM_IA64_SN_PCI_PCIDEV_H
+
+#include <linux/pci.h>
+
+/*
+ * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to
+ * the pcidev_info structs for all devices under a controller, we keep a
+ * list of pcidev_info under pci_controller->platform_data.
+ */
+struct sn_platform_data {
+       void *provider_soft;
+       struct list_head pcidev_info;
+};
+
+#define SN_PLATFORM_DATA(busdev) \
+       ((struct sn_platform_data *)(PCI_CONTROLLER(busdev)->platform_data))
+
+#define SN_PCIDEV_INFO(dev)    sn_pcidev_info_get(dev)
+
+/*
+ * Given a pci_bus, return the sn pcibus_bussoft struct.  Note that
+ * this only works for root busses, not for busses represented by PPB's.
+ */
+
+#define SN_PCIBUS_BUSSOFT(pci_bus) \
+       ((struct pcibus_bussoft *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
+
+#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
+       ((struct pcibus_info *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
+/*
+ * Given a struct pci_dev, return the sn pcibus_bussoft struct.  Note
+ * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
+ * due to possible PPB's in the path.
+ */
+
+#define SN_PCIDEV_BUSSOFT(pci_dev) \
+       (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info)
+
+#define SN_PCIDEV_BUSPROVIDER(pci_dev) \
+       (SN_PCIDEV_INFO(pci_dev)->pdi_provider)
+
+#define PCIIO_BUS_NONE 255      /* bus 255 reserved */
+#define PCIIO_SLOT_NONE 255
+#define PCIIO_FUNC_NONE 255
+#define PCIIO_VENDOR_ID_NONE   (-1)
+
+struct pcidev_info {
+       u64             pdi_pio_mapped_addr[7]; /* 6 BARs PLUS 1 ROM */
+       u64             pdi_slot_host_handle;   /* Bus and devfn Host pci_dev */
+
+       struct pcibus_bussoft   *pdi_pcibus_info;       /* Kernel common bus soft */
+       struct pcidev_info      *pdi_host_pcidev_info;  /* Kernel Host pci_dev */
+       struct pci_dev          *pdi_linux_pcidev;      /* Kernel pci_dev */
+
+       struct sn_irq_info      *pdi_sn_irq_info;
+       struct sn_pcibus_provider *pdi_provider;        /* sn pci ops */
+       struct pci_dev          *host_pci_dev;          /* host bus link */
+       struct list_head        pdi_list;               /* List of pcidev_info */
+};
+
+extern void sn_irq_fixup(struct pci_dev *pci_dev,
+                        struct sn_irq_info *sn_irq_info);
+extern void sn_irq_unfixup(struct pci_dev *pci_dev);
+extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
+extern void sn_bus_fixup(struct pci_bus *);
+extern void sn_acpi_bus_fixup(struct pci_bus *);
+extern void sn_common_bus_fixup(struct pci_bus *, struct pcibus_bussoft *);
+extern void sn_bus_store_sysdata(struct pci_dev *dev);
+extern void sn_bus_free_sysdata(void);
+extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
+extern void sn_io_slot_fixup(struct pci_dev *);
+extern void sn_acpi_slot_fixup(struct pci_dev *);
+extern void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *,
+                             struct sn_irq_info *);
+extern void sn_pci_unfixup_slot(struct pci_dev *dev);
+extern void sn_irq_lh_init(void);
+#endif                         /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/arch/ia64/include/asm/sn/pda.h b/arch/ia64/include/asm/sn/pda.h
new file mode 100644 (file)
index 0000000..1c5108d
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PDA_H
+#define _ASM_IA64_SN_PDA_H
+
+#include <linux/cache.h>
+#include <asm/percpu.h>
+#include <asm/system.h>
+
+
+/*
+ * CPU-specific data structure.
+ *
+ * One of these structures is allocated for each cpu of a NUMA system.
+ *
+ * This structure provides a convenient way of keeping together 
+ * all SN per-cpu data structures. 
+ */
+
+typedef struct pda_s {
+
+       /*
+        * Support for SN LEDs
+        */
+       volatile short  *led_address;
+       u8              led_state;
+       u8              hb_state;       /* supports blinking heartbeat leds */
+       unsigned int    hb_count;
+
+       unsigned int    idle_flag;
+       
+       volatile unsigned long *bedrock_rev_id;
+       volatile unsigned long *pio_write_status_addr;
+       unsigned long pio_write_status_val;
+       volatile unsigned long *pio_shub_war_cam_addr;
+
+       unsigned long   sn_in_service_ivecs[4];
+       int             sn_lb_int_war_ticks;
+       int             sn_last_irq;
+       int             sn_first_irq;
+} pda_t;
+
+
+#define CACHE_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
+
+/*
+ * PDA
+ * Per-cpu private data area for each cpu. The PDA is located immediately after
+ * the IA64 cpu_data area. A full page is allocated for the cp_data area for each
+ * cpu but only a small amout of the page is actually used. We put the SNIA PDA
+ * in the same page as the cpu_data area. Note that there is a check in the setup
+ * code to verify that we don't overflow the page.
+ *
+ * Seems like we should should cache-line align the pda so that any changes in the
+ * size of the cpu_data area don't change cache layout. Should we align to 32, 64, 128
+ * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later.
+ */
+DECLARE_PER_CPU(struct pda_s, pda_percpu);
+
+#define pda            (&__ia64_per_cpu_var(pda_percpu))
+
+#define pdacpu(cpu)    (&per_cpu(pda_percpu, cpu))
+
+#endif /* _ASM_IA64_SN_PDA_H */
diff --git a/arch/ia64/include/asm/sn/pic.h b/arch/ia64/include/asm/sn/pic.h
new file mode 100644 (file)
index 0000000..5f9da5f
--- /dev/null
@@ -0,0 +1,261 @@
+/*
+ * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PCI_PIC_H
+#define _ASM_IA64_SN_PCI_PIC_H
+
+/*
+ * PIC AS DEVICE ZERO
+ * ------------------
+ *
+ * PIC handles PCI/X busses.  PCI/X requires that the 'bridge' (i.e. PIC)
+ * be designated as 'device 0'.   That is a departure from earlier SGI
+ * PCI bridges.  Because of that we use config space 1 to access the
+ * config space of the first actual PCI device on the bus.
+ * Here's what the PIC manual says:
+ *
+ *     The current PCI-X bus specification now defines that the parent
+ *     hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC
+ *     reduced the total number of devices from 8 to 4 and removed the
+ *     device registers and windows, now only supporting devices 0,1,2, and
+ *     3. PIC did leave all 8 configuration space windows. The reason was
+ *     there was nothing to gain by removing them. Here in lies the problem.
+ *     The device numbering we do using 0 through 3 is unrelated to the device
+ *     numbering which PCI-X requires in configuration space. In the past we
+ *     correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc.
+ *     PCI-X requires we start a 1, not 0 and currently the PX brick
+ *     does associate our:
+ *
+ *         device 0 with configuration space window 1,
+ *         device 1 with configuration space window 2,
+ *         device 2 with configuration space window 3,
+ *         device 3 with configuration space window 4.
+ *
+ * The net effect is that all config space access are off-by-one with
+ * relation to other per-slot accesses on the PIC.
+ * Here is a table that shows some of that:
+ *
+ *                               Internal Slot#
+ *           |
+ *           |     0         1        2         3
+ * ----------|---------------------------------------
+ * config    |  0x21000   0x22000  0x23000   0x24000
+ *           |
+ * even rrb  |  0[0]      n/a      1[0]      n/a       [] == implied even/odd
+ *           |
+ * odd rrb   |  n/a       0[1]     n/a       1[1]
+ *           |
+ * int dev   |  00       01        10        11
+ *           |
+ * ext slot# |  1        2         3         4
+ * ----------|---------------------------------------
+ */
+
+#define PIC_ATE_TARGETID_SHFT           8
+#define PIC_HOST_INTR_ADDR              0x0000FFFFFFFFFFFFUL
+#define PIC_PCI64_ATTR_TARG_SHFT        60
+
+
+/*****************************************************************************
+ *********************** PIC MMR structure mapping ***************************
+ *****************************************************************************/
+
+/* NOTE: PIC WAR. PV#854697.  PIC does not allow writes just to [31:0]
+ * of a 64-bit register.  When writing PIC registers, always write the
+ * entire 64 bits.
+ */
+
+struct pic {
+
+    /* 0x000000-0x00FFFF -- Local Registers */
+
+    /* 0x000000-0x000057 -- Standard Widget Configuration */
+    u64                p_wid_id;                       /* 0x000000 */
+    u64                p_wid_stat;                     /* 0x000008 */
+    u64                p_wid_err_upper;                /* 0x000010 */
+    u64                p_wid_err_lower;                /* 0x000018 */
+    #define p_wid_err p_wid_err_lower
+    u64                p_wid_control;                  /* 0x000020 */
+    u64                p_wid_req_timeout;              /* 0x000028 */
+    u64                p_wid_int_upper;                /* 0x000030 */
+    u64                p_wid_int_lower;                /* 0x000038 */
+    #define p_wid_int p_wid_int_lower
+    u64                p_wid_err_cmdword;              /* 0x000040 */
+    u64                p_wid_llp;                      /* 0x000048 */
+    u64                p_wid_tflush;                   /* 0x000050 */
+
+    /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
+    u64                p_wid_aux_err;                  /* 0x000058 */
+    u64                p_wid_resp_upper;               /* 0x000060 */
+    u64                p_wid_resp_lower;               /* 0x000068 */
+    #define p_wid_resp p_wid_resp_lower
+    u64                p_wid_tst_pin_ctrl;             /* 0x000070 */
+    u64                p_wid_addr_lkerr;               /* 0x000078 */
+
+    /* 0x000080-0x00008F -- PMU & MAP */
+    u64                p_dir_map;                      /* 0x000080 */
+    u64                _pad_000088;                    /* 0x000088 */
+
+    /* 0x000090-0x00009F -- SSRAM */
+    u64                p_map_fault;                    /* 0x000090 */
+    u64                _pad_000098;                    /* 0x000098 */
+
+    /* 0x0000A0-0x0000AF -- Arbitration */
+    u64                p_arb;                          /* 0x0000A0 */
+    u64                _pad_0000A8;                    /* 0x0000A8 */
+
+    /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
+    u64                p_ate_parity_err;               /* 0x0000B0 */
+    u64                _pad_0000B8;                    /* 0x0000B8 */
+
+    /* 0x0000C0-0x0000FF -- PCI/GIO */
+    u64                p_bus_timeout;                  /* 0x0000C0 */
+    u64                p_pci_cfg;                      /* 0x0000C8 */
+    u64                p_pci_err_upper;                /* 0x0000D0 */
+    u64                p_pci_err_lower;                /* 0x0000D8 */
+    #define p_pci_err p_pci_err_lower
+    u64                _pad_0000E0[4];                 /* 0x0000{E0..F8} */
+
+    /* 0x000100-0x0001FF -- Interrupt */
+    u64                p_int_status;                   /* 0x000100 */
+    u64                p_int_enable;                   /* 0x000108 */
+    u64                p_int_rst_stat;                 /* 0x000110 */
+    u64                p_int_mode;                     /* 0x000118 */
+    u64                p_int_device;                   /* 0x000120 */
+    u64                p_int_host_err;                 /* 0x000128 */
+    u64                p_int_addr[8];                  /* 0x0001{30,,,68} */
+    u64                p_err_int_view;                 /* 0x000170 */
+    u64                p_mult_int;                     /* 0x000178 */
+    u64                p_force_always[8];              /* 0x0001{80,,,B8} */
+    u64                p_force_pin[8];                 /* 0x0001{C0,,,F8} */
+
+    /* 0x000200-0x000298 -- Device */
+    u64                p_device[4];                    /* 0x0002{00,,,18} */
+    u64                _pad_000220[4];                 /* 0x0002{20,,,38} */
+    u64                p_wr_req_buf[4];                /* 0x0002{40,,,58} */
+    u64                _pad_000260[4];                 /* 0x0002{60,,,78} */
+    u64                p_rrb_map[2];                   /* 0x0002{80,,,88} */
+    #define p_even_resp p_rrb_map[0]                   /* 0x000280 */
+    #define p_odd_resp  p_rrb_map[1]                   /* 0x000288 */
+    u64                p_resp_status;                  /* 0x000290 */
+    u64                p_resp_clear;                   /* 0x000298 */
+
+    u64                _pad_0002A0[12];                /* 0x0002{A0..F8} */
+
+    /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
+    struct {
+       u64     upper;                          /* 0x0003{00,,,F0} */
+       u64     lower;                          /* 0x0003{08,,,F8} */
+    } p_buf_addr_match[16];
+
+    /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
+    struct {
+       u64     flush_w_touch;                  /* 0x000{400,,,5C0} */
+       u64     flush_wo_touch;                 /* 0x000{408,,,5C8} */
+       u64     inflight;                       /* 0x000{410,,,5D0} */
+       u64     prefetch;                       /* 0x000{418,,,5D8} */
+       u64     total_pci_retry;                /* 0x000{420,,,5E0} */
+       u64     max_pci_retry;                  /* 0x000{428,,,5E8} */
+       u64     max_latency;                    /* 0x000{430,,,5F0} */
+       u64     clear_all;                      /* 0x000{438,,,5F8} */
+    } p_buf_count[8];
+
+
+    /* 0x000600-0x0009FF -- PCI/X registers */
+    u64                p_pcix_bus_err_addr;            /* 0x000600 */
+    u64                p_pcix_bus_err_attr;            /* 0x000608 */
+    u64                p_pcix_bus_err_data;            /* 0x000610 */
+    u64                p_pcix_pio_split_addr;          /* 0x000618 */
+    u64                p_pcix_pio_split_attr;          /* 0x000620 */
+    u64                p_pcix_dma_req_err_attr;        /* 0x000628 */
+    u64                p_pcix_dma_req_err_addr;        /* 0x000630 */
+    u64                p_pcix_timeout;                 /* 0x000638 */
+
+    u64                _pad_000640[120];               /* 0x000{640,,,9F8} */
+
+    /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
+    struct {
+       u64     p_buf_addr;                     /* 0x000{A00,,,AF0} */
+       u64     p_buf_attr;                     /* 0X000{A08,,,AF8} */
+    } p_pcix_read_buf_64[16];
+
+    struct {
+       u64     p_buf_addr;                     /* 0x000{B00,,,BE0} */
+       u64     p_buf_attr;                     /* 0x000{B08,,,BE8} */
+       u64     p_buf_valid;                    /* 0x000{B10,,,BF0} */
+       u64     __pad1;                         /* 0x000{B18,,,BF8} */
+    } p_pcix_write_buf_64[8];
+
+    /* End of Local Registers -- Start of Address Map space */
+
+    char               _pad_000c00[0x010000 - 0x000c00];
+
+    /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
+    u64                p_int_ate_ram[1024];            /* 0x010000-0x011fff */
+
+    /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
+    u64                p_int_ate_ram_mp[1024];         /* 0x012000-0x013fff */
+
+    char               _pad_014000[0x18000 - 0x014000];
+
+    /* 0x18000-0x197F8 -- PIC Write Request Ram */
+    u64                p_wr_req_lower[256];            /* 0x18000 - 0x187F8 */
+    u64                p_wr_req_upper[256];            /* 0x18800 - 0x18FF8 */
+    u64                p_wr_req_parity[256];           /* 0x19000 - 0x197F8 */
+
+    char               _pad_019800[0x20000 - 0x019800];
+
+    /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
+    union {
+       u8              c[0x1000 / 1];                  /* 0x02{0000,,,7FFF} */
+       u16     s[0x1000 / 2];                  /* 0x02{0000,,,7FFF} */
+       u32     l[0x1000 / 4];                  /* 0x02{0000,,,7FFF} */
+       u64     d[0x1000 / 8];                  /* 0x02{0000,,,7FFF} */
+       union {
+           u8  c[0x100 / 1];
+           u16 s[0x100 / 2];
+           u32 l[0x100 / 4];
+           u64 d[0x100 / 8];
+       } f[8];
+    } p_type0_cfg_dev[8];                              /* 0x02{0000,,,7FFF} */
+
+    /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
+    union {
+       u8              c[0x1000 / 1];                  /* 0x028000-0x029000 */
+       u16     s[0x1000 / 2];                  /* 0x028000-0x029000 */
+       u32     l[0x1000 / 4];                  /* 0x028000-0x029000 */
+       u64     d[0x1000 / 8];                  /* 0x028000-0x029000 */
+       union {
+           u8  c[0x100 / 1];
+           u16 s[0x100 / 2];
+           u32 l[0x100 / 4];
+           u64 d[0x100 / 8];
+       } f[8];
+    } p_type1_cfg;                                     /* 0x028000-0x029000 */
+
+    char               _pad_029000[0x030000-0x029000];
+
+    /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
+    union {
+       u8              c[8 / 1];
+       u16     s[8 / 2];
+       u32     l[8 / 4];
+       u64     d[8 / 8];
+    } p_pci_iack;                                      /* 0x030000-0x030007 */
+
+    char               _pad_030007[0x040000-0x030008];
+
+    /* 0x040000-0x030007 -- PCIX Special Cycle */
+    union {
+       u8              c[8 / 1];
+       u16     s[8 / 2];
+       u32     l[8 / 4];
+       u64     d[8 / 8];
+    } p_pcix_cycle;                                    /* 0x040000-0x040007 */
+};
+
+#endif                          /* _ASM_IA64_SN_PCI_PIC_H */
diff --git a/arch/ia64/include/asm/sn/rw_mmr.h b/arch/ia64/include/asm/sn/rw_mmr.h
new file mode 100644 (file)
index 0000000..2d78f4c
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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) 2002-2006 Silicon Graphics, Inc.  All Rights Reserved.
+ */
+#ifndef _ASM_IA64_SN_RW_MMR_H
+#define _ASM_IA64_SN_RW_MMR_H
+
+
+/*
+ * This file that access MMRs via uncached physical addresses.
+ *     pio_phys_read_mmr  - read an MMR
+ *     pio_phys_write_mmr - write an MMR
+ *     pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0
+ *             Second MMR will be skipped if address is NULL
+ *
+ * Addresses passed to these routines should be uncached physical addresses
+ * ie., 0x80000....
+ */
+
+
+extern long pio_phys_read_mmr(volatile long *mmr); 
+extern void pio_phys_write_mmr(volatile long *mmr, long val);
+extern void pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2); 
+
+#endif /* _ASM_IA64_SN_RW_MMR_H */
diff --git a/arch/ia64/include/asm/sn/shub_mmr.h b/arch/ia64/include/asm/sn/shub_mmr.h
new file mode 100644 (file)
index 0000000..7de1d1d
--- /dev/null
@@ -0,0 +1,502 @@
+/*
+ *
+ * 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) 2001-2005 Silicon Graphics, Inc.  All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_SHUB_MMR_H
+#define _ASM_IA64_SN_SHUB_MMR_H
+
+/* ==================================================================== */
+/*                        Register "SH_IPI_INT"                         */
+/*               SHub Inter-Processor Interrupt Registers               */
+/* ==================================================================== */
+#define SH1_IPI_INT                    __IA64_UL_CONST(0x0000000110000380)
+#define SH2_IPI_INT                    __IA64_UL_CONST(0x0000000010000380)
+
+/*   SH_IPI_INT_TYPE                                                    */
+/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
+#define SH_IPI_INT_TYPE_SHFT                           0
+#define SH_IPI_INT_TYPE_MASK           __IA64_UL_CONST(0x0000000000000007)
+
+/*   SH_IPI_INT_AGT                                                     */
+/*   Description:  Agent, must be 0 for SHub                            */
+#define SH_IPI_INT_AGT_SHFT                            3
+#define SH_IPI_INT_AGT_MASK            __IA64_UL_CONST(0x0000000000000008)
+
+/*   SH_IPI_INT_PID                                                     */
+/*   Description:  Processor ID, same setting as on targeted McKinley  */
+#define SH_IPI_INT_PID_SHFT                            4
+#define SH_IPI_INT_PID_MASK            __IA64_UL_CONST(0x00000000000ffff0)
+
+/*   SH_IPI_INT_BASE                                                    */
+/*   Description:  Optional interrupt vector area, 2MB aligned          */
+#define SH_IPI_INT_BASE_SHFT                           21
+#define SH_IPI_INT_BASE_MASK           __IA64_UL_CONST(0x0003ffffffe00000)
+
+/*   SH_IPI_INT_IDX                                                     */
+/*   Description:  Targeted McKinley interrupt vector                   */
+#define SH_IPI_INT_IDX_SHFT                            52
+#define SH_IPI_INT_IDX_MASK            __IA64_UL_CONST(0x0ff0000000000000)
+
+/*   SH_IPI_INT_SEND                                                    */
+/*   Description:  Send Interrupt Message to PI, This generates a puls  */
+#define SH_IPI_INT_SEND_SHFT                           63
+#define SH_IPI_INT_SEND_MASK           __IA64_UL_CONST(0x8000000000000000)
+
+/* ==================================================================== */
+/*                     Register "SH_EVENT_OCCURRED"                     */
+/*                    SHub Interrupt Event Occurred                     */
+/* ==================================================================== */
+#define SH1_EVENT_OCCURRED             __IA64_UL_CONST(0x0000000110010000)
+#define SH1_EVENT_OCCURRED_ALIAS       __IA64_UL_CONST(0x0000000110010008)
+#define SH2_EVENT_OCCURRED             __IA64_UL_CONST(0x0000000010010000)
+#define SH2_EVENT_OCCURRED_ALIAS       __IA64_UL_CONST(0x0000000010010008)
+
+/* ==================================================================== */
+/*                     Register "SH_PI_CAM_CONTROL"                     */
+/*                      CRB CAM MMR Access Control                      */
+/* ==================================================================== */
+#define SH1_PI_CAM_CONTROL             __IA64_UL_CONST(0x0000000120050300)
+
+/* ==================================================================== */
+/*                        Register "SH_SHUB_ID"                         */
+/*                            SHub ID Number                            */
+/* ==================================================================== */
+#define SH1_SHUB_ID                    __IA64_UL_CONST(0x0000000110060580)
+#define SH1_SHUB_ID_REVISION_SHFT                      28
+#define SH1_SHUB_ID_REVISION_MASK      __IA64_UL_CONST(0x00000000f0000000)
+
+/* ==================================================================== */
+/*                          Register "SH_RTC"                           */
+/*                           Real-time Clock                            */
+/* ==================================================================== */
+#define SH1_RTC                                __IA64_UL_CONST(0x00000001101c0000)
+#define SH2_RTC                                __IA64_UL_CONST(0x00000002101c0000)
+#define SH_RTC_MASK                    __IA64_UL_CONST(0x007fffffffffffff)
+
+/* ==================================================================== */
+/*                   Register "SH_PIO_WRITE_STATUS_0|1"                 */
+/*                      PIO Write Status for CPU 0 & 1                  */
+/* ==================================================================== */
+#define SH1_PIO_WRITE_STATUS_0         __IA64_UL_CONST(0x0000000120070200)
+#define SH1_PIO_WRITE_STATUS_1         __IA64_UL_CONST(0x0000000120070280)
+#define SH2_PIO_WRITE_STATUS_0         __IA64_UL_CONST(0x0000000020070200)
+#define SH2_PIO_WRITE_STATUS_1         __IA64_UL_CONST(0x0000000020070280)
+#define SH2_PIO_WRITE_STATUS_2         __IA64_UL_CONST(0x0000000020070300)
+#define SH2_PIO_WRITE_STATUS_3         __IA64_UL_CONST(0x0000000020070380)
+
+/*   SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK                               */
+/*   Description:  Deadlock response detected                           */
+#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT                1
+#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK \
+                                       __IA64_UL_CONST(0x0000000000000002)
+
+/*   SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT                          */
+/*   Description:  Count of currently pending PIO writes                */
+#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_SHFT   56
+#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK \
+                                       __IA64_UL_CONST(0x3f00000000000000)
+
+/* ==================================================================== */
+/*                Register "SH_PIO_WRITE_STATUS_0_ALIAS"                */
+/* ==================================================================== */
+#define SH1_PIO_WRITE_STATUS_0_ALIAS   __IA64_UL_CONST(0x0000000120070208)
+#define SH2_PIO_WRITE_STATUS_0_ALIAS   __IA64_UL_CONST(0x0000000020070208)
+
+/* ==================================================================== */
+/*                     Register "SH_EVENT_OCCURRED"                     */
+/*                    SHub Interrupt Event Occurred                     */
+/* ==================================================================== */
+/*   SH_EVENT_OCCURRED_UART_INT                                         */
+/*   Description:  Pending Junk Bus UART Interrupt                      */
+#define SH_EVENT_OCCURRED_UART_INT_SHFT                        20
+#define SH_EVENT_OCCURRED_UART_INT_MASK        __IA64_UL_CONST(0x0000000000100000)
+
+/*   SH_EVENT_OCCURRED_IPI_INT                                          */
+/*   Description:  Pending IPI Interrupt                                */
+#define SH_EVENT_OCCURRED_IPI_INT_SHFT                 28
+#define SH_EVENT_OCCURRED_IPI_INT_MASK __IA64_UL_CONST(0x0000000010000000)
+
+/*   SH_EVENT_OCCURRED_II_INT0                                          */
+/*   Description:  Pending II 0 Interrupt                               */
+#define SH_EVENT_OCCURRED_II_INT0_SHFT                 29
+#define SH_EVENT_OCCURRED_II_INT0_MASK __IA64_UL_CONST(0x0000000020000000)
+
+/*   SH_EVENT_OCCURRED_II_INT1                                          */
+/*   Description:  Pending II 1 Interrupt                               */
+#define SH_EVENT_OCCURRED_II_INT1_SHFT                 30
+#define SH_EVENT_OCCURRED_II_INT1_MASK __IA64_UL_CONST(0x0000000040000000)
+
+/*   SH2_EVENT_OCCURRED_EXTIO_INT2                                      */
+/*   Description:  Pending SHUB 2 EXT IO INT2                           */
+#define SH2_EVENT_OCCURRED_EXTIO_INT2_SHFT             33
+#define SH2_EVENT_OCCURRED_EXTIO_INT2_MASK __IA64_UL_CONST(0x0000000200000000)
+
+/*   SH2_EVENT_OCCURRED_EXTIO_INT3                                      */
+/*   Description:  Pending SHUB 2 EXT IO INT3                           */
+#define SH2_EVENT_OCCURRED_EXTIO_INT3_SHFT             34
+#define SH2_EVENT_OCCURRED_EXTIO_INT3_MASK __IA64_UL_CONST(0x0000000400000000)
+
+#define SH_ALL_INT_MASK \
+       (SH_EVENT_OCCURRED_UART_INT_MASK | SH_EVENT_OCCURRED_IPI_INT_MASK | \
+        SH_EVENT_OCCURRED_II_INT0_MASK | SH_EVENT_OCCURRED_II_INT1_MASK | \
+        SH_EVENT_OCCURRED_II_INT1_MASK | SH2_EVENT_OCCURRED_EXTIO_INT2_MASK | \
+        SH2_EVENT_OCCURRED_EXTIO_INT3_MASK)
+
+
+/* ==================================================================== */
+/*                         LEDS                                         */
+/* ==================================================================== */
+#define SH1_REAL_JUNK_BUS_LED0                 0x7fed00000UL
+#define SH1_REAL_JUNK_BUS_LED1                 0x7fed10000UL
+#define SH1_REAL_JUNK_BUS_LED2                 0x7fed20000UL
+#define SH1_REAL_JUNK_BUS_LED3                 0x7fed30000UL
+
+#define SH2_REAL_JUNK_BUS_LED0                 0xf0000000UL
+#define SH2_REAL_JUNK_BUS_LED1                 0xf0010000UL
+#define SH2_REAL_JUNK_BUS_LED2                 0xf0020000UL
+#define SH2_REAL_JUNK_BUS_LED3                 0xf0030000UL
+
+/* ==================================================================== */
+/*                         Register "SH1_PTC_0"                         */
+/*       Puge Translation Cache Message Configuration Information       */
+/* ==================================================================== */
+#define SH1_PTC_0                      __IA64_UL_CONST(0x00000001101a0000)
+
+/*   SH1_PTC_0_A                                                        */
+/*   Description:  Type                                                 */
+#define SH1_PTC_0_A_SHFT                               0
+
+/*   SH1_PTC_0_PS                                                       */
+/*   Description:  Page Size                                            */
+#define SH1_PTC_0_PS_SHFT                              2
+
+/*   SH1_PTC_0_RID                                                      */
+/*   Description:  Region ID                                            */
+#define SH1_PTC_0_RID_SHFT                             8
+
+/*   SH1_PTC_0_START                                                    */
+/*   Description:  Start                                                */
+#define SH1_PTC_0_START_SHFT                           63
+
+/* ==================================================================== */
+/*                         Register "SH1_PTC_1"                         */
+/*       Puge Translation Cache Message Configuration Information       */
+/* ==================================================================== */
+#define SH1_PTC_1                      __IA64_UL_CONST(0x00000001101a0080)
+
+/*   SH1_PTC_1_START                                                    */
+/*   Description:  PTC_1 Start                                          */
+#define SH1_PTC_1_START_SHFT                           63
+
+/* ==================================================================== */
+/*                         Register "SH2_PTC"                           */
+/*       Puge Translation Cache Message Configuration Information       */
+/* ==================================================================== */
+#define SH2_PTC                                __IA64_UL_CONST(0x0000000170000000)
+
+/*   SH2_PTC_A                                                          */
+/*   Description:  Type                                                 */
+#define SH2_PTC_A_SHFT                                 0
+
+/*   SH2_PTC_PS                                                         */
+/*   Description:  Page Size                                            */
+#define SH2_PTC_PS_SHFT                                        2
+
+/*   SH2_PTC_RID                                                      */
+/*   Description:  Region ID                                            */
+#define SH2_PTC_RID_SHFT                               4
+
+/*   SH2_PTC_START                                                      */
+/*   Description:  Start                                                */
+#define SH2_PTC_START_SHFT                             63
+
+/*   SH2_PTC_ADDR_RID                                                   */
+/*   Description:  Region ID                                            */
+#define SH2_PTC_ADDR_SHFT                              4
+#define SH2_PTC_ADDR_MASK              __IA64_UL_CONST(0x1ffffffffffff000)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC1_INT_CONFIG"                     */
+/*                SHub RTC 1 Interrupt Config Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC1_INT_CONFIG            __IA64_UL_CONST(0x0000000110001480)
+#define SH2_RTC1_INT_CONFIG            __IA64_UL_CONST(0x0000000010001480)
+#define SH_RTC1_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
+#define SH_RTC1_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC1_INT_CONFIG_TYPE                                            */
+/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
+#define SH_RTC1_INT_CONFIG_TYPE_SHFT                   0
+#define SH_RTC1_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
+
+/*   SH_RTC1_INT_CONFIG_AGT                                             */
+/*   Description:  Agent, must be 0 for SHub                            */
+#define SH_RTC1_INT_CONFIG_AGT_SHFT                    3
+#define SH_RTC1_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
+
+/*   SH_RTC1_INT_CONFIG_PID                                             */
+/*   Description:  Processor ID, same setting as on targeted McKinley  */
+#define SH_RTC1_INT_CONFIG_PID_SHFT                    4
+#define SH_RTC1_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
+
+/*   SH_RTC1_INT_CONFIG_BASE                                            */
+/*   Description:  Optional interrupt vector area, 2MB aligned          */
+#define SH_RTC1_INT_CONFIG_BASE_SHFT                   21
+#define SH_RTC1_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
+
+/*   SH_RTC1_INT_CONFIG_IDX                                             */
+/*   Description:  Targeted McKinley interrupt vector                   */
+#define SH_RTC1_INT_CONFIG_IDX_SHFT                    52
+#define SH_RTC1_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC1_INT_ENABLE"                     */
+/*                SHub RTC 1 Interrupt Enable Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC1_INT_ENABLE            __IA64_UL_CONST(0x0000000110001500)
+#define SH2_RTC1_INT_ENABLE            __IA64_UL_CONST(0x0000000010001500)
+#define SH_RTC1_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
+#define SH_RTC1_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC1_INT_ENABLE_RTC1_ENABLE                                     */
+/*   Description:  Enable RTC 1 Interrupt                               */
+#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_SHFT            0
+#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_MASK \
+                                       __IA64_UL_CONST(0x0000000000000001)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC2_INT_CONFIG"                     */
+/*                SHub RTC 2 Interrupt Config Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC2_INT_CONFIG            __IA64_UL_CONST(0x0000000110001580)
+#define SH2_RTC2_INT_CONFIG            __IA64_UL_CONST(0x0000000010001580)
+#define SH_RTC2_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
+#define SH_RTC2_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC2_INT_CONFIG_TYPE                                            */
+/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
+#define SH_RTC2_INT_CONFIG_TYPE_SHFT                   0
+#define SH_RTC2_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
+
+/*   SH_RTC2_INT_CONFIG_AGT                                             */
+/*   Description:  Agent, must be 0 for SHub                            */
+#define SH_RTC2_INT_CONFIG_AGT_SHFT                    3
+#define SH_RTC2_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
+
+/*   SH_RTC2_INT_CONFIG_PID                                             */
+/*   Description:  Processor ID, same setting as on targeted McKinley  */
+#define SH_RTC2_INT_CONFIG_PID_SHFT                    4
+#define SH_RTC2_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
+
+/*   SH_RTC2_INT_CONFIG_BASE                                            */
+/*   Description:  Optional interrupt vector area, 2MB aligned          */
+#define SH_RTC2_INT_CONFIG_BASE_SHFT                   21
+#define SH_RTC2_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
+
+/*   SH_RTC2_INT_CONFIG_IDX                                             */
+/*   Description:  Targeted McKinley interrupt vector                   */
+#define SH_RTC2_INT_CONFIG_IDX_SHFT                    52
+#define SH_RTC2_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC2_INT_ENABLE"                     */
+/*                SHub RTC 2 Interrupt Enable Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC2_INT_ENABLE            __IA64_UL_CONST(0x0000000110001600)
+#define SH2_RTC2_INT_ENABLE            __IA64_UL_CONST(0x0000000010001600)
+#define SH_RTC2_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
+#define SH_RTC2_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC2_INT_ENABLE_RTC2_ENABLE                                     */
+/*   Description:  Enable RTC 2 Interrupt                               */
+#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_SHFT            0
+#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_MASK \
+                                       __IA64_UL_CONST(0x0000000000000001)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC3_INT_CONFIG"                     */
+/*                SHub RTC 3 Interrupt Config Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC3_INT_CONFIG            __IA64_UL_CONST(0x0000000110001680)
+#define SH2_RTC3_INT_CONFIG            __IA64_UL_CONST(0x0000000010001680)
+#define SH_RTC3_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
+#define SH_RTC3_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC3_INT_CONFIG_TYPE                                            */
+/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
+#define SH_RTC3_INT_CONFIG_TYPE_SHFT                   0
+#define SH_RTC3_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
+
+/*   SH_RTC3_INT_CONFIG_AGT                                             */
+/*   Description:  Agent, must be 0 for SHub                            */
+#define SH_RTC3_INT_CONFIG_AGT_SHFT                    3
+#define SH_RTC3_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
+
+/*   SH_RTC3_INT_CONFIG_PID                                             */
+/*   Description:  Processor ID, same setting as on targeted McKinley  */
+#define SH_RTC3_INT_CONFIG_PID_SHFT                    4
+#define SH_RTC3_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
+
+/*   SH_RTC3_INT_CONFIG_BASE                                            */
+/*   Description:  Optional interrupt vector area, 2MB aligned          */
+#define SH_RTC3_INT_CONFIG_BASE_SHFT                   21
+#define SH_RTC3_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
+
+/*   SH_RTC3_INT_CONFIG_IDX                                             */
+/*   Description:  Targeted McKinley interrupt vector                   */
+#define SH_RTC3_INT_CONFIG_IDX_SHFT                    52
+#define SH_RTC3_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
+
+/* ==================================================================== */
+/*                    Register "SH_RTC3_INT_ENABLE"                     */
+/*                SHub RTC 3 Interrupt Enable Registers                 */
+/* ==================================================================== */
+
+#define SH1_RTC3_INT_ENABLE            __IA64_UL_CONST(0x0000000110001700)
+#define SH2_RTC3_INT_ENABLE            __IA64_UL_CONST(0x0000000010001700)
+#define SH_RTC3_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
+#define SH_RTC3_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_RTC3_INT_ENABLE_RTC3_ENABLE                                     */
+/*   Description:  Enable RTC 3 Interrupt                               */
+#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_SHFT            0
+#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_MASK \
+                                       __IA64_UL_CONST(0x0000000000000001)
+
+/*   SH_EVENT_OCCURRED_RTC1_INT                                         */
+/*   Description:  Pending RTC 1 Interrupt                              */
+#define SH_EVENT_OCCURRED_RTC1_INT_SHFT                        24
+#define SH_EVENT_OCCURRED_RTC1_INT_MASK        __IA64_UL_CONST(0x0000000001000000)
+
+/*   SH_EVENT_OCCURRED_RTC2_INT                                         */
+/*   Description:  Pending RTC 2 Interrupt                              */
+#define SH_EVENT_OCCURRED_RTC2_INT_SHFT                        25
+#define SH_EVENT_OCCURRED_RTC2_INT_MASK        __IA64_UL_CONST(0x0000000002000000)
+
+/*   SH_EVENT_OCCURRED_RTC3_INT                                         */
+/*   Description:  Pending RTC 3 Interrupt                              */
+#define SH_EVENT_OCCURRED_RTC3_INT_SHFT                        26
+#define SH_EVENT_OCCURRED_RTC3_INT_MASK        __IA64_UL_CONST(0x0000000004000000)
+
+/* ==================================================================== */
+/*                       Register "SH_IPI_ACCESS"                       */
+/*                 CPU interrupt Access Permission Bits                 */
+/* ==================================================================== */
+
+#define SH1_IPI_ACCESS                 __IA64_UL_CONST(0x0000000110060480)
+#define SH2_IPI_ACCESS0                        __IA64_UL_CONST(0x0000000010060c00)
+#define SH2_IPI_ACCESS1                        __IA64_UL_CONST(0x0000000010060c80)
+#define SH2_IPI_ACCESS2                        __IA64_UL_CONST(0x0000000010060d00)
+#define SH2_IPI_ACCESS3                        __IA64_UL_CONST(0x0000000010060d80)
+
+/* ==================================================================== */
+/*                        Register "SH_INT_CMPB"                        */
+/*                  RTC Compare Value for Processor B                   */
+/* ==================================================================== */
+
+#define SH1_INT_CMPB                   __IA64_UL_CONST(0x00000001101b0080)
+#define SH2_INT_CMPB                   __IA64_UL_CONST(0x00000000101b0080)
+#define SH_INT_CMPB_MASK               __IA64_UL_CONST(0x007fffffffffffff)
+#define SH_INT_CMPB_INIT               __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_INT_CMPB_REAL_TIME_CMPB                                         */
+/*   Description:  Real Time Clock Compare                              */
+#define SH_INT_CMPB_REAL_TIME_CMPB_SHFT                        0
+#define SH_INT_CMPB_REAL_TIME_CMPB_MASK        __IA64_UL_CONST(0x007fffffffffffff)
+
+/* ==================================================================== */
+/*                        Register "SH_INT_CMPC"                        */
+/*                  RTC Compare Value for Processor C                   */
+/* ==================================================================== */
+
+#define SH1_INT_CMPC                   __IA64_UL_CONST(0x00000001101b0100)
+#define SH2_INT_CMPC                   __IA64_UL_CONST(0x00000000101b0100)
+#define SH_INT_CMPC_MASK               __IA64_UL_CONST(0x007fffffffffffff)
+#define SH_INT_CMPC_INIT               __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_INT_CMPC_REAL_TIME_CMPC                                         */
+/*   Description:  Real Time Clock Compare                              */
+#define SH_INT_CMPC_REAL_TIME_CMPC_SHFT                        0
+#define SH_INT_CMPC_REAL_TIME_CMPC_MASK        __IA64_UL_CONST(0x007fffffffffffff)
+
+/* ==================================================================== */
+/*                        Register "SH_INT_CMPD"                        */
+/*                  RTC Compare Value for Processor D                   */
+/* ==================================================================== */
+
+#define SH1_INT_CMPD                   __IA64_UL_CONST(0x00000001101b0180)
+#define SH2_INT_CMPD                   __IA64_UL_CONST(0x00000000101b0180)
+#define SH_INT_CMPD_MASK               __IA64_UL_CONST(0x007fffffffffffff)
+#define SH_INT_CMPD_INIT               __IA64_UL_CONST(0x0000000000000000)
+
+/*   SH_INT_CMPD_REAL_TIME_CMPD                                         */
+/*   Description:  Real Time Clock Compare                              */
+#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT                        0
+#define SH_INT_CMPD_REAL_TIME_CMPD_MASK        __IA64_UL_CONST(0x007fffffffffffff)
+
+/* ==================================================================== */
+/*                Register "SH_MD_DQLP_MMR_DIR_PRIVEC0"                 */
+/*                      privilege vector for acc=0                      */
+/* ==================================================================== */
+#define SH1_MD_DQLP_MMR_DIR_PRIVEC0    __IA64_UL_CONST(0x0000000100030300)
+
+/* ==================================================================== */
+/*                Register "SH_MD_DQRP_MMR_DIR_PRIVEC0"                 */
+/*                      privilege vector for acc=0                      */
+/* ==================================================================== */
+#define SH1_MD_DQRP_MMR_DIR_PRIVEC0    __IA64_UL_CONST(0x0000000100050300)
+
+/* ==================================================================== */
+/* Some MMRs are functionally identical (or close enough) on both SHUB1 */
+/* and SHUB2 that it makes sense to define a geberic name for the MMR.  */
+/* It is acceptible to use (for example) SH_IPI_INT to reference the    */
+/* the IPI MMR. The value of SH_IPI_INT is determined at runtime based  */
+/* on the type of the SHUB. Do not use these #defines in performance    */
+/* critical code  or loops - there is a small performance penalty.      */
+/* ==================================================================== */
+#define shubmmr(a,b)           (is_shub2() ? a##2_##b : a##1_##b)
+
+#define SH_REAL_JUNK_BUS_LED0  shubmmr(SH, REAL_JUNK_BUS_LED0)
+#define SH_IPI_INT             shubmmr(SH, IPI_INT)
+#define SH_EVENT_OCCURRED      shubmmr(SH, EVENT_OCCURRED)
+#define SH_EVENT_OCCURRED_ALIAS        shubmmr(SH, EVENT_OCCURRED_ALIAS)
+#define SH_RTC                 shubmmr(SH, RTC)
+#define SH_RTC1_INT_CONFIG     shubmmr(SH, RTC1_INT_CONFIG)
+#define SH_RTC1_INT_ENABLE     shubmmr(SH, RTC1_INT_ENABLE)
+#define SH_RTC2_INT_CONFIG     shubmmr(SH, RTC2_INT_CONFIG)
+#define SH_RTC2_INT_ENABLE     shubmmr(SH, RTC2_INT_ENABLE)
+#define SH_RTC3_INT_CONFIG     shubmmr(SH, RTC3_INT_CONFIG)
+#define SH_RTC3_INT_ENABLE     shubmmr(SH, RTC3_INT_ENABLE)
+#define SH_INT_CMPB            shubmmr(SH, INT_CMPB)
+#define SH_INT_CMPC            shubmmr(SH, INT_CMPC)
+#define SH_INT_CMPD            shubmmr(SH, INT_CMPD)
+
+/* ========================================================================== */
+/*                        Register "SH2_BT_ENG_CSR_0"                         */
+/*                    Engine 0 Control and Status Register                    */
+/* ========================================================================== */
+
+#define SH2_BT_ENG_CSR_0               __IA64_UL_CONST(0x0000000030040000)
+#define SH2_BT_ENG_SRC_ADDR_0          __IA64_UL_CONST(0x0000000030040080)
+#define SH2_BT_ENG_DEST_ADDR_0         __IA64_UL_CONST(0x0000000030040100)
+#define SH2_BT_ENG_NOTIF_ADDR_0                __IA64_UL_CONST(0x0000000030040180)
+
+/* ========================================================================== */
+/*                       BTE interfaces 1-3                                   */
+/* ========================================================================== */
+
+#define SH2_BT_ENG_CSR_1               __IA64_UL_CONST(0x0000000030050000)
+#define SH2_BT_ENG_CSR_2               __IA64_UL_CONST(0x0000000030060000)
+#define SH2_BT_ENG_CSR_3               __IA64_UL_CONST(0x0000000030070000)
+
+#endif /* _ASM_IA64_SN_SHUB_MMR_H */
diff --git a/arch/ia64/include/asm/sn/shubio.h b/arch/ia64/include/asm/sn/shubio.h
new file mode 100644 (file)
index 0000000..22a6f18
--- /dev/null
@@ -0,0 +1,3358 @@
+/*
+ * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_SHUBIO_H
+#define _ASM_IA64_SN_SHUBIO_H
+
+#define HUB_WIDGET_ID_MAX      0xf
+#define IIO_NUM_ITTES          7
+#define HUB_NUM_BIG_WINDOW     (IIO_NUM_ITTES - 1)
+
+#define                IIO_WID                 0x00400000      /* Crosstalk Widget Identification */
+                                                       /* This register is also accessible from
+                                                        * Crosstalk at address 0x0.  */
+#define                IIO_WSTAT               0x00400008      /* Crosstalk Widget Status */
+#define                IIO_WCR                 0x00400020      /* Crosstalk Widget Control Register */
+#define                IIO_ILAPR               0x00400100      /* IO Local Access Protection Register */
+#define                IIO_ILAPO               0x00400108      /* IO Local Access Protection Override */
+#define                IIO_IOWA                0x00400110      /* IO Outbound Widget Access */
+#define                IIO_IIWA                0x00400118      /* IO Inbound Widget Access */
+#define                IIO_IIDEM               0x00400120      /* IO Inbound Device Error Mask */
+#define                IIO_ILCSR               0x00400128      /* IO LLP Control and Status Register */
+#define                IIO_ILLR                0x00400130      /* IO LLP Log Register    */
+#define                IIO_IIDSR               0x00400138      /* IO Interrupt Destination */
+
+#define                IIO_IGFX0               0x00400140      /* IO Graphics Node-Widget Map 0 */
+#define                IIO_IGFX1               0x00400148      /* IO Graphics Node-Widget Map 1 */
+
+#define                IIO_ISCR0               0x00400150      /* IO Scratch Register 0 */
+#define                IIO_ISCR1               0x00400158      /* IO Scratch Register 1 */
+
+#define                IIO_ITTE1               0x00400160      /* IO Translation Table Entry 1 */
+#define                IIO_ITTE2               0x00400168      /* IO Translation Table Entry 2 */
+#define                IIO_ITTE3               0x00400170      /* IO Translation Table Entry 3 */
+#define                IIO_ITTE4               0x00400178      /* IO Translation Table Entry 4 */
+#define                IIO_ITTE5               0x00400180      /* IO Translation Table Entry 5 */
+#define                IIO_ITTE6               0x00400188      /* IO Translation Table Entry 6 */
+#define                IIO_ITTE7               0x00400190      /* IO Translation Table Entry 7 */
+
+#define                IIO_IPRB0               0x00400198      /* IO PRB Entry 0   */
+#define                IIO_IPRB8               0x004001A0      /* IO PRB Entry 8   */
+#define                IIO_IPRB9               0x004001A8      /* IO PRB Entry 9   */
+#define                IIO_IPRBA               0x004001B0      /* IO PRB Entry A   */
+#define                IIO_IPRBB               0x004001B8      /* IO PRB Entry B   */
+#define                IIO_IPRBC               0x004001C0      /* IO PRB Entry C   */
+#define                IIO_IPRBD               0x004001C8      /* IO PRB Entry D   */
+#define                IIO_IPRBE               0x004001D0      /* IO PRB Entry E   */
+#define                IIO_IPRBF               0x004001D8      /* IO PRB Entry F   */
+
+#define                IIO_IXCC                0x004001E0      /* IO Crosstalk Credit Count Timeout */
+#define                IIO_IMEM                0x004001E8      /* IO Miscellaneous Error Mask */
+#define                IIO_IXTT                0x004001F0      /* IO Crosstalk Timeout Threshold */
+#define                IIO_IECLR               0x004001F8      /* IO Error Clear Register */
+#define                IIO_IBCR                0x00400200      /* IO BTE Control Register */
+
+#define                IIO_IXSM                0x00400208      /* IO Crosstalk Spurious Message */
+#define                IIO_IXSS                0x00400210      /* IO Crosstalk Spurious Sideband */
+
+#define                IIO_ILCT                0x00400218      /* IO LLP Channel Test    */
+
+#define                IIO_IIEPH1              0x00400220      /* IO Incoming Error Packet Header, Part 1 */
+#define                IIO_IIEPH2              0x00400228      /* IO Incoming Error Packet Header, Part 2 */
+
+#define                IIO_ISLAPR              0x00400230      /* IO SXB Local Access Protection Regster */
+#define                IIO_ISLAPO              0x00400238      /* IO SXB Local Access Protection Override */
+
+#define                IIO_IWI                 0x00400240      /* IO Wrapper Interrupt Register */
+#define                IIO_IWEL                0x00400248      /* IO Wrapper Error Log Register */
+#define                IIO_IWC                 0x00400250      /* IO Wrapper Control Register */
+#define                IIO_IWS                 0x00400258      /* IO Wrapper Status Register */
+#define                IIO_IWEIM               0x00400260      /* IO Wrapper Error Interrupt Masking Register */
+
+#define                IIO_IPCA                0x00400300      /* IO PRB Counter Adjust */
+
+#define                IIO_IPRTE0_A            0x00400308      /* IO PIO Read Address Table Entry 0, Part A */
+#define                IIO_IPRTE1_A            0x00400310      /* IO PIO Read Address Table Entry 1, Part A */
+#define                IIO_IPRTE2_A            0x00400318      /* IO PIO Read Address Table Entry 2, Part A */
+#define                IIO_IPRTE3_A            0x00400320      /* IO PIO Read Address Table Entry 3, Part A */
+#define                IIO_IPRTE4_A            0x00400328      /* IO PIO Read Address Table Entry 4, Part A */
+#define                IIO_IPRTE5_A            0x00400330      /* IO PIO Read Address Table Entry 5, Part A */
+#define                IIO_IPRTE6_A            0x00400338      /* IO PIO Read Address Table Entry 6, Part A */
+#define                IIO_IPRTE7_A            0x00400340      /* IO PIO Read Address Table Entry 7, Part A */
+
+#define                IIO_IPRTE0_B            0x00400348      /* IO PIO Read Address Table Entry 0, Part B */
+#define                IIO_IPRTE1_B            0x00400350      /* IO PIO Read Address Table Entry 1, Part B */
+#define                IIO_IPRTE2_B            0x00400358      /* IO PIO Read Address Table Entry 2, Part B */
+#define                IIO_IPRTE3_B            0x00400360      /* IO PIO Read Address Table Entry 3, Part B */
+#define                IIO_IPRTE4_B            0x00400368      /* IO PIO Read Address Table Entry 4, Part B */
+#define                IIO_IPRTE5_B            0x00400370      /* IO PIO Read Address Table Entry 5, Part B */
+#define                IIO_IPRTE6_B            0x00400378      /* IO PIO Read Address Table Entry 6, Part B */
+#define                IIO_IPRTE7_B            0x00400380      /* IO PIO Read Address Table Entry 7, Part B */
+
+#define                IIO_IPDR                0x00400388      /* IO PIO Deallocation Register */
+#define                IIO_ICDR                0x00400390      /* IO CRB Entry Deallocation Register */
+#define                IIO_IFDR                0x00400398      /* IO IOQ FIFO Depth Register */
+#define                IIO_IIAP                0x004003A0      /* IO IIQ Arbitration Parameters */
+#define                IIO_ICMR                0x004003A8      /* IO CRB Management Register */
+#define                IIO_ICCR                0x004003B0      /* IO CRB Control Register */
+#define                IIO_ICTO                0x004003B8      /* IO CRB Timeout   */
+#define                IIO_ICTP                0x004003C0      /* IO CRB Timeout Prescalar */
+
+#define                IIO_ICRB0_A             0x00400400      /* IO CRB Entry 0_A */
+#define                IIO_ICRB0_B             0x00400408      /* IO CRB Entry 0_B */
+#define                IIO_ICRB0_C             0x00400410      /* IO CRB Entry 0_C */
+#define                IIO_ICRB0_D             0x00400418      /* IO CRB Entry 0_D */
+#define                IIO_ICRB0_E             0x00400420      /* IO CRB Entry 0_E */
+
+#define                IIO_ICRB1_A             0x00400430      /* IO CRB Entry 1_A */
+#define                IIO_ICRB1_B             0x00400438      /* IO CRB Entry 1_B */
+#define                IIO_ICRB1_C             0x00400440      /* IO CRB Entry 1_C */
+#define                IIO_ICRB1_D             0x00400448      /* IO CRB Entry 1_D */
+#define                IIO_ICRB1_E             0x00400450      /* IO CRB Entry 1_E */
+
+#define                IIO_ICRB2_A             0x00400460      /* IO CRB Entry 2_A */
+#define                IIO_ICRB2_B             0x00400468      /* IO CRB Entry 2_B */
+#define                IIO_ICRB2_C             0x00400470      /* IO CRB Entry 2_C */
+#define                IIO_ICRB2_D             0x00400478      /* IO CRB Entry 2_D */
+#define                IIO_ICRB2_E             0x00400480      /* IO CRB Entry 2_E */
+
+#define                IIO_ICRB3_A             0x00400490      /* IO CRB Entry 3_A */
+#define                IIO_ICRB3_B             0x00400498      /* IO CRB Entry 3_B */
+#define                IIO_ICRB3_C             0x004004a0      /* IO CRB Entry 3_C */
+#define                IIO_ICRB3_D             0x004004a8      /* IO CRB Entry 3_D */
+#define                IIO_ICRB3_E             0x004004b0      /* IO CRB Entry 3_E */
+
+#define                IIO_ICRB4_A             0x004004c0      /* IO CRB Entry 4_A */
+#define                IIO_ICRB4_B             0x004004c8      /* IO CRB Entry 4_B */
+#define                IIO_ICRB4_C             0x004004d0      /* IO CRB Entry 4_C */
+#define                IIO_ICRB4_D             0x004004d8      /* IO CRB Entry 4_D */
+#define                IIO_ICRB4_E             0x004004e0      /* IO CRB Entry 4_E */
+
+#define                IIO_ICRB5_A             0x004004f0      /* IO CRB Entry 5_A */
+#define                IIO_ICRB5_B             0x004004f8      /* IO CRB Entry 5_B */
+#define                IIO_ICRB5_C             0x00400500      /* IO CRB Entry 5_C */
+#define                IIO_ICRB5_D             0x00400508      /* IO CRB Entry 5_D */
+#define                IIO_ICRB5_E             0x00400510      /* IO CRB Entry 5_E */
+
+#define                IIO_ICRB6_A             0x00400520      /* IO CRB Entry 6_A */
+#define                IIO_ICRB6_B             0x00400528      /* IO CRB Entry 6_B */
+#define                IIO_ICRB6_C             0x00400530      /* IO CRB Entry 6_C */
+#define                IIO_ICRB6_D             0x00400538      /* IO CRB Entry 6_D */
+#define                IIO_ICRB6_E             0x00400540      /* IO CRB Entry 6_E */
+
+#define                IIO_ICRB7_A             0x00400550      /* IO CRB Entry 7_A */
+#define                IIO_ICRB7_B             0x00400558      /* IO CRB Entry 7_B */
+#define                IIO_ICRB7_C             0x00400560      /* IO CRB Entry 7_C */
+#define                IIO_ICRB7_D             0x00400568      /* IO CRB Entry 7_D */
+#define                IIO_ICRB7_E             0x00400570      /* IO CRB Entry 7_E */
+
+#define                IIO_ICRB8_A             0x00400580      /* IO CRB Entry 8_A */
+#define                IIO_ICRB8_B             0x00400588      /* IO CRB Entry 8_B */
+#define                IIO_ICRB8_C             0x00400590      /* IO CRB Entry 8_C */
+#define                IIO_ICRB8_D             0x00400598      /* IO CRB Entry 8_D */
+#define                IIO_ICRB8_E             0x004005a0      /* IO CRB Entry 8_E */
+
+#define                IIO_ICRB9_A             0x004005b0      /* IO CRB Entry 9_A */
+#define                IIO_ICRB9_B             0x004005b8      /* IO CRB Entry 9_B */
+#define                IIO_ICRB9_C             0x004005c0      /* IO CRB Entry 9_C */
+#define                IIO_ICRB9_D             0x004005c8      /* IO CRB Entry 9_D */
+#define                IIO_ICRB9_E             0x004005d0      /* IO CRB Entry 9_E */
+
+#define                IIO_ICRBA_A             0x004005e0      /* IO CRB Entry A_A */
+#define                IIO_ICRBA_B             0x004005e8      /* IO CRB Entry A_B */
+#define                IIO_ICRBA_C             0x004005f0      /* IO CRB Entry A_C */
+#define                IIO_ICRBA_D             0x004005f8      /* IO CRB Entry A_D */
+#define                IIO_ICRBA_E             0x00400600      /* IO CRB Entry A_E */
+
+#define                IIO_ICRBB_A             0x00400610      /* IO CRB Entry B_A */
+#define                IIO_ICRBB_B             0x00400618      /* IO CRB Entry B_B */
+#define                IIO_ICRBB_C             0x00400620      /* IO CRB Entry B_C */
+#define                IIO_ICRBB_D             0x00400628      /* IO CRB Entry B_D */
+#define                IIO_ICRBB_E             0x00400630      /* IO CRB Entry B_E */
+
+#define                IIO_ICRBC_A             0x00400640      /* IO CRB Entry C_A */
+#define                IIO_ICRBC_B             0x00400648      /* IO CRB Entry C_B */
+#define                IIO_ICRBC_C             0x00400650      /* IO CRB Entry C_C */
+#define                IIO_ICRBC_D             0x00400658      /* IO CRB Entry C_D */
+#define                IIO_ICRBC_E             0x00400660      /* IO CRB Entry C_E */
+
+#define                IIO_ICRBD_A             0x00400670      /* IO CRB Entry D_A */
+#define                IIO_ICRBD_B             0x00400678      /* IO CRB Entry D_B */
+#define                IIO_ICRBD_C             0x00400680      /* IO CRB Entry D_C */
+#define                IIO_ICRBD_D             0x00400688      /* IO CRB Entry D_D */
+#define                IIO_ICRBD_E             0x00400690      /* IO CRB Entry D_E */
+
+#define                IIO_ICRBE_A             0x004006a0      /* IO CRB Entry E_A */
+#define                IIO_ICRBE_B             0x004006a8      /* IO CRB Entry E_B */
+#define                IIO_ICRBE_C             0x004006b0      /* IO CRB Entry E_C */
+#define                IIO_ICRBE_D             0x004006b8      /* IO CRB Entry E_D */
+#define                IIO_ICRBE_E             0x004006c0      /* IO CRB Entry E_E */
+
+#define                IIO_ICSML               0x00400700      /* IO CRB Spurious Message Low */
+#define                IIO_ICSMM               0x00400708      /* IO CRB Spurious Message Middle */
+#define                IIO_ICSMH               0x00400710      /* IO CRB Spurious Message High */
+
+#define                IIO_IDBSS               0x00400718      /* IO Debug Submenu Select */
+
+#define                IIO_IBLS0               0x00410000      /* IO BTE Length Status 0 */
+#define                IIO_IBSA0               0x00410008      /* IO BTE Source Address 0 */
+#define                IIO_IBDA0               0x00410010      /* IO BTE Destination Address 0 */
+#define                IIO_IBCT0               0x00410018      /* IO BTE Control Terminate 0 */
+#define                IIO_IBNA0               0x00410020      /* IO BTE Notification Address 0 */
+#define                IIO_IBIA0               0x00410028      /* IO BTE Interrupt Address 0 */
+#define                IIO_IBLS1               0x00420000      /* IO BTE Length Status 1 */
+#define                IIO_IBSA1               0x00420008      /* IO BTE Source Address 1 */
+#define                IIO_IBDA1               0x00420010      /* IO BTE Destination Address 1 */
+#define                IIO_IBCT1               0x00420018      /* IO BTE Control Terminate 1 */
+#define                IIO_IBNA1               0x00420020      /* IO BTE Notification Address 1 */
+#define                IIO_IBIA1               0x00420028      /* IO BTE Interrupt Address 1 */
+
+#define                IIO_IPCR                0x00430000      /* IO Performance Control */
+#define                IIO_IPPR                0x00430008      /* IO Performance Profiling */
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register echoes some information from the         *
+ * LB_REV_ID register. It is available through Crosstalk as described   *
+ * above. The REV_NUM and MFG_NUM fields receive their values from      *
+ * the REVISION and MANUFACTURER fields in the LB_REV_ID register.      *
+ * The PART_NUM field's value is the Crosstalk device ID number that    *
+ * Steve Miller assigned to the SHub chip.                              *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_wid_u {
+       u64 ii_wid_regval;
+       struct {
+               u64 w_rsvd_1:1;
+               u64 w_mfg_num:11;
+               u64 w_part_num:16;
+               u64 w_rev_num:4;
+               u64 w_rsvd:32;
+       } ii_wid_fld_s;
+} ii_wid_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  The fields in this register are set upon detection of an error      *
+ * and cleared by various mechanisms, as explained in the               *
+ * description.                                                         *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_wstat_u {
+       u64 ii_wstat_regval;
+       struct {
+               u64 w_pending:4;
+               u64 w_xt_crd_to:1;
+               u64 w_xt_tail_to:1;
+               u64 w_rsvd_3:3;
+               u64 w_tx_mx_rty:1;
+               u64 w_rsvd_2:6;
+               u64 w_llp_tx_cnt:8;
+               u64 w_rsvd_1:8;
+               u64 w_crazy:1;
+               u64 w_rsvd:31;
+       } ii_wstat_fld_s;
+} ii_wstat_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This is a read-write enabled register. It controls     *
+ * various aspects of the Crosstalk flow control.                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_wcr_u {
+       u64 ii_wcr_regval;
+       struct {
+               u64 w_wid:4;
+               u64 w_tag:1;
+               u64 w_rsvd_1:8;
+               u64 w_dst_crd:3;
+               u64 w_f_bad_pkt:1;
+               u64 w_dir_con:1;
+               u64 w_e_thresh:5;
+               u64 w_rsvd:41;
+       } ii_wcr_fld_s;
+} ii_wcr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register's value is a bit vector that guards      *
+ * access to local registers within the II as well as to external       *
+ * Crosstalk widgets. Each bit in the register corresponds to a         *
+ * particular region in the system; a region consists of one, two or    *
+ * four nodes (depending on the value of the REGION_SIZE field in the   *
+ * LB_REV_ID register, which is documented in Section 8.3.1.1). The     *
+ * protection provided by this register applies to PIO read             *
+ * operations as well as PIO write operations. The II will perform a    *
+ * PIO read or write request only if the bit for the requestor's        *
+ * region is set; otherwise, the II will not perform the requested      *
+ * operation and will return an error response. When a PIO read or      *
+ * write request targets an external Crosstalk widget, then not only    *
+ * must the bit for the requestor's region be set in the ILAPR, but     *
+ * also the target widget's bit in the IOWA register must be set in     *
+ * order for the II to perform the requested operation; otherwise,      *
+ * the II will return an error response. Hence, the protection          *
+ * provided by the IOWA register supplements the protection provided    *
+ * by the ILAPR for requests that target external Crosstalk widgets.    *
+ * This register itself can be accessed only by the nodes whose         *
+ * region ID bits are enabled in this same register. It can also be     *
+ * accessed through the IAlias space by the local processors.           *
+ * The reset value of this register allows access by all nodes.         *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ilapr_u {
+       u64 ii_ilapr_regval;
+       struct {
+               u64 i_region:64;
+       } ii_ilapr_fld_s;
+} ii_ilapr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  A write to this register of the 64-bit value           *
+ * "SGIrules" in ASCII, will cause the bit in the ILAPR register        *
+ * corresponding to the region of the requestor to be set (allow        *
+ * access). A write of any other value will be ignored. Access          *
+ * protection for this register is "SGIrules".                          *
+ * This register can also be accessed through the IAlias space.         *
+ * However, this access will not change the access permissions in the   *
+ * ILAPR.                                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ilapo_u {
+       u64 ii_ilapo_regval;
+       struct {
+               u64 i_io_ovrride:64;
+       } ii_ilapo_fld_s;
+} ii_ilapo_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register qualifies all the PIO and Graphics writes launched    *
+ * from the SHUB towards a widget.                                      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iowa_u {
+       u64 ii_iowa_regval;
+       struct {
+               u64 i_w0_oac:1;
+               u64 i_rsvd_1:7;
+               u64 i_wx_oac:8;
+               u64 i_rsvd:48;
+       } ii_iowa_fld_s;
+} ii_iowa_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register qualifies all the requests launched      *
+ * from a widget towards the Shub. This register is intended to be      *
+ * used by software in case of misbehaving widgets.                     *
+ *                                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iiwa_u {
+       u64 ii_iiwa_regval;
+       struct {
+               u64 i_w0_iac:1;
+               u64 i_rsvd_1:7;
+               u64 i_wx_iac:8;
+               u64 i_rsvd:48;
+       } ii_iiwa_fld_s;
+} ii_iiwa_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register qualifies all the operations launched    *
+ * from a widget towards the SHub. It allows individual access          *
+ * control for up to 8 devices per widget. A device refers to           *
+ * individual DMA master hosted by a widget.                            *
+ * The bits in each field of this register are cleared by the Shub      *
+ * upon detection of an error which requires the device to be           *
+ * disabled. These fields assume that 0=TNUM=7 (i.e., Bridge-centric    *
+ * Crosstalk). Whether or not a device has access rights to this        *
+ * Shub is determined by an AND of the device enable bit in the         *
+ * appropriate field of this register and the corresponding bit in      *
+ * the Wx_IAC field (for the widget which this device belongs to).      *
+ * The bits in this field are set by writing a 1 to them. Incoming      *
+ * replies from Crosstalk are not subject to this access control        *
+ * mechanism.                                                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iidem_u {
+       u64 ii_iidem_regval;
+       struct {
+               u64 i_w8_dxs:8;
+               u64 i_w9_dxs:8;
+               u64 i_wa_dxs:8;
+               u64 i_wb_dxs:8;
+               u64 i_wc_dxs:8;
+               u64 i_wd_dxs:8;
+               u64 i_we_dxs:8;
+               u64 i_wf_dxs:8;
+       } ii_iidem_fld_s;
+} ii_iidem_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the various programmable fields necessary    *
+ * for controlling and observing the LLP signals.                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ilcsr_u {
+       u64 ii_ilcsr_regval;
+       struct {
+               u64 i_nullto:6;
+               u64 i_rsvd_4:2;
+               u64 i_wrmrst:1;
+               u64 i_rsvd_3:1;
+               u64 i_llp_en:1;
+               u64 i_bm8:1;
+               u64 i_llp_stat:2;
+               u64 i_remote_power:1;
+               u64 i_rsvd_2:1;
+               u64 i_maxrtry:10;
+               u64 i_d_avail_sel:2;
+               u64 i_rsvd_1:4;
+               u64 i_maxbrst:10;
+               u64 i_rsvd:22;
+
+       } ii_ilcsr_fld_s;
+} ii_ilcsr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This is simply a status registers that monitors the LLP error       *
+ * rate.                                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_illr_u {
+       u64 ii_illr_regval;
+       struct {
+               u64 i_sn_cnt:16;
+               u64 i_cb_cnt:16;
+               u64 i_rsvd:32;
+       } ii_illr_fld_s;
+} ii_illr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  All II-detected non-BTE error interrupts are           *
+ * specified via this register.                                         *
+ * NOTE: The PI interrupt register address is hardcoded in the II. If   *
+ * PI_ID==0, then the II sends an interrupt request (Duplonet PWRI      *
+ * packet) to address offset 0x0180_0090 within the local register      *
+ * address space of PI0 on the node specified by the NODE field. If     *
+ * PI_ID==1, then the II sends the interrupt request to address         *
+ * offset 0x01A0_0090 within the local register address space of PI1    *
+ * on the node specified by the NODE field.                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iidsr_u {
+       u64 ii_iidsr_regval;
+       struct {
+               u64 i_level:8;
+               u64 i_pi_id:1;
+               u64 i_node:11;
+               u64 i_rsvd_3:4;
+               u64 i_enable:1;
+               u64 i_rsvd_2:3;
+               u64 i_int_sent:2;
+               u64 i_rsvd_1:2;
+               u64 i_pi0_forward_int:1;
+               u64 i_pi1_forward_int:1;
+               u64 i_rsvd:30;
+       } ii_iidsr_fld_s;
+} ii_iidsr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are two instances of this register. This register is used     *
+ * for matching up the incoming responses from the graphics widget to   *
+ * the processor that initiated the graphics operation. The             *
+ * write-responses are converted to graphics credits and returned to    *
+ * the processor so that the processor interface can manage the flow    *
+ * control.                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_igfx0_u {
+       u64 ii_igfx0_regval;
+       struct {
+               u64 i_w_num:4;
+               u64 i_pi_id:1;
+               u64 i_n_num:12;
+               u64 i_p_num:1;
+               u64 i_rsvd:46;
+       } ii_igfx0_fld_s;
+} ii_igfx0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are two instances of this register. This register is used     *
+ * for matching up the incoming responses from the graphics widget to   *
+ * the processor that initiated the graphics operation. The             *
+ * write-responses are converted to graphics credits and returned to    *
+ * the processor so that the processor interface can manage the flow    *
+ * control.                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_igfx1_u {
+       u64 ii_igfx1_regval;
+       struct {
+               u64 i_w_num:4;
+               u64 i_pi_id:1;
+               u64 i_n_num:12;
+               u64 i_p_num:1;
+               u64 i_rsvd:46;
+       } ii_igfx1_fld_s;
+} ii_igfx1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are two instances of this registers. These registers are      *
+ * used as scratch registers for software use.                          *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iscr0_u {
+       u64 ii_iscr0_regval;
+       struct {
+               u64 i_scratch:64;
+       } ii_iscr0_fld_s;
+} ii_iscr0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are two instances of this registers. These registers are      *
+ * used as scratch registers for software use.                          *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iscr1_u {
+       u64 ii_iscr1_regval;
+       struct {
+               u64 i_scratch:64;
+       } ii_iscr1_fld_s;
+} ii_iscr1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a Shub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the SHub is thus the lower 16 GBytes per widget       * 
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the Shub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte1_u {
+       u64 ii_itte1_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte1_fld_s;
+} ii_itte1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a Shub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the Shub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the Shub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte2_u {
+       u64 ii_itte2_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte2_fld_s;
+} ii_itte2_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a Shub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the Shub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the SHub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte3_u {
+       u64 ii_itte3_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte3_fld_s;
+} ii_itte3_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a SHub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the SHub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the SHub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte4_u {
+       u64 ii_itte4_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte4_fld_s;
+} ii_itte4_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a SHub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the Shub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the Shub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte5_u {
+       u64 ii_itte5_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte5_fld_s;
+} ii_itte5_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a Shub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the Shub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the Shub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte6_u {
+       u64 ii_itte6_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte6_fld_s;
+} ii_itte6_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are seven instances of translation table entry   *
+ * registers. Each register maps a Shub Big Window to a 48-bit          *
+ * address on Crosstalk.                                                *
+ * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
+ * number) are used to select one of these 7 registers. The Widget      *
+ * number field is then derived from the W_NUM field for synthesizing   *
+ * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
+ * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
+ * are padded with zeros. Although the maximum Crosstalk space          *
+ * addressable by the Shub is thus the lower 16 GBytes per widget       *
+ * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
+ * space can be accessed.                                               *
+ * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
+ * Window number) are used to select one of these 7 registers. The      *
+ * Widget number field is then derived from the W_NUM field for         *
+ * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
+ * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
+ * field is used as Crosstalk[47], and remainder of the Crosstalk       *
+ * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
+ * Crosstalk space addressable by the SHub is thus the lower            *
+ * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
+ * of this space can be accessed.                                       *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_itte7_u {
+       u64 ii_itte7_regval;
+       struct {
+               u64 i_offset:5;
+               u64 i_rsvd_1:3;
+               u64 i_w_num:4;
+               u64 i_iosp:1;
+               u64 i_rsvd:51;
+       } ii_itte7_fld_s;
+} ii_itte7_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprb0_u {
+       u64 ii_iprb0_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprb0_fld_s;
+} ii_iprb0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprb8_u {
+       u64 ii_iprb8_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprb8_fld_s;
+} ii_iprb8_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprb9_u {
+       u64 ii_iprb9_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprb9_fld_s;
+} ii_iprb9_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.        *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ *                                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprba_u {
+       u64 ii_iprba_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprba_fld_s;
+} ii_iprba_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprbb_u {
+       u64 ii_iprbb_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprbb_fld_s;
+} ii_iprbb_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprbc_u {
+       u64 ii_iprbc_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprbc_fld_s;
+} ii_iprbc_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprbd_u {
+       u64 ii_iprbd_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprbd_fld_s;
+} ii_iprbd_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of SHub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprbe_u {
+       u64 ii_iprbe_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprbe_fld_s;
+} ii_iprbe_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 9 instances of this register, one per        *
+ * actual widget in this implementation of Shub and Crossbow.           *
+ * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
+ * refers to Crossbow's internal space.                                 *
+ * This register contains the state elements per widget that are        *
+ * necessary to manage the PIO flow control on Crosstalk and on the     *
+ * Router Network. See the PIO Flow Control chapter for a complete      *
+ * description of this register                                         *
+ * The SPUR_WR bit requires some explanation. When this register is     *
+ * written, the new value of the C field is captured in an internal     *
+ * register so the hardware can remember what the programmer wrote      *
+ * into the credit counter. The SPUR_WR bit sets whenever the C field   *
+ * increments above this stored value, which indicates that there       *
+ * have been more responses received than requests sent. The SPUR_WR    *
+ * bit cannot be cleared until a value is written to the IPRBx          *
+ * register; the write will correct the C field and capture its new     *
+ * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
+ * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
+ * .                                                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprbf_u {
+       u64 ii_iprbf_regval;
+       struct {
+               u64 i_c:8;
+               u64 i_na:14;
+               u64 i_rsvd_2:2;
+               u64 i_nb:14;
+               u64 i_rsvd_1:2;
+               u64 i_m:2;
+               u64 i_f:1;
+               u64 i_of_cnt:5;
+               u64 i_error:1;
+               u64 i_rd_to:1;
+               u64 i_spur_wr:1;
+               u64 i_spur_rd:1;
+               u64 i_rsvd:11;
+               u64 i_mult_err:1;
+       } ii_iprbe_fld_s;
+} ii_iprbf_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register specifies the timeout value to use for monitoring     *
+ * Crosstalk credits which are used outbound to Crosstalk. An           *
+ * internal counter called the Crosstalk Credit Timeout Counter         *
+ * increments every 128 II clocks. The counter starts counting          *
+ * anytime the credit count drops below a threshold, and resets to      *
+ * zero (stops counting) anytime the credit count is at or above the    *
+ * threshold. The threshold is 1 credit in direct connect mode and 2    *
+ * in Crossbow connect mode. When the internal Crosstalk Credit         *
+ * Timeout Counter reaches the value programmed in this register, a     *
+ * Crosstalk Credit Timeout has occurred. The internal counter is not   *
+ * readable from software, and stops counting at its maximum value,     *
+ * so it cannot cause more than one interrupt.                          *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ixcc_u {
+       u64 ii_ixcc_regval;
+       struct {
+               u64 i_time_out:26;
+               u64 i_rsvd:38;
+       } ii_ixcc_fld_s;
+} ii_ixcc_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register qualifies all the PIO and DMA            *
+ * operations launched from widget 0 towards the SHub. In               *
+ * addition, it also qualifies accesses by the BTE streams.             *
+ * The bits in each field of this register are cleared by the SHub      *
+ * upon detection of an error which requires widget 0 or the BTE        *
+ * streams to be terminated. Whether or not widget x has access         *
+ * rights to this SHub is determined by an AND of the device            *
+ * enable bit in the appropriate field of this register and bit 0 in    *
+ * the Wx_IAC field. The bits in this field are set by writing a 1 to   *
+ * them. Incoming replies from Crosstalk are not subject to this        *
+ * access control mechanism.                                            *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_imem_u {
+       u64 ii_imem_regval;
+       struct {
+               u64 i_w0_esd:1;
+               u64 i_rsvd_3:3;
+               u64 i_b0_esd:1;
+               u64 i_rsvd_2:3;
+               u64 i_b1_esd:1;
+               u64 i_rsvd_1:3;
+               u64 i_clr_precise:1;
+               u64 i_rsvd:51;
+       } ii_imem_fld_s;
+} ii_imem_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register specifies the timeout value to use for   *
+ * monitoring Crosstalk tail flits coming into the Shub in the          *
+ * TAIL_TO field. An internal counter associated with this register     *
+ * is incremented every 128 II internal clocks (7 bits). The counter    *
+ * starts counting anytime a header micropacket is received and stops   *
+ * counting (and resets to zero) any time a micropacket with a Tail     *
+ * bit is received. Once the counter reaches the threshold value        *
+ * programmed in this register, it generates an interrupt to the        *
+ * processor that is programmed into the IIDSR. The counter saturates   *
+ * (does not roll over) at its maximum value, so it cannot cause        *
+ * another interrupt until after it is cleared.                         *
+ * The register also contains the Read Response Timeout values. The     *
+ * Prescalar is 23 bits, and counts II clocks. An internal counter      *
+ * increments on every II clock and when it reaches the value in the    *
+ * Prescalar field, all IPRTE registers with their valid bits set       *
+ * have their Read Response timers bumped. Whenever any of them match   *
+ * the value in the RRSP_TO field, a Read Response Timeout has          *
+ * occurred, and error handling occurs as described in the Error        *
+ * Handling section of this document.                                   *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ixtt_u {
+       u64 ii_ixtt_regval;
+       struct {
+               u64 i_tail_to:26;
+               u64 i_rsvd_1:6;
+               u64 i_rrsp_ps:23;
+               u64 i_rrsp_to:5;
+               u64 i_rsvd:4;
+       } ii_ixtt_fld_s;
+} ii_ixtt_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Writing a 1 to the fields of this register clears the appropriate   *
+ * error bits in other areas of SHub. Note that when the                *
+ * E_PRB_x bits are used to clear error bits in PRB registers,          *
+ * SPUR_RD and SPUR_WR may persist, because they require additional     *
+ * action to clear them. See the IPRBx and IXSS Register                *
+ * specifications.                                                      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ieclr_u {
+       u64 ii_ieclr_regval;
+       struct {
+               u64 i_e_prb_0:1;
+               u64 i_rsvd:7;
+               u64 i_e_prb_8:1;
+               u64 i_e_prb_9:1;
+               u64 i_e_prb_a:1;
+               u64 i_e_prb_b:1;
+               u64 i_e_prb_c:1;
+               u64 i_e_prb_d:1;
+               u64 i_e_prb_e:1;
+               u64 i_e_prb_f:1;
+               u64 i_e_crazy:1;
+               u64 i_e_bte_0:1;
+               u64 i_e_bte_1:1;
+               u64 i_reserved_1:10;
+               u64 i_spur_rd_hdr:1;
+               u64 i_cam_intr_to:1;
+               u64 i_cam_overflow:1;
+               u64 i_cam_read_miss:1;
+               u64 i_ioq_rep_underflow:1;
+               u64 i_ioq_req_underflow:1;
+               u64 i_ioq_rep_overflow:1;
+               u64 i_ioq_req_overflow:1;
+               u64 i_iiq_rep_overflow:1;
+               u64 i_iiq_req_overflow:1;
+               u64 i_ii_xn_rep_cred_overflow:1;
+               u64 i_ii_xn_req_cred_overflow:1;
+               u64 i_ii_xn_invalid_cmd:1;
+               u64 i_xn_ii_invalid_cmd:1;
+               u64 i_reserved_2:21;
+       } ii_ieclr_fld_s;
+} ii_ieclr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register controls both BTEs. SOFT_RESET is intended for        *
+ * recovery after an error. COUNT controls the total number of CRBs     *
+ * that both BTEs (combined) can use, which affects total BTE           *
+ * bandwidth.                                                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibcr_u {
+       u64 ii_ibcr_regval;
+       struct {
+               u64 i_count:4;
+               u64 i_rsvd_1:4;
+               u64 i_soft_reset:1;
+               u64 i_rsvd:55;
+       } ii_ibcr_fld_s;
+} ii_ibcr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the header of a spurious read response       *
+ * received from Crosstalk. A spurious read response is defined as a    *
+ * read response received by II from a widget for which (1) the SIDN    *
+ * has a value between 1 and 7, inclusive (II never sends requests to   *
+ * these widgets (2) there is no valid IPRTE register which             *
+ * corresponds to the TNUM, or (3) the widget indicated in SIDN is      *
+ * not the same as the widget recorded in the IPRTE register            *
+ * referenced by the TNUM. If this condition is true, and if the        *
+ * IXSS[VALID] bit is clear, then the header of the spurious read       *
+ * response is capture in IXSM and IXSS, and IXSS[VALID] is set. The    *
+ * errant header is thereby captured, and no further spurious read      *
+ * respones are captured until IXSS[VALID] is cleared by setting the    *
+ * appropriate bit in IECLR.Everytime a spurious read response is       *
+ * detected, the SPUR_RD bit of the PRB corresponding to the incoming   *
+ * message's SIDN field is set. This always happens, regarless of       *
+ * whether a header is captured. The programmer should check            *
+ * IXSM[SIDN] to determine which widget sent the spurious response,     *
+ * because there may be more than one SPUR_RD bit set in the PRB        *
+ * registers. The widget indicated by IXSM[SIDN] was the first          *
+ * spurious read response to be received since the last time            *
+ * IXSS[VALID] was clear. The SPUR_RD bit of the corresponding PRB      *
+ * will be set. Any SPUR_RD bits in any other PRB registers indicate    *
+ * spurious messages from other widets which were detected after the    *
+ * header was captured..                                                *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ixsm_u {
+       u64 ii_ixsm_regval;
+       struct {
+               u64 i_byte_en:32;
+               u64 i_reserved:1;
+               u64 i_tag:3;
+               u64 i_alt_pactyp:4;
+               u64 i_bo:1;
+               u64 i_error:1;
+               u64 i_vbpm:1;
+               u64 i_gbr:1;
+               u64 i_ds:2;
+               u64 i_ct:1;
+               u64 i_tnum:5;
+               u64 i_pactyp:4;
+               u64 i_sidn:4;
+               u64 i_didn:4;
+       } ii_ixsm_fld_s;
+} ii_ixsm_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the sideband bits of a spurious read         *
+ * response received from Crosstalk.                                    *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ixss_u {
+       u64 ii_ixss_regval;
+       struct {
+               u64 i_sideband:8;
+               u64 i_rsvd:55;
+               u64 i_valid:1;
+       } ii_ixss_fld_s;
+} ii_ixss_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register enables software to access the II LLP's test port.    *
+ * Refer to the LLP 2.5 documentation for an explanation of the test    *
+ * port. Software can write to this register to program the values      *
+ * for the control fields (TestErrCapture, TestClear, TestFlit,         *
+ * TestMask and TestSeed). Similarly, software can read from this       *
+ * register to obtain the values of the test port's status outputs      *
+ * (TestCBerr, TestValid and TestData).                                 *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ilct_u {
+       u64 ii_ilct_regval;
+       struct {
+               u64 i_test_seed:20;
+               u64 i_test_mask:8;
+               u64 i_test_data:20;
+               u64 i_test_valid:1;
+               u64 i_test_cberr:1;
+               u64 i_test_flit:3;
+               u64 i_test_clear:1;
+               u64 i_test_err_capture:1;
+               u64 i_rsvd:9;
+       } ii_ilct_fld_s;
+} ii_ilct_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  If the II detects an illegal incoming Duplonet packet (request or   *
+ * reply) when VALID==0 in the IIEPH1 register, then it saves the       *
+ * contents of the packet's header flit in the IIEPH1 and IIEPH2        *
+ * registers, sets the VALID bit in IIEPH1, clears the OVERRUN bit,     *
+ * and assigns a value to the ERR_TYPE field which indicates the        *
+ * specific nature of the error. The II recognizes four different       *
+ * types of errors: short request packets (ERR_TYPE==2), short reply    *
+ * packets (ERR_TYPE==3), long request packets (ERR_TYPE==4) and long   *
+ * reply packets (ERR_TYPE==5). The encodings for these types of        *
+ * errors were chosen to be consistent with the same types of errors    *
+ * indicated by the ERR_TYPE field in the LB_ERROR_HDR1 register (in    *
+ * the LB unit). If the II detects an illegal incoming Duplonet         *
+ * packet when VALID==1 in the IIEPH1 register, then it merely sets     *
+ * the OVERRUN bit to indicate that a subsequent error has happened,    *
+ * and does nothing further.                                            *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iieph1_u {
+       u64 ii_iieph1_regval;
+       struct {
+               u64 i_command:7;
+               u64 i_rsvd_5:1;
+               u64 i_suppl:14;
+               u64 i_rsvd_4:1;
+               u64 i_source:14;
+               u64 i_rsvd_3:1;
+               u64 i_err_type:4;
+               u64 i_rsvd_2:4;
+               u64 i_overrun:1;
+               u64 i_rsvd_1:3;
+               u64 i_valid:1;
+               u64 i_rsvd:13;
+       } ii_iieph1_fld_s;
+} ii_iieph1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register holds the Address field from the header flit of an    *
+ * incoming erroneous Duplonet packet, along with the tail bit which    *
+ * accompanied this header flit. This register is essentially an        *
+ * extension of IIEPH1. Two registers were necessary because the 64     *
+ * bits available in only a single register were insufficient to        *
+ * capture the entire header flit of an erroneous packet.               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iieph2_u {
+       u64 ii_iieph2_regval;
+       struct {
+               u64 i_rsvd_0:3;
+               u64 i_address:47;
+               u64 i_rsvd_1:10;
+               u64 i_tail:1;
+               u64 i_rsvd:3;
+       } ii_iieph2_fld_s;
+} ii_iieph2_u_t;
+
+/******************************/
+
+/************************************************************************
+ *                                                                     *
+ *  This register's value is a bit vector that guards access from SXBs  *
+ * to local registers within the II as well as to external Crosstalk    *
+ * widgets                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_islapr_u {
+       u64 ii_islapr_regval;
+       struct {
+               u64 i_region:64;
+       } ii_islapr_fld_s;
+} ii_islapr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  A write to this register of the 56-bit value "Pup+Bun" will cause  *
+ * the bit in the ISLAPR register corresponding to the region of the   *
+ * requestor to be set (access allowed).                               (
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_islapo_u {
+       u64 ii_islapo_regval;
+       struct {
+               u64 i_io_sbx_ovrride:56;
+               u64 i_rsvd:8;
+       } ii_islapo_fld_s;
+} ii_islapo_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Determines how long the wrapper will wait aftr an interrupt is     *
+ * initially issued from the II before it times out the outstanding    *
+ * interrupt and drops it from the interrupt queue.                    * 
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iwi_u {
+       u64 ii_iwi_regval;
+       struct {
+               u64 i_prescale:24;
+               u64 i_rsvd:8;
+               u64 i_timeout:8;
+               u64 i_rsvd1:8;
+               u64 i_intrpt_retry_period:8;
+               u64 i_rsvd2:8;
+       } ii_iwi_fld_s;
+} ii_iwi_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Log errors which have occurred in the II wrapper. The errors are   *
+ * cleared by writing to the IECLR register.                           * 
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iwel_u {
+       u64 ii_iwel_regval;
+       struct {
+               u64 i_intr_timed_out:1;
+               u64 i_rsvd:7;
+               u64 i_cam_overflow:1;
+               u64 i_cam_read_miss:1;
+               u64 i_rsvd1:2;
+               u64 i_ioq_rep_underflow:1;
+               u64 i_ioq_req_underflow:1;
+               u64 i_ioq_rep_overflow:1;
+               u64 i_ioq_req_overflow:1;
+               u64 i_iiq_rep_overflow:1;
+               u64 i_iiq_req_overflow:1;
+               u64 i_rsvd2:6;
+               u64 i_ii_xn_rep_cred_over_under:1;
+               u64 i_ii_xn_req_cred_over_under:1;
+               u64 i_rsvd3:6;
+               u64 i_ii_xn_invalid_cmd:1;
+               u64 i_xn_ii_invalid_cmd:1;
+               u64 i_rsvd4:30;
+       } ii_iwel_fld_s;
+} ii_iwel_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Controls the II wrapper.                                           * 
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iwc_u {
+       u64 ii_iwc_regval;
+       struct {
+               u64 i_dma_byte_swap:1;
+               u64 i_rsvd:3;
+               u64 i_cam_read_lines_reset:1;
+               u64 i_rsvd1:3;
+               u64 i_ii_xn_cred_over_under_log:1;
+               u64 i_rsvd2:19;
+               u64 i_xn_rep_iq_depth:5;
+               u64 i_rsvd3:3;
+               u64 i_xn_req_iq_depth:5;
+               u64 i_rsvd4:3;
+               u64 i_iiq_depth:6;
+               u64 i_rsvd5:12;
+               u64 i_force_rep_cred:1;
+               u64 i_force_req_cred:1;
+       } ii_iwc_fld_s;
+} ii_iwc_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Status in the II wrapper.                                          * 
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iws_u {
+       u64 ii_iws_regval;
+       struct {
+               u64 i_xn_rep_iq_credits:5;
+               u64 i_rsvd:3;
+               u64 i_xn_req_iq_credits:5;
+               u64 i_rsvd1:51;
+       } ii_iws_fld_s;
+} ii_iws_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Masks errors in the IWEL register.                                 *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iweim_u {
+       u64 ii_iweim_regval;
+       struct {
+               u64 i_intr_timed_out:1;
+               u64 i_rsvd:7;
+               u64 i_cam_overflow:1;
+               u64 i_cam_read_miss:1;
+               u64 i_rsvd1:2;
+               u64 i_ioq_rep_underflow:1;
+               u64 i_ioq_req_underflow:1;
+               u64 i_ioq_rep_overflow:1;
+               u64 i_ioq_req_overflow:1;
+               u64 i_iiq_rep_overflow:1;
+               u64 i_iiq_req_overflow:1;
+               u64 i_rsvd2:6;
+               u64 i_ii_xn_rep_cred_overflow:1;
+               u64 i_ii_xn_req_cred_overflow:1;
+               u64 i_rsvd3:6;
+               u64 i_ii_xn_invalid_cmd:1;
+               u64 i_xn_ii_invalid_cmd:1;
+               u64 i_rsvd4:30;
+       } ii_iweim_fld_s;
+} ii_iweim_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  A write to this register causes a particular field in the           *
+ * corresponding widget's PRB entry to be adjusted up or down by 1.     *
+ * This counter should be used when recovering from error and reset     *
+ * conditions. Note that software would be capable of causing           *
+ * inadvertent overflow or underflow of these counters.                 *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ipca_u {
+       u64 ii_ipca_regval;
+       struct {
+               u64 i_wid:4;
+               u64 i_adjust:1;
+               u64 i_rsvd_1:3;
+               u64 i_field:2;
+               u64 i_rsvd:54;
+       } ii_ipca_fld_s;
+} ii_ipca_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte0a_u {
+       u64 ii_iprte0a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte0a_fld_s;
+} ii_iprte0a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte1a_u {
+       u64 ii_iprte1a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte1a_fld_s;
+} ii_iprte1a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte2a_u {
+       u64 ii_iprte2a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte2a_fld_s;
+} ii_iprte2a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte3a_u {
+       u64 ii_iprte3a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte3a_fld_s;
+} ii_iprte3a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte4a_u {
+       u64 ii_iprte4a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte4a_fld_s;
+} ii_iprte4a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte5a_u {
+       u64 ii_iprte5a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte5a_fld_s;
+} ii_iprte5a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte6a_u {
+       u64 ii_iprte6a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprte6a_fld_s;
+} ii_iprte6a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte7a_u {
+       u64 ii_iprte7a_regval;
+       struct {
+               u64 i_rsvd_1:54;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } ii_iprtea7_fld_s;
+} ii_iprte7a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte0b_u {
+       u64 ii_iprte0b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte0b_fld_s;
+} ii_iprte0b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte1b_u {
+       u64 ii_iprte1b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte1b_fld_s;
+} ii_iprte1b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte2b_u {
+       u64 ii_iprte2b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte2b_fld_s;
+} ii_iprte2b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte3b_u {
+       u64 ii_iprte3b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte3b_fld_s;
+} ii_iprte3b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte4b_u {
+       u64 ii_iprte4b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte4b_fld_s;
+} ii_iprte4b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte5b_u {
+       u64 ii_iprte5b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte5b_fld_s;
+} ii_iprte5b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte6b_u {
+       u64 ii_iprte6b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+
+       } ii_iprte6b_fld_s;
+} ii_iprte6b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  There are 8 instances of this register. This register contains      *
+ * the information that the II has to remember once it has launched a   *
+ * PIO Read operation. The contents are used to form the correct        *
+ * Router Network packet and direct the Crosstalk reply to the          *
+ * appropriate processor.                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iprte7b_u {
+       u64 ii_iprte7b_regval;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_address:47;
+               u64 i_init:3;
+               u64 i_source:11;
+       } ii_iprte7b_fld_s;
+} ii_iprte7b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  SHub II contains a feature which did not exist in      *
+ * the Hub which automatically cleans up after a Read Response          *
+ * timeout, including deallocation of the IPRTE and recovery of IBuf    *
+ * space. The inclusion of this register in SHub is for backward        *
+ * compatibility                                                        *
+ * A write to this register causes an entry from the table of           *
+ * outstanding PIO Read Requests to be freed and returned to the        *
+ * stack of free entries. This register is used in handling the         *
+ * timeout errors that result in a PIO Reply never returning from       *
+ * Crosstalk.                                                           *
+ * Note that this register does not affect the contents of the IPRTE    *
+ * registers. The Valid bits in those registers have to be              *
+ * specifically turned off by software.                                 *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ipdr_u {
+       u64 ii_ipdr_regval;
+       struct {
+               u64 i_te:3;
+               u64 i_rsvd_1:1;
+               u64 i_pnd:1;
+               u64 i_init_rpcnt:1;
+               u64 i_rsvd:58;
+       } ii_ipdr_fld_s;
+} ii_ipdr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  A write to this register causes a CRB entry to be returned to the   *
+ * queue of free CRBs. The entry should have previously been cleared    *
+ * (mark bit) via backdoor access to the pertinent CRB entry. This      *
+ * register is used in the last step of handling the errors that are    *
+ * captured and marked in CRB entries.  Briefly: 1) first error for     *
+ * DMA write from a particular device, and first error for a            *
+ * particular BTE stream, lead to a marked CRB entry, and processor     *
+ * interrupt, 2) software reads the error information captured in the   *
+ * CRB entry, and presumably takes some corrective action, 3)           *
+ * software clears the mark bit, and finally 4) software writes to      *
+ * the ICDR register to return the CRB entry to the list of free CRB    *
+ * entries.                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icdr_u {
+       u64 ii_icdr_regval;
+       struct {
+               u64 i_crb_num:4;
+               u64 i_pnd:1;
+               u64 i_rsvd:59;
+       } ii_icdr_fld_s;
+} ii_icdr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register provides debug access to two FIFOs inside of II.      *
+ * Both IOQ_MAX* fields of this register contain the instantaneous      *
+ * depth (in units of the number of available entries) of the           *
+ * associated IOQ FIFO.  A read of this register will return the        *
+ * number of free entries on each FIFO at the time of the read.  So     *
+ * when a FIFO is idle, the associated field contains the maximum       *
+ * depth of the FIFO.  This register is writable for debug reasons      *
+ * and is intended to be written with the maximum desired FIFO depth    *
+ * while the FIFO is idle. Software must assure that II is idle when    *
+ * this register is written. If there are any active entries in any     *
+ * of these FIFOs when this register is written, the results are        *
+ * undefined.                                                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ifdr_u {
+       u64 ii_ifdr_regval;
+       struct {
+               u64 i_ioq_max_rq:7;
+               u64 i_set_ioq_rq:1;
+               u64 i_ioq_max_rp:7;
+               u64 i_set_ioq_rp:1;
+               u64 i_rsvd:48;
+       } ii_ifdr_fld_s;
+} ii_ifdr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register allows the II to become sluggish in removing          *
+ * messages from its inbound queue (IIQ). This will cause messages to   *
+ * back up in either virtual channel. Disabling the "molasses" mode     *
+ * subsequently allows the II to be tested under stress. In the         *
+ * sluggish ("Molasses") mode, the localized effects of congestion      *
+ * can be observed.                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iiap_u {
+       u64 ii_iiap_regval;
+       struct {
+               u64 i_rq_mls:6;
+               u64 i_rsvd_1:2;
+               u64 i_rp_mls:6;
+               u64 i_rsvd:50;
+       } ii_iiap_fld_s;
+} ii_iiap_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register allows several parameters of CRB operation to be      *
+ * set. Note that writing to this register can have catastrophic side   *
+ * effects, if the CRB is not quiescent, i.e. if the CRB is             *
+ * processing protocol messages when the write occurs.                  *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icmr_u {
+       u64 ii_icmr_regval;
+       struct {
+               u64 i_sp_msg:1;
+               u64 i_rd_hdr:1;
+               u64 i_rsvd_4:2;
+               u64 i_c_cnt:4;
+               u64 i_rsvd_3:4;
+               u64 i_clr_rqpd:1;
+               u64 i_clr_rppd:1;
+               u64 i_rsvd_2:2;
+               u64 i_fc_cnt:4;
+               u64 i_crb_vld:15;
+               u64 i_crb_mark:15;
+               u64 i_rsvd_1:2;
+               u64 i_precise:1;
+               u64 i_rsvd:11;
+       } ii_icmr_fld_s;
+} ii_icmr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register allows control of the table portion of the CRB        *
+ * logic via software. Control operations from this register have       *
+ * priority over all incoming Crosstalk or BTE requests.                *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_iccr_u {
+       u64 ii_iccr_regval;
+       struct {
+               u64 i_crb_num:4;
+               u64 i_rsvd_1:4;
+               u64 i_cmd:8;
+               u64 i_pending:1;
+               u64 i_rsvd:47;
+       } ii_iccr_fld_s;
+} ii_iccr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register allows the maximum timeout value to be programmed.    *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icto_u {
+       u64 ii_icto_regval;
+       struct {
+               u64 i_timeout:8;
+               u64 i_rsvd:56;
+       } ii_icto_fld_s;
+} ii_icto_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register allows the timeout prescalar to be programmed. An     *
+ * internal counter is associated with this register. When the          *
+ * internal counter reaches the value of the PRESCALE field, the        *
+ * timer registers in all valid CRBs are incremented (CRBx_D[TIMEOUT]   *
+ * field). The internal counter resets to zero, and then continues      *
+ * counting.                                                            *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ictp_u {
+       u64 ii_ictp_regval;
+       struct {
+               u64 i_prescale:24;
+               u64 i_rsvd:40;
+       } ii_ictp_fld_s;
+} ii_ictp_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
+ * used for Crosstalk operations (both cacheline and partial            *
+ * operations) or BTE/IO. Because the CRB entries are very wide, five   *
+ * registers (_A to _E) are required to read and write each entry.      *
+ * The CRB Entry registers can be conceptualized as rows and columns    *
+ * (illustrated in the table above). Each row contains the 4            *
+ * registers required for a single CRB Entry. The first doubleword      *
+ * (column) for each entry is labeled A, and the second doubleword      *
+ * (higher address) is labeled B, the third doubleword is labeled C,    *
+ * the fourth doubleword is labeled D and the fifth doubleword is       *
+ * labeled E. All CRB entries have their addresses on a quarter         *
+ * cacheline aligned boundary.                   *
+ * Upon reset, only the following fields are initialized: valid         *
+ * (VLD), priority count, timeout, timeout valid, and context valid.    *
+ * All other bits should be cleared by software before use (after       *
+ * recovering any potential error state from before the reset).         *
+ * The following four tables summarize the format for the four          *
+ * registers that are used for each ICRB# Entry.                        *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icrb0_a_u {
+       u64 ii_icrb0_a_regval;
+       struct {
+               u64 ia_iow:1;
+               u64 ia_vld:1;
+               u64 ia_addr:47;
+               u64 ia_tnum:5;
+               u64 ia_sidn:4;
+               u64 ia_rsvd:6;
+       } ii_icrb0_a_fld_s;
+} ii_icrb0_a_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
+ * used for Crosstalk operations (both cacheline and partial            *
+ * operations) or BTE/IO. Because the CRB entries are very wide, five   *
+ * registers (_A to _E) are required to read and write each entry.      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icrb0_b_u {
+       u64 ii_icrb0_b_regval;
+       struct {
+               u64 ib_xt_err:1;
+               u64 ib_mark:1;
+               u64 ib_ln_uce:1;
+               u64 ib_errcode:3;
+               u64 ib_error:1;
+               u64 ib_stall__bte_1:1;
+               u64 ib_stall__bte_0:1;
+               u64 ib_stall__intr:1;
+               u64 ib_stall_ib:1;
+               u64 ib_intvn:1;
+               u64 ib_wb:1;
+               u64 ib_hold:1;
+               u64 ib_ack:1;
+               u64 ib_resp:1;
+               u64 ib_ack_cnt:11;
+               u64 ib_rsvd:7;
+               u64 ib_exc:5;
+               u64 ib_init:3;
+               u64 ib_imsg:8;
+               u64 ib_imsgtype:2;
+               u64 ib_use_old:1;
+               u64 ib_rsvd_1:11;
+       } ii_icrb0_b_fld_s;
+} ii_icrb0_b_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
+ * used for Crosstalk operations (both cacheline and partial            *
+ * operations) or BTE/IO. Because the CRB entries are very wide, five   *
+ * registers (_A to _E) are required to read and write each entry.      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icrb0_c_u {
+       u64 ii_icrb0_c_regval;
+       struct {
+               u64 ic_source:15;
+               u64 ic_size:2;
+               u64 ic_ct:1;
+               u64 ic_bte_num:1;
+               u64 ic_gbr:1;
+               u64 ic_resprqd:1;
+               u64 ic_bo:1;
+               u64 ic_suppl:15;
+               u64 ic_rsvd:27;
+       } ii_icrb0_c_fld_s;
+} ii_icrb0_c_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
+ * used for Crosstalk operations (both cacheline and partial            *
+ * operations) or BTE/IO. Because the CRB entries are very wide, five   *
+ * registers (_A to _E) are required to read and write each entry.      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icrb0_d_u {
+       u64 ii_icrb0_d_regval;
+       struct {
+               u64 id_pa_be:43;
+               u64 id_bte_op:1;
+               u64 id_pr_psc:4;
+               u64 id_pr_cnt:4;
+               u64 id_sleep:1;
+               u64 id_rsvd:11;
+       } ii_icrb0_d_fld_s;
+} ii_icrb0_d_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
+ * used for Crosstalk operations (both cacheline and partial            *
+ * operations) or BTE/IO. Because the CRB entries are very wide, five   *
+ * registers (_A to _E) are required to read and write each entry.      *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icrb0_e_u {
+       u64 ii_icrb0_e_regval;
+       struct {
+               u64 ie_timeout:8;
+               u64 ie_context:15;
+               u64 ie_rsvd:1;
+               u64 ie_tvld:1;
+               u64 ie_cvld:1;
+               u64 ie_rsvd_0:38;
+       } ii_icrb0_e_fld_s;
+} ii_icrb0_e_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the lower 64 bits of the header of the       *
+ * spurious message captured by II. Valid when the SP_MSG bit in ICMR   *
+ * register is set.                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icsml_u {
+       u64 ii_icsml_regval;
+       struct {
+               u64 i_tt_addr:47;
+               u64 i_newsuppl_ex:14;
+               u64 i_reserved:2;
+               u64 i_overflow:1;
+       } ii_icsml_fld_s;
+} ii_icsml_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the middle 64 bits of the header of the      *
+ * spurious message captured by II. Valid when the SP_MSG bit in ICMR   *
+ * register is set.                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icsmm_u {
+       u64 ii_icsmm_regval;
+       struct {
+               u64 i_tt_ack_cnt:11;
+               u64 i_reserved:53;
+       } ii_icsmm_fld_s;
+} ii_icsmm_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the microscopic state, all the inputs to     *
+ * the protocol table, captured with the spurious message. Valid when   *
+ * the SP_MSG bit in the ICMR register is set.                          *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_icsmh_u {
+       u64 ii_icsmh_regval;
+       struct {
+               u64 i_tt_vld:1;
+               u64 i_xerr:1;
+               u64 i_ft_cwact_o:1;
+               u64 i_ft_wact_o:1;
+               u64 i_ft_active_o:1;
+               u64 i_sync:1;
+               u64 i_mnusg:1;
+               u64 i_mnusz:1;
+               u64 i_plusz:1;
+               u64 i_plusg:1;
+               u64 i_tt_exc:5;
+               u64 i_tt_wb:1;
+               u64 i_tt_hold:1;
+               u64 i_tt_ack:1;
+               u64 i_tt_resp:1;
+               u64 i_tt_intvn:1;
+               u64 i_g_stall_bte1:1;
+               u64 i_g_stall_bte0:1;
+               u64 i_g_stall_il:1;
+               u64 i_g_stall_ib:1;
+               u64 i_tt_imsg:8;
+               u64 i_tt_imsgtype:2;
+               u64 i_tt_use_old:1;
+               u64 i_tt_respreqd:1;
+               u64 i_tt_bte_num:1;
+               u64 i_cbn:1;
+               u64 i_match:1;
+               u64 i_rpcnt_lt_34:1;
+               u64 i_rpcnt_ge_34:1;
+               u64 i_rpcnt_lt_18:1;
+               u64 i_rpcnt_ge_18:1;
+               u64 i_rpcnt_lt_2:1;
+               u64 i_rpcnt_ge_2:1;
+               u64 i_rqcnt_lt_18:1;
+               u64 i_rqcnt_ge_18:1;
+               u64 i_rqcnt_lt_2:1;
+               u64 i_rqcnt_ge_2:1;
+               u64 i_tt_device:7;
+               u64 i_tt_init:3;
+               u64 i_reserved:5;
+       } ii_icsmh_fld_s;
+} ii_icsmh_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  The Shub DEBUG unit provides a 3-bit selection signal to the        *
+ * II core and a 3-bit selection signal to the fsbclk domain in the II  *
+ * wrapper.                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_idbss_u {
+       u64 ii_idbss_regval;
+       struct {
+               u64 i_iioclk_core_submenu:3;
+               u64 i_rsvd:5;
+               u64 i_fsbclk_wrapper_submenu:3;
+               u64 i_rsvd_1:5;
+               u64 i_iioclk_menu:5;
+               u64 i_rsvd_2:43;
+       } ii_idbss_fld_s;
+} ii_idbss_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register is used to set up the length for a       *
+ * transfer and then to monitor the progress of that transfer. This     *
+ * register needs to be initialized before a transfer is started. A     *
+ * legitimate write to this register will set the Busy bit, clear the   *
+ * Error bit, and initialize the length to the value desired.           *
+ * While the transfer is in progress, hardware will decrement the       *
+ * length field with each successful block that is copied. Once the     *
+ * transfer completes, hardware will clear the Busy bit. The length     *
+ * field will also contain the number of cache lines left to be         *
+ * transferred.                                                         *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibls0_u {
+       u64 ii_ibls0_regval;
+       struct {
+               u64 i_length:16;
+               u64 i_error:1;
+               u64 i_rsvd_1:3;
+               u64 i_busy:1;
+               u64 i_rsvd:43;
+       } ii_ibls0_fld_s;
+} ii_ibls0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register should be loaded before a transfer is started. The    *
+ * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
+ * address as described in Section 1.3, Figure2 and Figure3. Since      *
+ * the bottom 7 bits of the address are always taken to be zero, BTE    *
+ * transfers are always cacheline-aligned.                              *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibsa0_u {
+       u64 ii_ibsa0_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:42;
+               u64 i_rsvd:15;
+       } ii_ibsa0_fld_s;
+} ii_ibsa0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register should be loaded before a transfer is started. The    *
+ * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
+ * address as described in Section 1.3, Figure2 and Figure3. Since      *
+ * the bottom 7 bits of the address are always taken to be zero, BTE    *
+ * transfers are always cacheline-aligned.                              *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibda0_u {
+       u64 ii_ibda0_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:42;
+               u64 i_rsvd:15;
+       } ii_ibda0_fld_s;
+} ii_ibda0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Writing to this register sets up the attributes of the transfer     *
+ * and initiates the transfer operation. Reading this register has      *
+ * the side effect of terminating any transfer in progress. Note:       *
+ * stopping a transfer midstream could have an adverse impact on the    *
+ * other BTE. If a BTE stream has to be stopped (due to error           *
+ * handling for example), both BTE streams should be stopped and        *
+ * their transfers discarded.                                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibct0_u {
+       u64 ii_ibct0_regval;
+       struct {
+               u64 i_zerofill:1;
+               u64 i_rsvd_2:3;
+               u64 i_notify:1;
+               u64 i_rsvd_1:3;
+               u64 i_poison:1;
+               u64 i_rsvd:55;
+       } ii_ibct0_fld_s;
+} ii_ibct0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the address to which the WINV is sent.       *
+ * This address has to be cache line aligned.                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibna0_u {
+       u64 ii_ibna0_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:42;
+               u64 i_rsvd:15;
+       } ii_ibna0_fld_s;
+} ii_ibna0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the programmable level as well as the node   *
+ * ID and PI unit of the processor to which the interrupt will be       *
+ * sent.                                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibia0_u {
+       u64 ii_ibia0_regval;
+       struct {
+               u64 i_rsvd_2:1;
+               u64 i_node_id:11;
+               u64 i_rsvd_1:4;
+               u64 i_level:7;
+               u64 i_rsvd:41;
+       } ii_ibia0_fld_s;
+} ii_ibia0_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * Description:  This register is used to set up the length for a       *
+ * transfer and then to monitor the progress of that transfer. This     *
+ * register needs to be initialized before a transfer is started. A     *
+ * legitimate write to this register will set the Busy bit, clear the   *
+ * Error bit, and initialize the length to the value desired.           *
+ * While the transfer is in progress, hardware will decrement the       *
+ * length field with each successful block that is copied. Once the     *
+ * transfer completes, hardware will clear the Busy bit. The length     *
+ * field will also contain the number of cache lines left to be         *
+ * transferred.                                                         *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibls1_u {
+       u64 ii_ibls1_regval;
+       struct {
+               u64 i_length:16;
+               u64 i_error:1;
+               u64 i_rsvd_1:3;
+               u64 i_busy:1;
+               u64 i_rsvd:43;
+       } ii_ibls1_fld_s;
+} ii_ibls1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register should be loaded before a transfer is started. The    *
+ * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
+ * address as described in Section 1.3, Figure2 and Figure3. Since      *
+ * the bottom 7 bits of the address are always taken to be zero, BTE    *
+ * transfers are always cacheline-aligned.                              *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibsa1_u {
+       u64 ii_ibsa1_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:33;
+               u64 i_rsvd:24;
+       } ii_ibsa1_fld_s;
+} ii_ibsa1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register should be loaded before a transfer is started. The    *
+ * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
+ * address as described in Section 1.3, Figure2 and Figure3. Since      *
+ * the bottom 7 bits of the address are always taken to be zero, BTE    *
+ * transfers are always cacheline-aligned.                              *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibda1_u {
+       u64 ii_ibda1_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:33;
+               u64 i_rsvd:24;
+       } ii_ibda1_fld_s;
+} ii_ibda1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  Writing to this register sets up the attributes of the transfer     *
+ * and initiates the transfer operation. Reading this register has      *
+ * the side effect of terminating any transfer in progress. Note:       *
+ * stopping a transfer midstream could have an adverse impact on the    *
+ * other BTE. If a BTE stream has to be stopped (due to error           *
+ * handling for example), both BTE streams should be stopped and        *
+ * their transfers discarded.                                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibct1_u {
+       u64 ii_ibct1_regval;
+       struct {
+               u64 i_zerofill:1;
+               u64 i_rsvd_2:3;
+               u64 i_notify:1;
+               u64 i_rsvd_1:3;
+               u64 i_poison:1;
+               u64 i_rsvd:55;
+       } ii_ibct1_fld_s;
+} ii_ibct1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the address to which the WINV is sent.       *
+ * This address has to be cache line aligned.                           *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibna1_u {
+       u64 ii_ibna1_regval;
+       struct {
+               u64 i_rsvd_1:7;
+               u64 i_addr:33;
+               u64 i_rsvd:24;
+       } ii_ibna1_fld_s;
+} ii_ibna1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register contains the programmable level as well as the node   *
+ * ID and PI unit of the processor to which the interrupt will be       *
+ * sent.                                                               *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ibia1_u {
+       u64 ii_ibia1_regval;
+       struct {
+               u64 i_pi_id:1;
+               u64 i_node_id:8;
+               u64 i_rsvd_1:7;
+               u64 i_level:7;
+               u64 i_rsvd:41;
+       } ii_ibia1_fld_s;
+} ii_ibia1_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *  This register defines the resources that feed information into      *
+ * the two performance counters located in the IO Performance           *
+ * Profiling Register. There are 17 different quantities that can be    *
+ * measured. Given these 17 different options, the two performance      *
+ * counters have 15 of them in common; menu selections 0 through 0xE    *
+ * are identical for each performance counter. As for the other two     *
+ * options, one is available from one performance counter and the       *
+ * other is available from the other performance counter. Hence, the    *
+ * II supports all 17*16=272 possible combinations of quantities to     *
+ * measure.                                                             *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ipcr_u {
+       u64 ii_ipcr_regval;
+       struct {
+               u64 i_ippr0_c:4;
+               u64 i_ippr1_c:4;
+               u64 i_icct:8;
+               u64 i_rsvd:48;
+       } ii_ipcr_fld_s;
+} ii_ipcr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ *                                                                     *
+ *                                                                     *
+ ************************************************************************/
+
+typedef union ii_ippr_u {
+       u64 ii_ippr_regval;
+       struct {
+               u64 i_ippr0:32;
+               u64 i_ippr1:32;
+       } ii_ippr_fld_s;
+} ii_ippr_u_t;
+
+/************************************************************************
+ *                                                                     *
+ * The following defines which were not formed into structures are     *
+ * probably indentical to another register, and the name of the                *
+ * register is provided against each of these registers. This          *
+ * information needs to be checked carefully                           *
+ *                                                                     *
+ *             IIO_ICRB1_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB1_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB1_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB1_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB1_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB2_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB2_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB2_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB2_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB2_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB3_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB3_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB3_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB3_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB3_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB4_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB4_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB4_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB4_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB4_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB5_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB5_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB5_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB5_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB5_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB6_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB6_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB6_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB6_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB6_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB7_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB7_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB7_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB7_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB7_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB8_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB8_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB8_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB8_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB8_E             IIO_ICRB0_E                     *
+ *             IIO_ICRB9_A             IIO_ICRB0_A                     *
+ *             IIO_ICRB9_B             IIO_ICRB0_B                     *
+ *             IIO_ICRB9_C             IIO_ICRB0_C                     *
+ *             IIO_ICRB9_D             IIO_ICRB0_D                     *
+ *             IIO_ICRB9_E             IIO_ICRB0_E                     *
+ *             IIO_ICRBA_A             IIO_ICRB0_A                     *
+ *             IIO_ICRBA_B             IIO_ICRB0_B                     *
+ *             IIO_ICRBA_C             IIO_ICRB0_C                     *
+ *             IIO_ICRBA_D             IIO_ICRB0_D                     *
+ *             IIO_ICRBA_E             IIO_ICRB0_E                     *
+ *             IIO_ICRBB_A             IIO_ICRB0_A                     *
+ *             IIO_ICRBB_B             IIO_ICRB0_B                     *
+ *             IIO_ICRBB_C             IIO_ICRB0_C                     *
+ *             IIO_ICRBB_D             IIO_ICRB0_D                     *
+ *             IIO_ICRBB_E             IIO_ICRB0_E                     *
+ *             IIO_ICRBC_A             IIO_ICRB0_A                     *
+ *             IIO_ICRBC_B             IIO_ICRB0_B                     *
+ *             IIO_ICRBC_C             IIO_ICRB0_C                     *
+ *             IIO_ICRBC_D             IIO_ICRB0_D                     *
+ *             IIO_ICRBC_E             IIO_ICRB0_E                     *
+ *             IIO_ICRBD_A             IIO_ICRB0_A                     *
+ *             IIO_ICRBD_B             IIO_ICRB0_B                     *
+ *             IIO_ICRBD_C             IIO_ICRB0_C                     *
+ *             IIO_ICRBD_D             IIO_ICRB0_D                     *
+ *             IIO_ICRBD_E             IIO_ICRB0_E                     *
+ *             IIO_ICRBE_A             IIO_ICRB0_A                     *
+ *             IIO_ICRBE_B             IIO_ICRB0_B                     *
+ *             IIO_ICRBE_C             IIO_ICRB0_C                     *
+ *             IIO_ICRBE_D             IIO_ICRB0_D                     *
+ *             IIO_ICRBE_E             IIO_ICRB0_E                     *
+ *                                                                     *
+ ************************************************************************/
+
+/*
+ * Slightly friendlier names for some common registers.
+ */
+#define IIO_WIDGET              IIO_WID                /* Widget identification */
+#define IIO_WIDGET_STAT         IIO_WSTAT      /* Widget status register */
+#define IIO_WIDGET_CTRL         IIO_WCR                /* Widget control register */
+#define IIO_PROTECT             IIO_ILAPR      /* IO interface protection */
+#define IIO_PROTECT_OVRRD       IIO_ILAPO      /* IO protect override */
+#define IIO_OUTWIDGET_ACCESS    IIO_IOWA       /* Outbound widget access */
+#define IIO_INWIDGET_ACCESS     IIO_IIWA       /* Inbound widget access */
+#define IIO_INDEV_ERR_MASK      IIO_IIDEM      /* Inbound device error mask */
+#define IIO_LLP_CSR             IIO_ILCSR      /* LLP control and status */
+#define IIO_LLP_LOG             IIO_ILLR       /* LLP log */
+#define IIO_XTALKCC_TOUT        IIO_IXCC       /* Xtalk credit count timeout */
+#define IIO_XTALKTT_TOUT        IIO_IXTT       /* Xtalk tail timeout */
+#define IIO_IO_ERR_CLR          IIO_IECLR      /* IO error clear */
+#define IIO_IGFX_0             IIO_IGFX0
+#define IIO_IGFX_1             IIO_IGFX1
+#define IIO_IBCT_0             IIO_IBCT0
+#define IIO_IBCT_1             IIO_IBCT1
+#define IIO_IBLS_0             IIO_IBLS0
+#define IIO_IBLS_1             IIO_IBLS1
+#define IIO_IBSA_0             IIO_IBSA0
+#define IIO_IBSA_1             IIO_IBSA1
+#define IIO_IBDA_0             IIO_IBDA0
+#define IIO_IBDA_1             IIO_IBDA1
+#define IIO_IBNA_0             IIO_IBNA0
+#define IIO_IBNA_1             IIO_IBNA1
+#define IIO_IBIA_0             IIO_IBIA0
+#define IIO_IBIA_1             IIO_IBIA1
+#define IIO_IOPRB_0            IIO_IPRB0
+
+#define IIO_PRTE_A(_x)         (IIO_IPRTE0_A + (8 * (_x)))
+#define IIO_PRTE_B(_x)         (IIO_IPRTE0_B + (8 * (_x)))
+#define IIO_NUM_PRTES          8       /* Total number of PRB table entries */
+#define IIO_WIDPRTE_A(x)       IIO_PRTE_A(((x) - 8))   /* widget ID to its PRTE num */
+#define IIO_WIDPRTE_B(x)       IIO_PRTE_B(((x) - 8))   /* widget ID to its PRTE num */
+
+#define IIO_NUM_IPRBS          9
+
+#define IIO_LLP_CSR_IS_UP              0x00002000
+#define IIO_LLP_CSR_LLP_STAT_MASK       0x00003000
+#define IIO_LLP_CSR_LLP_STAT_SHFT       12
+
+#define IIO_LLP_CB_MAX  0xffff /* in ILLR CB_CNT, Max Check Bit errors */
+#define IIO_LLP_SN_MAX  0xffff /* in ILLR SN_CNT, Max Sequence Number errors */
+
+/* key to IIO_PROTECT_OVRRD */
+#define IIO_PROTECT_OVRRD_KEY   0x53474972756c6573ull  /* "SGIrules" */
+
+/* BTE register names */
+#define IIO_BTE_STAT_0          IIO_IBLS_0     /* Also BTE length/status 0 */
+#define IIO_BTE_SRC_0           IIO_IBSA_0     /* Also BTE source address  0 */
+#define IIO_BTE_DEST_0          IIO_IBDA_0     /* Also BTE dest. address 0 */
+#define IIO_BTE_CTRL_0          IIO_IBCT_0     /* Also BTE control/terminate 0 */
+#define IIO_BTE_NOTIFY_0        IIO_IBNA_0     /* Also BTE notification 0 */
+#define IIO_BTE_INT_0           IIO_IBIA_0     /* Also BTE interrupt 0 */
+#define IIO_BTE_OFF_0           0      /* Base offset from BTE 0 regs. */
+#define IIO_BTE_OFF_1          (IIO_IBLS_1 - IIO_IBLS_0)       /* Offset from base to BTE 1 */
+
+/* BTE register offsets from base */
+#define BTEOFF_STAT             0
+#define BTEOFF_SRC             (IIO_BTE_SRC_0 - IIO_BTE_STAT_0)
+#define BTEOFF_DEST            (IIO_BTE_DEST_0 - IIO_BTE_STAT_0)
+#define BTEOFF_CTRL            (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0)
+#define BTEOFF_NOTIFY          (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0)
+#define BTEOFF_INT             (IIO_BTE_INT_0 - IIO_BTE_STAT_0)
+
+/* names used in shub diags */
+#define IIO_BASE_BTE0   IIO_IBLS_0
+#define IIO_BASE_BTE1   IIO_IBLS_1
+
+/*
+ * Macro which takes the widget number, and returns the
+ * IO PRB address of that widget.
+ * value _x is expected to be a widget number in the range
+ * 0, 8 - 0xF
+ */
+#define IIO_IOPRB(_x)  (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
+                       (_x) : \
+                       (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
+
+/* GFX Flow Control Node/Widget Register */
+#define IIO_IGFX_W_NUM_BITS    4       /* size of widget num field */
+#define IIO_IGFX_W_NUM_MASK    ((1<<IIO_IGFX_W_NUM_BITS)-1)
+#define IIO_IGFX_W_NUM_SHIFT   0
+#define IIO_IGFX_PI_NUM_BITS   1       /* size of PI num field */
+#define IIO_IGFX_PI_NUM_MASK   ((1<<IIO_IGFX_PI_NUM_BITS)-1)
+#define IIO_IGFX_PI_NUM_SHIFT  4
+#define IIO_IGFX_N_NUM_BITS    8       /* size of node num field */
+#define IIO_IGFX_N_NUM_MASK    ((1<<IIO_IGFX_N_NUM_BITS)-1)
+#define IIO_IGFX_N_NUM_SHIFT   5
+#define IIO_IGFX_P_NUM_BITS    1       /* size of processor num field */
+#define IIO_IGFX_P_NUM_MASK    ((1<<IIO_IGFX_P_NUM_BITS)-1)
+#define IIO_IGFX_P_NUM_SHIFT   16
+#define IIO_IGFX_INIT(widget, pi, node, cpu)                           (\
+       (((widget) & IIO_IGFX_W_NUM_MASK) << IIO_IGFX_W_NUM_SHIFT) |     \
+       (((pi)     & IIO_IGFX_PI_NUM_MASK)<< IIO_IGFX_PI_NUM_SHIFT)|     \
+       (((node)   & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) |     \
+       (((cpu)    & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT))
+
+/* Scratch registers (all bits available) */
+#define IIO_SCRATCH_REG0        IIO_ISCR0
+#define IIO_SCRATCH_REG1        IIO_ISCR1
+#define IIO_SCRATCH_MASK        0xffffffffffffffffUL
+
+#define IIO_SCRATCH_BIT0_0      0x0000000000000001UL
+#define IIO_SCRATCH_BIT0_1      0x0000000000000002UL
+#define IIO_SCRATCH_BIT0_2      0x0000000000000004UL
+#define IIO_SCRATCH_BIT0_3      0x0000000000000008UL
+#define IIO_SCRATCH_BIT0_4      0x0000000000000010UL
+#define IIO_SCRATCH_BIT0_5      0x0000000000000020UL
+#define IIO_SCRATCH_BIT0_6      0x0000000000000040UL
+#define IIO_SCRATCH_BIT0_7      0x0000000000000080UL
+#define IIO_SCRATCH_BIT0_8      0x0000000000000100UL
+#define IIO_SCRATCH_BIT0_9      0x0000000000000200UL
+#define IIO_SCRATCH_BIT0_A      0x0000000000000400UL
+
+#define IIO_SCRATCH_BIT1_0      0x0000000000000001UL
+#define IIO_SCRATCH_BIT1_1      0x0000000000000002UL
+/* IO Translation Table Entries */
+#define IIO_NUM_ITTES   7      /* ITTEs numbered 0..6 */
+                                       /* Hw manuals number them 1..7! */
+/*
+ * IIO_IMEM Register fields.
+ */
+#define IIO_IMEM_W0ESD  0x1UL  /* Widget 0 shut down due to error */
+#define IIO_IMEM_B0ESD (1UL << 4)      /* BTE 0 shut down due to error */
+#define IIO_IMEM_B1ESD (1UL << 8)      /* BTE 1 Shut down due to error */
+
+/*
+ * As a permanent workaround for a bug in the PI side of the shub, we've
+ * redefined big window 7 as small window 0.
+ XXX does this still apply for SN1??
+ */
+#define HUB_NUM_BIG_WINDOW     (IIO_NUM_ITTES - 1)
+
+/*
+ * Use the top big window as a surrogate for the first small window
+ */
+#define SWIN0_BIGWIN            HUB_NUM_BIG_WINDOW
+
+#define ILCSR_WARM_RESET        0x100
+
+/*
+ * CRB manipulation macros
+ *     The CRB macros are slightly complicated, since there are up to
+ *     four registers associated with each CRB entry.
+ */
+#define IIO_NUM_CRBS            15     /* Number of CRBs */
+#define IIO_NUM_PC_CRBS         4      /* Number of partial cache CRBs */
+#define IIO_ICRB_OFFSET         8
+#define IIO_ICRB_0              IIO_ICRB0_A
+#define IIO_ICRB_ADDR_SHFT     2       /* Shift to get proper address */
+/* XXX - This is now tuneable:
+        #define IIO_FIRST_PC_ENTRY 12
+ */
+
+#define IIO_ICRB_A(_x) ((u64)(IIO_ICRB_0 + (6 * IIO_ICRB_OFFSET * (_x))))
+#define IIO_ICRB_B(_x) ((u64)((char *)IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET))
+#define IIO_ICRB_C(_x) ((u64)((char *)IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET))
+#define IIO_ICRB_D(_x) ((u64)((char *)IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET))
+#define IIO_ICRB_E(_x) ((u64)((char *)IIO_ICRB_A(_x) + 4*IIO_ICRB_OFFSET))
+
+#define TNUM_TO_WIDGET_DEV(_tnum)      (_tnum & 0x7)
+
+/*
+ * values for "ecode" field
+ */
+#define IIO_ICRB_ECODE_DERR     0      /* Directory error due to IIO access */
+#define IIO_ICRB_ECODE_PERR     1      /* Poison error on IO access */
+#define IIO_ICRB_ECODE_WERR     2      /* Write error by IIO access
+                                        * e.g. WINV to a Read only line. */
+#define IIO_ICRB_ECODE_AERR     3      /* Access error caused by IIO access */
+#define IIO_ICRB_ECODE_PWERR    4      /* Error on partial write */
+#define IIO_ICRB_ECODE_PRERR    5      /* Error on partial read  */
+#define IIO_ICRB_ECODE_TOUT     6      /* CRB timeout before deallocating */
+#define IIO_ICRB_ECODE_XTERR    7      /* Incoming xtalk pkt had error bit */
+
+/*
+ * Values for field imsgtype
+ */
+#define IIO_ICRB_IMSGT_XTALK    0      /* Incoming Meessage from Xtalk */
+#define IIO_ICRB_IMSGT_BTE      1      /* Incoming message from BTE    */
+#define IIO_ICRB_IMSGT_SN1NET   2      /* Incoming message from SN1 net */
+#define IIO_ICRB_IMSGT_CRB      3      /* Incoming message from CRB ???  */
+
+/*
+ * values for field initiator.
+ */
+#define IIO_ICRB_INIT_XTALK     0      /* Message originated in xtalk  */
+#define IIO_ICRB_INIT_BTE0      0x1    /* Message originated in BTE 0  */
+#define IIO_ICRB_INIT_SN1NET    0x2    /* Message originated in SN1net */
+#define IIO_ICRB_INIT_CRB       0x3    /* Message originated in CRB ?  */
+#define IIO_ICRB_INIT_BTE1      0x5    /* MEssage originated in BTE 1  */
+
+/*
+ * Number of credits Hub widget has while sending req/response to
+ * xbow.
+ * Value of 3 is required by Xbow 1.1
+ * We may be able to increase this to 4 with Xbow 1.2.
+ */
+#define                   HUBII_XBOW_CREDIT       3
+#define                   HUBII_XBOW_REV2_CREDIT  4
+
+/*
+ * Number of credits that xtalk devices should use when communicating
+ * with a SHub (depth of SHub's queue).
+ */
+#define HUB_CREDIT 4
+
+/*
+ * Some IIO_PRB fields
+ */
+#define IIO_PRB_MULTI_ERR      (1LL << 63)
+#define IIO_PRB_SPUR_RD                (1LL << 51)
+#define IIO_PRB_SPUR_WR                (1LL << 50)
+#define IIO_PRB_RD_TO          (1LL << 49)
+#define IIO_PRB_ERROR          (1LL << 48)
+
+/*************************************************************************
+
+ Some of the IIO field masks and shifts are defined here.
+ This is in order to maintain compatibility in SN0 and SN1 code
+**************************************************************************/
+
+/*
+ * ICMR register fields
+ * (Note: the IIO_ICMR_P_CNT and IIO_ICMR_PC_VLD from Hub are not
+ * present in SHub)
+ */
+
+#define IIO_ICMR_CRB_VLD_SHFT   20
+#define IIO_ICMR_CRB_VLD_MASK  (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT)
+
+#define IIO_ICMR_FC_CNT_SHFT    16
+#define IIO_ICMR_FC_CNT_MASK   (0xf << IIO_ICMR_FC_CNT_SHFT)
+
+#define IIO_ICMR_C_CNT_SHFT     4
+#define IIO_ICMR_C_CNT_MASK    (0xf << IIO_ICMR_C_CNT_SHFT)
+
+#define IIO_ICMR_PRECISE       (1UL << 52)
+#define IIO_ICMR_CLR_RPPD      (1UL << 13)
+#define IIO_ICMR_CLR_RQPD      (1UL << 12)
+
+/*
+ * IIO PIO Deallocation register field masks : (IIO_IPDR)
+ XXX present but not needed in bedrock?  See the manual.
+ */
+#define IIO_IPDR_PND           (1 << 4)
+
+/*
+ * IIO CRB deallocation register field masks: (IIO_ICDR)
+ */
+#define IIO_ICDR_PND           (1 << 4)
+
+/* 
+ * IO BTE Length/Status (IIO_IBLS) register bit field definitions
+ */
+#define IBLS_BUSY              (0x1UL << 20)
+#define IBLS_ERROR_SHFT                16
+#define IBLS_ERROR             (0x1UL << IBLS_ERROR_SHFT)
+#define IBLS_LENGTH_MASK       0xffff
+
+/*
+ * IO BTE Control/Terminate register (IBCT) register bit field definitions
+ */
+#define IBCT_POISON            (0x1UL << 8)
+#define IBCT_NOTIFY            (0x1UL << 4)
+#define IBCT_ZFIL_MODE         (0x1UL << 0)
+
+/*
+ * IIO Incoming Error Packet Header (IIO_IIEPH1/IIO_IIEPH2)
+ */
+#define IIEPH1_VALID           (1UL << 44)
+#define IIEPH1_OVERRUN         (1UL << 40)
+#define IIEPH1_ERR_TYPE_SHFT   32
+#define IIEPH1_ERR_TYPE_MASK   0xf
+#define IIEPH1_SOURCE_SHFT     20
+#define IIEPH1_SOURCE_MASK     11
+#define IIEPH1_SUPPL_SHFT      8
+#define IIEPH1_SUPPL_MASK      11
+#define IIEPH1_CMD_SHFT                0
+#define IIEPH1_CMD_MASK                7
+
+#define IIEPH2_TAIL            (1UL << 40)
+#define IIEPH2_ADDRESS_SHFT    0
+#define IIEPH2_ADDRESS_MASK    38
+
+#define IIEPH1_ERR_SHORT_REQ   2
+#define IIEPH1_ERR_SHORT_REPLY 3
+#define IIEPH1_ERR_LONG_REQ    4
+#define IIEPH1_ERR_LONG_REPLY  5
+
+/*
+ * IO Error Clear register bit field definitions
+ */
+#define IECLR_PI1_FWD_INT      (1UL << 31)     /* clear PI1_FORWARD_INT in iidsr */
+#define IECLR_PI0_FWD_INT      (1UL << 30)     /* clear PI0_FORWARD_INT in iidsr */
+#define IECLR_SPUR_RD_HDR      (1UL << 29)     /* clear valid bit in ixss reg */
+#define IECLR_BTE1             (1UL << 18)     /* clear bte error 1 */
+#define IECLR_BTE0             (1UL << 17)     /* clear bte error 0 */
+#define IECLR_CRAZY            (1UL << 16)     /* clear crazy bit in wstat reg */
+#define IECLR_PRB_F            (1UL << 15)     /* clear err bit in PRB_F reg */
+#define IECLR_PRB_E            (1UL << 14)     /* clear err bit in PRB_E reg */
+#define IECLR_PRB_D            (1UL << 13)     /* clear err bit in PRB_D reg */
+#define IECLR_PRB_C            (1UL << 12)     /* clear err bit in PRB_C reg */
+#define IECLR_PRB_B            (1UL << 11)     /* clear err bit in PRB_B reg */
+#define IECLR_PRB_A            (1UL << 10)     /* clear err bit in PRB_A reg */
+#define IECLR_PRB_9            (1UL << 9)      /* clear err bit in PRB_9 reg */
+#define IECLR_PRB_8            (1UL << 8)      /* clear err bit in PRB_8 reg */
+#define IECLR_PRB_0            (1UL << 0)      /* clear err bit in PRB_0 reg */
+
+/*
+ * IIO CRB control register Fields: IIO_ICCR 
+ */
+#define        IIO_ICCR_PENDING        0x10000
+#define        IIO_ICCR_CMD_MASK       0xFF
+#define        IIO_ICCR_CMD_SHFT       7
+#define        IIO_ICCR_CMD_NOP        0x0     /* No Op */
+#define        IIO_ICCR_CMD_WAKE       0x100   /* Reactivate CRB entry and process */
+#define        IIO_ICCR_CMD_TIMEOUT    0x200   /* Make CRB timeout & mark invalid */
+#define        IIO_ICCR_CMD_EJECT      0x400   /* Contents of entry written to memory
+                                        * via a WB
+                                        */
+#define        IIO_ICCR_CMD_FLUSH      0x800
+
+/*
+ *
+ * CRB Register description.
+ *
+ * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
+ * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
+ * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
+ * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
+ * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
+ *
+ * Many of the fields in CRB are status bits used by hardware
+ * for implementation of the protocol. It's very dangerous to
+ * mess around with the CRB registers.
+ *
+ * It's OK to read the CRB registers and try to make sense out of the
+ * fields in CRB.
+ *
+ * Updating CRB requires all activities in Hub IIO to be quiesced.
+ * otherwise, a write to CRB could corrupt other CRB entries.
+ * CRBs are here only as a back door peek to shub IIO's status.
+ * Quiescing implies  no dmas no PIOs
+ * either directly from the cpu or from sn0net.
+ * this is not something that can be done easily. So, AVOID updating
+ * CRBs.
+ */
+
+/*
+ * Easy access macros for CRBs, all 5 registers (A-E)
+ */
+typedef ii_icrb0_a_u_t icrba_t;
+#define a_sidn         ii_icrb0_a_fld_s.ia_sidn
+#define a_tnum         ii_icrb0_a_fld_s.ia_tnum
+#define a_addr          ii_icrb0_a_fld_s.ia_addr
+#define a_valid         ii_icrb0_a_fld_s.ia_vld
+#define a_iow           ii_icrb0_a_fld_s.ia_iow
+#define a_regvalue     ii_icrb0_a_regval
+
+typedef ii_icrb0_b_u_t icrbb_t;
+#define b_use_old       ii_icrb0_b_fld_s.ib_use_old
+#define b_imsgtype      ii_icrb0_b_fld_s.ib_imsgtype
+#define b_imsg          ii_icrb0_b_fld_s.ib_imsg
+#define b_initiator     ii_icrb0_b_fld_s.ib_init
+#define b_exc           ii_icrb0_b_fld_s.ib_exc
+#define b_ackcnt        ii_icrb0_b_fld_s.ib_ack_cnt
+#define b_resp          ii_icrb0_b_fld_s.ib_resp
+#define b_ack           ii_icrb0_b_fld_s.ib_ack
+#define b_hold          ii_icrb0_b_fld_s.ib_hold
+#define b_wb            ii_icrb0_b_fld_s.ib_wb
+#define b_intvn         ii_icrb0_b_fld_s.ib_intvn
+#define b_stall_ib      ii_icrb0_b_fld_s.ib_stall_ib
+#define b_stall_int     ii_icrb0_b_fld_s.ib_stall__intr
+#define b_stall_bte_0   ii_icrb0_b_fld_s.ib_stall__bte_0
+#define b_stall_bte_1   ii_icrb0_b_fld_s.ib_stall__bte_1
+#define b_error         ii_icrb0_b_fld_s.ib_error
+#define b_ecode         ii_icrb0_b_fld_s.ib_errcode
+#define b_lnetuce       ii_icrb0_b_fld_s.ib_ln_uce
+#define b_mark          ii_icrb0_b_fld_s.ib_mark
+#define b_xerr          ii_icrb0_b_fld_s.ib_xt_err
+#define b_regvalue     ii_icrb0_b_regval
+
+typedef ii_icrb0_c_u_t icrbc_t;
+#define c_suppl         ii_icrb0_c_fld_s.ic_suppl
+#define c_barrop        ii_icrb0_c_fld_s.ic_bo
+#define c_doresp        ii_icrb0_c_fld_s.ic_resprqd
+#define c_gbr           ii_icrb0_c_fld_s.ic_gbr
+#define c_btenum        ii_icrb0_c_fld_s.ic_bte_num
+#define c_cohtrans      ii_icrb0_c_fld_s.ic_ct
+#define c_xtsize        ii_icrb0_c_fld_s.ic_size
+#define c_source        ii_icrb0_c_fld_s.ic_source
+#define c_regvalue     ii_icrb0_c_regval
+
+typedef ii_icrb0_d_u_t icrbd_t;
+#define d_sleep         ii_icrb0_d_fld_s.id_sleep
+#define d_pricnt        ii_icrb0_d_fld_s.id_pr_cnt
+#define d_pripsc        ii_icrb0_d_fld_s.id_pr_psc
+#define d_bteop         ii_icrb0_d_fld_s.id_bte_op
+#define d_bteaddr       ii_icrb0_d_fld_s.id_pa_be      /* ic_pa_be fld has 2 names */
+#define d_benable       ii_icrb0_d_fld_s.id_pa_be      /* ic_pa_be fld has 2 names */
+#define d_regvalue     ii_icrb0_d_regval
+
+typedef ii_icrb0_e_u_t icrbe_t;
+#define icrbe_ctxtvld   ii_icrb0_e_fld_s.ie_cvld
+#define icrbe_toutvld   ii_icrb0_e_fld_s.ie_tvld
+#define icrbe_context   ii_icrb0_e_fld_s.ie_context
+#define icrbe_timeout   ii_icrb0_e_fld_s.ie_timeout
+#define e_regvalue     ii_icrb0_e_regval
+
+/* Number of widgets supported by shub */
+#define HUB_NUM_WIDGET          9
+#define HUB_WIDGET_ID_MIN       0x8
+#define HUB_WIDGET_ID_MAX       0xf
+
+#define HUB_WIDGET_PART_NUM     0xc120
+#define MAX_HUBS_PER_XBOW       2
+
+/* A few more #defines for backwards compatibility */
+#define iprb_t          ii_iprb0_u_t
+#define iprb_regval     ii_iprb0_regval
+#define iprb_mult_err  ii_iprb0_fld_s.i_mult_err
+#define iprb_spur_rd   ii_iprb0_fld_s.i_spur_rd
+#define iprb_spur_wr   ii_iprb0_fld_s.i_spur_wr
+#define iprb_rd_to     ii_iprb0_fld_s.i_rd_to
+#define iprb_ovflow     ii_iprb0_fld_s.i_of_cnt
+#define iprb_error      ii_iprb0_fld_s.i_error
+#define iprb_ff         ii_iprb0_fld_s.i_f
+#define iprb_mode       ii_iprb0_fld_s.i_m
+#define iprb_bnakctr    ii_iprb0_fld_s.i_nb
+#define iprb_anakctr    ii_iprb0_fld_s.i_na
+#define iprb_xtalkctr   ii_iprb0_fld_s.i_c
+
+#define LNK_STAT_WORKING        0x2            /* LLP is working */
+
+#define IIO_WSTAT_ECRAZY       (1ULL << 32)    /* Hub gone crazy */
+#define IIO_WSTAT_TXRETRY      (1ULL << 9)     /* Hub Tx Retry timeout */
+#define IIO_WSTAT_TXRETRY_MASK  0x7F           /* should be 0xFF?? */
+#define IIO_WSTAT_TXRETRY_SHFT  16
+#define IIO_WSTAT_TXRETRY_CNT(w)       (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \
+                                       IIO_WSTAT_TXRETRY_MASK)
+
+/* Number of II perf. counters we can multiplex at once */
+
+#define IO_PERF_SETS   32
+
+/* Bit for the widget in inbound access register */
+#define IIO_IIWA_WIDGET(_w)    ((u64)(1ULL << _w))
+/* Bit for the widget in outbound access register */
+#define IIO_IOWA_WIDGET(_w)    ((u64)(1ULL << _w))
+
+/* NOTE: The following define assumes that we are going to get
+ * widget numbers from 8 thru F and the device numbers within
+ * widget from 0 thru 7.
+ */
+#define IIO_IIDEM_WIDGETDEV_MASK(w, d) ((u64)(1ULL << (8 * ((w) - 8) + (d))))
+
+/* IO Interrupt Destination Register */
+#define IIO_IIDSR_SENT_SHIFT    28
+#define IIO_IIDSR_SENT_MASK     0x30000000
+#define IIO_IIDSR_ENB_SHIFT     24
+#define IIO_IIDSR_ENB_MASK      0x01000000
+#define IIO_IIDSR_NODE_SHIFT    9
+#define IIO_IIDSR_NODE_MASK     0x000ff700
+#define IIO_IIDSR_PI_ID_SHIFT   8
+#define IIO_IIDSR_PI_ID_MASK    0x00000100
+#define IIO_IIDSR_LVL_SHIFT     0
+#define IIO_IIDSR_LVL_MASK      0x000000ff
+
+/* Xtalk timeout threshhold register (IIO_IXTT) */
+#define IXTT_RRSP_TO_SHFT      55      /* read response timeout */
+#define IXTT_RRSP_TO_MASK      (0x1FULL << IXTT_RRSP_TO_SHFT)
+#define IXTT_RRSP_PS_SHFT      32      /* read responsed TO prescalar */
+#define IXTT_RRSP_PS_MASK      (0x7FFFFFULL << IXTT_RRSP_PS_SHFT)
+#define IXTT_TAIL_TO_SHFT      0       /* tail timeout counter threshold */
+#define IXTT_TAIL_TO_MASK      (0x3FFFFFFULL << IXTT_TAIL_TO_SHFT)
+
+/*
+ * The IO LLP control status register and widget control register
+ */
+
+typedef union hubii_wcr_u {
+       u64 wcr_reg_value;
+       struct {
+               u64 wcr_widget_id:4,    /* LLP crossbar credit */
+                wcr_tag_mode:1,        /* Tag mode */
+                wcr_rsvd1:8,   /* Reserved */
+                wcr_xbar_crd:3,        /* LLP crossbar credit */
+                wcr_f_bad_pkt:1,       /* Force bad llp pkt enable */
+                wcr_dir_con:1, /* widget direct connect */
+                wcr_e_thresh:5,        /* elasticity threshold */
+                wcr_rsvd:41;   /* unused */
+       } wcr_fields_s;
+} hubii_wcr_t;
+
+#define iwcr_dir_con    wcr_fields_s.wcr_dir_con
+
+/* The structures below are defined to extract and modify the ii
+performance registers */
+
+/* io_perf_sel allows the caller to specify what tests will be
+   performed */
+
+typedef union io_perf_sel {
+       u64 perf_sel_reg;
+       struct {
+               u64 perf_ippr0:4, perf_ippr1:4, perf_icct:8, perf_rsvd:48;
+       } perf_sel_bits;
+} io_perf_sel_t;
+
+/* io_perf_cnt is to extract the count from the shub registers. Due to
+   hardware problems there is only one counter, not two. */
+
+typedef union io_perf_cnt {
+       u64 perf_cnt;
+       struct {
+               u64 perf_cnt:20, perf_rsvd2:12, perf_rsvd1:32;
+       } perf_cnt_bits;
+
+} io_perf_cnt_t;
+
+typedef union iprte_a {
+       u64 entry;
+       struct {
+               u64 i_rsvd_1:3;
+               u64 i_addr:38;
+               u64 i_init:3;
+               u64 i_source:8;
+               u64 i_rsvd:2;
+               u64 i_widget:4;
+               u64 i_to_cnt:5;
+               u64 i_vld:1;
+       } iprte_fields;
+} iprte_a_t;
+
+#endif                         /* _ASM_IA64_SN_SHUBIO_H */
diff --git a/arch/ia64/include/asm/sn/simulator.h b/arch/ia64/include/asm/sn/simulator.h
new file mode 100644 (file)
index 0000000..c2611f6
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_SIMULATOR_H
+#define _ASM_IA64_SN_SIMULATOR_H
+
+#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_SGI_UV)
+#define SNMAGIC 0xaeeeeeee8badbeefL
+#define IS_MEDUSA()                    ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;})
+
+#define SIMULATOR_SLEEP()              asm("nop.i 0x8beef")
+#define IS_RUNNING_ON_SIMULATOR()      (sn_prom_type)
+#define IS_RUNNING_ON_FAKE_PROM()      (sn_prom_type == 2)
+extern int sn_prom_type;               /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
+#else
+#define IS_MEDUSA()                    0
+#define SIMULATOR_SLEEP()
+#define IS_RUNNING_ON_SIMULATOR()      0
+#endif
+
+#endif /* _ASM_IA64_SN_SIMULATOR_H */
diff --git a/arch/ia64/include/asm/sn/sn2/sn_hwperf.h b/arch/ia64/include/asm/sn/sn2/sn_hwperf.h
new file mode 100644 (file)
index 0000000..e61ebac
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * 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) 2004 Silicon Graphics, Inc. All rights reserved.
+ *
+ * Data types used by the SN_SAL_HWPERF_OP SAL call for monitoring
+ * SGI Altix node and router hardware
+ *
+ * Mark Goodwin <markgw@sgi.com> Mon Aug 30 12:23:46 EST 2004
+ */
+
+#ifndef SN_HWPERF_H
+#define SN_HWPERF_H
+
+/*
+ * object structure. SN_HWPERF_ENUM_OBJECTS and SN_HWPERF_GET_CPU_INFO
+ * return an array of these. Do not change this without also
+ * changing the corresponding SAL code.
+ */
+#define SN_HWPERF_MAXSTRING            128
+struct sn_hwperf_object_info {
+       u32 id;
+       union {
+               struct {
+                       u64 this_part:1;
+                       u64 is_shared:1;
+               } fields;
+               struct {
+                       u64 flags;
+                       u64 reserved;
+               } b;
+       } f;
+       char name[SN_HWPERF_MAXSTRING];
+       char location[SN_HWPERF_MAXSTRING];
+       u32 ports;
+};
+
+#define sn_hwp_this_part       f.fields.this_part
+#define sn_hwp_is_shared       f.fields.is_shared
+#define sn_hwp_flags           f.b.flags
+
+/* macros for object classification */
+#define SN_HWPERF_IS_NODE(x)           ((x) && strstr((x)->name, "SHub"))
+#define SN_HWPERF_IS_NODE_SHUB2(x)     ((x) && strstr((x)->name, "SHub 2."))
+#define SN_HWPERF_IS_IONODE(x)         ((x) && strstr((x)->name, "TIO"))
+#define SN_HWPERF_IS_NL3ROUTER(x)      ((x) && strstr((x)->name, "NL3Router"))
+#define SN_HWPERF_IS_NL4ROUTER(x)      ((x) && strstr((x)->name, "NL4Router"))
+#define SN_HWPERF_IS_OLDROUTER(x)      ((x) && strstr((x)->name, "Router"))
+#define SN_HWPERF_IS_ROUTER(x)         (SN_HWPERF_IS_NL3ROUTER(x) ||           \
+                                               SN_HWPERF_IS_NL4ROUTER(x) ||    \
+                                               SN_HWPERF_IS_OLDROUTER(x))
+#define SN_HWPERF_FOREIGN(x)           ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared)
+#define SN_HWPERF_SAME_OBJTYPE(x,y)    ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\
+                                       (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\
+                                       (SN_HWPERF_IS_ROUTER(x) && SN_HWPERF_IS_ROUTER(y)))
+
+/* numa port structure, SN_HWPERF_ENUM_PORTS returns an array of these */
+struct sn_hwperf_port_info {
+       u32 port;
+       u32 conn_id;
+       u32 conn_port;
+};
+
+/* for HWPERF_{GET,SET}_MMRS */
+struct sn_hwperf_data {
+       u64 addr;
+       u64 data;
+};
+
+/* user ioctl() argument, see below */
+struct sn_hwperf_ioctl_args {
+        u64 arg;               /* argument, usually an object id */
+        u64 sz;                 /* size of transfer */
+        void *ptr;              /* pointer to source/target */
+        u32 v0;                        /* second return value */
+};
+
+/*
+ * For SN_HWPERF_{GET,SET}_MMRS and SN_HWPERF_OBJECT_DISTANCE,
+ * sn_hwperf_ioctl_args.arg can be used to specify a CPU on which
+ * to call SAL, and whether to use an interprocessor interrupt
+ * or task migration in order to do so. If the CPU specified is
+ * SN_HWPERF_ARG_ANY_CPU, then the current CPU will be used.
+ */
+#define SN_HWPERF_ARG_ANY_CPU          0x7fffffffUL
+#define SN_HWPERF_ARG_CPU_MASK         0x7fffffff00000000ULL
+#define SN_HWPERF_ARG_USE_IPI_MASK     0x8000000000000000ULL
+#define SN_HWPERF_ARG_OBJID_MASK       0x00000000ffffffffULL
+
+/* 
+ * ioctl requests on the "sn_hwperf" misc device that call SAL.
+ */
+#define SN_HWPERF_OP_MEM_COPYIN                0x1000
+#define SN_HWPERF_OP_MEM_COPYOUT       0x2000
+#define SN_HWPERF_OP_MASK              0x0fff
+
+/*
+ * Determine mem requirement.
+ * arg don't care
+ * sz  8
+ * p   pointer to u64 integer
+ */
+#define        SN_HWPERF_GET_HEAPSIZE          1
+
+/*
+ * Install mem for SAL drvr
+ * arg don't care
+ * sz  sizeof buffer pointed to by p
+ * p   pointer to buffer for scratch area
+ */
+#define SN_HWPERF_INSTALL_HEAP         2
+
+/*
+ * Determine number of objects
+ * arg don't care
+ * sz  8
+ * p   pointer to u64 integer
+ */
+#define SN_HWPERF_OBJECT_COUNT         (10|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Determine object "distance", relative to a cpu. This operation can
+ * execute on a designated logical cpu number, using either an IPI or
+ * via task migration. If the cpu number is SN_HWPERF_ANY_CPU, then
+ * the current CPU is used. See the SN_HWPERF_ARG_* macros above.
+ *
+ * arg bitmap of IPI flag, cpu number and object id
+ * sz  8
+ * p   pointer to u64 integer
+ */
+#define SN_HWPERF_OBJECT_DISTANCE      (11|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Enumerate objects. Special case if sz == 8, returns the required
+ * buffer size.
+ * arg don't care
+ * sz  sizeof buffer pointed to by p
+ * p   pointer to array of struct sn_hwperf_object_info
+ */
+#define SN_HWPERF_ENUM_OBJECTS         (12|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Enumerate NumaLink ports for an object. Special case if sz == 8,
+ * returns the required buffer size.
+ * arg object id
+ * sz  sizeof buffer pointed to by p
+ * p   pointer to array of struct sn_hwperf_port_info
+ */
+#define SN_HWPERF_ENUM_PORTS           (13|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * SET/GET memory mapped registers. These operations can execute
+ * on a designated logical cpu number, using either an IPI or via
+ * task migration. If the cpu number is SN_HWPERF_ANY_CPU, then
+ * the current CPU is used. See the SN_HWPERF_ARG_* macros above.
+ *
+ * arg bitmap of ipi flag, cpu number and object id
+ * sz  sizeof buffer pointed to by p
+ * p   pointer to array of struct sn_hwperf_data
+ */
+#define SN_HWPERF_SET_MMRS             (14|SN_HWPERF_OP_MEM_COPYIN)
+#define SN_HWPERF_GET_MMRS             (15|SN_HWPERF_OP_MEM_COPYOUT| \
+                                           SN_HWPERF_OP_MEM_COPYIN)
+/*
+ * Lock a shared object
+ * arg object id
+ * sz  don't care
+ * p   don't care
+ */
+#define SN_HWPERF_ACQUIRE              16
+
+/*
+ * Unlock a shared object
+ * arg object id
+ * sz  don't care
+ * p   don't care
+ */
+#define SN_HWPERF_RELEASE              17
+
+/*
+ * Break a lock on a shared object
+ * arg object id
+ * sz  don't care
+ * p   don't care
+ */
+#define SN_HWPERF_FORCE_RELEASE                18
+
+/*
+ * ioctl requests on "sn_hwperf" that do not call SAL
+ */
+
+/*
+ * get cpu info as an array of hwperf_object_info_t. 
+ * id is logical CPU number, name is description, location
+ * is geoid (e.g. 001c04#1c). Special case if sz == 8,
+ * returns the required buffer size.
+ *
+ * arg don't care
+ * sz  sizeof buffer pointed to by p
+ * p   pointer to array of struct sn_hwperf_object_info
+ */
+#define SN_HWPERF_GET_CPU_INFO         (100|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Given an object id, return it's node number (aka cnode).
+ * arg object id
+ * sz  8
+ * p   pointer to u64 integer
+ */
+#define SN_HWPERF_GET_OBJ_NODE         (101|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Given a node number (cnode), return it's nasid.
+ * arg ordinal node number (aka cnodeid)
+ * sz  8
+ * p   pointer to u64 integer
+ */
+#define SN_HWPERF_GET_NODE_NASID       (102|SN_HWPERF_OP_MEM_COPYOUT)
+
+/*
+ * Given a node id, determine the id of the nearest node with CPUs
+ * and the id of the nearest node that has memory. The argument
+ * node would normally be a "headless" node, e.g. an "IO node".
+ * Return 0 on success.
+ */
+extern int sn_hwperf_get_nearest_node(cnodeid_t node,
+       cnodeid_t *near_mem, cnodeid_t *near_cpu);
+
+/* return codes */
+#define SN_HWPERF_OP_OK                        0
+#define SN_HWPERF_OP_NOMEM             1
+#define SN_HWPERF_OP_NO_PERM           2
+#define SN_HWPERF_OP_IO_ERROR          3
+#define SN_HWPERF_OP_BUSY              4
+#define SN_HWPERF_OP_RECONFIGURE       253
+#define SN_HWPERF_OP_INVAL             254
+
+int sn_topology_open(struct inode *inode, struct file *file);
+int sn_topology_release(struct inode *inode, struct file *file);
+#endif                         /* SN_HWPERF_H */
diff --git a/arch/ia64/include/asm/sn/sn_cpuid.h b/arch/ia64/include/asm/sn/sn_cpuid.h
new file mode 100644 (file)
index 0000000..a676dd9
--- /dev/null
@@ -0,0 +1,132 @@
+/* 
+ *
+ * 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) 2000-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+
+#ifndef _ASM_IA64_SN_SN_CPUID_H
+#define _ASM_IA64_SN_SN_CPUID_H
+
+#include <linux/smp.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/pda.h>
+#include <asm/intrinsics.h>
+
+
+/*
+ * Functions for converting between cpuids, nodeids and NASIDs.
+ * 
+ * These are for SGI platforms only.
+ *
+ */
+
+
+
+
+/*
+ *  Definitions of terms (these definitions are for IA64 ONLY. Other architectures
+ *  use cpuid/cpunum quite defferently):
+ *
+ *        CPUID - a number in range of 0..NR_CPUS-1 that uniquely identifies
+ *             the cpu. The value cpuid has no significance on IA64 other than
+ *             the boot cpu is 0.
+ *                     smp_processor_id() returns the cpuid of the current cpu.
+ *
+ *        CPU_PHYSICAL_ID (also known as HARD_PROCESSOR_ID)
+ *             This is the same as 31:24 of the processor LID register
+ *                     hard_smp_processor_id()- cpu_physical_id of current processor
+ *                     cpu_physical_id(cpuid) - convert a <cpuid> to a <physical_cpuid>
+ *                     cpu_logical_id(phy_id) - convert a <physical_cpuid> to a <cpuid> 
+ *                             * not real efficient - don't use in perf critical code
+ *
+ *         SLICE - a number in the range of 0 - 3 (typically) that represents the
+ *             cpu number on a brick.
+ *
+ *        SUBNODE - (almost obsolete) the number of the FSB that a cpu is
+ *             connected to. This is also the same as the PI number. Usually 0 or 1.
+ *
+ *     NOTE!!!: the value of the bits in the cpu physical id (SAPICid or LID) of a cpu has no 
+ *     significance. The SAPIC id (LID) is a 16-bit cookie that has meaning only to the PROM.
+ *
+ *
+ * The macros convert between cpu physical ids & slice/nasid/cnodeid.
+ * These terms are described below:
+ *
+ *
+ * Brick
+ *          -----   -----           -----   -----       CPU
+ *          | 0 |   | 1 |           | 0 |   | 1 |       SLICE
+ *          -----   -----           -----   -----
+ *            |       |               |       |
+ *            |       |               |       |
+ *          0 |       | 2           0 |       | 2       FSB SLOT
+ *             -------                 -------  
+ *                |                       |
+ *                |                       |
+ *                |                       |
+ *             ------------      -------------
+ *             |          |      |           |
+ *             |    SHUB  |      |   SHUB    |        NASID   (0..MAX_NASIDS)
+ *             |          |----- |           |        CNODEID (0..num_compact_nodes-1)
+ *             |          |      |           |
+ *             |          |      |           |
+ *             ------------      -------------
+ *                   |                 |
+ *                           
+ *
+ */
+
+#define get_node_number(addr)                  NASID_GET(addr)
+
+/*
+ * NOTE: on non-MP systems, only cpuid 0 exists
+ */
+
+extern short physical_node_map[];      /* indexed by nasid to get cnode */
+
+/*
+ * Macros for retrieving info about current cpu
+ */
+#define get_nasid()    (sn_nodepda->phys_cpuid[smp_processor_id()].nasid)
+#define get_subnode()  (sn_nodepda->phys_cpuid[smp_processor_id()].subnode)
+#define get_slice()    (sn_nodepda->phys_cpuid[smp_processor_id()].slice)
+#define get_cnode()    (sn_nodepda->phys_cpuid[smp_processor_id()].cnode)
+#define get_sapicid()  ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
+
+/*
+ * Macros for retrieving info about an arbitrary cpu
+ *     cpuid - logical cpu id
+ */
+#define cpuid_to_nasid(cpuid)          (sn_nodepda->phys_cpuid[cpuid].nasid)
+#define cpuid_to_subnode(cpuid)                (sn_nodepda->phys_cpuid[cpuid].subnode)
+#define cpuid_to_slice(cpuid)          (sn_nodepda->phys_cpuid[cpuid].slice)
+
+
+/*
+ * Dont use the following in performance critical code. They require scans
+ * of potentially large tables.
+ */
+extern int nasid_slice_to_cpuid(int, int);
+
+/*
+ * cnodeid_to_nasid - convert a cnodeid to a NASID
+ */
+#define cnodeid_to_nasid(cnodeid)      (sn_cnodeid_to_nasid[cnodeid])
+/*
+ * nasid_to_cnodeid - convert a NASID to a cnodeid
+ */
+#define nasid_to_cnodeid(nasid)                (physical_node_map[nasid])
+
+/*
+ * partition_coherence_id - get the coherence ID of the current partition
+ */
+extern u8 sn_coherency_id;
+#define partition_coherence_id()       (sn_coherency_id)
+
+#endif /* _ASM_IA64_SN_SN_CPUID_H */
+
diff --git a/arch/ia64/include/asm/sn/sn_feature_sets.h b/arch/ia64/include/asm/sn/sn_feature_sets.h
new file mode 100644 (file)
index 0000000..8e83ac1
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _ASM_IA64_SN_FEATURE_SETS_H
+#define _ASM_IA64_SN_FEATURE_SETS_H
+
+/*
+ * SN PROM Features
+ *
+ * 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) 2005-2006 Silicon Graphics, Inc.  All rights reserved.
+ */
+
+
+/* --------------------- PROM Features -----------------------------*/
+extern int sn_prom_feature_available(int id);
+
+#define MAX_PROM_FEATURE_SETS                  2
+
+/*
+ * The following defines features that may or may not be supported by the
+ * current PROM. The OS uses sn_prom_feature_available(feature) to test for
+ * the presence of a PROM feature. Down rev (old) PROMs will always test
+ * "false" for new features.
+ *
+ * Use:
+ *             if (sn_prom_feature_available(PRF_XXX))
+ *                     ...
+ */
+
+#define PRF_PAL_CACHE_FLUSH_SAFE       0
+#define PRF_DEVICE_FLUSH_LIST          1
+#define PRF_HOTPLUG_SUPPORT            2
+#define PRF_CPU_DISABLE_SUPPORT                3
+
+/* --------------------- OS Features -------------------------------*/
+
+/*
+ * The following defines OS features that are optionally present in
+ * the operating system.
+ * During boot, PROM is notified of these features via a series of calls:
+ *
+ *             ia64_sn_set_os_feature(feature1);
+ *
+ * Once enabled, a feature cannot be disabled.
+ *
+ * By default, features are disabled unless explicitly enabled.
+ *
+ * These defines must be kept in sync with the corresponding
+ * PROM definitions in feature_sets.h.
+ */
+#define  OSF_MCA_SLV_TO_OS_INIT_SLV    0
+#define  OSF_FEAT_LOG_SBES             1
+#define  OSF_ACPI_ENABLE               2
+#define  OSF_PCISEGMENT_ENABLE         3
+
+
+#endif /* _ASM_IA64_SN_FEATURE_SETS_H */
diff --git a/arch/ia64/include/asm/sn/sn_sal.h b/arch/ia64/include/asm/sn/sn_sal.h
new file mode 100644 (file)
index 0000000..57e649d
--- /dev/null
@@ -0,0 +1,1188 @@
+#ifndef _ASM_IA64_SN_SN_SAL_H
+#define _ASM_IA64_SN_SN_SAL_H
+
+/*
+ * System Abstraction Layer definitions for IA64
+ *
+ * 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) 2000-2006 Silicon Graphics, Inc.  All rights reserved.
+ */
+
+
+#include <asm/sal.h>
+#include <asm/sn/sn_cpuid.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/geo.h>
+#include <asm/sn/nodepda.h>
+#include <asm/sn/shub_mmr.h>
+
+// SGI Specific Calls
+#define  SN_SAL_POD_MODE                           0x02000001
+#define  SN_SAL_SYSTEM_RESET                       0x02000002
+#define  SN_SAL_PROBE                              0x02000003
+#define  SN_SAL_GET_MASTER_NASID                   0x02000004
+#define         SN_SAL_GET_KLCONFIG_ADDR                  0x02000005
+#define  SN_SAL_LOG_CE                            0x02000006
+#define  SN_SAL_REGISTER_CE                       0x02000007
+#define  SN_SAL_GET_PARTITION_ADDR                0x02000009
+#define  SN_SAL_XP_ADDR_REGION                    0x0200000f
+#define  SN_SAL_NO_FAULT_ZONE_VIRTUAL             0x02000010
+#define  SN_SAL_NO_FAULT_ZONE_PHYSICAL            0x02000011
+#define  SN_SAL_PRINT_ERROR                       0x02000012
+#define  SN_SAL_REGISTER_PMI_HANDLER              0x02000014
+#define  SN_SAL_SET_ERROR_HANDLING_FEATURES       0x0200001a   // reentrant
+#define  SN_SAL_GET_FIT_COMPT                     0x0200001b   // reentrant
+#define  SN_SAL_GET_SAPIC_INFO                     0x0200001d
+#define  SN_SAL_GET_SN_INFO                        0x0200001e
+#define  SN_SAL_CONSOLE_PUTC                       0x02000021
+#define  SN_SAL_CONSOLE_GETC                       0x02000022
+#define  SN_SAL_CONSOLE_PUTS                       0x02000023
+#define  SN_SAL_CONSOLE_GETS                       0x02000024
+#define  SN_SAL_CONSOLE_GETS_TIMEOUT               0x02000025
+#define  SN_SAL_CONSOLE_POLL                       0x02000026
+#define  SN_SAL_CONSOLE_INTR                       0x02000027
+#define  SN_SAL_CONSOLE_PUTB                      0x02000028
+#define  SN_SAL_CONSOLE_XMIT_CHARS                0x0200002a
+#define  SN_SAL_CONSOLE_READC                     0x0200002b
+#define  SN_SAL_SYSCTL_OP                         0x02000030
+#define  SN_SAL_SYSCTL_MODID_GET                  0x02000031
+#define  SN_SAL_SYSCTL_GET                         0x02000032
+#define  SN_SAL_SYSCTL_IOBRICK_MODULE_GET          0x02000033
+#define  SN_SAL_SYSCTL_IO_PORTSPEED_GET            0x02000035
+#define  SN_SAL_SYSCTL_SLAB_GET                    0x02000036
+#define  SN_SAL_BUS_CONFIG                        0x02000037
+#define  SN_SAL_SYS_SERIAL_GET                    0x02000038
+#define  SN_SAL_PARTITION_SERIAL_GET              0x02000039
+#define  SN_SAL_SYSCTL_PARTITION_GET               0x0200003a
+#define  SN_SAL_SYSTEM_POWER_DOWN                 0x0200003b
+#define  SN_SAL_GET_MASTER_BASEIO_NASID                   0x0200003c
+#define  SN_SAL_COHERENCE                          0x0200003d
+#define  SN_SAL_MEMPROTECT                         0x0200003e
+#define  SN_SAL_SYSCTL_FRU_CAPTURE                0x0200003f
+
+#define  SN_SAL_SYSCTL_IOBRICK_PCI_OP             0x02000042   // reentrant
+#define         SN_SAL_IROUTER_OP                         0x02000043
+#define  SN_SAL_SYSCTL_EVENT                       0x02000044
+#define  SN_SAL_IOIF_INTERRUPT                    0x0200004a
+#define  SN_SAL_HWPERF_OP                         0x02000050   // lock
+#define  SN_SAL_IOIF_ERROR_INTERRUPT              0x02000051
+#define  SN_SAL_IOIF_PCI_SAFE                     0x02000052
+#define  SN_SAL_IOIF_SLOT_ENABLE                  0x02000053
+#define  SN_SAL_IOIF_SLOT_DISABLE                 0x02000054
+#define  SN_SAL_IOIF_GET_HUBDEV_INFO              0x02000055
+#define  SN_SAL_IOIF_GET_PCIBUS_INFO              0x02000056
+#define  SN_SAL_IOIF_GET_PCIDEV_INFO              0x02000057
+#define  SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST     0x02000058   // deprecated
+#define  SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST     0x0200005a
+
+#define SN_SAL_IOIF_INIT                          0x0200005f
+#define SN_SAL_HUB_ERROR_INTERRUPT                0x02000060
+#define SN_SAL_BTE_RECOVER                        0x02000061
+#define SN_SAL_RESERVED_DO_NOT_USE                0x02000062
+#define SN_SAL_IOIF_GET_PCI_TOPOLOGY              0x02000064
+
+#define  SN_SAL_GET_PROM_FEATURE_SET              0x02000065
+#define  SN_SAL_SET_OS_FEATURE_SET                0x02000066
+#define  SN_SAL_INJECT_ERROR                      0x02000067
+#define  SN_SAL_SET_CPU_NUMBER                    0x02000068
+
+#define  SN_SAL_KERNEL_LAUNCH_EVENT               0x02000069
+
+/*
+ * Service-specific constants
+ */
+
+/* Console interrupt manipulation */
+       /* action codes */
+#define SAL_CONSOLE_INTR_OFF    0       /* turn the interrupt off */
+#define SAL_CONSOLE_INTR_ON     1       /* turn the interrupt on */
+#define SAL_CONSOLE_INTR_STATUS 2      /* retrieve the interrupt status */
+       /* interrupt specification & status return codes */
+#define SAL_CONSOLE_INTR_XMIT  1       /* output interrupt */
+#define SAL_CONSOLE_INTR_RECV  2       /* input interrupt */
+
+/* interrupt handling */
+#define SAL_INTR_ALLOC         1
+#define SAL_INTR_FREE          2
+#define SAL_INTR_REDIRECT      3
+
+/*
+ * operations available on the generic SN_SAL_SYSCTL_OP
+ * runtime service
+ */
+#define SAL_SYSCTL_OP_IOBOARD          0x0001  /*  retrieve board type */
+#define SAL_SYSCTL_OP_TIO_JLCK_RST      0x0002  /* issue TIO clock reset */
+
+/*
+ * IRouter (i.e. generalized system controller) operations
+ */
+#define SAL_IROUTER_OPEN       0       /* open a subchannel */
+#define SAL_IROUTER_CLOSE      1       /* close a subchannel */
+#define SAL_IROUTER_SEND       2       /* send part of an IRouter packet */
+#define SAL_IROUTER_RECV       3       /* receive part of an IRouter packet */
+#define SAL_IROUTER_INTR_STATUS        4       /* check the interrupt status for
+                                        * an open subchannel
+                                        */
+#define SAL_IROUTER_INTR_ON    5       /* enable an interrupt */
+#define SAL_IROUTER_INTR_OFF   6       /* disable an interrupt */
+#define SAL_IROUTER_INIT       7       /* initialize IRouter driver */
+
+/* IRouter interrupt mask bits */
+#define SAL_IROUTER_INTR_XMIT  SAL_CONSOLE_INTR_XMIT
+#define SAL_IROUTER_INTR_RECV  SAL_CONSOLE_INTR_RECV
+
+/*
+ * Error Handling Features
+ */
+#define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV    0x1     // obsolete
+#define SAL_ERR_FEAT_LOG_SBES                  0x2     // obsolete
+#define SAL_ERR_FEAT_MFR_OVERRIDE              0x4
+#define SAL_ERR_FEAT_SBE_THRESHOLD             0xffff0000
+
+/*
+ * SAL Error Codes
+ */
+#define SALRET_MORE_PASSES     1
+#define SALRET_OK              0
+#define SALRET_NOT_IMPLEMENTED (-1)
+#define SALRET_INVALID_ARG     (-2)
+#define SALRET_ERROR           (-3)
+
+#define SN_SAL_FAKE_PROM                          0x02009999
+
+/**
+  * sn_sal_revision - get the SGI SAL revision number
+  *
+  * The SGI PROM stores its version in the sal_[ab]_rev_(major|minor).
+  * This routine simply extracts the major and minor values and
+  * presents them in a u32 format.
+  *
+  * For example, version 4.05 would be represented at 0x0405.
+  */
+static inline u32
+sn_sal_rev(void)
+{
+       struct ia64_sal_systab *systab = __va(efi.sal_systab);
+
+       return (u32)(systab->sal_b_rev_major << 8 | systab->sal_b_rev_minor);
+}
+
+/*
+ * Returns the master console nasid, if the call fails, return an illegal
+ * value.
+ */
+static inline u64
+ia64_sn_get_console_nasid(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL(ret_stuff, SN_SAL_GET_MASTER_NASID, 0, 0, 0, 0, 0, 0, 0);
+
+       if (ret_stuff.status < 0)
+               return ret_stuff.status;
+
+       /* Master console nasid is in 'v0' */
+       return ret_stuff.v0;
+}
+
+/*
+ * Returns the master baseio nasid, if the call fails, return an illegal
+ * value.
+ */
+static inline u64
+ia64_sn_get_master_baseio_nasid(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL(ret_stuff, SN_SAL_GET_MASTER_BASEIO_NASID, 0, 0, 0, 0, 0, 0, 0);
+
+       if (ret_stuff.status < 0)
+               return ret_stuff.status;
+
+       /* Master baseio nasid is in 'v0' */
+       return ret_stuff.v0;
+}
+
+static inline void *
+ia64_sn_get_klconfig_addr(nasid_t nasid)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
+       return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
+}
+
+/*
+ * Returns the next console character.
+ */
+static inline u64
+ia64_sn_console_getc(int *ch)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_GETC, 0, 0, 0, 0, 0, 0, 0);
+
+       /* character is in 'v0' */
+       *ch = (int)ret_stuff.v0;
+
+       return ret_stuff.status;
+}
+
+/*
+ * Read a character from the SAL console device, after a previous interrupt
+ * or poll operation has given us to know that a character is available
+ * to be read.
+ */
+static inline u64
+ia64_sn_console_readc(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_READC, 0, 0, 0, 0, 0, 0, 0);
+
+       /* character is in 'v0' */
+       return ret_stuff.v0;
+}
+
+/*
+ * Sends the given character to the console.
+ */
+static inline u64
+ia64_sn_console_putc(char ch)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_PUTC, (u64)ch, 0, 0, 0, 0, 0, 0);
+
+       return ret_stuff.status;
+}
+
+/*
+ * Sends the given buffer to the console.
+ */
+static inline u64
+ia64_sn_console_putb(const char *buf, int len)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0; 
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_PUTB, (u64)buf, (u64)len, 0, 0, 0, 0, 0);
+
+       if ( ret_stuff.status == 0 ) {
+               return ret_stuff.v0;
+       }
+       return (u64)0;
+}
+
+/*
+ * Print a platform error record
+ */
+static inline u64
+ia64_sn_plat_specific_err_print(int (*hook)(const char*, ...), char *rec)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_REENTRANT(ret_stuff, SN_SAL_PRINT_ERROR, (u64)hook, (u64)rec, 0, 0, 0, 0, 0);
+
+       return ret_stuff.status;
+}
+
+/*
+ * Check for Platform errors
+ */
+static inline u64
+ia64_sn_plat_cpei_handler(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_LOG_CE, 0, 0, 0, 0, 0, 0, 0);
+
+       return ret_stuff.status;
+}
+
+/*
+ * Set Error Handling Features (Obsolete)
+ */
+static inline u64
+ia64_sn_plat_set_error_handling_features(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES,
+               SAL_ERR_FEAT_LOG_SBES,
+               0, 0, 0, 0, 0, 0);
+
+       return ret_stuff.status;
+}
+
+/*
+ * Checks for console input.
+ */
+static inline u64
+ia64_sn_console_check(int *result)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_POLL, 0, 0, 0, 0, 0, 0, 0);
+
+       /* result is in 'v0' */
+       *result = (int)ret_stuff.v0;
+
+       return ret_stuff.status;
+}
+
+/*
+ * Checks console interrupt status
+ */
+static inline u64
+ia64_sn_console_intr_status(void)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
+                0, SAL_CONSOLE_INTR_STATUS,
+                0, 0, 0, 0, 0);
+
+       if (ret_stuff.status == 0) {
+           return ret_stuff.v0;
+       }
+       
+       return 0;
+}
+
+/*
+ * Enable an interrupt on the SAL console device.
+ */
+static inline void
+ia64_sn_console_intr_enable(u64 intr)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
+                intr, SAL_CONSOLE_INTR_ON,
+                0, 0, 0, 0, 0);
+}
+
+/*
+ * Disable an interrupt on the SAL console device.
+ */
+static inline void
+ia64_sn_console_intr_disable(u64 intr)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
+                intr, SAL_CONSOLE_INTR_OFF,
+                0, 0, 0, 0, 0);
+}
+
+/*
+ * Sends a character buffer to the console asynchronously.
+ */
+static inline u64
+ia64_sn_console_xmit_chars(char *buf, int len)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_XMIT_CHARS,
+                (u64)buf, (u64)len,
+                0, 0, 0, 0, 0);
+
+       if (ret_stuff.status == 0) {
+           return ret_stuff.v0;
+       }
+
+       return 0;
+}
+
+/*
+ * Returns the iobrick module Id
+ */
+static inline u64
+ia64_sn_sysctl_iobrick_module_get(nasid_t nasid, int *result)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SYSCTL_IOBRICK_MODULE_GET, nasid, 0, 0, 0, 0, 0, 0);
+
+       /* result is in 'v0' */
+       *result = (int)ret_stuff.v0;
+
+       return ret_stuff.status;
+}
+
+/**
+ * ia64_sn_pod_mode - call the SN_SAL_POD_MODE function
+ *
+ * SN_SAL_POD_MODE actually takes an argument, but it's always
+ * 0 when we call it from the kernel, so we don't have to expose
+ * it to the caller.
+ */
+static inline u64
+ia64_sn_pod_mode(void)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_REENTRANT(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0);
+       if (isrv.status)
+               return 0;
+       return isrv.v0;
+}
+
+/**
+ * ia64_sn_probe_mem - read from memory safely
+ * @addr: address to probe
+ * @size: number bytes to read (1,2,4,8)
+ * @data_ptr: address to store value read by probe (-1 returned if probe fails)
+ *
+ * Call into the SAL to do a memory read.  If the read generates a machine
+ * check, this routine will recover gracefully and return -1 to the caller.
+ * @addr is usually a kernel virtual address in uncached space (i.e. the
+ * address starts with 0xc), but if called in physical mode, @addr should
+ * be a physical address.
+ *
+ * Return values:
+ *  0 - probe successful
+ *  1 - probe failed (generated MCA)
+ *  2 - Bad arg
+ * <0 - PAL error
+ */
+static inline u64
+ia64_sn_probe_mem(long addr, long size, void *data_ptr)
+{
+       struct ia64_sal_retval isrv;
+
+       SAL_CALL(isrv, SN_SAL_PROBE, addr, size, 0, 0, 0, 0, 0);
+
+       if (data_ptr) {
+               switch (size) {
+               case 1:
+                       *((u8*)data_ptr) = (u8)isrv.v0;
+                       break;
+               case 2:
+                       *((u16*)data_ptr) = (u16)isrv.v0;
+                       break;
+               case 4:
+                       *((u32*)data_ptr) = (u32)isrv.v0;
+                       break;
+               case 8:
+                       *((u64*)data_ptr) = (u64)isrv.v0;
+                       break;
+               default:
+                       isrv.status = 2;
+               }
+       }
+       return isrv.status;
+}
+
+/*
+ * Retrieve the system serial number as an ASCII string.
+ */
+static inline u64
+ia64_sn_sys_serial_get(char *buf)
+{
+       struct ia64_sal_retval ret_stuff;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SYS_SERIAL_GET, buf, 0, 0, 0, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+extern char sn_system_serial_number_string[];
+extern u64 sn_partition_serial_number;
+
+static inline char *
+sn_system_serial_number(void) {
+       if (sn_system_serial_number_string[0]) {
+               return(sn_system_serial_number_string);
+       } else {
+               ia64_sn_sys_serial_get(sn_system_serial_number_string);
+               return(sn_system_serial_number_string);
+       }
+}
+       
+
+/*
+ * Returns a unique id number for this system and partition (suitable for
+ * use with license managers), based in part on the system serial number.
+ */
+static inline u64
+ia64_sn_partition_serial_get(void)
+{
+       struct ia64_sal_retval ret_stuff;
+       ia64_sal_oemcall_reentrant(&ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0,
+                                  0, 0, 0, 0, 0, 0);
+       if (ret_stuff.status != 0)
+           return 0;
+       return ret_stuff.v0;
+}
+
+static inline u64
+sn_partition_serial_number_val(void) {
+       if (unlikely(sn_partition_serial_number == 0)) {
+               sn_partition_serial_number = ia64_sn_partition_serial_get();
+       }
+       return sn_partition_serial_number;
+}
+
+/*
+ * Returns the partition id of the nasid passed in as an argument,
+ * or INVALID_PARTID if the partition id cannot be retrieved.
+ */
+static inline partid_t
+ia64_sn_sysctl_partition_get(nasid_t nasid)
+{
+       struct ia64_sal_retval ret_stuff;
+       SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid,
+               0, 0, 0, 0, 0, 0);
+       if (ret_stuff.status != 0)
+           return -1;
+       return ((partid_t)ret_stuff.v0);
+}
+
+/*
+ * Returns the physical address of the partition's reserved page through
+ * an iterative number of calls.
+ *
+ * On first call, 'cookie' and 'len' should be set to 0, and 'addr'
+ * set to the nasid of the partition whose reserved page's address is
+ * being sought.
+ * On subsequent calls, pass the values, that were passed back on the
+ * previous call.
+ *
+ * While the return status equals SALRET_MORE_PASSES, keep calling
+ * this function after first copying 'len' bytes starting at 'addr'
+ * into 'buf'. Once the return status equals SALRET_OK, 'addr' will
+ * be the physical address of the partition's reserved page. If the
+ * return status equals neither of these, an error as occurred.
+ */
+static inline s64
+sn_partition_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len)
+{
+       struct ia64_sal_retval rv;
+       ia64_sal_oemcall_reentrant(&rv, SN_SAL_GET_PARTITION_ADDR, *cookie,
+                                  *addr, buf, *len, 0, 0, 0);
+       *cookie = rv.v0;
+       *addr = rv.v1;
+       *len = rv.v2;
+       return rv.status;
+}
+
+/*
+ * Register or unregister a physical address range being referenced across
+ * a partition boundary for which certain SAL errors should be scanned for,
+ * cleaned up and ignored.  This is of value for kernel partitioning code only.
+ * Values for the operation argument:
+ *     1 = register this address range with SAL
+ *     0 = unregister this address range with SAL
+ * 
+ * SAL maintains a reference count on an address range in case it is registered
+ * multiple times.
+ * 
+ * On success, returns the reference count of the address range after the SAL
+ * call has performed the current registration/unregistration.  Returns a
+ * negative value if an error occurred.
+ */
+static inline int
+sn_register_xp_addr_region(u64 paddr, u64 len, int operation)
+{
+       struct ia64_sal_retval ret_stuff;
+       ia64_sal_oemcall(&ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len,
+                        (u64)operation, 0, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+/*
+ * Register or unregister an instruction range for which SAL errors should
+ * be ignored.  If an error occurs while in the registered range, SAL jumps
+ * to return_addr after ignoring the error.  Values for the operation argument:
+ *     1 = register this instruction range with SAL
+ *     0 = unregister this instruction range with SAL
+ *
+ * Returns 0 on success, or a negative value if an error occurred.
+ */
+static inline int
+sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr,
+                        int virtual, int operation)
+{
+       struct ia64_sal_retval ret_stuff;
+       u64 call;
+       if (virtual) {
+               call = SN_SAL_NO_FAULT_ZONE_VIRTUAL;
+       } else {
+               call = SN_SAL_NO_FAULT_ZONE_PHYSICAL;
+       }
+       ia64_sal_oemcall(&ret_stuff, call, start_addr, end_addr, return_addr,
+                        (u64)1, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+/*
+ * Register or unregister a function to handle a PMI received by a CPU.
+ * Before calling the registered handler, SAL sets r1 to the value that
+ * was passed in as the global_pointer.
+ *
+ * If the handler pointer is NULL, then the currently registered handler
+ * will be unregistered.
+ *
+ * Returns 0 on success, or a negative value if an error occurred.
+ */
+static inline int
+sn_register_pmi_handler(u64 handler, u64 global_pointer)
+{
+       struct ia64_sal_retval ret_stuff;
+       ia64_sal_oemcall(&ret_stuff, SN_SAL_REGISTER_PMI_HANDLER, handler,
+                        global_pointer, 0, 0, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+/*
+ * Change or query the coherence domain for this partition. Each cpu-based
+ * nasid is represented by a bit in an array of 64-bit words:
+ *      0 = not in this partition's coherency domain
+ *      1 = in this partition's coherency domain
+ *
+ * It is not possible for the local system's nasids to be removed from
+ * the coherency domain.  Purpose of the domain arguments:
+ *      new_domain = set the coherence domain to the given nasids
+ *      old_domain = return the current coherence domain
+ *
+ * Returns 0 on success, or a negative value if an error occurred.
+ */
+static inline int
+sn_change_coherence(u64 *new_domain, u64 *old_domain)
+{
+       struct ia64_sal_retval ret_stuff;
+       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
+                               (u64)old_domain, 0, 0, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+/*
+ * Change memory access protections for a physical address range.
+ * nasid_array is not used on Altix, but may be in future architectures.
+ * Available memory protection access classes are defined after the function.
+ */
+static inline int
+sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
+                               (u64)nasid_array, perms, 0, 0, 0);
+       return ret_stuff.status;
+}
+#define SN_MEMPROT_ACCESS_CLASS_0              0x14a080
+#define SN_MEMPROT_ACCESS_CLASS_1              0x2520c2
+#define SN_MEMPROT_ACCESS_CLASS_2              0x14a1ca
+#define SN_MEMPROT_ACCESS_CLASS_3              0x14a290
+#define SN_MEMPROT_ACCESS_CLASS_6              0x084080
+#define SN_MEMPROT_ACCESS_CLASS_7              0x021080
+
+/*
+ * Turns off system power.
+ */
+static inline void
+ia64_sn_power_down(void)
+{
+       struct ia64_sal_retval ret_stuff;
+       SAL_CALL(ret_stuff, SN_SAL_SYSTEM_POWER_DOWN, 0, 0, 0, 0, 0, 0, 0);
+       while(1)
+               cpu_relax();
+       /* never returns */
+}
+
+/**
+ * ia64_sn_fru_capture - tell the system controller to capture hw state
+ *
+ * This routine will call the SAL which will tell the system controller(s)
+ * to capture hw mmr information from each SHub in the system.
+ */
+static inline u64
+ia64_sn_fru_capture(void)
+{
+        struct ia64_sal_retval isrv;
+        SAL_CALL(isrv, SN_SAL_SYSCTL_FRU_CAPTURE, 0, 0, 0, 0, 0, 0, 0);
+        if (isrv.status)
+                return 0;
+        return isrv.v0;
+}
+
+/*
+ * Performs an operation on a PCI bus or slot -- power up, power down
+ * or reset.
+ */
+static inline u64
+ia64_sn_sysctl_iobrick_pci_op(nasid_t n, u64 connection_type, 
+                             u64 bus, char slot, 
+                             u64 action)
+{
+       struct ia64_sal_retval rv = {0, 0, 0, 0};
+
+       SAL_CALL_NOLOCK(rv, SN_SAL_SYSCTL_IOBRICK_PCI_OP, connection_type, n, action,
+                bus, (u64) slot, 0, 0);
+       if (rv.status)
+               return rv.v0;
+       return 0;
+}
+
+
+/*
+ * Open a subchannel for sending arbitrary data to the system
+ * controller network via the system controller device associated with
+ * 'nasid'.  Return the subchannel number or a negative error code.
+ */
+static inline int
+ia64_sn_irtr_open(nasid_t nasid)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_OPEN, nasid,
+                          0, 0, 0, 0, 0);
+       return (int) rv.v0;
+}
+
+/*
+ * Close system controller subchannel 'subch' previously opened on 'nasid'.
+ */
+static inline int
+ia64_sn_irtr_close(nasid_t nasid, int subch)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_CLOSE,
+                          (u64) nasid, (u64) subch, 0, 0, 0, 0);
+       return (int) rv.status;
+}
+
+/*
+ * Read data from system controller associated with 'nasid' on
+ * subchannel 'subch'.  The buffer to be filled is pointed to by
+ * 'buf', and its capacity is in the integer pointed to by 'len'.  The
+ * referent of 'len' is set to the number of bytes read by the SAL
+ * call.  The return value is either SALRET_OK (for bytes read) or
+ * SALRET_ERROR (for error or "no data available").
+ */
+static inline int
+ia64_sn_irtr_recv(nasid_t nasid, int subch, char *buf, int *len)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_RECV,
+                          (u64) nasid, (u64) subch, (u64) buf, (u64) len,
+                          0, 0);
+       return (int) rv.status;
+}
+
+/*
+ * Write data to the system controller network via the system
+ * controller associated with 'nasid' on suchannel 'subch'.  The
+ * buffer to be written out is pointed to by 'buf', and 'len' is the
+ * number of bytes to be written.  The return value is either the
+ * number of bytes written (which could be zero) or a negative error
+ * code.
+ */
+static inline int
+ia64_sn_irtr_send(nasid_t nasid, int subch, char *buf, int len)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_SEND,
+                          (u64) nasid, (u64) subch, (u64) buf, (u64) len,
+                          0, 0);
+       return (int) rv.v0;
+}
+
+/*
+ * Check whether any interrupts are pending for the system controller
+ * associated with 'nasid' and its subchannel 'subch'.  The return
+ * value is a mask of pending interrupts (SAL_IROUTER_INTR_XMIT and/or
+ * SAL_IROUTER_INTR_RECV).
+ */
+static inline int
+ia64_sn_irtr_intr(nasid_t nasid, int subch)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_STATUS,
+                          (u64) nasid, (u64) subch, 0, 0, 0, 0);
+       return (int) rv.v0;
+}
+
+/*
+ * Enable the interrupt indicated by the intr parameter (either
+ * SAL_IROUTER_INTR_XMIT or SAL_IROUTER_INTR_RECV).
+ */
+static inline int
+ia64_sn_irtr_intr_enable(nasid_t nasid, int subch, u64 intr)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_ON,
+                          (u64) nasid, (u64) subch, intr, 0, 0, 0);
+       return (int) rv.v0;
+}
+
+/*
+ * Disable the interrupt indicated by the intr parameter (either
+ * SAL_IROUTER_INTR_XMIT or SAL_IROUTER_INTR_RECV).
+ */
+static inline int
+ia64_sn_irtr_intr_disable(nasid_t nasid, int subch, u64 intr)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_OFF,
+                          (u64) nasid, (u64) subch, intr, 0, 0, 0);
+       return (int) rv.v0;
+}
+
+/*
+ * Set up a node as the point of contact for system controller
+ * environmental event delivery.
+ */
+static inline int
+ia64_sn_sysctl_event_init(nasid_t nasid)
+{
+        struct ia64_sal_retval rv;
+        SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_EVENT, (u64) nasid,
+                          0, 0, 0, 0, 0, 0);
+        return (int) rv.v0;
+}
+
+/*
+ * Ask the system controller on the specified nasid to reset
+ * the CX corelet clock.  Only valid on TIO nodes.
+ */
+static inline int
+ia64_sn_sysctl_tio_clock_reset(nasid_t nasid)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_TIO_JLCK_RST,
+                       nasid, 0, 0, 0, 0, 0);
+       if (rv.status != 0)
+               return (int)rv.status;
+       if (rv.v0 != 0)
+               return (int)rv.v0;
+
+       return 0;
+}
+
+/*
+ * Get the associated ioboard type for a given nasid.
+ */
+static inline s64
+ia64_sn_sysctl_ioboard_get(nasid_t nasid, u16 *ioboard)
+{
+       struct ia64_sal_retval isrv;
+       SAL_CALL_REENTRANT(isrv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD,
+                          nasid, 0, 0, 0, 0, 0);
+       if (isrv.v0 != 0) {
+               *ioboard = isrv.v0;
+               return isrv.status;
+       }
+       if (isrv.v1 != 0) {
+               *ioboard = isrv.v1;
+               return isrv.status;
+       }
+
+       return isrv.status;
+}
+
+/**
+ * ia64_sn_get_fit_compt - read a FIT entry from the PROM header
+ * @nasid: NASID of node to read
+ * @index: FIT entry index to be retrieved (0..n)
+ * @fitentry: 16 byte buffer where FIT entry will be stored.
+ * @banbuf: optional buffer for retrieving banner
+ * @banlen: length of banner buffer
+ *
+ * Access to the physical PROM chips needs to be serialized since reads and
+ * writes can't occur at the same time, so we need to call into the SAL when
+ * we want to look at the FIT entries on the chips.
+ *
+ * Returns:
+ *     %SALRET_OK if ok
+ *     %SALRET_INVALID_ARG if index too big
+ *     %SALRET_NOT_IMPLEMENTED if running on older PROM
+ *     ??? if nasid invalid OR banner buffer not large enough
+ */
+static inline int
+ia64_sn_get_fit_compt(u64 nasid, u64 index, void *fitentry, void *banbuf,
+                     u64 banlen)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_NOLOCK(rv, SN_SAL_GET_FIT_COMPT, nasid, index, fitentry,
+                       banbuf, banlen, 0, 0);
+       return (int) rv.status;
+}
+
+/*
+ * Initialize the SAL components of the system controller
+ * communication driver; specifically pass in a sizable buffer that
+ * can be used for allocation of subchannel queues as new subchannels
+ * are opened.  "buf" points to the buffer, and "len" specifies its
+ * length.
+ */
+static inline int
+ia64_sn_irtr_init(nasid_t nasid, void *buf, int len)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INIT,
+                          (u64) nasid, (u64) buf, (u64) len, 0, 0, 0);
+       return (int) rv.status;
+}
+
+/*
+ * Returns the nasid, subnode & slice corresponding to a SAPIC ID
+ *
+ *  In:
+ *     arg0 - SN_SAL_GET_SAPIC_INFO
+ *     arg1 - sapicid (lid >> 16) 
+ *  Out:
+ *     v0 - nasid
+ *     v1 - subnode
+ *     v2 - slice
+ */
+static inline u64
+ia64_sn_get_sapic_info(int sapicid, int *nasid, int *subnode, int *slice)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SAPIC_INFO, sapicid, 0, 0, 0, 0, 0, 0);
+
+/***** BEGIN HACK - temp til old proms no longer supported ********/
+       if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) {
+               if (nasid) *nasid = sapicid & 0xfff;
+               if (subnode) *subnode = (sapicid >> 13) & 1;
+               if (slice) *slice = (sapicid >> 12) & 3;
+               return 0;
+       }
+/***** END HACK *******/
+
+       if (ret_stuff.status < 0)
+               return ret_stuff.status;
+
+       if (nasid) *nasid = (int) ret_stuff.v0;
+       if (subnode) *subnode = (int) ret_stuff.v1;
+       if (slice) *slice = (int) ret_stuff.v2;
+       return 0;
+}
+/*
+ * Returns information about the HUB/SHUB.
+ *  In:
+ *     arg0 - SN_SAL_GET_SN_INFO
+ *     arg1 - 0 (other values reserved for future use)
+ *  Out:
+ *     v0 
+ *             [7:0]   - shub type (0=shub1, 1=shub2)
+ *             [15:8]  - Log2 max number of nodes in entire system (includes
+ *                       C-bricks, I-bricks, etc)
+ *             [23:16] - Log2 of nodes per sharing domain                       
+ *             [31:24] - partition ID
+ *             [39:32] - coherency_id
+ *             [47:40] - regionsize
+ *     v1 
+ *             [15:0]  - nasid mask (ex., 0x7ff for 11 bit nasid)
+ *             [23:15] - bit position of low nasid bit
+ */
+static inline u64
+ia64_sn_get_sn_info(int fc, u8 *shubtype, u16 *nasid_bitmask, u8 *nasid_shift, 
+               u8 *systemsize, u8 *sharing_domain_size, u8 *partid, u8 *coher, u8 *reg)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+       ret_stuff.v1 = 0;
+       ret_stuff.v2 = 0;
+       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO, fc, 0, 0, 0, 0, 0, 0);
+
+/***** BEGIN HACK - temp til old proms no longer supported ********/
+       if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) {
+               int nasid = get_sapicid() & 0xfff;
+#define SH_SHUB_ID_NODES_PER_BIT_MASK 0x001f000000000000UL
+#define SH_SHUB_ID_NODES_PER_BIT_SHFT 48
+               if (shubtype) *shubtype = 0;
+               if (nasid_bitmask) *nasid_bitmask = 0x7ff;
+               if (nasid_shift) *nasid_shift = 38;
+               if (systemsize) *systemsize = 10;
+               if (sharing_domain_size) *sharing_domain_size = 8;
+               if (partid) *partid = ia64_sn_sysctl_partition_get(nasid);
+               if (coher) *coher = nasid >> 9;
+               if (reg) *reg = (HUB_L((u64 *) LOCAL_MMR_ADDR(SH1_SHUB_ID)) & SH_SHUB_ID_NODES_PER_BIT_MASK) >>
+                       SH_SHUB_ID_NODES_PER_BIT_SHFT;
+               return 0;
+       }
+/***** END HACK *******/
+
+       if (ret_stuff.status < 0)
+               return ret_stuff.status;
+
+       if (shubtype) *shubtype = ret_stuff.v0 & 0xff;
+       if (systemsize) *systemsize = (ret_stuff.v0 >> 8) & 0xff;
+       if (sharing_domain_size) *sharing_domain_size = (ret_stuff.v0 >> 16) & 0xff;
+       if (partid) *partid = (ret_stuff.v0 >> 24) & 0xff;
+       if (coher) *coher = (ret_stuff.v0 >> 32) & 0xff;
+       if (reg) *reg = (ret_stuff.v0 >> 40) & 0xff;
+       if (nasid_bitmask) *nasid_bitmask = (ret_stuff.v1 & 0xffff);
+       if (nasid_shift) *nasid_shift = (ret_stuff.v1 >> 16) & 0xff;
+       return 0;
+}
+/*
+ * This is the access point to the Altix PROM hardware performance
+ * and status monitoring interface. For info on using this, see
+ * arch/ia64/include/asm/sn/sn2/sn_hwperf.h
+ */
+static inline int
+ia64_sn_hwperf_op(nasid_t nasid, u64 opcode, u64 a0, u64 a1, u64 a2,
+                  u64 a3, u64 a4, int *v0)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_NOLOCK(rv, SN_SAL_HWPERF_OP, (u64)nasid,
+               opcode, a0, a1, a2, a3, a4);
+       if (v0)
+               *v0 = (int) rv.v0;
+       return (int) rv.status;
+}
+
+static inline int
+ia64_sn_ioif_get_pci_topology(u64 buf, u64 len)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_NOLOCK(rv, SN_SAL_IOIF_GET_PCI_TOPOLOGY, buf, len, 0, 0, 0, 0, 0);
+       return (int) rv.status;
+}
+
+/*
+ * BTE error recovery is implemented in SAL
+ */
+static inline int
+ia64_sn_bte_recovery(nasid_t nasid)
+{
+       struct ia64_sal_retval rv;
+
+       rv.status = 0;
+       SAL_CALL_NOLOCK(rv, SN_SAL_BTE_RECOVER, (u64)nasid, 0, 0, 0, 0, 0, 0);
+       if (rv.status == SALRET_NOT_IMPLEMENTED)
+               return 0;
+       return (int) rv.status;
+}
+
+static inline int
+ia64_sn_is_fake_prom(void)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_NOLOCK(rv, SN_SAL_FAKE_PROM, 0, 0, 0, 0, 0, 0, 0);
+       return (rv.status == 0);
+}
+
+static inline int
+ia64_sn_get_prom_feature_set(int set, unsigned long *feature_set)
+{
+       struct ia64_sal_retval rv;
+
+       SAL_CALL_NOLOCK(rv, SN_SAL_GET_PROM_FEATURE_SET, set, 0, 0, 0, 0, 0, 0);
+       if (rv.status != 0)
+               return rv.status;
+       *feature_set = rv.v0;
+       return 0;
+}
+
+static inline int
+ia64_sn_set_os_feature(int feature)
+{
+       struct ia64_sal_retval rv;
+
+       SAL_CALL_NOLOCK(rv, SN_SAL_SET_OS_FEATURE_SET, feature, 0, 0, 0, 0, 0, 0);
+       return rv.status;
+}
+
+static inline int
+sn_inject_error(u64 paddr, u64 *data, u64 *ecc)
+{
+       struct ia64_sal_retval ret_stuff;
+
+       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data,
+                               (u64)ecc, 0, 0, 0, 0);
+       return ret_stuff.status;
+}
+
+static inline int
+ia64_sn_set_cpu_number(int cpu)
+{
+       struct ia64_sal_retval rv;
+
+       SAL_CALL_NOLOCK(rv, SN_SAL_SET_CPU_NUMBER, cpu, 0, 0, 0, 0, 0, 0);
+       return rv.status;
+}
+static inline int
+ia64_sn_kernel_launch_event(void)
+{
+       struct ia64_sal_retval rv;
+       SAL_CALL_NOLOCK(rv, SN_SAL_KERNEL_LAUNCH_EVENT, 0, 0, 0, 0, 0, 0, 0);
+       return rv.status;
+}
+#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/arch/ia64/include/asm/sn/tioca.h b/arch/ia64/include/asm/sn/tioca.h
new file mode 100644 (file)
index 0000000..666222d
--- /dev/null
@@ -0,0 +1,596 @@
+#ifndef _ASM_IA64_SN_TIO_TIOCA_H
+#define _ASM_IA64_SN_TIO_TIOCA_H
+
+/*
+ * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+
+#define TIOCA_PART_NUM 0xE020
+#define TIOCA_MFGR_NUM 0x24
+#define TIOCA_REV_A    0x1
+
+/*
+ * Register layout for TIO:CA.  See below for bitmasks for each register.
+ */
+
+struct tioca {
+       u64     ca_id;                          /* 0x000000 */
+       u64     ca_control1;                    /* 0x000008 */
+       u64     ca_control2;                    /* 0x000010 */
+       u64     ca_status1;                     /* 0x000018 */
+       u64     ca_status2;                     /* 0x000020 */
+       u64     ca_gart_aperature;              /* 0x000028 */
+       u64     ca_gfx_detach;                  /* 0x000030 */
+       u64     ca_inta_dest_addr;              /* 0x000038 */
+       u64     ca_intb_dest_addr;              /* 0x000040 */
+       u64     ca_err_int_dest_addr;           /* 0x000048 */
+       u64     ca_int_status;                  /* 0x000050 */
+       u64     ca_int_status_alias;            /* 0x000058 */
+       u64     ca_mult_error;                  /* 0x000060 */
+       u64     ca_mult_error_alias;            /* 0x000068 */
+       u64     ca_first_error;                 /* 0x000070 */
+       u64     ca_int_mask;                    /* 0x000078 */
+       u64     ca_crm_pkterr_type;             /* 0x000080 */
+       u64     ca_crm_pkterr_type_alias;       /* 0x000088 */
+       u64     ca_crm_ct_error_detail_1;       /* 0x000090 */
+       u64     ca_crm_ct_error_detail_2;       /* 0x000098 */
+       u64     ca_crm_tnumto;                  /* 0x0000A0 */
+       u64     ca_gart_err;                    /* 0x0000A8 */
+       u64     ca_pcierr_type;                 /* 0x0000B0 */
+       u64     ca_pcierr_addr;                 /* 0x0000B8 */
+
+       u64     ca_pad_0000C0[3];               /* 0x0000{C0..D0} */
+
+       u64     ca_pci_rd_buf_flush;            /* 0x0000D8 */
+       u64     ca_pci_dma_addr_extn;           /* 0x0000E0 */
+       u64     ca_agp_dma_addr_extn;           /* 0x0000E8 */
+       u64     ca_force_inta;                  /* 0x0000F0 */
+       u64     ca_force_intb;                  /* 0x0000F8 */
+       u64     ca_debug_vector_sel;            /* 0x000100 */
+       u64     ca_debug_mux_core_sel;          /* 0x000108 */
+       u64     ca_debug_mux_pci_sel;           /* 0x000110 */
+       u64     ca_debug_domain_sel;            /* 0x000118 */
+
+       u64     ca_pad_000120[28];              /* 0x0001{20..F8} */
+
+       u64     ca_gart_ptr_table;              /* 0x200 */
+       u64     ca_gart_tlb_addr[8];            /* 0x2{08..40} */
+};
+
+/*
+ * Mask/shift definitions for TIO:CA registers.  The convention here is
+ * to mainly use the names as they appear in the "TIO AEGIS Programmers'
+ * Reference" with a CA_ prefix added.  Some exceptions were made to fix
+ * duplicate field names or to generalize fields that are common to
+ * different registers (ca_debug_mux_core_sel and ca_debug_mux_pci_sel for
+ * example).
+ *
+ * Fields consisting of a single bit have a single #define have a single
+ * macro declaration to mask the bit.  Fields consisting of multiple bits
+ * have two declarations: one to mask the proper bits in a register, and 
+ * a second with the suffix "_SHFT" to identify how far the mask needs to
+ * be shifted right to get its base value.
+ */
+
+/* ==== ca_control1 */
+#define CA_SYS_BIG_END                 (1ull << 0)
+#define CA_DMA_AGP_SWAP                        (1ull << 1)
+#define CA_DMA_PCI_SWAP                        (1ull << 2)
+#define CA_PIO_IO_SWAP                 (1ull << 3)
+#define CA_PIO_MEM_SWAP                        (1ull << 4)
+#define CA_GFX_WR_SWAP                 (1ull << 5)
+#define CA_AGP_FW_ENABLE               (1ull << 6)
+#define CA_AGP_CAL_CYCLE               (0x7ull << 7)
+#define CA_AGP_CAL_CYCLE_SHFT          7
+#define CA_AGP_CAL_PRSCL_BYP           (1ull << 10)
+#define CA_AGP_INIT_CAL_ENB            (1ull << 11)
+#define CA_INJ_ADDR_PERR               (1ull << 12)
+#define CA_INJ_DATA_PERR               (1ull << 13)
+       /* bits 15:14 unused */
+#define CA_PCIM_IO_NBE_AD              (0x7ull << 16)
+#define CA_PCIM_IO_NBE_AD_SHFT         16
+#define CA_PCIM_FAST_BTB_ENB           (1ull << 19)
+       /* bits 23:20 unused */
+#define CA_PIO_ADDR_OFFSET             (0xffull << 24)
+#define CA_PIO_ADDR_OFFSET_SHFT                24
+       /* bits 35:32 unused */
+#define CA_AGPDMA_OP_COMBDELAY         (0x1full << 36)
+#define CA_AGPDMA_OP_COMBDELAY_SHFT    36
+       /* bit 41 unused */
+#define CA_AGPDMA_OP_ENB_COMBDELAY     (1ull << 42)
+#define        CA_PCI_INT_LPCNT                (0xffull << 44)
+#define CA_PCI_INT_LPCNT_SHFT          44
+       /* bits 63:52 unused */
+
+/* ==== ca_control2 */
+#define CA_AGP_LATENCY_TO              (0xffull << 0)
+#define CA_AGP_LATENCY_TO_SHFT         0
+#define CA_PCI_LATENCY_TO              (0xffull << 8)
+#define CA_PCI_LATENCY_TO_SHFT         8
+#define CA_PCI_MAX_RETRY               (0x3ffull << 16)
+#define CA_PCI_MAX_RETRY_SHFT          16
+       /* bits 27:26 unused */
+#define CA_RT_INT_EN                   (0x3ull << 28)
+#define CA_RT_INT_EN_SHFT                      28
+#define CA_MSI_INT_ENB                 (1ull << 30)
+#define CA_PCI_ARB_ERR_ENB             (1ull << 31)
+#define CA_GART_MEM_PARAM              (0x3ull << 32)
+#define CA_GART_MEM_PARAM_SHFT         32
+#define CA_GART_RD_PREFETCH_ENB                (1ull << 34)
+#define CA_GART_WR_PREFETCH_ENB                (1ull << 35)
+#define CA_GART_FLUSH_TLB              (1ull << 36)
+       /* bits 39:37 unused */
+#define CA_CRM_TNUMTO_PERIOD           (0x1fffull << 40)
+#define CA_CRM_TNUMTO_PERIOD_SHFT      40
+       /* bits 55:53 unused */
+#define CA_CRM_TNUMTO_ENB              (1ull << 56)
+#define CA_CRM_PRESCALER_BYP           (1ull << 57)
+       /* bits 59:58 unused */
+#define CA_CRM_MAX_CREDIT              (0x7ull << 60)
+#define CA_CRM_MAX_CREDIT_SHFT         60
+       /* bit 63 unused */
+
+/* ==== ca_status1 */
+#define CA_CORELET_ID                  (0x3ull << 0)
+#define CA_CORELET_ID_SHFT             0
+#define CA_INTA_N                      (1ull << 2)
+#define CA_INTB_N                      (1ull << 3)
+#define CA_CRM_CREDIT_AVAIL            (0x7ull << 4)
+#define CA_CRM_CREDIT_AVAIL_SHFT       4
+       /* bit 7 unused */
+#define CA_CRM_SPACE_AVAIL             (0x7full << 8)
+#define CA_CRM_SPACE_AVAIL_SHFT                8
+       /* bit 15 unused */
+#define CA_GART_TLB_VAL                        (0xffull << 16)
+#define CA_GART_TLB_VAL_SHFT           16
+       /* bits 63:24 unused */
+
+/* ==== ca_status2 */
+#define CA_GFX_CREDIT_AVAIL            (0xffull << 0)
+#define CA_GFX_CREDIT_AVAIL_SHFT       0
+#define CA_GFX_OPQ_AVAIL               (0xffull << 8)
+#define CA_GFX_OPQ_AVAIL_SHFT          8
+#define CA_GFX_WRBUFF_AVAIL            (0xffull << 16)
+#define CA_GFX_WRBUFF_AVAIL_SHFT       16
+#define CA_ADMA_OPQ_AVAIL              (0xffull << 24)
+#define CA_ADMA_OPQ_AVAIL_SHFT         24
+#define CA_ADMA_WRBUFF_AVAIL           (0xffull << 32)
+#define CA_ADMA_WRBUFF_AVAIL_SHFT      32
+#define CA_ADMA_RDBUFF_AVAIL           (0x7full << 40)
+#define CA_ADMA_RDBUFF_AVAIL_SHFT      40
+#define CA_PCI_PIO_OP_STAT             (1ull << 47)
+#define CA_PDMA_OPQ_AVAIL              (0xfull << 48)
+#define CA_PDMA_OPQ_AVAIL_SHFT         48
+#define CA_PDMA_WRBUFF_AVAIL           (0xfull << 52)
+#define CA_PDMA_WRBUFF_AVAIL_SHFT      52
+#define CA_PDMA_RDBUFF_AVAIL           (0x3ull << 56)
+#define CA_PDMA_RDBUFF_AVAIL_SHFT      56
+       /* bits 63:58 unused */
+
+/* ==== ca_gart_aperature */
+#define CA_GART_AP_ENB_AGP             (1ull << 0)
+#define CA_GART_PAGE_SIZE              (1ull << 1)
+#define CA_GART_AP_ENB_PCI             (1ull << 2)
+       /* bits 11:3 unused */
+#define CA_GART_AP_SIZE                        (0x3ffull << 12)
+#define CA_GART_AP_SIZE_SHFT           12
+#define CA_GART_AP_BASE                        (0x3ffffffffffull << 22)
+#define CA_GART_AP_BASE_SHFT           22
+
+/* ==== ca_inta_dest_addr
+   ==== ca_intb_dest_addr 
+   ==== ca_err_int_dest_addr */
+       /* bits 2:0 unused */
+#define CA_INT_DEST_ADDR               (0x7ffffffffffffull << 3)
+#define CA_INT_DEST_ADDR_SHFT          3
+       /* bits 55:54 unused */
+#define CA_INT_DEST_VECT               (0xffull << 56)
+#define CA_INT_DEST_VECT_SHFT          56
+
+/* ==== ca_int_status */
+/* ==== ca_int_status_alias */
+/* ==== ca_mult_error */
+/* ==== ca_mult_error_alias */
+/* ==== ca_first_error */
+/* ==== ca_int_mask */
+#define CA_PCI_ERR                     (1ull << 0)
+       /* bits 3:1 unused */
+#define CA_GART_FETCH_ERR              (1ull << 4)
+#define CA_GFX_WR_OVFLW                        (1ull << 5)
+#define CA_PIO_REQ_OVFLW               (1ull << 6)
+#define CA_CRM_PKTERR                  (1ull << 7)
+#define CA_CRM_DVERR                   (1ull << 8)
+#define CA_TNUMTO                      (1ull << 9)
+#define CA_CXM_RSP_CRED_OVFLW          (1ull << 10)
+#define CA_CXM_REQ_CRED_OVFLW          (1ull << 11)
+#define CA_PIO_INVALID_ADDR            (1ull << 12)
+#define CA_PCI_ARB_TO                  (1ull << 13)
+#define CA_AGP_REQ_OFLOW               (1ull << 14)
+#define CA_SBA_TYPE1_ERR               (1ull << 15)
+       /* bit 16 unused */
+#define CA_INTA                                (1ull << 17)
+#define CA_INTB                                (1ull << 18)
+#define CA_MULT_INTA                   (1ull << 19)
+#define CA_MULT_INTB                   (1ull << 20)
+#define CA_GFX_CREDIT_OVFLW            (1ull << 21)
+       /* bits 63:22 unused */
+
+/* ==== ca_crm_pkterr_type */
+/* ==== ca_crm_pkterr_type_alias */
+#define CA_CRM_PKTERR_SBERR_HDR                (1ull << 0)
+#define CA_CRM_PKTERR_DIDN             (1ull << 1)
+#define CA_CRM_PKTERR_PACTYPE          (1ull << 2)
+#define CA_CRM_PKTERR_INV_TNUM         (1ull << 3)
+#define CA_CRM_PKTERR_ADDR_RNG         (1ull << 4)
+#define CA_CRM_PKTERR_ADDR_ALGN                (1ull << 5)
+#define CA_CRM_PKTERR_HDR_PARAM                (1ull << 6)
+#define CA_CRM_PKTERR_CW_ERR           (1ull << 7)
+#define CA_CRM_PKTERR_SBERR_NH         (1ull << 8)
+#define CA_CRM_PKTERR_EARLY_TERM       (1ull << 9)
+#define CA_CRM_PKTERR_EARLY_TAIL       (1ull << 10)
+#define CA_CRM_PKTERR_MSSNG_TAIL       (1ull << 11)
+#define CA_CRM_PKTERR_MSSNG_HDR                (1ull << 12)
+       /* bits 15:13 unused */
+#define CA_FIRST_CRM_PKTERR_SBERR_HDR  (1ull << 16)
+#define CA_FIRST_CRM_PKTERR_DIDN       (1ull << 17)
+#define CA_FIRST_CRM_PKTERR_PACTYPE    (1ull << 18)
+#define CA_FIRST_CRM_PKTERR_INV_TNUM   (1ull << 19)
+#define CA_FIRST_CRM_PKTERR_ADDR_RNG   (1ull << 20)
+#define CA_FIRST_CRM_PKTERR_ADDR_ALGN  (1ull << 21)
+#define CA_FIRST_CRM_PKTERR_HDR_PARAM  (1ull << 22)
+#define CA_FIRST_CRM_PKTERR_CW_ERR     (1ull << 23)
+#define CA_FIRST_CRM_PKTERR_SBERR_NH   (1ull << 24)
+#define CA_FIRST_CRM_PKTERR_EARLY_TERM (1ull << 25)
+#define CA_FIRST_CRM_PKTERR_EARLY_TAIL (1ull << 26)
+#define CA_FIRST_CRM_PKTERR_MSSNG_TAIL (1ull << 27)
+#define CA_FIRST_CRM_PKTERR_MSSNG_HDR  (1ull << 28)
+       /* bits 63:29 unused */
+
+/* ==== ca_crm_ct_error_detail_1 */
+#define CA_PKT_TYPE                    (0xfull << 0)
+#define CA_PKT_TYPE_SHFT               0
+#define CA_SRC_ID                      (0x3ull << 4)
+#define CA_SRC_ID_SHFT                 4
+#define CA_DATA_SZ                     (0x3ull << 6)
+#define CA_DATA_SZ_SHFT                        6
+#define CA_TNUM                                (0xffull << 8)
+#define CA_TNUM_SHFT                   8
+#define CA_DW_DATA_EN                  (0xffull << 16)
+#define CA_DW_DATA_EN_SHFT             16
+#define CA_GFX_CRED                    (0xffull << 24)
+#define CA_GFX_CRED_SHFT               24
+#define CA_MEM_RD_PARAM                        (0x3ull << 32)
+#define CA_MEM_RD_PARAM_SHFT           32
+#define CA_PIO_OP                      (1ull << 34)
+#define CA_CW_ERR                      (1ull << 35)
+       /* bits 62:36 unused */
+#define CA_VALID                       (1ull << 63)
+
+/* ==== ca_crm_ct_error_detail_2 */
+       /* bits 2:0 unused */
+#define CA_PKT_ADDR                    (0x1fffffffffffffull << 3)
+#define CA_PKT_ADDR_SHFT               3
+       /* bits 63:56 unused */
+
+/* ==== ca_crm_tnumto */
+#define CA_CRM_TNUMTO_VAL              (0xffull << 0)
+#define CA_CRM_TNUMTO_VAL_SHFT         0
+#define CA_CRM_TNUMTO_WR               (1ull << 8)
+       /* bits 63:9 unused */
+
+/* ==== ca_gart_err */
+#define CA_GART_ERR_SOURCE             (0x3ull << 0)
+#define CA_GART_ERR_SOURCE_SHFT                0
+       /* bits 3:2 unused */
+#define CA_GART_ERR_ADDR               (0xfffffffffull << 4)
+#define CA_GART_ERR_ADDR_SHFT          4
+       /* bits 63:40 unused */
+
+/* ==== ca_pcierr_type */
+#define CA_PCIERR_DATA                 (0xffffffffull << 0)
+#define CA_PCIERR_DATA_SHFT            0
+#define CA_PCIERR_ENB                  (0xfull << 32)
+#define CA_PCIERR_ENB_SHFT             32
+#define CA_PCIERR_CMD                  (0xfull << 36)
+#define CA_PCIERR_CMD_SHFT             36
+#define CA_PCIERR_A64                  (1ull << 40)
+#define CA_PCIERR_SLV_SERR             (1ull << 41)
+#define CA_PCIERR_SLV_WR_PERR          (1ull << 42)
+#define CA_PCIERR_SLV_RD_PERR          (1ull << 43)
+#define CA_PCIERR_MST_SERR             (1ull << 44)
+#define CA_PCIERR_MST_WR_PERR          (1ull << 45)
+#define CA_PCIERR_MST_RD_PERR          (1ull << 46)
+#define CA_PCIERR_MST_MABT             (1ull << 47)
+#define CA_PCIERR_MST_TABT             (1ull << 48)
+#define CA_PCIERR_MST_RETRY_TOUT       (1ull << 49)
+
+#define CA_PCIERR_TYPES \
+       (CA_PCIERR_A64|CA_PCIERR_SLV_SERR| \
+        CA_PCIERR_SLV_WR_PERR|CA_PCIERR_SLV_RD_PERR| \
+        CA_PCIERR_MST_SERR|CA_PCIERR_MST_WR_PERR|CA_PCIERR_MST_RD_PERR| \
+        CA_PCIERR_MST_MABT|CA_PCIERR_MST_TABT|CA_PCIERR_MST_RETRY_TOUT)
+
+       /* bits 63:50 unused */
+
+/* ==== ca_pci_dma_addr_extn */
+#define CA_UPPER_NODE_OFFSET           (0x3full << 0)
+#define CA_UPPER_NODE_OFFSET_SHFT      0
+       /* bits 7:6 unused */
+#define CA_CHIPLET_ID                  (0x3ull << 8)
+#define CA_CHIPLET_ID_SHFT             8
+       /* bits 11:10 unused */
+#define CA_PCI_DMA_NODE_ID             (0xffffull << 12)
+#define CA_PCI_DMA_NODE_ID_SHFT                12
+       /* bits 27:26 unused */
+#define CA_PCI_DMA_PIO_MEM_TYPE                (1ull << 28)
+       /* bits 63:29 unused */
+
+
+/* ==== ca_agp_dma_addr_extn */
+       /* bits 19:0 unused */
+#define CA_AGP_DMA_NODE_ID             (0xffffull << 20)
+#define CA_AGP_DMA_NODE_ID_SHFT                20
+       /* bits 27:26 unused */
+#define CA_AGP_DMA_PIO_MEM_TYPE                (1ull << 28)
+       /* bits 63:29 unused */
+
+/* ==== ca_debug_vector_sel */
+#define CA_DEBUG_MN_VSEL               (0xfull << 0)
+#define CA_DEBUG_MN_VSEL_SHFT          0
+#define CA_DEBUG_PP_VSEL               (0xfull << 4)
+#define CA_DEBUG_PP_VSEL_SHFT          4
+#define CA_DEBUG_GW_VSEL               (0xfull << 8)
+#define CA_DEBUG_GW_VSEL_SHFT          8
+#define CA_DEBUG_GT_VSEL               (0xfull << 12)
+#define CA_DEBUG_GT_VSEL_SHFT          12
+#define CA_DEBUG_PD_VSEL               (0xfull << 16)
+#define CA_DEBUG_PD_VSEL_SHFT          16
+#define CA_DEBUG_AD_VSEL               (0xfull << 20)
+#define CA_DEBUG_AD_VSEL_SHFT          20
+#define CA_DEBUG_CX_VSEL               (0xfull << 24)
+#define CA_DEBUG_CX_VSEL_SHFT          24
+#define CA_DEBUG_CR_VSEL               (0xfull << 28)
+#define CA_DEBUG_CR_VSEL_SHFT          28
+#define CA_DEBUG_BA_VSEL               (0xfull << 32)
+#define CA_DEBUG_BA_VSEL_SHFT          32
+#define CA_DEBUG_PE_VSEL               (0xfull << 36)
+#define CA_DEBUG_PE_VSEL_SHFT          36
+#define CA_DEBUG_BO_VSEL               (0xfull << 40)
+#define CA_DEBUG_BO_VSEL_SHFT          40
+#define CA_DEBUG_BI_VSEL               (0xfull << 44)
+#define CA_DEBUG_BI_VSEL_SHFT          44
+#define CA_DEBUG_AS_VSEL               (0xfull << 48)
+#define CA_DEBUG_AS_VSEL_SHFT          48
+#define CA_DEBUG_PS_VSEL               (0xfull << 52)
+#define CA_DEBUG_PS_VSEL_SHFT          52
+#define CA_DEBUG_PM_VSEL               (0xfull << 56)
+#define CA_DEBUG_PM_VSEL_SHFT          56
+       /* bits 63:60 unused */
+
+/* ==== ca_debug_mux_core_sel */
+/* ==== ca_debug_mux_pci_sel */
+#define CA_DEBUG_MSEL0                 (0x7ull << 0)
+#define CA_DEBUG_MSEL0_SHFT            0
+       /* bit 3 unused */
+#define CA_DEBUG_NSEL0                 (0x7ull << 4)
+#define CA_DEBUG_NSEL0_SHFT            4
+       /* bit 7 unused */
+#define CA_DEBUG_MSEL1                 (0x7ull << 8)
+#define CA_DEBUG_MSEL1_SHFT            8
+       /* bit 11 unused */
+#define CA_DEBUG_NSEL1                 (0x7ull << 12)
+#define CA_DEBUG_NSEL1_SHFT            12
+       /* bit 15 unused */
+#define CA_DEBUG_MSEL2                 (0x7ull << 16)
+#define CA_DEBUG_MSEL2_SHFT            16
+       /* bit 19 unused */
+#define CA_DEBUG_NSEL2                 (0x7ull << 20)
+#define CA_DEBUG_NSEL2_SHFT            20
+       /* bit 23 unused */
+#define CA_DEBUG_MSEL3                 (0x7ull << 24)
+#define CA_DEBUG_MSEL3_SHFT            24
+       /* bit 27 unused */
+#define CA_DEBUG_NSEL3                 (0x7ull << 28)
+#define CA_DEBUG_NSEL3_SHFT            28
+       /* bit 31 unused */
+#define CA_DEBUG_MSEL4                 (0x7ull << 32)
+#define CA_DEBUG_MSEL4_SHFT            32
+       /* bit 35 unused */
+#define CA_DEBUG_NSEL4                 (0x7ull << 36)
+#define CA_DEBUG_NSEL4_SHFT            36
+       /* bit 39 unused */
+#define CA_DEBUG_MSEL5                 (0x7ull << 40)
+#define CA_DEBUG_MSEL5_SHFT            40
+       /* bit 43 unused */
+#define CA_DEBUG_NSEL5                 (0x7ull << 44)
+#define CA_DEBUG_NSEL5_SHFT            44
+       /* bit 47 unused */
+#define CA_DEBUG_MSEL6                 (0x7ull << 48)
+#define CA_DEBUG_MSEL6_SHFT            48
+       /* bit 51 unused */
+#define CA_DEBUG_NSEL6                 (0x7ull << 52)
+#define CA_DEBUG_NSEL6_SHFT            52
+       /* bit 55 unused */
+#define CA_DEBUG_MSEL7                 (0x7ull << 56)
+#define CA_DEBUG_MSEL7_SHFT            56
+       /* bit 59 unused */
+#define CA_DEBUG_NSEL7                 (0x7ull << 60)
+#define CA_DEBUG_NSEL7_SHFT            60
+       /* bit 63 unused */
+
+
+/* ==== ca_debug_domain_sel */
+#define CA_DEBUG_DOMAIN_L              (1ull << 0)
+#define CA_DEBUG_DOMAIN_H              (1ull << 1)
+       /* bits 63:2 unused */
+
+/* ==== ca_gart_ptr_table */
+#define CA_GART_PTR_VAL                        (1ull << 0)
+       /* bits 11:1 unused */
+#define CA_GART_PTR_ADDR               (0xfffffffffffull << 12)
+#define CA_GART_PTR_ADDR_SHFT          12
+       /* bits 63:56 unused */
+
+/* ==== ca_gart_tlb_addr[0-7] */
+#define CA_GART_TLB_ADDR               (0xffffffffffffffull << 0)
+#define CA_GART_TLB_ADDR_SHFT          0
+       /* bits 62:56 unused */
+#define CA_GART_TLB_ENTRY_VAL          (1ull << 63)
+
+/*
+ * PIO address space ranges for TIO:CA
+ */
+
+/* CA internal registers */
+#define CA_PIO_ADMIN                   0x00000000
+#define CA_PIO_ADMIN_LEN               0x00010000
+
+/* GFX Write Buffer - Diagnostics */
+#define CA_PIO_GFX                     0x00010000
+#define CA_PIO_GFX_LEN                 0x00010000
+
+/* AGP DMA Write Buffer - Diagnostics */
+#define CA_PIO_AGP_DMAWRITE            0x00020000
+#define CA_PIO_AGP_DMAWRITE_LEN                0x00010000
+
+/* AGP DMA READ Buffer - Diagnostics */
+#define CA_PIO_AGP_DMAREAD             0x00030000
+#define CA_PIO_AGP_DMAREAD_LEN         0x00010000
+
+/* PCI Config Type 0 */
+#define CA_PIO_PCI_TYPE0_CONFIG                0x01000000
+#define CA_PIO_PCI_TYPE0_CONFIG_LEN    0x01000000
+
+/* PCI Config Type 1 */
+#define CA_PIO_PCI_TYPE1_CONFIG                0x02000000
+#define CA_PIO_PCI_TYPE1_CONFIG_LEN    0x01000000
+
+/* PCI I/O Cycles - mapped to PCI Address 0x00000000-0x04ffffff */
+#define CA_PIO_PCI_IO                  0x03000000
+#define CA_PIO_PCI_IO_LEN              0x05000000
+
+/* PCI MEM Cycles - mapped to PCI with CA_PIO_ADDR_OFFSET of ca_control1 */
+/*     use Fast Write if enabled and coretalk packet type is a GFX request */
+#define CA_PIO_PCI_MEM_OFFSET          0x08000000
+#define CA_PIO_PCI_MEM_OFFSET_LEN      0x08000000
+
+/* PCI MEM Cycles - mapped to PCI Address 0x00000000-0xbfffffff */
+/*     use Fast Write if enabled and coretalk packet type is a GFX request */
+#define CA_PIO_PCI_MEM                 0x40000000
+#define CA_PIO_PCI_MEM_LEN             0xc0000000
+
+/*
+ * DMA space
+ *
+ * The CA aperature (ie. bus address range) mapped by the GART is segmented into
+ * two parts.  The lower portion of the aperature is used for mapping 32 bit
+ * PCI addresses which are managed by the dma interfaces in this file.  The
+ * upper poprtion of the aperature is used for mapping 48 bit AGP addresses.
+ * The AGP portion of the aperature is managed by the agpgart_be.c driver
+ * in drivers/linux/agp.  There are ca-specific hooks in that driver to
+ * manipulate the gart, but management of the AGP portion of the aperature
+ * is the responsibility of that driver.
+ *
+ * CA allows three main types of DMA mapping:
+ *
+ * PCI 64-bit  Managed by this driver
+ * PCI 32-bit  Managed by this driver
+ * AGP 48-bit  Managed by hooks in the /dev/agpgart driver
+ *
+ * All of the above can optionally be remapped through the GART.  The following
+ * table lists the combinations of addressing types and GART remapping that
+ * is currently supported by the driver (h/w supports all, s/w limits this):
+ *
+ *             PCI64           PCI32           AGP48
+ * GART                no              yes             yes
+ * Direct      yes             yes             no
+ *
+ * GART remapping of PCI64 is not done because there is no need to.  The
+ * 64 bit PCI address holds all of the information necessary to target any
+ * memory in the system.
+ *
+ * AGP48 is always mapped through the GART.  Management of the AGP48 portion
+ * of the aperature is the responsibility of code in the agpgart_be driver.
+ *
+ * The non-64 bit bus address space will currently be partitioned like this:
+ *
+ *     0xffff_ffff_ffff        +--------
+ *                             | AGP48 direct
+ *                             | Space managed by this driver
+ *     CA_AGP_DIRECT_BASE      +--------
+ *                             | AGP GART mapped (gfx aperature)
+ *                             | Space managed by /dev/agpgart driver
+ *                             | This range is exposed to the agpgart
+ *                             | driver as the "graphics aperature"
+ *     CA_AGP_MAPPED_BASE      +-----
+ *                             | PCI GART mapped
+ *                             | Space managed by this driver          
+ *     CA_PCI32_MAPPED_BASE    +----
+ *                             | PCI32 direct
+ *                             | Space managed by this driver
+ *     0xC000_0000             +--------
+ *     (CA_PCI32_DIRECT_BASE)
+ *
+ * The bus address range CA_PCI32_MAPPED_BASE through CA_AGP_DIRECT_BASE
+ * is what we call the CA aperature.  Addresses falling in this range will
+ * be remapped using the GART.
+ *
+ * The bus address range CA_AGP_MAPPED_BASE through CA_AGP_DIRECT_BASE
+ * is what we call the graphics aperature.  This is a subset of the CA
+ * aperature and is under the control of the agpgart_be driver.
+ *
+ * CA_PCI32_MAPPED_BASE, CA_AGP_MAPPED_BASE, and CA_AGP_DIRECT_BASE are
+ * somewhat arbitrary values.  The known constraints on choosing these is:
+ *
+ * 1)  CA_AGP_DIRECT_BASE-CA_PCI32_MAPPED_BASE+1 (the CA aperature size)
+ *     must be one of the values supported by the ca_gart_aperature register.
+ *     Currently valid values are: 4MB through 4096MB in powers of 2 increments
+ *
+ * 2)  CA_AGP_DIRECT_BASE-CA_AGP_MAPPED_BASE+1 (the gfx aperature size)
+ *     must be in MB units since that's what the agpgart driver assumes.
+ */
+
+/*
+ * Define Bus DMA ranges.  These are configurable (see constraints above)
+ * and will probably need tuning based on experience.
+ */
+
+
+/*
+ * 11/24/03
+ * CA has an addressing glitch w.r.t. PCI direct 32 bit DMA that makes it
+ * generally unusable.  The problem is that for PCI direct 32 
+ * DMA's, all 32 bits of the bus address are used to form the lower 32 bits
+ * of the coretalk address, and coretalk bits 38:32 come from a register.
+ * Since only PCI bus addresses 0xC0000000-0xFFFFFFFF (1GB) are available
+ * for DMA (the rest is allocated to PIO), host node addresses need to be
+ * such that their lower 32 bits fall in the 0xC0000000-0xffffffff range
+ * as well.  So there can be no PCI32 direct DMA below 3GB!!  For this
+ * reason we set the CA_PCI32_DIRECT_SIZE to 0 which essentially makes
+ * tioca_dma_direct32() a noop but preserves the code flow should this issue
+ * be fixed in a respin.
+ *
+ * For now, all PCI32 DMA's must be mapped through the GART.
+ */
+
+#define CA_PCI32_DIRECT_BASE   0xC0000000UL    /* BASE not configurable */
+#define CA_PCI32_DIRECT_SIZE   0x00000000UL    /* 0 MB */
+
+#define CA_PCI32_MAPPED_BASE   0xC0000000UL
+#define CA_PCI32_MAPPED_SIZE   0x40000000UL    /* 2GB */
+
+#define CA_AGP_MAPPED_BASE     0x80000000UL
+#define CA_AGP_MAPPED_SIZE     0x40000000UL    /* 2GB */
+
+#define CA_AGP_DIRECT_BASE     0x40000000UL    /* 2GB */
+#define CA_AGP_DIRECT_SIZE     0x40000000UL
+
+#define CA_APERATURE_BASE      (CA_AGP_MAPPED_BASE)
+#define CA_APERATURE_SIZE      (CA_AGP_MAPPED_SIZE+CA_PCI32_MAPPED_SIZE)
+
+#endif  /* _ASM_IA64_SN_TIO_TIOCA_H */
diff --git a/arch/ia64/include/asm/sn/tioca_provider.h b/arch/ia64/include/asm/sn/tioca_provider.h
new file mode 100644 (file)
index 0000000..9a820ac
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
+#define _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
+
+#include <asm/sn/tioca.h>
+
+/*
+ * WAR enables
+ * Defines for individual WARs. Each is a bitmask of applicable
+ * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
+ * (3 << 1) == (rev A or rev B), etc
+ */
+
+#define TIOCA_WAR_ENABLED(pv, tioca_common) \
+       ((1 << tioca_common->ca_rev) & pv)
+
+  /* TIO:ICE:FRZ:Freezer loses a PIO data ucred on PIO RD RSP with CW error */
+#define PV907908 (1 << 1)
+  /* ATI config space problems after BIOS execution starts */
+#define PV908234 (1 << 1)
+  /* CA:AGPDMA write request data mismatch with ABC1CL merge */
+#define PV895469 (1 << 1)
+  /* TIO:CA TLB invalidate of written GART entries possibly not occurring in CA*/
+#define PV910244 (1 << 1)
+
+struct tioca_dmamap{
+       struct list_head        cad_list;       /* headed by ca_list */
+
+       dma_addr_t              cad_dma_addr;   /* Linux dma handle */
+       uint                    cad_gart_entry; /* start entry in ca_gart_pagemap */
+       uint                    cad_gart_size;  /* #entries for this map */
+};
+
+/*
+ * Kernel only fields.  Prom may look at this stuff for debugging only.
+ * Access this structure through the ca_kernel_private ptr.
+ */
+
+struct tioca_common ;
+
+struct tioca_kernel {
+       struct tioca_common     *ca_common;     /* tioca this belongs to */
+       struct list_head        ca_list;        /* list of all ca's */
+       struct list_head        ca_dmamaps;
+       spinlock_t              ca_lock;        /* Kernel lock */
+       cnodeid_t               ca_closest_node;
+       struct list_head        *ca_devices;    /* bus->devices */
+
+       /*
+        * General GART stuff
+        */
+       u64     ca_ap_size;             /* size of aperature in bytes */
+       u32     ca_gart_entries;        /* # u64 entries in gart */
+       u32     ca_ap_pagesize;         /* aperature page size in bytes */
+       u64     ca_ap_bus_base;         /* bus address of CA aperature */
+       u64     ca_gart_size;           /* gart size in bytes */
+       u64     *ca_gart;               /* gart table vaddr */
+       u64     ca_gart_coretalk_addr;  /* gart coretalk addr */
+       u8              ca_gart_iscoherent;     /* used in tioca_tlbflush */
+
+       /* PCI GART convenience values */
+       u64     ca_pciap_base;          /* pci aperature bus base address */
+       u64     ca_pciap_size;          /* pci aperature size (bytes) */
+       u64     ca_pcigart_base;        /* gfx GART bus base address */
+       u64     *ca_pcigart;            /* gfx GART vm address */
+       u32     ca_pcigart_entries;
+       u32     ca_pcigart_start;       /* PCI start index in ca_gart */
+       void            *ca_pcigart_pagemap;
+
+       /* AGP GART convenience values */
+       u64     ca_gfxap_base;          /* gfx aperature bus base address */
+       u64     ca_gfxap_size;          /* gfx aperature size (bytes) */
+       u64     ca_gfxgart_base;        /* gfx GART bus base address */
+       u64     *ca_gfxgart;            /* gfx GART vm address */
+       u32     ca_gfxgart_entries;
+       u32     ca_gfxgart_start;       /* agpgart start index in ca_gart */
+};
+
+/*
+ * Common tioca info shared between kernel and prom
+ *
+ * DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES
+ * TO THE PROM VERSION.
+ */
+
+struct tioca_common {
+       struct pcibus_bussoft   ca_common;      /* common pciio header */
+
+       u32             ca_rev;
+       u32             ca_closest_nasid;
+
+       u64             ca_prom_private;
+       u64             ca_kernel_private;
+};
+
+/**
+ * tioca_paddr_to_gart - Convert an SGI coretalk address to a CA GART entry
+ * @paddr: page address to convert
+ *
+ * Convert a system [coretalk] address to a GART entry.  GART entries are
+ * formed using the following:
+ *
+ *     data = ( (1<<63) |  ( (REMAP_NODE_ID << 40) | (MD_CHIPLET_ID << 38) | 
+ * (REMAP_SYS_ADDR) ) >> 12 )
+ *
+ * DATA written to 1 GART TABLE Entry in system memory is remapped system
+ * addr for 1 page 
+ *
+ * The data is for coretalk address format right shifted 12 bits with a
+ * valid bit.
+ *
+ *     GART_TABLE_ENTRY [ 25:0 ]  -- REMAP_SYS_ADDRESS[37:12].
+ *     GART_TABLE_ENTRY [ 27:26 ] -- SHUB MD chiplet id.
+ *     GART_TABLE_ENTRY [ 41:28 ] -- REMAP_NODE_ID.
+ *     GART_TABLE_ENTRY [ 63 ]    -- Valid Bit 
+ */
+static inline u64
+tioca_paddr_to_gart(unsigned long paddr)
+{
+       /*
+        * We are assuming right now that paddr already has the correct
+        * format since the address from xtalk_dmaXXX should already have
+        * NODE_ID, CHIPLET_ID, and SYS_ADDR in the correct locations.
+        */
+
+       return ((paddr) >> 12) | (1UL << 63);
+}
+
+/**
+ * tioca_physpage_to_gart - Map a host physical page for SGI CA based DMA
+ * @page_addr: system page address to map
+ */
+
+static inline unsigned long
+tioca_physpage_to_gart(u64 page_addr)
+{
+       u64 coretalk_addr;
+
+       coretalk_addr = PHYS_TO_TIODMA(page_addr);
+       if (!coretalk_addr) {
+               return 0;
+       }
+
+       return tioca_paddr_to_gart(coretalk_addr);
+}
+
+/**
+ * tioca_tlbflush - invalidate cached SGI CA GART TLB entries
+ * @tioca_kernel: CA context 
+ *
+ * Invalidate tlb entries for a given CA GART.  Main complexity is to account
+ * for revA bug.
+ */
+static inline void
+tioca_tlbflush(struct tioca_kernel *tioca_kernel)
+{
+       volatile u64 tmp;
+       volatile struct tioca __iomem *ca_base;
+       struct tioca_common *tioca_common;
+
+       tioca_common = tioca_kernel->ca_common;
+       ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
+
+       /*
+        * Explicit flushes not needed if GART is in cached mode
+        */
+       if (tioca_kernel->ca_gart_iscoherent) {
+               if (TIOCA_WAR_ENABLED(PV910244, tioca_common)) {
+                       /*
+                        * PV910244:  RevA CA needs explicit flushes.
+                        * Need to put GART into uncached mode before
+                        * flushing otherwise the explicit flush is ignored.
+                        *
+                        * Alternate WAR would be to leave GART cached and
+                        * touch every CL aligned GART entry.
+                        */
+
+                       __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM);
+                       __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
+                       __sn_setq_relaxed(&ca_base->ca_control2,
+                           (0x2ull << CA_GART_MEM_PARAM_SHFT));
+                       tmp = __sn_readq_relaxed(&ca_base->ca_control2);
+               }
+
+               return;
+       }
+
+       /*
+        * Gart in uncached mode ... need an explicit flush.
+        */
+
+       __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
+       tmp = __sn_readq_relaxed(&ca_base->ca_control2);
+}
+
+extern u32     tioca_gart_found;
+extern struct list_head tioca_list;
+extern int tioca_init_provider(void);
+extern void tioca_fastwrite_enable(struct tioca_kernel *tioca_kern);
+#endif /* _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H */
diff --git a/arch/ia64/include/asm/sn/tioce.h b/arch/ia64/include/asm/sn/tioce.h
new file mode 100644 (file)
index 0000000..893468e
--- /dev/null
@@ -0,0 +1,760 @@
+/*
+ * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef __ASM_IA64_SN_TIOCE_H__
+#define __ASM_IA64_SN_TIOCE_H__
+
+/* CE ASIC part & mfgr information  */
+#define TIOCE_PART_NUM                 0xCE00
+#define TIOCE_SRC_ID                   0x01
+#define TIOCE_REV_A                    0x1
+
+/* CE Virtual PPB Vendor/Device IDs */
+#define CE_VIRT_PPB_VENDOR_ID          0x10a9
+#define CE_VIRT_PPB_DEVICE_ID          0x4002
+
+/* CE Host Bridge Vendor/Device IDs */
+#define CE_HOST_BRIDGE_VENDOR_ID       0x10a9
+#define CE_HOST_BRIDGE_DEVICE_ID       0x4001
+
+
+#define TIOCE_NUM_M40_ATES             4096
+#define TIOCE_NUM_M3240_ATES           2048
+#define TIOCE_NUM_PORTS                        2
+
+/*
+ * Register layout for TIOCE.  MMR offsets are shown at the far right of the
+ * structure definition.
+ */
+typedef volatile struct tioce {
+       /*
+        * ADMIN : Administration Registers
+        */
+       u64     ce_adm_id;                              /* 0x000000 */
+       u64     ce_pad_000008;                          /* 0x000008 */
+       u64     ce_adm_dyn_credit_status;               /* 0x000010 */
+       u64     ce_adm_last_credit_status;              /* 0x000018 */
+       u64     ce_adm_credit_limit;                    /* 0x000020 */
+       u64     ce_adm_force_credit;                    /* 0x000028 */
+       u64     ce_adm_control;                         /* 0x000030 */
+       u64     ce_adm_mmr_chn_timeout;                 /* 0x000038 */
+       u64     ce_adm_ssp_ure_timeout;                 /* 0x000040 */
+       u64     ce_adm_ssp_dre_timeout;                 /* 0x000048 */
+       u64     ce_adm_ssp_debug_sel;                   /* 0x000050 */
+       u64     ce_adm_int_status;                      /* 0x000058 */
+       u64     ce_adm_int_status_alias;                /* 0x000060 */
+       u64     ce_adm_int_mask;                        /* 0x000068 */
+       u64     ce_adm_int_pending;                     /* 0x000070 */
+       u64     ce_adm_force_int;                       /* 0x000078 */
+       u64     ce_adm_ure_ups_buf_barrier_flush;       /* 0x000080 */
+       u64     ce_adm_int_dest[15];        /* 0x000088 -- 0x0000F8 */
+       u64     ce_adm_error_summary;                   /* 0x000100 */
+       u64     ce_adm_error_summary_alias;             /* 0x000108 */
+       u64     ce_adm_error_mask;                      /* 0x000110 */
+       u64     ce_adm_first_error;                     /* 0x000118 */
+       u64     ce_adm_error_overflow;                  /* 0x000120 */
+       u64     ce_adm_error_overflow_alias;            /* 0x000128 */
+       u64     ce_pad_000130[2];           /* 0x000130 -- 0x000138 */
+       u64     ce_adm_tnum_error;                      /* 0x000140 */
+       u64     ce_adm_mmr_err_detail;                  /* 0x000148 */
+       u64     ce_adm_msg_sram_perr_detail;            /* 0x000150 */
+       u64     ce_adm_bap_sram_perr_detail;            /* 0x000158 */
+       u64     ce_adm_ce_sram_perr_detail;             /* 0x000160 */
+       u64     ce_adm_ce_credit_oflow_detail;          /* 0x000168 */
+       u64     ce_adm_tx_link_idle_max_timer;          /* 0x000170 */
+       u64     ce_adm_pcie_debug_sel;                  /* 0x000178 */
+       u64     ce_pad_000180[16];          /* 0x000180 -- 0x0001F8 */
+
+       u64     ce_adm_pcie_debug_sel_top;              /* 0x000200 */
+       u64     ce_adm_pcie_debug_lat_sel_lo_top;       /* 0x000208 */
+       u64     ce_adm_pcie_debug_lat_sel_hi_top;       /* 0x000210 */
+       u64     ce_adm_pcie_debug_trig_sel_top;         /* 0x000218 */
+       u64     ce_adm_pcie_debug_trig_lat_sel_lo_top;  /* 0x000220 */
+       u64     ce_adm_pcie_debug_trig_lat_sel_hi_top;  /* 0x000228 */
+       u64     ce_adm_pcie_trig_compare_top;           /* 0x000230 */
+       u64     ce_adm_pcie_trig_compare_en_top;        /* 0x000238 */
+       u64     ce_adm_ssp_debug_sel_top;               /* 0x000240 */
+       u64     ce_adm_ssp_debug_lat_sel_lo_top;        /* 0x000248 */
+       u64     ce_adm_ssp_debug_lat_sel_hi_top;        /* 0x000250 */
+       u64     ce_adm_ssp_debug_trig_sel_top;          /* 0x000258 */
+       u64     ce_adm_ssp_debug_trig_lat_sel_lo_top;   /* 0x000260 */
+       u64     ce_adm_ssp_debug_trig_lat_sel_hi_top;   /* 0x000268 */
+       u64     ce_adm_ssp_trig_compare_top;            /* 0x000270 */
+       u64     ce_adm_ssp_trig_compare_en_top;         /* 0x000278 */
+       u64     ce_pad_000280[48];          /* 0x000280 -- 0x0003F8 */
+
+       u64     ce_adm_bap_ctrl;                        /* 0x000400 */
+       u64     ce_pad_000408[127];         /* 0x000408 -- 0x0007F8 */
+
+       u64     ce_msg_buf_data63_0[35];    /* 0x000800 -- 0x000918 */
+       u64     ce_pad_000920[29];          /* 0x000920 -- 0x0009F8 */
+
+       u64     ce_msg_buf_data127_64[35];  /* 0x000A00 -- 0x000B18 */
+       u64     ce_pad_000B20[29];          /* 0x000B20 -- 0x000BF8 */
+
+       u64     ce_msg_buf_parity[35];      /* 0x000C00 -- 0x000D18 */
+       u64     ce_pad_000D20[29];          /* 0x000D20 -- 0x000DF8 */
+
+       u64     ce_pad_000E00[576];         /* 0x000E00 -- 0x001FF8 */
+
+       /*
+        * LSI : LSI's PCI Express Link Registers (Link#1 and Link#2)
+        * Link#1 MMRs at start at 0x002000, Link#2 MMRs at 0x003000
+        * NOTE: the comment offsets at far right: let 'z' = {2 or 3}
+        */
+       #define ce_lsi(link_num)        ce_lsi[link_num-1]
+       struct ce_lsi_reg {
+               u64     ce_lsi_lpu_id;                  /* 0x00z000 */
+               u64     ce_lsi_rst;                     /* 0x00z008 */
+               u64     ce_lsi_dbg_stat;                /* 0x00z010 */
+               u64     ce_lsi_dbg_cfg;                 /* 0x00z018 */
+               u64     ce_lsi_ltssm_ctrl;              /* 0x00z020 */
+               u64     ce_lsi_lk_stat;                 /* 0x00z028 */
+               u64     ce_pad_00z030[2];   /* 0x00z030 -- 0x00z038 */
+               u64     ce_lsi_int_and_stat;            /* 0x00z040 */
+               u64     ce_lsi_int_mask;                /* 0x00z048 */
+               u64     ce_pad_00z050[22];  /* 0x00z050 -- 0x00z0F8 */
+               u64     ce_lsi_lk_perf_cnt_sel;         /* 0x00z100 */
+               u64     ce_pad_00z108;                  /* 0x00z108 */
+               u64     ce_lsi_lk_perf_cnt_ctrl;        /* 0x00z110 */
+               u64     ce_pad_00z118;                  /* 0x00z118 */
+               u64     ce_lsi_lk_perf_cnt1;            /* 0x00z120 */
+               u64     ce_lsi_lk_perf_cnt1_test;       /* 0x00z128 */
+               u64     ce_lsi_lk_perf_cnt2;            /* 0x00z130 */
+               u64     ce_lsi_lk_perf_cnt2_test;       /* 0x00z138 */
+               u64     ce_pad_00z140[24];  /* 0x00z140 -- 0x00z1F8 */
+               u64     ce_lsi_lk_lyr_cfg;              /* 0x00z200 */
+               u64     ce_lsi_lk_lyr_status;           /* 0x00z208 */
+               u64     ce_lsi_lk_lyr_int_stat;         /* 0x00z210 */
+               u64     ce_lsi_lk_ly_int_stat_test;     /* 0x00z218 */
+               u64     ce_lsi_lk_ly_int_stat_mask;     /* 0x00z220 */
+               u64     ce_pad_00z228[3];   /* 0x00z228 -- 0x00z238 */
+               u64     ce_lsi_fc_upd_ctl;              /* 0x00z240 */
+               u64     ce_pad_00z248[3];   /* 0x00z248 -- 0x00z258 */
+               u64     ce_lsi_flw_ctl_upd_to_timer;    /* 0x00z260 */
+               u64     ce_lsi_flw_ctl_upd_timer0;      /* 0x00z268 */
+               u64     ce_lsi_flw_ctl_upd_timer1;      /* 0x00z270 */
+               u64     ce_pad_00z278[49];  /* 0x00z278 -- 0x00z3F8 */
+               u64     ce_lsi_freq_nak_lat_thrsh;      /* 0x00z400 */
+               u64     ce_lsi_ack_nak_lat_tmr;         /* 0x00z408 */
+               u64     ce_lsi_rply_tmr_thr;            /* 0x00z410 */
+               u64     ce_lsi_rply_tmr;                /* 0x00z418 */
+               u64     ce_lsi_rply_num_stat;           /* 0x00z420 */
+               u64     ce_lsi_rty_buf_max_addr;        /* 0x00z428 */
+               u64     ce_lsi_rty_fifo_ptr;            /* 0x00z430 */
+               u64     ce_lsi_rty_fifo_rd_wr_ptr;      /* 0x00z438 */
+               u64     ce_lsi_rty_fifo_cred;           /* 0x00z440 */
+               u64     ce_lsi_seq_cnt;                 /* 0x00z448 */
+               u64     ce_lsi_ack_sent_seq_num;        /* 0x00z450 */
+               u64     ce_lsi_seq_cnt_fifo_max_addr;   /* 0x00z458 */
+               u64     ce_lsi_seq_cnt_fifo_ptr;        /* 0x00z460 */
+               u64     ce_lsi_seq_cnt_rd_wr_ptr;       /* 0x00z468 */
+               u64     ce_lsi_tx_lk_ts_ctl;            /* 0x00z470 */
+               u64     ce_pad_00z478;                  /* 0x00z478 */
+               u64     ce_lsi_mem_addr_ctl;            /* 0x00z480 */
+               u64     ce_lsi_mem_d_ld0;               /* 0x00z488 */
+               u64     ce_lsi_mem_d_ld1;               /* 0x00z490 */
+               u64     ce_lsi_mem_d_ld2;               /* 0x00z498 */
+               u64     ce_lsi_mem_d_ld3;               /* 0x00z4A0 */
+               u64     ce_lsi_mem_d_ld4;               /* 0x00z4A8 */
+               u64     ce_pad_00z4B0[2];   /* 0x00z4B0 -- 0x00z4B8 */
+               u64     ce_lsi_rty_d_cnt;               /* 0x00z4C0 */
+               u64     ce_lsi_seq_buf_cnt;             /* 0x00z4C8 */
+               u64     ce_lsi_seq_buf_bt_d;            /* 0x00z4D0 */
+               u64     ce_pad_00z4D8;                  /* 0x00z4D8 */
+               u64     ce_lsi_ack_lat_thr;             /* 0x00z4E0 */
+               u64     ce_pad_00z4E8[3];   /* 0x00z4E8 -- 0x00z4F8 */
+               u64     ce_lsi_nxt_rcv_seq_1_cntr;      /* 0x00z500 */
+               u64     ce_lsi_unsp_dllp_rcvd;          /* 0x00z508 */
+               u64     ce_lsi_rcv_lk_ts_ctl;           /* 0x00z510 */
+               u64     ce_pad_00z518[29];  /* 0x00z518 -- 0x00z5F8 */
+               u64     ce_lsi_phy_lyr_cfg;             /* 0x00z600 */
+               u64     ce_pad_00z608;                  /* 0x00z608 */
+               u64     ce_lsi_phy_lyr_int_stat;        /* 0x00z610 */
+               u64     ce_lsi_phy_lyr_int_stat_test;   /* 0x00z618 */
+               u64     ce_lsi_phy_lyr_int_mask;        /* 0x00z620 */
+               u64     ce_pad_00z628[11];  /* 0x00z628 -- 0x00z678 */
+               u64     ce_lsi_rcv_phy_cfg;             /* 0x00z680 */
+               u64     ce_lsi_rcv_phy_stat1;           /* 0x00z688 */
+               u64     ce_lsi_rcv_phy_stat2;           /* 0x00z690 */
+               u64     ce_lsi_rcv_phy_stat3;           /* 0x00z698 */
+               u64     ce_lsi_rcv_phy_int_stat;        /* 0x00z6A0 */
+               u64     ce_lsi_rcv_phy_int_stat_test;   /* 0x00z6A8 */
+               u64     ce_lsi_rcv_phy_int_mask;        /* 0x00z6B0 */
+               u64     ce_pad_00z6B8[9];   /* 0x00z6B8 -- 0x00z6F8 */
+               u64     ce_lsi_tx_phy_cfg;              /* 0x00z700 */
+               u64     ce_lsi_tx_phy_stat;             /* 0x00z708 */
+               u64     ce_lsi_tx_phy_int_stat;         /* 0x00z710 */
+               u64     ce_lsi_tx_phy_int_stat_test;    /* 0x00z718 */
+               u64     ce_lsi_tx_phy_int_mask;         /* 0x00z720 */
+               u64     ce_lsi_tx_phy_stat2;            /* 0x00z728 */
+               u64     ce_pad_00z730[10];  /* 0x00z730 -- 0x00z77F */
+               u64     ce_lsi_ltssm_cfg1;              /* 0x00z780 */
+               u64     ce_lsi_ltssm_cfg2;              /* 0x00z788 */
+               u64     ce_lsi_ltssm_cfg3;              /* 0x00z790 */
+               u64     ce_lsi_ltssm_cfg4;              /* 0x00z798 */
+               u64     ce_lsi_ltssm_cfg5;              /* 0x00z7A0 */
+               u64     ce_lsi_ltssm_stat1;             /* 0x00z7A8 */
+               u64     ce_lsi_ltssm_stat2;             /* 0x00z7B0 */
+               u64     ce_lsi_ltssm_int_stat;          /* 0x00z7B8 */
+               u64     ce_lsi_ltssm_int_stat_test;     /* 0x00z7C0 */
+               u64     ce_lsi_ltssm_int_mask;          /* 0x00z7C8 */
+               u64     ce_lsi_ltssm_stat_wr_en;        /* 0x00z7D0 */
+               u64     ce_pad_00z7D8[5];   /* 0x00z7D8 -- 0x00z7F8 */
+               u64     ce_lsi_gb_cfg1;                 /* 0x00z800 */
+               u64     ce_lsi_gb_cfg2;                 /* 0x00z808 */
+               u64     ce_lsi_gb_cfg3;                 /* 0x00z810 */
+               u64     ce_lsi_gb_cfg4;                 /* 0x00z818 */
+               u64     ce_lsi_gb_stat;                 /* 0x00z820 */
+               u64     ce_lsi_gb_int_stat;             /* 0x00z828 */
+               u64     ce_lsi_gb_int_stat_test;        /* 0x00z830 */
+               u64     ce_lsi_gb_int_mask;             /* 0x00z838 */
+               u64     ce_lsi_gb_pwr_dn1;              /* 0x00z840 */
+               u64     ce_lsi_gb_pwr_dn2;              /* 0x00z848 */
+               u64     ce_pad_00z850[246]; /* 0x00z850 -- 0x00zFF8 */
+       } ce_lsi[2];
+
+       u64     ce_pad_004000[10];          /* 0x004000 -- 0x004048 */
+
+       /*
+        * CRM: Coretalk Receive Module Registers
+        */
+       u64     ce_crm_debug_mux;                       /* 0x004050 */
+       u64     ce_pad_004058;                          /* 0x004058 */
+       u64     ce_crm_ssp_err_cmd_wrd;                 /* 0x004060 */
+       u64     ce_crm_ssp_err_addr;                    /* 0x004068 */
+       u64     ce_crm_ssp_err_syn;                     /* 0x004070 */
+
+       u64     ce_pad_004078[499];         /* 0x004078 -- 0x005008 */
+
+       /*
+         * CXM: Coretalk Xmit Module Registers
+         */
+       u64     ce_cxm_dyn_credit_status;               /* 0x005010 */
+       u64     ce_cxm_last_credit_status;              /* 0x005018 */
+       u64     ce_cxm_credit_limit;                    /* 0x005020 */
+       u64     ce_cxm_force_credit;                    /* 0x005028 */
+       u64     ce_cxm_disable_bypass;                  /* 0x005030 */
+       u64     ce_pad_005038[3];           /* 0x005038 -- 0x005048 */
+       u64     ce_cxm_debug_mux;                       /* 0x005050 */
+
+        u64        ce_pad_005058[501];         /* 0x005058 -- 0x005FF8 */
+
+       /*
+        * DTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
+        * DTL: Link#1 MMRs at start at 0x006000, Link#2 MMRs at 0x008000
+        * DTL: the comment offsets at far right: let 'y' = {6 or 8}
+        *
+        * UTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
+        * UTL: Link#1 MMRs at start at 0x007000, Link#2 MMRs at 0x009000
+        * UTL: the comment offsets at far right: let 'z' = {7 or 9}
+        */
+       #define ce_dtl(link_num)        ce_dtl_utl[link_num-1]
+       #define ce_utl(link_num)        ce_dtl_utl[link_num-1]
+       struct ce_dtl_utl_reg {
+               /* DTL */
+               u64     ce_dtl_dtdr_credit_limit;       /* 0x00y000 */
+               u64     ce_dtl_dtdr_credit_force;       /* 0x00y008 */
+               u64     ce_dtl_dyn_credit_status;       /* 0x00y010 */
+               u64     ce_dtl_dtl_last_credit_stat;    /* 0x00y018 */
+               u64     ce_dtl_dtl_ctrl;                /* 0x00y020 */
+               u64     ce_pad_00y028[5];   /* 0x00y028 -- 0x00y048 */
+               u64     ce_dtl_debug_sel;               /* 0x00y050 */
+               u64     ce_pad_00y058[501]; /* 0x00y058 -- 0x00yFF8 */
+
+               /* UTL */
+               u64     ce_utl_utl_ctrl;                /* 0x00z000 */
+               u64     ce_utl_debug_sel;               /* 0x00z008 */
+               u64     ce_pad_00z010[510]; /* 0x00z010 -- 0x00zFF8 */
+       } ce_dtl_utl[2];
+
+       u64     ce_pad_00A000[514];         /* 0x00A000 -- 0x00B008 */
+
+       /*
+        * URE: Upstream Request Engine
+         */
+       u64     ce_ure_dyn_credit_status;               /* 0x00B010 */
+       u64     ce_ure_last_credit_status;              /* 0x00B018 */
+       u64     ce_ure_credit_limit;                    /* 0x00B020 */
+       u64     ce_pad_00B028;                          /* 0x00B028 */
+       u64     ce_ure_control;                         /* 0x00B030 */
+       u64     ce_ure_status;                          /* 0x00B038 */
+       u64     ce_pad_00B040[2];           /* 0x00B040 -- 0x00B048 */
+       u64     ce_ure_debug_sel;                       /* 0x00B050 */
+       u64     ce_ure_pcie_debug_sel;                  /* 0x00B058 */
+       u64     ce_ure_ssp_err_cmd_wrd;                 /* 0x00B060 */
+       u64     ce_ure_ssp_err_addr;                    /* 0x00B068 */
+       u64     ce_ure_page_map;                        /* 0x00B070 */
+       u64     ce_ure_dir_map[TIOCE_NUM_PORTS];        /* 0x00B078 */
+       u64     ce_ure_pipe_sel1;                       /* 0x00B088 */
+       u64     ce_ure_pipe_mask1;                      /* 0x00B090 */
+       u64     ce_ure_pipe_sel2;                       /* 0x00B098 */
+       u64     ce_ure_pipe_mask2;                      /* 0x00B0A0 */
+       u64     ce_ure_pcie1_credits_sent;              /* 0x00B0A8 */
+       u64     ce_ure_pcie1_credits_used;              /* 0x00B0B0 */
+       u64     ce_ure_pcie1_credit_limit;              /* 0x00B0B8 */
+       u64     ce_ure_pcie2_credits_sent;              /* 0x00B0C0 */
+       u64     ce_ure_pcie2_credits_used;              /* 0x00B0C8 */
+       u64     ce_ure_pcie2_credit_limit;              /* 0x00B0D0 */
+       u64     ce_ure_pcie_force_credit;               /* 0x00B0D8 */
+       u64     ce_ure_rd_tnum_val;                     /* 0x00B0E0 */
+       u64     ce_ure_rd_tnum_rsp_rcvd;                /* 0x00B0E8 */
+       u64     ce_ure_rd_tnum_esent_timer;             /* 0x00B0F0 */
+       u64     ce_ure_rd_tnum_error;                   /* 0x00B0F8 */
+       u64     ce_ure_rd_tnum_first_cl;                /* 0x00B100 */
+       u64     ce_ure_rd_tnum_link_buf;                /* 0x00B108 */
+       u64     ce_ure_wr_tnum_val;                     /* 0x00B110 */
+       u64     ce_ure_sram_err_addr0;                  /* 0x00B118 */
+       u64     ce_ure_sram_err_addr1;                  /* 0x00B120 */
+       u64     ce_ure_sram_err_addr2;                  /* 0x00B128 */
+       u64     ce_ure_sram_rd_addr0;                   /* 0x00B130 */
+       u64     ce_ure_sram_rd_addr1;                   /* 0x00B138 */
+       u64     ce_ure_sram_rd_addr2;                   /* 0x00B140 */
+       u64     ce_ure_sram_wr_addr0;                   /* 0x00B148 */
+       u64     ce_ure_sram_wr_addr1;                   /* 0x00B150 */
+       u64     ce_ure_sram_wr_addr2;                   /* 0x00B158 */
+       u64     ce_ure_buf_flush10;                     /* 0x00B160 */
+       u64     ce_ure_buf_flush11;                     /* 0x00B168 */
+       u64     ce_ure_buf_flush12;                     /* 0x00B170 */
+       u64     ce_ure_buf_flush13;                     /* 0x00B178 */
+       u64     ce_ure_buf_flush20;                     /* 0x00B180 */
+       u64     ce_ure_buf_flush21;                     /* 0x00B188 */
+       u64     ce_ure_buf_flush22;                     /* 0x00B190 */
+       u64     ce_ure_buf_flush23;                     /* 0x00B198 */
+       u64     ce_ure_pcie_control1;                   /* 0x00B1A0 */
+       u64     ce_ure_pcie_control2;                   /* 0x00B1A8 */
+
+       u64     ce_pad_00B1B0[458];         /* 0x00B1B0 -- 0x00BFF8 */
+
+       /* Upstream Data Buffer, Port1 */
+       struct ce_ure_maint_ups_dat1_data {
+               u64     data63_0[512];      /* 0x00C000 -- 0x00CFF8 */
+               u64     data127_64[512];    /* 0x00D000 -- 0x00DFF8 */
+               u64     parity[512];        /* 0x00E000 -- 0x00EFF8 */
+       } ce_ure_maint_ups_dat1;
+
+       /* Upstream Header Buffer, Port1 */
+       struct ce_ure_maint_ups_hdr1_data {
+               u64     data63_0[512];      /* 0x00F000 -- 0x00FFF8 */
+               u64     data127_64[512];    /* 0x010000 -- 0x010FF8 */
+               u64     parity[512];        /* 0x011000 -- 0x011FF8 */
+       } ce_ure_maint_ups_hdr1;
+
+       /* Upstream Data Buffer, Port2 */
+       struct ce_ure_maint_ups_dat2_data {
+               u64     data63_0[512];      /* 0x012000 -- 0x012FF8 */
+               u64     data127_64[512];    /* 0x013000 -- 0x013FF8 */
+               u64     parity[512];        /* 0x014000 -- 0x014FF8 */
+       } ce_ure_maint_ups_dat2;
+
+       /* Upstream Header Buffer, Port2 */
+       struct ce_ure_maint_ups_hdr2_data {
+               u64     data63_0[512];      /* 0x015000 -- 0x015FF8 */
+               u64     data127_64[512];    /* 0x016000 -- 0x016FF8 */
+               u64     parity[512];        /* 0x017000 -- 0x017FF8 */
+       } ce_ure_maint_ups_hdr2;
+
+       /* Downstream Data Buffer */
+       struct ce_ure_maint_dns_dat_data {
+               u64     data63_0[512];      /* 0x018000 -- 0x018FF8 */
+               u64     data127_64[512];    /* 0x019000 -- 0x019FF8 */
+               u64     parity[512];        /* 0x01A000 -- 0x01AFF8 */
+       } ce_ure_maint_dns_dat;
+
+       /* Downstream Header Buffer */
+       struct  ce_ure_maint_dns_hdr_data {
+               u64     data31_0[64];       /* 0x01B000 -- 0x01B1F8 */
+               u64     data95_32[64];      /* 0x01B200 -- 0x01B3F8 */
+               u64     parity[64];         /* 0x01B400 -- 0x01B5F8 */
+       } ce_ure_maint_dns_hdr;
+
+       /* RCI Buffer Data */
+       struct  ce_ure_maint_rci_data {
+               u64     data41_0[64];       /* 0x01B600 -- 0x01B7F8 */
+               u64     data69_42[64];      /* 0x01B800 -- 0x01B9F8 */
+       } ce_ure_maint_rci;
+
+       /* Response Queue */
+       u64     ce_ure_maint_rspq[64];      /* 0x01BA00 -- 0x01BBF8 */
+
+       u64     ce_pad_01C000[4224];        /* 0x01BC00 -- 0x023FF8 */
+
+       /* Admin Build-a-Packet Buffer */
+       struct  ce_adm_maint_bap_buf_data {
+               u64     data63_0[258];      /* 0x024000 -- 0x024808 */
+               u64     data127_64[258];    /* 0x024810 -- 0x025018 */
+               u64     parity[258];        /* 0x025020 -- 0x025828 */
+       } ce_adm_maint_bap_buf;
+
+       u64     ce_pad_025830[5370];        /* 0x025830 -- 0x02FFF8 */
+
+       /* URE: 40bit PMU ATE Buffer */             /* 0x030000 -- 0x037FF8 */
+       u64     ce_ure_ate40[TIOCE_NUM_M40_ATES];
+
+       /* URE: 32/40bit PMU ATE Buffer */          /* 0x038000 -- 0x03BFF8 */
+       u64     ce_ure_ate3240[TIOCE_NUM_M3240_ATES];
+
+       u64     ce_pad_03C000[2050];        /* 0x03C000 -- 0x040008 */
+
+       /*
+        * DRE: Down Stream Request Engine
+         */
+       u64     ce_dre_dyn_credit_status1;              /* 0x040010 */
+       u64     ce_dre_dyn_credit_status2;              /* 0x040018 */
+       u64     ce_dre_last_credit_status1;             /* 0x040020 */
+       u64     ce_dre_last_credit_status2;             /* 0x040028 */
+       u64     ce_dre_credit_limit1;                   /* 0x040030 */
+       u64     ce_dre_credit_limit2;                   /* 0x040038 */
+       u64     ce_dre_force_credit1;                   /* 0x040040 */
+       u64     ce_dre_force_credit2;                   /* 0x040048 */
+       u64     ce_dre_debug_mux1;                      /* 0x040050 */
+       u64     ce_dre_debug_mux2;                      /* 0x040058 */
+       u64     ce_dre_ssp_err_cmd_wrd;                 /* 0x040060 */
+       u64     ce_dre_ssp_err_addr;                    /* 0x040068 */
+       u64     ce_dre_comp_err_cmd_wrd;                /* 0x040070 */
+       u64     ce_dre_comp_err_addr;                   /* 0x040078 */
+       u64     ce_dre_req_status;                      /* 0x040080 */
+       u64     ce_dre_config1;                         /* 0x040088 */
+       u64     ce_dre_config2;                         /* 0x040090 */
+       u64     ce_dre_config_req_status;               /* 0x040098 */
+       u64     ce_pad_0400A0[12];          /* 0x0400A0 -- 0x0400F8 */
+       u64     ce_dre_dyn_fifo;                        /* 0x040100 */
+       u64     ce_pad_040108[3];           /* 0x040108 -- 0x040118 */
+       u64     ce_dre_last_fifo;                       /* 0x040120 */
+
+       u64     ce_pad_040128[27];          /* 0x040128 -- 0x0401F8 */
+
+       /* DRE Downstream Head Queue */
+       struct  ce_dre_maint_ds_head_queue {
+               u64     data63_0[32];       /* 0x040200 -- 0x0402F8 */
+               u64     data127_64[32];     /* 0x040300 -- 0x0403F8 */
+               u64     parity[32];         /* 0x040400 -- 0x0404F8 */
+       } ce_dre_maint_ds_head_q;
+
+       u64     ce_pad_040500[352];         /* 0x040500 -- 0x040FF8 */
+
+       /* DRE Downstream Data Queue */
+       struct  ce_dre_maint_ds_data_queue {
+               u64     data63_0[256];      /* 0x041000 -- 0x0417F8 */
+               u64     ce_pad_041800[256]; /* 0x041800 -- 0x041FF8 */
+               u64     data127_64[256];    /* 0x042000 -- 0x0427F8 */
+               u64     ce_pad_042800[256]; /* 0x042800 -- 0x042FF8 */
+               u64     parity[256];        /* 0x043000 -- 0x0437F8 */
+               u64     ce_pad_043800[256]; /* 0x043800 -- 0x043FF8 */
+       } ce_dre_maint_ds_data_q;
+
+       /* DRE URE Upstream Response Queue */
+       struct  ce_dre_maint_ure_us_rsp_queue {
+               u64     data63_0[8];        /* 0x044000 -- 0x044038 */
+               u64     ce_pad_044040[24];  /* 0x044040 -- 0x0440F8 */
+               u64     data127_64[8];      /* 0x044100 -- 0x044138 */
+               u64     ce_pad_044140[24];  /* 0x044140 -- 0x0441F8 */
+               u64     parity[8];          /* 0x044200 -- 0x044238 */
+               u64     ce_pad_044240[24];  /* 0x044240 -- 0x0442F8 */
+       } ce_dre_maint_ure_us_rsp_q;
+
+       u64     ce_dre_maint_us_wrt_rsp[32];/* 0x044300 -- 0x0443F8 */
+
+       u64     ce_end_of_struct;                       /* 0x044400 */
+} tioce_t;
+
+/* ce_lsiX_gb_cfg1 register bit masks & shifts */
+#define CE_LSI_GB_CFG1_RXL0S_THS_SHFT  0
+#define CE_LSI_GB_CFG1_RXL0S_THS_MASK  (0xffULL << 0)
+#define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT  8
+#define CE_LSI_GB_CFG1_RXL0S_SMP_MASK  (0xfULL << 8);
+#define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT  12
+#define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK  (0x7ULL << 12)
+#define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT  15
+#define CE_LSI_GB_CFG1_RXL0S_FLT_MASK  (0x1ULL << 15)
+#define CE_LSI_GB_CFG1_LPBK_SEL_SHFT   16
+#define CE_LSI_GB_CFG1_LPBK_SEL_MASK   (0x3ULL << 16)
+#define CE_LSI_GB_CFG1_LPBK_EN_SHFT    18
+#define CE_LSI_GB_CFG1_LPBK_EN_MASK    (0x1ULL << 18)
+#define CE_LSI_GB_CFG1_RVRS_LB_SHFT    19
+#define CE_LSI_GB_CFG1_RVRS_LB_MASK    (0x1ULL << 19)
+#define CE_LSI_GB_CFG1_RVRS_CLK_SHFT   20
+#define CE_LSI_GB_CFG1_RVRS_CLK_MASK   (0x3ULL << 20)
+#define CE_LSI_GB_CFG1_SLF_TS_SHFT     24
+#define CE_LSI_GB_CFG1_SLF_TS_MASK     (0xfULL << 24)
+
+/* ce_adm_int_mask/ce_adm_int_status register bit defines */
+#define CE_ADM_INT_CE_ERROR_SHFT               0
+#define CE_ADM_INT_LSI1_IP_ERROR_SHFT          1
+#define CE_ADM_INT_LSI2_IP_ERROR_SHFT          2
+#define CE_ADM_INT_PCIE_ERROR_SHFT             3
+#define CE_ADM_INT_PORT1_HOTPLUG_EVENT_SHFT    4
+#define CE_ADM_INT_PORT2_HOTPLUG_EVENT_SHFT    5
+#define CE_ADM_INT_PCIE_PORT1_DEV_A_SHFT       6
+#define CE_ADM_INT_PCIE_PORT1_DEV_B_SHFT       7
+#define CE_ADM_INT_PCIE_PORT1_DEV_C_SHFT       8
+#define CE_ADM_INT_PCIE_PORT1_DEV_D_SHFT       9
+#define CE_ADM_INT_PCIE_PORT2_DEV_A_SHFT       10
+#define CE_ADM_INT_PCIE_PORT2_DEV_B_SHFT       11
+#define CE_ADM_INT_PCIE_PORT2_DEV_C_SHFT       12
+#define CE_ADM_INT_PCIE_PORT2_DEV_D_SHFT       13
+#define CE_ADM_INT_PCIE_MSG_SHFT               14 /*see int_dest_14*/
+#define CE_ADM_INT_PCIE_MSG_SLOT_0_SHFT                14
+#define CE_ADM_INT_PCIE_MSG_SLOT_1_SHFT                15
+#define CE_ADM_INT_PCIE_MSG_SLOT_2_SHFT                16
+#define CE_ADM_INT_PCIE_MSG_SLOT_3_SHFT                17
+#define CE_ADM_INT_PORT1_PM_PME_MSG_SHFT       22
+#define CE_ADM_INT_PORT2_PM_PME_MSG_SHFT       23
+
+/* ce_adm_force_int register bit defines */
+#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_A_SHFT 0
+#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_B_SHFT 1
+#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_C_SHFT 2
+#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_D_SHFT 3
+#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_A_SHFT 4
+#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_B_SHFT 5
+#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_C_SHFT 6
+#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_D_SHFT 7
+#define CE_ADM_FORCE_INT_ALWAYS_SHFT           8
+
+/* ce_adm_int_dest register bit masks & shifts */
+#define INTR_VECTOR_SHFT                       56
+
+/* ce_adm_error_mask and ce_adm_error_summary register bit masks */
+#define CE_ADM_ERR_CRM_SSP_REQ_INVALID                 (0x1ULL <<  0)
+#define CE_ADM_ERR_SSP_REQ_HEADER                      (0x1ULL <<  1)
+#define CE_ADM_ERR_SSP_RSP_HEADER                      (0x1ULL <<  2)
+#define CE_ADM_ERR_SSP_PROTOCOL_ERROR                  (0x1ULL <<  3)
+#define CE_ADM_ERR_SSP_SBE                             (0x1ULL <<  4)
+#define CE_ADM_ERR_SSP_MBE                             (0x1ULL <<  5)
+#define CE_ADM_ERR_CXM_CREDIT_OFLOW                    (0x1ULL <<  6)
+#define CE_ADM_ERR_DRE_SSP_REQ_INVAL                   (0x1ULL <<  7)
+#define CE_ADM_ERR_SSP_REQ_LONG                                (0x1ULL <<  8)
+#define CE_ADM_ERR_SSP_REQ_OFLOW                       (0x1ULL <<  9)
+#define CE_ADM_ERR_SSP_REQ_SHORT                       (0x1ULL << 10)
+#define CE_ADM_ERR_SSP_REQ_SIDEBAND                    (0x1ULL << 11)
+#define CE_ADM_ERR_SSP_REQ_ADDR_ERR                    (0x1ULL << 12)
+#define CE_ADM_ERR_SSP_REQ_BAD_BE                      (0x1ULL << 13)
+#define CE_ADM_ERR_PCIE_COMPL_TIMEOUT                  (0x1ULL << 14)
+#define CE_ADM_ERR_PCIE_UNEXP_COMPL                    (0x1ULL << 15)
+#define CE_ADM_ERR_PCIE_ERR_COMPL                      (0x1ULL << 16)
+#define CE_ADM_ERR_DRE_CREDIT_OFLOW                    (0x1ULL << 17)
+#define CE_ADM_ERR_DRE_SRAM_PE                         (0x1ULL << 18)
+#define CE_ADM_ERR_SSP_RSP_INVALID                     (0x1ULL << 19)
+#define CE_ADM_ERR_SSP_RSP_LONG                                (0x1ULL << 20)
+#define CE_ADM_ERR_SSP_RSP_SHORT                       (0x1ULL << 21)
+#define CE_ADM_ERR_SSP_RSP_SIDEBAND                    (0x1ULL << 22)
+#define CE_ADM_ERR_URE_SSP_RSP_UNEXP                   (0x1ULL << 23)
+#define CE_ADM_ERR_URE_SSP_WR_REQ_TIMEOUT              (0x1ULL << 24)
+#define CE_ADM_ERR_URE_SSP_RD_REQ_TIMEOUT              (0x1ULL << 25)
+#define CE_ADM_ERR_URE_ATE3240_PAGE_FAULT              (0x1ULL << 26)
+#define CE_ADM_ERR_URE_ATE40_PAGE_FAULT                        (0x1ULL << 27)
+#define CE_ADM_ERR_URE_CREDIT_OFLOW                    (0x1ULL << 28)
+#define CE_ADM_ERR_URE_SRAM_PE                         (0x1ULL << 29)
+#define CE_ADM_ERR_ADM_SSP_RSP_UNEXP                   (0x1ULL << 30)
+#define CE_ADM_ERR_ADM_SSP_REQ_TIMEOUT                 (0x1ULL << 31)
+#define CE_ADM_ERR_MMR_ACCESS_ERROR                    (0x1ULL << 32)
+#define CE_ADM_ERR_MMR_ADDR_ERROR                      (0x1ULL << 33)
+#define CE_ADM_ERR_ADM_CREDIT_OFLOW                    (0x1ULL << 34)
+#define CE_ADM_ERR_ADM_SRAM_PE                         (0x1ULL << 35)
+#define CE_ADM_ERR_DTL1_MIN_PDATA_CREDIT_ERR           (0x1ULL << 36)
+#define CE_ADM_ERR_DTL1_INF_COMPL_CRED_UPDT_ERR                (0x1ULL << 37)
+#define CE_ADM_ERR_DTL1_INF_POSTED_CRED_UPDT_ERR       (0x1ULL << 38)
+#define CE_ADM_ERR_DTL1_INF_NPOSTED_CRED_UPDT_ERR      (0x1ULL << 39)
+#define CE_ADM_ERR_DTL1_COMP_HD_CRED_MAX_ERR           (0x1ULL << 40)
+#define CE_ADM_ERR_DTL1_COMP_D_CRED_MAX_ERR            (0x1ULL << 41)
+#define CE_ADM_ERR_DTL1_NPOSTED_HD_CRED_MAX_ERR                (0x1ULL << 42)
+#define CE_ADM_ERR_DTL1_NPOSTED_D_CRED_MAX_ERR         (0x1ULL << 43)
+#define CE_ADM_ERR_DTL1_POSTED_HD_CRED_MAX_ERR         (0x1ULL << 44)
+#define CE_ADM_ERR_DTL1_POSTED_D_CRED_MAX_ERR          (0x1ULL << 45)
+#define CE_ADM_ERR_DTL2_MIN_PDATA_CREDIT_ERR           (0x1ULL << 46)
+#define CE_ADM_ERR_DTL2_INF_COMPL_CRED_UPDT_ERR                (0x1ULL << 47)
+#define CE_ADM_ERR_DTL2_INF_POSTED_CRED_UPDT_ERR       (0x1ULL << 48)
+#define CE_ADM_ERR_DTL2_INF_NPOSTED_CRED_UPDT_ERR      (0x1ULL << 49)
+#define CE_ADM_ERR_DTL2_COMP_HD_CRED_MAX_ERR           (0x1ULL << 50)
+#define CE_ADM_ERR_DTL2_COMP_D_CRED_MAX_ERR            (0x1ULL << 51)
+#define CE_ADM_ERR_DTL2_NPOSTED_HD_CRED_MAX_ERR                (0x1ULL << 52)
+#define CE_ADM_ERR_DTL2_NPOSTED_D_CRED_MAX_ERR         (0x1ULL << 53)
+#define CE_ADM_ERR_DTL2_POSTED_HD_CRED_MAX_ERR         (0x1ULL << 54)
+#define CE_ADM_ERR_DTL2_POSTED_D_CRED_MAX_ERR          (0x1ULL << 55)
+#define CE_ADM_ERR_PORT1_PCIE_COR_ERR                  (0x1ULL << 56)
+#define CE_ADM_ERR_PORT1_PCIE_NFAT_ERR                 (0x1ULL << 57)
+#define CE_ADM_ERR_PORT1_PCIE_FAT_ERR                  (0x1ULL << 58)
+#define CE_ADM_ERR_PORT2_PCIE_COR_ERR                  (0x1ULL << 59)
+#define CE_ADM_ERR_PORT2_PCIE_NFAT_ERR                 (0x1ULL << 60)
+#define CE_ADM_ERR_PORT2_PCIE_FAT_ERR                  (0x1ULL << 61)
+
+/* ce_adm_ure_ups_buf_barrier_flush register bit masks and shifts */
+#define FLUSH_SEL_PORT1_PIPE0_SHFT     0
+#define FLUSH_SEL_PORT1_PIPE1_SHFT     4
+#define FLUSH_SEL_PORT1_PIPE2_SHFT     8
+#define FLUSH_SEL_PORT1_PIPE3_SHFT     12
+#define FLUSH_SEL_PORT2_PIPE0_SHFT     16
+#define FLUSH_SEL_PORT2_PIPE1_SHFT     20
+#define FLUSH_SEL_PORT2_PIPE2_SHFT     24
+#define FLUSH_SEL_PORT2_PIPE3_SHFT     28
+
+/* ce_dre_config1 register bit masks and shifts */
+#define CE_DRE_RO_ENABLE               (0x1ULL << 0)
+#define CE_DRE_DYN_RO_ENABLE           (0x1ULL << 1)
+#define CE_DRE_SUP_CONFIG_COMP_ERROR   (0x1ULL << 2)
+#define CE_DRE_SUP_IO_COMP_ERROR       (0x1ULL << 3)
+#define CE_DRE_ADDR_MODE_SHFT          4
+
+/* ce_dre_config_req_status register bit masks */
+#define CE_DRE_LAST_CONFIG_COMPLETION  (0x7ULL << 0)
+#define CE_DRE_DOWNSTREAM_CONFIG_ERROR (0x1ULL << 3)
+#define CE_DRE_CONFIG_COMPLETION_VALID (0x1ULL << 4)
+#define CE_DRE_CONFIG_REQUEST_ACTIVE   (0x1ULL << 5)
+
+/* ce_ure_control register bit masks & shifts */
+#define CE_URE_RD_MRG_ENABLE           (0x1ULL << 0)
+#define CE_URE_WRT_MRG_ENABLE1         (0x1ULL << 4)
+#define CE_URE_WRT_MRG_ENABLE2         (0x1ULL << 5)
+#define CE_URE_WRT_MRG_TIMER_SHFT      12
+#define CE_URE_WRT_MRG_TIMER_MASK      (0x7FFULL << CE_URE_WRT_MRG_TIMER_SHFT)
+#define CE_URE_WRT_MRG_TIMER(x)                (((u64)(x) << \
+                                         CE_URE_WRT_MRG_TIMER_SHFT) & \
+                                        CE_URE_WRT_MRG_TIMER_MASK)
+#define CE_URE_RSPQ_BYPASS_DISABLE     (0x1ULL << 24)
+#define CE_URE_UPS_DAT1_PAR_DISABLE    (0x1ULL << 32)
+#define CE_URE_UPS_HDR1_PAR_DISABLE    (0x1ULL << 33)
+#define CE_URE_UPS_DAT2_PAR_DISABLE    (0x1ULL << 34)
+#define CE_URE_UPS_HDR2_PAR_DISABLE    (0x1ULL << 35)
+#define CE_URE_ATE_PAR_DISABLE         (0x1ULL << 36)
+#define CE_URE_RCI_PAR_DISABLE         (0x1ULL << 37)
+#define CE_URE_RSPQ_PAR_DISABLE                (0x1ULL << 38)
+#define CE_URE_DNS_DAT_PAR_DISABLE     (0x1ULL << 39)
+#define CE_URE_DNS_HDR_PAR_DISABLE     (0x1ULL << 40)
+#define CE_URE_MALFORM_DISABLE         (0x1ULL << 44)
+#define CE_URE_UNSUP_DISABLE           (0x1ULL << 45)
+
+/* ce_ure_page_map register bit masks & shifts */
+#define CE_URE_ATE3240_ENABLE          (0x1ULL << 0)
+#define CE_URE_ATE40_ENABLE            (0x1ULL << 1)
+#define CE_URE_PAGESIZE_SHFT           4
+#define CE_URE_PAGESIZE_MASK           (0x7ULL << CE_URE_PAGESIZE_SHFT)
+#define CE_URE_4K_PAGESIZE             (0x0ULL << CE_URE_PAGESIZE_SHFT)
+#define CE_URE_16K_PAGESIZE            (0x1ULL << CE_URE_PAGESIZE_SHFT)
+#define CE_URE_64K_PAGESIZE            (0x2ULL << CE_URE_PAGESIZE_SHFT)
+#define CE_URE_128K_PAGESIZE           (0x3ULL << CE_URE_PAGESIZE_SHFT)
+#define CE_URE_256K_PAGESIZE           (0x4ULL << CE_URE_PAGESIZE_SHFT)
+
+/* ce_ure_pipe_sel register bit masks & shifts */
+#define PKT_TRAFIC_SHRT                        16
+#define BUS_SRC_ID_SHFT                        8
+#define DEV_SRC_ID_SHFT                        3
+#define FNC_SRC_ID_SHFT                        0
+#define CE_URE_TC_MASK                 (0x07ULL << PKT_TRAFIC_SHRT)
+#define CE_URE_BUS_MASK                        (0xFFULL << BUS_SRC_ID_SHFT)
+#define CE_URE_DEV_MASK                        (0x1FULL << DEV_SRC_ID_SHFT)
+#define CE_URE_FNC_MASK                        (0x07ULL << FNC_SRC_ID_SHFT)
+#define CE_URE_PIPE_BUS(b)             (((u64)(b) << BUS_SRC_ID_SHFT) & \
+                                        CE_URE_BUS_MASK)
+#define CE_URE_PIPE_DEV(d)             (((u64)(d) << DEV_SRC_ID_SHFT) & \
+                                        CE_URE_DEV_MASK)
+#define CE_URE_PIPE_FNC(f)             (((u64)(f) << FNC_SRC_ID_SHFT) & \
+                                        CE_URE_FNC_MASK)
+
+#define CE_URE_SEL1_SHFT               0
+#define CE_URE_SEL2_SHFT               20
+#define CE_URE_SEL3_SHFT               40
+#define CE_URE_SEL1_MASK               (0x7FFFFULL << CE_URE_SEL1_SHFT)
+#define CE_URE_SEL2_MASK               (0x7FFFFULL << CE_URE_SEL2_SHFT)
+#define CE_URE_SEL3_MASK               (0x7FFFFULL << CE_URE_SEL3_SHFT)
+
+
+/* ce_ure_pipe_mask register bit masks & shifts */
+#define CE_URE_MASK1_SHFT              0
+#define CE_URE_MASK2_SHFT              20
+#define CE_URE_MASK3_SHFT              40
+#define CE_URE_MASK1_MASK              (0x7FFFFULL << CE_URE_MASK1_SHFT)
+#define CE_URE_MASK2_MASK              (0x7FFFFULL << CE_URE_MASK2_SHFT)
+#define CE_URE_MASK3_MASK              (0x7FFFFULL << CE_URE_MASK3_SHFT)
+
+
+/* ce_ure_pcie_control1 register bit masks & shifts */
+#define CE_URE_SI                      (0x1ULL << 0)
+#define CE_URE_ELAL_SHFT               4
+#define CE_URE_ELAL_MASK               (0x7ULL << CE_URE_ELAL_SHFT)
+#define CE_URE_ELAL_SET(n)             (((u64)(n) << CE_URE_ELAL_SHFT) & \
+                                        CE_URE_ELAL_MASK)
+#define CE_URE_ELAL1_SHFT              8
+#define CE_URE_ELAL1_MASK              (0x7ULL << CE_URE_ELAL1_SHFT)
+#define CE_URE_ELAL1_SET(n)            (((u64)(n) << CE_URE_ELAL1_SHFT) & \
+                                        CE_URE_ELAL1_MASK)
+#define CE_URE_SCC                     (0x1ULL << 12)
+#define CE_URE_PN1_SHFT                        16
+#define CE_URE_PN1_MASK                        (0xFFULL << CE_URE_PN1_SHFT)
+#define CE_URE_PN2_SHFT                        24
+#define CE_URE_PN2_MASK                        (0xFFULL << CE_URE_PN2_SHFT)
+#define CE_URE_PN1_SET(n)              (((u64)(n) << CE_URE_PN1_SHFT) & \
+                                        CE_URE_PN1_MASK)
+#define CE_URE_PN2_SET(n)              (((u64)(n) << CE_URE_PN2_SHFT) & \
+                                        CE_URE_PN2_MASK)
+
+/* ce_ure_pcie_control2 register bit masks & shifts */
+#define CE_URE_ABP                     (0x1ULL << 0)
+#define CE_URE_PCP                     (0x1ULL << 1)
+#define CE_URE_MSP                     (0x1ULL << 2)
+#define CE_URE_AIP                     (0x1ULL << 3)
+#define CE_URE_PIP                     (0x1ULL << 4)
+#define CE_URE_HPS                     (0x1ULL << 5)
+#define CE_URE_HPC                     (0x1ULL << 6)
+#define CE_URE_SPLV_SHFT               7
+#define CE_URE_SPLV_MASK               (0xFFULL << CE_URE_SPLV_SHFT)
+#define CE_URE_SPLV_SET(n)             (((u64)(n) << CE_URE_SPLV_SHFT) & \
+                                        CE_URE_SPLV_MASK)
+#define CE_URE_SPLS_SHFT               15
+#define CE_URE_SPLS_MASK               (0x3ULL << CE_URE_SPLS_SHFT)
+#define CE_URE_SPLS_SET(n)             (((u64)(n) << CE_URE_SPLS_SHFT) & \
+                                        CE_URE_SPLS_MASK)
+#define CE_URE_PSN1_SHFT               19
+#define CE_URE_PSN1_MASK               (0x1FFFULL << CE_URE_PSN1_SHFT)
+#define CE_URE_PSN2_SHFT               32
+#define CE_URE_PSN2_MASK               (0x1FFFULL << CE_URE_PSN2_SHFT)
+#define CE_URE_PSN1_SET(n)             (((u64)(n) << CE_URE_PSN1_SHFT) & \
+                                        CE_URE_PSN1_MASK)
+#define CE_URE_PSN2_SET(n)             (((u64)(n) << CE_URE_PSN2_SHFT) & \
+                                        CE_URE_PSN2_MASK)
+
+/*
+ * PIO address space ranges for CE
+ */
+
+/* Local CE Registers Space */
+#define CE_PIO_MMR                     0x00000000
+#define CE_PIO_MMR_LEN                 0x04000000
+
+/* PCI Compatible Config Space */
+#define CE_PIO_CONFIG_SPACE            0x04000000
+#define CE_PIO_CONFIG_SPACE_LEN                0x04000000
+
+/* PCI I/O Space Alias */
+#define CE_PIO_IO_SPACE_ALIAS          0x08000000
+#define CE_PIO_IO_SPACE_ALIAS_LEN      0x08000000
+
+/* PCI Enhanced Config Space */
+#define CE_PIO_E_CONFIG_SPACE          0x10000000
+#define CE_PIO_E_CONFIG_SPACE_LEN      0x10000000
+
+/* PCI I/O Space */
+#define CE_PIO_IO_SPACE                        0x100000000
+#define CE_PIO_IO_SPACE_LEN            0x100000000
+
+/* PCI MEM Space */
+#define CE_PIO_MEM_SPACE               0x200000000
+#define CE_PIO_MEM_SPACE_LEN           TIO_HWIN_SIZE
+
+
+/*
+ * CE PCI Enhanced Config Space shifts & masks
+ */
+#define CE_E_CONFIG_BUS_SHFT           20
+#define CE_E_CONFIG_BUS_MASK           (0xFF << CE_E_CONFIG_BUS_SHFT)
+#define CE_E_CONFIG_DEVICE_SHFT                15
+#define CE_E_CONFIG_DEVICE_MASK                (0x1F << CE_E_CONFIG_DEVICE_SHFT)
+#define CE_E_CONFIG_FUNC_SHFT          12
+#define CE_E_CONFIG_FUNC_MASK          (0x7  << CE_E_CONFIG_FUNC_SHFT)
+
+#endif /* __ASM_IA64_SN_TIOCE_H__ */
diff --git a/arch/ia64/include/asm/sn/tioce_provider.h b/arch/ia64/include/asm/sn/tioce_provider.h
new file mode 100644 (file)
index 0000000..32c32f3
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_CE_PROVIDER_H
+#define _ASM_IA64_SN_CE_PROVIDER_H
+
+#include <asm/sn/pcibus_provider_defs.h>
+#include <asm/sn/tioce.h>
+
+/*
+ * Common TIOCE structure shared between the prom and kernel
+ *
+ * DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES TO THE
+ * PROM VERSION.
+ */
+struct tioce_common {
+       struct pcibus_bussoft   ce_pcibus;      /* common pciio header */
+
+       u32             ce_rev;
+       u64             ce_kernel_private;
+       u64             ce_prom_private;
+};
+
+struct tioce_kernel {
+       struct tioce_common     *ce_common;
+       spinlock_t              ce_lock;
+       struct list_head        ce_dmamap_list;
+
+       u64             ce_ate40_shadow[TIOCE_NUM_M40_ATES];
+       u64             ce_ate3240_shadow[TIOCE_NUM_M3240_ATES];
+       u32             ce_ate3240_pagesize;
+
+       u8                      ce_port1_secondary;
+
+       /* per-port resources */
+       struct {
+               int             dirmap_refcnt;
+               u64     dirmap_shadow;
+       } ce_port[TIOCE_NUM_PORTS];
+};
+
+struct tioce_dmamap {
+       struct list_head        ce_dmamap_list; /* headed by tioce_kernel */
+       u32             refcnt;
+
+       u64             nbytes;         /* # bytes mapped */
+
+       u64             ct_start;       /* coretalk start address */
+       u64             pci_start;      /* bus start address */
+
+       u64             __iomem *ate_hw;/* hw ptr of first ate in map */
+       u64             *ate_shadow;    /* shadow ptr of firat ate */
+       u16             ate_count;      /* # ate's in the map */
+};
+
+extern int tioce_init_provider(void);
+
+#endif  /* __ASM_IA64_SN_CE_PROVIDER_H */
diff --git a/arch/ia64/include/asm/sn/tiocp.h b/arch/ia64/include/asm/sn/tiocp.h
new file mode 100644 (file)
index 0000000..e8ad0bb
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
+ */
+#ifndef _ASM_IA64_SN_PCI_TIOCP_H
+#define _ASM_IA64_SN_PCI_TIOCP_H
+
+#define TIOCP_HOST_INTR_ADDR            0x003FFFFFFFFFFFFFUL
+#define TIOCP_PCI64_CMDTYPE_MEM         (0x1ull << 60)
+#define TIOCP_PCI64_CMDTYPE_MSI         (0x3ull << 60)
+
+
+/*****************************************************************************
+ *********************** TIOCP MMR structure mapping ***************************
+ *****************************************************************************/
+
+struct tiocp{
+
+    /* 0x000000-0x00FFFF -- Local Registers */
+
+    /* 0x000000-0x000057 -- (Legacy Widget Space) Configuration */
+    u64                cp_id;                          /* 0x000000 */
+    u64                cp_stat;                        /* 0x000008 */
+    u64                cp_err_upper;                   /* 0x000010 */
+    u64                cp_err_lower;                   /* 0x000018 */
+    #define cp_err cp_err_lower
+    u64                cp_control;                     /* 0x000020 */
+    u64                cp_req_timeout;                 /* 0x000028 */
+    u64                cp_intr_upper;                  /* 0x000030 */
+    u64                cp_intr_lower;                  /* 0x000038 */
+    #define cp_intr cp_intr_lower
+    u64                cp_err_cmdword;                 /* 0x000040 */
+    u64                _pad_000048;                    /* 0x000048 */
+    u64                cp_tflush;                      /* 0x000050 */
+
+    /* 0x000058-0x00007F -- Bridge-specific Configuration */
+    u64                cp_aux_err;                     /* 0x000058 */
+    u64                cp_resp_upper;                  /* 0x000060 */
+    u64                cp_resp_lower;                  /* 0x000068 */
+    #define cp_resp cp_resp_lower
+    u64                cp_tst_pin_ctrl;                /* 0x000070 */
+    u64                cp_addr_lkerr;                  /* 0x000078 */
+
+    /* 0x000080-0x00008F -- PMU & MAP */
+    u64                cp_dir_map;                     /* 0x000080 */
+    u64                _pad_000088;                    /* 0x000088 */
+
+    /* 0x000090-0x00009F -- SSRAM */
+    u64                cp_map_fault;                   /* 0x000090 */
+    u64                _pad_000098;                    /* 0x000098 */
+
+    /* 0x0000A0-0x0000AF -- Arbitration */
+    u64                cp_arb;                         /* 0x0000A0 */
+    u64                _pad_0000A8;                    /* 0x0000A8 */
+
+    /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
+    u64                cp_ate_parity_err;              /* 0x0000B0 */
+    u64                _pad_0000B8;                    /* 0x0000B8 */
+
+    /* 0x0000C0-0x0000FF -- PCI/GIO */
+    u64                cp_bus_timeout;                 /* 0x0000C0 */
+    u64                cp_pci_cfg;                     /* 0x0000C8 */
+    u64                cp_pci_err_upper;               /* 0x0000D0 */
+    u64                cp_pci_err_lower;               /* 0x0000D8 */
+    #define cp_pci_err cp_pci_err_lower
+    u64                _pad_0000E0[4];                 /* 0x0000{E0..F8} */
+
+    /* 0x000100-0x0001FF -- Interrupt */
+    u64                cp_int_status;                  /* 0x000100 */
+    u64                cp_int_enable;                  /* 0x000108 */
+    u64                cp_int_rst_stat;                /* 0x000110 */
+    u64                cp_int_mode;                    /* 0x000118 */
+    u64                cp_int_device;                  /* 0x000120 */
+    u64                cp_int_host_err;                /* 0x000128 */
+    u64                cp_int_addr[8];                 /* 0x0001{30,,,68} */
+    u64                cp_err_int_view;                /* 0x000170 */
+    u64                cp_mult_int;                    /* 0x000178 */
+    u64                cp_force_always[8];             /* 0x0001{80,,,B8} */
+    u64                cp_force_pin[8];                /* 0x0001{C0,,,F8} */
+
+    /* 0x000200-0x000298 -- Device */
+    u64                cp_device[4];                   /* 0x0002{00,,,18} */
+    u64                _pad_000220[4];                 /* 0x0002{20,,,38} */
+    u64                cp_wr_req_buf[4];               /* 0x0002{40,,,58} */
+    u64                _pad_000260[4];                 /* 0x0002{60,,,78} */
+    u64                cp_rrb_map[2];                  /* 0x0002{80,,,88} */
+    #define cp_even_resp cp_rrb_map[0]                 /* 0x000280 */
+    #define cp_odd_resp  cp_rrb_map[1]                 /* 0x000288 */
+    u64                cp_resp_status;                 /* 0x000290 */
+    u64                cp_resp_clear;                  /* 0x000298 */
+
+    u64                _pad_0002A0[12];                /* 0x0002{A0..F8} */
+
+    /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
+    struct {
+       u64     upper;                          /* 0x0003{00,,,F0} */
+       u64     lower;                          /* 0x0003{08,,,F8} */
+    } cp_buf_addr_match[16];
+
+    /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
+    struct {
+       u64     flush_w_touch;                  /* 0x000{400,,,5C0} */
+       u64     flush_wo_touch;                 /* 0x000{408,,,5C8} */
+       u64     inflight;                       /* 0x000{410,,,5D0} */
+       u64     prefetch;                       /* 0x000{418,,,5D8} */
+       u64     total_pci_retry;                /* 0x000{420,,,5E0} */
+       u64     max_pci_retry;                  /* 0x000{428,,,5E8} */
+       u64     max_latency;                    /* 0x000{430,,,5F0} */
+       u64     clear_all;                      /* 0x000{438,,,5F8} */
+    } cp_buf_count[8];
+
+
+    /* 0x000600-0x0009FF -- PCI/X registers */
+    u64                cp_pcix_bus_err_addr;           /* 0x000600 */
+    u64                cp_pcix_bus_err_attr;           /* 0x000608 */
+    u64                cp_pcix_bus_err_data;           /* 0x000610 */
+    u64                cp_pcix_pio_split_addr;         /* 0x000618 */
+    u64                cp_pcix_pio_split_attr;         /* 0x000620 */
+    u64                cp_pcix_dma_req_err_attr;       /* 0x000628 */
+    u64                cp_pcix_dma_req_err_addr;       /* 0x000630 */
+    u64                cp_pcix_timeout;                /* 0x000638 */
+
+    u64                _pad_000640[24];                /* 0x000{640,,,6F8} */
+
+    /* 0x000700-0x000737 -- Debug Registers */
+    u64                cp_ct_debug_ctl;                /* 0x000700 */
+    u64                cp_br_debug_ctl;                /* 0x000708 */
+    u64                cp_mux3_debug_ctl;              /* 0x000710 */
+    u64                cp_mux4_debug_ctl;              /* 0x000718 */
+    u64                cp_mux5_debug_ctl;              /* 0x000720 */
+    u64                cp_mux6_debug_ctl;              /* 0x000728 */
+    u64                cp_mux7_debug_ctl;              /* 0x000730 */
+
+    u64                _pad_000738[89];                /* 0x000{738,,,9F8} */
+
+    /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
+    struct {
+       u64     cp_buf_addr;                    /* 0x000{A00,,,AF0} */
+       u64     cp_buf_attr;                    /* 0X000{A08,,,AF8} */
+    } cp_pcix_read_buf_64[16];
+
+    struct {
+       u64     cp_buf_addr;                    /* 0x000{B00,,,BE0} */
+       u64     cp_buf_attr;                    /* 0x000{B08,,,BE8} */
+       u64     cp_buf_valid;                   /* 0x000{B10,,,BF0} */
+       u64     __pad1;                         /* 0x000{B18,,,BF8} */
+    } cp_pcix_write_buf_64[8];
+
+    /* End of Local Registers -- Start of Address Map space */
+
+    char       _pad_000c00[0x010000 - 0x000c00];
+
+    /* 0x010000-0x011FF8 -- Internal ATE RAM (Auto Parity Generation) */
+    u64                cp_int_ate_ram[1024];           /* 0x010000-0x011FF8 */
+
+    char       _pad_012000[0x14000 - 0x012000];
+
+    /* 0x014000-0x015FF8 -- Internal ATE RAM (Manual Parity Generation) */
+    u64                cp_int_ate_ram_mp[1024];        /* 0x014000-0x015FF8 */
+
+    char       _pad_016000[0x18000 - 0x016000];
+
+    /* 0x18000-0x197F8 -- TIOCP Write Request Ram */
+    u64                cp_wr_req_lower[256];           /* 0x18000 - 0x187F8 */
+    u64                cp_wr_req_upper[256];           /* 0x18800 - 0x18FF8 */
+    u64                cp_wr_req_parity[256];          /* 0x19000 - 0x197F8 */
+
+    char       _pad_019800[0x1C000 - 0x019800];
+
+    /* 0x1C000-0x1EFF8 -- TIOCP Read Response Ram */
+    u64                cp_rd_resp_lower[512];          /* 0x1C000 - 0x1CFF8 */
+    u64                cp_rd_resp_upper[512];          /* 0x1D000 - 0x1DFF8 */
+    u64                cp_rd_resp_parity[512];         /* 0x1E000 - 0x1EFF8 */
+
+    char       _pad_01F000[0x20000 - 0x01F000];
+
+    /* 0x020000-0x021FFF -- Host Device (CP) Configuration Space (not used)  */
+    char       _pad_020000[0x021000 - 0x20000];
+
+    /* 0x021000-0x027FFF -- PCI Device Configuration Spaces */
+    union {
+       u8      c[0x1000 / 1];                  /* 0x02{0000,,,7FFF} */
+       u16     s[0x1000 / 2];                  /* 0x02{0000,,,7FFF} */
+       u32     l[0x1000 / 4];                  /* 0x02{0000,,,7FFF} */
+       u64     d[0x1000 / 8];                  /* 0x02{0000,,,7FFF} */
+       union {
+           u8  c[0x100 / 1];
+           u16 s[0x100 / 2];
+           u32 l[0x100 / 4];
+           u64 d[0x100 / 8];
+       } f[8];
+    } cp_type0_cfg_dev[7];                             /* 0x02{1000,,,7FFF} */
+
+    /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
+    union {
+       u8      c[0x1000 / 1];                  /* 0x028000-0x029000 */
+       u16     s[0x1000 / 2];                  /* 0x028000-0x029000 */
+       u32     l[0x1000 / 4];                  /* 0x028000-0x029000 */
+       u64     d[0x1000 / 8];                  /* 0x028000-0x029000 */
+       union {
+           u8  c[0x100 / 1];
+           u16 s[0x100 / 2];
+           u32 l[0x100 / 4];
+           u64 d[0x100 / 8];
+       } f[8];
+    } cp_type1_cfg;                                    /* 0x028000-0x029000 */
+
+    char               _pad_029000[0x030000-0x029000];
+
+    /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
+    union {
+       u8      c[8 / 1];
+       u16     s[8 / 2];
+       u32     l[8 / 4];
+       u64     d[8 / 8];
+    } cp_pci_iack;                                     /* 0x030000-0x030007 */
+
+    char               _pad_030007[0x040000-0x030008];
+
+    /* 0x040000-0x040007 -- PCIX Special Cycle */
+    union {
+       u8      c[8 / 1];
+       u16     s[8 / 2];
+       u32     l[8 / 4];
+       u64     d[8 / 8];
+    } cp_pcix_cycle;                                   /* 0x040000-0x040007 */
+
+    char               _pad_040007[0x200000-0x040008];
+
+    /* 0x200000-0x7FFFFF -- PCI/GIO Device Spaces */
+    union {
+       u8      c[0x100000 / 1];
+       u16     s[0x100000 / 2];
+       u32     l[0x100000 / 4];
+       u64     d[0x100000 / 8];
+    } cp_devio_raw[6];                                 /* 0x200000-0x7FFFFF */
+
+    #define cp_devio(n)  cp_devio_raw[((n)<2)?(n*2):(n+2)]
+
+    char               _pad_800000[0xA00000-0x800000];
+
+    /* 0xA00000-0xBFFFFF -- PCI/GIO Device Spaces w/flush  */
+    union {
+       u8      c[0x100000 / 1];
+       u16     s[0x100000 / 2];
+       u32     l[0x100000 / 4];
+       u64     d[0x100000 / 8];
+    } cp_devio_raw_flush[6];                           /* 0xA00000-0xBFFFFF */
+
+    #define cp_devio_flush(n)  cp_devio_raw_flush[((n)<2)?(n*2):(n+2)]
+
+};
+
+#endif         /* _ASM_IA64_SN_PCI_TIOCP_H */
diff --git a/arch/ia64/include/asm/sn/tiocx.h b/arch/ia64/include/asm/sn/tiocx.h
new file mode 100644 (file)
index 0000000..d297284
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * 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) 2005 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef _ASM_IA64_SN_TIO_TIOCX_H
+#define _ASM_IA64_SN_TIO_TIOCX_H
+
+#ifdef __KERNEL__
+
+struct cx_id_s {
+       unsigned int part_num;
+       unsigned int mfg_num;
+       int nasid;
+};
+
+struct cx_dev {
+       struct cx_id_s cx_id;
+       int bt;                         /* board/blade type */
+       void *soft;                     /* driver specific */
+       struct hubdev_info *hubdev;
+       struct device dev;
+       struct cx_drv *driver;
+};
+
+struct cx_device_id {
+       unsigned int part_num;
+       unsigned int mfg_num;
+};
+
+struct cx_drv {
+       char *name;
+       const struct cx_device_id *id_table;
+       struct device_driver driver;
+       int (*probe) (struct cx_dev * dev, const struct cx_device_id * id);
+       int (*remove) (struct cx_dev * dev);
+};
+
+/* create DMA address by stripping AS bits */
+#define TIOCX_DMA_ADDR(a) (u64)((u64)(a) & 0xffffcfffffffffUL)
+
+#define TIOCX_TO_TIOCX_DMA_ADDR(a) (u64)(((u64)(a) & 0xfffffffff) |  \
+                                  ((((u64)(a)) & 0xffffc000000000UL) <<2))
+
+#define TIO_CE_ASIC_PARTNUM 0xce00
+#define TIOCX_CORELET 3
+
+/* These are taken from tio_mmr_as.h */
+#define TIO_ICE_FRZ_CFG               TIO_MMR_ADDR_MOD(0x00000000b0008100UL)
+#define TIO_ICE_PMI_TX_CFG            TIO_MMR_ADDR_MOD(0x00000000b000b100UL)
+#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3 TIO_MMR_ADDR_MOD(0x00000000b000be18UL)
+#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK 0x000000000000000fUL
+
+#define to_cx_dev(n) container_of(n, struct cx_dev, dev)
+#define to_cx_driver(drv) container_of(drv, struct cx_drv, driver)
+
+extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int);
+extern void tiocx_irq_free(struct sn_irq_info *);
+extern int cx_device_unregister(struct cx_dev *);
+extern int cx_device_register(nasid_t, int, int, struct hubdev_info *, int);
+extern int cx_driver_unregister(struct cx_drv *);
+extern int cx_driver_register(struct cx_drv *);
+extern u64 tiocx_dma_addr(u64 addr);
+extern u64 tiocx_swin_base(int nasid);
+extern void tiocx_mmr_store(int nasid, u64 offset, u64 value);
+extern u64 tiocx_mmr_load(int nasid, u64 offset);
+
+#endif                         //  __KERNEL__
+#endif                         // _ASM_IA64_SN_TIO_TIOCX__
diff --git a/arch/ia64/include/asm/sn/types.h b/arch/ia64/include/asm/sn/types.h
new file mode 100644 (file)
index 0000000..8e04ee2
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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) 1999,2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (C) 1999 by Ralf Baechle
+ */
+#ifndef _ASM_IA64_SN_TYPES_H
+#define _ASM_IA64_SN_TYPES_H
+
+#include <linux/types.h>
+
+typedef unsigned long  cpuid_t;
+typedef signed short   nasid_t;        /* node id in numa-as-id space */
+typedef signed char    partid_t;       /* partition ID type */
+typedef unsigned int    moduleid_t;     /* user-visible module number type */
+typedef unsigned int    cmoduleid_t;    /* kernel compact module id type */
+typedef unsigned char  slotid_t;       /* slot (blade) within module */
+typedef unsigned char  slabid_t;       /* slab (asic) within slot */
+typedef u64 nic_t;
+typedef unsigned long iopaddr_t;
+typedef unsigned long paddr_t;
+typedef short cnodeid_t;
+
+#endif /* _ASM_IA64_SN_TYPES_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
new file mode 100644 (file)
index 0000000..d5ef0aa
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _ASM_IA64_SOCKET_H
+#define _ASM_IA64_SOCKET_H
+
+/*
+ * Socket related defines.
+ *
+ * Based on <asm-i386/socket.h>.
+ *
+ * Modified 1998-2000
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+#define SOL_SOCKET     1
+
+#define SO_DEBUG       1
+#define SO_REUSEADDR   2
+#define SO_TYPE                3
+#define SO_ERROR       4
+#define SO_DONTROUTE   5
+#define SO_BROADCAST   6
+#define SO_SNDBUF      7
+#define SO_RCVBUF      8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE   9
+#define SO_OOBINLINE   10
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_LINGER      13
+#define SO_BSDCOMPAT   14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED    16
+#define SO_PEERCRED    17
+#define SO_RCVLOWAT    18
+#define SO_SNDLOWAT    19
+#define SO_RCVTIMEO    20
+#define SO_SNDTIMEO    21
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
+#define SO_SECURITY_ENCRYPTION_NETWORK         24
+
+#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_ACCEPTCONN          30
+
+#define SO_PEERSEC             31
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+#define SO_MARK                        36
+
+#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/ia64/include/asm/sockios.h b/arch/ia64/include/asm/sockios.h
new file mode 100644 (file)
index 0000000..15c9246
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ASM_IA64_SOCKIOS_H
+#define _ASM_IA64_SOCKIOS_H
+
+/*
+ * Socket-level I/O control calls.
+ *
+ * Based on <asm-i386/sockios.h>.
+ *
+ * Modified 1998, 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+#define FIOSETOWN      0x8901
+#define SIOCSPGRP      0x8902
+#define FIOGETOWN      0x8903
+#define SIOCGPGRP      0x8904
+#define SIOCATMARK     0x8905
+#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
+
+#endif /* _ASM_IA64_SOCKIOS_H */
diff --git a/arch/ia64/include/asm/sparsemem.h b/arch/ia64/include/asm/sparsemem.h
new file mode 100644 (file)
index 0000000..67a7c40
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ASM_IA64_SPARSEMEM_H
+#define _ASM_IA64_SPARSEMEM_H
+
+#ifdef CONFIG_SPARSEMEM
+/*
+ * SECTION_SIZE_BITS            2^N: how big each section will be
+ * MAX_PHYSMEM_BITS             2^N: how much memory we can have in that space
+ */
+
+#define SECTION_SIZE_BITS      (30)
+#define MAX_PHYSMEM_BITS       (50)
+#ifdef CONFIG_FORCE_MAX_ZONEORDER
+#if ((CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS)
+#undef SECTION_SIZE_BITS
+#define SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT)
+#endif
+#endif
+
+#endif /* CONFIG_SPARSEMEM */
+#endif /* _ASM_IA64_SPARSEMEM_H */
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
new file mode 100644 (file)
index 0000000..0229fb9
--- /dev/null
@@ -0,0 +1,220 @@
+#ifndef _ASM_IA64_SPINLOCK_H
+#define _ASM_IA64_SPINLOCK_H
+
+/*
+ * Copyright (C) 1998-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ *
+ * This file is used for SMP configurations only.
+ */
+
+#include <linux/compiler.h>
+#include <linux/kernel.h>
+#include <linux/bitops.h>
+
+#include <asm/atomic.h>
+#include <asm/intrinsics.h>
+#include <asm/system.h>
+
+#define __raw_spin_lock_init(x)                        ((x)->lock = 0)
+
+#ifdef ASM_SUPPORTED
+/*
+ * Try to get the lock.  If we fail to get the lock, make a non-standard call to
+ * ia64_spinlock_contention().  We do not use a normal call because that would force all
+ * callers of __raw_spin_lock() to be non-leaf routines.  Instead, ia64_spinlock_contention() is
+ * carefully coded to touch only those registers that __raw_spin_lock() marks "clobbered".
+ */
+
+#define IA64_SPINLOCK_CLOBBERS "ar.ccv", "ar.pfs", "p14", "p15", "r27", "r28", "r29", "r30", "b6", "memory"
+
+static inline void
+__raw_spin_lock_flags (raw_spinlock_t *lock, unsigned long flags)
+{
+       register volatile unsigned int *ptr asm ("r31") = &lock->lock;
+
+#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
+# ifdef CONFIG_ITANIUM
+       /* don't use brl on Itanium... */
+       asm volatile ("{\n\t"
+                     "  mov ar.ccv = r0\n\t"
+                     "  mov r28 = ip\n\t"
+                     "  mov r30 = 1;;\n\t"
+                     "}\n\t"
+                     "cmpxchg4.acq r30 = [%1], r30, ar.ccv\n\t"
+                     "movl r29 = ia64_spinlock_contention_pre3_4;;\n\t"
+                     "cmp4.ne p14, p0 = r30, r0\n\t"
+                     "mov b6 = r29;;\n\t"
+                     "mov r27=%2\n\t"
+                     "(p14) br.cond.spnt.many b6"
+                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
+# else
+       asm volatile ("{\n\t"
+                     "  mov ar.ccv = r0\n\t"
+                     "  mov r28 = ip\n\t"
+                     "  mov r30 = 1;;\n\t"
+                     "}\n\t"
+                     "cmpxchg4.acq r30 = [%1], r30, ar.ccv;;\n\t"
+                     "cmp4.ne p14, p0 = r30, r0\n\t"
+                     "mov r27=%2\n\t"
+                     "(p14) brl.cond.spnt.many ia64_spinlock_contention_pre3_4;;"
+                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
+# endif /* CONFIG_MCKINLEY */
+#else
+# ifdef CONFIG_ITANIUM
+       /* don't use brl on Itanium... */
+       /* mis-declare, so we get the entry-point, not it's function descriptor: */
+       asm volatile ("mov r30 = 1\n\t"
+                     "mov r27=%2\n\t"
+                     "mov ar.ccv = r0;;\n\t"
+                     "cmpxchg4.acq r30 = [%0], r30, ar.ccv\n\t"
+                     "movl r29 = ia64_spinlock_contention;;\n\t"
+                     "cmp4.ne p14, p0 = r30, r0\n\t"
+                     "mov b6 = r29;;\n\t"
+                     "(p14) br.call.spnt.many b6 = b6"
+                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
+# else
+       asm volatile ("mov r30 = 1\n\t"
+                     "mov r27=%2\n\t"
+                     "mov ar.ccv = r0;;\n\t"
+                     "cmpxchg4.acq r30 = [%0], r30, ar.ccv;;\n\t"
+                     "cmp4.ne p14, p0 = r30, r0\n\t"
+                     "(p14) brl.call.spnt.many b6=ia64_spinlock_contention;;"
+                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
+# endif /* CONFIG_MCKINLEY */
+#endif
+}
+
+#define __raw_spin_lock(lock) __raw_spin_lock_flags(lock, 0)
+
+/* Unlock by doing an ordered store and releasing the cacheline with nta */
+static inline void __raw_spin_unlock(raw_spinlock_t *x) {
+       barrier();
+       asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(x));
+}
+
+#else /* !ASM_SUPPORTED */
+#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
+# define __raw_spin_lock(x)                                                            \
+do {                                                                                   \
+       __u32 *ia64_spinlock_ptr = (__u32 *) (x);                                       \
+       __u64 ia64_spinlock_val;                                                        \
+       ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0);                 \
+       if (unlikely(ia64_spinlock_val)) {                                              \
+               do {                                                                    \
+                       while (*ia64_spinlock_ptr)                                      \
+                               ia64_barrier();                                         \
+                       ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0); \
+               } while (ia64_spinlock_val);                                            \
+       }                                                                               \
+} while (0)
+#define __raw_spin_unlock(x)   do { barrier(); ((raw_spinlock_t *) x)->lock = 0; } while (0)
+#endif /* !ASM_SUPPORTED */
+
+#define __raw_spin_is_locked(x)                ((x)->lock != 0)
+#define __raw_spin_trylock(x)          (cmpxchg_acq(&(x)->lock, 0, 1) == 0)
+#define __raw_spin_unlock_wait(lock) \
+       do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
+
+#define __raw_read_can_lock(rw)                (*(volatile int *)(rw) >= 0)
+#define __raw_write_can_lock(rw)       (*(volatile int *)(rw) == 0)
+
+#define __raw_read_lock(rw)                                                            \
+do {                                                                                   \
+       raw_rwlock_t *__read_lock_ptr = (rw);                                           \
+                                                                                       \
+       while (unlikely(ia64_fetchadd(1, (int *) __read_lock_ptr, acq) < 0)) {          \
+               ia64_fetchadd(-1, (int *) __read_lock_ptr, rel);                        \
+               while (*(volatile int *)__read_lock_ptr < 0)                            \
+                       cpu_relax();                                                    \
+       }                                                                               \
+} while (0)
+
+#define __raw_read_unlock(rw)                                  \
+do {                                                           \
+       raw_rwlock_t *__read_lock_ptr = (rw);                   \
+       ia64_fetchadd(-1, (int *) __read_lock_ptr, rel);        \
+} while (0)
+
+#ifdef ASM_SUPPORTED
+#define __raw_write_lock(rw)                                                   \
+do {                                                                           \
+       __asm__ __volatile__ (                                                  \
+               "mov ar.ccv = r0\n"                                             \
+               "dep r29 = -1, r0, 31, 1;;\n"                                   \
+               "1:\n"                                                          \
+               "ld4 r2 = [%0];;\n"                                             \
+               "cmp4.eq p0,p7 = r0,r2\n"                                       \
+               "(p7) br.cond.spnt.few 1b \n"                                   \
+               "cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n"                       \
+               "cmp4.eq p0,p7 = r0, r2\n"                                      \
+               "(p7) br.cond.spnt.few 1b;;\n"                                  \
+               :: "r"(rw) : "ar.ccv", "p7", "r2", "r29", "memory");            \
+} while(0)
+
+#define __raw_write_trylock(rw)                                                        \
+({                                                                             \
+       register long result;                                                   \
+                                                                               \
+       __asm__ __volatile__ (                                                  \
+               "mov ar.ccv = r0\n"                                             \
+               "dep r29 = -1, r0, 31, 1;;\n"                                   \
+               "cmpxchg4.acq %0 = [%1], r29, ar.ccv\n"                         \
+               : "=r"(result) : "r"(rw) : "ar.ccv", "r29", "memory");          \
+       (result == 0);                                                          \
+})
+
+static inline void __raw_write_unlock(raw_rwlock_t *x)
+{
+       u8 *y = (u8 *)x;
+       barrier();
+       asm volatile ("st1.rel.nta [%0] = r0\n\t" :: "r"(y+3) : "memory" );
+}
+
+#else /* !ASM_SUPPORTED */
+
+#define __raw_write_lock(l)                                                            \
+({                                                                                     \
+       __u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1);                       \
+       __u32 *ia64_write_lock_ptr = (__u32 *) (l);                                     \
+       do {                                                                            \
+               while (*ia64_write_lock_ptr)                                            \
+                       ia64_barrier();                                                 \
+               ia64_val = ia64_cmpxchg4_acq(ia64_write_lock_ptr, ia64_set_val, 0);     \
+       } while (ia64_val);                                                             \
+})
+
+#define __raw_write_trylock(rw)                                                \
+({                                                                     \
+       __u64 ia64_val;                                                 \
+       __u64 ia64_set_val = ia64_dep_mi(-1, 0, 31,1);                  \
+       ia64_val = ia64_cmpxchg4_acq((__u32 *)(rw), ia64_set_val, 0);   \
+       (ia64_val == 0);                                                \
+})
+
+static inline void __raw_write_unlock(raw_rwlock_t *x)
+{
+       barrier();
+       x->write_lock = 0;
+}
+
+#endif /* !ASM_SUPPORTED */
+
+static inline int __raw_read_trylock(raw_rwlock_t *x)
+{
+       union {
+               raw_rwlock_t lock;
+               __u32 word;
+       } old, new;
+       old.lock = new.lock = *x;
+       old.lock.write_lock = new.lock.write_lock = 0;
+       ++new.lock.read_counter;
+       return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
+}
+
+#define _raw_spin_relax(lock)  cpu_relax()
+#define _raw_read_relax(lock)  cpu_relax()
+#define _raw_write_relax(lock) cpu_relax()
+
+#endif /*  _ASM_IA64_SPINLOCK_H */
diff --git a/arch/ia64/include/asm/spinlock_types.h b/arch/ia64/include/asm/spinlock_types.h
new file mode 100644 (file)
index 0000000..474e46f
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _ASM_IA64_SPINLOCK_TYPES_H
+#define _ASM_IA64_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 read_counter      : 31;
+       volatile unsigned int write_lock        :  1;
+} raw_rwlock_t;
+
+#define __RAW_RW_LOCK_UNLOCKED         { 0, 0 }
+
+#endif
diff --git a/arch/ia64/include/asm/stat.h b/arch/ia64/include/asm/stat.h
new file mode 100644 (file)
index 0000000..367bb90
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef _ASM_IA64_STAT_H
+#define _ASM_IA64_STAT_H
+
+/*
+ * Modified 1998, 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+struct stat {
+       unsigned long   st_dev;
+       unsigned long   st_ino;
+       unsigned long   st_nlink;
+       unsigned int    st_mode;
+       unsigned int    st_uid;
+       unsigned int    st_gid;
+       unsigned int    __pad0;
+       unsigned long   st_rdev;
+       unsigned long   st_size;
+       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;
+       unsigned long   st_blksize;
+       long            st_blocks;
+       unsigned long   __unused[3];
+};
+
+#define STAT_HAVE_NSEC 1
+
+struct ia64_oldstat {
+       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;
+       unsigned int    __pad1;
+       unsigned long   st_size;
+       unsigned long   st_atime;
+       unsigned long   st_mtime;
+       unsigned long   st_ctime;
+       unsigned int    st_blksize;
+       int             st_blocks;
+       unsigned int    __unused1;
+       unsigned int    __unused2;
+};
+
+#endif /* _ASM_IA64_STAT_H */
diff --git a/arch/ia64/include/asm/statfs.h b/arch/ia64/include/asm/statfs.h
new file mode 100644 (file)
index 0000000..8110979
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _ASM_IA64_STATFS_H
+#define _ASM_IA64_STATFS_H
+
+/*
+ * Based on <asm-i386/statfs.h>.
+ *
+ * Modified 1998, 1999, 2003
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#ifndef __KERNEL_STRICT_NAMES
+# include <linux/types.h>
+typedef __kernel_fsid_t        fsid_t;
+#endif
+
+/*
+ * This is ugly --- we're already 64-bit, so just duplicate the definitions
+ */
+struct statfs {
+       long f_type;
+       long f_bsize;
+       long f_blocks;
+       long f_bfree;
+       long f_bavail;
+       long f_files;
+       long f_ffree;
+       __kernel_fsid_t f_fsid;
+       long f_namelen;
+       long f_frsize;
+       long f_spare[5];
+};
+
+
+struct statfs64 {
+       long f_type;
+       long f_bsize;
+       long f_blocks;
+       long f_bfree;
+       long f_bavail;
+       long f_files;
+       long f_ffree;
+       __kernel_fsid_t f_fsid;
+       long f_namelen;
+       long f_frsize;
+       long f_spare[5];
+};
+
+struct compat_statfs64 {
+       __u32 f_type;
+       __u32 f_bsize;
+       __u64 f_blocks;
+       __u64 f_bfree;
+       __u64 f_bavail;
+       __u64 f_files;
+       __u64 f_ffree;
+       __kernel_fsid_t f_fsid;
+       __u32 f_namelen;
+       __u32 f_frsize;
+       __u32 f_spare[5];
+} __attribute__((packed));
+
+#endif /* _ASM_IA64_STATFS_H */
diff --git a/arch/ia64/include/asm/string.h b/arch/ia64/include/asm/string.h
new file mode 100644 (file)
index 0000000..85fd65c
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _ASM_IA64_STRING_H
+#define _ASM_IA64_STRING_H
+
+/*
+ * Here is where we want to put optimized versions of the string
+ * routines.
+ *
+ * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#define __HAVE_ARCH_STRLEN     1 /* see arch/ia64/lib/strlen.S */
+#define __HAVE_ARCH_MEMSET     1 /* see arch/ia64/lib/memset.S */
+#define __HAVE_ARCH_MEMCPY     1 /* see arch/ia64/lib/memcpy.S */
+
+extern __kernel_size_t strlen (const char *);
+extern void *memcpy (void *, const void *, __kernel_size_t);
+extern void *memset (void *, int, __kernel_size_t);
+
+#endif /* _ASM_IA64_STRING_H */
diff --git a/arch/ia64/include/asm/suspend.h b/arch/ia64/include/asm/suspend.h
new file mode 100644 (file)
index 0000000..b05bbb6
--- /dev/null
@@ -0,0 +1 @@
+/* dummy (must be non-empty to prevent prejudicial removal...) */
diff --git a/arch/ia64/include/asm/system.h b/arch/ia64/include/asm/system.h
new file mode 100644 (file)
index 0000000..927a381
--- /dev/null
@@ -0,0 +1,292 @@
+#ifndef _ASM_IA64_SYSTEM_H
+#define _ASM_IA64_SYSTEM_H
+
+/*
+ * System defines. Note that this is included both from .c and .S
+ * files, so it does only defines, not any C code.  This is based
+ * on information published in the Processor Abstraction Layer
+ * and the System Abstraction Layer manual.
+ *
+ * Copyright (C) 1998-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
+ */
+
+#include <asm/kregs.h>
+#include <asm/page.h>
+#include <asm/pal.h>
+#include <asm/percpu.h>
+
+#define GATE_ADDR              RGN_BASE(RGN_GATE)
+
+/*
+ * 0xa000000000000000+2*PERCPU_PAGE_SIZE
+ * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
+ */
+#define KERNEL_START            (GATE_ADDR+__IA64_UL_CONST(0x100000000))
+#define PERCPU_ADDR            (-PERCPU_PAGE_SIZE)
+#define LOAD_OFFSET            (KERNEL_START - KERNEL_TR_PAGE_SIZE)
+
+#ifndef __ASSEMBLY__
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
+
+struct pci_vector_struct {
+       __u16 segment;  /* PCI Segment number */
+       __u16 bus;      /* PCI Bus number */
+       __u32 pci_id;   /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */
+       __u8 pin;       /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */
+       __u32 irq;      /* IRQ assigned */
+};
+
+extern struct ia64_boot_param {
+       __u64 command_line;             /* physical address of command line arguments */
+       __u64 efi_systab;               /* physical address of EFI system table */
+       __u64 efi_memmap;               /* physical address of EFI memory map */
+       __u64 efi_memmap_size;          /* size of EFI memory map */
+       __u64 efi_memdesc_size;         /* size of an EFI memory map descriptor */
+       __u32 efi_memdesc_version;      /* memory descriptor version */
+       struct {
+               __u16 num_cols; /* number of columns on console output device */
+               __u16 num_rows; /* number of rows on console output device */
+               __u16 orig_x;   /* cursor's x position */
+               __u16 orig_y;   /* cursor's y position */
+       } console_info;
+       __u64 fpswa;            /* physical address of the fpswa interface */
+       __u64 initrd_start;
+       __u64 initrd_size;
+} *ia64_boot_param;
+
+/*
+ * Macros to force memory ordering.  In these descriptions, "previous"
+ * and "subsequent" refer to program order; "visible" means that all
+ * architecturally visible effects of a memory access have occurred
+ * (at a minimum, this means the memory has been read or written).
+ *
+ *   wmb():    Guarantees that all preceding stores to memory-
+ *             like regions are visible before any subsequent
+ *             stores and that all following stores will be
+ *             visible only after all previous stores.
+ *   rmb():    Like wmb(), but for reads.
+ *   mb():     wmb()/rmb() combo, i.e., all previous memory
+ *             accesses are visible before all subsequent
+ *             accesses and vice versa.  This is also known as
+ *             a "fence."
+ *
+ * Note: "mb()" and its variants cannot be used as a fence to order
+ * accesses to memory mapped I/O registers.  For that, mf.a needs to
+ * be used.  However, we don't want to always use mf.a because (a)
+ * it's (presumably) much slower than mf and (b) mf.a is supported for
+ * sequential memory pages only.
+ */
+#define mb()   ia64_mf()
+#define rmb()  mb()
+#define wmb()  mb()
+#define read_barrier_depends() do { } while(0)
+
+#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
+
+/*
+ * XXX check on this ---I suspect what Linus really wants here is
+ * acquire vs release semantics but we can't discuss this stuff with
+ * Linus just yet.  Grrr...
+ */
+#define set_mb(var, value)     do { (var) = (value); mb(); } while (0)
+
+#define safe_halt()         ia64_pal_halt_light()    /* PAL_HALT_LIGHT */
+
+/*
+ * The group barrier in front of the rsm & ssm are necessary to ensure
+ * that none of the previous instructions in the same group are
+ * affected by the rsm/ssm.
+ */
+/* For spinlocks etc */
+
+/*
+ * - clearing psr.i is implicitly serialized (visible by next insn)
+ * - setting psr.i requires data serialization
+ * - we need a stop-bit before reading PSR because we sometimes
+ *   write a floating-point register right before reading the PSR
+ *   and that writes to PSR.mfl
+ */
+#ifdef CONFIG_PARAVIRT
+#define __local_save_flags()   ia64_get_psr_i()
+#else
+#define __local_save_flags()   ia64_getreg(_IA64_REG_PSR)
+#endif
+
+#define __local_irq_save(x)                    \
+do {                                           \
+       ia64_stop();                            \
+       (x) = __local_save_flags();             \
+       ia64_stop();                            \
+       ia64_rsm(IA64_PSR_I);                   \
+} while (0)
+
+#define __local_irq_disable()                  \
+do {                                           \
+       ia64_stop();                            \
+       ia64_rsm(IA64_PSR_I);                   \
+} while (0)
+
+#define __local_irq_restore(x) ia64_intrin_local_irq_restore((x) & IA64_PSR_I)
+
+#ifdef CONFIG_IA64_DEBUG_IRQ
+
+  extern unsigned long last_cli_ip;
+
+# define __save_ip()           last_cli_ip = ia64_getreg(_IA64_REG_IP)
+
+# define local_irq_save(x)                                     \
+do {                                                           \
+       unsigned long __psr;                                    \
+                                                               \
+       __local_irq_save(__psr);                                \
+       if (__psr & IA64_PSR_I)                                 \
+               __save_ip();                                    \
+       (x) = __psr;                                            \
+} while (0)
+
+# define local_irq_disable()   do { unsigned long __x; local_irq_save(__x); } while (0)
+
+# define local_irq_restore(x)                                  \
+do {                                                           \
+       unsigned long __old_psr, __psr = (x);                   \
+                                                               \
+       local_save_flags(__old_psr);                            \
+       __local_irq_restore(__psr);                             \
+       if ((__old_psr & IA64_PSR_I) && !(__psr & IA64_PSR_I))  \
+               __save_ip();                                    \
+} while (0)
+
+#else /* !CONFIG_IA64_DEBUG_IRQ */
+# define local_irq_save(x)     __local_irq_save(x)
+# define local_irq_disable()   __local_irq_disable()
+# define local_irq_restore(x)  __local_irq_restore(x)
+#endif /* !CONFIG_IA64_DEBUG_IRQ */
+
+#define local_irq_enable()     ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
+#define local_save_flags(flags)        ({ ia64_stop(); (flags) = __local_save_flags(); })
+
+#define irqs_disabled()                                \
+({                                             \
+       unsigned long __ia64_id_flags;          \
+       local_save_flags(__ia64_id_flags);      \
+       (__ia64_id_flags & IA64_PSR_I) == 0;    \
+})
+
+#ifdef __KERNEL__
+
+#ifdef CONFIG_IA32_SUPPORT
+# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0)
+#else
+# define IS_IA32_PROCESS(regs)         0
+struct task_struct;
+static inline void ia32_save_state(struct task_struct *t __attribute__((unused))){}
+static inline void ia32_load_state(struct task_struct *t __attribute__((unused))){}
+#endif
+
+/*
+ * Context switch from one thread to another.  If the two threads have
+ * different address spaces, schedule() has already taken care of
+ * switching to the new address space by calling switch_mm().
+ *
+ * Disabling access to the fph partition and the debug-register
+ * context switch MUST be done before calling ia64_switch_to() since a
+ * newly created thread returns directly to
+ * ia64_ret_from_syscall_clear_r8.
+ */
+extern struct task_struct *ia64_switch_to (void *next_task);
+
+struct task_struct;
+
+extern void ia64_save_extra (struct task_struct *task);
+extern void ia64_load_extra (struct task_struct *task);
+
+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
+extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next);
+# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n)
+#else
+# define IA64_ACCOUNT_ON_SWITCH(p,n)
+#endif
+
+#ifdef CONFIG_PERFMON
+  DECLARE_PER_CPU(unsigned long, pfm_syst_info);
+# define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1)
+#else
+# define PERFMON_IS_SYSWIDE() (0)
+#endif
+
+#define IA64_HAS_EXTRA_STATE(t)                                                        \
+       ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)       \
+        || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE())
+
+#define __switch_to(prev,next,last) do {                                                        \
+       IA64_ACCOUNT_ON_SWITCH(prev, next);                                                      \
+       if (IA64_HAS_EXTRA_STATE(prev))                                                          \
+               ia64_save_extra(prev);                                                           \
+       if (IA64_HAS_EXTRA_STATE(next))                                                          \
+               ia64_load_extra(next);                                                           \
+       ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next);                      \
+       (last) = ia64_switch_to((next));                                                         \
+} while (0)
+
+#ifdef CONFIG_SMP
+/*
+ * In the SMP case, we save the fph state when context-switching away from a thread that
+ * modified fph.  This way, when the thread gets scheduled on another CPU, the CPU can
+ * pick up the state from task->thread.fph, avoiding the complication of having to fetch
+ * the latest fph state from another CPU.  In other words: eager save, lazy restore.
+ */
+# define switch_to(prev,next,last) do {                                                \
+       if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) {                               \
+               ia64_psr(task_pt_regs(prev))->mfh = 0;                  \
+               (prev)->thread.flags |= IA64_THREAD_FPH_VALID;                  \
+               __ia64_save_fpu((prev)->thread.fph);                            \
+       }                                                                       \
+       __switch_to(prev, next, last);                                          \
+       /* "next" in old context is "current" in new context */                 \
+       if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) &&        \
+                    (task_cpu(current) !=                                     \
+                                     task_thread_info(current)->last_cpu))) { \
+               platform_migrate(current);                                     \
+               task_thread_info(current)->last_cpu = task_cpu(current);       \
+       }                                                                      \
+} while (0)
+#else
+# define switch_to(prev,next,last)     __switch_to(prev, next, last)
+#endif
+
+#define __ARCH_WANT_UNLOCKED_CTXSW
+#define ARCH_HAS_PREFETCH_SWITCH_STACK
+#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
+
+void cpu_idle_wait(void);
+
+#define arch_align_stack(x) (x)
+
+void default_idle(void);
+
+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
+extern void account_system_vtime(struct task_struct *);
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_IA64_SYSTEM_H */
diff --git a/arch/ia64/include/asm/termbits.h b/arch/ia64/include/asm/termbits.h
new file mode 100644 (file)
index 0000000..9f162e0
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _ASM_IA64_TERMBITS_H
+#define _ASM_IA64_TERMBITS_H
+
+/*
+ * Based on <asm-i386/termbits.h>.
+ *
+ * Modified 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ *
+ * 99/01/28    Added new baudrates
+ */
+
+#include <linux/posix_types.h>
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+};
+
+struct termios2 {
+       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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* 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 IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0000400
+#define   NL0  0000000
+#define   NL1  0000400
+#define CRDLY  0003000
+#define   CR0  0000000
+#define   CR1  0001000
+#define   CR2  0002000
+#define   CR3  0003000
+#define TABDLY 0014000
+#define   TAB0 0000000
+#define   TAB1 0004000
+#define   TAB2 0010000
+#define   TAB3 0014000
+#define   XTABS        0014000
+#define BSDLY  0020000
+#define   BS0  0000000
+#define   BS1  0020000
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+#define FFDLY  0100000
+#define   FF0  0000000
+#define   FF1  0100000
+
+/* c_cflag bit meaning */
+#define CBAUD  0010017
+#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 CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define    BOTHER 0010000
+#define    B57600 0010001
+#define   B115200 0010002
+#define   B230400 0010003
+#define   B460800 0010004
+#define   B500000 0010005
+#define   B576000 0010006
+#define   B921600 0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define CIBAUD   002003600000          /* input baud rate */
+#define CMSPAR   010000000000          /* mark or space (stick) parity */
+#define CRTSCTS          020000000000          /* flow control */
+
+#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
+
+/* c_lflag bits */
+#define ISIG   0000001
+#define ICANON 0000002
+#define XCASE  0000004
+#define ECHO   0000010
+#define ECHOE  0000020
+#define ECHOK  0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL        0001000
+#define ECHOPRT        0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif /* _ASM_IA64_TERMBITS_H */
diff --git a/arch/ia64/include/asm/termios.h b/arch/ia64/include/asm/termios.h
new file mode 100644 (file)
index 0000000..689d218
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef _ASM_IA64_TERMIOS_H
+#define _ASM_IA64_TERMIOS_H
+
+/*
+ * Modified 1999
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ *
+ * 99/01/28    Added N_IRDA and N_SMSBLOCK
+ */
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+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 */
+};
+
+/* modem lines */
+#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
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+# ifdef __KERNEL__
+
+/*     intr=^C         quit=^\         erase=del       kill=^U
+       eof=^D          vtime=\0        vmin=\1         sxtc=\0
+       start=^Q        stop=^S         susp=^Z         eol=\0
+       reprint=^R      discard=^U      werase=^W       lnext=^V
+       eol2=\0
+*/
+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
+
+/*
+ * Translate a "termio" structure into a "termios". Ugh.
+ */
+#define SET_LOW_TERMIOS_BITS(termios, termio, x) {     \
+       unsigned short __tmp;                           \
+       get_user(__tmp,&(termio)->x);                   \
+       *(unsigned short *) &(termios)->x = __tmp;      \
+}
+
+#define user_termio_to_kernel_termios(termios, termio)         \
+({                                                             \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag);         \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag);         \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag);         \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag);         \
+       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC);   \
+})
+
+/*
+ * Translate a "termios" structure into a "termio". Ugh.
+ */
+#define kernel_termios_to_user_termio(termio, termios)         \
+({                                                             \
+       put_user((termios)->c_iflag, &(termio)->c_iflag);       \
+       put_user((termios)->c_oflag, &(termio)->c_oflag);       \
+       put_user((termios)->c_cflag, &(termio)->c_cflag);       \
+       put_user((termios)->c_lflag, &(termio)->c_lflag);       \
+       put_user((termios)->c_line,  &(termio)->c_line);        \
+       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC);     \
+})
+
+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
+#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
+
+# endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_TERMIOS_H */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..7c60fcd
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+#ifndef _ASM_IA64_THREAD_INFO_H
+#define _ASM_IA64_THREAD_INFO_H
+
+#ifndef ASM_OFFSETS_C
+#include <asm/asm-offsets.h>
+#endif
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+
+#define PREEMPT_ACTIVE_BIT 30
+#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
+
+#ifndef __ASSEMBLY__
+
+/*
+ * On IA-64, we want to keep the task structure and kernel stack together, so they can be
+ * mapped by a single TLB entry and so they can be addressed by the "current" pointer
+ * without having to do pointer masking.
+ */
+struct thread_info {
+       struct task_struct *task;       /* XXX not really needed, except for dup_task_struct() */
+       struct exec_domain *exec_domain;/* execution domain */
+       __u32 flags;                    /* thread_info flags (see TIF_*) */
+       __u32 cpu;                      /* current CPU */
+       __u32 last_cpu;                 /* Last CPU thread ran on */
+       __u32 status;                   /* Thread synchronous flags */
+       mm_segment_t addr_limit;        /* user-level address space limit */
+       int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
+       struct restart_block restart_block;
+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
+       __u64 ac_stamp;
+       __u64 ac_leave;
+       __u64 ac_stime;
+       __u64 ac_utime;
+#endif
+};
+
+#define THREAD_SIZE                    KERNEL_STACK_SIZE
+
+#define INIT_THREAD_INFO(tsk)                  \
+{                                              \
+       .task           = &tsk,                 \
+       .exec_domain    = &default_exec_domain, \
+       .flags          = 0,                    \
+       .cpu            = 0,                    \
+       .addr_limit     = KERNEL_DS,            \
+       .preempt_count  = 0,                    \
+       .restart_block = {                      \
+               .fn = do_no_restart_syscall,    \
+       },                                      \
+}
+
+#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
+
+#ifndef ASM_OFFSETS_C
+/* how to get the thread information struct from C */
+#define current_thread_info()  ((struct thread_info *) ((char *) current + IA64_TASK_SIZE))
+#define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
+#define task_thread_info(tsk)  ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
+#else
+#define current_thread_info()  ((struct thread_info *) 0)
+#define alloc_thread_info(tsk) ((struct thread_info *) 0)
+#define task_thread_info(tsk)  ((struct thread_info *) 0)
+#endif
+#define free_thread_info(ti)   /* nothing */
+#define task_stack_page(tsk)   ((void *)(tsk))
+
+#define __HAVE_THREAD_FUNCTIONS
+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
+#define setup_thread_stack(p, org)                     \
+       *task_thread_info(p) = *task_thread_info(org);  \
+       task_thread_info(p)->ac_stime = 0;              \
+       task_thread_info(p)->ac_utime = 0;              \
+       task_thread_info(p)->task = (p);
+#else
+#define setup_thread_stack(p, org) \
+       *task_thread_info(p) = *task_thread_info(org); \
+       task_thread_info(p)->task = (p);
+#endif
+#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)
+
+#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
+#define alloc_task_struct()    ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
+#define free_task_struct(tsk)  free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
+
+#define tsk_set_notify_resume(tsk) \
+       set_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME)
+extern void tsk_clear_notify_resume(struct task_struct *tsk);
+#endif /* !__ASSEMBLY */
+
+/*
+ * thread information flags
+ * - these are process state flags that various assembly files may need to access
+ * - pending work-to-be-done flags are in least-significant 16 bits, other flags
+ *   in top 16 bits
+ */
+#define TIF_SIGPENDING         0       /* signal pending */
+#define TIF_NEED_RESCHED       1       /* rescheduling necessary */
+#define TIF_SYSCALL_TRACE      2       /* syscall trace active */
+#define TIF_SYSCALL_AUDIT      3       /* syscall auditing active */
+#define TIF_SINGLESTEP         4       /* restore singlestep on return to user mode */
+#define TIF_NOTIFY_RESUME      6       /* resumption notification requested */
+#define TIF_POLLING_NRFLAG     16      /* true if poll_idle() is polling TIF_NEED_RESCHED */
+#define TIF_MEMDIE             17
+#define TIF_MCA_INIT           18      /* this task is processing MCA or INIT */
+#define TIF_DB_DISABLED                19      /* debug trap disabled for fsyscall */
+#define TIF_FREEZE             20      /* is freezing for suspend */
+#define TIF_RESTORE_RSE                21      /* user RBS is newer than kernel RBS */
+
+#define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
+#define _TIF_SYSCALL_AUDIT     (1 << TIF_SYSCALL_AUDIT)
+#define _TIF_SINGLESTEP                (1 << TIF_SINGLESTEP)
+#define _TIF_SYSCALL_TRACEAUDIT        (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
+#define _TIF_NOTIFY_RESUME     (1 << TIF_NOTIFY_RESUME)
+#define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
+#define _TIF_POLLING_NRFLAG    (1 << TIF_POLLING_NRFLAG)
+#define _TIF_MCA_INIT          (1 << TIF_MCA_INIT)
+#define _TIF_DB_DISABLED       (1 << TIF_DB_DISABLED)
+#define _TIF_FREEZE            (1 << TIF_FREEZE)
+#define _TIF_RESTORE_RSE       (1 << TIF_RESTORE_RSE)
+
+/* "work to do on user-return" bits */
+#define TIF_ALLWORK_MASK       (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
+                                _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
+/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
+#define TIF_WORK_MASK          (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
+
+#define TS_POLLING             1       /* true if in idle loop and not sleeping */
+#define TS_RESTORE_SIGMASK     2       /* restore signal mask in do_signal() */
+
+#define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING)
+
+#ifndef __ASSEMBLY__
+#define HAVE_SET_RESTORE_SIGMASK       1
+static inline void set_restore_sigmask(void)
+{
+       struct thread_info *ti = current_thread_info();
+       ti->status |= TS_RESTORE_SIGMASK;
+       set_bit(TIF_SIGPENDING, &ti->flags);
+}
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_THREAD_INFO_H */
diff --git a/arch/ia64/include/asm/timex.h b/arch/ia64/include/asm/timex.h
new file mode 100644 (file)
index 0000000..05a6baf
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASM_IA64_TIMEX_H
+#define _ASM_IA64_TIMEX_H
+
+/*
+ * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+/*
+ * 2001/01/18 davidm   Removed CLOCK_TICK_RATE.  It makes no sense on IA-64.
+ *                     Also removed cacheflush_time as it's entirely unused.
+ */
+
+#include <asm/intrinsics.h>
+#include <asm/processor.h>
+
+typedef unsigned long cycles_t;
+
+extern void (*ia64_udelay)(unsigned long usecs);
+
+/*
+ * For performance reasons, we don't want to define CLOCK_TICK_TRATE as
+ * local_cpu_data->itc_rate.  Fortunately, we don't have to, either: according to George
+ * Anzinger, 1/CLOCK_TICK_RATE is taken as the resolution of the timer clock.  The time
+ * calculation assumes that you will use enough of these so that your tick size <= 1/HZ.
+ * If the calculation shows that your CLOCK_TICK_RATE can not supply exactly 1/HZ ticks,
+ * the actual value is calculated and used to update the wall clock each jiffie.  Setting
+ * the CLOCK_TICK_RATE to x*HZ insures that the calculation will find no errors.  Hence we
+ * pick a multiple of HZ which gives us a (totally virtual) CLOCK_TICK_RATE of about
+ * 100MHz.
+ */
+#define CLOCK_TICK_RATE                (HZ * 100000UL)
+
+static inline cycles_t
+get_cycles (void)
+{
+       cycles_t ret;
+
+       ret = ia64_getreg(_IA64_REG_AR_ITC);
+       return ret;
+}
+
+#endif /* _ASM_IA64_TIMEX_H */
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..20d8a39
--- /dev/null
@@ -0,0 +1,257 @@
+#ifndef _ASM_IA64_TLB_H
+#define _ASM_IA64_TLB_H
+/*
+ * Based on <asm-generic/tlb.h>.
+ *
+ * Copyright (C) 2002-2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+/*
+ * Removing a translation from a page table (including TLB-shootdown) is a four-step
+ * procedure:
+ *
+ *     (1) Flush (virtual) caches --- ensures virtual memory is coherent with kernel memory
+ *         (this is a no-op on ia64).
+ *     (2) Clear the relevant portions of the page-table
+ *     (3) Flush the TLBs --- ensures that stale content is gone from CPU TLBs
+ *     (4) Release the pages that were freed up in step (2).
+ *
+ * Note that the ordering of these steps is crucial to avoid races on MP machines.
+ *
+ * The Linux kernel defines several platform-specific hooks for TLB-shootdown.  When
+ * unmapping a portion of the virtual address space, these hooks are called according to
+ * the following template:
+ *
+ *     tlb <- tlb_gather_mmu(mm, full_mm_flush);       // start unmap for address space MM
+ *     {
+ *       for each vma that needs a shootdown do {
+ *         tlb_start_vma(tlb, vma);
+ *           for each page-table-entry PTE that needs to be removed do {
+ *             tlb_remove_tlb_entry(tlb, pte, address);
+ *             if (pte refers to a normal page) {
+ *               tlb_remove_page(tlb, page);
+ *             }
+ *           }
+ *         tlb_end_vma(tlb, vma);
+ *       }
+ *     }
+ *     tlb_finish_mmu(tlb, start, end);        // finish unmap for address space MM
+ */
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+#include <linux/swap.h>
+
+#include <asm/pgalloc.h>
+#include <asm/processor.h>
+#include <asm/tlbflush.h>
+#include <asm/machvec.h>
+
+#ifdef CONFIG_SMP
+# define FREE_PTE_NR           2048
+# define tlb_fast_mode(tlb)    ((tlb)->nr == ~0U)
+#else
+# define FREE_PTE_NR           0
+# define tlb_fast_mode(tlb)    (1)
+#endif
+
+struct mmu_gather {
+       struct mm_struct        *mm;
+       unsigned int            nr;             /* == ~0U => fast mode */
+       unsigned char           fullmm;         /* non-zero means full mm flush */
+       unsigned char           need_flush;     /* really unmapped some PTEs? */
+       unsigned long           start_addr;
+       unsigned long           end_addr;
+       struct page             *pages[FREE_PTE_NR];
+};
+
+struct ia64_tr_entry {
+       u64 ifa;
+       u64 itir;
+       u64 pte;
+       u64 rr;
+}; /*Record for tr entry!*/
+
+extern int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size);
+extern void ia64_ptr_entry(u64 target_mask, int slot);
+
+extern struct ia64_tr_entry __per_cpu_idtrs[NR_CPUS][2][IA64_TR_ALLOC_MAX];
+
+/*
+ region register macros
+*/
+#define RR_TO_VE(val)   (((val) >> 0) & 0x0000000000000001)
+#define RR_VE(val)     (((val) & 0x0000000000000001) << 0)
+#define RR_VE_MASK     0x0000000000000001L
+#define RR_VE_SHIFT    0
+#define RR_TO_PS(val)  (((val) >> 2) & 0x000000000000003f)
+#define RR_PS(val)     (((val) & 0x000000000000003f) << 2)
+#define RR_PS_MASK     0x00000000000000fcL
+#define RR_PS_SHIFT    2
+#define RR_RID_MASK    0x00000000ffffff00L
+#define RR_TO_RID(val)         ((val >> 8) & 0xffffff)
+
+/* Users of the generic TLB shootdown code must declare this storage space. */
+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
+
+/*
+ * Flush the TLB for address range START to END and, if not in fast mode, release the
+ * freed pages that where gathered up to this point.
+ */
+static inline void
+ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
+{
+       unsigned int nr;
+
+       if (!tlb->need_flush)
+               return;
+       tlb->need_flush = 0;
+
+       if (tlb->fullmm) {
+               /*
+                * Tearing down the entire address space.  This happens both as a result
+                * of exit() and execve().  The latter case necessitates the call to
+                * flush_tlb_mm() here.
+                */
+               flush_tlb_mm(tlb->mm);
+       } else if (unlikely (end - start >= 1024*1024*1024*1024UL
+                            || REGION_NUMBER(start) != REGION_NUMBER(end - 1)))
+       {
+               /*
+                * If we flush more than a tera-byte or across regions, we're probably
+                * better off just flushing the entire TLB(s).  This should be very rare
+                * and is not worth optimizing for.
+                */
+               flush_tlb_all();
+       } else {
+               /*
+                * XXX fix me: flush_tlb_range() should take an mm pointer instead of a
+                * vma pointer.
+                */
+               struct vm_area_struct vma;
+
+               vma.vm_mm = tlb->mm;
+               /* flush the address range from the tlb: */
+               flush_tlb_range(&vma, start, end);
+               /* now flush the virt. page-table area mapping the address range: */
+               flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end));
+       }
+
+       /* lastly, release the freed pages */
+       nr = tlb->nr;
+       if (!tlb_fast_mode(tlb)) {
+               unsigned long i;
+               tlb->nr = 0;
+               tlb->start_addr = ~0UL;
+               for (i = 0; i < nr; ++i)
+                       free_page_and_swap_cache(tlb->pages[i]);
+       }
+}
+
+/*
+ * Return a pointer to an initialized struct mmu_gather.
+ */
+static inline struct mmu_gather *
+tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush)
+{
+       struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
+
+       tlb->mm = mm;
+       /*
+        * Use fast mode if only 1 CPU is online.
+        *
+        * It would be tempting to turn on fast-mode for full_mm_flush as well.  But this
+        * doesn't work because of speculative accesses and software prefetching: the page
+        * table of "mm" may (and usually is) the currently active page table and even
+        * though the kernel won't do any user-space accesses during the TLB shoot down, a
+        * compiler might use speculation or lfetch.fault on what happens to be a valid
+        * user-space address.  This in turn could trigger a TLB miss fault (or a VHPT
+        * walk) and re-insert a TLB entry we just removed.  Slow mode avoids such
+        * problems.  (We could make fast-mode work by switching the current task to a
+        * different "mm" during the shootdown.) --davidm 08/02/2002
+        */
+       tlb->nr = (num_online_cpus() == 1) ? ~0U : 0;
+       tlb->fullmm = full_mm_flush;
+       tlb->start_addr = ~0UL;
+       return tlb;
+}
+
+/*
+ * Called at the end of the shootdown operation to free up any resources that were
+ * collected.
+ */
+static inline void
+tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
+{
+       /*
+        * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and
+        * tlb->end_addr.
+        */
+       ia64_tlb_flush_mmu(tlb, start, end);
+
+       /* keep the page table cache within bounds */
+       check_pgt_cache();
+
+       put_cpu_var(mmu_gathers);
+}
+
+/*
+ * Logically, this routine frees PAGE.  On MP machines, the actual freeing of the page
+ * must be delayed until after the TLB has been flushed (see comments at the beginning of
+ * this file).
+ */
+static inline void
+tlb_remove_page (struct mmu_gather *tlb, struct page *page)
+{
+       tlb->need_flush = 1;
+
+       if (tlb_fast_mode(tlb)) {
+               free_page_and_swap_cache(page);
+               return;
+       }
+       tlb->pages[tlb->nr++] = page;
+       if (tlb->nr >= FREE_PTE_NR)
+               ia64_tlb_flush_mmu(tlb, tlb->start_addr, tlb->end_addr);
+}
+
+/*
+ * Remove TLB entry for PTE mapped at virtual address ADDRESS.  This is called for any
+ * PTE, not just those pointing to (normal) physical memory.
+ */
+static inline void
+__tlb_remove_tlb_entry (struct mmu_gather *tlb, pte_t *ptep, unsigned long address)
+{
+       if (tlb->start_addr == ~0UL)
+               tlb->start_addr = address;
+       tlb->end_addr = address + PAGE_SIZE;
+}
+
+#define tlb_migrate_finish(mm) platform_tlb_migrate_finish(mm)
+
+#define tlb_start_vma(tlb, vma)                        do { } while (0)
+#define tlb_end_vma(tlb, vma)                  do { } while (0)
+
+#define tlb_remove_tlb_entry(tlb, ptep, addr)          \
+do {                                                   \
+       tlb->need_flush = 1;                            \
+       __tlb_remove_tlb_entry(tlb, ptep, addr);        \
+} while (0)
+
+#define pte_free_tlb(tlb, ptep)                                \
+do {                                                   \
+       tlb->need_flush = 1;                            \
+       __pte_free_tlb(tlb, ptep);                      \
+} while (0)
+
+#define pmd_free_tlb(tlb, ptep)                                \
+do {                                                   \
+       tlb->need_flush = 1;                            \
+       __pmd_free_tlb(tlb, ptep);                      \
+} while (0)
+
+#define pud_free_tlb(tlb, pudp)                                \
+do {                                                   \
+       tlb->need_flush = 1;                            \
+       __pud_free_tlb(tlb, pudp);                      \
+} while (0)
+
+#endif /* _ASM_IA64_TLB_H */
diff --git a/arch/ia64/include/asm/tlbflush.h b/arch/ia64/include/asm/tlbflush.h
new file mode 100644 (file)
index 0000000..3be25df
--- /dev/null
@@ -0,0 +1,102 @@
+#ifndef _ASM_IA64_TLBFLUSH_H
+#define _ASM_IA64_TLBFLUSH_H
+
+/*
+ * Copyright (C) 2002 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+
+#include <linux/mm.h>
+
+#include <asm/intrinsics.h>
+#include <asm/mmu_context.h>
+#include <asm/page.h>
+
+/*
+ * Now for some TLB flushing routines.  This is the kind of stuff that
+ * can be very expensive, so try to avoid them whenever possible.
+ */
+extern void setup_ptcg_sem(int max_purges, int from_palo);
+
+/*
+ * Flush everything (kernel mapping may also have changed due to
+ * vmalloc/vfree).
+ */
+extern void local_flush_tlb_all (void);
+
+#ifdef CONFIG_SMP
+  extern void smp_flush_tlb_all (void);
+  extern void smp_flush_tlb_mm (struct mm_struct *mm);
+  extern void smp_flush_tlb_cpumask (cpumask_t xcpumask);
+# define flush_tlb_all()       smp_flush_tlb_all()
+#else
+# define flush_tlb_all()       local_flush_tlb_all()
+# define smp_flush_tlb_cpumask(m) local_flush_tlb_all()
+#endif
+
+static inline void
+local_finish_flush_tlb_mm (struct mm_struct *mm)
+{
+       if (mm == current->active_mm)
+               activate_context(mm);
+}
+
+/*
+ * Flush a specified user mapping.  This is called, e.g., as a result of fork() and
+ * exit().  fork() ends up here because the copy-on-write mechanism needs to write-protect
+ * the PTEs of the parent task.
+ */
+static inline void
+flush_tlb_mm (struct mm_struct *mm)
+{
+       if (!mm)
+               return;
+
+       set_bit(mm->context, ia64_ctx.flushmap);
+       mm->context = 0;
+
+       if (atomic_read(&mm->mm_users) == 0)
+               return;         /* happens as a result of exit_mmap() */
+
+#ifdef CONFIG_SMP
+       smp_flush_tlb_mm(mm);
+#else
+       local_finish_flush_tlb_mm(mm);
+#endif
+}
+
+extern void flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end);
+
+/*
+ * Page-granular tlb flush.
+ */
+static inline void
+flush_tlb_page (struct vm_area_struct *vma, unsigned long addr)
+{
+#ifdef CONFIG_SMP
+       flush_tlb_range(vma, (addr & PAGE_MASK), (addr & PAGE_MASK) + PAGE_SIZE);
+#else
+       if (vma->vm_mm == current->active_mm)
+               ia64_ptcl(addr, (PAGE_SHIFT << 2));
+       else
+               vma->vm_mm->context = 0;
+#endif
+}
+
+/*
+ * Flush the local TLB. Invoked from another cpu using an IPI.
+ */
+#ifdef CONFIG_SMP
+void smp_local_flush_tlb(void);
+#else
+#define smp_local_flush_tlb()
+#endif
+
+static inline void flush_tlb_kernel_range(unsigned long start,
+                                         unsigned long end)
+{
+       flush_tlb_all();        /* XXX fix me */
+}
+
+#endif /* _ASM_IA64_TLBFLUSH_H */
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
new file mode 100644 (file)
index 0000000..35bcb64
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2002, Erich Focht, NEC
+ *
+ * All rights reserved.
+ *
+ * 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.
+ */
+#ifndef _ASM_IA64_TOPOLOGY_H
+#define _ASM_IA64_TOPOLOGY_H
+
+#include <asm/acpi.h>
+#include <asm/numa.h>
+#include <asm/smp.h>
+
+#ifdef CONFIG_NUMA
+
+/* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
+#define PENALTY_FOR_NODE_WITH_CPUS 255
+
+/*
+ * Distance above which we begin to use zone reclaim
+ */
+#define RECLAIM_DISTANCE 15
+
+/*
+ * Returns the number of the node containing CPU 'cpu'
+ */
+#define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
+
+/*
+ * Returns a bitmask of CPUs on Node 'node'.
+ */
+#define node_to_cpumask(node) (node_to_cpu_mask[node])
+
+/*
+ * Returns the number of the node containing Node 'nid'.
+ * Not implemented here. Multi-level hierarchies detected with
+ * the help of node_distance().
+ */
+#define parent_node(nid) (nid)
+
+/*
+ * Returns the number of the first CPU on Node 'node'.
+ */
+#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
+
+/*
+ * Determines the node for a given pci bus
+ */
+#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
+
+void build_cpu_to_node_map(void);
+
+#define SD_CPU_INIT (struct sched_domain) {            \
+       .span                   = CPU_MASK_NONE,        \
+       .parent                 = NULL,                 \
+       .child                  = NULL,                 \
+       .groups                 = NULL,                 \
+       .min_interval           = 1,                    \
+       .max_interval           = 4,                    \
+       .busy_factor            = 64,                   \
+       .imbalance_pct          = 125,                  \
+       .cache_nice_tries       = 2,                    \
+       .busy_idx               = 2,                    \
+       .idle_idx               = 1,                    \
+       .newidle_idx            = 2,                    \
+       .wake_idx               = 1,                    \
+       .forkexec_idx           = 1,                    \
+       .flags                  = SD_LOAD_BALANCE       \
+                               | SD_BALANCE_NEWIDLE    \
+                               | SD_BALANCE_EXEC       \
+                               | SD_WAKE_AFFINE,       \
+       .last_balance           = jiffies,              \
+       .balance_interval       = 1,                    \
+       .nr_balance_failed      = 0,                    \
+}
+
+/* sched_domains SD_NODE_INIT for IA64 NUMA machines */
+#define SD_NODE_INIT (struct sched_domain) {           \
+       .span                   = CPU_MASK_NONE,        \
+       .parent                 = NULL,                 \
+       .child                  = NULL,                 \
+       .groups                 = NULL,                 \
+       .min_interval           = 8,                    \
+       .max_interval           = 8*(min(num_online_cpus(), 32)), \
+       .busy_factor            = 64,                   \
+       .imbalance_pct          = 125,                  \
+       .cache_nice_tries       = 2,                    \
+       .busy_idx               = 3,                    \
+       .idle_idx               = 2,                    \
+       .newidle_idx            = 2,                    \
+       .wake_idx               = 1,                    \
+       .forkexec_idx           = 1,                    \
+       .flags                  = SD_LOAD_BALANCE       \
+                               | SD_BALANCE_EXEC       \
+                               | SD_BALANCE_FORK       \
+                               | SD_SERIALIZE          \
+                               | SD_WAKE_BALANCE,      \
+       .last_balance           = jiffies,              \
+       .balance_interval       = 64,                   \
+       .nr_balance_failed      = 0,                    \
+}
+
+#endif /* CONFIG_NUMA */
+
+#ifdef CONFIG_SMP
+#define topology_physical_package_id(cpu)      (cpu_data(cpu)->socket_id)
+#define topology_core_id(cpu)                  (cpu_data(cpu)->core_id)
+#define topology_core_siblings(cpu)            (cpu_core_map[cpu])
+#define topology_thread_siblings(cpu)          (per_cpu(cpu_sibling_map, cpu))
+#define smt_capable()                          (smp_num_siblings > 1)
+#endif
+
+extern void arch_fix_phys_package_id(int num, u32 slot);
+
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
+                                       CPU_MASK_ALL : \
+                                       node_to_cpumask(pcibus_to_node(bus)) \
+                               )
+
+#include <asm-generic/topology.h>
+
+#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h
new file mode 100644 (file)
index 0000000..e36b371
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _ASM_IA64_TYPES_H
+#define _ASM_IA64_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.
+ *
+ * Based on <asm-alpha/types.h>.
+ *
+ * Modified 1998-2000, 2002
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <asm-generic/int-l64.h>
+
+#ifdef __ASSEMBLY__
+# define __IA64_UL(x)          (x)
+# define __IA64_UL_CONST(x)    x
+
+# ifdef __KERNEL__
+#  define BITS_PER_LONG 64
+# endif
+
+#else
+# define __IA64_UL(x)          ((unsigned long)(x))
+# define __IA64_UL_CONST(x)    x##UL
+
+typedef unsigned int umode_t;
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+# ifdef __KERNEL__
+
+#define BITS_PER_LONG 64
+
+/* DMA addresses are 64-bits wide, in general.  */
+
+typedef u64 dma_addr_t;
+
+# endif /* __KERNEL__ */
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_TYPES_H */
diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..449c8c0
--- /dev/null
@@ -0,0 +1,401 @@
+#ifndef _ASM_IA64_UACCESS_H
+#define _ASM_IA64_UACCESS_H
+
+/*
+ * This file defines various macros to transfer memory areas across
+ * the user/kernel boundary.  This needs to be done carefully because
+ * this code is executed in kernel mode and uses user-specified
+ * addresses.  Thus, we need to be careful not to let the user to
+ * trick us into accessing kernel memory that would normally be
+ * inaccessible.  This code is also fairly performance sensitive,
+ * so we want to spend as little time doing safety checks as
+ * possible.
+ *
+ * To make matters a bit more interesting, these macros sometimes also
+ * called from within the kernel itself, in which case the address
+ * validity check must be skipped.  The get_fs() macro tells us what
+ * to do: if get_fs()==USER_DS, checking is performed, if
+ * get_fs()==KERNEL_DS, checking is bypassed.
+ *
+ * Note that even if the memory area specified by the user is in a
+ * valid address range, it is still possible that we'll get a page
+ * fault while accessing it.  This is handled by filling out an
+ * exception handler fixup entry for each instruction that has the
+ * potential to fault.  When such a fault occurs, the page fault
+ * handler checks to see whether the faulting instruction has a fixup
+ * associated and, if so, sets r8 to -EFAULT and clears r9 to 0 and
+ * then resumes execution at the continuation point.
+ *
+ * Based on <asm-alpha/uaccess.h>.
+ *
+ * Copyright (C) 1998, 1999, 2001-2004 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <linux/compiler.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/page-flags.h>
+#include <linux/mm.h>
+
+#include <asm/intrinsics.h>
+#include <asm/pgtable.h>
+#include <asm/io.h>
+
+/*
+ * For historical reasons, the following macros are grossly misnamed:
+ */
+#define KERNEL_DS      ((mm_segment_t) { ~0UL })               /* cf. access_ok() */
+#define USER_DS                ((mm_segment_t) { TASK_SIZE-1 })        /* cf. access_ok() */
+
+#define VERIFY_READ    0
+#define VERIFY_WRITE   1
+
+#define get_ds()  (KERNEL_DS)
+#define get_fs()  (current_thread_info()->addr_limit)
+#define set_fs(x) (current_thread_info()->addr_limit = (x))
+
+#define segment_eq(a, b)       ((a).seg == (b).seg)
+
+/*
+ * When accessing user memory, we need to make sure the entire area really is in
+ * user-level space.  In order to do this efficiently, we make sure that the page at
+ * address TASK_SIZE is never valid.  We also need to make sure that the address doesn't
+ * point inside the virtually mapped linear page table.
+ */
+#define __access_ok(addr, size, segment)                                               \
+({                                                                                     \
+       __chk_user_ptr(addr);                                                           \
+       (likely((unsigned long) (addr) <= (segment).seg)                                \
+        && ((segment).seg == KERNEL_DS.seg                                             \
+            || likely(REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT)));        \
+})
+#define access_ok(type, addr, size)    __access_ok((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.
+ *
+ * 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)))
+
+extern long __put_user_unaligned_unknown (void);
+
+#define __put_user_unaligned(x, ptr)                                                           \
+({                                                                                             \
+       long __ret;                                                                             \
+       switch (sizeof(*(ptr))) {                                                               \
+               case 1: __ret = __put_user((x), (ptr)); break;                                  \
+               case 2: __ret = (__put_user((x), (u8 __user *)(ptr)))                           \
+                       | (__put_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break;              \
+               case 4: __ret = (__put_user((x), (u16 __user *)(ptr)))                          \
+                       | (__put_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break;            \
+               case 8: __ret = (__put_user((x), (u32 __user *)(ptr)))                          \
+                       | (__put_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break;            \
+               default: __ret = __put_user_unaligned_unknown();                                \
+       }                                                                                       \
+       __ret;                                                                                  \
+})
+
+extern long __get_user_unaligned_unknown (void);
+
+#define __get_user_unaligned(x, ptr)                                                           \
+({                                                                                             \
+       long __ret;                                                                             \
+       switch (sizeof(*(ptr))) {                                                               \
+               case 1: __ret = __get_user((x), (ptr)); break;                                  \
+               case 2: __ret = (__get_user((x), (u8 __user *)(ptr)))                           \
+                       | (__get_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break;              \
+               case 4: __ret = (__get_user((x), (u16 __user *)(ptr)))                          \
+                       | (__get_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break;            \
+               case 8: __ret = (__get_user((x), (u32 __user *)(ptr)))                          \
+                       | (__get_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break;            \
+               default: __ret = __get_user_unaligned_unknown();                                \
+       }                                                                                       \
+       __ret;                                                                                  \
+})
+
+#ifdef ASM_SUPPORTED
+  struct __large_struct { unsigned long buf[100]; };
+# define __m(x) (*(struct __large_struct __user *)(x))
+
+/* We need to declare the __ex_table section before we can use it in .xdata.  */
+asm (".section \"__ex_table\", \"a\"\n\t.previous");
+
+# define __get_user_size(val, addr, n, err)                                                    \
+do {                                                                                           \
+       register long __gu_r8 asm ("r8") = 0;                                                   \
+       register long __gu_r9 asm ("r9");                                                       \
+       asm ("\n[1:]\tld"#n" %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n"     \
+            "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n"                                         \
+            "[1:]"                                                                             \
+            : "=r"(__gu_r9), "=r"(__gu_r8) : "m"(__m(addr)), "1"(__gu_r8));                    \
+       (err) = __gu_r8;                                                                        \
+       (val) = __gu_r9;                                                                        \
+} while (0)
+
+/*
+ * The "__put_user_size()" macro tells gcc it reads from memory instead of writing it.  This
+ * is because they do not write to any memory gcc knows about, so there are no aliasing
+ * issues.
+ */
+# define __put_user_size(val, addr, n, err)                                                    \
+do {                                                                                           \
+       register long __pu_r8 asm ("r8") = 0;                                                   \
+       asm volatile ("\n[1:]\tst"#n" %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
+                     "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n"                                  \
+                     "[1:]"                                                                    \
+                     : "=r"(__pu_r8) : "m"(__m(addr)), "rO"(val), "0"(__pu_r8));               \
+       (err) = __pu_r8;                                                                        \
+} while (0)
+
+#else /* !ASM_SUPPORTED */
+# define RELOC_TYPE    2       /* ip-rel */
+# define __get_user_size(val, addr, n, err)                            \
+do {                                                                   \
+       __ld_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE);   \
+       (err) = ia64_getreg(_IA64_REG_R8);                              \
+       (val) = ia64_getreg(_IA64_REG_R9);                              \
+} while (0)
+# define __put_user_size(val, addr, n, err)                                                    \
+do {                                                                                           \
+       __st_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE, (unsigned long) (val));    \
+       (err) = ia64_getreg(_IA64_REG_R8);                                                      \
+} while (0)
+#endif /* !ASM_SUPPORTED */
+
+extern void __get_user_unknown (void);
+
+/*
+ * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
+ * could clobber r8 and r9 (among others).  Thus, be careful not to evaluate it while
+ * using r8/r9.
+ */
+#define __do_get_user(check, x, ptr, size, segment)                                    \
+({                                                                                     \
+       const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);                              \
+       __typeof__ (size) __gu_size = (size);                                           \
+       long __gu_err = -EFAULT;                                                        \
+       unsigned long __gu_val = 0;                                                     \
+       if (!check || __access_ok(__gu_ptr, size, segment))                             \
+               switch (__gu_size) {                                                    \
+                     case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break;  \
+                     case 2: __get_user_size(__gu_val, __gu_ptr, 2, __gu_err); break;  \
+                     case 4: __get_user_size(__gu_val, __gu_ptr, 4, __gu_err); break;  \
+                     case 8: __get_user_size(__gu_val, __gu_ptr, 8, __gu_err); break;  \
+                     default: __get_user_unknown(); break;                             \
+               }                                                                       \
+       (x) = (__typeof__(*(__gu_ptr))) __gu_val;                                       \
+       __gu_err;                                                                       \
+})
+
+#define __get_user_nocheck(x, ptr, size)       __do_get_user(0, x, ptr, size, KERNEL_DS)
+#define __get_user_check(x, ptr, size, segment)        __do_get_user(1, x, ptr, size, segment)
+
+extern void __put_user_unknown (void);
+
+/*
+ * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
+ * could clobber r8 (among others).  Thus, be careful not to evaluate them while using r8.
+ */
+#define __do_put_user(check, x, ptr, size, segment)                                    \
+({                                                                                     \
+       __typeof__ (x) __pu_x = (x);                                                    \
+       __typeof__ (*(ptr)) __user *__pu_ptr = (ptr);                                   \
+       __typeof__ (size) __pu_size = (size);                                           \
+       long __pu_err = -EFAULT;                                                        \
+                                                                                       \
+       if (!check || __access_ok(__pu_ptr, __pu_size, segment))                        \
+               switch (__pu_size) {                                                    \
+                     case 1: __put_user_size(__pu_x, __pu_ptr, 1, __pu_err); break;    \
+                     case 2: __put_user_size(__pu_x, __pu_ptr, 2, __pu_err); break;    \
+                     case 4: __put_user_size(__pu_x, __pu_ptr, 4, __pu_err); break;    \
+                     case 8: __put_user_size(__pu_x, __pu_ptr, 8, __pu_err); break;    \
+                     default: __put_user_unknown(); break;                             \
+               }                                                                       \
+       __pu_err;                                                                       \
+})
+
+#define __put_user_nocheck(x, ptr, size)       __do_put_user(0, x, ptr, size, KERNEL_DS)
+#define __put_user_check(x, ptr, size, segment)        __do_put_user(1, x, ptr, size, segment)
+
+/*
+ * Complex access routines
+ */
+extern unsigned long __must_check __copy_user (void __user *to, const void __user *from,
+                                              unsigned long count);
+
+static inline unsigned long
+__copy_to_user (void __user *to, const void *from, unsigned long count)
+{
+       return __copy_user(to, (__force void __user *) from, count);
+}
+
+static inline unsigned long
+__copy_from_user (void *to, const void __user *from, unsigned long count)
+{
+       return __copy_user((__force void __user *) to, from, count);
+}
+
+#define __copy_to_user_inatomic                __copy_to_user
+#define __copy_from_user_inatomic      __copy_from_user
+#define copy_to_user(to, from, n)                                                      \
+({                                                                                     \
+       void __user *__cu_to = (to);                                                    \
+       const void *__cu_from = (from);                                                 \
+       long __cu_len = (n);                                                            \
+                                                                                       \
+       if (__access_ok(__cu_to, __cu_len, get_fs()))                                   \
+               __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len);   \
+       __cu_len;                                                                       \
+})
+
+#define copy_from_user(to, from, n)                                                    \
+({                                                                                     \
+       void *__cu_to = (to);                                                           \
+       const void __user *__cu_from = (from);                                          \
+       long __cu_len = (n);                                                            \
+                                                                                       \
+       __chk_user_ptr(__cu_from);                                                      \
+       if (__access_ok(__cu_from, __cu_len, get_fs()))                                 \
+               __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len);   \
+       __cu_len;                                                                       \
+})
+
+#define __copy_in_user(to, from, size) __copy_user((to), (from), (size))
+
+static inline unsigned long
+copy_in_user (void __user *to, const void __user *from, unsigned long n)
+{
+       if (likely(access_ok(VERIFY_READ, from, n) && access_ok(VERIFY_WRITE, to, n)))
+               n = __copy_user(to, from, n);
+       return n;
+}
+
+extern unsigned long __do_clear_user (void __user *, unsigned long);
+
+#define __clear_user(to, n)            __do_clear_user(to, n)
+
+#define clear_user(to, n)                                      \
+({                                                             \
+       unsigned long __cu_len = (n);                           \
+       if (__access_ok(to, __cu_len, get_fs()))                \
+               __cu_len = __do_clear_user(to, __cu_len);       \
+       __cu_len;                                               \
+})
+
+
+/*
+ * Returns: -EFAULT if exception before terminator, N if the entire buffer filled, else
+ * strlen.
+ */
+extern long __must_check __strncpy_from_user (char *to, const char __user *from, long to_len);
+
+#define strncpy_from_user(to, from, n)                                 \
+({                                                                     \
+       const char __user * __sfu_from = (from);                        \
+       long __sfu_ret = -EFAULT;                                       \
+       if (__access_ok(__sfu_from, 0, get_fs()))                       \
+               __sfu_ret = __strncpy_from_user((to), __sfu_from, (n)); \
+       __sfu_ret;                                                      \
+})
+
+/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
+extern unsigned long __strlen_user (const char __user *);
+
+#define strlen_user(str)                               \
+({                                                     \
+       const char __user *__su_str = (str);            \
+       unsigned long __su_ret = 0;                     \
+       if (__access_ok(__su_str, 0, get_fs()))         \
+               __su_ret = __strlen_user(__su_str);     \
+       __su_ret;                                       \
+})
+
+/*
+ * 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 unsigned long __strnlen_user (const char __user *, long);
+
+#define strnlen_user(str, len)                                 \
+({                                                             \
+       const char __user *__su_str = (str);                    \
+       unsigned long __su_ret = 0;                             \
+       if (__access_ok(__su_str, 0, get_fs()))                 \
+               __su_ret = __strnlen_user(__su_str, len);       \
+       __su_ret;                                               \
+})
+
+/* Generic code can't deal with the location-relative format that we use for compactness.  */
+#define ARCH_HAS_SORT_EXTABLE
+#define ARCH_HAS_SEARCH_EXTABLE
+
+struct exception_table_entry {
+       int addr;       /* location-relative address of insn this fixup is for */
+       int cont;       /* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */
+};
+
+extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
+extern const struct exception_table_entry *search_exception_tables (unsigned long addr);
+
+static inline int
+ia64_done_with_exception (struct pt_regs *regs)
+{
+       const struct exception_table_entry *e;
+       e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
+       if (e) {
+               ia64_handle_exception(regs, e);
+               return 1;
+       }
+       return 0;
+}
+
+#define ARCH_HAS_TRANSLATE_MEM_PTR     1
+static __inline__ char *
+xlate_dev_mem_ptr (unsigned long p)
+{
+       struct page *page;
+       char * ptr;
+
+       page = pfn_to_page(p >> PAGE_SHIFT);
+       if (PageUncached(page))
+               ptr = (char *)p + __IA64_UNCACHED_OFFSET;
+       else
+               ptr = __va(p);
+
+       return ptr;
+}
+
+/*
+ * Convert a virtual cached kernel memory pointer to an uncached pointer
+ */
+static __inline__ char *
+xlate_dev_kmem_ptr (char * p)
+{
+       struct page *page;
+       char * ptr;
+
+       page = virt_to_page((unsigned long)p);
+       if (PageUncached(page))
+               ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
+       else
+               ptr = p;
+
+       return ptr;
+}
+
+#endif /* _ASM_IA64_UACCESS_H */
diff --git a/arch/ia64/include/asm/ucontext.h b/arch/ia64/include/asm/ucontext.h
new file mode 100644 (file)
index 0000000..bf573dc
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ASM_IA64_UCONTEXT_H
+#define _ASM_IA64_UCONTEXT_H
+
+struct ucontext {
+       struct sigcontext uc_mcontext;
+};
+
+#define uc_link                uc_mcontext.sc_gr[0]    /* wrong type; nobody cares */
+#define uc_sigmask     uc_mcontext.sc_sigmask
+#define uc_stack       uc_mcontext.sc_stack
+
+#endif /* _ASM_IA64_UCONTEXT_H */
diff --git a/arch/ia64/include/asm/unaligned.h b/arch/ia64/include/asm/unaligned.h
new file mode 100644 (file)
index 0000000..7bddc7f
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ASM_IA64_UNALIGNED_H
+#define _ASM_IA64_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_IA64_UNALIGNED_H */
diff --git a/arch/ia64/include/asm/uncached.h b/arch/ia64/include/asm/uncached.h
new file mode 100644 (file)
index 0000000..13d7e65
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2001-2008 Silicon Graphics, Inc.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * Prototypes for the uncached page allocator
+ */
+
+extern unsigned long uncached_alloc_page(int starting_nid, int n_pages);
+extern void uncached_free_page(unsigned long uc_addr, int n_pages);
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
new file mode 100644 (file)
index 0000000..d535833
--- /dev/null
@@ -0,0 +1,384 @@
+#ifndef _ASM_IA64_UNISTD_H
+#define _ASM_IA64_UNISTD_H
+
+/*
+ * IA-64 Linux syscall numbers and inline-functions.
+ *
+ * Copyright (C) 1998-2005 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <asm/break.h>
+
+#define __BREAK_SYSCALL                        __IA64_BREAK_SYSCALL
+
+#define __NR_ni_syscall                        1024
+#define __NR_exit                      1025
+#define __NR_read                      1026
+#define __NR_write                     1027
+#define __NR_open                      1028
+#define __NR_close                     1029
+#define __NR_creat                     1030
+#define __NR_link                      1031
+#define __NR_unlink                    1032
+#define __NR_execve                    1033
+#define __NR_chdir                     1034
+#define __NR_fchdir                    1035
+#define __NR_utimes                    1036
+#define __NR_mknod                     1037
+#define __NR_chmod                     1038
+#define __NR_chown                     1039
+#define __NR_lseek                     1040
+#define __NR_getpid                    1041
+#define __NR_getppid                   1042
+#define __NR_mount                     1043
+#define __NR_umount                    1044
+#define __NR_setuid                    1045
+#define __NR_getuid                    1046
+#define __NR_geteuid                   1047
+#define __NR_ptrace                    1048
+#define __NR_access                    1049
+#define __NR_sync                      1050
+#define __NR_fsync                     1051
+#define __NR_fdatasync                 1052
+#define __NR_kill                      1053
+#define __NR_rename                    1054
+#define __NR_mkdir                     1055
+#define __NR_rmdir                     1056
+#define __NR_dup                       1057
+#define __NR_pipe                      1058
+#define __NR_times                     1059
+#define __NR_brk                       1060
+#define __NR_setgid                    1061
+#define __NR_getgid                    1062
+#define __NR_getegid                   1063
+#define __NR_acct                      1064
+#define __NR_ioctl                     1065
+#define __NR_fcntl                     1066
+#define __NR_umask                     1067
+#define __NR_chroot                    1068
+#define __NR_ustat                     1069
+#define __NR_dup2                      1070
+#define __NR_setreuid                  1071
+#define __NR_setregid                  1072
+#define __NR_getresuid                 1073
+#define __NR_setresuid                 1074
+#define __NR_getresgid                 1075
+#define __NR_setresgid                 1076
+#define __NR_getgroups                 1077
+#define __NR_setgroups                 1078
+#define __NR_getpgid                   1079
+#define __NR_setpgid                   1080
+#define __NR_setsid                    1081
+#define __NR_getsid                    1082
+#define __NR_sethostname               1083
+#define __NR_setrlimit                 1084
+#define __NR_getrlimit                 1085
+#define __NR_getrusage                 1086
+#define __NR_gettimeofday              1087
+#define __NR_settimeofday              1088
+#define __NR_select                    1089
+#define __NR_poll                      1090
+#define __NR_symlink                   1091
+#define __NR_readlink                  1092
+#define __NR_uselib                    1093
+#define __NR_swapon                    1094
+#define __NR_swapoff                   1095
+#define __NR_reboot                    1096
+#define __NR_truncate                  1097
+#define __NR_ftruncate                 1098
+#define __NR_fchmod                    1099
+#define __NR_fchown                    1100
+#define __NR_getpriority               1101
+#define __NR_setpriority               1102
+#define __NR_statfs                    1103
+#define __NR_fstatfs                   1104
+#define __NR_gettid                    1105
+#define __NR_semget                    1106
+#define __NR_semop                     1107
+#define __NR_semctl                    1108
+#define __NR_msgget                    1109
+#define __NR_msgsnd                    1110
+#define __NR_msgrcv                    1111
+#define __NR_msgctl                    1112
+#define __NR_shmget                    1113
+#define __NR_shmat                     1114
+#define __NR_shmdt                     1115
+#define __NR_shmctl                    1116
+/* also known as klogctl() in GNU libc: */
+#define __NR_syslog                    1117
+#define __NR_setitimer                 1118
+#define __NR_getitimer                 1119
+/* 1120 was __NR_old_stat */
+/* 1121 was __NR_old_lstat */
+/* 1122 was __NR_old_fstat */
+#define __NR_vhangup                   1123
+#define __NR_lchown                    1124
+#define __NR_remap_file_pages          1125
+#define __NR_wait4                     1126
+#define __NR_sysinfo                   1127
+#define __NR_clone                     1128
+#define __NR_setdomainname             1129
+#define __NR_uname                     1130
+#define __NR_adjtimex                  1131
+/* 1132 was __NR_create_module */
+#define __NR_init_module               1133
+#define __NR_delete_module             1134
+/* 1135 was __NR_get_kernel_syms */
+/* 1136 was __NR_query_module */
+#define __NR_quotactl                  1137
+#define __NR_bdflush                   1138
+#define __NR_sysfs                     1139
+#define __NR_personality               1140
+#define __NR_afs_syscall               1141
+#define __NR_setfsuid                  1142
+#define __NR_setfsgid                  1143
+#define __NR_getdents                  1144
+#define __NR_flock                     1145
+#define __NR_readv                     1146
+#define __NR_writev                    1147
+#define __NR_pread64                   1148
+#define __NR_pwrite64                  1149
+#define __NR__sysctl                   1150
+#define __NR_mmap                      1151
+#define __NR_munmap                    1152
+#define __NR_mlock                     1153
+#define __NR_mlockall                  1154
+#define __NR_mprotect                  1155
+#define __NR_mremap                    1156
+#define __NR_msync                     1157
+#define __NR_munlock                   1158
+#define __NR_munlockall                        1159
+#define __NR_sched_getparam            1160
+#define __NR_sched_setparam            1161
+#define __NR_sched_getscheduler                1162
+#define __NR_sched_setscheduler                1163
+#define __NR_sched_yield               1164
+#define __NR_sched_get_priority_max    1165
+#define __NR_sched_get_priority_min    1166
+#define __NR_sched_rr_get_interval     1167
+#define __NR_nanosleep                 1168
+#define __NR_nfsservctl                        1169
+#define __NR_prctl                     1170
+/* 1171 is reserved for backwards compatibility with old __NR_getpagesize */
+#define __NR_mmap2                     1172
+#define __NR_pciconfig_read            1173
+#define __NR_pciconfig_write           1174
+#define __NR_perfmonctl                        1175
+#define __NR_sigaltstack               1176
+#define __NR_rt_sigaction              1177
+#define __NR_rt_sigpending             1178
+#define __NR_rt_sigprocmask            1179
+#define __NR_rt_sigqueueinfo           1180
+#define __NR_rt_sigreturn              1181
+#define __NR_rt_sigsuspend             1182
+#define __NR_rt_sigtimedwait           1183
+#define __NR_getcwd                    1184
+#define __NR_capget                    1185
+#define __NR_capset                    1186
+#define __NR_sendfile                  1187
+#define __NR_getpmsg                   1188
+#define __NR_putpmsg                   1189
+#define __NR_socket                    1190
+#define __NR_bind                      1191
+#define __NR_connect                   1192
+#define __NR_listen                    1193
+#define __NR_accept                    1194
+#define __NR_getsockname               1195
+#define __NR_getpeername               1196
+#define __NR_socketpair                        1197
+#define __NR_send                      1198
+#define __NR_sendto                    1199
+#define __NR_recv                      1200
+#define __NR_recvfrom                  1201
+#define __NR_shutdown                  1202
+#define __NR_setsockopt                        1203
+#define __NR_getsockopt                        1204
+#define __NR_sendmsg                   1205
+#define __NR_recvmsg                   1206
+#define __NR_pivot_root                        1207
+#define __NR_mincore                   1208
+#define __NR_madvise                   1209
+#define __NR_stat                      1210
+#define __NR_lstat                     1211
+#define __NR_fstat                     1212
+#define __NR_clone2                    1213
+#define __NR_getdents64                        1214
+#define __NR_getunwind                 1215
+#define __NR_readahead                 1216
+#define __NR_setxattr                  1217
+#define __NR_lsetxattr                 1218
+#define __NR_fsetxattr                 1219
+#define __NR_getxattr                  1220
+#define __NR_lgetxattr                 1221
+#define __NR_fgetxattr                 1222
+#define __NR_listxattr                 1223
+#define __NR_llistxattr                        1224
+#define __NR_flistxattr                        1225
+#define __NR_removexattr               1226
+#define __NR_lremovexattr              1227
+#define __NR_fremovexattr              1228
+#define __NR_tkill                     1229
+#define __NR_futex                     1230
+#define __NR_sched_setaffinity         1231
+#define __NR_sched_getaffinity         1232
+#define __NR_set_tid_address           1233
+#define __NR_fadvise64                 1234
+#define __NR_tgkill                    1235
+#define __NR_exit_group                        1236
+#define __NR_lookup_dcookie            1237
+#define __NR_io_setup                  1238
+#define __NR_io_destroy                        1239
+#define __NR_io_getevents              1240
+#define __NR_io_submit                 1241
+#define __NR_io_cancel                 1242
+#define __NR_epoll_create              1243
+#define __NR_epoll_ctl                 1244
+#define __NR_epoll_wait                        1245
+#define __NR_restart_syscall           1246
+#define __NR_semtimedop                        1247
+#define __NR_timer_create              1248
+#define __NR_timer_settime             1249
+#define __NR_timer_gettime             1250
+#define __NR_timer_getoverrun          1251
+#define __NR_timer_delete              1252
+#define __NR_clock_settime             1253
+#define __NR_clock_gettime             1254
+#define __NR_clock_getres              1255
+#define __NR_clock_nanosleep           1256
+#define __NR_fstatfs64                 1257
+#define __NR_statfs64                  1258
+#define __NR_mbind                     1259
+#define __NR_get_mempolicy             1260
+#define __NR_set_mempolicy             1261
+#define __NR_mq_open                   1262
+#define __NR_mq_unlink                 1263
+#define __NR_mq_timedsend              1264
+#define __NR_mq_timedreceive           1265
+#define __NR_mq_notify                 1266
+#define __NR_mq_getsetattr             1267
+#define __NR_kexec_load                        1268
+#define __NR_vserver                   1269
+#define __NR_waitid                    1270
+#define __NR_add_key                   1271
+#define __NR_request_key               1272
+#define __NR_keyctl                    1273
+#define __NR_ioprio_set                        1274
+#define __NR_ioprio_get                        1275
+#define __NR_move_pages                        1276
+#define __NR_inotify_init              1277
+#define __NR_inotify_add_watch         1278
+#define __NR_inotify_rm_watch          1279
+#define __NR_migrate_pages             1280
+#define __NR_openat                    1281
+#define __NR_mkdirat                   1282
+#define __NR_mknodat                   1283
+#define __NR_fchownat                  1284
+#define __NR_futimesat                 1285
+#define __NR_newfstatat                        1286
+#define __NR_unlinkat                  1287
+#define __NR_renameat                  1288
+#define __NR_linkat                    1289
+#define __NR_symlinkat                 1290
+#define __NR_readlinkat                        1291
+#define __NR_fchmodat                  1292
+#define __NR_faccessat                 1293
+#define __NR_pselect6                  1294
+#define __NR_ppoll                     1295
+#define __NR_unshare                   1296
+#define __NR_splice                    1297
+#define __NR_set_robust_list           1298
+#define __NR_get_robust_list           1299
+#define __NR_sync_file_range           1300
+#define __NR_tee                       1301
+#define __NR_vmsplice                  1302
+#define __NR_fallocate                 1303
+#define __NR_getcpu                    1304
+#define __NR_epoll_pwait               1305
+#define __NR_utimensat                 1306
+#define __NR_signalfd                  1307
+#define __NR_timerfd                   1308
+#define __NR_eventfd                   1309
+#define __NR_timerfd_create            1310
+#define __NR_timerfd_settime           1311
+#define __NR_timerfd_gettime           1312
+#define __NR_signalfd4                 1313
+#define __NR_eventfd2                  1314
+#define __NR_epoll_create1             1315
+#define __NR_dup3                      1316
+#define __NR_pipe2                     1317
+#define __NR_inotify_init1             1318
+
+#ifdef __KERNEL__
+
+
+#define NR_syscalls                    295 /* length of syscall table */
+
+/*
+ * The following defines stop scripts/checksyscalls.sh from complaining about
+ * unimplemented system calls.  Glibc provides for each of these by using
+ * more modern equivalent system calls.
+ */
+#define __IGNORE_fork          /* clone() */
+#define __IGNORE_time          /* gettimeofday() */
+#define __IGNORE_alarm         /* setitimer(ITIMER_REAL, ... */
+#define __IGNORE_pause         /* rt_sigprocmask(), rt_sigsuspend() */
+#define __IGNORE_utime         /* utimes() */
+#define __IGNORE_getpgrp       /* getpgid() */
+#define __IGNORE_vfork         /* clone() */
+
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_RT_SIGSUSPEND
+
+#ifdef CONFIG_IA32_SUPPORT
+# define __ARCH_WANT_SYS_FADVISE64
+# define __ARCH_WANT_SYS_GETPGRP
+# define __ARCH_WANT_SYS_LLSEEK
+# define __ARCH_WANT_SYS_NICE
+# define __ARCH_WANT_SYS_OLD_GETRLIMIT
+# define __ARCH_WANT_SYS_OLDUMOUNT
+# define __ARCH_WANT_SYS_SIGPENDING
+# define __ARCH_WANT_SYS_SIGPROCMASK
+# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+# define __ARCH_WANT_COMPAT_SYS_TIME
+#endif
+
+#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
+
+#include <linux/types.h>
+#include <linux/linkage.h>
+#include <linux/compiler.h>
+
+extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
+
+asmlinkage unsigned long sys_mmap(
+                               unsigned long addr, unsigned long len,
+                               int prot, int flags,
+                               int fd, long off);
+asmlinkage unsigned long sys_mmap2(
+                               unsigned long addr, unsigned long len,
+                               int prot, int flags,
+                               int fd, long pgoff);
+struct pt_regs;
+struct sigaction;
+long sys_execve(char __user *filename, char __user * __user *argv,
+                          char __user * __user *envp, struct pt_regs *regs);
+asmlinkage long sys_pipe(void);
+asmlinkage long sys_rt_sigaction(int sig,
+                                const struct sigaction __user *act,
+                                struct sigaction __user *oact,
+                                size_t sigsetsize);
+
+/*
+ * "Conditional" syscalls
+ *
+ * Note, this macro can only be used in the file which defines sys_ni_syscall, i.e., in
+ * kernel/sys_ni.c.  This version causes warnings because the declaration isn't a
+ * proper prototype, but we can't use __typeof__ either, because not all cond_syscall()
+ * declarations have prototypes at the moment.
+ */
+#define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall")))
+
+#endif /* !__ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_IA64_UNISTD_H */
diff --git a/arch/ia64/include/asm/unwind.h b/arch/ia64/include/asm/unwind.h
new file mode 100644 (file)
index 0000000..1af3875
--- /dev/null
@@ -0,0 +1,233 @@
+#ifndef _ASM_IA64_UNWIND_H
+#define _ASM_IA64_UNWIND_H
+
+/*
+ * Copyright (C) 1999-2000, 2003 Hewlett-Packard Co
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ * A simple API for unwinding kernel stacks.  This is used for
+ * debugging and error reporting purposes.  The kernel doesn't need
+ * full-blown stack unwinding with all the bells and whitles, so there
+ * is not much point in implementing the full IA-64 unwind API (though
+ * it would of course be possible to implement the kernel API on top
+ * of it).
+ */
+
+struct task_struct;    /* forward declaration */
+struct switch_stack;   /* forward declaration */
+
+enum unw_application_register {
+       UNW_AR_BSP,
+       UNW_AR_BSPSTORE,
+       UNW_AR_PFS,
+       UNW_AR_RNAT,
+       UNW_AR_UNAT,
+       UNW_AR_LC,
+       UNW_AR_EC,
+       UNW_AR_FPSR,
+       UNW_AR_RSC,
+       UNW_AR_CCV,
+       UNW_AR_CSD,
+       UNW_AR_SSD
+};
+
+/*
+ * The following declarations are private to the unwind
+ * implementation:
+ */
+
+struct unw_stack {
+       unsigned long limit;
+       unsigned long top;
+};
+
+#define UNW_FLAG_INTERRUPT_FRAME       (1UL << 0)
+
+/*
+ * No user of this module should every access this structure directly
+ * as it is subject to change.  It is declared here solely so we can
+ * use automatic variables.
+ */
+struct unw_frame_info {
+       struct unw_stack regstk;
+       struct unw_stack memstk;
+       unsigned int flags;
+       short hint;
+       short prev_script;
+
+       /* current frame info: */
+       unsigned long bsp;              /* backing store pointer value */
+       unsigned long sp;               /* stack pointer value */
+       unsigned long psp;              /* previous sp value */
+       unsigned long ip;               /* instruction pointer value */
+       unsigned long pr;               /* current predicate values */
+       unsigned long *cfm_loc;         /* cfm save location (or NULL) */
+       unsigned long pt;               /* struct pt_regs location */
+
+       struct task_struct *task;
+       struct switch_stack *sw;
+
+       /* preserved state: */
+       unsigned long *bsp_loc;         /* previous bsp save location */
+       unsigned long *bspstore_loc;
+       unsigned long *pfs_loc;
+       unsigned long *rnat_loc;
+       unsigned long *rp_loc;
+       unsigned long *pri_unat_loc;
+       unsigned long *unat_loc;
+       unsigned long *pr_loc;
+       unsigned long *lc_loc;
+       unsigned long *fpsr_loc;
+       struct unw_ireg {
+               unsigned long *loc;
+               struct unw_ireg_nat {
+                       unsigned long type : 3;         /* enum unw_nat_type */
+                       signed long off : 61;           /* NaT word is at loc+nat.off */
+               } nat;
+       } r4, r5, r6, r7;
+       unsigned long *b1_loc, *b2_loc, *b3_loc, *b4_loc, *b5_loc;
+       struct ia64_fpreg *f2_loc, *f3_loc, *f4_loc, *f5_loc, *fr_loc[16];
+};
+
+/*
+ * The official API follows below:
+ */
+
+struct unw_table_entry {
+       u64 start_offset;
+       u64 end_offset;
+       u64 info_offset;
+};
+
+/*
+ * Initialize unwind support.
+ */
+extern void unw_init (void);
+
+extern void *unw_add_unwind_table (const char *name, unsigned long segment_base, unsigned long gp,
+                                  const void *table_start, const void *table_end);
+
+extern void unw_remove_unwind_table (void *handle);
+
+/*
+ * Prepare to unwind blocked task t.
+ */
+extern void unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t);
+
+extern void unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t,
+                                struct switch_stack *sw);
+
+/*
+ * Prepare to unwind the currently running thread.
+ */
+extern void unw_init_running (void (*callback)(struct unw_frame_info *info, void *arg), void *arg);
+
+/*
+ * Unwind to previous to frame.  Returns 0 if successful, negative
+ * number in case of an error.
+ */
+extern int unw_unwind (struct unw_frame_info *info);
+
+/*
+ * Unwind until the return pointer is in user-land (or until an error
+ * occurs).  Returns 0 if successful, negative number in case of
+ * error.
+ */
+extern int unw_unwind_to_user (struct unw_frame_info *info);
+
+#define unw_is_intr_frame(info)        (((info)->flags & UNW_FLAG_INTERRUPT_FRAME) != 0)
+
+static inline int
+unw_get_ip (struct unw_frame_info *info, unsigned long *valp)
+{
+       *valp = (info)->ip;
+       return 0;
+}
+
+static inline int
+unw_get_sp (struct unw_frame_info *info, unsigned long *valp)
+{
+       *valp = (info)->sp;
+       return 0;
+}
+
+static inline int
+unw_get_psp (struct unw_frame_info *info, unsigned long *valp)
+{
+       *valp = (info)->psp;
+       return 0;
+}
+
+static inline int
+unw_get_bsp (struct unw_frame_info *info, unsigned long *valp)
+{
+       *valp = (info)->bsp;
+       return 0;
+}
+
+static inline int
+unw_get_cfm (struct unw_frame_info *info, unsigned long *valp)
+{
+       *valp = *(info)->cfm_loc;
+       return 0;
+}
+
+static inline int
+unw_set_cfm (struct unw_frame_info *info, unsigned long val)
+{
+       *(info)->cfm_loc = val;
+       return 0;
+}
+
+static inline int
+unw_get_rp (struct unw_frame_info *info, unsigned long *val)
+{
+       if (!info->rp_loc)
+               return -1;
+       *val = *info->rp_loc;
+       return 0;
+}
+
+extern int unw_access_gr (struct unw_frame_info *, int, unsigned long *, char *, int);
+extern int unw_access_br (struct unw_frame_info *, int, unsigned long *, int);
+extern int unw_access_fr (struct unw_frame_info *, int, struct ia64_fpreg *, int);
+extern int unw_access_ar (struct unw_frame_info *, int, unsigned long *, int);
+extern int unw_access_pr (struct unw_frame_info *, unsigned long *, int);
+
+static inline int
+unw_set_gr (struct unw_frame_info *i, int n, unsigned long v, char nat)
+{
+       return unw_access_gr(i, n, &v, &nat, 1);
+}
+
+static inline int
+unw_set_br (struct unw_frame_info *i, int n, unsigned long v)
+{
+       return unw_access_br(i, n, &v, 1);
+}
+
+static inline int
+unw_set_fr (struct unw_frame_info *i, int n, struct ia64_fpreg v)
+{
+       return unw_access_fr(i, n, &v, 1);
+}
+
+static inline int
+unw_set_ar (struct unw_frame_info *i, int n, unsigned long v)
+{
+       return unw_access_ar(i, n, &v, 1);
+}
+
+static inline int
+unw_set_pr (struct unw_frame_info *i, unsigned long v)
+{
+       return unw_access_pr(i, &v, 1);
+}
+
+#define unw_get_gr(i,n,v,nat)  unw_access_gr(i,n,v,nat,0)
+#define unw_get_br(i,n,v)      unw_access_br(i,n,v,0)
+#define unw_get_fr(i,n,v)      unw_access_fr(i,n,v,0)
+#define unw_get_ar(i,n,v)      unw_access_ar(i,n,v,0)
+#define unw_get_pr(i,v)                unw_access_pr(i,v,0)
+
+#endif /* _ASM_UNWIND_H */
diff --git a/arch/ia64/include/asm/user.h b/arch/ia64/include/asm/user.h
new file mode 100644 (file)
index 0000000..8b98211
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _ASM_IA64_USER_H
+#define _ASM_IA64_USER_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).  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.
+ *
+ * Modified 1998, 1999, 2001
+ *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+#include <linux/ptrace.h>
+#include <linux/types.h>
+
+#include <asm/page.h>
+
+#define EF_SIZE                3072    /* XXX fix me */
+
+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 /* _ASM_IA64_USER_H */
diff --git a/arch/ia64/include/asm/ustack.h b/arch/ia64/include/asm/ustack.h
new file mode 100644 (file)
index 0000000..504167c
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ASM_IA64_USTACK_H
+#define _ASM_IA64_USTACK_H
+
+/*
+ * Constants for the user stack size
+ */
+
+#ifdef __KERNEL__
+#include <asm/page.h>
+
+/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
+#define MAX_USER_STACK_SIZE    (RGN_MAP_LIMIT/2)
+#define STACK_TOP              (0x6000000000000000UL + RGN_MAP_LIMIT)
+#define STACK_TOP_MAX          STACK_TOP
+#endif
+
+/* Make a default stack size of 2GiB */
+#define DEFAULT_USER_STACK_SIZE        (1UL << 31)
+
+#endif /* _ASM_IA64_USTACK_H */
diff --git a/arch/ia64/include/asm/uv/uv_hub.h b/arch/ia64/include/asm/uv/uv_hub.h
new file mode 100644 (file)
index 0000000..f607018
--- /dev/null
@@ -0,0 +1,309 @@
+/*
+ * 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.
+ *
+ * SGI UV architectural definitions
+ *
+ * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef __ASM_IA64_UV_HUB_H__
+#define __ASM_IA64_UV_HUB_H__
+
+#include <linux/numa.h>
+#include <linux/percpu.h>
+#include <asm/types.h>
+#include <asm/percpu.h>
+
+
+/*
+ * Addressing Terminology
+ *
+ *     M       - The low M bits of a physical address represent the offset
+ *               into the blade local memory. RAM memory on a blade is physically
+ *               contiguous (although various IO spaces may punch holes in
+ *               it)..
+ *
+ *     N       - Number of bits in the node portion of a socket physical
+ *               address.
+ *
+ *     NASID   - network ID of a router, Mbrick or Cbrick. Nasid values of
+ *               routers always have low bit of 1, C/MBricks have low bit
+ *               equal to 0. Most addressing macros that target UV hub chips
+ *               right shift the NASID by 1 to exclude the always-zero bit.
+ *               NASIDs contain up to 15 bits.
+ *
+ *     GNODE   - NASID right shifted by 1 bit. Most mmrs contain gnodes instead
+ *               of nasids.
+ *
+ *     PNODE   - the low N bits of the GNODE. The PNODE is the most useful variant
+ *               of the nasid for socket usage.
+ *
+ *
+ *  NumaLink Global Physical Address Format:
+ *  +--------------------------------+---------------------+
+ *  |00..000|      GNODE             |      NodeOffset     |
+ *  +--------------------------------+---------------------+
+ *          |<-------53 - M bits --->|<--------M bits ----->
+ *
+ *     M - number of node offset bits (35 .. 40)
+ *
+ *
+ *  Memory/UV-HUB Processor Socket Address Format:
+ *  +----------------+---------------+---------------------+
+ *  |00..000000000000|   PNODE       |      NodeOffset     |
+ *  +----------------+---------------+---------------------+
+ *                   <--- N bits --->|<--------M bits ----->
+ *
+ *     M - number of node offset bits (35 .. 40)
+ *     N - number of PNODE bits (0 .. 10)
+ *
+ *             Note: M + N cannot currently exceed 44 (x86_64) or 46 (IA64).
+ *             The actual values are configuration dependent and are set at
+ *             boot time. M & N values are set by the hardware/BIOS at boot.
+ */
+
+
+/*
+ * Maximum number of bricks in all partitions and in all coherency domains.
+ * This is the total number of bricks accessible in the numalink fabric. It
+ * includes all C & M bricks. Routers are NOT included.
+ *
+ * This value is also the value of the maximum number of non-router NASIDs
+ * in the numalink fabric.
+ *
+ * NOTE: a brick may contain 1 or 2 OS nodes. Don't get these confused.
+ */
+#define UV_MAX_NUMALINK_BLADES 16384
+
+/*
+ * Maximum number of C/Mbricks within a software SSI (hardware may support
+ * more).
+ */
+#define UV_MAX_SSI_BLADES      1
+
+/*
+ * The largest possible NASID of a C or M brick (+ 2)
+ */
+#define UV_MAX_NASID_VALUE     (UV_MAX_NUMALINK_NODES * 2)
+
+/*
+ * The following defines attributes of the HUB chip. These attributes are
+ * frequently referenced and are kept in the per-cpu data areas of each cpu.
+ * They are kept together in a struct to minimize cache misses.
+ */
+struct uv_hub_info_s {
+       unsigned long   global_mmr_base;
+       unsigned long   gpa_mask;
+       unsigned long   gnode_upper;
+       unsigned long   lowmem_remap_top;
+       unsigned long   lowmem_remap_base;
+       unsigned short  pnode;
+       unsigned short  pnode_mask;
+       unsigned short  coherency_domain_number;
+       unsigned short  numa_blade_id;
+       unsigned char   blade_processor_id;
+       unsigned char   m_val;
+       unsigned char   n_val;
+};
+DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
+#define uv_hub_info            (&__get_cpu_var(__uv_hub_info))
+#define uv_cpu_hub_info(cpu)   (&per_cpu(__uv_hub_info, cpu))
+
+/*
+ * Local & Global MMR space macros.
+ *     Note: macros are intended to be used ONLY by inline functions
+ *     in this file - not by other kernel code.
+ *             n -  NASID (full 15-bit global nasid)
+ *             g -  GNODE (full 15-bit global nasid, right shifted 1)
+ *             p -  PNODE (local part of nsids, right shifted 1)
+ */
+#define UV_NASID_TO_PNODE(n)           (((n) >> 1) & uv_hub_info->pnode_mask)
+#define UV_PNODE_TO_NASID(p)           (((p) << 1) | uv_hub_info->gnode_upper)
+
+#define UV_LOCAL_MMR_BASE              0xf4000000UL
+#define UV_GLOBAL_MMR32_BASE           0xf8000000UL
+#define UV_GLOBAL_MMR64_BASE           (uv_hub_info->global_mmr_base)
+
+#define UV_GLOBAL_MMR32_PNODE_SHIFT    15
+#define UV_GLOBAL_MMR64_PNODE_SHIFT    26
+
+#define UV_GLOBAL_MMR32_PNODE_BITS(p)  ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
+
+#define UV_GLOBAL_MMR64_PNODE_BITS(p)                                  \
+       ((unsigned long)(p) << UV_GLOBAL_MMR64_PNODE_SHIFT)
+
+/*
+ * Macros for converting between kernel virtual addresses, socket local physical
+ * addresses, and UV global physical addresses.
+ *     Note: use the standard __pa() & __va() macros for converting
+ *           between socket virtual and socket physical addresses.
+ */
+
+/* socket phys RAM --> UV global physical address */
+static inline unsigned long uv_soc_phys_ram_to_gpa(unsigned long paddr)
+{
+       if (paddr < uv_hub_info->lowmem_remap_top)
+               paddr += uv_hub_info->lowmem_remap_base;
+       return paddr | uv_hub_info->gnode_upper;
+}
+
+
+/* socket virtual --> UV global physical address */
+static inline unsigned long uv_gpa(void *v)
+{
+       return __pa(v) | uv_hub_info->gnode_upper;
+}
+
+/* socket virtual --> UV global physical address */
+static inline void *uv_vgpa(void *v)
+{
+       return (void *)uv_gpa(v);
+}
+
+/* UV global physical address --> socket virtual */
+static inline void *uv_va(unsigned long gpa)
+{
+       return __va(gpa & uv_hub_info->gpa_mask);
+}
+
+/* pnode, offset --> socket virtual */
+static inline void *uv_pnode_offset_to_vaddr(int pnode, unsigned long offset)
+{
+       return __va(((unsigned long)pnode << uv_hub_info->m_val) | offset);
+}
+
+
+/*
+ * Access global MMRs using the low memory MMR32 space. This region supports
+ * faster MMR access but not all MMRs are accessible in this space.
+ */
+static inline unsigned long *uv_global_mmr32_address(int pnode,
+                               unsigned long offset)
+{
+       return __va(UV_GLOBAL_MMR32_BASE |
+                      UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset);
+}
+
+static inline void uv_write_global_mmr32(int pnode, unsigned long offset,
+                                unsigned long val)
+{
+       *uv_global_mmr32_address(pnode, offset) = val;
+}
+
+static inline unsigned long uv_read_global_mmr32(int pnode,
+                                                unsigned long offset)
+{
+       return *uv_global_mmr32_address(pnode, offset);
+}
+
+/*
+ * Access Global MMR space using the MMR space located at the top of physical
+ * memory.
+ */
+static inline unsigned long *uv_global_mmr64_address(int pnode,
+                               unsigned long offset)
+{
+       return __va(UV_GLOBAL_MMR64_BASE |
+                   UV_GLOBAL_MMR64_PNODE_BITS(pnode) | offset);
+}
+
+static inline void uv_write_global_mmr64(int pnode, unsigned long offset,
+                               unsigned long val)
+{
+       *uv_global_mmr64_address(pnode, offset) = val;
+}
+
+static inline unsigned long uv_read_global_mmr64(int pnode,
+                                                unsigned long offset)
+{
+       return *uv_global_mmr64_address(pnode, offset);
+}
+
+/*
+ * Access hub local MMRs. Faster than using global space but only local MMRs
+ * are accessible.
+ */
+static inline unsigned long *uv_local_mmr_address(unsigned long offset)
+{
+       return __va(UV_LOCAL_MMR_BASE | offset);
+}
+
+static inline unsigned long uv_read_local_mmr(unsigned long offset)
+{
+       return *uv_local_mmr_address(offset);
+}
+
+static inline void uv_write_local_mmr(unsigned long offset, unsigned long val)
+{
+       *uv_local_mmr_address(offset) = val;
+}
+
+/*
+ * Structures and definitions for converting between cpu, node, pnode, and blade
+ * numbers.
+ */
+
+/* Blade-local cpu number of current cpu. Numbered 0 .. <# cpus on the blade> */
+static inline int uv_blade_processor_id(void)
+{
+       return smp_processor_id();
+}
+
+/* Blade number of current cpu. Numnbered 0 .. <#blades -1> */
+static inline int uv_numa_blade_id(void)
+{
+       return 0;
+}
+
+/* Convert a cpu number to the the UV blade number */
+static inline int uv_cpu_to_blade_id(int cpu)
+{
+       return 0;
+}
+
+/* Convert linux node number to the UV blade number */
+static inline int uv_node_to_blade_id(int nid)
+{
+       return 0;
+}
+
+/* Convert a blade id to the PNODE of the blade */
+static inline int uv_blade_to_pnode(int bid)
+{
+       return 0;
+}
+
+/* Determine the number of possible cpus on a blade */
+static inline int uv_blade_nr_possible_cpus(int bid)
+{
+       return num_possible_cpus();
+}
+
+/* Determine the number of online cpus on a blade */
+static inline int uv_blade_nr_online_cpus(int bid)
+{
+       return num_online_cpus();
+}
+
+/* Convert a cpu id to the PNODE of the blade containing the cpu */
+static inline int uv_cpu_to_pnode(int cpu)
+{
+       return 0;
+}
+
+/* Convert a linux node number to the PNODE of the blade */
+static inline int uv_node_to_pnode(int nid)
+{
+       return 0;
+}
+
+/* Maximum possible number of blades */
+static inline int uv_num_possible_blades(void)
+{
+       return 1;
+}
+
+#endif /* __ASM_IA64_UV_HUB__ */
+
diff --git a/arch/ia64/include/asm/uv/uv_mmrs.h b/arch/ia64/include/asm/uv/uv_mmrs.h
new file mode 100644 (file)
index 0000000..c149ef0
--- /dev/null
@@ -0,0 +1,673 @@
+/*
+ * 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.
+ *
+ * SGI UV MMR definitions
+ *
+ * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
+ */
+
+#ifndef __ASM_IA64_UV_MMRS__
+#define __ASM_IA64_UV_MMRS__
+
+#define UV_MMR_ENABLE          (1UL << 63)
+
+/* ========================================================================= */
+/*                           UVH_BAU_DATA_CONFIG                             */
+/* ========================================================================= */
+#define UVH_BAU_DATA_CONFIG 0x61680UL
+#define UVH_BAU_DATA_CONFIG_32 0x0438
+
+#define UVH_BAU_DATA_CONFIG_VECTOR_SHFT 0
+#define UVH_BAU_DATA_CONFIG_VECTOR_MASK 0x00000000000000ffUL
+#define UVH_BAU_DATA_CONFIG_DM_SHFT 8
+#define UVH_BAU_DATA_CONFIG_DM_MASK 0x0000000000000700UL
+#define UVH_BAU_DATA_CONFIG_DESTMODE_SHFT 11
+#define UVH_BAU_DATA_CONFIG_DESTMODE_MASK 0x0000000000000800UL
+#define UVH_BAU_DATA_CONFIG_STATUS_SHFT 12
+#define UVH_BAU_DATA_CONFIG_STATUS_MASK 0x0000000000001000UL
+#define UVH_BAU_DATA_CONFIG_P_SHFT 13
+#define UVH_BAU_DATA_CONFIG_P_MASK 0x0000000000002000UL
+#define UVH_BAU_DATA_CONFIG_T_SHFT 15
+#define UVH_BAU_DATA_CONFIG_T_MASK 0x0000000000008000UL
+#define UVH_BAU_DATA_CONFIG_M_SHFT 16
+#define UVH_BAU_DATA_CONFIG_M_MASK 0x0000000000010000UL
+#define UVH_BAU_DATA_CONFIG_APIC_ID_SHFT 32
+#define UVH_BAU_DATA_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
+
+union uvh_bau_data_config_u {
+    unsigned long      v;
+    struct uvh_bau_data_config_s {
+       unsigned long   vector_  :  8;  /* RW */
+       unsigned long   dm       :  3;  /* RW */
+       unsigned long   destmode :  1;  /* RW */
+       unsigned long   status   :  1;  /* RO */
+       unsigned long   p        :  1;  /* RO */
+       unsigned long   rsvd_14  :  1;  /*    */
+       unsigned long   t        :  1;  /* RO */
+       unsigned long   m        :  1;  /* RW */
+       unsigned long   rsvd_17_31: 15;  /*    */
+       unsigned long   apic_id  : 32;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                           UVH_EVENT_OCCURRED0                             */
+/* ========================================================================= */
+#define UVH_EVENT_OCCURRED0 0x70000UL
+#define UVH_EVENT_OCCURRED0_32 0x005e8
+
+#define UVH_EVENT_OCCURRED0_LB_HCERR_SHFT 0
+#define UVH_EVENT_OCCURRED0_LB_HCERR_MASK 0x0000000000000001UL
+#define UVH_EVENT_OCCURRED0_GR0_HCERR_SHFT 1
+#define UVH_EVENT_OCCURRED0_GR0_HCERR_MASK 0x0000000000000002UL
+#define UVH_EVENT_OCCURRED0_GR1_HCERR_SHFT 2
+#define UVH_EVENT_OCCURRED0_GR1_HCERR_MASK 0x0000000000000004UL
+#define UVH_EVENT_OCCURRED0_LH_HCERR_SHFT 3
+#define UVH_EVENT_OCCURRED0_LH_HCERR_MASK 0x0000000000000008UL
+#define UVH_EVENT_OCCURRED0_RH_HCERR_SHFT 4
+#define UVH_EVENT_OCCURRED0_RH_HCERR_MASK 0x0000000000000010UL
+#define UVH_EVENT_OCCURRED0_XN_HCERR_SHFT 5
+#define UVH_EVENT_OCCURRED0_XN_HCERR_MASK 0x0000000000000020UL
+#define UVH_EVENT_OCCURRED0_SI_HCERR_SHFT 6
+#define UVH_EVENT_OCCURRED0_SI_HCERR_MASK 0x0000000000000040UL
+#define UVH_EVENT_OCCURRED0_LB_AOERR0_SHFT 7
+#define UVH_EVENT_OCCURRED0_LB_AOERR0_MASK 0x0000000000000080UL
+#define UVH_EVENT_OCCURRED0_GR0_AOERR0_SHFT 8
+#define UVH_EVENT_OCCURRED0_GR0_AOERR0_MASK 0x0000000000000100UL
+#define UVH_EVENT_OCCURRED0_GR1_AOERR0_SHFT 9
+#define UVH_EVENT_OCCURRED0_GR1_AOERR0_MASK 0x0000000000000200UL
+#define UVH_EVENT_OCCURRED0_LH_AOERR0_SHFT 10
+#define UVH_EVENT_OCCURRED0_LH_AOERR0_MASK 0x0000000000000400UL
+#define UVH_EVENT_OCCURRED0_RH_AOERR0_SHFT 11
+#define UVH_EVENT_OCCURRED0_RH_AOERR0_MASK 0x0000000000000800UL
+#define UVH_EVENT_OCCURRED0_XN_AOERR0_SHFT 12
+#define UVH_EVENT_OCCURRED0_XN_AOERR0_MASK 0x0000000000001000UL
+#define UVH_EVENT_OCCURRED0_SI_AOERR0_SHFT 13
+#define UVH_EVENT_OCCURRED0_SI_AOERR0_MASK 0x0000000000002000UL
+#define UVH_EVENT_OCCURRED0_LB_AOERR1_SHFT 14
+#define UVH_EVENT_OCCURRED0_LB_AOERR1_MASK 0x0000000000004000UL
+#define UVH_EVENT_OCCURRED0_GR0_AOERR1_SHFT 15
+#define UVH_EVENT_OCCURRED0_GR0_AOERR1_MASK 0x0000000000008000UL
+#define UVH_EVENT_OCCURRED0_GR1_AOERR1_SHFT 16
+#define UVH_EVENT_OCCURRED0_GR1_AOERR1_MASK 0x0000000000010000UL
+#define UVH_EVENT_OCCURRED0_LH_AOERR1_SHFT 17
+#define UVH_EVENT_OCCURRED0_LH_AOERR1_MASK 0x0000000000020000UL
+#define UVH_EVENT_OCCURRED0_RH_AOERR1_SHFT 18
+#define UVH_EVENT_OCCURRED0_RH_AOERR1_MASK 0x0000000000040000UL
+#define UVH_EVENT_OCCURRED0_XN_AOERR1_SHFT 19
+#define UVH_EVENT_OCCURRED0_XN_AOERR1_MASK 0x0000000000080000UL
+#define UVH_EVENT_OCCURRED0_SI_AOERR1_SHFT 20
+#define UVH_EVENT_OCCURRED0_SI_AOERR1_MASK 0x0000000000100000UL
+#define UVH_EVENT_OCCURRED0_RH_VPI_INT_SHFT 21
+#define UVH_EVENT_OCCURRED0_RH_VPI_INT_MASK 0x0000000000200000UL
+#define UVH_EVENT_OCCURRED0_SYSTEM_SHUTDOWN_INT_SHFT 22
+#define UVH_EVENT_OCCURRED0_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000400000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_0_SHFT 23
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_0_MASK 0x0000000000800000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_1_SHFT 24
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_1_MASK 0x0000000001000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_2_SHFT 25
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_2_MASK 0x0000000002000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_3_SHFT 26
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_3_MASK 0x0000000004000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_4_SHFT 27
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_4_MASK 0x0000000008000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_5_SHFT 28
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_5_MASK 0x0000000010000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_6_SHFT 29
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_6_MASK 0x0000000020000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_7_SHFT 30
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_7_MASK 0x0000000040000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_8_SHFT 31
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_8_MASK 0x0000000080000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_9_SHFT 32
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_9_MASK 0x0000000100000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_10_SHFT 33
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_10_MASK 0x0000000200000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_11_SHFT 34
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_11_MASK 0x0000000400000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_12_SHFT 35
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_12_MASK 0x0000000800000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_13_SHFT 36
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_13_MASK 0x0000001000000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_14_SHFT 37
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_14_MASK 0x0000002000000000UL
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_15_SHFT 38
+#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_15_MASK 0x0000004000000000UL
+#define UVH_EVENT_OCCURRED0_L1_NMI_INT_SHFT 39
+#define UVH_EVENT_OCCURRED0_L1_NMI_INT_MASK 0x0000008000000000UL
+#define UVH_EVENT_OCCURRED0_STOP_CLOCK_SHFT 40
+#define UVH_EVENT_OCCURRED0_STOP_CLOCK_MASK 0x0000010000000000UL
+#define UVH_EVENT_OCCURRED0_ASIC_TO_L1_SHFT 41
+#define UVH_EVENT_OCCURRED0_ASIC_TO_L1_MASK 0x0000020000000000UL
+#define UVH_EVENT_OCCURRED0_L1_TO_ASIC_SHFT 42
+#define UVH_EVENT_OCCURRED0_L1_TO_ASIC_MASK 0x0000040000000000UL
+#define UVH_EVENT_OCCURRED0_LTC_INT_SHFT 43
+#define UVH_EVENT_OCCURRED0_LTC_INT_MASK 0x0000080000000000UL
+#define UVH_EVENT_OCCURRED0_LA_SEQ_TRIGGER_SHFT 44
+#define UVH_EVENT_OCCURRED0_LA_SEQ_TRIGGER_MASK 0x0000100000000000UL
+#define UVH_EVENT_OCCURRED0_IPI_INT_SHFT 45
+#define UVH_EVENT_OCCURRED0_IPI_INT_MASK 0x0000200000000000UL
+#define UVH_EVENT_OCCURRED0_EXTIO_INT0_SHFT 46
+#define UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK 0x0000400000000000UL
+#define UVH_EVENT_OCCURRED0_EXTIO_INT1_SHFT 47
+#define UVH_EVENT_OCCURRED0_EXTIO_INT1_MASK 0x0000800000000000UL
+#define UVH_EVENT_OCCURRED0_EXTIO_INT2_SHFT 48
+#define UVH_EVENT_OCCURRED0_EXTIO_INT2_MASK 0x0001000000000000UL
+#define UVH_EVENT_OCCURRED0_EXTIO_INT3_SHFT 49
+#define UVH_EVENT_OCCURRED0_EXTIO_INT3_MASK 0x0002000000000000UL
+#define UVH_EVENT_OCCURRED0_PROFILE_INT_SHFT 50
+#define UVH_EVENT_OCCURRED0_PROFILE_INT_MASK 0x0004000000000000UL
+#define UVH_EVENT_OCCURRED0_RTC0_SHFT 51
+#define UVH_EVENT_OCCURRED0_RTC0_MASK 0x0008000000000000UL
+#define UVH_EVENT_OCCURRED0_RTC1_SHFT 52
+#define UVH_EVENT_OCCURRED0_RTC1_MASK 0x0010000000000000UL
+#define UVH_EVENT_OCCURRED0_RTC2_SHFT 53
+#define UVH_EVENT_OCCURRED0_RTC2_MASK 0x0020000000000000UL
+#define UVH_EVENT_OCCURRED0_RTC3_SHFT 54
+#define UVH_EVENT_OCCURRED0_RTC3_MASK 0x0040000000000000UL
+#define UVH_EVENT_OCCURRED0_BAU_DATA_SHFT 55
+#define UVH_EVENT_OCCURRED0_BAU_DATA_MASK 0x0080000000000000UL
+#define UVH_EVENT_OCCURRED0_POWER_MANAGEMENT_REQ_SHFT 56
+#define UVH_EVENT_OCCURRED0_POWER_MANAGEMENT_REQ_MASK 0x0100000000000000UL
+union uvh_event_occurred0_u {
+    unsigned long      v;
+    struct uvh_event_occurred0_s {
+       unsigned long   lb_hcerr             :  1;  /* RW, W1C */
+       unsigned long   gr0_hcerr            :  1;  /* RW, W1C */
+       unsigned long   gr1_hcerr            :  1;  /* RW, W1C */
+       unsigned long   lh_hcerr             :  1;  /* RW, W1C */
+       unsigned long   rh_hcerr             :  1;  /* RW, W1C */
+       unsigned long   xn_hcerr             :  1;  /* RW, W1C */
+       unsigned long   si_hcerr             :  1;  /* RW, W1C */
+       unsigned long   lb_aoerr0            :  1;  /* RW, W1C */
+       unsigned long   gr0_aoerr0           :  1;  /* RW, W1C */
+       unsigned long   gr1_aoerr0           :  1;  /* RW, W1C */
+       unsigned long   lh_aoerr0            :  1;  /* RW, W1C */
+       unsigned long   rh_aoerr0            :  1;  /* RW, W1C */
+       unsigned long   xn_aoerr0            :  1;  /* RW, W1C */
+       unsigned long   si_aoerr0            :  1;  /* RW, W1C */
+       unsigned long   lb_aoerr1            :  1;  /* RW, W1C */
+       unsigned long   gr0_aoerr1           :  1;  /* RW, W1C */
+       unsigned long   gr1_aoerr1           :  1;  /* RW, W1C */
+       unsigned long   lh_aoerr1            :  1;  /* RW, W1C */
+       unsigned long   rh_aoerr1            :  1;  /* RW, W1C */
+       unsigned long   xn_aoerr1            :  1;  /* RW, W1C */
+       unsigned long   si_aoerr1            :  1;  /* RW, W1C */
+       unsigned long   rh_vpi_int           :  1;  /* RW, W1C */
+       unsigned long   system_shutdown_int  :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_0         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_1         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_2         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_3         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_4         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_5         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_6         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_7         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_8         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_9         :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_10        :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_11        :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_12        :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_13        :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_14        :  1;  /* RW, W1C */
+       unsigned long   lb_irq_int_15        :  1;  /* RW, W1C */
+       unsigned long   l1_nmi_int           :  1;  /* RW, W1C */
+       unsigned long   stop_clock           :  1;  /* RW, W1C */
+       unsigned long   asic_to_l1           :  1;  /* RW, W1C */
+       unsigned long   l1_to_asic           :  1;  /* RW, W1C */
+       unsigned long   ltc_int              :  1;  /* RW, W1C */
+       unsigned long   la_seq_trigger       :  1;  /* RW, W1C */
+       unsigned long   ipi_int              :  1;  /* RW, W1C */
+       unsigned long   extio_int0           :  1;  /* RW, W1C */
+       unsigned long   extio_int1           :  1;  /* RW, W1C */
+       unsigned long   extio_int2           :  1;  /* RW, W1C */
+       unsigned long   extio_int3           :  1;  /* RW, W1C */
+       unsigned long   profile_int          :  1;  /* RW, W1C */
+       unsigned long   rtc0                 :  1;  /* RW, W1C */
+       unsigned long   rtc1                 :  1;  /* RW, W1C */
+       unsigned long   rtc2                 :  1;  /* RW, W1C */
+       unsigned long   rtc3                 :  1;  /* RW, W1C */
+       unsigned long   bau_data             :  1;  /* RW, W1C */
+       unsigned long   power_management_req :  1;  /* RW, W1C */
+       unsigned long   rsvd_57_63           :  7;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                        UVH_EVENT_OCCURRED0_ALIAS                          */
+/* ========================================================================= */
+#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
+#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
+
+/* ========================================================================= */
+/*                               UVH_INT_CMPB                                */
+/* ========================================================================= */
+#define UVH_INT_CMPB 0x22080UL
+
+#define UVH_INT_CMPB_REAL_TIME_CMPB_SHFT 0
+#define UVH_INT_CMPB_REAL_TIME_CMPB_MASK 0x00ffffffffffffffUL
+
+union uvh_int_cmpb_u {
+    unsigned long      v;
+    struct uvh_int_cmpb_s {
+       unsigned long   real_time_cmpb : 56;  /* RW */
+       unsigned long   rsvd_56_63     :  8;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                               UVH_INT_CMPC                                */
+/* ========================================================================= */
+#define UVH_INT_CMPC 0x22100UL
+
+#define UVH_INT_CMPC_REAL_TIME_CMPC_SHFT 0
+#define UVH_INT_CMPC_REAL_TIME_CMPC_MASK 0x00ffffffffffffffUL
+
+union uvh_int_cmpc_u {
+    unsigned long      v;
+    struct uvh_int_cmpc_s {
+       unsigned long   real_time_cmpc : 56;  /* RW */
+       unsigned long   rsvd_56_63     :  8;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                               UVH_INT_CMPD                                */
+/* ========================================================================= */
+#define UVH_INT_CMPD 0x22180UL
+
+#define UVH_INT_CMPD_REAL_TIME_CMPD_SHFT 0
+#define UVH_INT_CMPD_REAL_TIME_CMPD_MASK 0x00ffffffffffffffUL
+
+union uvh_int_cmpd_u {
+    unsigned long      v;
+    struct uvh_int_cmpd_s {
+       unsigned long   real_time_cmpd : 56;  /* RW */
+       unsigned long   rsvd_56_63     :  8;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                               UVH_NODE_ID                                 */
+/* ========================================================================= */
+#define UVH_NODE_ID 0x0UL
+
+#define UVH_NODE_ID_FORCE1_SHFT 0
+#define UVH_NODE_ID_FORCE1_MASK 0x0000000000000001UL
+#define UVH_NODE_ID_MANUFACTURER_SHFT 1
+#define UVH_NODE_ID_MANUFACTURER_MASK 0x0000000000000ffeUL
+#define UVH_NODE_ID_PART_NUMBER_SHFT 12
+#define UVH_NODE_ID_PART_NUMBER_MASK 0x000000000ffff000UL
+#define UVH_NODE_ID_REVISION_SHFT 28
+#define UVH_NODE_ID_REVISION_MASK 0x00000000f0000000UL
+#define UVH_NODE_ID_NODE_ID_SHFT 32
+#define UVH_NODE_ID_NODE_ID_MASK 0x00007fff00000000UL
+#define UVH_NODE_ID_NODES_PER_BIT_SHFT 48
+#define UVH_NODE_ID_NODES_PER_BIT_MASK 0x007f000000000000UL
+#define UVH_NODE_ID_NI_PORT_SHFT 56
+#define UVH_NODE_ID_NI_PORT_MASK 0x0f00000000000000UL
+
+union uvh_node_id_u {
+    unsigned long      v;
+    struct uvh_node_id_s {
+       unsigned long   force1        :  1;  /* RO */
+       unsigned long   manufacturer  : 11;  /* RO */
+       unsigned long   part_number   : 16;  /* RO */
+       unsigned long   revision      :  4;  /* RO */
+       unsigned long   node_id       : 15;  /* RW */
+       unsigned long   rsvd_47       :  1;  /*    */
+       unsigned long   nodes_per_bit :  7;  /* RW */
+       unsigned long   rsvd_55       :  1;  /*    */
+       unsigned long   ni_port       :  4;  /* RO */
+       unsigned long   rsvd_60_63    :  4;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR                  */
+/* ========================================================================= */
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR 0x16000d0UL
+
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT 24
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_MASK 0x00003fffff000000UL
+
+union uvh_rh_gam_alias210_redirect_config_0_mmr_u {
+    unsigned long      v;
+    struct uvh_rh_gam_alias210_redirect_config_0_mmr_s {
+       unsigned long   rsvd_0_23 : 24;  /*    */
+       unsigned long   dest_base : 22;  /* RW */
+       unsigned long   rsvd_46_63: 18;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR                  */
+/* ========================================================================= */
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR 0x16000e0UL
+
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR_DEST_BASE_SHFT 24
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR_DEST_BASE_MASK 0x00003fffff000000UL
+
+union uvh_rh_gam_alias210_redirect_config_1_mmr_u {
+    unsigned long      v;
+    struct uvh_rh_gam_alias210_redirect_config_1_mmr_s {
+       unsigned long   rsvd_0_23 : 24;  /*    */
+       unsigned long   dest_base : 22;  /* RW */
+       unsigned long   rsvd_46_63: 18;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR                  */
+/* ========================================================================= */
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR 0x16000f0UL
+
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR_DEST_BASE_SHFT 24
+#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR_DEST_BASE_MASK 0x00003fffff000000UL
+
+union uvh_rh_gam_alias210_redirect_config_2_mmr_u {
+    unsigned long      v;
+    struct uvh_rh_gam_alias210_redirect_config_2_mmr_s {
+       unsigned long   rsvd_0_23 : 24;  /*    */
+       unsigned long   dest_base : 22;  /* RW */
+       unsigned long   rsvd_46_63: 18;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                    UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR                      */
+/* ========================================================================= */
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR 0x1600010UL
+
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_SHFT 28
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_MASK 0x00003ffff0000000UL
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_GR4_SHFT 48
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_GR4_MASK 0x0001000000000000UL
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_N_GRU_SHFT 52
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_N_GRU_MASK 0x00f0000000000000UL
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_ENABLE_SHFT 63
+#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_ENABLE_MASK 0x8000000000000000UL
+
+union uvh_rh_gam_gru_overlay_config_mmr_u {
+    unsigned long      v;
+    struct uvh_rh_gam_gru_overlay_config_mmr_s {
+       unsigned long   rsvd_0_27: 28;  /*    */
+       unsigned long   base   : 18;  /* RW */
+       unsigned long   rsvd_46_47:  2;  /*    */
+       unsigned long   gr4    :  1;  /* RW */
+       unsigned long   rsvd_49_51:  3;  /*    */
+       unsigned long   n_gru  :  4;  /* RW */
+       unsigned long   rsvd_56_62:  7;  /*    */
+       unsigned long   enable :  1;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                    UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR                      */
+/* ========================================================================= */
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR 0x1600028UL
+
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT 26
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_MASK 0x00003ffffc000000UL
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_DUAL_HUB_SHFT 46
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_DUAL_HUB_MASK 0x0000400000000000UL
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_ENABLE_SHFT 63
+#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_ENABLE_MASK 0x8000000000000000UL
+
+union uvh_rh_gam_mmr_overlay_config_mmr_u {
+    unsigned long      v;
+    struct uvh_rh_gam_mmr_overlay_config_mmr_s {
+       unsigned long   rsvd_0_25: 26;  /*    */
+       unsigned long   base     : 20;  /* RW */
+       unsigned long   dual_hub :  1;  /* RW */
+       unsigned long   rsvd_47_62: 16;  /*    */
+       unsigned long   enable   :  1;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                                 UVH_RTC                                   */
+/* ========================================================================= */
+#define UVH_RTC 0x340000UL
+
+#define UVH_RTC_REAL_TIME_CLOCK_SHFT 0
+#define UVH_RTC_REAL_TIME_CLOCK_MASK 0x00ffffffffffffffUL
+
+union uvh_rtc_u {
+    unsigned long      v;
+    struct uvh_rtc_s {
+       unsigned long   real_time_clock : 56;  /* RW */
+       unsigned long   rsvd_56_63      :  8;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                           UVH_RTC1_INT_CONFIG                             */
+/* ========================================================================= */
+#define UVH_RTC1_INT_CONFIG 0x615c0UL
+
+#define UVH_RTC1_INT_CONFIG_VECTOR_SHFT 0
+#define UVH_RTC1_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
+#define UVH_RTC1_INT_CONFIG_DM_SHFT 8
+#define UVH_RTC1_INT_CONFIG_DM_MASK 0x0000000000000700UL
+#define UVH_RTC1_INT_CONFIG_DESTMODE_SHFT 11
+#define UVH_RTC1_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
+#define UVH_RTC1_INT_CONFIG_STATUS_SHFT 12
+#define UVH_RTC1_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
+#define UVH_RTC1_INT_CONFIG_P_SHFT 13
+#define UVH_RTC1_INT_CONFIG_P_MASK 0x0000000000002000UL
+#define UVH_RTC1_INT_CONFIG_T_SHFT 15
+#define UVH_RTC1_INT_CONFIG_T_MASK 0x0000000000008000UL
+#define UVH_RTC1_INT_CONFIG_M_SHFT 16
+#define UVH_RTC1_INT_CONFIG_M_MASK 0x0000000000010000UL
+#define UVH_RTC1_INT_CONFIG_APIC_ID_SHFT 32
+#define UVH_RTC1_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
+
+union uvh_rtc1_int_config_u {
+    unsigned long      v;
+    struct uvh_rtc1_int_config_s {
+       unsigned long   vector_  :  8;  /* RW */
+       unsigned long   dm       :  3;  /* RW */
+       unsigned long   destmode :  1;  /* RW */
+       unsigned long   status   :  1;  /* RO */
+       unsigned long   p        :  1;  /* RO */
+       unsigned long   rsvd_14  :  1;  /*    */
+       unsigned long   t        :  1;  /* RO */
+       unsigned long   m        :  1;  /* RW */
+       unsigned long   rsvd_17_31: 15;  /*    */
+       unsigned long   apic_id  : 32;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                           UVH_RTC2_INT_CONFIG                             */
+/* ========================================================================= */
+#define UVH_RTC2_INT_CONFIG 0x61600UL
+
+#define UVH_RTC2_INT_CONFIG_VECTOR_SHFT 0
+#define UVH_RTC2_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
+#define UVH_RTC2_INT_CONFIG_DM_SHFT 8
+#define UVH_RTC2_INT_CONFIG_DM_MASK 0x0000000000000700UL
+#define UVH_RTC2_INT_CONFIG_DESTMODE_SHFT 11
+#define UVH_RTC2_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
+#define UVH_RTC2_INT_CONFIG_STATUS_SHFT 12
+#define UVH_RTC2_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
+#define UVH_RTC2_INT_CONFIG_P_SHFT 13
+#define UVH_RTC2_INT_CONFIG_P_MASK 0x0000000000002000UL
+#define UVH_RTC2_INT_CONFIG_T_SHFT 15
+#define UVH_RTC2_INT_CONFIG_T_MASK 0x0000000000008000UL
+#define UVH_RTC2_INT_CONFIG_M_SHFT 16
+#define UVH_RTC2_INT_CONFIG_M_MASK 0x0000000000010000UL
+#define UVH_RTC2_INT_CONFIG_APIC_ID_SHFT 32
+#define UVH_RTC2_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
+
+union uvh_rtc2_int_config_u {
+    unsigned long      v;
+    struct uvh_rtc2_int_config_s {
+       unsigned long   vector_  :  8;  /* RW */
+       unsigned long   dm       :  3;  /* RW */
+       unsigned long   destmode :  1;  /* RW */
+       unsigned long   status   :  1;  /* RO */
+       unsigned long   p        :  1;  /* RO */
+       unsigned long   rsvd_14  :  1;  /*    */
+       unsigned long   t        :  1;  /* RO */
+       unsigned long   m        :  1;  /* RW */
+       unsigned long   rsvd_17_31: 15;  /*    */
+       unsigned long   apic_id  : 32;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                           UVH_RTC3_INT_CONFIG                             */
+/* ========================================================================= */
+#define UVH_RTC3_INT_CONFIG 0x61640UL
+
+#define UVH_RTC3_INT_CONFIG_VECTOR_SHFT 0
+#define UVH_RTC3_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
+#define UVH_RTC3_INT_CONFIG_DM_SHFT 8
+#define UVH_RTC3_INT_CONFIG_DM_MASK 0x0000000000000700UL
+#define UVH_RTC3_INT_CONFIG_DESTMODE_SHFT 11
+#define UVH_RTC3_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
+#define UVH_RTC3_INT_CONFIG_STATUS_SHFT 12
+#define UVH_RTC3_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
+#define UVH_RTC3_INT_CONFIG_P_SHFT 13
+#define UVH_RTC3_INT_CONFIG_P_MASK 0x0000000000002000UL
+#define UVH_RTC3_INT_CONFIG_T_SHFT 15
+#define UVH_RTC3_INT_CONFIG_T_MASK 0x0000000000008000UL
+#define UVH_RTC3_INT_CONFIG_M_SHFT 16
+#define UVH_RTC3_INT_CONFIG_M_MASK 0x0000000000010000UL
+#define UVH_RTC3_INT_CONFIG_APIC_ID_SHFT 32
+#define UVH_RTC3_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
+
+union uvh_rtc3_int_config_u {
+    unsigned long      v;
+    struct uvh_rtc3_int_config_s {
+       unsigned long   vector_  :  8;  /* RW */
+       unsigned long   dm       :  3;  /* RW */
+       unsigned long   destmode :  1;  /* RW */
+       unsigned long   status   :  1;  /* RO */
+       unsigned long   p        :  1;  /* RO */
+       unsigned long   rsvd_14  :  1;  /*    */
+       unsigned long   t        :  1;  /* RO */
+       unsigned long   m        :  1;  /* RW */
+       unsigned long   rsvd_17_31: 15;  /*    */
+       unsigned long   apic_id  : 32;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                            UVH_RTC_INC_RATIO                              */
+/* ========================================================================= */
+#define UVH_RTC_INC_RATIO 0x350000UL
+
+#define UVH_RTC_INC_RATIO_FRACTION_SHFT 0
+#define UVH_RTC_INC_RATIO_FRACTION_MASK 0x00000000000fffffUL
+#define UVH_RTC_INC_RATIO_RATIO_SHFT 20
+#define UVH_RTC_INC_RATIO_RATIO_MASK 0x0000000000700000UL
+
+union uvh_rtc_inc_ratio_u {
+    unsigned long      v;
+    struct uvh_rtc_inc_ratio_s {
+       unsigned long   fraction : 20;  /* RW */
+       unsigned long   ratio    :  3;  /* RW */
+       unsigned long   rsvd_23_63: 41;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                          UVH_SI_ADDR_MAP_CONFIG                           */
+/* ========================================================================= */
+#define UVH_SI_ADDR_MAP_CONFIG 0xc80000UL
+
+#define UVH_SI_ADDR_MAP_CONFIG_M_SKT_SHFT 0
+#define UVH_SI_ADDR_MAP_CONFIG_M_SKT_MASK 0x000000000000003fUL
+#define UVH_SI_ADDR_MAP_CONFIG_N_SKT_SHFT 8
+#define UVH_SI_ADDR_MAP_CONFIG_N_SKT_MASK 0x0000000000000f00UL
+
+union uvh_si_addr_map_config_u {
+    unsigned long      v;
+    struct uvh_si_addr_map_config_s {
+       unsigned long   m_skt :  6;  /* RW */
+       unsigned long   rsvd_6_7:  2;  /*    */
+       unsigned long   n_skt :  4;  /* RW */
+       unsigned long   rsvd_12_63: 52;  /*    */
+    } s;
+};
+
+/* ========================================================================= */
+/*                       UVH_SI_ALIAS0_OVERLAY_CONFIG                        */
+/* ========================================================================= */
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG 0xc80008UL
+
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_SHFT 24
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_SHFT 48
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_SHFT 63
+#define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
+
+union uvh_si_alias0_overlay_config_u {
+    unsigned long      v;
+    struct uvh_si_alias0_overlay_config_s {
+       unsigned long   rsvd_0_23: 24;  /*    */
+       unsigned long   base    :  8;  /* RW */
+       unsigned long   rsvd_32_47: 16;  /*    */
+       unsigned long   m_alias :  5;  /* RW */
+       unsigned long   rsvd_53_62: 10;  /*    */
+       unsigned long   enable  :  1;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                       UVH_SI_ALIAS1_OVERLAY_CONFIG                        */
+/* ========================================================================= */
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG 0xc80010UL
+
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_SHFT 24
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_SHFT 48
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_SHFT 63
+#define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
+
+union uvh_si_alias1_overlay_config_u {
+    unsigned long      v;
+    struct uvh_si_alias1_overlay_config_s {
+       unsigned long   rsvd_0_23: 24;  /*    */
+       unsigned long   base    :  8;  /* RW */
+       unsigned long   rsvd_32_47: 16;  /*    */
+       unsigned long   m_alias :  5;  /* RW */
+       unsigned long   rsvd_53_62: 10;  /*    */
+       unsigned long   enable  :  1;  /* RW */
+    } s;
+};
+
+/* ========================================================================= */
+/*                       UVH_SI_ALIAS2_OVERLAY_CONFIG                        */
+/* ========================================================================= */
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG 0xc80018UL
+
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_SHFT 24
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_SHFT 48
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_SHFT 63
+#define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
+
+union uvh_si_alias2_overlay_config_u {
+    unsigned long      v;
+    struct uvh_si_alias2_overlay_config_s {
+       unsigned long   rsvd_0_23: 24;  /*    */
+       unsigned long   base    :  8;  /* RW */
+       unsigned long   rsvd_32_47: 16;  /*    */
+       unsigned long   m_alias :  5;  /* RW */
+       unsigned long   rsvd_53_62: 10;  /*    */
+       unsigned long   enable  :  1;  /* RW */
+    } s;
+};
+
+
+#endif /* __ASM_IA64_UV_MMRS__ */
diff --git a/arch/ia64/include/asm/vga.h b/arch/ia64/include/asm/vga.h
new file mode 100644 (file)
index 0000000..02184ec
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *     Access to VGA videoram
+ *
+ *     (c) 1998 Martin Mares <mj@ucw.cz>
+ *     (c) 1999 Asit Mallick <asit.k.mallick@intel.com>
+ *     (c) 1999 Don Dugger <don.dugger@intel.com>
+ */
+
+#ifndef __ASM_IA64_VGA_H_
+#define __ASM_IA64_VGA_H_
+
+/*
+ * On the PC, we can just recalculate addresses and then access the
+ * videoram directly without any black magic.
+ */
+
+extern unsigned long vga_console_iobase;
+extern unsigned long vga_console_membase;
+
+#define VGA_MAP_MEM(x,s)       ((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
+
+#define vga_readb(x)   (*(x))
+#define vga_writeb(x,y)        (*(y) = (x))
+
+#endif /* __ASM_IA64_VGA_H_ */
diff --git a/arch/ia64/include/asm/xor.h b/arch/ia64/include/asm/xor.h
new file mode 100644 (file)
index 0000000..a349e23
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Optimized RAID-5 checksumming functions for IA-64.
+ *
+ * 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_ia64_2(unsigned long, unsigned long *, unsigned long *);
+extern void xor_ia64_3(unsigned long, unsigned long *, unsigned long *,
+                      unsigned long *);
+extern void xor_ia64_4(unsigned long, unsigned long *, unsigned long *,
+                      unsigned long *, unsigned long *);
+extern void xor_ia64_5(unsigned long, unsigned long *, unsigned long *,
+                      unsigned long *, unsigned long *, unsigned long *);
+
+static struct xor_block_template xor_block_ia64 = {
+       .name = "ia64",
+       .do_2 = xor_ia64_2,
+       .do_3 = xor_ia64_3,
+       .do_4 = xor_ia64_4,
+       .do_5 = xor_ia64_5,
+};
+
+#define XOR_TRY_TEMPLATES      xor_speed(&xor_block_ia64)
index c64a55af9b95b43651dd2c4e0cf281e8422c99d2..94c44b1ccfd0de7fb136247756b4ea1a4e08c4e1 100644 (file)
 #include <linux/pid.h>
 #include <linux/clocksource.h>
 #include <linux/kbuild.h>
-#include <asm-ia64/processor.h>
-#include <asm-ia64/ptrace.h>
-#include <asm-ia64/siginfo.h>
-#include <asm-ia64/sigcontext.h>
-#include <asm-ia64/mca.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+#include <asm/siginfo.h>
+#include <asm/sigcontext.h>
+#include <asm/mca.h>
 
 #include "../kernel/sigframe.h"
 #include "../kernel/fsyscall_gtod_data.h"
index db540e58c783b9e43a7d2b99b0843a6089c470df..41c712917ff706b595ee1683b3e6fdbcf0b46efe 100644 (file)
@@ -1123,7 +1123,7 @@ SET_REG(b5);
         *   p15    - used to track flag status.
         *
         * If you patch this code to use more registers, do not forget to update
-        * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h.
+        * the clobber lists for spin_lock() in arch/ia64/include/asm/spinlock.h.
         */
 
 #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
index 3bc2fa64f87f7f55047646e600614150d6b3c0eb..5c4674ae8aea0279f1abba8cff8bdade994e0131 100644 (file)
@@ -69,7 +69,7 @@
  *     systems, we use one-to-one mapping between IA-64 vector and IRQ.  A
  *     platform can implement platform_irq_to_vector(irq) and
  *     platform_local_vector_to_irq(vector) APIs to differentiate the mapping.
- *     Please see also include/asm-ia64/hw_irq.h for those APIs.
+ *     Please see also arch/ia64/include/asm/hw_irq.h for those APIs.
  *
  * To sum up, there are three levels of mappings involved:
  *
index 621630256c4aa053b30dbb6e54d56e95dfd0e842..f69389c7be1d8a8d22d9f8ecbdc4407d273e3c21 100644 (file)
@@ -45,7 +45,7 @@
  * to the correct location.
  */
 #include <asm/asmmacro.h>
-#include <asm-ia64/break.h>
+#include <asm/break.h>
 
        /*
         * void jprobe_break(void)
index 1ae049181e83f9b2bbfc7e1fa63cae8ba6ea6f73..8273afc32db8cf342a526e2c75c70cf3b3995e78 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <linux/kbuild.h>
 #include <linux/threads.h>
-#include <asm-ia64/native/irq.h>
+#include <asm/native/irq.h>
 
 void foo(void)
 {
index e5c2de9b29a5738484af3265f5713b286bbc8906..593279f33e96e71fae02c6c335f20d2b699e23c6 100644 (file)
@@ -314,7 +314,7 @@ static inline void __init setup_crashkernel(unsigned long total, int *n)
  *
  * Setup the reserved memory areas set aside for the boot parameters,
  * initrd, etc.  There are currently %IA64_MAX_RSVD_REGIONS defined,
- * see include/asm-ia64/meminit.h if you need to define more.
+ * see arch/ia64/include/asm/meminit.h if you need to define more.
  */
 void __init
 reserve_memory (void)
index ab7e2fd40798ea8702d4b4c5bcd167b3310d0645..c77ebdf98119ea9202d9d3624f048874c0e9944c 100644 (file)
@@ -63,7 +63,7 @@ EXPORT_SYMBOL(sn_io_addr);
 /**
  * __sn_mmiowb - I/O space memory barrier
  *
- * See include/asm-ia64/io.h and Documentation/DocBook/deviceiobook.tmpl
+ * See arch/ia64/include/asm/io.h and Documentation/DocBook/deviceiobook.tmpl
  * for details.
  *
  * On SN2, we wait for the PIO_WRITE_STATUS SHub register to clear.
index b4c4eaa5dd265bbdd4646898a99f63e86e01e315..4da736e25333abc8ce46440dcb8b97c4c9f2be9d 100644 (file)
@@ -3,6 +3,7 @@ config MIPS
        default y
        select HAVE_IDE
        select HAVE_OPROFILE
+       select HAVE_ARCH_KGDB
        # Horrible source of confusion.  Die, die, die ...
        select EMBEDDED
        select RTC_LIB
@@ -34,7 +35,6 @@ config BASLER_EXCITE
        select SYS_HAS_CPU_RM9000
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
-       select SYS_SUPPORTS_KGDB
        help
          The eXcite is a smart camera platform manufactured by
          Basler Vision Technologies AG.
@@ -280,7 +280,6 @@ config PMC_MSP
        select SYS_HAS_CPU_MIPS32_R2
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
-       select SYS_SUPPORTS_KGDB
        select IRQ_CPU
        select SERIAL_8250
        select SERIAL_8250_CONSOLE
@@ -306,7 +305,6 @@ config PMC_YOSEMITE
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
-       select SYS_SUPPORTS_KGDB
        select SYS_SUPPORTS_SMP
        help
          Yosemite is an evaluation board for the RM9000x2 processor
@@ -359,7 +357,6 @@ config SGI_IP27
        select SYS_HAS_CPU_R10000
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
-       select SYS_SUPPORTS_KGDB
        select SYS_SUPPORTS_NUMA
        select SYS_SUPPORTS_SMP
        select GENERIC_HARDIRQS_NO__DO_IRQ
@@ -475,7 +472,6 @@ config SIBYTE_SWARM
        select SYS_HAS_CPU_SB1
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
-       select SYS_SUPPORTS_KGDB
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select ZONE_DMA32 if 64BIT
 
@@ -868,7 +864,6 @@ config SOC_PNX8550
        select SYS_HAS_EARLY_PRINTK
        select SYS_SUPPORTS_32BIT_KERNEL
        select GENERIC_HARDIRQS_NO__DO_IRQ
-       select SYS_SUPPORTS_KGDB
        select GENERIC_GPIO
 
 config SWAP_IO_SPACE
index f18cf92650e350d746a299081dfd58dbeb468b34..765c8e287d2b2b45f2687f607c61ecc1d1096cad 100644 (file)
@@ -34,28 +34,6 @@ config SMTC_IDLE_HOOK_DEBUG
          arch/mips/kernel/smtc.c.  This debugging option result in significant
          overhead so should be disabled in production kernels.
 
-config KGDB
-       bool "Remote GDB kernel debugging"
-       depends on DEBUG_KERNEL && SYS_SUPPORTS_KGDB
-       select DEBUG_INFO
-       help
-         If you say Y here, it will be possible to remotely debug the MIPS
-         kernel using gdb. This enlarges your kernel image disk size by
-         several megabytes and requires a machine with more than 16 MB,
-         better 32 MB RAM to avoid excessive linking time. This is only
-         useful for kernel hackers. If unsure, say N.
-
-config SYS_SUPPORTS_KGDB
-       bool
-
-config GDB_CONSOLE
-       bool "Console output to GDB"
-       depends on KGDB
-       help
-         If you are using GDB for remote debugging over a serial port and
-         would like kernel messages to be formatted into GDB $O packets so
-         that GDB prints them as program output, say 'Y'.
-
 config SB1XXX_CORELIS
        bool "Corelis Debugger"
        depends on SIBYTE_SB1xxx_SOC
index 1fe97cccead1f7b4d633eba2d273b41204cecd4e..e4a057d80ab6edddaf7f075ef781886833e7a024 100644 (file)
@@ -134,4 +134,3 @@ config SOC_AU1X00
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_APM_EMULATION
-       select SYS_SUPPORTS_KGDB
index dd0e19dacfcff444ab7b4ff07912ff8b0bcde082..df48fd65bbf3989cfe5e8be4997214277b2a54a3 100644 (file)
@@ -9,7 +9,6 @@ obj-y += prom.o irq.o puts.o time.o reset.o \
        au1xxx_irqmap.o clocks.o platform.o power.o setup.o \
        sleeper.o cputable.o dma.o dbdma.o gpio.o
 
-obj-$(CONFIG_KGDB)             += dbg_io.o
 obj-$(CONFIG_PCI)              += pci.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/au1000/common/dbg_io.c b/arch/mips/au1000/common/dbg_io.c
deleted file mode 100644 (file)
index af5be7d..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <linux/types.h>
-
-#include <asm/mach-au1x00/au1000.h>
-
-#ifdef CONFIG_KGDB
-
-/*
- * FIXME the user should be able to select the
- * uart to be used for debugging.
- */
-#define DEBUG_BASE  UART_DEBUG_BASE
-
-#define         UART16550_BAUD_2400             2400
-#define         UART16550_BAUD_4800             4800
-#define         UART16550_BAUD_9600             9600
-#define         UART16550_BAUD_19200            19200
-#define         UART16550_BAUD_38400            38400
-#define         UART16550_BAUD_57600            57600
-#define         UART16550_BAUD_115200           115200
-
-#define         UART16550_PARITY_NONE           0
-#define         UART16550_PARITY_ODD            0x08
-#define         UART16550_PARITY_EVEN           0x18
-#define         UART16550_PARITY_MARK           0x28
-#define         UART16550_PARITY_SPACE          0x38
-
-#define         UART16550_DATA_5BIT             0x0
-#define         UART16550_DATA_6BIT             0x1
-#define         UART16550_DATA_7BIT             0x2
-#define         UART16550_DATA_8BIT             0x3
-
-#define         UART16550_STOP_1BIT             0x0
-#define         UART16550_STOP_2BIT             0x4
-
-
-#define UART_RX                0       /* Receive buffer */
-#define UART_TX                4       /* Transmit buffer */
-#define UART_IER       8       /* Interrupt Enable Register */
-#define UART_IIR       0xC     /* Interrupt ID Register */
-#define UART_FCR       0x10    /* FIFO Control Register */
-#define UART_LCR       0x14    /* Line Control Register */
-#define UART_MCR       0x18    /* Modem Control Register */
-#define UART_LSR       0x1C    /* Line Status Register */
-#define UART_MSR       0x20    /* Modem Status Register */
-#define UART_CLK       0x28    /* Baud Rat4e Clock Divider */
-#define UART_MOD_CNTRL 0x100   /* Module Control */
-
-/* memory-mapped read/write of the port */
-#define UART16550_READ(y)     (au_readl(DEBUG_BASE + y) & 0xff)
-#define UART16550_WRITE(y, z) (au_writel(z & 0xff, DEBUG_BASE + y))
-
-extern unsigned long calc_clock(void);
-
-void debugInit(u32 baud, u8 data, u8 parity, u8 stop)
-{
-       if (UART16550_READ(UART_MOD_CNTRL) != 0x3)
-               UART16550_WRITE(UART_MOD_CNTRL, 3);
-       calc_clock();
-
-       /* disable interrupts */
-       UART16550_WRITE(UART_IER, 0);
-
-       /* set up baud rate */
-       {
-               u32 divisor;
-
-               /* set divisor */
-               divisor = get_au1x00_uart_baud_base() / baud;
-               UART16550_WRITE(UART_CLK, divisor & 0xffff);
-       }
-
-       /* set data format */
-       UART16550_WRITE(UART_LCR, (data | parity | stop));
-}
-
-static int remoteDebugInitialized;
-
-u8 getDebugChar(void)
-{
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(UART16550_BAUD_115200,
-                         UART16550_DATA_8BIT,
-                         UART16550_PARITY_NONE,
-                         UART16550_STOP_1BIT);
-       }
-
-       while ((UART16550_READ(UART_LSR) & 0x1) == 0);
-       return UART16550_READ(UART_RX);
-}
-
-
-int putDebugChar(u8 byte)
-{
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(UART16550_BAUD_115200,
-                         UART16550_DATA_8BIT,
-                         UART16550_PARITY_NONE,
-                         UART16550_STOP_1BIT);
-       }
-
-       while ((UART16550_READ(UART_LSR) & 0x40) == 0);
-       UART16550_WRITE(UART_TX, byte);
-
-       return 1;
-}
-
-#endif
index 5ebe0de5e4590e404e8ba11c2a86730fd38bed16..847413514964f1f83e560fdb6fe53b68442de3b9 100644 (file)
@@ -57,6 +57,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 33a4aebe0cba37a33f3d89e918caaa03e1d40673..3bae13c2895494788a13571853ab0c5f77b42429 100644 (file)
@@ -55,6 +55,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 3837365d613d54bf65b01acff016eb7e805e12e6..8a9c7d57208d2fbf6011e9fb5a390d0f5c62a852 100644 (file)
@@ -52,6 +52,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 8355483f3de2a65503e60ac5801eada3679ee08b..7c6792308bc5b85f372af92adee39811862ad3c7 100644 (file)
@@ -54,7 +54,7 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
 
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 09fd63b86062060719490113a5ba9cfdee83c74e..e9b2a0fd48ae702135c0af9d1e3057b5de0c8267 100644 (file)
@@ -53,6 +53,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x08000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 49f51e165863d40e004408b4a1199f16c59d29b1..3b6e395cf952019c41f999a86c6bab6a9f4236cf 100644 (file)
@@ -53,6 +53,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 1b5f58434bb78390cad601c8b44bb4bf628a7d46..e1055a13a1a0a108e21cd7dabf8af581226a19bc 100644 (file)
@@ -53,6 +53,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x08000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index b849bf501c0423fb93d8cb82f3474324b971cca1..7516434760a1c18d6300c3bef3b79002385330e2 100644 (file)
@@ -53,6 +53,6 @@ void __init prom_init(void)
        if (!memsize_str)
                memsize = 0x04000000;
        else
-               memsize = strict_strtol(memsize_str, 0, NULL);
+               strict_strtol(memsize_str, 0, &memsize);
        add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
index 519142c2e4ef31f475349a618ee630f20287fc88..cff29cf46d0353e59d1bb782c712b1ab29901fe6 100644 (file)
@@ -5,5 +5,4 @@
 obj-$(CONFIG_BASLER_EXCITE)    += excite_irq.o excite_prom.o excite_setup.o \
                                   excite_device.o excite_procfs.o
 
-obj-$(CONFIG_KGDB)             += excite_dbg_io.o
 obj-m                          += excite_iodev.o
diff --git a/arch/mips/basler/excite/excite_dbg_io.c b/arch/mips/basler/excite/excite_dbg_io.c
deleted file mode 100644 (file)
index d289e3a..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *  Copyright (C) 2004 by Basler Vision Technologies AG
- *  Author: Thomas Koeller <thomas.koeller@baslerweb.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 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/linkage.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <asm/gdb-stub.h>
-#include <asm/rm9k-ocd.h>
-#include <excite.h>
-
-#if defined(CONFIG_SERIAL_8250) && CONFIG_SERIAL_8250_NR_UARTS > 1
-#error Debug port used by serial driver
-#endif
-
-#define UART_CLK               25000000
-#define BASE_BAUD              (UART_CLK / 16)
-#define REGISTER_BASE_0                0x0208UL
-#define REGISTER_BASE_1                0x0238UL
-
-#define REGISTER_BASE_DBG      REGISTER_BASE_1
-
-#define CPRR   0x0004
-#define UACFG  0x0200
-#define UAINTS 0x0204
-#define UARBR  (REGISTER_BASE_DBG + 0x0000)
-#define UATHR  (REGISTER_BASE_DBG + 0x0004)
-#define UADLL  (REGISTER_BASE_DBG + 0x0008)
-#define UAIER  (REGISTER_BASE_DBG + 0x000c)
-#define UADLH  (REGISTER_BASE_DBG + 0x0010)
-#define UAIIR  (REGISTER_BASE_DBG + 0x0014)
-#define UAFCR  (REGISTER_BASE_DBG + 0x0018)
-#define UALCR  (REGISTER_BASE_DBG + 0x001c)
-#define UAMCR  (REGISTER_BASE_DBG + 0x0020)
-#define UALSR  (REGISTER_BASE_DBG + 0x0024)
-#define UAMSR  (REGISTER_BASE_DBG + 0x0028)
-#define UASCR  (REGISTER_BASE_DBG + 0x002c)
-
-#define        PARITY_NONE     0
-#define        PARITY_ODD      0x08
-#define        PARITY_EVEN     0x18
-#define        PARITY_MARK     0x28
-#define        PARITY_SPACE    0x38
-
-#define        DATA_5BIT       0x0
-#define        DATA_6BIT       0x1
-#define        DATA_7BIT       0x2
-#define        DATA_8BIT       0x3
-
-#define        STOP_1BIT       0x0
-#define        STOP_2BIT       0x4
-
-#define BAUD_DBG       57600
-#define        PARITY_DBG      PARITY_NONE
-#define        DATA_DBG        DATA_8BIT
-#define        STOP_DBG        STOP_1BIT
-
-/* Initialize the serial port for KGDB debugging */
-void __init excite_kgdb_init(void)
-{
-       const u32 divisor = BASE_BAUD / BAUD_DBG;
-
-       /* Take the UART out of reset */
-       titan_writel(0x00ff1cff, CPRR);
-       titan_writel(0x00000000, UACFG);
-       titan_writel(0x00000002, UACFG);
-
-       titan_writel(0x0, UALCR);
-       titan_writel(0x0, UAIER);
-
-       /* Disable FIFOs */
-       titan_writel(0x00, UAFCR);
-
-       titan_writel(0x80, UALCR);
-       titan_writel(divisor & 0xff, UADLL);
-       titan_writel((divisor & 0xff00) >> 8, UADLH);
-       titan_writel(0x0, UALCR);
-
-       titan_writel(DATA_DBG | PARITY_DBG | STOP_DBG, UALCR);
-
-       /* Enable receiver interrupt */
-       titan_readl(UARBR);
-       titan_writel(0x1, UAIER);
-}
-
-int getDebugChar(void)
-{
-       while (!(titan_readl(UALSR) & 0x1));
-       return titan_readl(UARBR);
-}
-
-int putDebugChar(int data)
-{
-       while (!(titan_readl(UALSR) & 0x20));
-       titan_writel(data, UATHR);
-       return 1;
-}
-
-/* KGDB interrupt handler */
-asmlinkage void excite_kgdb_inthdl(void)
-{
-       if (unlikely(
-               ((titan_readl(UAIIR) & 0x7) == 4)
-               && ((titan_readl(UARBR) & 0xff) == 0x3)))
-                       set_async_breakpoint(&regs->cp0_epc);
-}
index 4903e067916b4b5badaca3f2b44bfb2d8c3cbe8d..934e0a6b1011e5e137dde54423611698a84ac801 100644 (file)
@@ -50,10 +50,6 @@ void __init arch_init_irq(void)
        mips_cpu_irq_init();
        rm7k_cpu_irq_init();
        rm9k_cpu_irq_init();
-
-#ifdef CONFIG_KGDB
-       excite_kgdb_init();
-#endif
 }
 
 asmlinkage void plat_irq_dispatch(void)
@@ -90,9 +86,6 @@ asmlinkage void plat_irq_dispatch(void)
        msgint      = msgintflags & msgintmask & (0x1 << (TITAN_MSGINT % 0x20));
        if ((pending & (1 << TITAN_IRQ)) && msgint) {
                ocd_writel(msgint, INTP0Clear0 + (TITAN_MSGINT / 0x20 * 0x10));
-#if defined(CONFIG_KGDB)
-               excite_kgdb_inthdl();
-#endif
                do_IRQ(TITAN_IRQ);
                return;
        }
index 6dd8f0d46d096f1b8ad57d0510abed786bb09b42..d66b3b8edf2a10723ab947437faa93272275b632 100644 (file)
@@ -95,13 +95,13 @@ static int __init excite_init_console(void)
        /* Take the DUART out of reset */
        titan_writel(0x00ff1cff, CPRR);
 
-#if defined(CONFIG_KGDB) || (CONFIG_SERIAL_8250_NR_UARTS > 1)
+#if (CONFIG_SERIAL_8250_NR_UARTS > 1)
        /* Enable both ports */
        titan_writel(MASK_SER0 | MASK_SER1, UACFG);
 #else
        /* Enable port #0 only */
        titan_writel(MASK_SER0, UACFG);
-#endif /* defined(CONFIG_KGDB) */
+#endif
 
        /*
         * Set up serial port #0. Do not use autodetection; the result is
index 2678b7ec335197d9c938071f093ead61e2d509d2..eb44b72254afe26088bc921e3f2331057a065f10 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc5
-# Thu Sep  6 13:14:29 2007
+# Linux kernel version: 2.6.26
+# Fri Jul 25 10:25:34 2008
 #
 CONFIG_MIPS=y
 
@@ -10,9 +10,11 @@ CONFIG_MIPS=y
 #
 # CONFIG_MACH_ALCHEMY is not set
 # CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
 CONFIG_MIPS_COBALT=y
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
 # CONFIG_LEMOTE_FULONG is not set
 # CONFIG_MIPS_MALTA is not set
 # CONFIG_MIPS_SIM is not set
@@ -24,6 +26,7 @@ CONFIG_MIPS_COBALT=y
 # CONFIG_PMC_YOSEMITE is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_CRHINE is not set
 # CONFIG_SIBYTE_CARMEL is not set
@@ -34,19 +37,25 @@ CONFIG_MIPS_COBALT=y
 # CONFIG_SIBYTE_SENTOSA is not set
 # CONFIG_SIBYTE_BIGSUR is not set
 # CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
 # CONFIG_WR_PPMC is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_CEVT_GT641XX=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_EARLY_PRINTK=y
@@ -108,6 +117,7 @@ CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -115,10 +125,16 @@ CONFIG_FLATMEM_MANUAL=y
 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=0
 CONFIG_VIRT_TO_BUS=y
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
@@ -151,23 +167,28 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
+# CONFIG_NAMESPACES 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_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_PCSPKR_PLATFORM=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
@@ -177,23 +198,37 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLAB=y
-# CONFIG_SLUB is not set
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+# CONFIG_HAVE_CLK is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 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 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -207,18 +242,18 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
 CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 CONFIG_MMU=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+CONFIG_I8253=y
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -232,8 +267,8 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Power management options
 #
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
 # CONFIG_PM is not set
-CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -250,6 +285,7 @@ CONFIG_XFRM=y
 CONFIG_XFRM_USER=y
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
 CONFIG_NET_KEY=y
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
@@ -269,6 +305,7 @@ CONFIG_IP_FIB_HASH=y
 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
@@ -276,8 +313,6 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -294,10 +329,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -305,6 +336,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # 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
@@ -326,9 +358,12 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=y
@@ -337,6 +372,7 @@ CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
 # CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
 
 #
 # User Modules And Translation Layers
@@ -350,6 +386,7 @@ CONFIG_MTD_BLKDEVS=y
 # 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
@@ -384,6 +421,7 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_START=0x0
 CONFIG_MTD_PHYSMAP_LEN=0x0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=0
+# CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -423,7 +461,9 @@ CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -462,10 +502,15 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 # CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -475,7 +520,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -504,7 +548,9 @@ CONFIG_ATA=y
 # CONFIG_PATA_MPIIX is not set
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
 # CONFIG_PATA_PDC_OLD is not set
@@ -518,29 +564,27 @@ CONFIG_ATA=y
 CONFIG_PATA_VIA=y
 # CONFIG_PATA_WINBOND is not set
 # CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
+# CONFIG_FUSION is not set
 
 #
-# Fusion MPT device support
+# IEEE 1394 (FireWire) support
 #
-# CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
-# IEEE 1394 (FireWire) support
+# Enable only one of the two stacks, unless you know what you are doing
 #
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -562,7 +606,12 @@ CONFIG_TULIP=y
 # CONFIG_DM9102 is not set
 # CONFIG_ULI526X is not set
 # CONFIG_HP100 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_NET_PCI is not set
+# CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
 # CONFIG_TR is not set
@@ -572,6 +621,7 @@ CONFIG_TULIP=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -580,7 +630,6 @@ CONFIG_TULIP=y
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET_MII is not set
 # CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
@@ -588,7 +637,6 @@ CONFIG_TULIP=y
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -607,7 +655,6 @@ CONFIG_INPUT_POLLDEV=y
 #
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
@@ -642,7 +689,9 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -664,65 +713,122 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_RTC is not set
-CONFIG_COBALT_LCD=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_COBALT=y
+# CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
-
-#
-# Sound
-#
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
 # CONFIG_SOUND is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
 # USB Input Devices
@@ -743,6 +849,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=m
 # CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
@@ -751,15 +858,18 @@ CONFIG_USB=m
 # CONFIG_USB_DEVICE_CLASS is not set
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=m
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=m
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -773,6 +883,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 #
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -785,6 +896,7 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
@@ -793,6 +905,7 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -800,15 +913,11 @@ CONFIG_USB_STORAGE=m
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-CONFIG_USB_MON=y
+# CONFIG_USB_MON is not set
 
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 # CONFIG_USB_SERIAL is not set
 
 #
@@ -833,16 +942,10 @@ CONFIG_USB_MON=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 
@@ -858,6 +961,8 @@ CONFIG_LEDS_COBALT_RAQ=y
 CONFIG_LEDS_TRIGGERS=y
 # CONFIG_LEDS_TRIGGER_TIMER is not set
 # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
@@ -882,9 +987,10 @@ CONFIG_RTC_INTF_DEV=y
 # Platform RTC drivers
 #
 CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_STK17TA8 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
@@ -892,23 +998,7 @@ CONFIG_RTC_DRV_CMOS=y
 #
 # on-CPU RTC drivers
 #
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -923,22 +1013,22 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
-# CONFIG_EXT4DEV_FS is not set
+CONFIG_EXT4DEV_FS=y
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -967,7 +1057,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=y
 
 #
@@ -983,32 +1072,28 @@ CONFIG_CONFIGFS_FS=y
 # CONFIG_JFFS2_FS 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
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 # CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_ACL_SUPPORT=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1022,34 +1107,26 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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 is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_CROSSCOMPILE=y
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 CONFIG_CMDLINE=""
 
 #
@@ -1057,14 +1134,95 @@ CONFIG_CMDLINE=""
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-# CONFIG_CRYPTO is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 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 is not set
+# 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
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index ebb8ad62b3a3cac9dd4c3723ccd7012d6d66d526..a279165e3a7d3899b9fae53a7323f4e3df3b3781 100644 (file)
@@ -1092,7 +1092,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index ad4e5ef65592efbf80c3cc769bb68f865f1c91de..8944d15caf13145866a136710597dab3c915b704 100644 (file)
@@ -1092,7 +1092,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index d0dc2e83ad35aadac3d848a0db067f2c764f76be..ab17973107fde80e44e217b696cbf73757297f62 100644 (file)
@@ -1174,7 +1174,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE="mem=48M"
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 9155082313c891ffa5eaf61234cfecfbb90bc38f..b65803f19352724866354ba61d5b53a54d1a17f2 100644 (file)
@@ -1392,7 +1392,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index e4e324422cd96d2c02cc1976fae34b58518164e9..a190ac07740b31dcdc935701ebc30d02c87f9bc4 100644 (file)
@@ -1209,7 +1209,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 3572e80356d2e8c26088795677d5cfb4189d752d..4e465e94599179a79f53769789cc0b3830aa0a40 100644 (file)
@@ -1269,7 +1269,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 138c575a0151668ded722068f6ebc7c658cd6a10..831d3e5a1ea6ba976d04f0febdd7793f51b367a0 100644 (file)
@@ -943,7 +943,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 59d19472b161b621bfbe41db03f91809176f21c1..dd13db4d0fb98efec3a5c56f427cfd7f26185355 100644 (file)
@@ -1415,8 +1415,6 @@ CONFIG_FORCED_INLINING=y
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
 # CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_KGDB is not set
-CONFIG_SYS_SUPPORTS_KGDB=y
 # CONFIG_RUNTIME_DEBUG is not set
 # CONFIG_MIPS_UNCACHED is not set
 
index bacf0dd0e3457a2f37447a131a51d7168b77ca1f..db9272677aa2dd2b26e98f01caf21cae5f656bf7 100644 (file)
@@ -3020,7 +3020,6 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 6dfe6f793cef62fdaf92fb22f452cdba1a0ef100..9e21e333a2fc66efaef996f0198718f8b46ed15c 100644 (file)
@@ -1085,7 +1085,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index c965a87e6a963dd1f80c962a3490d590aca0259f..af67ed4f71ae8bf3ad06f44e4a829c84b53cb528 100644 (file)
@@ -1202,7 +1202,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 0778996c682fbcf1ff81f97b8e3bc0cc64e4296b..7956f56cbf3ed0dd1a9ca825d4b3651ed5c15195 100644 (file)
@@ -1195,7 +1195,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 37c7b5ffd474afa5d3483137efcc56c0dee6f5ef..723bd5176a358a7a1993335c931223be403d2c18 100644 (file)
@@ -1216,10 +1216,8 @@ CONFIG_DEBUG_MUTEXES=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_CROSSCOMPILE=y
-CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
+CONFIG_CMDLINE="console=ttyS1,38400n8 root=/dev/nfs ip=bootp"
 # CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_KGDB is not set
-CONFIG_SYS_SUPPORTS_KGDB=y
 # CONFIG_RUNTIME_DEBUG is not set
 
 #
index 893e5c4ab66d55a1af9a21881f6ef22a3d6d9ce2..b5052fb42e9ef11475960579564c7268fbb1808e 100644 (file)
@@ -1206,10 +1206,8 @@ CONFIG_DEBUG_SLAB=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_CROSSCOMPILE=y
-CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
+CONFIG_CMDLINE="console=ttyS1,38400n8 root=/dev/nfs ip=bootp"
 # CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_KGDB is not set
-CONFIG_SYS_SUPPORTS_KGDB=y
 # CONFIG_RUNTIME_DEBUG is not set
 
 #
index e42aed5a38bb8cba5008474475cf48b603ccaf1d..c7c0864b8ce98053a70a7fc576dc7f75c64793a5 100644 (file)
@@ -742,7 +742,6 @@ CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_SAMPLES is not set
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 
 #
 # Security options
index 1ea97865f2cead680c0670397b34ec735bbb7d08..a9acaa2f9da3e6bc31a81ab2a729c6955b5db523 100644 (file)
@@ -963,7 +963,6 @@ CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_SAMPLES is not set
 CONFIG_CMDLINE=""
-CONFIG_SYS_SUPPORTS_KGDB=y
 # CONFIG_SB1XXX_CORELIS is not set
 
 #
index 7f86c43d1bdaaa14b291b84473236782806790c1..ea8249c75b3f8e0ed37f4f3133dacdf5b3014fb0 100644 (file)
@@ -827,8 +827,6 @@ CONFIG_FORCED_INLINING=y
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
 # CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_KGDB is not set
-CONFIG_SYS_SUPPORTS_KGDB=y
 # CONFIG_RUNTIME_DEBUG is not set
 
 #
index 11567702b155460a84adcbf9b08bca3c6c280a97..d70627de7cfe953764ae786304d0e89b73c1e178 100644 (file)
@@ -34,7 +34,6 @@
 #include <asm/bcache.h>
 #include <asm/irq.h>
 #include <asm/reboot.h>
-#include <asm/gdb-stub.h>
 #include <asm/traps.h>
 #include <asm/debug.h>
 
index 62bfb455d1b11c9edb89ab6d1683c0aaf6b20fef..a56c4b804b07c10821a2dfb9aaf5f8b8518e29e7 100644 (file)
@@ -41,7 +41,6 @@
 #include <asm/bcache.h>
 #include <asm/irq.h>
 #include <asm/reboot.h>
-#include <asm/gdb-stub.h>
 #include <asm/traps.h>
 #include <asm/debug.h>
 
index 0fd31974ba28b2e9da37b936e041305adc9dcd81..706f9397479770265d69b0307df9d76ea3739178 100644 (file)
@@ -71,7 +71,7 @@ obj-$(CONFIG_MIPS32_COMPAT)   += linux32.o ptrace32.o signal32.o
 obj-$(CONFIG_MIPS32_N32)       += binfmt_elfn32.o scall64-n32.o signal_n32.o
 obj-$(CONFIG_MIPS32_O32)       += binfmt_elfo32.o scall64-o32.o
 
-obj-$(CONFIG_KGDB)             += gdb-low.o gdb-stub.o
+obj-$(CONFIG_KGDB)             += kgdb.o
 obj-$(CONFIG_PROC_FS)          += proc.o
 
 obj-$(CONFIG_64BIT)            += cpu-bugs64.o
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
deleted file mode 100644 (file)
index 2c44606..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * gdb-low.S contains the low-level trap handler for the GDB stub.
- *
- * Copyright (C) 1995 Andreas Busse
- */
-#include <linux/sys.h>
-
-#include <asm/asm.h>
-#include <asm/errno.h>
-#include <asm/irqflags.h>
-#include <asm/mipsregs.h>
-#include <asm/regdef.h>
-#include <asm/stackframe.h>
-#include <asm/gdb-stub.h>
-
-#ifdef CONFIG_32BIT
-#define DMFC0  mfc0
-#define DMTC0  mtc0
-#define LDC1   lwc1
-#define SDC1   lwc1
-#endif
-#ifdef CONFIG_64BIT
-#define DMFC0  dmfc0
-#define DMTC0  dmtc0
-#define LDC1   ldc1
-#define SDC1   ldc1
-#endif
-
-/*
- * [jsun] We reserves about 2x GDB_FR_SIZE in stack.  The lower (addressed)
- * part is used to store registers and passed to exception handler.
- * The upper part is reserved for "call func" feature where gdb client
- * saves some of the regs, setups call frame and passes args.
- *
- * A trace shows about 200 bytes are used to store about half of all regs.
- * The rest should be big enough for frame setup and passing args.
- */
-
-/*
- * The low level trap handler
- */
-               .align  5
-               NESTED(trap_low, GDB_FR_SIZE, sp)
-               .set    noat
-               .set    noreorder
-
-               mfc0    k0, CP0_STATUS
-               sll     k0, 3                   /* extract cu0 bit */
-               bltz    k0, 1f
-               move    k1, sp
-
-               /*
-                * Called from user mode, go somewhere else.
-                */
-               mfc0    k0, CP0_CAUSE
-               andi    k0, k0, 0x7c
-#ifdef CONFIG_64BIT
-               dsll    k0, k0, 1
-#endif
-               PTR_L   k1, saved_vectors(k0)
-               jr      k1
-               nop
-1:
-               move    k0, sp
-               PTR_SUBU sp, k1, GDB_FR_SIZE*2  # see comment above
-               LONG_S  k0, GDB_FR_REG29(sp)
-               LONG_S  $2, GDB_FR_REG2(sp)
-
-/*
- * First save the CP0 and special registers
- */
-
-               mfc0    v0, CP0_STATUS
-               LONG_S  v0, GDB_FR_STATUS(sp)
-               mfc0    v0, CP0_CAUSE
-               LONG_S  v0, GDB_FR_CAUSE(sp)
-               DMFC0   v0, CP0_EPC
-               LONG_S  v0, GDB_FR_EPC(sp)
-               DMFC0   v0, CP0_BADVADDR
-               LONG_S  v0, GDB_FR_BADVADDR(sp)
-               mfhi    v0
-               LONG_S  v0, GDB_FR_HI(sp)
-               mflo    v0
-               LONG_S  v0, GDB_FR_LO(sp)
-
-/*
- * Now the integer registers
- */
-
-               LONG_S  zero, GDB_FR_REG0(sp)           /* I know... */
-               LONG_S  $1, GDB_FR_REG1(sp)
-               /* v0 already saved */
-               LONG_S  $3, GDB_FR_REG3(sp)
-               LONG_S  $4, GDB_FR_REG4(sp)
-               LONG_S  $5, GDB_FR_REG5(sp)
-               LONG_S  $6, GDB_FR_REG6(sp)
-               LONG_S  $7, GDB_FR_REG7(sp)
-               LONG_S  $8, GDB_FR_REG8(sp)
-               LONG_S  $9, GDB_FR_REG9(sp)
-               LONG_S  $10, GDB_FR_REG10(sp)
-               LONG_S  $11, GDB_FR_REG11(sp)
-               LONG_S  $12, GDB_FR_REG12(sp)
-               LONG_S  $13, GDB_FR_REG13(sp)
-               LONG_S  $14, GDB_FR_REG14(sp)
-               LONG_S  $15, GDB_FR_REG15(sp)
-               LONG_S  $16, GDB_FR_REG16(sp)
-               LONG_S  $17, GDB_FR_REG17(sp)
-               LONG_S  $18, GDB_FR_REG18(sp)
-               LONG_S  $19, GDB_FR_REG19(sp)
-               LONG_S  $20, GDB_FR_REG20(sp)
-               LONG_S  $21, GDB_FR_REG21(sp)
-               LONG_S  $22, GDB_FR_REG22(sp)
-               LONG_S  $23, GDB_FR_REG23(sp)
-               LONG_S  $24, GDB_FR_REG24(sp)
-               LONG_S  $25, GDB_FR_REG25(sp)
-               LONG_S  $26, GDB_FR_REG26(sp)
-               LONG_S  $27, GDB_FR_REG27(sp)
-               LONG_S  $28, GDB_FR_REG28(sp)
-               /* sp already saved */
-               LONG_S  $30, GDB_FR_REG30(sp)
-               LONG_S  $31, GDB_FR_REG31(sp)
-
-               CLI                             /* disable interrupts */
-               TRACE_IRQS_OFF
-
-/*
- * Followed by the floating point registers
- */
-               mfc0    v0, CP0_STATUS          /* FPU enabled? */
-               srl     v0, v0, 16
-               andi    v0, v0, (ST0_CU1 >> 16)
-
-               beqz    v0,2f                   /* disabled, skip */
-                nop
-
-               SDC1    $0, GDB_FR_FPR0(sp)
-               SDC1    $1, GDB_FR_FPR1(sp)
-               SDC1    $2, GDB_FR_FPR2(sp)
-               SDC1    $3, GDB_FR_FPR3(sp)
-               SDC1    $4, GDB_FR_FPR4(sp)
-               SDC1    $5, GDB_FR_FPR5(sp)
-               SDC1    $6, GDB_FR_FPR6(sp)
-               SDC1    $7, GDB_FR_FPR7(sp)
-               SDC1    $8, GDB_FR_FPR8(sp)
-               SDC1    $9, GDB_FR_FPR9(sp)
-               SDC1    $10, GDB_FR_FPR10(sp)
-               SDC1    $11, GDB_FR_FPR11(sp)
-               SDC1    $12, GDB_FR_FPR12(sp)
-               SDC1    $13, GDB_FR_FPR13(sp)
-               SDC1    $14, GDB_FR_FPR14(sp)
-               SDC1    $15, GDB_FR_FPR15(sp)
-               SDC1    $16, GDB_FR_FPR16(sp)
-               SDC1    $17, GDB_FR_FPR17(sp)
-               SDC1    $18, GDB_FR_FPR18(sp)
-               SDC1    $19, GDB_FR_FPR19(sp)
-               SDC1    $20, GDB_FR_FPR20(sp)
-               SDC1    $21, GDB_FR_FPR21(sp)
-               SDC1    $22, GDB_FR_FPR22(sp)
-               SDC1    $23, GDB_FR_FPR23(sp)
-               SDC1    $24, GDB_FR_FPR24(sp)
-               SDC1    $25, GDB_FR_FPR25(sp)
-               SDC1    $26, GDB_FR_FPR26(sp)
-               SDC1    $27, GDB_FR_FPR27(sp)
-               SDC1    $28, GDB_FR_FPR28(sp)
-               SDC1    $29, GDB_FR_FPR29(sp)
-               SDC1    $30, GDB_FR_FPR30(sp)
-               SDC1    $31, GDB_FR_FPR31(sp)
-
-/*
- * FPU control registers
- */
-
-               cfc1    v0, CP1_STATUS
-               LONG_S  v0, GDB_FR_FSR(sp)
-               cfc1    v0, CP1_REVISION
-               LONG_S  v0, GDB_FR_FIR(sp)
-
-/*
- * Current stack frame ptr
- */
-
-2:
-               LONG_S  sp, GDB_FR_FRP(sp)
-
-/*
- * CP0 registers (R4000/R4400 unused registers skipped)
- */
-
-               mfc0    v0, CP0_INDEX
-               LONG_S  v0, GDB_FR_CP0_INDEX(sp)
-               mfc0    v0, CP0_RANDOM
-               LONG_S  v0, GDB_FR_CP0_RANDOM(sp)
-               DMFC0   v0, CP0_ENTRYLO0
-               LONG_S  v0, GDB_FR_CP0_ENTRYLO0(sp)
-               DMFC0   v0, CP0_ENTRYLO1
-               LONG_S  v0, GDB_FR_CP0_ENTRYLO1(sp)
-               DMFC0   v0, CP0_CONTEXT
-               LONG_S  v0, GDB_FR_CP0_CONTEXT(sp)
-               mfc0    v0, CP0_PAGEMASK
-               LONG_S  v0, GDB_FR_CP0_PAGEMASK(sp)
-               mfc0    v0, CP0_WIRED
-               LONG_S  v0, GDB_FR_CP0_WIRED(sp)
-               DMFC0   v0, CP0_ENTRYHI
-               LONG_S  v0, GDB_FR_CP0_ENTRYHI(sp)
-               mfc0    v0, CP0_PRID
-               LONG_S  v0, GDB_FR_CP0_PRID(sp)
-
-               .set    at
-
-/*
- * Continue with the higher level handler
- */
-
-               move    a0,sp
-
-               jal     handle_exception
-                nop
-
-/*
- * Restore all writable registers, in reverse order
- */
-
-               .set    noat
-
-               LONG_L  v0, GDB_FR_CP0_ENTRYHI(sp)
-               LONG_L  v1, GDB_FR_CP0_WIRED(sp)
-               DMTC0   v0, CP0_ENTRYHI
-               mtc0    v1, CP0_WIRED
-               LONG_L  v0, GDB_FR_CP0_PAGEMASK(sp)
-               LONG_L  v1, GDB_FR_CP0_ENTRYLO1(sp)
-               mtc0    v0, CP0_PAGEMASK
-               DMTC0   v1, CP0_ENTRYLO1
-               LONG_L  v0, GDB_FR_CP0_ENTRYLO0(sp)
-               LONG_L  v1, GDB_FR_CP0_INDEX(sp)
-               DMTC0   v0, CP0_ENTRYLO0
-               LONG_L  v0, GDB_FR_CP0_CONTEXT(sp)
-               mtc0    v1, CP0_INDEX
-               DMTC0   v0, CP0_CONTEXT
-
-
-/*
- * Next, the floating point registers
- */
-               mfc0    v0, CP0_STATUS          /* check if the FPU is enabled */
-               srl     v0, v0, 16
-               andi    v0, v0, (ST0_CU1 >> 16)
-
-               beqz    v0, 3f                  /* disabled, skip */
-                nop
-
-               LDC1    $31, GDB_FR_FPR31(sp)
-               LDC1    $30, GDB_FR_FPR30(sp)
-               LDC1    $29, GDB_FR_FPR29(sp)
-               LDC1    $28, GDB_FR_FPR28(sp)
-               LDC1    $27, GDB_FR_FPR27(sp)
-               LDC1    $26, GDB_FR_FPR26(sp)
-               LDC1    $25, GDB_FR_FPR25(sp)
-               LDC1    $24, GDB_FR_FPR24(sp)
-               LDC1    $23, GDB_FR_FPR23(sp)
-               LDC1    $22, GDB_FR_FPR22(sp)
-               LDC1    $21, GDB_FR_FPR21(sp)
-               LDC1    $20, GDB_FR_FPR20(sp)
-               LDC1    $19, GDB_FR_FPR19(sp)
-               LDC1    $18, GDB_FR_FPR18(sp)
-               LDC1    $17, GDB_FR_FPR17(sp)
-               LDC1    $16, GDB_FR_FPR16(sp)
-               LDC1    $15, GDB_FR_FPR15(sp)
-               LDC1    $14, GDB_FR_FPR14(sp)
-               LDC1    $13, GDB_FR_FPR13(sp)
-               LDC1    $12, GDB_FR_FPR12(sp)
-               LDC1    $11, GDB_FR_FPR11(sp)
-               LDC1    $10, GDB_FR_FPR10(sp)
-               LDC1    $9, GDB_FR_FPR9(sp)
-               LDC1    $8, GDB_FR_FPR8(sp)
-               LDC1    $7, GDB_FR_FPR7(sp)
-               LDC1    $6, GDB_FR_FPR6(sp)
-               LDC1    $5, GDB_FR_FPR5(sp)
-               LDC1    $4, GDB_FR_FPR4(sp)
-               LDC1    $3, GDB_FR_FPR3(sp)
-               LDC1    $2, GDB_FR_FPR2(sp)
-               LDC1    $1, GDB_FR_FPR1(sp)
-               LDC1    $0, GDB_FR_FPR0(sp)
-
-/*
- * Now the CP0 and integer registers
- */
-
-3:
-#ifdef CONFIG_MIPS_MT_SMTC
-               /* Read-modify write of Status must be atomic */
-               mfc0    t2, CP0_TCSTATUS
-               ori     t1, t2, TCSTATUS_IXMT
-               mtc0    t1, CP0_TCSTATUS
-               andi    t2, t2, TCSTATUS_IXMT
-               _ehb
-               DMT     9                               # dmt   t1
-               jal     mips_ihb
-               nop
-#endif /* CONFIG_MIPS_MT_SMTC */
-               mfc0    t0, CP0_STATUS
-               ori     t0, 0x1f
-               xori    t0, 0x1f
-               mtc0    t0, CP0_STATUS
-#ifdef CONFIG_MIPS_MT_SMTC
-               andi    t1, t1, VPECONTROL_TE
-               beqz    t1, 9f
-               nop
-               EMT                                     # emt
-9:
-               mfc0    t1, CP0_TCSTATUS
-               xori    t1, t1, TCSTATUS_IXMT
-               or      t1, t1, t2
-               mtc0    t1, CP0_TCSTATUS
-               _ehb
-#endif /* CONFIG_MIPS_MT_SMTC */
-               LONG_L  v0, GDB_FR_STATUS(sp)
-               LONG_L  v1, GDB_FR_EPC(sp)
-               mtc0    v0, CP0_STATUS
-               DMTC0   v1, CP0_EPC
-               LONG_L  v0, GDB_FR_HI(sp)
-               LONG_L  v1, GDB_FR_LO(sp)
-               mthi    v0
-               mtlo    v1
-               LONG_L  $31, GDB_FR_REG31(sp)
-               LONG_L  $30, GDB_FR_REG30(sp)
-               LONG_L  $28, GDB_FR_REG28(sp)
-               LONG_L  $27, GDB_FR_REG27(sp)
-               LONG_L  $26, GDB_FR_REG26(sp)
-               LONG_L  $25, GDB_FR_REG25(sp)
-               LONG_L  $24, GDB_FR_REG24(sp)
-               LONG_L  $23, GDB_FR_REG23(sp)
-               LONG_L  $22, GDB_FR_REG22(sp)
-               LONG_L  $21, GDB_FR_REG21(sp)
-               LONG_L  $20, GDB_FR_REG20(sp)
-               LONG_L  $19, GDB_FR_REG19(sp)
-               LONG_L  $18, GDB_FR_REG18(sp)
-               LONG_L  $17, GDB_FR_REG17(sp)
-               LONG_L  $16, GDB_FR_REG16(sp)
-               LONG_L  $15, GDB_FR_REG15(sp)
-               LONG_L  $14, GDB_FR_REG14(sp)
-               LONG_L  $13, GDB_FR_REG13(sp)
-               LONG_L  $12, GDB_FR_REG12(sp)
-               LONG_L  $11, GDB_FR_REG11(sp)
-               LONG_L  $10, GDB_FR_REG10(sp)
-               LONG_L  $9, GDB_FR_REG9(sp)
-               LONG_L  $8, GDB_FR_REG8(sp)
-               LONG_L  $7, GDB_FR_REG7(sp)
-               LONG_L  $6, GDB_FR_REG6(sp)
-               LONG_L  $5, GDB_FR_REG5(sp)
-               LONG_L  $4, GDB_FR_REG4(sp)
-               LONG_L  $3, GDB_FR_REG3(sp)
-               LONG_L  $2, GDB_FR_REG2(sp)
-               LONG_L  $1, GDB_FR_REG1(sp)
-#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
-               LONG_L  k0, GDB_FR_EPC(sp)
-               LONG_L  $29, GDB_FR_REG29(sp)           /* Deallocate stack */
-               jr      k0
-               rfe
-#else
-               LONG_L  sp, GDB_FR_REG29(sp)            /* Deallocate stack */
-
-               .set    mips3
-               eret
-               .set    mips0
-#endif
-               .set    at
-               .set    reorder
-               END(trap_low)
-
-LEAF(kgdb_read_byte)
-4:             lb      t0, (a0)
-               sb      t0, (a1)
-               li      v0, 0
-               jr      ra
-               .section __ex_table,"a"
-               PTR     4b, kgdbfault
-               .previous
-               END(kgdb_read_byte)
-
-LEAF(kgdb_write_byte)
-5:             sb      a0, (a1)
-               li      v0, 0
-               jr      ra
-               .section __ex_table,"a"
-               PTR     5b, kgdbfault
-               .previous
-               END(kgdb_write_byte)
-
-               .type   kgdbfault@function
-               .ent    kgdbfault
-
-kgdbfault:     li      v0, -EFAULT
-               jr      ra
-               .end    kgdbfault
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
deleted file mode 100644 (file)
index 25f4eab..0000000
+++ /dev/null
@@ -1,1155 +0,0 @@
-/*
- *  arch/mips/kernel/gdb-stub.c
- *
- *  Originally written by Glenn Engel, Lake Stevens Instrument Division
- *
- *  Contributed by HP Systems
- *
- *  Modified for SPARC by Stu Grossman, Cygnus Support.
- *
- *  Modified for Linux/MIPS (and MIPS in general) by Andreas Busse
- *  Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
- *
- *  Copyright (C) 1995 Andreas Busse
- *
- *  Copyright (C) 2003 MontaVista Software Inc.
- *  Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- */
-
-/*
- *  To enable debugger support, two things need to happen.  One, a
- *  call to set_debug_traps() is necessary in order to allow any breakpoints
- *  or error conditions to be properly intercepted and reported to gdb.
- *  Two, a breakpoint needs to be generated to begin communication.  This
- *  is most easily accomplished by a call to breakpoint().  Breakpoint()
- *  simulates a breakpoint by executing a BREAK instruction.
- *
- *
- *    The following gdb commands are supported:
- *
- * command          function                               Return value
- *
- *    g             return the value of the CPU registers  hex data or ENN
- *    G             set the value of the CPU registers     OK or ENN
- *
- *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA      hex data or ENN
- *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA      OK or ENN
- *
- *    c             Resume at current address              SNN   ( signal NN)
- *    cAA..AA       Continue at address AA..AA             SNN
- *
- *    s             Step one instruction                   SNN
- *    sAA..AA       Step one instruction from AA..AA       SNN
- *
- *    k             kill
- *
- *    ?             What was the last sigval ?             SNN   (signal NN)
- *
- *    bBB..BB      Set baud rate to BB..BB                OK or BNN, then sets
- *                                                        baud rate
- *
- * All commands and responses are sent with a packet which includes a
- * checksum.  A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum>    :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer.  '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host:                  Reply:
- * $m0,10#2a               +$00010203040506070809101112131415#42
- *
- *
- *  ==============
- *  MORE EXAMPLES:
- *  ==============
- *
- *  For reference -- the following are the steps that one
- *  company took (RidgeRun Inc) to get remote gdb debugging
- *  going. In this scenario the host machine was a PC and the
- *  target platform was a Galileo EVB64120A MIPS evaluation
- *  board.
- *
- *  Step 1:
- *  First download gdb-5.0.tar.gz from the internet.
- *  and then build/install the package.
- *
- *  Example:
- *    $ tar zxf gdb-5.0.tar.gz
- *    $ cd gdb-5.0
- *    $ ./configure --target=mips-linux-elf
- *    $ make
- *    $ install
- *    $ which mips-linux-elf-gdb
- *    /usr/local/bin/mips-linux-elf-gdb
- *
- *  Step 2:
- *  Configure linux for remote debugging and build it.
- *
- *  Example:
- *    $ cd ~/linux
- *    $ make menuconfig <go to "Kernel Hacking" and turn on remote debugging>
- *    $ make
- *
- *  Step 3:
- *  Download the kernel to the remote target and start
- *  the kernel running. It will promptly halt and wait
- *  for the host gdb session to connect. It does this
- *  since the "Kernel Hacking" option has defined
- *  CONFIG_KGDB which in turn enables your calls
- *  to:
- *     set_debug_traps();
- *     breakpoint();
- *
- *  Step 4:
- *  Start the gdb session on the host.
- *
- *  Example:
- *    $ mips-linux-elf-gdb vmlinux
- *    (gdb) set remotebaud 115200
- *    (gdb) target remote /dev/ttyS1
- *    ...at this point you are connected to
- *       the remote target and can use gdb
- *       in the normal fasion. Setting
- *       breakpoints, single stepping,
- *       printing variables, etc.
- */
-#include <linux/string.h>
-#include <linux/kernel.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/init.h>
-#include <linux/smp.h>
-#include <linux/spinlock.h>
-#include <linux/slab.h>
-#include <linux/reboot.h>
-
-#include <asm/asm.h>
-#include <asm/cacheflush.h>
-#include <asm/mipsregs.h>
-#include <asm/pgtable.h>
-#include <asm/system.h>
-#include <asm/gdb-stub.h>
-#include <asm/inst.h>
-
-/*
- * external low-level support routines
- */
-
-extern int putDebugChar(char c);    /* write a single character      */
-extern char getDebugChar(void);     /* read and return a single char */
-extern void trap_low(void);
-
-/*
- * breakpoint and test functions
- */
-extern void breakpoint(void);
-extern void breakinst(void);
-extern void async_breakpoint(void);
-extern void async_breakinst(void);
-extern void adel(void);
-
-/*
- * local prototypes
- */
-
-static void getpacket(char *buffer);
-static void putpacket(char *buffer);
-static int computeSignal(int tt);
-static int hex(unsigned char ch);
-static int hexToInt(char **ptr, int *intValue);
-static int hexToLong(char **ptr, long *longValue);
-static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault);
-void handle_exception(struct gdb_regs *regs);
-
-int kgdb_enabled;
-
-/*
- * spin locks for smp case
- */
-static DEFINE_SPINLOCK(kgdb_lock);
-static raw_spinlock_t kgdb_cpulock[NR_CPUS] = {
-       [0 ... NR_CPUS-1] = __RAW_SPIN_LOCK_UNLOCKED,
-};
-
-/*
- * BUFMAX defines the maximum number of characters in inbound/outbound buffers
- * at least NUMREGBYTES*2 are needed for register packets
- */
-#define BUFMAX 2048
-
-static char input_buffer[BUFMAX];
-static char output_buffer[BUFMAX];
-static int initialized;        /* !0 means we've been initialized */
-static int kgdb_started;
-static const char hexchars[]="0123456789abcdef";
-
-/* Used to prevent crashes in memory access.  Note that they'll crash anyway if
-   we haven't set up fault handlers yet... */
-int kgdb_read_byte(unsigned char *address, unsigned char *dest);
-int kgdb_write_byte(unsigned char val, unsigned char *dest);
-
-/*
- * Convert ch from a hex digit to an int
- */
-static int hex(unsigned char ch)
-{
-       if (ch >= 'a' && ch <= 'f')
-               return ch-'a'+10;
-       if (ch >= '0' && ch <= '9')
-               return ch-'0';
-       if (ch >= 'A' && ch <= 'F')
-               return ch-'A'+10;
-       return -1;
-}
-
-/*
- * scan for the sequence $<data>#<checksum>
- */
-static void getpacket(char *buffer)
-{
-       unsigned char checksum;
-       unsigned char xmitcsum;
-       int i;
-       int count;
-       unsigned char ch;
-
-       do {
-               /*
-                * wait around for the start character,
-                * ignore all other characters
-                */
-               while ((ch = (getDebugChar() & 0x7f)) != '$') ;
-
-               checksum = 0;
-               xmitcsum = -1;
-               count = 0;
-
-               /*
-                * now, read until a # or end of buffer is found
-                */
-               while (count < BUFMAX) {
-                       ch = getDebugChar();
-                       if (ch == '#')
-                               break;
-                       checksum = checksum + ch;
-                       buffer[count] = ch;
-                       count = count + 1;
-               }
-
-               if (count >= BUFMAX)
-                       continue;
-
-               buffer[count] = 0;
-
-               if (ch == '#') {
-                       xmitcsum = hex(getDebugChar() & 0x7f) << 4;
-                       xmitcsum |= hex(getDebugChar() & 0x7f);
-
-                       if (checksum != xmitcsum)
-                               putDebugChar('-');      /* failed checksum */
-                       else {
-                               putDebugChar('+'); /* successful transfer */
-
-                               /*
-                                * if a sequence char is present,
-                                * reply the sequence ID
-                                */
-                               if (buffer[2] == ':') {
-                                       putDebugChar(buffer[0]);
-                                       putDebugChar(buffer[1]);
-
-                                       /*
-                                        * remove sequence chars from buffer
-                                        */
-                                       count = strlen(buffer);
-                                       for (i=3; i <= count; i++)
-                                               buffer[i-3] = buffer[i];
-                               }
-                       }
-               }
-       }
-       while (checksum != xmitcsum);
-}
-
-/*
- * send the packet in buffer.
- */
-static void putpacket(char *buffer)
-{
-       unsigned char checksum;
-       int count;
-       unsigned char ch;
-
-       /*
-        * $<packet info>#<checksum>.
-        */
-
-       do {
-               putDebugChar('$');
-               checksum = 0;
-               count = 0;
-
-               while ((ch = buffer[count]) != 0) {
-                       if (!(putDebugChar(ch)))
-                               return;
-                       checksum += ch;
-                       count += 1;
-               }
-
-               putDebugChar('#');
-               putDebugChar(hexchars[checksum >> 4]);
-               putDebugChar(hexchars[checksum & 0xf]);
-
-       }
-       while ((getDebugChar() & 0x7f) != '+');
-}
-
-
-/*
- * Convert the memory pointed to by mem into hex, placing result in buf.
- * Return a pointer to the last char put in buf (null), in case of mem fault,
- * return 0.
- * may_fault is non-zero if we are reading from arbitrary memory, but is currently
- * not used.
- */
-static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault)
-{
-       unsigned char ch;
-
-       while (count-- > 0) {
-               if (kgdb_read_byte(mem++, &ch) != 0)
-                       return 0;
-               *buf++ = hexchars[ch >> 4];
-               *buf++ = hexchars[ch & 0xf];
-       }
-
-       *buf = 0;
-
-       return buf;
-}
-
-/*
- * convert the hex array pointed to by buf into binary to be placed in mem
- * return a pointer to the character AFTER the last byte written
- * may_fault is non-zero if we are reading from arbitrary memory, but is currently
- * not used.
- */
-static char *hex2mem(char *buf, char *mem, int count, int binary, int may_fault)
-{
-       int i;
-       unsigned char ch;
-
-       for (i=0; i<count; i++)
-       {
-               if (binary) {
-                       ch = *buf++;
-                       if (ch == 0x7d)
-                               ch = 0x20 ^ *buf++;
-               }
-               else {
-                       ch = hex(*buf++) << 4;
-                       ch |= hex(*buf++);
-               }
-               if (kgdb_write_byte(ch, mem++) != 0)
-                       return 0;
-       }
-
-       return mem;
-}
-
-/*
- * This table contains the mapping between SPARC hardware trap types, and
- * signals, which are primarily what GDB understands.  It also indicates
- * which hardware traps we need to commandeer when initializing the stub.
- */
-static struct hard_trap_info {
-       unsigned char tt;               /* Trap type code for MIPS R3xxx and R4xxx */
-       unsigned char signo;            /* Signal that we map this trap into */
-} hard_trap_info[] = {
-       { 6, SIGBUS },                  /* instruction bus error */
-       { 7, SIGBUS },                  /* data bus error */
-       { 9, SIGTRAP },                 /* break */
-       { 10, SIGILL },                 /* reserved instruction */
-/*     { 11, SIGILL },         */      /* CPU unusable */
-       { 12, SIGFPE },                 /* overflow */
-       { 13, SIGTRAP },                /* trap */
-       { 14, SIGSEGV },                /* virtual instruction cache coherency */
-       { 15, SIGFPE },                 /* floating point exception */
-       { 23, SIGSEGV },                /* watch */
-       { 31, SIGSEGV },                /* virtual data cache coherency */
-       { 0, 0}                         /* Must be last */
-};
-
-/* Save the normal trap handlers for user-mode traps. */
-void *saved_vectors[32];
-
-/*
- * Set up exception handlers for tracing and breakpoints
- */
-void set_debug_traps(void)
-{
-       struct hard_trap_info *ht;
-       unsigned long flags;
-       unsigned char c;
-
-       local_irq_save(flags);
-       for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
-               saved_vectors[ht->tt] = set_except_vector(ht->tt, trap_low);
-
-       putDebugChar('+'); /* 'hello world' */
-       /*
-        * In case GDB is started before us, ack any packets
-        * (presumably "$?#xx") sitting there.
-        */
-       while((c = getDebugChar()) != '$');
-       while((c = getDebugChar()) != '#');
-       c = getDebugChar(); /* eat first csum byte */
-       c = getDebugChar(); /* eat second csum byte */
-       putDebugChar('+'); /* ack it */
-
-       initialized = 1;
-       local_irq_restore(flags);
-}
-
-void restore_debug_traps(void)
-{
-       struct hard_trap_info *ht;
-       unsigned long flags;
-
-       local_irq_save(flags);
-       for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
-               set_except_vector(ht->tt, saved_vectors[ht->tt]);
-       local_irq_restore(flags);
-}
-
-/*
- * Convert the MIPS hardware trap type code to a Unix signal number.
- */
-static int computeSignal(int tt)
-{
-       struct hard_trap_info *ht;
-
-       for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
-               if (ht->tt == tt)
-                       return ht->signo;
-
-       return SIGHUP;          /* default for things we don't know about */
-}
-
-/*
- * While we find nice hex chars, build an int.
- * Return number of chars processed.
- */
-static int hexToInt(char **ptr, int *intValue)
-{
-       int numChars = 0;
-       int hexValue;
-
-       *intValue = 0;
-
-       while (**ptr) {
-               hexValue = hex(**ptr);
-               if (hexValue < 0)
-                       break;
-
-               *intValue = (*intValue << 4) | hexValue;
-               numChars ++;
-
-               (*ptr)++;
-       }
-
-       return (numChars);
-}
-
-static int hexToLong(char **ptr, long *longValue)
-{
-       int numChars = 0;
-       int hexValue;
-
-       *longValue = 0;
-
-       while (**ptr) {
-               hexValue = hex(**ptr);
-               if (hexValue < 0)
-                       break;
-
-               *longValue = (*longValue << 4) | hexValue;
-               numChars ++;
-
-               (*ptr)++;
-       }
-
-       return numChars;
-}
-
-
-#if 0
-/*
- * Print registers (on target console)
- * Used only to debug the stub...
- */
-void show_gdbregs(struct gdb_regs * regs)
-{
-       /*
-        * Saved main processor registers
-        */
-       printk("$0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-              regs->reg0, regs->reg1, regs->reg2, regs->reg3,
-              regs->reg4, regs->reg5, regs->reg6, regs->reg7);
-       printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-              regs->reg8, regs->reg9, regs->reg10, regs->reg11,
-              regs->reg12, regs->reg13, regs->reg14, regs->reg15);
-       printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-              regs->reg16, regs->reg17, regs->reg18, regs->reg19,
-              regs->reg20, regs->reg21, regs->reg22, regs->reg23);
-       printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-              regs->reg24, regs->reg25, regs->reg26, regs->reg27,
-              regs->reg28, regs->reg29, regs->reg30, regs->reg31);
-
-       /*
-        * Saved cp0 registers
-        */
-       printk("epc  : %08lx\nStatus: %08lx\nCause : %08lx\n",
-              regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
-}
-#endif /* dead code */
-
-/*
- * We single-step by setting breakpoints. When an exception
- * is handled, we need to restore the instructions hoisted
- * when the breakpoints were set.
- *
- * This is where we save the original instructions.
- */
-static struct gdb_bp_save {
-       unsigned long addr;
-       unsigned int val;
-} step_bp[2];
-
-#define BP 0x0000000d  /* break opcode */
-
-/*
- * Set breakpoint instructions for single stepping.
- */
-static void single_step(struct gdb_regs *regs)
-{
-       union mips_instruction insn;
-       unsigned long targ;
-       int is_branch, is_cond, i;
-
-       targ = regs->cp0_epc;
-       insn.word = *(unsigned int *)targ;
-       is_branch = is_cond = 0;
-
-       switch (insn.i_format.opcode) {
-       /*
-        * jr and jalr are in r_format format.
-        */
-       case spec_op:
-               switch (insn.r_format.func) {
-               case jalr_op:
-               case jr_op:
-                       targ = *(&regs->reg0 + insn.r_format.rs);
-                       is_branch = 1;
-                       break;
-               }
-               break;
-
-       /*
-        * This group contains:
-        * bltz_op, bgez_op, bltzl_op, bgezl_op,
-        * bltzal_op, bgezal_op, bltzall_op, bgezall_op.
-        */
-       case bcond_op:
-               is_branch = is_cond = 1;
-               targ += 4 + (insn.i_format.simmediate << 2);
-               break;
-
-       /*
-        * These are unconditional and in j_format.
-        */
-       case jal_op:
-       case j_op:
-               is_branch = 1;
-               targ += 4;
-               targ >>= 28;
-               targ <<= 28;
-               targ |= (insn.j_format.target << 2);
-               break;
-
-       /*
-        * These are conditional.
-        */
-       case beq_op:
-       case beql_op:
-       case bne_op:
-       case bnel_op:
-       case blez_op:
-       case blezl_op:
-       case bgtz_op:
-       case bgtzl_op:
-       case cop0_op:
-       case cop1_op:
-       case cop2_op:
-       case cop1x_op:
-               is_branch = is_cond = 1;
-               targ += 4 + (insn.i_format.simmediate << 2);
-               break;
-       }
-
-       if (is_branch) {
-               i = 0;
-               if (is_cond && targ != (regs->cp0_epc + 8)) {
-                       step_bp[i].addr = regs->cp0_epc + 8;
-                       step_bp[i++].val = *(unsigned *)(regs->cp0_epc + 8);
-                       *(unsigned *)(regs->cp0_epc + 8) = BP;
-               }
-               step_bp[i].addr = targ;
-               step_bp[i].val  = *(unsigned *)targ;
-               *(unsigned *)targ = BP;
-       } else {
-               step_bp[0].addr = regs->cp0_epc + 4;
-               step_bp[0].val  = *(unsigned *)(regs->cp0_epc + 4);
-               *(unsigned *)(regs->cp0_epc + 4) = BP;
-       }
-}
-
-/*
- *  If asynchronously interrupted by gdb, then we need to set a breakpoint
- *  at the interrupted instruction so that we wind up stopped with a
- *  reasonable stack frame.
- */
-static struct gdb_bp_save async_bp;
-
-/*
- * Swap the interrupted EPC with our asynchronous breakpoint routine.
- * This is safer than stuffing the breakpoint in-place, since no cache
- * flushes (or resulting smp_call_functions) are required.  The
- * assumption is that only one CPU will be handling asynchronous bp's,
- * and only one can be active at a time.
- */
-extern spinlock_t smp_call_lock;
-
-void set_async_breakpoint(unsigned long *epc)
-{
-       /* skip breaking into userland */
-       if ((*epc & 0x80000000) == 0)
-               return;
-
-#ifdef CONFIG_SMP
-       /* avoid deadlock if someone is make IPC */
-       if (spin_is_locked(&smp_call_lock))
-               return;
-#endif
-
-       async_bp.addr = *epc;
-       *epc = (unsigned long)async_breakpoint;
-}
-
-#ifdef CONFIG_SMP
-static void kgdb_wait(void *arg)
-{
-       unsigned flags;
-       int cpu = smp_processor_id();
-
-       local_irq_save(flags);
-
-       __raw_spin_lock(&kgdb_cpulock[cpu]);
-       __raw_spin_unlock(&kgdb_cpulock[cpu]);
-
-       local_irq_restore(flags);
-}
-#endif
-
-/*
- * GDB stub needs to call kgdb_wait on all processor with interrupts
- * disabled, so it uses it's own special variant.
- */
-static int kgdb_smp_call_kgdb_wait(void)
-{
-#ifdef CONFIG_SMP
-       cpumask_t mask = cpu_online_map;
-       struct call_data_struct data;
-       int cpu = smp_processor_id();
-       int cpus;
-
-       /*
-        * Can die spectacularly if this CPU isn't yet marked online
-        */
-       BUG_ON(!cpu_online(cpu));
-
-       cpu_clear(cpu, mask);
-       cpus = cpus_weight(mask);
-       if (!cpus)
-               return 0;
-
-       if (spin_is_locked(&smp_call_lock)) {
-               /*
-                * Some other processor is trying to make us do something
-                * but we're not going to respond... give up
-                */
-               return -1;
-               }
-
-       /*
-        * We will continue here, accepting the fact that
-        * the kernel may deadlock if another CPU attempts
-        * to call smp_call_function now...
-        */
-
-       data.func = kgdb_wait;
-       data.info = NULL;
-       atomic_set(&data.started, 0);
-       data.wait = 0;
-
-       spin_lock(&smp_call_lock);
-       call_data = &data;
-       mb();
-
-       core_send_ipi_mask(mask, SMP_CALL_FUNCTION);
-
-       /* Wait for response */
-       /* FIXME: lock-up detection, backtrace on lock-up */
-       while (atomic_read(&data.started) != cpus)
-               barrier();
-
-       call_data = NULL;
-       spin_unlock(&smp_call_lock);
-#endif
-
-       return 0;
-}
-
-/*
- * This function does all command processing for interfacing to gdb.  It
- * returns 1 if you should skip the instruction at the trap address, 0
- * otherwise.
- */
-void handle_exception(struct gdb_regs *regs)
-{
-       int trap;                       /* Trap type */
-       int sigval;
-       long addr;
-       int length;
-       char *ptr;
-       unsigned long *stack;
-       int i;
-       int bflag = 0;
-
-       kgdb_started = 1;
-
-       /*
-        * acquire the big kgdb spinlock
-        */
-       if (!spin_trylock(&kgdb_lock)) {
-               /*
-                * some other CPU has the lock, we should go back to
-                * receive the gdb_wait IPC
-                */
-               return;
-       }
-
-       /*
-        * If we're in async_breakpoint(), restore the real EPC from
-        * the breakpoint.
-        */
-       if (regs->cp0_epc == (unsigned long)async_breakinst) {
-               regs->cp0_epc = async_bp.addr;
-               async_bp.addr = 0;
-       }
-
-       /*
-        * acquire the CPU spinlocks
-        */
-       for_each_online_cpu(i)
-               if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0)
-                       panic("kgdb: couldn't get cpulock %d\n", i);
-
-       /*
-        * force other cpus to enter kgdb
-        */
-       kgdb_smp_call_kgdb_wait();
-
-       /*
-        * If we're in breakpoint() increment the PC
-        */
-       trap = (regs->cp0_cause & 0x7c) >> 2;
-       if (trap == 9 && regs->cp0_epc == (unsigned long)breakinst)
-               regs->cp0_epc += 4;
-
-       /*
-        * If we were single_stepping, restore the opcodes hoisted
-        * for the breakpoint[s].
-        */
-       if (step_bp[0].addr) {
-               *(unsigned *)step_bp[0].addr = step_bp[0].val;
-               step_bp[0].addr = 0;
-
-               if (step_bp[1].addr) {
-                       *(unsigned *)step_bp[1].addr = step_bp[1].val;
-                       step_bp[1].addr = 0;
-               }
-       }
-
-       stack = (long *)regs->reg29;                    /* stack ptr */
-       sigval = computeSignal(trap);
-
-       /*
-        * reply to host that an exception has occurred
-        */
-       ptr = output_buffer;
-
-       /*
-        * Send trap type (converted to signal)
-        */
-       *ptr++ = 'T';
-       *ptr++ = hexchars[sigval >> 4];
-       *ptr++ = hexchars[sigval & 0xf];
-
-       /*
-        * Send Error PC
-        */
-       *ptr++ = hexchars[REG_EPC >> 4];
-       *ptr++ = hexchars[REG_EPC & 0xf];
-       *ptr++ = ':';
-       ptr = mem2hex((char *)&regs->cp0_epc, ptr, sizeof(long), 0);
-       *ptr++ = ';';
-
-       /*
-        * Send frame pointer
-        */
-       *ptr++ = hexchars[REG_FP >> 4];
-       *ptr++ = hexchars[REG_FP & 0xf];
-       *ptr++ = ':';
-       ptr = mem2hex((char *)&regs->reg30, ptr, sizeof(long), 0);
-       *ptr++ = ';';
-
-       /*
-        * Send stack pointer
-        */
-       *ptr++ = hexchars[REG_SP >> 4];
-       *ptr++ = hexchars[REG_SP & 0xf];
-       *ptr++ = ':';
-       ptr = mem2hex((char *)&regs->reg29, ptr, sizeof(long), 0);
-       *ptr++ = ';';
-
-       *ptr++ = 0;
-       putpacket(output_buffer);       /* send it off... */
-
-       /*
-        * Wait for input from remote GDB
-        */
-       while (1) {
-               output_buffer[0] = 0;
-               getpacket(input_buffer);
-
-               switch (input_buffer[0])
-               {
-               case '?':
-                       output_buffer[0] = 'S';
-                       output_buffer[1] = hexchars[sigval >> 4];
-                       output_buffer[2] = hexchars[sigval & 0xf];
-                       output_buffer[3] = 0;
-                       break;
-
-               /*
-                * Detach debugger; let CPU run
-                */
-               case 'D':
-                       putpacket(output_buffer);
-                       goto finish_kgdb;
-                       break;
-
-               case 'd':
-                       /* toggle debug flag */
-                       break;
-
-               /*
-                * Return the value of the CPU registers
-                */
-               case 'g':
-                       ptr = output_buffer;
-                       ptr = mem2hex((char *)&regs->reg0, ptr, 32*sizeof(long), 0); /* r0...r31 */
-                       ptr = mem2hex((char *)&regs->cp0_status, ptr, 6*sizeof(long), 0); /* cp0 */
-                       ptr = mem2hex((char *)&regs->fpr0, ptr, 32*sizeof(long), 0); /* f0...31 */
-                       ptr = mem2hex((char *)&regs->cp1_fsr, ptr, 2*sizeof(long), 0); /* cp1 */
-                       ptr = mem2hex((char *)&regs->frame_ptr, ptr, 2*sizeof(long), 0); /* frp */
-                       ptr = mem2hex((char *)&regs->cp0_index, ptr, 16*sizeof(long), 0); /* cp0 */
-                       break;
-
-               /*
-                * set the value of the CPU registers - return OK
-                */
-               case 'G':
-               {
-                       ptr = &input_buffer[1];
-                       hex2mem(ptr, (char *)&regs->reg0, 32*sizeof(long), 0, 0);
-                       ptr += 32*(2*sizeof(long));
-                       hex2mem(ptr, (char *)&regs->cp0_status, 6*sizeof(long), 0, 0);
-                       ptr += 6*(2*sizeof(long));
-                       hex2mem(ptr, (char *)&regs->fpr0, 32*sizeof(long), 0, 0);
-                       ptr += 32*(2*sizeof(long));
-                       hex2mem(ptr, (char *)&regs->cp1_fsr, 2*sizeof(long), 0, 0);
-                       ptr += 2*(2*sizeof(long));
-                       hex2mem(ptr, (char *)&regs->frame_ptr, 2*sizeof(long), 0, 0);
-                       ptr += 2*(2*sizeof(long));
-                       hex2mem(ptr, (char *)&regs->cp0_index, 16*sizeof(long), 0, 0);
-                       strcpy(output_buffer, "OK");
-                }
-               break;
-
-               /*
-                * mAA..AA,LLLL  Read LLLL bytes at address AA..AA
-                */
-               case 'm':
-                       ptr = &input_buffer[1];
-
-                       if (hexToLong(&ptr, &addr)
-                               && *ptr++ == ','
-                               && hexToInt(&ptr, &length)) {
-                               if (mem2hex((char *)addr, output_buffer, length, 1))
-                                       break;
-                               strcpy(output_buffer, "E03");
-                       } else
-                               strcpy(output_buffer, "E01");
-                       break;
-
-               /*
-                * XAA..AA,LLLL: Write LLLL escaped binary bytes at address AA.AA
-                */
-               case 'X':
-                       bflag = 1;
-                       /* fall through */
-
-               /*
-                * MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK
-                */
-               case 'M':
-                       ptr = &input_buffer[1];
-
-                       if (hexToLong(&ptr, &addr)
-                               && *ptr++ == ','
-                               && hexToInt(&ptr, &length)
-                               && *ptr++ == ':') {
-                               if (hex2mem(ptr, (char *)addr, length, bflag, 1))
-                                       strcpy(output_buffer, "OK");
-                               else
-                                       strcpy(output_buffer, "E03");
-                       }
-                       else
-                               strcpy(output_buffer, "E02");
-                       break;
-
-               /*
-                * cAA..AA    Continue at address AA..AA(optional)
-                */
-               case 'c':
-                       /* try to read optional parameter, pc unchanged if no parm */
-
-                       ptr = &input_buffer[1];
-                       if (hexToLong(&ptr, &addr))
-                               regs->cp0_epc = addr;
-
-                       goto exit_kgdb_exception;
-                       break;
-
-               /*
-                * kill the program; let us try to restart the machine
-                * Reset the whole machine.
-                */
-               case 'k':
-               case 'r':
-                       machine_restart("kgdb restarts machine");
-                       break;
-
-               /*
-                * Step to next instruction
-                */
-               case 's':
-                       /*
-                        * There is no single step insn in the MIPS ISA, so we
-                        * use breakpoints and continue, instead.
-                        */
-                       single_step(regs);
-                       goto exit_kgdb_exception;
-                       /* NOTREACHED */
-                       break;
-
-               /*
-                * Set baud rate (bBB)
-                * FIXME: Needs to be written
-                */
-               case 'b':
-               {
-#if 0
-                       int baudrate;
-                       extern void set_timer_3();
-
-                       ptr = &input_buffer[1];
-                       if (!hexToInt(&ptr, &baudrate))
-                       {
-                               strcpy(output_buffer, "B01");
-                               break;
-                       }
-
-                       /* Convert baud rate to uart clock divider */
-
-                       switch (baudrate)
-                       {
-                               case 38400:
-                                       baudrate = 16;
-                                       break;
-                               case 19200:
-                                       baudrate = 33;
-                                       break;
-                               case 9600:
-                                       baudrate = 65;
-                                       break;
-                               default:
-                                       baudrate = 0;
-                                       strcpy(output_buffer, "B02");
-                                       goto x1;
-                       }
-
-                       if (baudrate) {
-                               putpacket("OK");        /* Ack before changing speed */
-                               set_timer_3(baudrate); /* Set it */
-                       }
-#endif
-               }
-               break;
-
-               }                       /* switch */
-
-               /*
-                * reply to the request
-                */
-
-               putpacket(output_buffer);
-
-       } /* while */
-
-       return;
-
-finish_kgdb:
-       restore_debug_traps();
-
-exit_kgdb_exception:
-       /* release locks so other CPUs can go */
-       for_each_online_cpu(i)
-               __raw_spin_unlock(&kgdb_cpulock[i]);
-       spin_unlock(&kgdb_lock);
-
-       __flush_cache_all();
-       return;
-}
-
-/*
- * This function will generate a breakpoint exception.  It is used at the
- * beginning of a program to sync up with a debugger and can be used
- * otherwise as a quick means to stop program execution and "break" into
- * the debugger.
- */
-void breakpoint(void)
-{
-       if (!initialized)
-               return;
-
-       __asm__ __volatile__(
-                       ".globl breakinst\n\t"
-                       ".set\tnoreorder\n\t"
-                       "nop\n"
-                       "breakinst:\tbreak\n\t"
-                       "nop\n\t"
-                       ".set\treorder"
-                       );
-}
-
-/* Nothing but the break; don't pollute any registers */
-void async_breakpoint(void)
-{
-       __asm__ __volatile__(
-                       ".globl async_breakinst\n\t"
-                       ".set\tnoreorder\n\t"
-                       "nop\n"
-                       "async_breakinst:\tbreak\n\t"
-                       "nop\n\t"
-                       ".set\treorder"
-                       );
-}
-
-void adel(void)
-{
-       __asm__ __volatile__(
-                       ".globl\tadel\n\t"
-                       "lui\t$8,0x8000\n\t"
-                       "lw\t$9,1($8)\n\t"
-                       );
-}
-
-/*
- * malloc is needed by gdb client in "call func()", even a private one
- * will make gdb happy
- */
-static void __used *malloc(size_t size)
-{
-       return kmalloc(size, GFP_ATOMIC);
-}
-
-static void __used free(void *where)
-{
-       kfree(where);
-}
-
-#ifdef CONFIG_GDB_CONSOLE
-
-void gdb_putsn(const char *str, int l)
-{
-       char outbuf[18];
-
-       if (!kgdb_started)
-               return;
-
-       outbuf[0]='O';
-
-       while(l) {
-               int i = (l>8)?8:l;
-               mem2hex((char *)str, &outbuf[1], i, 0);
-               outbuf[(i*2)+1]=0;
-               putpacket(outbuf);
-               str += i;
-               l -= i;
-       }
-}
-
-static void gdb_console_write(struct console *con, const char *s, unsigned n)
-{
-       gdb_putsn(s, n);
-}
-
-static struct console gdb_console = {
-       .name   = "gdb",
-       .write  = gdb_console_write,
-       .flags  = CON_PRINTBUFFER,
-       .index  = -1
-};
-
-static int __init register_gdb_console(void)
-{
-       register_console(&gdb_console);
-
-       return 0;
-}
-
-console_initcall(register_gdb_console);
-
-#endif
index 6045b9a51a35f74e218db115dc98b4554670b1e2..4b4007b3083a8f881cef80371e68a2a688c55f32 100644 (file)
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/kallsyms.h>
+#include <linux/kgdb.h>
 
 #include <asm/atomic.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
+#ifdef CONFIG_KGDB
+int kgdb_early_setup;
+#endif
+
 static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
 
 int allocate_irqno(void)
@@ -126,33 +131,22 @@ asmlinkage void spurious_interrupt(void)
        atomic_inc(&irq_err_count);
 }
 
-#ifdef CONFIG_KGDB
-extern void breakpoint(void);
-extern void set_debug_traps(void);
-
-static int kgdb_flag = 1;
-static int __init nokgdb(char *str)
-{
-       kgdb_flag = 0;
-       return 1;
-}
-__setup("nokgdb", nokgdb);
-#endif
-
 void __init init_IRQ(void)
 {
        int i;
 
+#ifdef CONFIG_KGDB
+       if (kgdb_early_setup)
+               return;
+#endif
+
        for (i = 0; i < NR_IRQS; i++)
                set_irq_noprobe(i);
 
        arch_init_irq();
 
 #ifdef CONFIG_KGDB
-       if (kgdb_flag) {
-               printk("Wait for gdb client connection ...\n");
-               set_debug_traps();
-               breakpoint();
-       }
+       if (!kgdb_early_setup)
+               kgdb_early_setup = 1;
 #endif
 }
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
new file mode 100644 (file)
index 0000000..c5a8b2d
--- /dev/null
@@ -0,0 +1,281 @@
+/*
+ *  Originally written by Glenn Engel, Lake Stevens Instrument Division
+ *
+ *  Contributed by HP Systems
+ *
+ *  Modified for Linux/MIPS (and MIPS in general) by Andreas Busse
+ *  Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
+ *
+ *  Copyright (C) 1995 Andreas Busse
+ *
+ *  Copyright (C) 2003 MontaVista Software Inc.
+ *  Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ *  Copyright (C) 2004-2005 MontaVista Software Inc.
+ *  Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com
+ *
+ *  Copyright (C) 2007-2008 Wind River Systems, Inc.
+ *  Author/Maintainer: Jason Wessel, jason.wessel@windriver.com
+ *
+ *  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.
+ */
+
+#include <linux/ptrace.h>              /* for linux pt_regs struct */
+#include <linux/kgdb.h>
+#include <linux/kdebug.h>
+#include <linux/sched.h>
+#include <asm/inst.h>
+#include <asm/fpu.h>
+#include <asm/cacheflush.h>
+#include <asm/processor.h>
+#include <asm/sigcontext.h>
+
+static struct hard_trap_info {
+       unsigned char tt;       /* Trap type code for MIPS R3xxx and R4xxx */
+       unsigned char signo;    /* Signal that we map this trap into */
+} hard_trap_info[] = {
+       { 6, SIGBUS },          /* instruction bus error */
+       { 7, SIGBUS },          /* data bus error */
+       { 9, SIGTRAP },         /* break */
+/*     { 11, SIGILL }, */      /* CPU unusable */
+       { 12, SIGFPE },         /* overflow */
+       { 13, SIGTRAP },        /* trap */
+       { 14, SIGSEGV },        /* virtual instruction cache coherency */
+       { 15, SIGFPE },         /* floating point exception */
+       { 23, SIGSEGV },        /* watch */
+       { 31, SIGSEGV },        /* virtual data cache coherency */
+       { 0, 0}                 /* Must be last */
+};
+
+void arch_kgdb_breakpoint(void)
+{
+       __asm__ __volatile__(
+               ".globl breakinst\n\t"
+               ".set\tnoreorder\n\t"
+               "nop\n"
+               "breakinst:\tbreak\n\t"
+               "nop\n\t"
+               ".set\treorder");
+}
+
+static void kgdb_call_nmi_hook(void *ignored)
+{
+       kgdb_nmicallback(raw_smp_processor_id(), (void *)0);
+}
+
+void kgdb_roundup_cpus(unsigned long flags)
+{
+       local_irq_enable();
+       smp_call_function(kgdb_call_nmi_hook, NULL, NULL);
+       local_irq_disable();
+}
+
+static int compute_signal(int tt)
+{
+       struct hard_trap_info *ht;
+
+       for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+               if (ht->tt == tt)
+                       return ht->signo;
+
+       return SIGHUP;          /* default for things we don't know about */
+}
+
+void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
+{
+       int reg;
+
+#if (KGDB_GDB_REG_SIZE == 32)
+       u32 *ptr = (u32 *)gdb_regs;
+#else
+       u64 *ptr = (u64 *)gdb_regs;
+#endif
+
+       for (reg = 0; reg < 32; reg++)
+               *(ptr++) = regs->regs[reg];
+
+       *(ptr++) = regs->cp0_status;
+       *(ptr++) = regs->lo;
+       *(ptr++) = regs->hi;
+       *(ptr++) = regs->cp0_badvaddr;
+       *(ptr++) = regs->cp0_cause;
+       *(ptr++) = regs->cp0_epc;
+
+       /* FP REGS */
+       if (!(current && (regs->cp0_status & ST0_CU1)))
+               return;
+
+       save_fp(current);
+       for (reg = 0; reg < 32; reg++)
+               *(ptr++) = current->thread.fpu.fpr[reg];
+}
+
+void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
+{
+       int reg;
+
+#if (KGDB_GDB_REG_SIZE == 32)
+       const u32 *ptr = (u32 *)gdb_regs;
+#else
+       const u64 *ptr = (u64 *)gdb_regs;
+#endif
+
+       for (reg = 0; reg < 32; reg++)
+               regs->regs[reg] = *(ptr++);
+
+       regs->cp0_status = *(ptr++);
+       regs->lo = *(ptr++);
+       regs->hi = *(ptr++);
+       regs->cp0_badvaddr = *(ptr++);
+       regs->cp0_cause = *(ptr++);
+       regs->cp0_epc = *(ptr++);
+
+       /* FP REGS from current */
+       if (!(current && (regs->cp0_status & ST0_CU1)))
+               return;
+
+       for (reg = 0; reg < 32; reg++)
+               current->thread.fpu.fpr[reg] = *(ptr++);
+       restore_fp(current);
+}
+
+/*
+ * Similar to regs_to_gdb_regs() except that process is sleeping and so
+ * we may not be able to get all the info.
+ */
+void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
+{
+       int reg;
+       struct thread_info *ti = task_thread_info(p);
+       unsigned long ksp = (unsigned long)ti + THREAD_SIZE - 32;
+       struct pt_regs *regs = (struct pt_regs *)ksp - 1;
+#if (KGDB_GDB_REG_SIZE == 32)
+       u32 *ptr = (u32 *)gdb_regs;
+#else
+       u64 *ptr = (u64 *)gdb_regs;
+#endif
+
+       for (reg = 0; reg < 16; reg++)
+               *(ptr++) = regs->regs[reg];
+
+       /* S0 - S7 */
+       for (reg = 16; reg < 24; reg++)
+               *(ptr++) = regs->regs[reg];
+
+       for (reg = 24; reg < 28; reg++)
+               *(ptr++) = 0;
+
+       /* GP, SP, FP, RA */
+       for (reg = 28; reg < 32; reg++)
+               *(ptr++) = regs->regs[reg];
+
+       *(ptr++) = regs->cp0_status;
+       *(ptr++) = regs->lo;
+       *(ptr++) = regs->hi;
+       *(ptr++) = regs->cp0_badvaddr;
+       *(ptr++) = regs->cp0_cause;
+       *(ptr++) = regs->cp0_epc;
+}
+
+/*
+ * Calls linux_debug_hook before the kernel dies. If KGDB is enabled,
+ * then try to fall into the debugger
+ */
+static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
+                           void *ptr)
+{
+       struct die_args *args = (struct die_args *)ptr;
+       struct pt_regs *regs = args->regs;
+       int trap = (regs->cp0_cause & 0x7c) >> 2;
+
+       if (fixup_exception(regs))
+               return NOTIFY_DONE;
+
+       /* Userpace events, ignore. */
+       if (user_mode(regs))
+               return NOTIFY_DONE;
+
+       if (atomic_read(&kgdb_active) != -1)
+               kgdb_nmicallback(smp_processor_id(), regs);
+
+       if (kgdb_handle_exception(trap, compute_signal(trap), 0, regs))
+               return NOTIFY_DONE;
+
+       if (atomic_read(&kgdb_setting_breakpoint))
+               if ((trap == 9) && (regs->cp0_epc == (unsigned long)breakinst))
+                       regs->cp0_epc += 4;
+
+       /* In SMP mode, __flush_cache_all does IPI */
+       local_irq_enable();
+       __flush_cache_all();
+
+       return NOTIFY_STOP;
+}
+
+static struct notifier_block kgdb_notifier = {
+       .notifier_call = kgdb_mips_notify,
+};
+
+/*
+ * Handle the 's' and 'c' commands
+ */
+int kgdb_arch_handle_exception(int vector, int signo, int err_code,
+                              char *remcom_in_buffer, char *remcom_out_buffer,
+                              struct pt_regs *regs)
+{
+       char *ptr;
+       unsigned long address;
+       int cpu = smp_processor_id();
+
+       switch (remcom_in_buffer[0]) {
+       case 's':
+       case 'c':
+               /* handle the optional parameter */
+               ptr = &remcom_in_buffer[1];
+               if (kgdb_hex2long(&ptr, &address))
+                       regs->cp0_epc = address;
+
+               atomic_set(&kgdb_cpu_doing_single_step, -1);
+               if (remcom_in_buffer[0] == 's')
+                       if (kgdb_contthread)
+                               atomic_set(&kgdb_cpu_doing_single_step, cpu);
+
+               return 0;
+       }
+
+       return -1;
+}
+
+struct kgdb_arch arch_kgdb_ops;
+
+/*
+ * We use kgdb_early_setup so that functions we need to call now don't
+ * cause trouble when called again later.
+ */
+int kgdb_arch_init(void)
+{
+       union mips_instruction insn = {
+               .r_format = {
+                       .opcode = spec_op,
+                       .func   = break_op,
+               }
+       };
+       memcpy(arch_kgdb_ops.gdb_bpt_instr, insn.byte, BREAK_INSTR_SIZE);
+
+       register_die_notifier(&kgdb_notifier);
+
+       return 0;
+}
+
+/*
+ *     kgdb_arch_exit - Perform any architecture specific uninitalization.
+ *
+ *     This function will handle the uninitalization of any architecture
+ *     specific callbacks, for dynamic registration and unregistration.
+ */
+void kgdb_arch_exit(void)
+{
+       unregister_die_notifier(&kgdb_notifier);
+}
index b8ea4e9d0d87ee8c169feafb93c8000231d3158b..426cced1e9dce3e4d6e560fad38d26136a8c02e9 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/bootmem.h>
 #include <linux/interrupt.h>
 #include <linux/ptrace.h>
+#include <linux/kgdb.h>
+#include <linux/kdebug.h>
 
 #include <asm/bootinfo.h>
 #include <asm/branch.h>
@@ -425,6 +427,10 @@ asmlinkage void do_be(struct pt_regs *regs)
        printk(KERN_ALERT "%s bus error, epc == %0*lx, ra == %0*lx\n",
               data ? "Data" : "Instruction",
               field, regs->cp0_epc, field, regs->regs[31]);
+       if (notify_die(DIE_OOPS, "bus error", regs, SIGBUS, 0, 0)
+           == NOTIFY_STOP)
+               return;
+
        die_if_kernel("Oops", regs);
        force_sig(SIGBUS, current);
 }
@@ -623,6 +629,9 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
 {
        siginfo_t info;
 
+       if (notify_die(DIE_FP, "FP exception", regs, SIGFPE, 0, 0)
+           == NOTIFY_STOP)
+               return;
        die_if_kernel("FP exception in kernel code", regs);
 
        if (fcr31 & FPU_CSR_UNI_X) {
@@ -682,6 +691,9 @@ static void do_trap_or_bp(struct pt_regs *regs, unsigned int code,
        siginfo_t info;
        char b[40];
 
+       if (notify_die(DIE_TRAP, str, regs, code, 0, 0) == NOTIFY_STOP)
+               return;
+
        /*
         * A short test says that IRIX 5.3 sends SIGTRAP for all trap
         * insns, even for trap and break codes that indicate arithmetic
@@ -762,6 +774,10 @@ asmlinkage void do_ri(struct pt_regs *regs)
        unsigned int opcode = 0;
        int status = -1;
 
+       if (notify_die(DIE_RI, "RI Fault", regs, SIGSEGV, 0, 0)
+           == NOTIFY_STOP)
+               return;
+
        die_if_kernel("Reserved instruction in kernel code", regs);
 
        if (unlikely(compute_return_epc(regs) < 0))
@@ -1537,6 +1553,11 @@ void __init trap_init(void)
        extern char except_vec4;
        unsigned long i;
 
+#if defined(CONFIG_KGDB)
+       if (kgdb_early_setup)
+               return; /* Already done */
+#endif
+
        if (cpu_has_veic || cpu_has_vint)
                ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
        else
index a782549ac80eaa02069e40a18f6e0d98527be9b2..f0cf46adb978fcffb8d0827114408498f0acea74 100644 (file)
@@ -246,10 +246,6 @@ void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
                old_pagemask = read_c0_pagemask();
                w = read_c0_wired();
                write_c0_wired(w + 1);
-               if (read_c0_wired() != w + 1) {
-                       printk("[tlbwired] No WIRED reg?\n");
-                       return;
-               }
                write_c0_index(w << 8);
                write_c0_pagemask(pagemask);
                write_c0_entryhi(entryhi);
index f8064446e812994617a2eede971ce109c6855673..3b7dd722c32a68ff83881d3200e769660678b899 100644 (file)
@@ -13,7 +13,6 @@ obj-y                         := malta-amon.o malta-cmdline.o \
 
 obj-$(CONFIG_EARLY_PRINTK)     += malta-console.o
 obj-$(CONFIG_PCI)              += malta-pci.o
-obj-$(CONFIG_KGDB)             += malta-kgdb.o
 
 # FIXME FIXME FIXME
 obj-$(CONFIG_MIPS_MT_SMTC)     += malta_smtc.o
index c0653021a17112e8d07a4048841211268e3aefdf..4832af2516680d4ac653ac31017f6a6960bab0d6 100644 (file)
 
 #include <asm/mips-boards/malta.h>
 
-#ifdef CONFIG_KGDB
-extern int rs_kgdb_hook(int, int);
-extern int rs_putDebugChar(char);
-extern char rs_getDebugChar(void);
-extern int saa9730_kgdb_hook(int);
-extern int saa9730_putDebugChar(char);
-extern char saa9730_getDebugChar(void);
-#endif
-
 int prom_argc;
 int *_prom_argv, *_prom_envp;
 
@@ -173,51 +164,6 @@ static void __init console_config(void)
 }
 #endif
 
-#ifdef CONFIG_KGDB
-void __init kgdb_config(void)
-{
-       extern int (*generic_putDebugChar)(char);
-       extern char (*generic_getDebugChar)(void);
-       char *argptr;
-       int line, speed;
-
-       argptr = prom_getcmdline();
-       if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
-               argptr += strlen("kgdb=ttyS");
-               if (*argptr != '0' && *argptr != '1')
-                       printk("KGDB: Unknown serial line /dev/ttyS%c, "
-                              "falling back to /dev/ttyS1\n", *argptr);
-               line = *argptr == '0' ? 0 : 1;
-               printk("KGDB: Using serial line /dev/ttyS%d for session\n", line);
-
-               speed = 0;
-               if (*++argptr == ',')
-               {
-                       int c;
-                       while ((c = *++argptr) && ('0' <= c && c <= '9'))
-                               speed = speed * 10 + c - '0';
-               }
-               {
-                       speed = rs_kgdb_hook(line, speed);
-                       generic_putDebugChar = rs_putDebugChar;
-                       generic_getDebugChar = rs_getDebugChar;
-               }
-
-               pr_info("KGDB: Using serial line /dev/ttyS%d at %d for "
-                       "session, please connect your debugger\n",
-                       line ? 1 : 0, speed);
-
-               {
-                       char *s;
-                       for (s = "Please connect GDB to this port\r\n"; *s; )
-                               generic_putDebugChar(*s++);
-               }
-
-               /* Breakpoint is invoked after interrupts are initialised */
-       }
-}
-#endif
-
 static void __init mips_nmi_setup(void)
 {
        void *base;
diff --git a/arch/mips/mti-malta/malta-kgdb.c b/arch/mips/mti-malta/malta-kgdb.c
deleted file mode 100644 (file)
index 6a1854d..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Carsten Langgaard, carstenl@mips.com
- * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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.,
- *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * This is the interface to the remote debugger stub.
- */
-#include <linux/types.h>
-#include <linux/serial.h>
-#include <linux/serialP.h>
-#include <linux/serial_reg.h>
-
-#include <asm/serial.h>
-#include <asm/io.h>
-
-static struct serial_state rs_table[] = {
-       SERIAL_PORT_DFNS        /* Defined in serial.h */
-};
-
-static struct async_struct kdb_port_info = {0};
-
-int (*generic_putDebugChar)(char);
-char (*generic_getDebugChar)(void);
-
-static __inline__ unsigned int serial_in(struct async_struct *info, int offset)
-{
-       return inb(info->port + offset);
-}
-
-static __inline__ void serial_out(struct async_struct *info, int offset,
-                               int value)
-{
-       outb(value, info->port+offset);
-}
-
-int rs_kgdb_hook(int tty_no, int speed) {
-       int t;
-       struct serial_state *ser = &rs_table[tty_no];
-
-       kdb_port_info.state = ser;
-       kdb_port_info.magic = SERIAL_MAGIC;
-       kdb_port_info.port = ser->port;
-       kdb_port_info.flags = ser->flags;
-
-       /*
-        * Clear all interrupts
-        */
-       serial_in(&kdb_port_info, UART_LSR);
-       serial_in(&kdb_port_info, UART_RX);
-       serial_in(&kdb_port_info, UART_IIR);
-       serial_in(&kdb_port_info, UART_MSR);
-
-       /*
-        * Now, initialize the UART
-        */
-       serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8);   /* reset DLAB */
-       if (kdb_port_info.flags & ASYNC_FOURPORT) {
-               kdb_port_info.MCR = UART_MCR_DTR | UART_MCR_RTS;
-               t = UART_MCR_DTR | UART_MCR_OUT1;
-       } else {
-               kdb_port_info.MCR
-                       = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2;
-               t = UART_MCR_DTR | UART_MCR_RTS;
-       }
-
-       kdb_port_info.MCR = t;          /* no interrupts, please */
-       serial_out(&kdb_port_info, UART_MCR, kdb_port_info.MCR);
-
-       /*
-        * and set the speed of the serial port
-        */
-       if (speed == 0)
-               speed = 9600;
-
-       t = kdb_port_info.state->baud_base / speed;
-       /* set DLAB */
-       serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB);
-       serial_out(&kdb_port_info, UART_DLL, t & 0xff);/* LS of divisor */
-       serial_out(&kdb_port_info, UART_DLM, t >> 8);  /* MS of divisor */
-       /* reset DLAB */
-       serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8);
-
-       return speed;
-}
-
-int putDebugChar(char c)
-{
-       return generic_putDebugChar(c);
-}
-
-char getDebugChar(void)
-{
-       return generic_getDebugChar();
-}
-
-int rs_putDebugChar(char c)
-{
-
-       if (!kdb_port_info.state) {     /* need to init device first */
-               return 0;
-       }
-
-       while ((serial_in(&kdb_port_info, UART_LSR) & UART_LSR_THRE) == 0)
-               ;
-
-       serial_out(&kdb_port_info, UART_TX, c);
-
-       return 1;
-}
-
-char rs_getDebugChar(void)
-{
-       if (!kdb_port_info.state) {     /* need to init device first */
-               return 0;
-       }
-
-       while (!(serial_in(&kdb_port_info, UART_LSR) & 1))
-               ;
-
-       return serial_in(&kdb_port_info, UART_RX);
-}
index e7cad54936ca3ce9164219ae7043dbe16a9776ae..dc78b8983eeb2688b0fbae098561b53a9885c028 100644 (file)
@@ -199,10 +199,6 @@ void __init plat_mem_setup(void)
         */
        enable_dma(4);
 
-#ifdef CONFIG_KGDB
-       kgdb_config();
-#endif
-
 #ifdef CONFIG_DMA_COHERENT
        if (mips_revision_sconid != MIPS_REVISION_SCON_BONITO)
                panic("Hardware DMA cache coherency not supported");
index 31cc1a5cec3b165379d34b0514ea9ba8056c376b..dd9e7b1f7fd34f7e9d3bfb0d16bd91b0e8e02f8a 100644 (file)
@@ -24,6 +24,5 @@
 
 obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o
 obj-$(CONFIG_PCI) += pci.o
-obj-$(CONFIG_KGDB) += gdb_hook.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/nxp/pnx8550/common/gdb_hook.c b/arch/mips/nxp/pnx8550/common/gdb_hook.c
deleted file mode 100644 (file)
index ad4624f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Carsten Langgaard, carstenl@mips.com
- * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *
- * ########################################################################
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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.,
- *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * ########################################################################
- *
- * This is the interface to the remote debugger stub.
- *
- */
-#include <linux/types.h>
-#include <linux/serial.h>
-#include <linux/serialP.h>
-#include <linux/serial_reg.h>
-#include <linux/serial_ip3106.h>
-
-#include <asm/serial.h>
-#include <asm/io.h>
-
-#include <uart.h>
-
-static struct serial_state rs_table[IP3106_NR_PORTS] = {
-};
-static struct async_struct kdb_port_info = {0};
-
-void rs_kgdb_hook(int tty_no)
-{
-       struct serial_state *ser = &rs_table[tty_no];
-
-       kdb_port_info.state = ser;
-       kdb_port_info.magic = SERIAL_MAGIC;
-       kdb_port_info.port  = tty_no;
-       kdb_port_info.flags = ser->flags;
-
-       /*
-        * Clear all interrupts
-        */
-       /* Clear all the transmitter FIFO counters (pointer and status) */
-       ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
-       /* Clear all the receiver FIFO counters (pointer and status) */
-       ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
-       /* Clear all interrupts */
-       ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX |
-               IP3106_UART_INT_ALLTX;
-
-       /*
-        * Now, initialize the UART
-        */
-       ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
-       ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
-}
-
-int putDebugChar(char c)
-{
-       /* Wait until FIFO not full */
-       while (((ip3106_fifo(UART_BASE, kdb_port_info.port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
-               ;
-       /* Send one char */
-       ip3106_fifo(UART_BASE, kdb_port_info.port) = c;
-
-       return 1;
-}
-
-char getDebugChar(void)
-{
-       char ch;
-
-       /* Wait until there is a char in the FIFO */
-       while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) &
-                                       IP3106_UART_FIFO_RXFIFO) >> 8))
-               ;
-       /* Read one char */
-       ch = ip3106_fifo(UART_BASE, kdb_port_info.port) &
-               IP3106_UART_FIFO_RBRTHR;
-       /* Advance the RX FIFO read pointer */
-       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
-       return (ch);
-}
-
-void rs_disable_debug_interrupts(void)
-{
-       ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all interrupts */
-}
-
-void rs_enable_debug_interrupts(void)
-{
-       /* Clear all the transmitter FIFO counters (pointer and status) */
-       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
-       /* Clear all the receiver FIFO counters (pointer and status) */
-       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
-       /* Clear all interrupts */
-       ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX |
-               IP3106_UART_INT_ALLTX;
-       ip3106_ien(UART_BASE, kdb_port_info.port)  = IP3106_UART_INT_ALLRX; /* Enable RX interrupts */
-}
index aad03429a5e3f65aab895ce7fd04473f94ebd3e0..f080f114a1bf6d343baba163b88958f9ee406cf3 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/module.h>
 
 #include <asm/io.h>
-#include <asm/gdb-stub.h>
 #include <int.h>
 #include <uart.h>
 
index 18b125e3b65d4a222fa1a2f7ae210611687d5889..acf1fa88944456119619e57d2813041e3eb04b20 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/random.h>
 
 #include <asm/io.h>
-#include <asm/gdb-stub.h>
 #include <int.h>
 #include <uart.h>
 
index 92d764c977014da47ddaf72813dbd67344eef478..2aed50fef10ff8b800a58c8cdc0551d654b8fbf8 100644 (file)
@@ -47,7 +47,6 @@ extern void pnx8550_machine_halt(void);
 extern void pnx8550_machine_power_off(void);
 extern struct resource ioport_resource;
 extern struct resource iomem_resource;
-extern void rs_kgdb_hook(int tty_no);
 extern char *prom_getcmdline(void);
 
 struct resource standard_io_resources[] = {
@@ -142,16 +141,5 @@ void __init plat_mem_setup(void)
                ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
        }
 
-#ifdef CONFIG_KGDB
-       argptr = prom_getcmdline();
-       if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
-               int line;
-               argptr += strlen("kgdb=ttyS");
-               line = *argptr == '0' ? 0 : 1;
-               rs_kgdb_hook(line);
-               pr_info("KGDB: Using ttyS%i for session, "
-                       "please connect your debugger\n", line ? 1 : 0);
-       }
-#endif
        return;
 }
index 8a17a39e5bf2ae265f86be48924f92d44b30c71c..31c15019659544a55f81f2675abf25f7a085640e 100644 (file)
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 
 #include <asm/addrspace.h>
+#include <asm/txx9irq.h>
+#include <asm/txx9/pci.h>
 #include <asm/txx9/tx3927.h>
 
-static inline int mkaddr(unsigned char bus, unsigned char dev_fn,
-       unsigned char where)
+static int mkaddr(struct pci_bus *bus, unsigned char devfn, unsigned char where)
 {
-       if (bus == 0 && dev_fn >= PCI_DEVFN(TX3927_PCIC_MAX_DEVNU, 0))
-               return PCIBIOS_DEVICE_NOT_FOUND;
-
-       tx3927_pcicptr->ica = ((bus & 0xff) << 0x10) |
-                             ((dev_fn & 0xff) << 0x08) |
-                             (where & 0xfc);
+       if (bus->parent == NULL &&
+           devfn >= PCI_DEVFN(TX3927_PCIC_MAX_DEVNU, 0))
+               return -1;
+       tx3927_pcicptr->ica =
+               ((bus->number & 0xff) << 0x10) |
+               ((devfn & 0xff) << 0x08) |
+               (where & 0xfc) | (bus->parent ? 1 : 0);
 
        /* clear M_ABORT and Disable M_ABORT Int. */
        tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT;
        tx3927_pcicptr->pcistatim &= ~PCI_STATUS_REC_MASTER_ABORT;
-
-       return PCIBIOS_SUCCESSFUL;
+       return 0;
 }
 
 static inline int check_abort(void)
 {
-       if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT)
+       if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT) {
                tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT;
                tx3927_pcicptr->pcistatim |= PCI_STATUS_REC_MASTER_ABORT;
+               /* flush write buffer */
+               iob();
                return PCIBIOS_DEVICE_NOT_FOUND;
-
+       }
        return PCIBIOS_SUCCESSFUL;
 }
 
 static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn,
        int where, int size, u32 * val)
 {
-       int ret;
-
-       ret = mkaddr(bus->number, devfn, where);
-       if (ret)
-               return ret;
+       if (mkaddr(bus, devfn, where)) {
+               *val = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
 
        switch (size) {
        case 1:
@@ -97,11 +100,8 @@ static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn,
 static int tx3927_pci_write_config(struct pci_bus *bus, unsigned int devfn,
        int where, int size, u32 val)
 {
-       int ret;
-
-       ret = mkaddr(bus->number, devfn, where);
-       if (ret)
-               return ret;
+       if (mkaddr(bus, devfn, where))
+               return PCIBIOS_DEVICE_NOT_FOUND;
 
        switch (size) {
        case 1:
@@ -117,11 +117,6 @@ static int tx3927_pci_write_config(struct pci_bus *bus, unsigned int devfn,
                tx3927_pcicptr->icd = cpu_to_le32(val);
        }
 
-       if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT)
-               tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT;
-               tx3927_pcicptr->pcistatim |= PCI_STATUS_REC_MASTER_ABORT;
-               return PCIBIOS_DEVICE_NOT_FOUND;
-
        return check_abort();
 }
 
@@ -202,3 +197,34 @@ void __init tx3927_pcic_setup(struct pci_controller *channel,
                PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
        local_irq_restore(flags);
 }
+
+static irqreturn_t tx3927_pcierr_interrupt(int irq, void *dev_id)
+{
+       struct pt_regs *regs = get_irq_regs();
+
+       if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) {
+               printk(KERN_WARNING "PCI error interrupt at 0x%08lx.\n",
+                      regs->cp0_epc);
+               printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n",
+                      tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat);
+       }
+       if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) {
+               /* clear all pci errors */
+               tx3927_pcicptr->pcistat |= TX3927_PCIC_PCISTATIM_ALL;
+               tx3927_pcicptr->istat = TX3927_PCIC_IIM_ALL;
+               tx3927_pcicptr->tstat = TX3927_PCIC_TIM_ALL;
+               tx3927_pcicptr->lbstat = TX3927_PCIC_LBIM_ALL;
+               return IRQ_HANDLED;
+       }
+       console_verbose();
+       panic("PCI error.");
+}
+
+void __init tx3927_setup_pcierr_irq(void)
+{
+       if (request_irq(TXX9_IRQ_BASE + TX3927_IR_PCI,
+                       tx3927_pcierr_interrupt,
+                       IRQF_DISABLED, "PCI error",
+                       (void *)TX3927_PCIC_REG))
+               printk(KERN_WARNING "Failed to request irq for PCIERR\n");
+}
index c6b49bccd2742b01f32c908851092dd5bc1aa2da..5989e747527f2e4e67f591b93a1f4eb2f16652f3 100644 (file)
@@ -16,6 +16,8 @@
  * option) any later version.
  */
 #include <linux/kernel.h>
+#include <linux/interrupt.h>
+#include <asm/txx9/pci.h>
 #include <asm/txx9/tx4927pcic.h>
 
 static struct {
@@ -85,6 +87,8 @@ static int check_abort(struct tx4927_pcic_reg __iomem *pcicptr)
                __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
                             | (PCI_STATUS_REC_MASTER_ABORT << 16),
                             &pcicptr->pcistatus);
+               /* flush write buffer */
+               iob();
                code = PCIBIOS_DEVICE_NOT_FOUND;
        }
        return code;
@@ -192,6 +196,28 @@ static struct {
        .gbwc = 0xfe0,  /* 4064 GBUSCLK for CCFG.GTOT=0b11 */
 };
 
+char *__devinit tx4927_pcibios_setup(char *str)
+{
+       unsigned long val;
+
+       if (!strncmp(str, "trdyto=", 7)) {
+               if (strict_strtoul(str + 7, 0, &val) == 0)
+                       tx4927_pci_opts.trdyto = val;
+               return NULL;
+       }
+       if (!strncmp(str, "retryto=", 8)) {
+               if (strict_strtoul(str + 8, 0, &val) == 0)
+                       tx4927_pci_opts.retryto = val;
+               return NULL;
+       }
+       if (!strncmp(str, "gbwc=", 5)) {
+               if (strict_strtoul(str + 5, 0, &val) == 0)
+                       tx4927_pci_opts.gbwc = val;
+               return NULL;
+       }
+       return str;
+}
+
 void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr,
                              struct pci_controller *channel, int extarb)
 {
@@ -406,3 +432,95 @@ void tx4927_report_pcic_status(void)
                        tx4927_report_pcic_status1(pcicptrs[i].pcicptr);
        }
 }
+
+static void tx4927_dump_pcic_settings1(struct tx4927_pcic_reg __iomem *pcicptr)
+{
+       int i;
+       __u32 __iomem *preg = (__u32 __iomem *)pcicptr;
+
+       printk(KERN_INFO "tx4927 pcic (0x%p) settings:", pcicptr);
+       for (i = 0; i < sizeof(struct tx4927_pcic_reg); i += 4, preg++) {
+               if (i % 32 == 0) {
+                       printk(KERN_CONT "\n");
+                       printk(KERN_INFO "%04x:", i);
+               }
+               /* skip registers with side-effects */
+               if (i == offsetof(struct tx4927_pcic_reg, g2pintack)
+                   || i == offsetof(struct tx4927_pcic_reg, g2pspc)
+                   || i == offsetof(struct tx4927_pcic_reg, g2pcfgadrs)
+                   || i == offsetof(struct tx4927_pcic_reg, g2pcfgdata)) {
+                       printk(KERN_CONT " XXXXXXXX");
+                       continue;
+               }
+               printk(KERN_CONT " %08x", __raw_readl(preg));
+       }
+       printk(KERN_CONT "\n");
+}
+
+void tx4927_dump_pcic_settings(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
+               if (pcicptrs[i].pcicptr)
+                       tx4927_dump_pcic_settings1(pcicptrs[i].pcicptr);
+       }
+}
+
+irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)
+{
+       struct pt_regs *regs = get_irq_regs();
+       struct tx4927_pcic_reg __iomem *pcicptr =
+               (struct tx4927_pcic_reg __iomem *)(unsigned long)dev_id;
+
+       if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) {
+               printk(KERN_WARNING "PCIERR interrupt at 0x%0*lx\n",
+                      (int)(2 * sizeof(unsigned long)), regs->cp0_epc);
+               tx4927_report_pcic_status1(pcicptr);
+       }
+       if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) {
+               /* clear all pci errors */
+               __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
+                            | (TX4927_PCIC_PCISTATUS_ALL << 16),
+                            &pcicptr->pcistatus);
+               __raw_writel(TX4927_PCIC_G2PSTATUS_ALL, &pcicptr->g2pstatus);
+               __raw_writel(TX4927_PCIC_PBASTATUS_ALL, &pcicptr->pbastatus);
+               __raw_writel(TX4927_PCIC_PCICSTATUS_ALL, &pcicptr->pcicstatus);
+               return IRQ_HANDLED;
+       }
+       console_verbose();
+       tx4927_dump_pcic_settings1(pcicptr);
+       panic("PCI error.");
+}
+
+#ifdef CONFIG_TOSHIBA_FPCIB0
+static void __init tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
+{
+       struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus);
+
+       if (!pcicptr)
+               return;
+       if (__raw_readl(&pcicptr->pbacfg) & TX4927_PCIC_PBACFG_PBAEN) {
+               /* Reset Bus Arbiter */
+               __raw_writel(TX4927_PCIC_PBACFG_RPBA, &pcicptr->pbacfg);
+               /*
+                * swap reqBP and reqXP (raise priority of SLC90E66).
+                * SLC90E66(PCI-ISA bridge) is connected to REQ2 on
+                * PCI Backplane board.
+                */
+               __raw_writel(0x72543610, &pcicptr->pbareqport);
+               __raw_writel(0, &pcicptr->pbabm);
+               /* Use Fixed ParkMaster (required by SLC90E66) */
+               __raw_writel(TX4927_PCIC_PBACFG_FIXPA, &pcicptr->pbacfg);
+               /* Enable Bus Arbiter */
+               __raw_writel(TX4927_PCIC_PBACFG_FIXPA |
+                            TX4927_PCIC_PBACFG_PBAEN,
+                            &pcicptr->pbacfg);
+               printk(KERN_INFO "PCI: Use Fixed Park Master (REQPORT %08x)\n",
+                      __raw_readl(&pcicptr->pbareqport));
+       }
+}
+#define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_0,
+       tx4927_quirk_slc90e66_bridge);
+#endif
index 27e86a09dd4167a8d511963e90742ad2b9ec39d0..aaa900596792db52eb6fdac89944e1bdd4c11146 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
+#include <linux/interrupt.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/tx4927.h>
 
@@ -81,3 +82,12 @@ int __init tx4927_pciclk66_setup(void)
                pciclk = -1;
        return pciclk;
 }
+
+void __init tx4927_setup_pcierr_irq(void)
+{
+       if (request_irq(TXX9_IRQ_BASE + TX4927_IR_PCIERR,
+                       tx4927_pcierr_interrupt,
+                       IRQF_DISABLED, "PCI error",
+                       (void *)TX4927_PCIC_REG))
+               printk(KERN_WARNING "Failed to request irq for PCIERR\n");
+}
index e5375511c2b7d79d9d6b4c63399b279f5475b46d..60e2c52c2c5ecfd758d949f9fc0e6926e21393b5 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
+#include <linux/interrupt.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/tx4938.h>
 
@@ -132,3 +133,12 @@ int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot)
        }
        return -1;
 }
+
+void __init tx4938_setup_pcierr_irq(void)
+{
+       if (request_irq(TXX9_IRQ_BASE + TX4938_IR_PCIERR,
+                       tx4927_pcierr_interrupt,
+                       IRQF_DISABLED, "PCI error",
+                       (void *)TX4927_PCIC_REG))
+               printk(KERN_WARNING "Failed to request irq for PCIERR\n");
+}
index 77bd5b68dc430beab3dde6dbefde63b1eca557ca..c7fe6ec621e68524b0e4ef5d391e7e47d43e472a 100644 (file)
@@ -328,7 +328,11 @@ EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
 #endif
 
-char *pcibios_setup(char *str)
+char * (*pcibios_plat_setup)(char *str) __devinitdata;
+
+char *__devinit pcibios_setup(char *str)
 {
+       if (pcibios_plat_setup)
+               return pcibios_plat_setup(str);
        return str;
 }
index 9de34302e5f4004ef21ba4b8de6c4f1771fb47f3..f7261628d8a60ec209d346232dbeab94874acb18 100644 (file)
 #include <msp_int.h>
 #include <msp_regs.h>
 
-#ifdef CONFIG_KGDB
-/*
- * kgdb uses serial port 1 so the console can remain on port 0.
- * To use port 0 change the definition to read as follows:
- * #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART0_BASE)
- */
-#define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART1_BASE)
-
-int putDebugChar(char c)
-{
-       volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
-       uint32_t val = (uint32_t)c;
-
-       local_irq_disable();
-       while( !(uart[5] & 0x20) ); /* Wait for TXRDY */
-       uart[0] = val;
-       while( !(uart[5] & 0x20) ); /* Wait for TXRDY */
-       local_irq_enable();
-
-       return 1;
-}
-
-char getDebugChar(void)
-{
-       volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
-       uint32_t val;
-
-       while( !(uart[5] & 0x01) ); /* Wait for RXRDY */
-       val = uart[0];
-
-       return (char)val;
-}
-
-void initDebugPort(unsigned int uartclk, unsigned int baudrate)
-{
-       unsigned int baud_divisor = (uartclk + 8 * baudrate)/(16 * baudrate);
-
-       /* Enable FIFOs */
-       writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
-                       UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_4,
-               (char *)DEBUG_PORT_BASE + (UART_FCR * 4));
-
-       /* Select brtc divisor */
-       writeb(UART_LCR_DLAB, (char *)DEBUG_PORT_BASE + (UART_LCR * 4));
-
-       /* Store divisor lsb */
-       writeb(baud_divisor, (char *)DEBUG_PORT_BASE + (UART_TX * 4));
-
-       /* Store divisor msb */
-       writeb(baud_divisor >> 8, (char *)DEBUG_PORT_BASE + (UART_IER * 4));
-
-       /* Set 8N1 mode */
-       writeb(UART_LCR_WLEN8, (char *)DEBUG_PORT_BASE + (UART_LCR * 4));
-
-       /* Disable flow control */
-       writeb(0, (char *)DEBUG_PORT_BASE + (UART_MCR * 4));
-
-       /* Disable receive interrupt(!) */
-       writeb(0, (char *)DEBUG_PORT_BASE + (UART_IER * 4));
-}
-#endif
-
 void __init msp_serial_setup(void)
 {
        char    *s;
@@ -139,17 +77,6 @@ void __init msp_serial_setup(void)
                case MACH_MSP7120_FPGA:
                        /* Enable UART1 on MSP4200 and MSP7120 */
                        *GPIO_CFG2_REG = 0x00002299;
-
-#ifdef CONFIG_KGDB
-                       /* Initialize UART1 for kgdb since PMON doesn't */
-                       if( DEBUG_PORT_BASE == KSEG1ADDR(MSP_UART1_BASE) ) {
-                               if( mips_machtype == MACH_MSP4200_FPGA
-                                || mips_machtype == MACH_MSP7120_FPGA )
-                                       initDebugPort(uartclk, 19200);
-                               else
-                                       initDebugPort(uartclk, 57600);
-                       }
-#endif
                        break;
 
                default:
index 8fd9a04e353487bed0942e40fbc6cccf3fbc6c9b..b16f95c3df654a089a33b7b9655228863421e865 100644 (file)
@@ -4,7 +4,6 @@
 
 obj-y    += irq.o prom.o py-console.o setup.o
 
-obj-$(CONFIG_KGDB)             += dbg_io.o
 obj-$(CONFIG_SMP)              += smp.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/pmc-sierra/yosemite/dbg_io.c b/arch/mips/pmc-sierra/yosemite/dbg_io.c
deleted file mode 100644 (file)
index 6362c70..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright 2003 PMC-Sierra
- * Author: Manish Lachwani (lachwani@pmc-sierra.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 2 of the  License, or (at your
- *  option) any later version.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.
- */
-
-/*
- * Support for KGDB for the Yosemite board. We make use of single serial
- * port to be used for KGDB as well as console. The second serial port
- * seems to be having a problem. Single IRQ is allocated for both the
- * ports. Hence, the interrupt routing code needs to figure out whether
- * the interrupt came from channel A or B.
- */
-
-#include <asm/serial.h>
-
-/*
- * Baud rate, Parity, Data and Stop bit settings for the
- * serial port on the Yosemite. Note that the Early printk
- * patch has been added. So, we should be all set to go
- */
-#define        YOSEMITE_BAUD_2400      2400
-#define        YOSEMITE_BAUD_4800      4800
-#define        YOSEMITE_BAUD_9600      9600
-#define        YOSEMITE_BAUD_19200     19200
-#define        YOSEMITE_BAUD_38400     38400
-#define        YOSEMITE_BAUD_57600     57600
-#define        YOSEMITE_BAUD_115200    115200
-
-#define        YOSEMITE_PARITY_NONE    0
-#define        YOSEMITE_PARITY_ODD     0x08
-#define        YOSEMITE_PARITY_EVEN    0x18
-#define        YOSEMITE_PARITY_MARK    0x28
-#define        YOSEMITE_PARITY_SPACE   0x38
-
-#define        YOSEMITE_DATA_5BIT      0x0
-#define        YOSEMITE_DATA_6BIT      0x1
-#define        YOSEMITE_DATA_7BIT      0x2
-#define        YOSEMITE_DATA_8BIT      0x3
-
-#define        YOSEMITE_STOP_1BIT      0x0
-#define        YOSEMITE_STOP_2BIT      0x4
-
-/* This is crucial */
-#define        SERIAL_REG_OFS          0x1
-
-#define        SERIAL_RCV_BUFFER       0x0
-#define        SERIAL_TRANS_HOLD       0x0
-#define        SERIAL_SEND_BUFFER      0x0
-#define        SERIAL_INTR_ENABLE      (1 * SERIAL_REG_OFS)
-#define        SERIAL_INTR_ID          (2 * SERIAL_REG_OFS)
-#define        SERIAL_DATA_FORMAT      (3 * SERIAL_REG_OFS)
-#define        SERIAL_LINE_CONTROL     (3 * SERIAL_REG_OFS)
-#define        SERIAL_MODEM_CONTROL    (4 * SERIAL_REG_OFS)
-#define        SERIAL_RS232_OUTPUT     (4 * SERIAL_REG_OFS)
-#define        SERIAL_LINE_STATUS      (5 * SERIAL_REG_OFS)
-#define        SERIAL_MODEM_STATUS     (6 * SERIAL_REG_OFS)
-#define        SERIAL_RS232_INPUT      (6 * SERIAL_REG_OFS)
-#define        SERIAL_SCRATCH_PAD      (7 * SERIAL_REG_OFS)
-
-#define        SERIAL_DIVISOR_LSB      (0 * SERIAL_REG_OFS)
-#define        SERIAL_DIVISOR_MSB      (1 * SERIAL_REG_OFS)
-
-/*
- * Functions to READ and WRITE to serial port 0
- */
-#define        SERIAL_READ(ofs)                (*((volatile unsigned char*)    \
-                                       (TITAN_SERIAL_BASE + ofs)))
-
-#define        SERIAL_WRITE(ofs, val)          ((*((volatile unsigned char*)   \
-                                       (TITAN_SERIAL_BASE + ofs))) = val)
-
-/*
- * Functions to READ and WRITE to serial port 1
- */
-#define        SERIAL_READ_1(ofs)              (*((volatile unsigned char*)    \
-                                       (TITAN_SERIAL_BASE_1 + ofs)))
-
-#define        SERIAL_WRITE_1(ofs, val)        ((*((volatile unsigned char*)   \
-                                       (TITAN_SERIAL_BASE_1 + ofs))) = val)
-
-/*
- * Second serial port initialization
- */
-void init_second_port(void)
-{
-       /* Disable Interrupts */
-       SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x0);
-       SERIAL_WRITE_1(SERIAL_INTR_ENABLE, 0x0);
-
-       {
-               unsigned int divisor;
-
-               SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x80);
-               divisor = TITAN_SERIAL_BASE_BAUD / YOSEMITE_BAUD_115200;
-               SERIAL_WRITE_1(SERIAL_DIVISOR_LSB, divisor & 0xff);
-
-               SERIAL_WRITE_1(SERIAL_DIVISOR_MSB,
-                              (divisor & 0xff00) >> 8);
-               SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x0);
-       }
-
-       SERIAL_WRITE_1(SERIAL_DATA_FORMAT, YOSEMITE_DATA_8BIT |
-                      YOSEMITE_PARITY_NONE | YOSEMITE_STOP_1BIT);
-
-       /* Enable Interrupts */
-       SERIAL_WRITE_1(SERIAL_INTR_ENABLE, 0xf);
-}
-
-/* Initialize the serial port for KGDB debugging */
-void debugInit(unsigned int baud, unsigned char data, unsigned char parity,
-              unsigned char stop)
-{
-       /* Disable Interrupts */
-       SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x0);
-       SERIAL_WRITE(SERIAL_INTR_ENABLE, 0x0);
-
-       {
-               unsigned int divisor;
-
-               SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x80);
-
-               divisor = TITAN_SERIAL_BASE_BAUD / baud;
-               SERIAL_WRITE(SERIAL_DIVISOR_LSB, divisor & 0xff);
-
-               SERIAL_WRITE(SERIAL_DIVISOR_MSB, (divisor & 0xff00) >> 8);
-               SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x0);
-       }
-
-       SERIAL_WRITE(SERIAL_DATA_FORMAT, data | parity | stop);
-}
-
-static int remoteDebugInitialized = 0;
-
-unsigned char getDebugChar(void)
-{
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(YOSEMITE_BAUD_115200,
-                         YOSEMITE_DATA_8BIT,
-                         YOSEMITE_PARITY_NONE, YOSEMITE_STOP_1BIT);
-       }
-
-       while ((SERIAL_READ(SERIAL_LINE_STATUS) & 0x1) == 0);
-       return SERIAL_READ(SERIAL_RCV_BUFFER);
-}
-
-int putDebugChar(unsigned char byte)
-{
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(YOSEMITE_BAUD_115200,
-                         YOSEMITE_DATA_8BIT,
-                         YOSEMITE_PARITY_NONE, YOSEMITE_STOP_1BIT);
-       }
-
-       while ((SERIAL_READ(SERIAL_LINE_STATUS) & 0x20) == 0);
-       SERIAL_WRITE(SERIAL_SEND_BUFFER, byte);
-
-       return 1;
-}
index 4decc28078673203a4355c9d7c64950a25c6d6c7..5f673eba142cf6a600e5c4159d84f72f0f6cf6b8 100644 (file)
@@ -141,10 +141,6 @@ asmlinkage void plat_irq_dispatch(void)
        }
 }
 
-#ifdef CONFIG_KGDB
-extern void init_second_port(void);
-#endif
-
 /*
  * Initialize the next level interrupt handler
  */
@@ -156,11 +152,6 @@ void __init arch_init_irq(void)
        rm7k_cpu_irq_init();
        rm9k_cpu_irq_init();
 
-#ifdef CONFIG_KGDB
-       /* At this point, initialize the second serial port */
-       init_second_port();
-#endif
-
 #ifdef CONFIG_GDB_CONSOLE
        register_gdb_console();
 #endif
index b2fe82dba0a561848e70aad5fee6a2a7bc834f1a..00a1c7877bf4c454e55ff41d507da678eb5f55b1 100644 (file)
@@ -64,7 +64,8 @@ static struct resource rb532_dev3_ctl_res[] = {
 
 void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val)
 {
-       unsigned flags, data;
+       unsigned long flags;
+       unsigned data;
        unsigned i = 0;
 
        spin_lock_irqsave(&dev3.lock, flags);
@@ -90,7 +91,7 @@ EXPORT_SYMBOL(get_434_reg);
 
 void set_latch_u5(unsigned char or_mask, unsigned char nand_mask)
 {
-       unsigned flags;
+       unsigned long flags;
 
        spin_lock_irqsave(&dev3.lock, flags);
 
index db74edf8cefb8cc96fca57386b93d9096ae3a58f..8e7a46855b50ad8fc5afe81e528d2e301c833a31 100644 (file)
@@ -49,8 +49,8 @@ static unsigned long __init cal_r4koff(void)
 
 void __init plat_time_init(void)
 {
-       unsigned int est_freq, flags;
-       unsigned long r4k_offset;
+       unsigned int est_freq;
+       unsigned long flags, r4k_offset;
 
        local_irq_save(flags);
 
index 5f389ee26fca034eb5c8f0cc6b961a15d9b3a6fe..896a1ef8482962e5376a37487693f5b87183f053 100644 (file)
@@ -20,7 +20,6 @@
 #include <asm/irq.h>
 #include <asm/reboot.h>
 #include <asm/time.h>
-#include <asm/gdb-stub.h>
 #include <asm/io.h>
 #include <asm/traps.h>
 #include <asm/sgialib.h>
@@ -81,30 +80,6 @@ void __init plat_mem_setup(void)
                add_preferred_console("arc", 0, NULL);
        }
 
-#ifdef CONFIG_KGDB
-       {
-       char *kgdb_ttyd = prom_getcmdline();
-
-       if ((kgdb_ttyd = strstr(kgdb_ttyd, "kgdb=ttyd")) != NULL) {
-               int line;
-               kgdb_ttyd += strlen("kgdb=ttyd");
-               if (*kgdb_ttyd != '1' && *kgdb_ttyd != '2')
-                       printk(KERN_INFO "KGDB: Uknown serial line /dev/ttyd%c"
-                              ", falling back to /dev/ttyd1\n", *kgdb_ttyd);
-               line = *kgdb_ttyd == '2' ? 0 : 1;
-               printk(KERN_INFO "KGDB: Using serial line /dev/ttyd%d for "
-                      "session\n", line ? 1 : 2);
-               rs_kgdb_hook(line);
-
-               printk(KERN_INFO "KGDB: Using serial line /dev/ttyd%d for "
-                      "session, please connect your debugger\n", line ? 1:2);
-
-               kgdb_enabled = 1;
-               /* Breakpoints and stuff are in sgi_irq_setup() */
-       }
-       }
-#endif
-
 #if defined(CONFIG_VT) && defined(CONFIG_SGI_NEWPORT_CONSOLE)
        {
                ULONG *gfxinfo;
index e0a6871d56e4501f947c662d19ba2267bad07d20..31f4931b8484334d60cdd0ea6ccc0b3ea214b2de 100644 (file)
@@ -7,7 +7,6 @@ obj-y   := ip27-berr.o ip27-irq.o ip27-init.o ip27-klconfig.o ip27-klnuma.o \
           ip27-xtalk.o
 
 obj-$(CONFIG_EARLY_PRINTK)     += ip27-console.o
-obj-$(CONFIG_KGDB)             += ip27-dbgio.o
 obj-$(CONFIG_SMP)              += ip27-smp.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/sgi-ip27/ip27-dbgio.c b/arch/mips/sgi-ip27/ip27-dbgio.c
deleted file mode 100644 (file)
index 08fd88b..0000000
+++ /dev/null
@@ -1,60 +0,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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.
- *
- * Copyright 2004 Ralf Baechle <ralf@linux-mips.org>
- */
-#include <asm/sn/addrs.h>
-#include <asm/sn/sn0/hub.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/ioc3.h>
-#include <asm/sn/sn_private.h>
-
-#include <linux/serial.h>
-#include <linux/serial_core.h>
-#include <linux/serial_reg.h>
-
-#define IOC3_CLK        (22000000 / 3)
-#define IOC3_FLAGS      (0)
-
-static inline struct ioc3_uartregs *console_uart(void)
-{
-       struct ioc3 *ioc3;
-
-       ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(get_nasid())->memory_base;
-
-       return &ioc3->sregs.uarta;
-}
-
-unsigned char getDebugChar(void)
-{
-       struct ioc3_uartregs *uart = console_uart();
-
-       while ((uart->iu_lsr & UART_LSR_DR) == 0);
-       return uart->iu_rbr;
-}
-
-void putDebugChar(unsigned char c)
-{
-       struct ioc3_uartregs *uart = console_uart();
-
-       while ((uart->iu_lsr & UART_LSR_THRE) == 0);
-       uart->iu_thr = c;
-}
index db372a0f106d1e8631aff8c001ba2891448aebb7..a35818ed42639c8548537546d82eae9f35f23674 100644 (file)
@@ -57,30 +57,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask);
 extern unsigned long ht_eoi_space;
 #endif
 
-#ifdef CONFIG_KGDB
-#include <asm/gdb-stub.h>
-extern void breakpoint(void);
-static int kgdb_irq;
-#ifdef CONFIG_GDB_CONSOLE
-extern void register_gdb_console(void);
-#endif
-
-/* kgdb is on when configured.  Pass "nokgdb" kernel arg to turn it off */
-static int kgdb_flag = 1;
-static int __init nokgdb(char *str)
-{
-       kgdb_flag = 0;
-       return 1;
-}
-__setup("nokgdb", nokgdb);
-
-/* Default to UART1 */
-int kgdb_port = 1;
-#ifdef CONFIG_SERIAL_SB1250_DUART
-extern char sb1250_duart_present[];
-#endif
-#endif
-
 static struct irq_chip bcm1480_irq_type = {
        .name = "BCM1480-IMR",
        .ack = ack_bcm1480_irq,
@@ -355,61 +331,10 @@ void __init arch_init_irq(void)
         * does its own management of IP7.
         */
 
-#ifdef CONFIG_KGDB
-       imask |= STATUSF_IP6;
-#endif
        /* Enable necessary IPs, disable the rest */
        change_c0_status(ST0_IM, imask);
-
-#ifdef CONFIG_KGDB
-       if (kgdb_flag) {
-               kgdb_irq = K_BCM1480_INT_UART_0 + kgdb_port;
-
-#ifdef CONFIG_SERIAL_SB1250_DUART
-               sb1250_duart_present[kgdb_port] = 0;
-#endif
-               /* Setup uart 1 settings, mapper */
-               /* QQQ FIXME */
-               __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port)));
-
-               __raw_writeq(IMR_IP6_VAL,
-                            IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
-                            (kgdb_irq << 3)));
-               bcm1480_unmask_irq(0, kgdb_irq);
-
-#ifdef CONFIG_GDB_CONSOLE
-               register_gdb_console();
-#endif
-               printk("Waiting for GDB on UART port %d\n", kgdb_port);
-               set_debug_traps();
-               breakpoint();
-       }
-#endif
-}
-
-#ifdef CONFIG_KGDB
-
-#include <linux/delay.h>
-
-#define duart_out(reg, val)     csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-#define duart_in(reg)           csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-
-static void bcm1480_kgdb_interrupt(void)
-{
-       /*
-        * Clear break-change status (allow some time for the remote
-        * host to stop the break, since we would see another
-        * interrupt on the end-of-break too)
-        */
-       kstat.irqs[smp_processor_id()][kgdb_irq]++;
-       mdelay(500);
-       duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
-                               M_DUART_RX_EN | M_DUART_TX_EN);
-       set_async_breakpoint(&get_irq_regs()->cp0_epc);
 }
 
-#endif         /* CONFIG_KGDB */
-
 extern void bcm1480_mailbox_interrupt(void);
 
 static inline void dispatch_ip2(void)
@@ -462,11 +387,6 @@ asmlinkage void plat_irq_dispatch(void)
                bcm1480_mailbox_interrupt();
 #endif
 
-#ifdef CONFIG_KGDB
-       else if (pending & CAUSEF_IP6)
-               bcm1480_kgdb_interrupt();               /* KGDB (uart 1) */
-#endif
-
        else if (pending & CAUSEF_IP2)
                dispatch_ip2();
 }
index fd9604d5555ac64d731e6ce2c56da1b171af07f0..3de30f79db3f33dcbf945bca58389456af40e1f3 100644 (file)
@@ -59,10 +59,6 @@ int cfe_cons_handle;
 extern unsigned long initrd_start, initrd_end;
 #endif
 
-#ifdef CONFIG_KGDB
-extern int kgdb_port;
-#endif
-
 static void __noreturn cfe_linux_exit(void *arg)
 {
        int warm = *(int *)arg;
@@ -246,9 +242,6 @@ void __init prom_init(void)
        int argc = fw_arg0;
        char **envp = (char **) fw_arg2;
        int *prom_vec = (int *) fw_arg3;
-#ifdef CONFIG_KGDB
-       char *arg;
-#endif
 
        _machine_restart   = cfe_linux_restart;
        _machine_halt      = cfe_linux_halt;
@@ -309,13 +302,6 @@ void __init prom_init(void)
                }
        }
 
-#ifdef CONFIG_KGDB
-       if ((arg = strstr(arcs_cmdline, "kgdb=duart")) != NULL)
-               kgdb_port = (arg[10] == '0') ? 0 : 1;
-       else
-               kgdb_port = 1;
-#endif
-
 #ifdef CONFIG_BLK_DEV_INITRD
        {
                char *ptr;
index eac9065ffe0ccc4c5f0811f8ee20d45375abd21f..a5158483986e878dd7d935a439d6c2b0c1f98d2e 100644 (file)
@@ -57,16 +57,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask);
 extern unsigned long ldt_eoi_space;
 #endif
 
-#ifdef CONFIG_KGDB
-static int kgdb_irq;
-
-/* Default to UART1 */
-int kgdb_port = 1;
-#ifdef CONFIG_SERIAL_SB1250_DUART
-extern char sb1250_duart_present[];
-#endif
-#endif
-
 static struct irq_chip sb1250_irq_type = {
        .name = "SB1250-IMR",
        .ack = ack_sb1250_irq,
@@ -313,55 +303,10 @@ void __init arch_init_irq(void)
         * does its own management of IP7.
         */
 
-#ifdef CONFIG_KGDB
-       imask |= STATUSF_IP6;
-#endif
        /* Enable necessary IPs, disable the rest */
        change_c0_status(ST0_IM, imask);
-
-#ifdef CONFIG_KGDB
-       if (kgdb_flag) {
-               kgdb_irq = K_INT_UART_0 + kgdb_port;
-
-#ifdef CONFIG_SERIAL_SB1250_DUART
-               sb1250_duart_present[kgdb_port] = 0;
-#endif
-               /* Setup uart 1 settings, mapper */
-               __raw_writeq(M_DUART_IMR_BRK,
-                            IOADDR(A_DUART_IMRREG(kgdb_port)));
-
-               __raw_writeq(IMR_IP6_VAL,
-                            IOADDR(A_IMR_REGISTER(0,
-                                                  R_IMR_INTERRUPT_MAP_BASE) +
-                                   (kgdb_irq << 3)));
-               sb1250_unmask_irq(0, kgdb_irq);
-       }
-#endif
-}
-
-#ifdef CONFIG_KGDB
-
-#include <linux/delay.h>
-
-#define duart_out(reg, val)     csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-#define duart_in(reg)           csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-
-static void sb1250_kgdb_interrupt(void)
-{
-       /*
-        * Clear break-change status (allow some time for the remote
-        * host to stop the break, since we would see another
-        * interrupt on the end-of-break too)
-        */
-       kstat_this_cpu.irqs[kgdb_irq]++;
-       mdelay(500);
-       duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
-                               M_DUART_RX_EN | M_DUART_TX_EN);
-       set_async_breakpoint(&get_irq_regs()->cp0_epc);
 }
 
-#endif         /* CONFIG_KGDB */
-
 extern void sb1250_mailbox_interrupt(void);
 
 static inline void dispatch_ip2(void)
@@ -407,11 +352,6 @@ asmlinkage void plat_irq_dispatch(void)
                sb1250_mailbox_interrupt();
 #endif
 
-#ifdef CONFIG_KGDB
-       else if (pending & CAUSEF_IP6)                  /* KGDB (uart 1) */
-               sb1250_kgdb_interrupt();
-#endif
-
        else if (pending & CAUSEF_IP2)
                dispatch_ip2();
        else
index 255d692bfa188c6df2d59d9a167644396d4d1b15..f18ba9201bbcd7eda4a1336c545694f84841abcd 100644 (file)
@@ -1,4 +1,3 @@
 obj-y                          := setup.o rtc_xicor1241.o rtc_m41t81.o
 
 obj-$(CONFIG_I2C_BOARDINFO)    += swarm-i2c.o
-obj-$(CONFIG_KGDB)             += dbg_io.o
diff --git a/arch/mips/sibyte/swarm/dbg_io.c b/arch/mips/sibyte/swarm/dbg_io.c
deleted file mode 100644 (file)
index b97ae30..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * kgdb debug routines for SiByte boards.
- *
- * Copyright (C) 2001 MontaVista Software Inc.
- * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- *
- * 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.
- *
- */
-
-/* -------------------- BEGINNING OF CONFIG --------------------- */
-
-#include <linux/delay.h>
-#include <asm/io.h>
-#include <asm/sibyte/sb1250.h>
-#include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/sb1250_uart.h>
-#include <asm/sibyte/sb1250_int.h>
-#include <asm/addrspace.h>
-
-/*
- * We use the second serial port for kgdb traffic.
- *     115200, 8, N, 1.
- */
-
-#define        BAUD_RATE               115200
-#define        CLK_DIVISOR             V_DUART_BAUD_RATE(BAUD_RATE)
-#define        DATA_BITS               V_DUART_BITS_PER_CHAR_8         /* or 7    */
-#define        PARITY                  V_DUART_PARITY_MODE_NONE        /* or even */
-#define        STOP_BITS               M_DUART_STOP_BIT_LEN_1          /* or 2    */
-
-static int duart_initialized = 0;      /* 0: need to be init'ed by kgdb */
-
-/* -------------------- END OF CONFIG --------------------- */
-extern int kgdb_port;
-
-#define        duart_out(reg, val)     csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-#define duart_in(reg)          csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
-
-void putDebugChar(unsigned char c);
-unsigned char getDebugChar(void);
-static void
-duart_init(int clk_divisor, int data, int parity, int stop)
-{
-       duart_out(R_DUART_MODE_REG_1, data | parity);
-       duart_out(R_DUART_MODE_REG_2, stop);
-       duart_out(R_DUART_CLK_SEL, clk_divisor);
-
-       duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN);  /* enable rx and tx */
-}
-
-void
-putDebugChar(unsigned char c)
-{
-       if (!duart_initialized) {
-               duart_initialized = 1;
-               duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
-       }
-       while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0);
-       duart_out(R_DUART_TX_HOLD, c);
-}
-
-unsigned char
-getDebugChar(void)
-{
-       if (!duart_initialized) {
-               duart_initialized = 1;
-               duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
-       }
-       while ((duart_in(R_DUART_STATUS) & M_DUART_RX_RDY) == 0) ;
-       return duart_in(R_DUART_RX_HOLD);
-}
-
index 6de4c5aa92bea002115b07c58351c4776efbf7fb..840fe757c48d836faa36b77b1c94e32585552b70 100644 (file)
@@ -1,3 +1,27 @@
+config MACH_TX39XX
+       bool
+       select MACH_TXX9
+       select SYS_HAS_CPU_TX39XX
+
+config MACH_TX49XX
+       bool
+       select MACH_TXX9
+       select CEVT_R4K
+       select CSRC_R4K
+       select IRQ_CPU
+       select SYS_HAS_CPU_TX49XX
+       select SYS_SUPPORTS_64BIT_KERNEL
+
+config MACH_TXX9
+       bool
+       select DMA_NONCOHERENT
+       select SWAP_IO_SPACE
+       select SYS_HAS_EARLY_PRINTK
+       select SYS_SUPPORTS_32BIT_KERNEL
+       select SYS_SUPPORTS_LITTLE_ENDIAN
+       select SYS_SUPPORTS_BIG_ENDIAN
+       select GENERIC_HARDIRQS_NO__DO_IRQ
+
 config TOSHIBA_JMR3927
        bool "Toshiba JMR-TX3927 board"
        depends on MACH_TX39XX
@@ -24,68 +48,37 @@ config TOSHIBA_RBTX4938
 config SOC_TX3927
        bool
        select CEVT_TXX9
-       select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
        select IRQ_TXX9
-       select SWAP_IO_SPACE
-       select SYS_HAS_CPU_TX39XX
-       select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_SUPPORTS_BIG_ENDIAN
-       select GENERIC_HARDIRQS_NO__DO_IRQ
        select GPIO_TXX9
 
 config SOC_TX4927
        bool
-       select CEVT_R4K
-       select CSRC_R4K
        select CEVT_TXX9
-       select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
-       select IRQ_CPU
        select IRQ_TXX9
        select PCI_TX4927
-       select SWAP_IO_SPACE
-       select SYS_HAS_CPU_TX49XX
-       select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_64BIT_KERNEL
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_SUPPORTS_BIG_ENDIAN
-       select SYS_SUPPORTS_KGDB
-       select GENERIC_HARDIRQS_NO__DO_IRQ
        select GPIO_TXX9
 
 config SOC_TX4938
        bool
-       select CEVT_R4K
-       select CSRC_R4K
        select CEVT_TXX9
-       select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
-       select IRQ_CPU
        select IRQ_TXX9
        select PCI_TX4927
-       select SWAP_IO_SPACE
-       select SYS_HAS_CPU_TX49XX
-       select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_64BIT_KERNEL
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_SUPPORTS_BIG_ENDIAN
-       select SYS_SUPPORTS_KGDB
-       select GENERIC_HARDIRQS_NO__DO_IRQ
        select GPIO_TXX9
 
 config TOSHIBA_FPCIB0
        bool "FPCIB0 Backplane Support"
-       depends on PCI && (MACH_TX39XX || MACH_TX49XX)
+       depends on PCI && MACH_TXX9
        select I8259
 
 config PICMG_PCI_BACKPLANE_DEFAULT
        bool "Support for PICMG PCI Backplane"
-       depends on PCI && (MACH_TX39XX || MACH_TX49XX)
+       depends on PCI && MACH_TXX9
        default y if !TOSHIBA_FPCIB0
 
 if TOSHIBA_RBTX4938
index 9c120771e65f7bf7f64de83801f5ffd07c468b88..9bb34af26b733260bb2810d403dd3acb3c601798 100644 (file)
@@ -4,9 +4,9 @@
 
 obj-y  += setup.o
 obj-$(CONFIG_PCI)      += pci.o
+obj-$(CONFIG_SOC_TX3927)       += setup_tx3927.o irq_tx3927.o
 obj-$(CONFIG_SOC_TX4927)       += mem_tx4927.o setup_tx4927.o irq_tx4927.o
 obj-$(CONFIG_SOC_TX4938)       += mem_tx4927.o setup_tx4938.o irq_tx4938.o
 obj-$(CONFIG_TOSHIBA_FPCIB0)   += smsc_fdc37m81x.o
-obj-$(CONFIG_KGDB)     += dbgio.o
 
 EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/txx9/generic/dbgio.c b/arch/mips/txx9/generic/dbgio.c
deleted file mode 100644 (file)
index 33b9c67..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * linux/arch/mips/tx4938/common/dbgio.c
- *
- * kgdb interface for gdb
- *
- * Author: MontaVista Software, Inc.
- *         source@mvista.com
- *
- * Copyright 2005 MontaVista Software Inc.
- *
- *  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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.
- *
- * Support for TX4938 in 2.6 - Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
- */
-
-#include <linux/types>
-
-extern u8 txx9_sio_kdbg_rd(void);
-extern int txx9_sio_kdbg_wr( u8 ch );
-
-u8 getDebugChar(void)
-{
-       return (txx9_sio_kdbg_rd());
-}
-
-int putDebugChar(u8 byte)
-{
-       return (txx9_sio_kdbg_wr(byte));
-}
-
diff --git a/arch/mips/txx9/generic/irq_tx3927.c b/arch/mips/txx9/generic/irq_tx3927.c
new file mode 100644 (file)
index 0000000..c683f59
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Common tx3927 irq handler
+ *
+ * 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 2001 MontaVista Software Inc.
+ * Copyright (C) 2000-2001 Toshiba Corporation
+ */
+#include <linux/init.h>
+#include <asm/txx9irq.h>
+#include <asm/txx9/tx3927.h>
+
+void __init tx3927_irq_init(void)
+{
+       int i;
+
+       txx9_irq_init(TX3927_IRC_REG);
+       /* raise priority for timers, sio */
+       for (i = 0; i < TX3927_NR_TMR; i++)
+               txx9_irq_set_pri(TX3927_IR_TMR(i), 6);
+       for (i = 0; i < TX3927_NR_SIO; i++)
+               txx9_irq_set_pri(TX3927_IR_SIO(i), 7);
+}
index 0b92d8c13208a085309538f5b97cf228baddc3c6..7b637a7c0e6694d7bbae5c3ec895093fb2f6491e 100644 (file)
@@ -386,3 +386,39 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
        return txx9_board_vec->pci_map_irq(dev, slot, pin);
 }
+
+char * (*txx9_board_pcibios_setup)(char *str) __devinitdata;
+
+char *__devinit txx9_pcibios_setup(char *str)
+{
+       if (txx9_board_pcibios_setup && !txx9_board_pcibios_setup(str))
+               return NULL;
+       if (!strcmp(str, "picmg")) {
+               /* PICMG compliant backplane (TOSHIBA JMB-PICMG-ATX
+                  (5V or 3.3V), JMB-PICMG-L2 (5V only), etc.) */
+               txx9_pci_option |= TXX9_PCI_OPT_PICMG;
+               return NULL;
+       } else if (!strcmp(str, "nopicmg")) {
+               /* non-PICMG compliant backplane (TOSHIBA
+                  RBHBK4100,RBHBK4200, Interface PCM-PCM05, etc.) */
+               txx9_pci_option &= ~TXX9_PCI_OPT_PICMG;
+               return NULL;
+       } else if (!strncmp(str, "clk=", 4)) {
+               char *val = str + 4;
+               txx9_pci_option &= ~TXX9_PCI_OPT_CLK_MASK;
+               if (strcmp(val, "33") == 0)
+                       txx9_pci_option |= TXX9_PCI_OPT_CLK_33;
+               else if (strcmp(val, "66") == 0)
+                       txx9_pci_option |= TXX9_PCI_OPT_CLK_66;
+               else /* "auto" */
+                       txx9_pci_option |= TXX9_PCI_OPT_CLK_AUTO;
+               return NULL;
+       } else if (!strncmp(str, "err=", 4)) {
+               if (!strcmp(str + 4, "panic"))
+                       txx9_pci_err_action = TXX9_PCI_ERR_PANIC;
+               else if (!strcmp(str + 4, "ignore"))
+                       txx9_pci_err_action = TXX9_PCI_ERR_IGNORE;
+               return NULL;
+       }
+       return str;
+}
index 8c60c78b9a9e0506d2eb3307e6bbda8e1dbef710..1bc57d0f4c5c156c9aafb6ce3d0d39f657943b65 100644 (file)
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/serial_core.h>
 #include <asm/bootinfo.h>
 #include <asm/time.h>
+#include <asm/reboot.h>
 #include <asm/txx9/generic.h>
+#include <asm/txx9/pci.h>
 #ifdef CONFIG_CPU_TX49XX
 #include <asm/txx9/tx4938.h>
 #endif
@@ -187,6 +191,117 @@ char * __init prom_getcmdline(void)
        return &(arcs_cmdline[0]);
 }
 
+static void __noreturn txx9_machine_halt(void)
+{
+       local_irq_disable();
+       clear_c0_status(ST0_IM);
+       while (1) {
+               if (cpu_wait) {
+                       (*cpu_wait)();
+                       if (cpu_has_counter) {
+                               /*
+                                * Clear counter interrupt while it
+                                * breaks WAIT instruction even if
+                                * masked.
+                                */
+                               write_c0_compare(0);
+                       }
+               }
+       }
+}
+
+/* Watchdog support */
+void __init txx9_wdt_init(unsigned long base)
+{
+       struct resource res = {
+               .start  = base,
+               .end    = base + 0x100 - 1,
+               .flags  = IORESOURCE_MEM,
+       };
+       platform_device_register_simple("txx9wdt", -1, &res, 1);
+}
+
+/* SPI support */
+void __init txx9_spi_init(int busid, unsigned long base, int irq)
+{
+       struct resource res[] = {
+               {
+                       .start  = base,
+                       .end    = base + 0x20 - 1,
+                       .flags  = IORESOURCE_MEM,
+               }, {
+                       .start  = irq,
+                       .flags  = IORESOURCE_IRQ,
+               },
+       };
+       platform_device_register_simple("spi_txx9", busid,
+                                       res, ARRAY_SIZE(res));
+}
+
+void __init txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr)
+{
+       struct platform_device *pdev =
+               platform_device_alloc("tc35815-mac", id);
+       if (!pdev ||
+           platform_device_add_data(pdev, ethaddr, 6) ||
+           platform_device_add(pdev))
+               platform_device_put(pdev);
+}
+
+void __init txx9_sio_init(unsigned long baseaddr, int irq,
+                         unsigned int line, unsigned int sclk, int nocts)
+{
+#ifdef CONFIG_SERIAL_TXX9
+       struct uart_port req;
+
+       memset(&req, 0, sizeof(req));
+       req.line = line;
+       req.iotype = UPIO_MEM;
+       req.membase = ioremap(baseaddr, 0x24);
+       req.mapbase = baseaddr;
+       req.irq = irq;
+       if (!nocts)
+               req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
+       if (sclk) {
+               req.flags |= UPF_MAGIC_MULTIPLIER /*USE_SCLK*/;
+               req.uartclk = sclk;
+       } else
+               req.uartclk = TXX9_IMCLK;
+       early_serial_txx9_setup(&req);
+#endif /* CONFIG_SERIAL_TXX9 */
+}
+
+#ifdef CONFIG_EARLY_PRINTK
+static void __init null_prom_putchar(char c)
+{
+}
+void (*txx9_prom_putchar)(char c) __initdata = null_prom_putchar;
+
+void __init prom_putchar(char c)
+{
+       txx9_prom_putchar(c);
+}
+
+static void __iomem *early_txx9_sio_port;
+
+static void __init early_txx9_sio_putchar(char c)
+{
+#define TXX9_SICISR    0x0c
+#define TXX9_SITFIFO   0x1c
+#define TXX9_SICISR_TXALS      0x00000002
+       while (!(__raw_readl(early_txx9_sio_port + TXX9_SICISR) &
+                TXX9_SICISR_TXALS))
+               ;
+       __raw_writel(c, early_txx9_sio_port + TXX9_SITFIFO);
+}
+
+void __init txx9_sio_putchar_init(unsigned long baseaddr)
+{
+       early_txx9_sio_port = ioremap(baseaddr, 0x24);
+       txx9_prom_putchar = early_txx9_sio_putchar;
+}
+#endif /* CONFIG_EARLY_PRINTK */
+
 /* wrappers */
 void __init plat_mem_setup(void)
 {
@@ -194,6 +309,15 @@ void __init plat_mem_setup(void)
        ioport_resource.end = ~0UL;     /* no limit */
        iomem_resource.start = 0;
        iomem_resource.end = ~0UL;      /* no limit */
+
+       /* fallback restart/halt routines */
+       _machine_restart = (void (*)(char *))txx9_machine_halt;
+       _machine_halt = txx9_machine_halt;
+       pm_power_off = txx9_machine_halt;
+
+#ifdef CONFIG_PCI
+       pcibios_plat_setup = txx9_pcibios_setup;
+#endif
        txx9_board_vec->mem_setup();
 }
 
diff --git a/arch/mips/txx9/generic/setup_tx3927.c b/arch/mips/txx9/generic/setup_tx3927.c
new file mode 100644 (file)
index 0000000..7bd963d
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * TX3927 setup routines
+ * Based on linux/arch/mips/txx9/jmr3927/setup.c
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Copyright (C) 2000-2001 Toshiba Corporation
+ * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/param.h>
+#include <linux/io.h>
+#include <asm/mipsregs.h>
+#include <asm/txx9irq.h>
+#include <asm/txx9tmr.h>
+#include <asm/txx9pio.h>
+#include <asm/txx9/generic.h>
+#include <asm/txx9/tx3927.h>
+
+void __init tx3927_wdt_init(void)
+{
+       txx9_wdt_init(TX3927_TMR_REG(2));
+}
+
+void __init tx3927_setup(void)
+{
+       int i;
+       unsigned int conf;
+
+       /* don't enable - see errata */
+       txx9_ccfg_toeon = 0;
+       if (strstr(prom_getcmdline(), "toeon") != NULL)
+               txx9_ccfg_toeon = 1;
+
+       txx9_reg_res_init(TX3927_REV_PCODE(), TX3927_REG_BASE,
+                         TX3927_REG_SIZE);
+
+       /* SDRAMC,ROMC are configured by PROM */
+       for (i = 0; i < 8; i++) {
+               if (!(tx3927_romcptr->cr[i] & 0x8))
+                       continue;       /* disabled */
+               txx9_ce_res[i].start = (unsigned long)TX3927_ROMC_BA(i);
+               txx9_ce_res[i].end =
+                       txx9_ce_res[i].start + TX3927_ROMC_SIZE(i) - 1;
+               request_resource(&iomem_resource, &txx9_ce_res[i]);
+       }
+
+       /* clocks */
+       txx9_gbus_clock = txx9_cpu_clock / 2;
+       /* change default value to udelay/mdelay take reasonable time */
+       loops_per_jiffy = txx9_cpu_clock / HZ / 2;
+
+       /* CCFG */
+       /* enable Timeout BusError */
+       if (txx9_ccfg_toeon)
+               tx3927_ccfgptr->ccfg |= TX3927_CCFG_TOE;
+
+       /* clear BusErrorOnWrite flag */
+       tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW;
+       if (read_c0_conf() & TX39_CONF_WBON)
+               /* Disable PCI snoop */
+               tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP;
+       else
+               /* Enable PCI SNOOP - with write through only */
+               tx3927_ccfgptr->ccfg |= TX3927_CCFG_PSNP;
+       /* do reset on watchdog */
+       tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR;
+
+       printk(KERN_INFO "TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n",
+              tx3927_ccfgptr->crir,
+              tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg);
+
+       /* TMR */
+       for (i = 0; i < TX3927_NR_TMR; i++)
+               txx9_tmr_init(TX3927_TMR_REG(i));
+
+       /* DMA */
+       tx3927_dmaptr->mcr = 0;
+       for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) {
+               /* reset channel */
+               tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST;
+               tx3927_dmaptr->ch[i].ccr = 0;
+       }
+       /* enable DMA */
+#ifdef __BIG_ENDIAN
+       tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN;
+#else
+       tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN | TX3927_DMA_MCR_LE;
+#endif
+
+       /* PIO */
+       __raw_writel(0, &tx3927_pioptr->maskcpu);
+       __raw_writel(0, &tx3927_pioptr->maskext);
+       txx9_gpio_init(TX3927_PIO_REG, 0, 16);
+
+       conf = read_c0_conf();
+       if (!(conf & TX39_CONF_ICE))
+               printk(KERN_INFO "TX3927 I-Cache disabled.\n");
+       if (!(conf & TX39_CONF_DCE))
+               printk(KERN_INFO "TX3927 D-Cache disabled.\n");
+       else if (!(conf & TX39_CONF_WBON))
+               printk(KERN_INFO "TX3927 D-Cache WriteThrough.\n");
+       else if (!(conf & TX39_CONF_CWFON))
+               printk(KERN_INFO "TX3927 D-Cache WriteBack.\n");
+       else
+               printk(KERN_INFO "TX3927 D-Cache WriteBack (CWF) .\n");
+}
+
+void __init tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr)
+{
+       txx9_clockevent_init(TX3927_TMR_REG(evt_tmrnr),
+                            TXX9_IRQ_BASE + TX3927_IR_TMR(evt_tmrnr),
+                            TXX9_IMCLK);
+       txx9_clocksource_init(TX3927_TMR_REG(src_tmrnr), TXX9_IMCLK);
+}
+
+void __init tx3927_sio_init(unsigned int sclk, unsigned int cts_mask)
+{
+       int i;
+
+       for (i = 0; i < 2; i++)
+               txx9_sio_init(TX3927_SIO_REG(i),
+                             TXX9_IRQ_BASE + TX3927_IR_SIO(i),
+                             i, sclk, (1 << i) & cts_mask);
+}
index 89d6e28add93cf7e5e1cf95673cb07280801c4da..f80d4b7a694d3791e09889d340da96f3cb3caa72 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/serial_core.h>
 #include <linux/param.h>
 #include <asm/txx9irq.h>
 #include <asm/txx9tmr.h>
@@ -21,7 +20,7 @@
 #include <asm/txx9/generic.h>
 #include <asm/txx9/tx4927.h>
 
-void __init tx4927_wdr_init(void)
+static void __init tx4927_wdr_init(void)
 {
        /* clear WatchDogReset (W1C) */
        tx4927_ccfg_set(TX4927_CCFG_WDRST);
@@ -29,6 +28,11 @@ void __init tx4927_wdr_init(void)
        tx4927_ccfg_set(TX4927_CCFG_WR);
 }
 
+void __init tx4927_wdt_init(void)
+{
+       txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
+}
+
 static struct resource tx4927_sdram_resource[4];
 
 void __init tx4927_setup(void)
@@ -173,22 +177,12 @@ void __init tx4927_time_init(unsigned int tmrnr)
                                     TXX9_IMCLK);
 }
 
-void __init tx4927_setup_serial(void)
+void __init tx4927_sio_init(unsigned int sclk, unsigned int cts_mask)
 {
-#ifdef CONFIG_SERIAL_TXX9
        int i;
-       struct uart_port req;
-
-       for (i = 0; i < 2; i++) {
-               memset(&req, 0, sizeof(req));
-               req.line = i;
-               req.iotype = UPIO_MEM;
-               req.membase = (unsigned char __iomem *)TX4927_SIO_REG(i);
-               req.mapbase = TX4927_SIO_REG(i) & 0xfffffffffULL;
-               req.irq = TXX9_IRQ_BASE + TX4927_IR_SIO(i);
-               req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
-               req.uartclk = TXX9_IMCLK;
-               early_serial_txx9_setup(&req);
-       }
-#endif /* CONFIG_SERIAL_TXX9 */
+
+       for (i = 0; i < 2; i++)
+               txx9_sio_init(TX4927_SIO_REG(i) & 0xfffffffffULL,
+                             TXX9_IRQ_BASE + TX4927_IR_SIO(i),
+                             i, sclk, (1 << i) & cts_mask);
 }
index 317378d8579d39f19bf665440e1e7b36f71a6d61..f3040b9ba0593df8596cb46c17264b336a2df42c 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/serial_core.h>
 #include <linux/param.h>
 #include <asm/txx9irq.h>
 #include <asm/txx9tmr.h>
@@ -21,7 +20,7 @@
 #include <asm/txx9/generic.h>
 #include <asm/txx9/tx4938.h>
 
-void __init tx4938_wdr_init(void)
+static void __init tx4938_wdr_init(void)
 {
        /* clear WatchDogReset (W1C) */
        tx4938_ccfg_set(TX4938_CCFG_WDRST);
@@ -29,6 +28,11 @@ void __init tx4938_wdr_init(void)
        tx4938_ccfg_set(TX4938_CCFG_WR);
 }
 
+void __init tx4938_wdt_init(void)
+{
+       txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
+}
+
 static struct resource tx4938_sdram_resource[4];
 static struct resource tx4938_sram_resource;
 
@@ -233,11 +237,9 @@ void __init tx4938_time_init(unsigned int tmrnr)
                                     TXX9_IMCLK);
 }
 
-void __init tx4938_setup_serial(void)
+void __init tx4938_sio_init(unsigned int sclk, unsigned int cts_mask)
 {
-#ifdef CONFIG_SERIAL_TXX9
        int i;
-       struct uart_port req;
        unsigned int ch_mask = 0;
 
        if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL)
@@ -245,15 +247,24 @@ void __init tx4938_setup_serial(void)
        for (i = 0; i < 2; i++) {
                if ((1 << i) & ch_mask)
                        continue;
-               memset(&req, 0, sizeof(req));
-               req.line = i;
-               req.iotype = UPIO_MEM;
-               req.membase = (unsigned char __iomem *)TX4938_SIO_REG(i);
-               req.mapbase = TX4938_SIO_REG(i) & 0xfffffffffULL;
-               req.irq = TXX9_IRQ_BASE + TX4938_IR_SIO(i);
-               req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
-               req.uartclk = TXX9_IMCLK;
-               early_serial_txx9_setup(&req);
+               txx9_sio_init(TX4938_SIO_REG(i) & 0xfffffffffULL,
+                             TXX9_IRQ_BASE + TX4938_IR_SIO(i),
+                             i, sclk, (1 << i) & cts_mask);
        }
-#endif /* CONFIG_SERIAL_TXX9 */
+}
+
+void __init tx4938_spi_init(int busid)
+{
+       txx9_spi_init(busid, TX4938_SPI_REG & 0xfffffffffULL,
+                     TXX9_IRQ_BASE + TX4938_IR_SPI);
+}
+
+void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1)
+{
+       u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg);
+
+       if (addr0 && (pcfg & TX4938_PCFG_ETH0_SEL))
+               txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH0, addr0);
+       if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL))
+               txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1);
 }
index 69e487467fa5e2ceaaf13149cf5f3ee28ac96c6f..a2b2d62d88e3270e281e5969d5c4ef968aeec8e2 100644 (file)
@@ -15,8 +15,6 @@
 #include <asm/io.h>
 #include <asm/txx9/smsc_fdc37m81x.h>
 
-#define DEBUG
-
 /* Common Registers */
 #define SMSC_FDC37M81X_CONFIG_INDEX  0x00
 #define SMSC_FDC37M81X_CONFIG_DATA   0x01
@@ -55,7 +53,7 @@
 #define SMSC_FDC37M81X_CONFIG_EXIT   0xaa
 #define SMSC_FDC37M81X_CHIP_ID       0x4d
 
-static unsigned long g_smsc_fdc37m81x_base = 0;
+static unsigned long g_smsc_fdc37m81x_base;
 
 static inline unsigned char smsc_fdc37m81x_rd(unsigned char index)
 {
@@ -107,7 +105,8 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
        u8 chip_id;
 
        if (g_smsc_fdc37m81x_base)
-               printk("smsc_fdc37m81x_init() stepping on old base=0x%0*lx\n",
+               printk(KERN_WARNING "%s: stepping on old base=0x%0*lx\n",
+                      __func__,
                       field, g_smsc_fdc37m81x_base);
 
        g_smsc_fdc37m81x_base = port;
@@ -118,7 +117,7 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
        if (chip_id == SMSC_FDC37M81X_CHIP_ID)
                smsc_fdc37m81x_config_end();
        else {
-               printk("smsc_fdc37m81x_init() unknow chip id 0x%02x\n",
+               printk(KERN_WARNING "%s: unknow chip id 0x%02x\n", __func__,
                       chip_id);
                g_smsc_fdc37m81x_base = 0;
        }
@@ -127,22 +126,23 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
 }
 
 #ifdef DEBUG
-void smsc_fdc37m81x_config_dump_one(char *key, u8 dev, u8 reg)
+static void smsc_fdc37m81x_config_dump_one(const char *key, u8 dev, u8 reg)
 {
-       printk("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg,
+       printk(KERN_INFO "%s: dev=0x%02x reg=0x%02x val=0x%02x\n",
+              key, dev, reg,
               smsc_fdc37m81x_rd(reg));
 }
 
 void smsc_fdc37m81x_config_dump(void)
 {
        u8 orig;
-       char *fname = "smsc_fdc37m81x_config_dump()";
+       const char *fname = __func__;
 
        smsc_fdc37m81x_config_beg();
 
        orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM);
 
-       printk("%s: common\n", fname);
+       printk(KERN_INFO "%s: common\n", fname);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
                                       SMSC_FDC37M81X_DNUM);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
@@ -154,7 +154,7 @@ void smsc_fdc37m81x_config_dump(void)
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
                                       SMSC_FDC37M81X_PMGT);
 
-       printk("%s: keyboard\n", fname);
+       printk(KERN_INFO "%s: keyboard\n", fname);
        smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
                                       SMSC_FDC37M81X_ACTIVE);
index ba292c9456691be2bfa1f8d5366a9f369f1a7bd7..20d61ac543e59b102591e86bae9432cfdb252498 100644 (file)
@@ -3,6 +3,5 @@
 #
 
 obj-y  += prom.o irq.o setup.o
-obj-$(CONFIG_KGDB)     += kgdb_io.o
 
 EXTRA_CFLAGS += -Werror
index 070c9a115e57a559ba023015015ae40ba67ab9ea..6ec626c9473fd4014a5c31919347d51aed407810 100644 (file)
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
 
 #include <asm/io.h>
 #include <asm/mipsregs.h>
-#include <asm/system.h>
-
-#include <asm/processor.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/jmr3927.h>
 
 #error JMR3927_IRQ_END > NR_IRQS
 #endif
 
-static unsigned char irc_level[TX3927_NUM_IR] = {
-       5, 5, 5, 5, 5, 5,       /* INT[5:0] */
-       7, 7,                   /* SIO */
-       5, 5, 5, 0, 0,          /* DMA, PIO, PCI */
-       6, 6, 6                 /* TMR */
-};
-
 /*
  * CP0_STATUS is a thread's resource (saved/restored on context switch).
  * So disable_irq/enable_irq MUST handle IOC/IRC registers.
@@ -103,26 +92,18 @@ static int jmr3927_irq_dispatch(int pending)
        return irq;
 }
 
-#ifdef CONFIG_PCI
-static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id)
-{
-       printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq);
-       printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n",
-              tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat);
-
-       return IRQ_HANDLED;
-}
-static struct irqaction pcierr_action = {
-       .handler = jmr3927_pcierr_interrupt,
-       .mask = CPU_MASK_NONE,
-       .name = "PCI error",
+static struct irq_chip jmr3927_irq_ioc = {
+       .name = "jmr3927_ioc",
+       .ack = mask_irq_ioc,
+       .mask = mask_irq_ioc,
+       .mask_ack = mask_irq_ioc,
+       .unmask = unmask_irq_ioc,
 };
-#endif
-
-static void __init jmr3927_irq_init(void);
 
 void __init jmr3927_irq_setup(void)
 {
+       int i;
+
        txx9_irq_dispatch = jmr3927_irq_dispatch;
        /* Now, interrupt control disabled, */
        /* all IRC interrupts are masked, */
@@ -138,34 +119,10 @@ void __init jmr3927_irq_setup(void)
        /* clear PCI Reset interrupts */
        jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR);
 
-       jmr3927_irq_init();
+       tx3927_irq_init();
+       for (i = JMR3927_IRQ_IOC; i < JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC; i++)
+               set_irq_chip_and_handler(i, &jmr3927_irq_ioc, handle_level_irq);
 
        /* setup IOC interrupt 1 (PCI, MODEM) */
        set_irq_chained_handler(JMR3927_IRQ_IOCINT, handle_simple_irq);
-
-#ifdef CONFIG_PCI
-       setup_irq(JMR3927_IRQ_IRC_PCI, &pcierr_action);
-#endif
-
-       /* enable all CPU interrupt bits. */
-       set_c0_status(ST0_IM);  /* IE bit is still 0. */
-}
-
-static struct irq_chip jmr3927_irq_ioc = {
-       .name = "jmr3927_ioc",
-       .ack = mask_irq_ioc,
-       .mask = mask_irq_ioc,
-       .mask_ack = mask_irq_ioc,
-       .unmask = unmask_irq_ioc,
-};
-
-static void __init jmr3927_irq_init(void)
-{
-       u32 i;
-
-       txx9_irq_init(TX3927_IRC_REG);
-       for (i = 0; i < TXx9_MAX_IR; i++)
-               txx9_irq_set_pri(i, irc_level[i]);
-       for (i = JMR3927_IRQ_IOC; i < JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC; i++)
-               set_irq_chip_and_handler(i, &jmr3927_irq_ioc, handle_level_irq);
 }
diff --git a/arch/mips/txx9/jmr3927/kgdb_io.c b/arch/mips/txx9/jmr3927/kgdb_io.c
deleted file mode 100644 (file)
index 5bd757e..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * BRIEF MODULE DESCRIPTION
- *     Low level uart routines to directly access a TX[34]927 SIO.
- *
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *             ahennessy@mvista.com or source@mvista.com
- *
- * Based on arch/mips/ddb5xxx/ddb5477/kgdb_io.c
- *
- * Copyright (C) 2000-2001 Toshiba Corporation
- *
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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 <asm/txx9/jmr3927.h>
-
-#define TIMEOUT       0xffffff
-
-static int remoteDebugInitialized = 0;
-static void debugInit(int baud);
-
-int putDebugChar(unsigned char c)
-{
-        int i = 0;
-
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(38400);
-       }
-
-        do {
-            slow_down();
-            i++;
-            if (i>TIMEOUT) {
-                break;
-            }
-        } while (!(tx3927_sioptr(0)->cisr & TXx927_SICISR_TXALS));
-       tx3927_sioptr(0)->tfifo = c;
-
-       return 1;
-}
-
-unsigned char getDebugChar(void)
-{
-        int i = 0;
-       int dicr;
-       char c;
-
-       if (!remoteDebugInitialized) {
-               remoteDebugInitialized = 1;
-               debugInit(38400);
-       }
-
-       /* diable RX int. */
-       dicr = tx3927_sioptr(0)->dicr;
-       tx3927_sioptr(0)->dicr = 0;
-
-        do {
-            slow_down();
-            i++;
-            if (i>TIMEOUT) {
-                break;
-            }
-        } while (tx3927_sioptr(0)->disr & TXx927_SIDISR_UVALID)
-               ;
-       c = tx3927_sioptr(0)->rfifo;
-
-       /* clear RX int. status */
-       tx3927_sioptr(0)->disr &= ~TXx927_SIDISR_RDIS;
-       /* enable RX int. */
-       tx3927_sioptr(0)->dicr = dicr;
-
-       return c;
-}
-
-static void debugInit(int baud)
-{
-       tx3927_sioptr(0)->lcr = 0x020;
-       tx3927_sioptr(0)->dicr = 0;
-       tx3927_sioptr(0)->disr = 0x4100;
-       tx3927_sioptr(0)->cisr = 0x014;
-       tx3927_sioptr(0)->fcr = 0;
-       tx3927_sioptr(0)->flcr = 0x02;
-       tx3927_sioptr(0)->bgr = ((JMR3927_BASE_BAUD + baud / 2) / baud) |
-               TXx927_SIBGR_BCLK_T0;
-}
index 2cadb423faceffc251edaabcc87219787edb5e75..70c4c8ec3e84b36d57b241f68a19c9a38bc05303 100644 (file)
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <asm/bootinfo.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/jmr3927.h>
 
-#define TIMEOUT       0xffffff
-
-void
-prom_putchar(char c)
-{
-        int i = 0;
-
-        do {
-            i++;
-            if (i>TIMEOUT)
-                break;
-        } while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS));
-       tx3927_sioptr(1)->tfifo = c;
-       return;
-}
-
-void
-puts(const char *cp)
-{
-    while (*cp)
-       prom_putchar(*cp++);
-    prom_putchar('\r');
-    prom_putchar('\n');
-}
-
 void __init jmr3927_prom_init(void)
 {
        /* CCFG */
        if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0)
-               puts("Warning: TX3927 TLB off\n");
+               printk(KERN_ERR "TX3927 TLB off\n");
 
        prom_init_cmdline();
        add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM);
+       txx9_sio_putchar_init(TX3927_SIO_REG(1));
 }
index 03647ebe41300a492bb73e1893cb2847b1e34081..87db41be8a565b9f3b0fc53632162cb534fed6c3 100644 (file)
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-#ifdef CONFIG_SERIAL_TXX9
-#include <linux/serial_core.h>
-#endif
-#include <asm/txx9tmr.h>
-#include <asm/txx9pio.h>
 #include <asm/reboot.h>
+#include <asm/txx9pio.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/pci.h>
 #include <asm/txx9/jmr3927.h>
 #include <asm/mipsregs.h>
 
-extern void puts(const char *cp);
-
-/* don't enable - see errata */
-static int jmr3927_ccfg_toeon;
-
-static inline void do_reset(void)
+static void jmr3927_machine_restart(char *command)
 {
+       local_irq_disable();
 #if 1  /* Resetting PCI bus */
        jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR);
        jmr3927_ioc_reg_out(JMR3927_IOC_RESET_PCI, JMR3927_IOC_RESET_ADDR);
@@ -61,33 +52,13 @@ static inline void do_reset(void)
        jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR);
 #endif
        jmr3927_ioc_reg_out(JMR3927_IOC_RESET_CPU, JMR3927_IOC_RESET_ADDR);
-}
-
-static void jmr3927_machine_restart(char *command)
-{
-       local_irq_disable();
-       puts("Rebooting...");
-       do_reset();
-}
-
-static void jmr3927_machine_halt(void)
-{
-       puts("JMR-TX3927 halted.\n");
-       while (1);
-}
-
-static void jmr3927_machine_power_off(void)
-{
-       puts("JMR-TX3927 halted. Please turn off the power.\n");
-       while (1);
+       /* fallback */
+       (*_machine_halt)();
 }
 
 static void __init jmr3927_time_init(void)
 {
-       txx9_clockevent_init(TX3927_TMR_REG(0),
-                            TXX9_IRQ_BASE + JMR3927_IRQ_IRC_TMR(0),
-                            JMR3927_IMCLK);
-       txx9_clocksource_init(TX3927_TMR_REG(1), JMR3927_IMCLK);
+       tx3927_time_init(0, 1);
 }
 
 #define DO_WRITE_THROUGH
@@ -102,11 +73,6 @@ static void __init jmr3927_mem_setup(void)
        set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO);
 
        _machine_restart = jmr3927_machine_restart;
-       _machine_halt = jmr3927_machine_halt;
-       pm_power_off = jmr3927_machine_power_off;
-
-       /* Reboot on panic */
-       panic_timeout = 180;
 
        /* cache setup */
        {
@@ -125,7 +91,8 @@ static void __init jmr3927_mem_setup(void)
 #endif
 
                conf = read_c0_conf();
-               conf &= ~(TX39_CONF_ICE | TX39_CONF_DCE | TX39_CONF_WBON | TX39_CONF_CWFON);
+               conf &= ~(TX39_CONF_ICE | TX39_CONF_DCE |
+                         TX39_CONF_WBON | TX39_CONF_CWFON);
                conf |= mips_ic_disable ? 0 : TX39_CONF_ICE;
                conf |= mips_dc_disable ? 0 : TX39_CONF_DCE;
                conf |= mips_config_wbon ? TX39_CONF_WBON : 0;
@@ -138,47 +105,14 @@ static void __init jmr3927_mem_setup(void)
        /* initialize board */
        jmr3927_board_init();
 
-       argptr = prom_getcmdline();
-
-       if ((argptr = strstr(argptr, "toeon")) != NULL)
-               jmr3927_ccfg_toeon = 1;
-       argptr = prom_getcmdline();
-       if ((argptr = strstr(argptr, "ip=")) == NULL) {
-               argptr = prom_getcmdline();
-               strcat(argptr, " ip=bootp");
-       }
-
-#ifdef CONFIG_SERIAL_TXX9
-       {
-               extern int early_serial_txx9_setup(struct uart_port *port);
-               int i;
-               struct uart_port req;
-               for(i = 0; i < 2; i++) {
-                       memset(&req, 0, sizeof(req));
-                       req.line = i;
-                       req.iotype = UPIO_MEM;
-                       req.membase = (unsigned char __iomem *)TX3927_SIO_REG(i);
-                       req.mapbase = TX3927_SIO_REG(i);
-                       req.irq = i == 0 ?
-                               JMR3927_IRQ_IRC_SIO0 : JMR3927_IRQ_IRC_SIO1;
-                       if (i == 0)
-                               req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
-                       req.uartclk = JMR3927_IMCLK;
-                       early_serial_txx9_setup(&req);
-               }
-       }
+       tx3927_sio_init(0, 1 << 1); /* ch1: noCTS */
 #ifdef CONFIG_SERIAL_TXX9_CONSOLE
        argptr = prom_getcmdline();
-       if ((argptr = strstr(argptr, "console=")) == NULL) {
-               argptr = prom_getcmdline();
+       if (!strstr(argptr, "console="))
                strcat(argptr, " console=ttyS1,115200");
-       }
-#endif
 #endif
 }
 
-static void tx3927_setup(void);
-
 static void __init jmr3927_pci_setup(void)
 {
 #ifdef CONFIG_PCI
@@ -199,32 +133,13 @@ static void __init jmr3927_pci_setup(void)
                jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR);
        }
        tx3927_pcic_setup(c, JMR3927_SDRAM_SIZE, extarb);
+       tx3927_setup_pcierr_irq();
 #endif /* CONFIG_PCI */
 }
 
 static void __init jmr3927_board_init(void)
 {
-       tx3927_setup();
-       jmr3927_pci_setup();
-
-       /* SIO0 DTR on */
-       jmr3927_ioc_reg_out(0, JMR3927_IOC_DTR_ADDR);
-
-       jmr3927_led_set(0);
-
-       printk("JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n",
-              jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK,
-              jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK,
-              jmr3927_dipsw1(), jmr3927_dipsw2(),
-              jmr3927_dipsw3(), jmr3927_dipsw4());
-}
-
-static void __init tx3927_setup(void)
-{
-       int i;
-
        txx9_cpu_clock = JMR3927_CORECLK;
-       txx9_gbus_clock = JMR3927_GBUSCLK;
        /* SDRAMC are configured by PROM */
 
        /* ROMC */
@@ -233,74 +148,32 @@ static void __init tx3927_setup(void)
        tx3927_romcptr->cr[3] = JMR3927_ROMCE3 | 0x0003f698;
        tx3927_romcptr->cr[5] = JMR3927_ROMCE5 | 0x0000f218;
 
-       /* CCFG */
-       /* enable Timeout BusError */
-       if (jmr3927_ccfg_toeon)
-               tx3927_ccfgptr->ccfg |= TX3927_CCFG_TOE;
-
-       /* clear BusErrorOnWrite flag */
-       tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW;
-       /* Disable PCI snoop */
-       tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP;
-       /* do reset on watchdog */
-       tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR;
-
-#ifdef DO_WRITE_THROUGH
-       /* Enable PCI SNOOP - with write through only */
-       tx3927_ccfgptr->ccfg |= TX3927_CCFG_PSNP;
-#endif
-
        /* Pin selection */
        tx3927_ccfgptr->pcfg &= ~TX3927_PCFG_SELALL;
        tx3927_ccfgptr->pcfg |=
                TX3927_PCFG_SELSIOC(0) | TX3927_PCFG_SELSIO_ALL |
                (TX3927_PCFG_SELDMA_ALL & ~TX3927_PCFG_SELDMA(1));
 
-       printk("TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n",
-              tx3927_ccfgptr->crir,
-              tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg);
-
-       /* TMR */
-       for (i = 0; i < TX3927_NR_TMR; i++)
-               txx9_tmr_init(TX3927_TMR_REG(i));
-
-       /* DMA */
-       tx3927_dmaptr->mcr = 0;
-       for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) {
-               /* reset channel */
-               tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST;
-               tx3927_dmaptr->ch[i].ccr = 0;
-       }
-       /* enable DMA */
-#ifdef __BIG_ENDIAN
-       tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN;
-#else
-       tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN | TX3927_DMA_MCR_LE;
-#endif
+       tx3927_setup();
 
-       /* PIO */
        /* PIO[15:12] connected to LEDs */
        __raw_writel(0x0000f000, &tx3927_pioptr->dir);
-       __raw_writel(0, &tx3927_pioptr->maskcpu);
-       __raw_writel(0, &tx3927_pioptr->maskext);
-       txx9_gpio_init(TX3927_PIO_REG, 0, 16);
        gpio_request(11, "dipsw1");
        gpio_request(10, "dipsw2");
-       {
-               unsigned int conf;
 
-       conf = read_c0_conf();
-               if (!(conf & TX39_CONF_ICE))
-                       printk("TX3927 I-Cache disabled.\n");
-               if (!(conf & TX39_CONF_DCE))
-                       printk("TX3927 D-Cache disabled.\n");
-               else if (!(conf & TX39_CONF_WBON))
-                       printk("TX3927 D-Cache WriteThrough.\n");
-               else if (!(conf & TX39_CONF_CWFON))
-                       printk("TX3927 D-Cache WriteBack.\n");
-               else
-                       printk("TX3927 D-Cache WriteBack (CWF) .\n");
-       }
+       jmr3927_pci_setup();
+
+       /* SIO0 DTR on */
+       jmr3927_ioc_reg_out(0, JMR3927_IOC_DTR_ADDR);
+
+       jmr3927_led_set(0);
+
+       printk(KERN_INFO
+              "JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n",
+              jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK,
+              jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK,
+              jmr3927_dipsw1(), jmr3927_dipsw2(),
+              jmr3927_dipsw3(), jmr3927_dipsw4());
 }
 
 /* This trick makes rtc-ds1742 driver usable as is. */
@@ -316,42 +189,21 @@ static unsigned long jmr3927_swizzle_addr_b(unsigned long port)
 #endif
 }
 
-static int __init jmr3927_rtc_init(void)
+static void __init jmr3927_rtc_init(void)
 {
        static struct resource __initdata res = {
                .start  = JMR3927_IOC_NVRAMB_ADDR - IO_BASE,
                .end    = JMR3927_IOC_NVRAMB_ADDR - IO_BASE + 0x800 - 1,
                .flags  = IORESOURCE_MEM,
        };
-       struct platform_device *dev;
-       dev = platform_device_register_simple("rtc-ds1742", -1, &res, 1);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
-}
-
-/* Watchdog support */
-
-static int __init txx9_wdt_init(unsigned long base)
-{
-       struct resource res = {
-               .start  = base,
-               .end    = base + 0x100 - 1,
-               .flags  = IORESOURCE_MEM,
-       };
-       struct platform_device *dev =
-               platform_device_register_simple("txx9wdt", -1, &res, 1);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
-}
-
-static int __init jmr3927_wdt_init(void)
-{
-       return txx9_wdt_init(TX3927_TMR_REG(2));
+       platform_device_register_simple("rtc-ds1742", -1, &res, 1);
 }
 
 static void __init jmr3927_device_init(void)
 {
        __swizzle_addr_b = jmr3927_swizzle_addr_b;
        jmr3927_rtc_init();
-       jmr3927_wdt_init();
+       tx3927_wdt_init();
 }
 
 struct txx9_board_vec jmr3927_vec __initdata = {
index cd748a930328ecc122b0eb4b4c8858b5f8e2ffe8..00cd5231da30c33524cf5ae02d7ad49d36e58851 100644 (file)
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 /*
-IRQ  Device
-00   RBTX4927-ISA/00
-01   RBTX4927-ISA/01 PS2/Keyboard
-02   RBTX4927-ISA/02 Cascade RBTX4927-ISA (irqs 8-15)
-03   RBTX4927-ISA/03
-04   RBTX4927-ISA/04
-05   RBTX4927-ISA/05
-06   RBTX4927-ISA/06
-07   RBTX4927-ISA/07
-08   RBTX4927-ISA/08
-09   RBTX4927-ISA/09
-10   RBTX4927-ISA/10
-11   RBTX4927-ISA/11
-12   RBTX4927-ISA/12 PS2/Mouse (not supported at this time)
-13   RBTX4927-ISA/13
-14   RBTX4927-ISA/14 IDE
-15   RBTX4927-ISA/15
-
-16   TX4927-CP0/00 Software 0
-17   TX4927-CP0/01 Software 1
-18   TX4927-CP0/02 Cascade TX4927-CP0
-19   TX4927-CP0/03 Multiplexed -- do not use
-20   TX4927-CP0/04 Multiplexed -- do not use
-21   TX4927-CP0/05 Multiplexed -- do not use
-22   TX4927-CP0/06 Multiplexed -- do not use
-23   TX4927-CP0/07 CPU TIMER
-
-24   TX4927-PIC/00
-25   TX4927-PIC/01
-26   TX4927-PIC/02
-27   TX4927-PIC/03 Cascade RBTX4927-IOC
-28   TX4927-PIC/04
-29   TX4927-PIC/05 RBTX4927 RTL-8019AS ethernet
-30   TX4927-PIC/06
-31   TX4927-PIC/07
-32   TX4927-PIC/08 TX4927 SerialIO Channel 0
-33   TX4927-PIC/09 TX4927 SerialIO Channel 1
-34   TX4927-PIC/10
-35   TX4927-PIC/11
-36   TX4927-PIC/12
-37   TX4927-PIC/13
-38   TX4927-PIC/14
-39   TX4927-PIC/15
-40   TX4927-PIC/16 TX4927 PCI PCI-C
-41   TX4927-PIC/17
-42   TX4927-PIC/18
-43   TX4927-PIC/19
-44   TX4927-PIC/20
-45   TX4927-PIC/21
-46   TX4927-PIC/22 TX4927 PCI PCI-ERR
-47   TX4927-PIC/23 TX4927 PCI PCI-PMA (not used)
-48   TX4927-PIC/24
-49   TX4927-PIC/25
-50   TX4927-PIC/26
-51   TX4927-PIC/27
-52   TX4927-PIC/28
-53   TX4927-PIC/29
-54   TX4927-PIC/30
-55   TX4927-PIC/31
-
-56 RBTX4927-IOC/00 FPCIB0 PCI-D PJ4/A PJ5/B SB/C PJ6/D PJ7/A (SouthBridge/NotUsed)        [RTL-8139=PJ4]
-57 RBTX4927-IOC/01 FPCIB0 PCI-C PJ4/D PJ5/A SB/B PJ6/C PJ7/D (SouthBridge/NotUsed)        [RTL-8139=PJ5]
-58 RBTX4927-IOC/02 FPCIB0 PCI-B PJ4/C PJ5/D SB/A PJ6/B PJ7/C (SouthBridge/IDE/pin=1,INTR) [RTL-8139=NotSupported]
-59 RBTX4927-IOC/03 FPCIB0 PCI-A PJ4/B PJ5/C SB/D PJ6/A PJ7/B (SouthBridge/USB/pin=4)      [RTL-8139=PJ6]
-60 RBTX4927-IOC/04
-61 RBTX4927-IOC/05
-62 RBTX4927-IOC/06
-63 RBTX4927-IOC/07
-
-NOTES:
-SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58
-SouthBridge/ISA/pin=0 no pci irq used by this device
-SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR via ISA IRQ14
-SouthBridge/USB/pin=4 using pci irq SouthBridge/D=PCI-A=#59
-SouthBridge/PMC/pin=0 no pci irq used by this device
-SuperIO/PS2/Keyboard, using INTR via ISA IRQ1
-SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported)
-JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthBridge, JP4, JP5, JP6
-*/
+ * I8259A_IRQ_BASE+00
+ * I8259A_IRQ_BASE+01 PS2/Keyboard
+ * I8259A_IRQ_BASE+02 Cascade RBTX4927-ISA (irqs 8-15)
+ * I8259A_IRQ_BASE+03
+ * I8259A_IRQ_BASE+04
+ * I8259A_IRQ_BASE+05
+ * I8259A_IRQ_BASE+06
+ * I8259A_IRQ_BASE+07
+ * I8259A_IRQ_BASE+08
+ * I8259A_IRQ_BASE+09
+ * I8259A_IRQ_BASE+10
+ * I8259A_IRQ_BASE+11
+ * I8259A_IRQ_BASE+12 PS2/Mouse (not supported at this time)
+ * I8259A_IRQ_BASE+13
+ * I8259A_IRQ_BASE+14 IDE
+ * I8259A_IRQ_BASE+15
+ *
+ * MIPS_CPU_IRQ_BASE+00 Software 0
+ * MIPS_CPU_IRQ_BASE+01 Software 1
+ * MIPS_CPU_IRQ_BASE+02 Cascade TX4927-CP0
+ * MIPS_CPU_IRQ_BASE+03 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+04 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+05 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+06 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+07 CPU TIMER
+ *
+ * TXX9_IRQ_BASE+00
+ * TXX9_IRQ_BASE+01
+ * TXX9_IRQ_BASE+02
+ * TXX9_IRQ_BASE+03 Cascade RBTX4927-IOC
+ * TXX9_IRQ_BASE+04
+ * TXX9_IRQ_BASE+05 RBTX4927 RTL-8019AS ethernet
+ * TXX9_IRQ_BASE+06
+ * TXX9_IRQ_BASE+07
+ * TXX9_IRQ_BASE+08 TX4927 SerialIO Channel 0
+ * TXX9_IRQ_BASE+09 TX4927 SerialIO Channel 1
+ * TXX9_IRQ_BASE+10
+ * TXX9_IRQ_BASE+11
+ * TXX9_IRQ_BASE+12
+ * TXX9_IRQ_BASE+13
+ * TXX9_IRQ_BASE+14
+ * TXX9_IRQ_BASE+15
+ * TXX9_IRQ_BASE+16 TX4927 PCI PCI-C
+ * TXX9_IRQ_BASE+17
+ * TXX9_IRQ_BASE+18
+ * TXX9_IRQ_BASE+19
+ * TXX9_IRQ_BASE+20
+ * TXX9_IRQ_BASE+21
+ * TXX9_IRQ_BASE+22 TX4927 PCI PCI-ERR
+ * TXX9_IRQ_BASE+23 TX4927 PCI PCI-PMA (not used)
+ * TXX9_IRQ_BASE+24
+ * TXX9_IRQ_BASE+25
+ * TXX9_IRQ_BASE+26
+ * TXX9_IRQ_BASE+27
+ * TXX9_IRQ_BASE+28
+ * TXX9_IRQ_BASE+29
+ * TXX9_IRQ_BASE+30
+ * TXX9_IRQ_BASE+31
+ *
+ * RBTX4927_IRQ_IOC+00 FPCIB0 PCI-D (SouthBridge)
+ * RBTX4927_IRQ_IOC+01 FPCIB0 PCI-C (SouthBridge)
+ * RBTX4927_IRQ_IOC+02 FPCIB0 PCI-B (SouthBridge/IDE/pin=1,INTR)
+ * RBTX4927_IRQ_IOC+03 FPCIB0 PCI-A (SouthBridge/USB/pin=4)
+ * RBTX4927_IRQ_IOC+04
+ * RBTX4927_IRQ_IOC+05
+ * RBTX4927_IRQ_IOC+06
+ * RBTX4927_IRQ_IOC+07
+ *
+ * NOTES:
+ * SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58
+ * SouthBridge/ISA/pin=0 no pci irq used by this device
+ * SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR
+ * via ISA IRQ14
+ * SouthBridge/USB/pin=4 using pci irq SouthBridge/D=PCI-A=#59
+ * SouthBridge/PMC/pin=0 no pci irq used by this device
+ * SuperIO/PS2/Keyboard, using INTR via ISA IRQ1
+ * SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported)
+ * JP7 is not bus master -- do NOT use -- only 4 pci bus master's
+ * allowed -- SouthBridge, JP4, JP5, JP6
+ */
 
 #include <linux/init.h>
 #include <linux/types.h>
@@ -134,7 +135,7 @@ static int toshiba_rbtx4927_irq_nested(int sw_irq)
        level3 = readb(rbtx4927_imstat_addr) & 0x1f;
        if (level3)
                sw_irq = RBTX4927_IRQ_IOC + fls(level3) - 1;
-       return (sw_irq);
+       return sw_irq;
 }
 
 static void __init toshiba_rbtx4927_irq_ioc_init(void)
index 5c0de54ebdd2c6ee8aa9f978284374da686a2225..1dc0a5b1956b2ec425e790adfe4f10d58b4e3bd9 100644 (file)
@@ -38,4 +38,5 @@ void __init rbtx4927_prom_init(void)
 {
        prom_init_cmdline();
        add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM);
+       txx9_sio_putchar_init(TX4927_SIO_REG(0) & 0xfffffffffULL);
 }
index 3da20ea3e55ceb36259580408115ee05d763bf0e..0d39bafea794278968384700b19f7125bd8785cf 100644 (file)
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <asm/io.h>
-#include <asm/processor.h>
 #include <asm/reboot.h>
 #include <asm/txx9/generic.h>
 #include <asm/txx9/pci.h>
@@ -103,6 +100,7 @@ static void __init tx4927_pci_setup(void)
                tx4927_report_pciclk();
                tx4927_pcic_setup(tx4927_pcicptr, c, extarb);
        }
+       tx4927_setup_pcierr_irq();
 }
 
 static void __init tx4937_pci_setup(void)
@@ -149,6 +147,7 @@ static void __init tx4937_pci_setup(void)
                tx4938_report_pciclk();
                tx4927_pcic_setup(tx4938_pcicptr, c, extarb);
        }
+       tx4938_setup_pcierr_irq();
 }
 
 static void __init rbtx4927_arch_init(void)
@@ -165,17 +164,8 @@ static void __init rbtx4937_arch_init(void)
 #define rbtx4937_arch_init NULL
 #endif /* CONFIG_PCI */
 
-static void __noreturn wait_forever(void)
-{
-       while (1)
-               if (cpu_wait)
-                       (*cpu_wait)();
-}
-
 static void toshiba_rbtx4927_restart(char *command)
 {
-       printk(KERN_NOTICE "System Rebooting...\n");
-
        /* enable the s/w reset register */
        writeb(1, rbtx4927_softresetlock_addr);
 
@@ -186,24 +176,8 @@ static void toshiba_rbtx4927_restart(char *command)
        /* do a s/w reset */
        writeb(1, rbtx4927_softreset_addr);
 
-       /* do something passive while waiting for reset */
-       local_irq_disable();
-       wait_forever();
-       /* no return */
-}
-
-static void toshiba_rbtx4927_halt(void)
-{
-       printk(KERN_NOTICE "System Halted\n");
-       local_irq_disable();
-       wait_forever();
-       /* no return */
-}
-
-static void toshiba_rbtx4927_power_off(void)
-{
-       toshiba_rbtx4927_halt();
-       /* no return */
+       /* fallback */
+       (*_machine_halt)();
 }
 
 static void __init rbtx4927_clock_init(void);
@@ -214,9 +188,6 @@ static void __init rbtx4927_mem_setup(void)
        u32 cp0_config;
        char *argptr;
 
-       /* f/w leaves this on at startup */
-       clear_c0_status(ST0_ERL);
-
        /* enable caches -- HCP5 does this, pmon does not */
        cp0_config = read_c0_config();
        cp0_config = cp0_config & ~(TX49_CONF_IC | TX49_CONF_DC);
@@ -231,37 +202,21 @@ static void __init rbtx4927_mem_setup(void)
        }
 
        _machine_restart = toshiba_rbtx4927_restart;
-       _machine_halt = toshiba_rbtx4927_halt;
-       pm_power_off = toshiba_rbtx4927_power_off;
 
 #ifdef CONFIG_PCI
        txx9_alloc_pci_controller(&txx9_primary_pcic,
                                  RBTX4927_PCIMEM, RBTX4927_PCIMEM_SIZE,
                                  RBTX4927_PCIIO, RBTX4927_PCIIO_SIZE);
+       txx9_board_pcibios_setup = tx4927_pcibios_setup;
 #else
        set_io_port_base(KSEG1 + RBTX4927_ISA_IO_OFFSET);
 #endif
 
-       tx4927_setup_serial();
+       tx4927_sio_init(0, 0);
 #ifdef CONFIG_SERIAL_TXX9_CONSOLE
-        argptr = prom_getcmdline();
-        if (strstr(argptr, "console=") == NULL) {
-                strcat(argptr, " console=ttyS0,38400");
-        }
-#endif
-
-#ifdef CONFIG_ROOT_NFS
-        argptr = prom_getcmdline();
-        if (strstr(argptr, "root=") == NULL) {
-                strcat(argptr, " root=/dev/nfs rw");
-        }
-#endif
-
-#ifdef CONFIG_IP_PNP
-        argptr = prom_getcmdline();
-        if (strstr(argptr, "ip=") == NULL) {
-                strcat(argptr, " ip=any");
-        }
+       argptr = prom_getcmdline();
+       if (!strstr(argptr, "console="))
+               strcat(argptr, " console=ttyS0,38400");
 #endif
 }
 
@@ -324,19 +279,17 @@ static void __init rbtx4927_time_init(void)
        tx4927_time_init(0);
 }
 
-static int __init toshiba_rbtx4927_rtc_init(void)
+static void __init toshiba_rbtx4927_rtc_init(void)
 {
        struct resource res = {
                .start  = RBTX4927_BRAMRTC_BASE - IO_BASE,
                .end    = RBTX4927_BRAMRTC_BASE - IO_BASE + 0x800 - 1,
                .flags  = IORESOURCE_MEM,
        };
-       struct platform_device *dev =
-               platform_device_register_simple("rtc-ds1742", -1, &res, 1);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+       platform_device_register_simple("rtc-ds1742", -1, &res, 1);
 }
 
-static int __init rbtx4927_ne_init(void)
+static void __init rbtx4927_ne_init(void)
 {
        struct resource res[] = {
                {
@@ -348,36 +301,14 @@ static int __init rbtx4927_ne_init(void)
                        .flags  = IORESOURCE_IRQ,
                }
        };
-       struct platform_device *dev =
-               platform_device_register_simple("ne", -1,
-                                               res, ARRAY_SIZE(res));
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
-}
-
-/* Watchdog support */
-
-static int __init txx9_wdt_init(unsigned long base)
-{
-       struct resource res = {
-               .start  = base,
-               .end    = base + 0x100 - 1,
-               .flags  = IORESOURCE_MEM,
-       };
-       struct platform_device *dev =
-               platform_device_register_simple("txx9wdt", -1, &res, 1);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
-}
-
-static int __init rbtx4927_wdt_init(void)
-{
-       return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
+       platform_device_register_simple("ne", -1, res, ARRAY_SIZE(res));
 }
 
 static void __init rbtx4927_device_init(void)
 {
        toshiba_rbtx4927_rtc_init();
        rbtx4927_ne_init();
-       rbtx4927_wdt_init();
+       tx4927_wdt_init();
 }
 
 struct txx9_board_vec rbtx4927_vec __initdata = {
index 3971a061657a6239f0cfb131fd635b5ebcefe518..ca2f8306ce93b1e95fde8594793507c4bdc356df 100644 (file)
  */
 
 /*
-IRQ  Device
-
-16   TX4938-CP0/00 Software 0
-17   TX4938-CP0/01 Software 1
-18   TX4938-CP0/02 Cascade TX4938-CP0
-19   TX4938-CP0/03 Multiplexed -- do not use
-20   TX4938-CP0/04 Multiplexed -- do not use
-21   TX4938-CP0/05 Multiplexed -- do not use
-22   TX4938-CP0/06 Multiplexed -- do not use
-23   TX4938-CP0/07 CPU TIMER
-
-24   TX4938-PIC/00
-25   TX4938-PIC/01
-26   TX4938-PIC/02 Cascade RBTX4938-IOC
-27   TX4938-PIC/03 RBTX4938 RTL-8019AS Ethernet
-28   TX4938-PIC/04
-29   TX4938-PIC/05 TX4938 ETH1
-30   TX4938-PIC/06 TX4938 ETH0
-31   TX4938-PIC/07
-32   TX4938-PIC/08 TX4938 SIO 0
-33   TX4938-PIC/09 TX4938 SIO 1
-34   TX4938-PIC/10 TX4938 DMA0
-35   TX4938-PIC/11 TX4938 DMA1
-36   TX4938-PIC/12 TX4938 DMA2
-37   TX4938-PIC/13 TX4938 DMA3
-38   TX4938-PIC/14
-39   TX4938-PIC/15
-40   TX4938-PIC/16 TX4938 PCIC
-41   TX4938-PIC/17 TX4938 TMR0
-42   TX4938-PIC/18 TX4938 TMR1
-43   TX4938-PIC/19 TX4938 TMR2
-44   TX4938-PIC/20
-45   TX4938-PIC/21
-46   TX4938-PIC/22 TX4938 PCIERR
-47   TX4938-PIC/23
-48   TX4938-PIC/24
-49   TX4938-PIC/25
-50   TX4938-PIC/26
-51   TX4938-PIC/27
-52   TX4938-PIC/28
-53   TX4938-PIC/29
-54   TX4938-PIC/30
-55   TX4938-PIC/31 TX4938 SPI
-
-56 RBTX4938-IOC/00 PCI-D
-57 RBTX4938-IOC/01 PCI-C
-58 RBTX4938-IOC/02 PCI-B
-59 RBTX4938-IOC/03 PCI-A
-60 RBTX4938-IOC/04 RTC
-61 RBTX4938-IOC/05 ATA
-62 RBTX4938-IOC/06 MODEM
-63 RBTX4938-IOC/07 SWINT
-*/
+ * MIPS_CPU_IRQ_BASE+00 Software 0
+ * MIPS_CPU_IRQ_BASE+01 Software 1
+ * MIPS_CPU_IRQ_BASE+02 Cascade TX4938-CP0
+ * MIPS_CPU_IRQ_BASE+03 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+04 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+05 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+06 Multiplexed -- do not use
+ * MIPS_CPU_IRQ_BASE+07 CPU TIMER
+ *
+ * TXX9_IRQ_BASE+00
+ * TXX9_IRQ_BASE+01
+ * TXX9_IRQ_BASE+02 Cascade RBTX4938-IOC
+ * TXX9_IRQ_BASE+03 RBTX4938 RTL-8019AS Ethernet
+ * TXX9_IRQ_BASE+04
+ * TXX9_IRQ_BASE+05 TX4938 ETH1
+ * TXX9_IRQ_BASE+06 TX4938 ETH0
+ * TXX9_IRQ_BASE+07
+ * TXX9_IRQ_BASE+08 TX4938 SIO 0
+ * TXX9_IRQ_BASE+09 TX4938 SIO 1
+ * TXX9_IRQ_BASE+10 TX4938 DMA0
+ * TXX9_IRQ_BASE+11 TX4938 DMA1
+ * TXX9_IRQ_BASE+12 TX4938 DMA2
+ * TXX9_IRQ_BASE+13 TX4938 DMA3
+ * TXX9_IRQ_BASE+14
+ * TXX9_IRQ_BASE+15
+ * TXX9_IRQ_BASE+16 TX4938 PCIC
+ * TXX9_IRQ_BASE+17 TX4938 TMR0
+ * TXX9_IRQ_BASE+18 TX4938 TMR1
+ * TXX9_IRQ_BASE+19 TX4938 TMR2
+ * TXX9_IRQ_BASE+20
+ * TXX9_IRQ_BASE+21
+ * TXX9_IRQ_BASE+22 TX4938 PCIERR
+ * TXX9_IRQ_BASE+23
+ * TXX9_IRQ_BASE+24
+ * TXX9_IRQ_BASE+25
+ * TXX9_IRQ_BASE+26
+ * TXX9_IRQ_BASE+27
+ * TXX9_IRQ_BASE+28
+ * TXX9_IRQ_BASE+29
+ * TXX9_IRQ_BASE+30
+ * TXX9_IRQ_BASE+31 TX4938 SPI
+ *
+ * RBTX4938_IRQ_IOC+00 PCI-D
+ * RBTX4938_IRQ_IOC+01 PCI-C
+ * RBTX4938_IRQ_IOC+02 PCI-B
+ * RBTX4938_IRQ_IOC+03 PCI-A
+ * RBTX4938_IRQ_IOC+04 RTC
+ * RBTX4938_IRQ_IOC+05 ATA
+ * RBTX4938_IRQ_IOC+06 MODEM
+ * RBTX4938_IRQ_IOC+07 SWINT
+ */
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <asm/mipsregs.h>
@@ -93,9 +91,6 @@ static int toshiba_rbtx4938_irq_nested(int sw_irq)
        return sw_irq;
 }
 
-/**********************************************************************************/
-/* Functions for ioc                                                              */
-/**********************************************************************************/
 static void __init
 toshiba_rbtx4938_irq_ioc_init(void)
 {
index ee189519ce5a6bf92ebaea66650fbd64d0afc5df..d73123cd2ab9441a68fcc65e31251a214ab16b54 100644 (file)
@@ -22,4 +22,5 @@ void __init rbtx4938_prom_init(void)
        prom_init_cmdline();
 #endif
        add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM);
+       txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL);
 }
index 6c2b99bb8af630e1d9c1b176ebd5b927689b11da..9ab48dec0fe840f12f9fccdf9e2cc0a631da90bc 100644 (file)
@@ -13,9 +13,6 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/console.h>
-#include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 
 #include <asm/txx9/spi.h>
 #include <asm/txx9pio.h>
 
-static void rbtx4938_machine_halt(void)
-{
-        printk(KERN_NOTICE "System Halted\n");
-       local_irq_disable();
-
-       while (1)
-               __asm__(".set\tmips3\n\t"
-                       "wait\n\t"
-                       ".set\tmips0");
-}
-
-static void rbtx4938_machine_power_off(void)
-{
-        rbtx4938_machine_halt();
-        /* no return */
-}
-
 static void rbtx4938_machine_restart(char *command)
 {
        local_irq_disable();
-
-       printk("Rebooting...");
        writeb(1, rbtx4938_softresetlock_addr);
        writeb(1, rbtx4938_sfvol_addr);
        writeb(1, rbtx4938_softreset_addr);
-       while(1)
-               ;
+       /* fallback */
+       (*_machine_halt)();
 }
 
 static void __init rbtx4938_pci_setup(void)
@@ -121,6 +99,7 @@ static void __init rbtx4938_pci_setup(void)
                register_pci_controller(c);
                tx4927_pcic_setup(tx4938_pcic1ptr, c, 0);
        }
+       tx4938_setup_pcierr_irq();
 #endif /* CONFIG_PCI */
 }
 
@@ -151,19 +130,7 @@ static int __init rbtx4938_ethaddr_init(void)
                if (sum)
                        printk(KERN_WARNING "seeprom: bad checksum.\n");
        }
-       for (i = 0; i < 2; i++) {
-               unsigned int id =
-                       TXX9_IRQ_BASE + (i ? TX4938_IR_ETH1 : TX4938_IR_ETH0);
-               struct platform_device *pdev;
-               if (!(__raw_readq(&tx4938_ccfgptr->pcfg) &
-                     (i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL)))
-                       continue;
-               pdev = platform_device_alloc("tc35815-mac", id);
-               if (!pdev ||
-                   platform_device_add_data(pdev, &dat[4 + 6 * i], 6) ||
-                   platform_device_add(pdev))
-                       platform_device_put(pdev);
-       }
+       tx4938_ethaddr_init(&dat[4], &dat[4 + 6]);
 #endif /* CONFIG_PCI */
        return 0;
 }
@@ -193,51 +160,36 @@ static void __init rbtx4938_mem_setup(void)
 
 #ifdef CONFIG_PCI
        txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0);
+       txx9_board_pcibios_setup = tx4927_pcibios_setup;
 #else
        set_io_port_base(RBTX4938_ETHER_BASE);
 #endif
 
-       tx4938_setup_serial();
+       tx4938_sio_init(7372800, 0);
 #ifdef CONFIG_SERIAL_TXX9_CONSOLE
-        argptr = prom_getcmdline();
-        if (strstr(argptr, "console=") == NULL) {
-                strcat(argptr, " console=ttyS0,38400");
-        }
+       argptr = prom_getcmdline();
+       if (!strstr(argptr, "console="))
+               strcat(argptr, " console=ttyS0,38400");
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61
-       printk("PIOSEL: disabling both ata and nand selection\n");
-       local_irq_disable();
+       printk(KERN_INFO "PIOSEL: disabling both ata and nand selection\n");
        txx9_clear64(&tx4938_ccfgptr->pcfg,
                     TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL);
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND
-       printk("PIOSEL: enabling nand selection\n");
+       printk(KERN_INFO "PIOSEL: enabling nand selection\n");
        txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
        txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA
-       printk("PIOSEL: enabling ata selection\n");
+       printk(KERN_INFO "PIOSEL: enabling ata selection\n");
        txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
        txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
 #endif
 
-#ifdef CONFIG_IP_PNP
-       argptr = prom_getcmdline();
-       if (strstr(argptr, "ip=") == NULL) {
-               strcat(argptr, " ip=any");
-       }
-#endif
-
-
-#ifdef CONFIG_FB
-       {
-               conswitchp = &dummy_con;
-       }
-#endif
-
        rbtx4938_spi_setup();
        pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg);    /* updated */
        /* fixup piosel */
@@ -258,11 +210,9 @@ static void __init rbtx4938_mem_setup(void)
        rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff;
        rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
        if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource))
-               printk("request resource for fpga failed\n");
+               printk(KERN_ERR "request resource for fpga failed\n");
 
        _machine_restart = rbtx4938_machine_restart;
-       _machine_halt = rbtx4938_machine_halt;
-       pm_power_off = rbtx4938_machine_power_off;
 
        writeb(0xff, rbtx4938_led_addr);
        printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",
@@ -270,7 +220,7 @@ static void __init rbtx4938_mem_setup(void)
               readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr));
 }
 
-static int __init rbtx4938_ne_init(void)
+static void __init rbtx4938_ne_init(void)
 {
        struct resource res[] = {
                {
@@ -282,10 +232,7 @@ static int __init rbtx4938_ne_init(void)
                        .flags  = IORESOURCE_IRQ,
                }
        };
-       struct platform_device *dev =
-               platform_device_register_simple("ne", -1,
-                                               res, ARRAY_SIZE(res));
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+       platform_device_register_simple("ne", -1, res, ARRAY_SIZE(res));
 }
 
 static DEFINE_SPINLOCK(rbtx4938_spi_gpio_lock);
@@ -321,24 +268,6 @@ static struct gpio_chip rbtx4938_spi_gpio_chip = {
        .ngpio = 3,
 };
 
-/* SPI support */
-
-static void __init txx9_spi_init(unsigned long base, int irq)
-{
-       struct resource res[] = {
-               {
-                       .start  = base,
-                       .end    = base + 0x20 - 1,
-                       .flags  = IORESOURCE_MEM,
-               }, {
-                       .start  = irq,
-                       .flags  = IORESOURCE_IRQ,
-               },
-       };
-       platform_device_register_simple("spi_txx9", 0,
-                                       res, ARRAY_SIZE(res));
-}
-
 static int __init rbtx4938_spi_init(void)
 {
        struct spi_board_info srtc_info = {
@@ -361,7 +290,7 @@ static int __init rbtx4938_spi_init(void)
        gpio_direction_output(16 + SEEPROM2_CS, 1);
        gpio_request(16 + SEEPROM3_CS, "seeprom3");
        gpio_direction_output(16 + SEEPROM3_CS, 1);
-       txx9_spi_init(TX4938_SPI_REG & 0xfffffffffULL, RBTX4938_IRQ_IRC_SPI);
+       tx4938_spi_init(0);
        return 0;
 }
 
@@ -372,30 +301,11 @@ static void __init rbtx4938_arch_init(void)
        rbtx4938_spi_init();
 }
 
-/* Watchdog support */
-
-static int __init txx9_wdt_init(unsigned long base)
-{
-       struct resource res = {
-               .start  = base,
-               .end    = base + 0x100 - 1,
-               .flags  = IORESOURCE_MEM,
-       };
-       struct platform_device *dev =
-               platform_device_register_simple("txx9wdt", -1, &res, 1);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
-}
-
-static int __init rbtx4938_wdt_init(void)
-{
-       return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
-}
-
 static void __init rbtx4938_device_init(void)
 {
        rbtx4938_ethaddr_init();
        rbtx4938_ne_init();
-       rbtx4938_wdt_init();
+       tx4938_wdt_init();
 }
 
 struct txx9_board_vec rbtx4938_vec __initdata = {
index 11de3606eee6d004e351f86bd4df0b1ce7800d55..b7cbb1487af462cf8d8a626a718e39d5dfa19014 100644 (file)
@@ -716,6 +716,12 @@ ENTRY(sys_call_table)
        .long sys_fallocate             /* 325 */
        .long sys_timerfd_settime
        .long sys_timerfd_gettime
+       .long sys_signalfd4
+       .long sys_eventfd2
+       .long sys_epoll_create1         /* 330 */
+       .long sys_dup3
+       .long sys_pipe2
+       .long sys_inotify_init1
 
 
 nr_syscalls=(.-sys_call_table)/4
index 2e2d2ffb6a0758932d60fd5ee86de9e63160b8ff..d1faf5c544057f718c3737faf2340dfbaf3914c1 100644 (file)
@@ -158,6 +158,7 @@ static int handle_stfl(struct kvm_vcpu *vcpu)
 
        vcpu->stat.instruction_stfl++;
        facility_list &= ~(1UL<<24); /* no stfle */
+       facility_list &= ~(1UL<<23); /* no large pages */
 
        rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list),
                           &facility_list, sizeof(facility_list));
index 0b88dc462d731c7c8c46525e3fa71eeb53e46cfd..cb992c3d6b711d75284a39d006c9cc258d5b61d0 100644 (file)
@@ -24,6 +24,11 @@ config SUPERH32
 config SUPERH64
        def_bool y if CPU_SH5
 
+config ARCH_DEFCONFIG
+       string
+       default "arch/sh/configs/shx3_defconfig" if SUPERH32
+       default "arch/sh/configs/cayman_defconfig" if SUPERH64
+
 config RWSEM_GENERIC_SPINLOCK
        def_bool y
 
@@ -348,253 +353,10 @@ config CPU_SUBTYPE_SH5_103
 endchoice
 
 source "arch/sh/mm/Kconfig"
 source "arch/sh/Kconfig.cpu"
 
-menu "Board support"
-
-config SOLUTION_ENGINE
-       bool
-
-config SH_SOLUTION_ENGINE
-       bool "SolutionEngine"
-       select SOLUTION_ENGINE
-       select CPU_HAS_IPR_IRQ
-       depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \
-         CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \
-         CPU_SUBTYPE_SH7750R 
-       help
-         Select SolutionEngine if configuring for a Hitachi SH7705, SH7709,
-         SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board.
-
-config SH_7206_SOLUTION_ENGINE
-       bool "SolutionEngine7206"
-       select SOLUTION_ENGINE
-       depends on CPU_SUBTYPE_SH7206
-       help
-         Select 7206 SolutionEngine if configuring for a Hitachi SH7206
-         evaluation board.
-
-config SH_7619_SOLUTION_ENGINE
-       bool "SolutionEngine7619"
-       select SOLUTION_ENGINE
-       depends on CPU_SUBTYPE_SH7619
-       help
-         Select 7619 SolutionEngine if configuring for a Hitachi SH7619
-         evaluation board.
-       
-config SH_7721_SOLUTION_ENGINE
-       bool "SolutionEngine7721"
-       select SOLUTION_ENGINE
-       depends on CPU_SUBTYPE_SH7721
-       help
-         Select 7721 SolutionEngine if configuring for a Hitachi SH7721
-         evaluation board.
-
-config SH_7722_SOLUTION_ENGINE
-       bool "SolutionEngine7722"
-       select SOLUTION_ENGINE
-       depends on CPU_SUBTYPE_SH7722
-       help
-         Select 7722 SolutionEngine if configuring for a Hitachi SH772
-         evaluation board.
-
-config SH_7751_SOLUTION_ENGINE
-       bool "SolutionEngine7751"
-       select SOLUTION_ENGINE
-       select CPU_HAS_IPR_IRQ
-       depends on CPU_SUBTYPE_SH7751
-       help
-         Select 7751 SolutionEngine if configuring for a Hitachi SH7751
-         evaluation board.
-         
-config SH_7780_SOLUTION_ENGINE
-       bool "SolutionEngine7780"
-       select SOLUTION_ENGINE
-       select SYS_SUPPORTS_PCI
-       depends on CPU_SUBTYPE_SH7780
-       help
-         Select 7780 SolutionEngine if configuring for a Renesas SH7780
-         evaluation board.
-
-config SH_7343_SOLUTION_ENGINE
-       bool "SolutionEngine7343"
-       select SOLUTION_ENGINE
-       depends on CPU_SUBTYPE_SH7343
-       help
-         Select 7343 SolutionEngine if configuring for a Hitachi
-         SH7343 (SH-Mobile 3AS) evaluation board.
-
-config SH_7751_SYSTEMH
-       bool "SystemH7751R"
-       depends on CPU_SUBTYPE_SH7751R
-       help
-         Select SystemH if you are configuring for a Renesas SystemH
-         7751R evaluation board.
-
-config SH_HP6XX
-       bool "HP6XX"
-       select SYS_SUPPORTS_APM_EMULATION
-       select HD6446X_SERIES
-       depends on CPU_SUBTYPE_SH7709
-       help
-         Select HP6XX if configuring for a HP jornada HP6xx.
-         More information (hardware only) at
-         <http://www.hp.com/jornada/>.
-
-config SH_DREAMCAST
-       bool "Dreamcast"
-       select SYS_SUPPORTS_PCI
-       depends on CPU_SUBTYPE_SH7091
-       help
-         Select Dreamcast if configuring for a SEGA Dreamcast.
-         More information at <http://www.linux-sh.org>
-
-config SH_SH03
-       bool "Interface CTP/PCI-SH03"
-       depends on CPU_SUBTYPE_SH7751
-       select CPU_HAS_IPR_IRQ
-       select SYS_SUPPORTS_PCI
-       help
-         CTP/PCI-SH03 is a CPU module computer that is produced
-         by Interface Corporation.
-         More information at <http://www.interface.co.jp>
-
-config SH_SECUREEDGE5410
-       bool "SecureEdge5410"
-       depends on CPU_SUBTYPE_SH7751R
-       select CPU_HAS_IPR_IRQ
-       select SYS_SUPPORTS_PCI
-       help
-         Select SecureEdge5410 if configuring for a SnapGear SH board.
-         This includes both the OEM SecureEdge products as well as the
-         SME product line.
-
-config SH_RTS7751R2D
-       bool "RTS7751R2D"
-       depends on CPU_SUBTYPE_SH7751R
-       select SYS_SUPPORTS_PCI
-       select IO_TRAPPED
-       help
-         Select RTS7751R2D if configuring for a Renesas Technology
-         Sales SH-Graphics board.
-
-config SH_RSK7203
-       bool "RSK7203"
-       depends on CPU_SUBTYPE_SH7203
-
-config SH_SDK7780
-       bool "SDK7780R3"
-       depends on CPU_SUBTYPE_SH7780
-       select SYS_SUPPORTS_PCI
-       help
-         Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3
-         evaluation board.
-
-config SH_HIGHLANDER
-       bool "Highlander"
-       depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
-       select SYS_SUPPORTS_PCI
-       select IO_TRAPPED
-
-config SH_SH7785LCR
-       bool "SH7785LCR"
-       depends on CPU_SUBTYPE_SH7785
-       select SYS_SUPPORTS_PCI
-       select IO_TRAPPED
-
-config SH_SH7785LCR_29BIT_PHYSMAPS
-       bool "SH7785LCR 29bit physmaps"
-       depends on SH_SH7785LCR
-       default y
-       help
-         This board has 2 physical memory maps. It can be changed with
-         DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
-         you can access all on-board device in 29bit address mode.
-
-config SH_MIGOR
-       bool "Migo-R"
-       depends on CPU_SUBTYPE_SH7722
-       help
-         Select Migo-R if configuring for the SH7722 Migo-R platform
-          by Renesas System Solutions Asia Pte. Ltd.
-
-config SH_AP325RXA
-       bool "AP-325RXA"
-       depends on CPU_SUBTYPE_SH7723
-       help
-         Renesas "AP-325RXA" support.
-         Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
-
-config SH_SH7763RDP
-       bool "SH7763RDP"
-       depends on CPU_SUBTYPE_SH7763
-       help
-         Select SH7763RDP if configuring for a Renesas SH7763
-         evaluation board.
-
-config SH_EDOSK7705
-       bool "EDOSK7705"
-       depends on CPU_SUBTYPE_SH7705
-
-config SH_SH4202_MICRODEV
-       bool "SH4-202 MicroDev"
-       depends on CPU_SUBTYPE_SH4_202
-       help
-         Select SH4-202 MicroDev if configuring for a SuperH MicroDev board
-         with an SH4-202 CPU.
-
-config SH_LANDISK
-       bool "LANDISK"
-       depends on CPU_SUBTYPE_SH7751R
-       select SYS_SUPPORTS_PCI
-       help
-         I-O DATA DEVICE, INC. "LANDISK Series" support.
-
-config SH_TITAN
-       bool "TITAN"
-       depends on CPU_SUBTYPE_SH7751R
-       select CPU_HAS_IPR_IRQ
-       select SYS_SUPPORTS_PCI
-       help
-         Select Titan if you are configuring for a Nimble Microsystems
-         NetEngine NP51R.
-
-config SH_SHMIN
-       bool "SHMIN"
-       depends on CPU_SUBTYPE_SH7706
-       select CPU_HAS_IPR_IRQ
-       help
-         Select SHMIN if configuring for the SHMIN board.
-
-config SH_LBOX_RE2
-       bool "L-BOX RE2"
-       depends on CPU_SUBTYPE_SH7751R
-       select SYS_SUPPORTS_PCI
-       help
-         Select L-BOX RE2 if configuring for the NTT COMWARE L-BOX RE2.
-
-config SH_X3PROTO
-       bool "SH-X3 Prototype board"
-       depends on CPU_SUBTYPE_SHX3
-
-config SH_MAGIC_PANEL_R2
-       bool "Magic Panel R2"
-       depends on CPU_SUBTYPE_SH7720
-       help
-         Select Magic Panel R2 if configuring for Magic Panel R2.
-
-config SH_CAYMAN
-       bool "Hitachi Cayman"
-       depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103
-       select SYS_SUPPORTS_PCI
-
-endmenu
-
-source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
-source "arch/sh/boards/renesas/r7780rp/Kconfig"
-source "arch/sh/boards/renesas/sdk7780/Kconfig"
-source "arch/sh/boards/renesas/migor/Kconfig"
-source "arch/sh/boards/magicpanelr2/Kconfig"
+source "arch/sh/boards/Kconfig"
 
 menu "Timer and clock configuration"
 
index c627e45c4df74b9abec100067a4fec6895117a93..25659ce74baaef76355436e23e80d68f30ed81c5 100644 (file)
@@ -68,7 +68,7 @@ OBJCOPYFLAGS  := -O binary -R .note -R .note.gnu.build-id -R .comment \
 defaultimage-$(CONFIG_SUPERH32)        := zImage
 
 # Set some sensible Kbuild defaults
-KBUILD_DEFCONFIG       := r7780mp_defconfig
+KBUILD_DEFCONFIG       := shx3_defconfig
 KBUILD_IMAGE           := $(defaultimage-y)
 
 #
@@ -91,51 +91,34 @@ LDFLAGS_vmlinux             += --defsym 'jiffies=jiffies_64+4'
 LDFLAGS                        += -EB
 endif
 
-KBUILD_CFLAGS          += -pipe $(cflags-y)
-KBUILD_AFLAGS          += $(cflags-y)
-
 head-y                 := arch/sh/kernel/init_task.o
 head-$(CONFIG_SUPERH32)        += arch/sh/kernel/head_32.o
 head-$(CONFIG_SUPERH64)        += arch/sh/kernel/head_64.o
 
 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 
-core-y                         += arch/sh/kernel/ arch/sh/mm/
+core-y                         += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
 core-$(CONFIG_SH_FPU_EMU)      += arch/sh/math-emu/
 
-# Boards
-machdir-$(CONFIG_SH_SOLUTION_ENGINE)           += se/770x
-machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE)      += se/7722
-machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)      += se/7751
-machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE)      += se/7780
-machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE)      += se/7343
-machdir-$(CONFIG_SH_7721_SOLUTION_ENGINE)      += se/7721
-machdir-$(CONFIG_SH_HP6XX)                     += hp6xx
-machdir-$(CONFIG_SH_DREAMCAST)                 += dreamcast
-machdir-$(CONFIG_SH_SH03)                      += sh03
-machdir-$(CONFIG_SH_SECUREEDGE5410)            += snapgear
-machdir-$(CONFIG_SH_RTS7751R2D)                        += renesas/rts7751r2d
-machdir-$(CONFIG_SH_7751_SYSTEMH)              += renesas/systemh
-machdir-$(CONFIG_SH_EDOSK7705)                 += renesas/edosk7705
-machdir-$(CONFIG_SH_HIGHLANDER)                        += renesas/r7780rp
-machdir-$(CONFIG_SH_MIGOR)                     += renesas/migor
-machdir-$(CONFIG_SH_SDK7780)                   += renesas/sdk7780
-machdir-$(CONFIG_SH_X3PROTO)                   += renesas/x3proto
-machdir-$(CONFIG_SH_RSK7203)                   += renesas/rsk7203
-machdir-$(CONFIG_SH_AP325RXA)                  += renesas/ap325rxa
-machdir-$(CONFIG_SH_SH7763RDP)                 += renesas/sh7763rdp
-machdir-$(CONFIG_SH_SH7785LCR)                 += renesas/sh7785lcr
-machdir-$(CONFIG_SH_SH4202_MICRODEV)           += superh/microdev
-machdir-$(CONFIG_SH_LANDISK)                   += landisk
-machdir-$(CONFIG_SH_TITAN)                     += titan
-machdir-$(CONFIG_SH_SHMIN)                     += shmin
-machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE)      += se/7206
-machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE)      += se/7619
-machdir-$(CONFIG_SH_LBOX_RE2)                  += lboxre2
-machdir-$(CONFIG_SH_MAGIC_PANEL_R2)            += magicpanelr2
-machdir-$(CONFIG_SH_CAYMAN)                    += cayman
-
-incdir-y       := $(notdir $(machdir-y))
+# Mach groups
+machdir-$(CONFIG_SOLUTION_ENGINE)              += mach-se
+machdir-$(CONFIG_SH_HP6XX)                     += mach-hp6xx
+machdir-$(CONFIG_SH_DREAMCAST)                 += mach-dreamcast
+machdir-$(CONFIG_SH_SH03)                      += mach-sh03
+machdir-$(CONFIG_SH_SECUREEDGE5410)            += mach-snapgear
+machdir-$(CONFIG_SH_RTS7751R2D)                        += mach-r2d
+machdir-$(CONFIG_SH_7751_SYSTEMH)              += mach-systemh
+machdir-$(CONFIG_SH_EDOSK7705)                 += mach-edosk7705
+machdir-$(CONFIG_SH_HIGHLANDER)                        += mach-highlander
+machdir-$(CONFIG_SH_MIGOR)                     += mach-migor
+machdir-$(CONFIG_SH_SDK7780)                   += mach-sdk7780
+machdir-$(CONFIG_SH_X3PROTO)                   += mach-x3proto
+machdir-$(CONFIG_SH_SH7763RDP)                 += mach-sh7763rdp
+machdir-$(CONFIG_SH_SH4202_MICRODEV)           += mach-microdev
+machdir-$(CONFIG_SH_LANDISK)                   += mach-landisk
+machdir-$(CONFIG_SH_TITAN)                     += mach-titan
+machdir-$(CONFIG_SH_LBOX_RE2)                  += mach-lboxre2
+machdir-$(CONFIG_SH_CAYMAN)                    += mach-cayman
 
 ifneq ($(machdir-y),)
 core-y += $(addprefix arch/sh/boards/, \
@@ -145,11 +128,22 @@ endif
 # Companion chips
 core-$(CONFIG_HD6446X_SERIES)  += arch/sh/cchips/hd6446x/
 
-cpuincdir-$(CONFIG_CPU_SH2)    := cpu-sh2
-cpuincdir-$(CONFIG_CPU_SH2A)   := cpu-sh2a
-cpuincdir-$(CONFIG_CPU_SH3)    := cpu-sh3
-cpuincdir-$(CONFIG_CPU_SH4)    := cpu-sh4
-cpuincdir-$(CONFIG_CPU_SH5)    := cpu-sh5
+#
+# CPU header paths
+#
+# These are ordered by optimization level. A CPU family that is a subset
+# of another (ie, SH-2A / SH-2), is picked up first, with increasing
+# levels of genericness if nothing more suitable is situated in the
+# hierarchy.
+#
+# As an example, in order of preference, SH-2A > SH-2 > common definitions.
+#
+cpuincdir-$(CONFIG_CPU_SH2A)   += cpu-sh2a
+cpuincdir-$(CONFIG_CPU_SH2)    += cpu-sh2
+cpuincdir-$(CONFIG_CPU_SH3)    += cpu-sh3
+cpuincdir-$(CONFIG_CPU_SH4)    += cpu-sh4
+cpuincdir-$(CONFIG_CPU_SH5)    += cpu-sh5
+cpuincdir-y                    += cpu-common   # Must be last
 
 libs-$(CONFIG_SUPERH32)                := arch/sh/lib/ $(libs-y)
 libs-$(CONFIG_SUPERH64)                := arch/sh/lib64/ $(libs-y)
@@ -160,57 +154,17 @@ drivers-$(CONFIG_OPROFILE)        += arch/sh/oprofile/
 
 boot := arch/sh/boot
 
-ifneq ($(KBUILD_SRC),)
-incdir-prefix  := $(srctree)/include/asm-sh/
-else
-incdir-prefix  :=
-endif
-
-#      Update machine arch and proc symlinks if something which affects
-#      them changed.  We use .arch and .mach to indicate when they were
-#      updated last, otherwise make uses the target directory mtime.
-
-include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) \
-                    include/config/auto.conf FORCE
-       @echo '  SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)'
-       $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
-       $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu
-       @touch $@
+cflags-y       += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \
+                  $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))
 
-#      Most boards have their own mach directories.  For the ones that
-#      don't, just reference the parent directory so the semantics are
-#      kept roughly the same.
-#
-#      When multiple boards are compiled in at the same time, preference
-#      for the mach link is given to whichever has a directory for its
-#      headers. However, this is only a workaround until platforms that
-#      can live in the same kernel image back away from relying on the
-#      mach link.
-
-include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
-                     include/config/auto.conf FORCE
-       $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
-       $(Q)rm -f include/asm-sh/mach
-       $(Q)for i in $(incdir-y); do \
-       if [ -d $(srctree)/include/asm-sh/$$i ]; then \
-               echo -n '  SYMLINK include/asm-sh/mach -> '; \
-               echo -e "include/asm-sh/$$i"; \
-               ln -fsn $(incdir-prefix)$$i \
-                       include/asm-sh/mach; \
-       else \
-               if [ ! -d include/asm-sh/mach ]; then \
-                       echo -n '  SYMLINK include/asm-sh/mach -> '; \
-                       echo -e 'include/asm-sh'; \
-                       ln -fsn $(incdir-prefix)../asm-sh include/asm-sh/mach; \
-               fi; \
-       fi; \
-       done
-       @touch $@
+KBUILD_CFLAGS          += -pipe $(cflags-y)
+KBUILD_CPPFLAGS                += $(cflags-y)
+KBUILD_AFLAGS          += $(cflags-y)
 
 PHONY += maketools FORCE
 
 maketools:  include/linux/version.h FORCE
-       $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
+       $(Q)$(MAKE) $(build)=arch/sh/tools arch/sh/include/asm/machtypes.h
 
 all: $(KBUILD_IMAGE)
 
@@ -219,8 +173,7 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux
 
 compressed: zImage
 
-archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools \
-            arch/sh/lib64/syscalltab.h
+archprepare: maketools arch/sh/lib64/syscalltab.h
 
 archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
@@ -262,6 +215,4 @@ arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S
        $(call filechk,gen-syscalltab)
 
 CLEAN_FILES += arch/sh/lib64/syscalltab.h \
-              include/asm-sh/machtypes.h \
-              include/asm-sh/cpu include/asm-sh/.cpu \
-              include/asm-sh/mach include/asm-sh/.mach
+              arch/sh/include/asm/machtypes.h
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
new file mode 100644 (file)
index 0000000..ae19486
--- /dev/null
@@ -0,0 +1,258 @@
+menu "Board support"
+
+config SOLUTION_ENGINE
+       bool
+
+config SH_SOLUTION_ENGINE
+       bool "SolutionEngine"
+       select SOLUTION_ENGINE
+       select CPU_HAS_IPR_IRQ
+       depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \
+         CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \
+         CPU_SUBTYPE_SH7750R 
+       help
+         Select SolutionEngine if configuring for a Hitachi SH7705, SH7709,
+         SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board.
+
+config SH_7206_SOLUTION_ENGINE
+       bool "SolutionEngine7206"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7206
+       help
+         Select 7206 SolutionEngine if configuring for a Hitachi SH7206
+         evaluation board.
+
+config SH_7619_SOLUTION_ENGINE
+       bool "SolutionEngine7619"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7619
+       help
+         Select 7619 SolutionEngine if configuring for a Hitachi SH7619
+         evaluation board.
+       
+config SH_7721_SOLUTION_ENGINE
+       bool "SolutionEngine7721"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7721
+       help
+         Select 7721 SolutionEngine if configuring for a Hitachi SH7721
+         evaluation board.
+
+config SH_7722_SOLUTION_ENGINE
+       bool "SolutionEngine7722"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7722
+       help
+         Select 7722 SolutionEngine if configuring for a Hitachi SH772
+         evaluation board.
+
+config SH_7751_SOLUTION_ENGINE
+       bool "SolutionEngine7751"
+       select SOLUTION_ENGINE
+       select CPU_HAS_IPR_IRQ
+       depends on CPU_SUBTYPE_SH7751
+       help
+         Select 7751 SolutionEngine if configuring for a Hitachi SH7751
+         evaluation board.
+         
+config SH_7780_SOLUTION_ENGINE
+       bool "SolutionEngine7780"
+       select SOLUTION_ENGINE
+       select SYS_SUPPORTS_PCI
+       depends on CPU_SUBTYPE_SH7780
+       help
+         Select 7780 SolutionEngine if configuring for a Renesas SH7780
+         evaluation board.
+
+config SH_7343_SOLUTION_ENGINE
+       bool "SolutionEngine7343"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7343
+       help
+         Select 7343 SolutionEngine if configuring for a Hitachi
+         SH7343 (SH-Mobile 3AS) evaluation board.
+
+config SH_7751_SYSTEMH
+       bool "SystemH7751R"
+       depends on CPU_SUBTYPE_SH7751R
+       help
+         Select SystemH if you are configuring for a Renesas SystemH
+         7751R evaluation board.
+
+config SH_HP6XX
+       bool "HP6XX"
+       select SYS_SUPPORTS_APM_EMULATION
+       select HD6446X_SERIES
+       depends on CPU_SUBTYPE_SH7709
+       help
+         Select HP6XX if configuring for a HP jornada HP6xx.
+         More information (hardware only) at
+         <http://www.hp.com/jornada/>.
+
+config SH_DREAMCAST
+       bool "Dreamcast"
+       select SYS_SUPPORTS_PCI
+       depends on CPU_SUBTYPE_SH7091
+       help
+         Select Dreamcast if configuring for a SEGA Dreamcast.
+         More information at <http://www.linux-sh.org>
+
+config SH_SH03
+       bool "Interface CTP/PCI-SH03"
+       depends on CPU_SUBTYPE_SH7751
+       select CPU_HAS_IPR_IRQ
+       select SYS_SUPPORTS_PCI
+       help
+         CTP/PCI-SH03 is a CPU module computer that is produced
+         by Interface Corporation.
+         More information at <http://www.interface.co.jp>
+
+config SH_SECUREEDGE5410
+       bool "SecureEdge5410"
+       depends on CPU_SUBTYPE_SH7751R
+       select CPU_HAS_IPR_IRQ
+       select SYS_SUPPORTS_PCI
+       help
+         Select SecureEdge5410 if configuring for a SnapGear SH board.
+         This includes both the OEM SecureEdge products as well as the
+         SME product line.
+
+config SH_RTS7751R2D
+       bool "RTS7751R2D"
+       depends on CPU_SUBTYPE_SH7751R
+       select SYS_SUPPORTS_PCI
+       select IO_TRAPPED
+       help
+         Select RTS7751R2D if configuring for a Renesas Technology
+         Sales SH-Graphics board.
+
+config SH_RSK7203
+       bool "RSK7203"
+       depends on CPU_SUBTYPE_SH7203
+
+config SH_SDK7780
+       bool "SDK7780R3"
+       depends on CPU_SUBTYPE_SH7780
+       select SYS_SUPPORTS_PCI
+       help
+         Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3
+         evaluation board.
+
+config SH_HIGHLANDER
+       bool "Highlander"
+       depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
+       select SYS_SUPPORTS_PCI
+       select IO_TRAPPED
+
+config SH_SH7785LCR
+       bool "SH7785LCR"
+       depends on CPU_SUBTYPE_SH7785
+       select SYS_SUPPORTS_PCI
+       select IO_TRAPPED
+
+config SH_SH7785LCR_29BIT_PHYSMAPS
+       bool "SH7785LCR 29bit physmaps"
+       depends on SH_SH7785LCR
+       default y
+       help
+         This board has 2 physical memory maps. It can be changed with
+         DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
+         you can access all on-board device in 29bit address mode.
+
+config SH_MIGOR
+       bool "Migo-R"
+       depends on CPU_SUBTYPE_SH7722
+       help
+         Select Migo-R if configuring for the SH7722 Migo-R platform
+          by Renesas System Solutions Asia Pte. Ltd.
+
+config SH_AP325RXA
+       bool "AP-325RXA"
+       depends on CPU_SUBTYPE_SH7723
+       help
+         Renesas "AP-325RXA" support.
+         Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
+
+config SH_SH7763RDP
+       bool "SH7763RDP"
+       depends on CPU_SUBTYPE_SH7763
+       help
+         Select SH7763RDP if configuring for a Renesas SH7763
+         evaluation board.
+
+config SH_EDOSK7705
+       bool "EDOSK7705"
+       depends on CPU_SUBTYPE_SH7705
+
+config SH_SH4202_MICRODEV
+       bool "SH4-202 MicroDev"
+       depends on CPU_SUBTYPE_SH4_202
+       help
+         Select SH4-202 MicroDev if configuring for a SuperH MicroDev board
+         with an SH4-202 CPU.
+
+config SH_LANDISK
+       bool "LANDISK"
+       depends on CPU_SUBTYPE_SH7751R
+       select SYS_SUPPORTS_PCI
+       help
+         I-O DATA DEVICE, INC. "LANDISK Series" support.
+
+config SH_TITAN
+       bool "TITAN"
+       depends on CPU_SUBTYPE_SH7751R
+       select CPU_HAS_IPR_IRQ
+       select SYS_SUPPORTS_PCI
+       help
+         Select Titan if you are configuring for a Nimble Microsystems
+         NetEngine NP51R.
+
+config SH_SHMIN
+       bool "SHMIN"
+       depends on CPU_SUBTYPE_SH7706
+       select CPU_HAS_IPR_IRQ
+       help
+         Select SHMIN if configuring for the SHMIN board.
+
+config SH_LBOX_RE2
+       bool "L-BOX RE2"
+       depends on CPU_SUBTYPE_SH7751R
+       select SYS_SUPPORTS_PCI
+       help
+         Select L-BOX RE2 if configuring for the NTT COMWARE L-BOX RE2.
+
+config SH_X3PROTO
+       bool "SH-X3 Prototype board"
+       depends on CPU_SUBTYPE_SHX3
+
+config SH_MAGIC_PANEL_R2
+       bool "Magic Panel R2"
+       depends on CPU_SUBTYPE_SH7720
+       help
+         Select Magic Panel R2 if configuring for Magic Panel R2.
+
+config SH_CAYMAN
+       bool "Hitachi Cayman"
+       depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103
+       select SYS_SUPPORTS_PCI
+
+endmenu
+
+source "arch/sh/boards/mach-r2d/Kconfig"
+source "arch/sh/boards/mach-highlander/Kconfig"
+source "arch/sh/boards/mach-sdk7780/Kconfig"
+source "arch/sh/boards/mach-migor/Kconfig"
+
+if SH_MAGIC_PANEL_R2
+
+menu "Magic Panel R2 options"
+
+config SH_MAGIC_PANEL_R2_VERSION
+       int SH_MAGIC_PANEL_R2_VERSION
+       default "3"
+       help
+         Set the version of the Magic Panel R2
+
+endmenu
+
+endif
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile
new file mode 100644 (file)
index 0000000..ff9b93c
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Specific board support, not covered by a mach group.
+#
+obj-$(CONFIG_SH_AP325RXA)      += board-ap325rxa.o
+obj-$(CONFIG_SH_MAGIC_PANEL_R2)        += board-magicpanelr2.o
+obj-$(CONFIG_SH_RSK7203)       += board-rsk7203.o
+obj-$(CONFIG_SH_SH7785LCR)     += board-sh7785lcr.o
+obj-$(CONFIG_SH_SHMIN)         += board-shmin..o
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
new file mode 100644 (file)
index 0000000..9c71603
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * Renesas - AP-325RXA
+ * (Compatible with Algo System ., LTD. - AP-320A)
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Author : Yusuke Goda <goda.yuske@renesas.com>
+ *
+ * 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.
+ */
+
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/smc911x.h>
+#include <media/soc_camera_platform.h>
+#include <media/sh_mobile_ceu.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/io.h>
+#include <asm/clock.h>
+
+static struct smc911x_platdata smc911x_info = {
+       .flags = SMC911X_USE_32BIT,
+       .irq_flags = IRQF_TRIGGER_LOW,
+};
+
+static struct resource smc9118_resources[] = {
+       [0] = {
+               .start  = 0xb6080000,
+               .end    = 0xb60fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 35,
+               .end    = 35,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device smc9118_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc9118_resources),
+       .resource       = smc9118_resources,
+       .dev            = {
+               .platform_data = &smc911x_info,
+       },
+};
+
+static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
+       {
+                .name = "uboot",
+                .offset = 0,
+                .size = (1 * 1024 * 1024),
+                .mask_flags = MTD_WRITEABLE,   /* Read-only */
+       }, {
+                .name = "kernel",
+                .offset = MTDPART_OFS_APPEND,
+                .size = (2 * 1024 * 1024),
+       }, {
+                .name = "other",
+                .offset = MTDPART_OFS_APPEND,
+                .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data ap325rxa_nor_flash_data = {
+       .width          = 2,
+       .parts          = ap325rxa_nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
+};
+
+static struct resource ap325rxa_nor_flash_resources[] = {
+       [0] = {
+               .name   = "NOR Flash",
+               .start  = 0x00000000,
+               .end    = 0x00ffffff,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device ap325rxa_nor_flash_device = {
+       .name           = "physmap-flash",
+       .resource       = ap325rxa_nor_flash_resources,
+       .num_resources  = ARRAY_SIZE(ap325rxa_nor_flash_resources),
+       .dev            = {
+               .platform_data = &ap325rxa_nor_flash_data,
+       },
+};
+
+#define FPGA_LCDREG    0xB4100180
+#define FPGA_BKLREG    0xB4100212
+#define FPGA_LCDREG_VAL        0x0018
+#define PORT_PHCR      0xA405010E
+#define PORT_PLCR      0xA4050114
+#define PORT_PMCR      0xA4050116
+#define PORT_PRCR      0xA405011C
+#define PORT_PSCR      0xA405011E
+#define PORT_PZCR      0xA405014C
+#define PORT_HIZCRA    0xA4050158
+#define PORT_MSELCRB   0xA4050182
+#define PORT_PSDR      0xA405013E
+#define PORT_PZDR      0xA405016C
+#define PORT_PSELD     0xA4050154
+
+static void ap320_wvga_power_on(void *board_data)
+{
+       msleep(100);
+
+       /* ASD AP-320/325 LCD ON */
+       ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG);
+
+       /* backlight */
+       ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR);
+       ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR);
+       ctrl_outw(0x100, FPGA_BKLREG);
+}
+
+static struct sh_mobile_lcdc_info lcdc_info = {
+       .clock_source = LCDC_CLK_EXTERNAL,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = RGB18,
+               .clock_divider = 1,
+               .lcd_cfg = {
+                       .name = "LB070WV1",
+                       .xres = 800,
+                       .yres = 480,
+                       .left_margin = 40,
+                       .right_margin = 160,
+                       .hsync_len = 8,
+                       .upper_margin = 63,
+                       .lower_margin = 80,
+                       .vsync_len = 1,
+                       .sync = 0, /* hsync and vsync are active low */
+               },
+               .board_cfg = {
+                       .display_on = ap320_wvga_power_on,
+               },
+       }
+};
+
+static struct resource lcdc_resources[] = {
+       [0] = {
+               .name   = "LCDC",
+               .start  = 0xfe940000, /* P4-only space */
+               .end    = 0xfe941fff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device lcdc_device = {
+       .name           = "sh_mobile_lcdc_fb",
+       .num_resources  = ARRAY_SIZE(lcdc_resources),
+       .resource       = lcdc_resources,
+       .dev            = {
+               .platform_data  = &lcdc_info,
+       },
+};
+
+#ifdef CONFIG_I2C
+static unsigned char camera_ncm03j_magic[] =
+{
+       0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
+       0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
+       0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
+       0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
+       0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
+       0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
+       0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
+       0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
+       0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
+       0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
+       0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
+       0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
+       0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
+       0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
+       0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
+       0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
+};
+
+static int camera_set_capture(struct soc_camera_platform_info *info,
+                             int enable)
+{
+       struct i2c_adapter *a = i2c_get_adapter(0);
+       struct i2c_msg msg;
+       int ret = 0;
+       int i;
+
+       if (!enable)
+               return 0; /* no disable for now */
+
+       for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
+               u_int8_t buf[8];
+
+               msg.addr = 0x6e;
+               msg.buf = buf;
+               msg.len = 2;
+               msg.flags = 0;
+
+               buf[0] = camera_ncm03j_magic[i];
+               buf[1] = camera_ncm03j_magic[i + 1];
+
+               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
+       }
+
+       return ret;
+}
+
+static struct soc_camera_platform_info camera_info = {
+       .iface = 0,
+       .format_name = "UYVY",
+       .format_depth = 16,
+       .format = {
+               .pixelformat = V4L2_PIX_FMT_UYVY,
+               .colorspace = V4L2_COLORSPACE_SMPTE170M,
+               .width = 640,
+               .height = 480,
+       },
+       .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+       .set_capture = camera_set_capture,
+};
+
+static struct platform_device camera_device = {
+       .name           = "soc_camera_platform",
+       .dev            = {
+               .platform_data  = &camera_info,
+       },
+};
+#endif /* CONFIG_I2C */
+
+static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
+       .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+};
+
+static struct resource ceu_resources[] = {
+       [0] = {
+               .name   = "CEU",
+               .start  = 0xfe910000,
+               .end    = 0xfe91009f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 52,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               /* place holder for contiguous memory */
+       },
+};
+
+static struct platform_device ceu_device = {
+       .name           = "sh_mobile_ceu",
+       .num_resources  = ARRAY_SIZE(ceu_resources),
+       .resource       = ceu_resources,
+       .dev            = {
+               .platform_data  = &sh_mobile_ceu_info,
+       },
+};
+
+static struct platform_device *ap325rxa_devices[] __initdata = {
+       &smc9118_device,
+       &ap325rxa_nor_flash_device,
+       &lcdc_device,
+       &ceu_device,
+#ifdef CONFIG_I2C
+       &camera_device,
+#endif
+};
+
+static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
+};
+
+static int __init ap325rxa_devices_setup(void)
+{
+       clk_always_enable("mstp200"); /* LCDC */
+       clk_always_enable("mstp203"); /* CEU */
+
+       platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
+
+       i2c_register_board_info(0, ap325rxa_i2c_devices,
+                               ARRAY_SIZE(ap325rxa_i2c_devices));
+       return platform_add_devices(ap325rxa_devices,
+                               ARRAY_SIZE(ap325rxa_devices));
+}
+device_initcall(ap325rxa_devices_setup);
+
+static void __init ap325rxa_setup(char **cmdline_p)
+{
+       /* LCDC configuration */
+       ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR);
+       ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR);
+       ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA);
+
+       /* CEU */
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
+       ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
+       ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
+}
+
+static struct sh_machine_vector mv_ap325rxa __initmv = {
+       .mv_name = "AP-325RXA",
+       .mv_setup = ap325rxa_setup,
+};
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c
new file mode 100644 (file)
index 0000000..f3b8b07
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+ * linux/arch/sh/boards/magicpanel/setup.c
+ *
+ *  Copyright (C) 2007  Markus Brunner, Mark Jonas
+ *
+ *  Magic Panel Release 2 board setup
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/map.h>
+#include <asm/magicpanelr2.h>
+#include <asm/heartbeat.h>
+
+#define LAN9115_READY  (ctrl_inl(0xA8000084UL) & 0x00000001UL)
+
+/* Prefer cmdline over RedBoot */
+static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
+
+/* Wait until reset finished. Timeout is 100ms. */
+static int __init ethernet_reset_finished(void)
+{
+       int i;
+
+       if (LAN9115_READY)
+               return 1;
+
+       for (i = 0; i < 10; ++i) {
+               mdelay(10);
+               if (LAN9115_READY)
+                       return 1;
+       }
+
+       return 0;
+}
+
+static void __init reset_ethernet(void)
+{
+       /* PMDR: LAN_RESET=on */
+       CLRBITS_OUTB(0x10, PORT_PMDR);
+
+       udelay(200);
+
+       /* PMDR: LAN_RESET=off */
+       SETBITS_OUTB(0x10, PORT_PMDR);
+}
+
+static void __init setup_chip_select(void)
+{
+       /* CS2: LAN (0x08000000 - 0x0bffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x36db0400, CS2BCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x000003c0, CS2WCR);
+
+       /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS4BCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS4WCR);
+
+       /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS5ABCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS5AWCR);
+
+       /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS5BBCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS5BWCR);
+
+       /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS6ABCR);
+       /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
+       ctrl_outl(0x001009C1, CS6AWCR);
+}
+
+static void __init setup_port_multiplexing(void)
+{
+       /* A7 GPO(LED8);     A6 GPO(LED7);     A5 GPO(LED6);      A4 GPO(LED5);
+        * A3 GPO(LED4);     A2 GPO(LED3);     A1 GPO(LED2);      A0 GPO(LED1);
+        */
+       ctrl_outw(0x5555, PORT_PACR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* B7 GPO(RST4);   B6 GPO(RST3);  B5 GPO(RST2);    B4 GPO(RST1);
+        * B3 GPO(PB3);    B2 GPO(PB2);   B1 GPO(PB1);     B0 GPO(PB0);
+        */
+       ctrl_outw(0x5555, PORT_PBCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* C7 GPO(PC7);   C6 GPO(PC6);    C5 GPO(PC5);     C4 GPO(PC4);
+        * C3 LCD_DATA3;  C2 LCD_DATA2;   C1 LCD_DATA1;    C0 LCD_DATA0;
+        */
+       ctrl_outw(0x5500, PORT_PCCR);   /* 01 01 01 01 00 00 00 00 */
+
+       /* D7 GPO(PD7); D6 GPO(PD6);    D5 GPO(PD5);       D4 GPO(PD4);
+        * D3 GPO(PD3); D2 GPO(PD2);    D1 GPO(PD1);       D0 GPO(PD0);
+        */
+       ctrl_outw(0x5555, PORT_PDCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* E7 (x);        E6 GPI(nu);    E5 GPI(nu);      E4 LCD_M_DISP;
+        * E3 LCD_CL1;    E2 LCD_CL2;    E1 LCD_DON;      E0 LCD_FLM;
+        */
+       ctrl_outw(0x3C00, PORT_PECR);   /* 00 11 11 00 00 00 00 00 */
+
+       /* F7 (x);           F6 DA1(VLCD);     F5 DA0(nc);        F4 AN3;
+        * F3 AN2(MID_AD);   F2 AN1(EARTH_AD); F1 AN0(TEMP);      F0 GPI+(nc);
+        */
+       ctrl_outw(0x0002, PORT_PFCR);   /* 00 00 00 00 00 00 00 10 */
+
+       /* G7 (x);        G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
+        * G3 GPI(KEY1);  G2 GPO(LED11);        G1 GPO(LED10);     G0 GPO(LED9);
+        */
+       ctrl_outw(0x03D5, PORT_PGCR);   /* 00 00 00 11 11 01 01 01 */
+
+       /* H7 (x);            H6 /RAS(BRAS);      H5 /CAS(BCAS); H4 CKE(BCKE);
+        * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR;   H0 USB1_PWR;
+        */
+       ctrl_outw(0x0050, PORT_PHCR);   /* 00 00 00 00 01 01 00 00 */
+
+       /* J7 (x);        J6 AUDCK;        J5 ASEBRKAK;     J4 AUDATA3;
+        * J3 AUDATA2;    J2 AUDATA1;      J1 AUDATA0;      J0 AUDSYNC;
+        */
+       ctrl_outw(0x0000, PORT_PJCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* K7 (x);          K6 (x);          K5 (x);       K4 (x);
+        * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
+        */
+       ctrl_outw(0x00FF, PORT_PKCR);   /* 00 00 00 00 11 11 11 11 */
+
+       /* L7 TRST;        L6 TMS;           L5 TDO;              L4 TDI;
+        * L3 TCK;         L2 (x);           L1 (x);              L0 (x);
+        */
+       ctrl_outw(0x0000, PORT_PLCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* M7 GPO(CURRENT_SINK);    M6 GPO(PWR_SWITCH);     M5 GPO(LAN_SPEED);
+        * M4 GPO(LAN_RESET);       M3 GPO(BUZZER);         M2 GPO(LCD_BL);
+        * M1 CS5B(CAN3_CS);        M0 GPI+(nc);
+        */
+       ctrl_outw(0x5552, PORT_PMCR);      /* 01 01 01 01 01 01 00 10 */
+
+       /* CURRENT_SINK=off,    PWR_SWITCH=off, LAN_SPEED=100MBit,
+        * LAN_RESET=off,       BUZZER=off,     LCD_BL=off
+        */
+#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
+       ctrl_outb(0x30, PORT_PMDR);
+#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
+       ctrl_outb(0xF0, PORT_PMDR);
+#else
+#error Unknown revision of PLATFORM_MP_R2
+#endif
+
+       /* P7 (x);             P6 (x);            P5 (x);
+        * P4 GPO(nu);         P3 IRQ3(LAN_IRQ);  P2 IRQ2(CAN3_IRQ);
+        * P1 IRQ1(CAN2_IRQ);  P0 IRQ0(CAN1_IRQ)
+        */
+       ctrl_outw(0x0100, PORT_PPCR);   /* 00 00 00 01 00 00 00 00 */
+       ctrl_outb(0x10, PORT_PPDR);
+
+       /* R7 A25;           R6 A24;         R5 A23;              R4 A22;
+        * R3 A21;           R2 A20;         R1 A19;              R0 A0;
+        */
+       ctrl_outw(0x0000, PORT_PRCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* S7 (x);              S6 (x);        S5 (x);       S4 GPO(EEPROM_CS2);
+        * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD; S0 SIOF0_SCK;
+        */
+       ctrl_outw(0x0140, PORT_PSCR);   /* 00 00 00 01 01 00 00 00 */
+
+       /* T7 (x);         T6 (x);        T5 (x);         T4 COM1_CTS;
+        * T3 COM1_RTS;    T2 COM1_TXD;   T1 COM1_RXD;    T0 GPO(WDOG)
+        */
+       ctrl_outw(0x0001, PORT_PTCR);   /* 00 00 00 00 00 00 00 01 */
+
+       /* U7 (x);           U6 (x);       U5 (x);        U4 GPI+(/AC_FAULT);
+        * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD;  U0 TOUCH_SCK;
+        */
+       ctrl_outw(0x0240, PORT_PUCR);   /* 00 00 00 10 01 00 00 00 */
+
+       /* V7 (x);        V6 (x);       V5 (x);           V4 GPO(MID2);
+        * V3 GPO(MID1);  V2 CARD_TxD;  V1 CARD_RxD;      V0 GPI+(/BAT_FAULT);
+        */
+       ctrl_outw(0x0142, PORT_PVCR);   /* 00 00 00 01 01 00 00 10 */
+}
+
+static void __init mpr2_setup(char **cmdline_p)
+{
+       __set_io_port_base(0xa0000000);
+
+       /* set Pin Select Register A:
+        * /PCC_CD1, /PCC_CD2,  PCC_BVD1, PCC_BVD2,
+        * /IOIS16,  IRQ4,      IRQ5,     USB1d_SUSPEND
+        */
+       ctrl_outw(0xAABC, PORT_PSELA);
+       /* set Pin Select Register B:
+        * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
+        * LCD_VEPWC,  IIC_SDA,    IIC_SCL, Reserved
+        */
+       ctrl_outw(0x3C00, PORT_PSELB);
+       /* set Pin Select Register C:
+        * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
+        */
+       ctrl_outw(0x0000, PORT_PSELC);
+       /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
+        * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
+        */
+       ctrl_outw(0x0000, PORT_PSELD);
+       /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
+       ctrl_outw(0x0101, PORT_UTRCTL);
+       /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
+       ctrl_outw(0xA5C0, PORT_UCLKCR_W);
+
+       setup_chip_select();
+
+       setup_port_multiplexing();
+
+       reset_ethernet();
+
+       printk(KERN_INFO "Magic Panel Release 2 A.%i\n",
+                               CONFIG_SH_MAGIC_PANEL_R2_VERSION);
+
+       if (ethernet_reset_finished() == 0)
+               printk(KERN_WARNING "Ethernet not ready\n");
+}
+
+static struct resource smc911x_resources[] = {
+       [0] = {
+               .start          = 0xa8000000,
+               .end            = 0xabffffff,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 35,
+               .end            = 35,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc911x_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc911x_resources),
+       .resource       = smc911x_resources,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .flags          = HEARTBEAT_INVERTED,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition *parsed_partitions;
+
+static struct mtd_partition mpr2_partitions[] = {
+       /* Reserved for bootloader, read-only */
+       {
+               .name = "Bootloader",
+               .offset = 0x00000000UL,
+               .size = MPR2_MTD_BOOTLOADER_SIZE,
+               .mask_flags = MTD_WRITEABLE,
+       },
+       /* Reserved for kernel image */
+       {
+               .name = "Kernel",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size = MPR2_MTD_KERNEL_SIZE,
+       },
+       /* Rest is used for Flash FS */
+       {
+               .name = "Flash_FS",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size = MTDPART_SIZ_FULL,
+       }
+};
+
+static struct physmap_flash_data flash_data = {
+       .width          = 2,
+};
+
+static struct resource flash_resource = {
+       .start          = 0x00000000,
+       .end            = 0x2000000UL,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = &flash_resource,
+       .num_resources  = 1,
+       .dev            = {
+               .platform_data = &flash_data,
+       },
+};
+
+static struct mtd_info *flash_mtd;
+
+static struct map_info mpr2_flash_map = {
+       .name = "Magic Panel R2 Flash",
+       .size = 0x2000000UL,
+       .bankwidth = 2,
+};
+
+static void __init set_mtd_partitions(void)
+{
+       int nr_parts = 0;
+
+       simple_map_init(&mpr2_flash_map);
+       flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
+       nr_parts = parse_mtd_partitions(flash_mtd, probes,
+                                       &parsed_partitions, 0);
+       /* If there is no partition table, used the hard coded table */
+       if (nr_parts <= 0) {
+               flash_data.parts = mpr2_partitions;
+               flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
+       } else {
+               flash_data.nr_parts = nr_parts;
+               flash_data.parts = parsed_partitions;
+       }
+}
+
+/*
+ * Add all resources to the platform_device
+ */
+
+static struct platform_device *mpr2_devices[] __initdata = {
+       &heartbeat_device,
+       &smc911x_device,
+       &flash_device,
+};
+
+
+static int __init mpr2_devices_setup(void)
+{
+       set_mtd_partitions();
+       return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
+}
+device_initcall(mpr2_devices_setup);
+
+/*
+ * Initialize IRQ setting
+ */
+static void __init init_mpr2_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
+
+       set_irq_type(32, IRQ_TYPE_LEVEL_LOW);    /* IRQ0 CAN1 */
+       set_irq_type(33, IRQ_TYPE_LEVEL_LOW);    /* IRQ1 CAN2 */
+       set_irq_type(34, IRQ_TYPE_LEVEL_LOW);    /* IRQ2 CAN3 */
+       set_irq_type(35, IRQ_TYPE_LEVEL_LOW);    /* IRQ3 SMSC9115 */
+       set_irq_type(36, IRQ_TYPE_EDGE_RISING);  /* IRQ4 touchscreen */
+       set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
+
+       intc_set_priority(32, 13);              /* IRQ0 CAN1 */
+       intc_set_priority(33, 13);              /* IRQ0 CAN2 */
+       intc_set_priority(34, 13);              /* IRQ0 CAN3 */
+       intc_set_priority(35, 6);               /* IRQ3 SMSC9115 */
+}
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_mpr2 __initmv = {
+       .mv_name                = "mpr2",
+       .mv_setup               = mpr2_setup,
+       .mv_init_irq            = init_mpr2_IRQ,
+};
diff --git a/arch/sh/boards/board-rsk7203.c b/arch/sh/boards/board-rsk7203.c
new file mode 100644 (file)
index 0000000..ffbedc5
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Renesas Technology Europe RSK+ 7203 Support.
+ *
+ * Copyright (C) 2008 Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/map.h>
+#include <linux/smc911x.h>
+#include <asm/machvec.h>
+#include <asm/io.h>
+
+static struct smc911x_platdata smc911x_info = {
+       .flags          = SMC911X_USE_16BIT,
+       .irq_flags      = IRQF_TRIGGER_LOW,
+};
+
+static struct resource smc911x_resources[] = {
+       [0] = {
+               .start          = 0x24000000,
+               .end            = 0x24000000 + 0x100,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 64,
+               .end            = 64,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc911x_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc911x_resources),
+       .resource       = smc911x_resources,
+       .dev            = {
+               .platform_data = &smc911x_info,
+       },
+};
+
+static const char *probes[] = { "cmdlinepart", NULL };
+
+static struct mtd_partition *parsed_partitions;
+
+static struct mtd_partition rsk7203_partitions[] = {
+       {
+               .name           = "Bootloader",
+               .offset         = 0x00000000,
+               .size           = 0x00040000,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "Kernel",
+               .offset         = MTDPART_OFS_NXTBLK,
+               .size           = 0x001c0000,
+       }, {
+               .name           = "Flash_FS",
+               .offset         = MTDPART_OFS_NXTBLK,
+               .size           = MTDPART_SIZ_FULL,
+       }
+};
+
+static struct physmap_flash_data flash_data = {
+       .width          = 2,
+};
+
+static struct resource flash_resource = {
+       .start          = 0x20000000,
+       .end            = 0x20400000,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = &flash_resource,
+       .num_resources  = 1,
+       .dev            = {
+               .platform_data = &flash_data,
+       },
+};
+
+static struct mtd_info *flash_mtd;
+
+static struct map_info rsk7203_flash_map = {
+       .name           = "RSK+ Flash",
+       .size           = 0x400000,
+       .bankwidth      = 2,
+};
+
+static void __init set_mtd_partitions(void)
+{
+       int nr_parts = 0;
+
+       simple_map_init(&rsk7203_flash_map);
+       flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
+       nr_parts = parse_mtd_partitions(flash_mtd, probes,
+                                       &parsed_partitions, 0);
+       /* If there is no partition table, used the hard coded table */
+       if (nr_parts <= 0) {
+               flash_data.parts = rsk7203_partitions;
+               flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
+       } else {
+               flash_data.nr_parts = nr_parts;
+               flash_data.parts = parsed_partitions;
+       }
+}
+
+
+static struct platform_device *rsk7203_devices[] __initdata = {
+       &smc911x_device,
+       &flash_device,
+};
+
+static int __init rsk7203_devices_setup(void)
+{
+       set_mtd_partitions();
+       return platform_add_devices(rsk7203_devices,
+                                   ARRAY_SIZE(rsk7203_devices));
+}
+device_initcall(rsk7203_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_rsk7203 __initmv = {
+       .mv_name        = "RSK+7203",
+};
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
new file mode 100644 (file)
index 0000000..b95d674
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ * Renesas Technology Corp. R0P7785LC0011RL Support.
+ *
+ * Copyright (C) 2008  Yoshihiro Shimoda
+ *
+ * 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.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/sm501.h>
+#include <linux/sm501-regs.h>
+#include <linux/fb.h>
+#include <linux/mtd/physmap.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/i2c-pca-platform.h>
+#include <linux/i2c-algo-pca.h>
+#include <asm/heartbeat.h>
+#include <asm/sh7785lcr.h>
+
+/*
+ * NOTE: This board has 2 physical memory maps.
+ *      Please look at include/asm-sh/sh7785lcr.h or hardware manual.
+ */
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PLD_LEDCR,
+               .end    = PLD_LEDCR,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 8,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition nor_flash_partitions[] = {
+       {
+               .name           = "loader",
+               .offset         = 0x00000000,
+               .size           = 512 * 1024,
+       },
+       {
+               .name           = "bootenv",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 512 * 1024,
+       },
+       {
+               .name           = "kernel",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 4 * 1024 * 1024,
+       },
+       {
+               .name           = "data",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data nor_flash_data = {
+       .width          = 4,
+       .parts          = nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
+};
+
+static struct resource nor_flash_resources[] = {
+       [0]     = {
+               .start  = NOR_FLASH_ADDR,
+               .end    = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device nor_flash_device = {
+       .name           = "physmap-flash",
+       .dev            = {
+               .platform_data  = &nor_flash_data,
+       },
+       .num_resources  = ARRAY_SIZE(nor_flash_resources),
+       .resource       = nor_flash_resources,
+};
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = R8A66597_ADDR,
+               .end    = R8A66597_ADDR + R8A66597_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               .start  = 2,
+               .end    = 2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource sm501_resources[] = {
+       [0]     = {
+               .start  = SM107_MEM_ADDR,
+               .end    = SM107_MEM_ADDR + SM107_MEM_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1]     = {
+               .start  = SM107_REG_ADDR,
+               .end    = SM107_REG_ADDR + SM107_REG_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2]     = {
+               .start  = 10,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct fb_videomode sm501_default_mode_crt = {
+       .pixclock       = 35714,        /* 28MHz */
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 105,
+       .right_margin   = 16,
+       .upper_margin   = 33,
+       .lower_margin   = 10,
+       .hsync_len      = 39,
+       .vsync_len      = 2,
+       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct fb_videomode sm501_default_mode_pnl = {
+       .pixclock       = 40000,        /* 25MHz */
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 2,
+       .right_margin   = 16,
+       .upper_margin   = 33,
+       .lower_margin   = 10,
+       .hsync_len      = 39,
+       .vsync_len      = 2,
+       .sync           = 0,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode_pnl,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT |
+                         SM501FB_FLAG_PANEL_NO_VBIASEN,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode_crt,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT,
+};
+
+static struct sm501_platdata_fb sm501_fb_pdata = {
+       .fb_route       = SM501_FB_OWN,
+       .fb_crt         = &sm501_pdata_fbsub_crt,
+       .fb_pnl         = &sm501_pdata_fbsub_pnl,
+};
+
+static struct sm501_initdata sm501_initdata = {
+       .gpio_high      = {
+               .set    = 0x00001fe0,
+               .mask   = 0x0,
+       },
+       .devices        = 0,
+       .mclk           = 84 * 1000000,
+       .m1xclk         = 112 * 1000000,
+};
+
+static struct sm501_platdata sm501_platform_data = {
+       .init           = &sm501_initdata,
+       .fb             = &sm501_fb_pdata,
+};
+
+static struct platform_device sm501_device = {
+       .name           = "sm501",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &sm501_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(sm501_resources),
+       .resource       = sm501_resources,
+};
+
+static struct resource i2c_resources[] = {
+       [0] = {
+               .start  = PCA9564_ADDR,
+               .end    = PCA9564_ADDR + PCA9564_SIZE - 1,
+               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
+       },
+       [1] = {
+               .start  = 12,
+               .end    = 12,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
+       .gpio                   = 0,
+       .i2c_clock_speed        = I2C_PCA_CON_330kHz,
+       .timeout                = 100,
+};
+
+static struct platform_device i2c_device = {
+       .name           = "i2c-pca-platform",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &i2c_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(i2c_resources),
+       .resource       = i2c_resources,
+};
+
+static struct platform_device *sh7785lcr_devices[] __initdata = {
+       &heartbeat_device,
+       &nor_flash_device,
+       &r8a66597_usb_host_device,
+       &sm501_device,
+       &i2c_device,
+};
+
+static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("r2025sd", 0x32),
+       },
+};
+
+static int __init sh7785lcr_devices_setup(void)
+{
+       i2c_register_board_info(0, sh7785lcr_i2c_devices,
+                               ARRAY_SIZE(sh7785lcr_i2c_devices));
+
+       return platform_add_devices(sh7785lcr_devices,
+                                   ARRAY_SIZE(sh7785lcr_devices));
+}
+__initcall(sh7785lcr_devices_setup);
+
+/* Initialize IRQ setting */
+void __init init_sh7785lcr_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ7654);
+       plat_irq_setup_pins(IRQ_MODE_IRQ3210);
+}
+
+static void sh7785lcr_power_off(void)
+{
+       ctrl_outb(0x01, P2SEGADDR(PLD_POFCR));
+}
+
+/* Initialize the board */
+static void __init sh7785lcr_setup(char **cmdline_p)
+{
+       void __iomem *sm501_reg;
+
+       printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n");
+
+       pm_power_off = sh7785lcr_power_off;
+
+       /* sm501 DRAM configuration */
+       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
+       writel(0x000307c2, sm501_reg);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_sh7785lcr __initmv = {
+       .mv_name                = "SH7785LCR",
+       .mv_setup               = sh7785lcr_setup,
+       .mv_init_irq            = init_sh7785lcr_IRQ,
+};
+
diff --git a/arch/sh/boards/board-shmin.c b/arch/sh/boards/board-shmin.c
new file mode 100644 (file)
index 0000000..16e5dae
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * arch/sh/boards/shmin/setup.c
+ *
+ * Copyright (C) 2006 Takashi YOSHII
+ *
+ * SHMIN Support.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/machvec.h>
+#include <asm/shmin.h>
+#include <asm/clock.h>
+#include <asm/io.h>
+
+#define PFC_PHCR       0xa400010eUL
+#define INTC_ICR1      0xa4000010UL
+
+static void __init init_shmin_irq(void)
+{
+       ctrl_outw(0x2a00, PFC_PHCR);    // IRQ0-3=IRQ
+       ctrl_outw(0x0aaa, INTC_ICR1);   // IRQ0-3=IRQ-mode,Low-active.
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
+{
+       static int dummy;
+
+       if ((port & ~0x1f) == SHMIN_NE_BASE)
+               return (void __iomem *)(SHMIN_IO_BASE + port);
+
+       dummy = 0;
+
+       return &dummy;
+
+}
+
+static struct sh_machine_vector mv_shmin __initmv = {
+       .mv_name        = "SHMIN",
+       .mv_init_irq    = init_shmin_irq,
+       .mv_ioport_map  = shmin_ioport_map,
+};
diff --git a/arch/sh/boards/cayman/Makefile b/arch/sh/boards/cayman/Makefile
deleted file mode 100644 (file)
index 489a8f8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Hitachi Cayman specific parts of the kernel
-#
-obj-y := setup.o irq.o
-obj-$(CONFIG_HEARTBEAT)        += led.o
diff --git a/arch/sh/boards/cayman/irq.c b/arch/sh/boards/cayman/irq.c
deleted file mode 100644 (file)
index 30ec7be..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support
- *
- * This file handles the board specific parts of the Cayman interrupt system
- *
- * Copyright (C) 2002 Stuart Menefy
- *
- * 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.
- */
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/signal.h>
-#include <asm/cpu/irq.h>
-#include <asm/page.h>
-
-/* Setup for the SMSC FDC37C935 / LAN91C100FD */
-#define SMSC_IRQ         IRQ_IRL1
-
-/* Setup for PCI Bus 2, which transmits interrupts via the EPLD */
-#define PCI2_IRQ         IRQ_IRL3
-
-unsigned long epld_virt;
-
-#define EPLD_BASE        0x04002000
-#define EPLD_STATUS_BASE (epld_virt + 0x10)
-#define EPLD_MASK_BASE   (epld_virt + 0x20)
-
-/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
-   the same SH-5 interrupt */
-
-static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id)
-{
-        printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n");
-       return IRQ_NONE;
-}
-
-static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
-{
-        printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq);
-       return IRQ_NONE;
-}
-
-static struct irqaction cayman_action_smsc = {
-       .name           = "Cayman SMSC Mux",
-       .handler        = cayman_interrupt_smsc,
-       .flags          = IRQF_DISABLED,
-};
-
-static struct irqaction cayman_action_pci2 = {
-       .name           = "Cayman PCI2 Mux",
-       .handler        = cayman_interrupt_pci2,
-       .flags          = IRQF_DISABLED,
-};
-
-static void enable_cayman_irq(unsigned int irq)
-{
-       unsigned long flags;
-       unsigned long mask;
-       unsigned int reg;
-       unsigned char bit;
-
-       irq -= START_EXT_IRQS;
-       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
-       bit = 1<<(irq % 8);
-       local_irq_save(flags);
-       mask = ctrl_inl(reg);
-       mask |= bit;
-       ctrl_outl(mask, reg);
-       local_irq_restore(flags);
-}
-
-void disable_cayman_irq(unsigned int irq)
-{
-       unsigned long flags;
-       unsigned long mask;
-       unsigned int reg;
-       unsigned char bit;
-
-       irq -= START_EXT_IRQS;
-       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
-       bit = 1<<(irq % 8);
-       local_irq_save(flags);
-       mask = ctrl_inl(reg);
-       mask &= ~bit;
-       ctrl_outl(mask, reg);
-       local_irq_restore(flags);
-}
-
-static void ack_cayman_irq(unsigned int irq)
-{
-       disable_cayman_irq(irq);
-}
-
-static void end_cayman_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_cayman_irq(irq);
-}
-
-static unsigned int startup_cayman_irq(unsigned int irq)
-{
-       enable_cayman_irq(irq);
-       return 0; /* never anything pending */
-}
-
-static void shutdown_cayman_irq(unsigned int irq)
-{
-       disable_cayman_irq(irq);
-}
-
-struct hw_interrupt_type cayman_irq_type = {
-       .typename       = "Cayman-IRQ",
-       .startup        = startup_cayman_irq,
-       .shutdown       = shutdown_cayman_irq,
-       .enable         = enable_cayman_irq,
-       .disable        = disable_cayman_irq,
-       .ack            = ack_cayman_irq,
-       .end            = end_cayman_irq,
-};
-
-int cayman_irq_demux(int evt)
-{
-       int irq = intc_evt_to_irq[evt];
-
-       if (irq == SMSC_IRQ) {
-               unsigned long status;
-               int i;
-
-               status = ctrl_inl(EPLD_STATUS_BASE) &
-                        ctrl_inl(EPLD_MASK_BASE) & 0xff;
-               if (status == 0) {
-                       irq = -1;
-               } else {
-                       for (i=0; i<8; i++) {
-                               if (status & (1<<i))
-                                       break;
-                       }
-                       irq = START_EXT_IRQS + i;
-               }
-       }
-
-       if (irq == PCI2_IRQ) {
-               unsigned long status;
-               int i;
-
-               status = ctrl_inl(EPLD_STATUS_BASE + 3 * sizeof(u32)) &
-                        ctrl_inl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff;
-               if (status == 0) {
-                       irq = -1;
-               } else {
-                       for (i=0; i<8; i++) {
-                               if (status & (1<<i))
-                                       break;
-                       }
-                       irq = START_EXT_IRQS + (3 * 8) + i;
-               }
-       }
-
-       return irq;
-}
-
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
-int cayman_irq_describe(char* p, int irq)
-{
-       if (irq < NR_INTC_IRQS) {
-               return intc_irq_describe(p, irq);
-       } else if (irq < NR_INTC_IRQS + 8) {
-               return sprintf(p, "(SMSC %d)", irq - NR_INTC_IRQS);
-       } else if ((irq >= NR_INTC_IRQS + 24) && (irq < NR_INTC_IRQS + 32)) {
-               return sprintf(p, "(PCI2 %d)", irq - (NR_INTC_IRQS + 24));
-       }
-
-       return 0;
-}
-#endif
-
-void init_cayman_irq(void)
-{
-       int i;
-
-       epld_virt = onchip_remap(EPLD_BASE, 1024, "EPLD");
-       if (!epld_virt) {
-               printk(KERN_ERR "Cayman IRQ: Unable to remap EPLD\n");
-               return;
-       }
-
-       for (i=0; i<NR_EXT_IRQS; i++) {
-               irq_desc[START_EXT_IRQS + i].chip = &cayman_irq_type;
-       }
-
-       /* Setup the SMSC interrupt */
-       setup_irq(SMSC_IRQ, &cayman_action_smsc);
-       setup_irq(PCI2_IRQ, &cayman_action_pci2);
-}
diff --git a/arch/sh/boards/cayman/led.c b/arch/sh/boards/cayman/led.c
deleted file mode 100644 (file)
index a808eac..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * arch/sh/boards/cayman/led.c
- *
- * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Flash the LEDs
- */
-#include <asm/io.h>
-
-/*
-** It is supposed these functions to be used for a low level
-** debugging (via Cayman LEDs), hence to be available as soon
-** as possible.
-** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped
-** (this happen when IRQ are initialized... quite late).
-** These triky dependencies should be removed. Temporary, it
-** may be enough to NOP until EPLD is mapped.
-*/
-
-extern unsigned long epld_virt;
-
-#define LED_ADDR      (epld_virt + 0x008)
-#define HDSP2534_ADDR (epld_virt + 0x100)
-
-void mach_led(int position, int value)
-{
-       if (!epld_virt)
-               return;
-
-       if (value)
-               ctrl_outl(0, LED_ADDR);
-       else
-               ctrl_outl(1, LED_ADDR);
-
-}
-
-void mach_alphanum(int position, unsigned char value)
-{
-       if (!epld_virt)
-               return;
-
-       ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2));
-}
-
-void mach_alphanum_brightness(int setting)
-{
-       ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0);
-}
diff --git a/arch/sh/boards/cayman/setup.c b/arch/sh/boards/cayman/setup.c
deleted file mode 100644 (file)
index 8c9fa47..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * arch/sh/mach-cayman/setup.c
- *
- * SH5 Cayman support
- *
- * Copyright (C) 2002  David J. Mckay & Benedict Gaster
- * Copyright (C) 2003 - 2007  Paul Mundt
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <asm/cpu/irq.h>
-
-/*
- * Platform Dependent Interrupt Priorities.
- */
-
-/* Using defaults defined in irq.h */
-#define        RES NO_PRIORITY         /* Disabled */
-#define IR0 IRL0_PRIORITY      /* IRLs */
-#define IR1 IRL1_PRIORITY
-#define IR2 IRL2_PRIORITY
-#define IR3 IRL3_PRIORITY
-#define PCA INTA_PRIORITY      /* PCI Ints */
-#define PCB INTB_PRIORITY
-#define PCC INTC_PRIORITY
-#define PCD INTD_PRIORITY
-#define SER TOP_PRIORITY
-#define ERR TOP_PRIORITY
-#define PW0 TOP_PRIORITY
-#define PW1 TOP_PRIORITY
-#define PW2 TOP_PRIORITY
-#define PW3 TOP_PRIORITY
-#define DM0 NO_PRIORITY                /* DMA Ints */
-#define DM1 NO_PRIORITY
-#define DM2 NO_PRIORITY
-#define DM3 NO_PRIORITY
-#define DAE NO_PRIORITY
-#define TU0 TIMER_PRIORITY     /* TMU Ints */
-#define TU1 NO_PRIORITY
-#define TU2 NO_PRIORITY
-#define TI2 NO_PRIORITY
-#define ATI NO_PRIORITY                /* RTC Ints */
-#define PRI NO_PRIORITY
-#define CUI RTC_PRIORITY
-#define ERI SCIF_PRIORITY      /* SCIF Ints */
-#define RXI SCIF_PRIORITY
-#define BRI SCIF_PRIORITY
-#define TXI SCIF_PRIORITY
-#define ITI TOP_PRIORITY       /* WDT Ints */
-
-/* Setup for the SMSC FDC37C935 */
-#define SMSC_SUPERIO_BASE      0x04000000
-#define SMSC_CONFIG_PORT_ADDR  0x3f0
-#define SMSC_INDEX_PORT_ADDR   SMSC_CONFIG_PORT_ADDR
-#define SMSC_DATA_PORT_ADDR    0x3f1
-
-#define SMSC_ENTER_CONFIG_KEY  0x55
-#define SMSC_EXIT_CONFIG_KEY   0xaa
-
-#define SMCS_LOGICAL_DEV_INDEX 0x07
-#define SMSC_DEVICE_ID_INDEX   0x20
-#define SMSC_DEVICE_REV_INDEX  0x21
-#define SMSC_ACTIVATE_INDEX    0x30
-#define SMSC_PRIMARY_BASE_INDEX  0x60
-#define SMSC_SECONDARY_BASE_INDEX 0x62
-#define SMSC_PRIMARY_INT_INDEX 0x70
-#define SMSC_SECONDARY_INT_INDEX 0x72
-
-#define SMSC_IDE1_DEVICE       1
-#define SMSC_KEYBOARD_DEVICE   7
-#define SMSC_CONFIG_REGISTERS  8
-
-#define SMSC_SUPERIO_READ_INDEXED(index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       inb(SMSC_DATA_PORT_ADDR); })
-#define SMSC_SUPERIO_WRITE_INDEXED(val, index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       outb((val),   SMSC_DATA_PORT_ADDR); })
-
-#define IDE1_PRIMARY_BASE      0x01f0
-#define IDE1_SECONDARY_BASE    0x03f6
-
-unsigned long smsc_superio_virt;
-
-int platform_int_priority[NR_INTC_IRQS] = {
-       IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ  0- 7 */
-       RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ  8-15 */
-       PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */
-       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */
-       TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */
-       RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */
-       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */
-       RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */
-};
-
-static int __init smsc_superio_setup(void)
-{
-       unsigned char devid, devrev;
-
-       smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO");
-       if (!smsc_superio_virt) {
-               panic("Unable to remap SMSC SuperIO\n");
-       }
-
-       /* Initially the chip is in run state */
-       /* Put it into configuration state */
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       /* Read device ID info */
-       devid = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
-       devrev = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
-       printk("SMSC SuperIO devid %02x rev %02x\n", devid, devrev);
-
-       /* Select the keyboard device */
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-
-       /* enable it */
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-
-       /* Select the interrupts */
-       /* On a PC keyboard is IRQ1, mouse is IRQ12 */
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX);
-       SMSC_SUPERIO_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX);
-
-#ifdef CONFIG_IDE
-       /*
-        * Only IDE1 exists on the Cayman
-        */
-
-       /* Power it on */
-       SMSC_SUPERIO_WRITE_INDEXED(1 << SMSC_IDE1_DEVICE, 0x22);
-
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE >> 8,
-                                  SMSC_PRIMARY_BASE_INDEX + 0);
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE & 0xff,
-                                  SMSC_PRIMARY_BASE_INDEX + 1);
-
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE >> 8,
-                                  SMSC_SECONDARY_BASE_INDEX + 0);
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE & 0xff,
-                                  SMSC_SECONDARY_BASE_INDEX + 1);
-
-       SMSC_SUPERIO_WRITE_INDEXED(14, SMSC_PRIMARY_INT_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_CONFIG_REGISTERS,
-                                  SMCS_LOGICAL_DEV_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
-       SMSC_SUPERIO_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
-#endif
-
-       /* Exit the configuration state */
-       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       return 0;
-}
-__initcall(smsc_superio_setup);
-
-static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
-{
-       if (port < 0x400) {
-               extern unsigned long smsc_superio_virt;
-               return (void __iomem *)((port << 2) | smsc_superio_virt);
-       }
-
-       return (void __iomem *)port;
-}
-
-extern void init_cayman_irq(void);
-
-static struct sh_machine_vector mv_cayman __initmv = {
-       .mv_name                = "Hitachi Cayman",
-       .mv_nr_irqs             = 64,
-       .mv_ioport_map          = cayman_ioport_map,
-       .mv_init_irq            = init_cayman_irq,
-};
diff --git a/arch/sh/boards/dreamcast/Makefile b/arch/sh/boards/dreamcast/Makefile
deleted file mode 100644 (file)
index 7b97546..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Makefile for the Sega Dreamcast specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o rtc.o
-
diff --git a/arch/sh/boards/dreamcast/irq.c b/arch/sh/boards/dreamcast/irq.c
deleted file mode 100644 (file)
index 9d0673a..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/irq.c
- *
- * Holly IRQ support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- * Released under the terms of the GNU GPL v2.0
- */
-
-#include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/dreamcast/sysasic.h>
-
-/* Dreamcast System ASIC Hardware Events -
-
-   The Dreamcast's System ASIC (a.k.a. Holly) is responsible for receiving
-   hardware events from system peripherals and triggering an SH7750 IRQ.
-   Hardware events can trigger IRQs 13, 11, or 9 depending on which bits are
-   set in the Event Mask Registers (EMRs).  When a hardware event is
-   triggered, it's corresponding bit in the Event Status Registers (ESRs)
-   is set, and that bit should be rewritten to the ESR to acknowledge that
-   event.
-
-   There are three 32-bit ESRs located at 0xa05f8900 - 0xa05f6908.  Event
-   types can be found in include/asm-sh/dreamcast/sysasic.h. There are three
-   groups of EMRs that parallel the ESRs.  Each EMR group corresponds to an
-   IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928
-   triggers IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9.
-
-   In the kernel, these events are mapped to virtual IRQs so that drivers can
-   respond to them as they would a normal interrupt.  In order to keep this
-   mapping simple, the events are mapped as:
-
-   6900/6910 - Events  0-31, IRQ 13
-   6904/6924 - Events 32-63, IRQ 11
-   6908/6938 - Events 64-95, IRQ  9
-
-*/
-
-#define ESR_BASE 0x005f6900    /* Base event status register */
-#define EMR_BASE 0x005f6910    /* Base event mask register */
-
-/* Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
-   1 = 0x6920, 2 = 0x6930; also determine the event offset */
-#define LEVEL(event) (((event) - HW_EVENT_IRQ_BASE) / 32)
-
-/* Return the hardware event's bit positon within the EMR/ESR */
-#define EVENT_BIT(event) (((event) - HW_EVENT_IRQ_BASE) & 31)
-
-/* For each of these *_irq routines, the IRQ passed in is the virtual IRQ
-   (logically mapped to the corresponding bit for the hardware event). */
-
-/* Disable the hardware event by masking its bit in its EMR */
-static inline void disable_systemasic_irq(unsigned int irq)
-{
-        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
-        __u32 mask;
-
-        mask = inl(emr);
-        mask &= ~(1 << EVENT_BIT(irq));
-        outl(mask, emr);
-}
-
-/* Enable the hardware event by setting its bit in its EMR */
-static inline void enable_systemasic_irq(unsigned int irq)
-{
-        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
-        __u32 mask;
-
-        mask = inl(emr);
-        mask |= (1 << EVENT_BIT(irq));
-        outl(mask, emr);
-}
-
-/* Acknowledge a hardware event by writing its bit back to its ESR */
-static void ack_systemasic_irq(unsigned int irq)
-{
-        __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
-        disable_systemasic_irq(irq);
-        outl((1 << EVENT_BIT(irq)), esr);
-}
-
-/* After a IRQ has been ack'd and responded to, it needs to be renabled */
-static void end_systemasic_irq(unsigned int irq)
-{
-        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-                enable_systemasic_irq(irq);
-}
-
-static unsigned int startup_systemasic_irq(unsigned int irq)
-{
-        enable_systemasic_irq(irq);
-
-        return 0;
-}
-
-static void shutdown_systemasic_irq(unsigned int irq)
-{
-        disable_systemasic_irq(irq);
-}
-
-struct hw_interrupt_type systemasic_int = {
-        .typename       = "System ASIC",
-        .startup        = startup_systemasic_irq,
-        .shutdown       = shutdown_systemasic_irq,
-        .enable         = enable_systemasic_irq,
-        .disable        = disable_systemasic_irq,
-        .ack            = ack_systemasic_irq,
-        .end            = end_systemasic_irq,
-};
-
-/*
- * Map the hardware event indicated by the processor IRQ to a virtual IRQ.
- */
-int systemasic_irq_demux(int irq)
-{
-        __u32 emr, esr, status, level;
-        __u32 j, bit;
-
-        switch (irq) {
-                case 13:
-                        level = 0;
-                        break;
-                case 11:
-                        level = 1;
-                        break;
-                case  9:
-                        level = 2;
-                        break;
-                default:
-                        return irq;
-        }
-        emr = EMR_BASE + (level << 4) + (level << 2);
-        esr = ESR_BASE + (level << 2);
-
-        /* Mask the ESR to filter any spurious, unwanted interrupts */
-        status = inl(esr);
-        status &= inl(emr);
-
-        /* Now scan and find the first set bit as the event to map */
-        for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {
-                if (status & bit) {
-                        irq = HW_EVENT_IRQ_BASE + j + (level << 5);
-                        return irq;
-                }
-        }
-
-        /* Not reached */
-        return irq;
-}
diff --git a/arch/sh/boards/dreamcast/rtc.c b/arch/sh/boards/dreamcast/rtc.c
deleted file mode 100644 (file)
index a743368..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/rtc.c
- *
- * Dreamcast AICA RTC routines.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
- * Copyright (c) 2002 Paul Mundt <lethal@chaoticdreams.org>
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- */
-
-#include <linux/time.h>
-#include <asm/rtc.h>
-#include <asm/io.h>
-
-/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
-   seconds) to get the standard Unix Epoch when getting the time, and add
-   20 years when setting the time. */
-#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
-
-/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
-   registers.*/
-#define AICA_RTC_SECS_H                0xa0710000
-#define AICA_RTC_SECS_L                0xa0710004
-
-/**
- * aica_rtc_gettimeofday - Get the time from the AICA RTC
- * @ts: pointer to resulting timespec
- *
- * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
- */
-static void aica_rtc_gettimeofday(struct timespec *ts)
-{
-       unsigned long val1, val2;
-
-       do {
-               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-
-               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-       } while (val1 != val2);
-
-       ts->tv_sec = val1 - TWENTY_YEARS;
-
-       /* Can't get nanoseconds with just a seconds counter. */
-       ts->tv_nsec = 0;
-}
-
-/**
- * aica_rtc_settimeofday - Set the AICA RTC to the current time
- * @secs: contains the time_t to set
- *
- * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
- */
-static int aica_rtc_settimeofday(const time_t secs)
-{
-       unsigned long val1, val2;
-       unsigned long adj = secs + TWENTY_YEARS;
-
-       do {
-               ctrl_outl((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
-               ctrl_outl((adj & 0xffff), AICA_RTC_SECS_L);
-
-               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-
-               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-       } while (val1 != val2);
-
-       return 0;
-}
-
-void aica_time_init(void)
-{
-       rtc_sh_get_time = aica_rtc_gettimeofday;
-       rtc_sh_set_time = aica_rtc_settimeofday;
-}
-
diff --git a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c
deleted file mode 100644 (file)
index 2581c8c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/setup.c
- *
- * Hardware support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
- * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- * This file originally bore the message (with enclosed-$):
- *     Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
- *     SEGA Dreamcast support
- */
-
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/device.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/rtc.h>
-#include <asm/machvec.h>
-#include <asm/mach/sysasic.h>
-
-extern struct hw_interrupt_type systemasic_int;
-extern void aica_time_init(void);
-extern int gapspci_init(void);
-extern int systemasic_irq_demux(int);
-
-static void __init dreamcast_setup(char **cmdline_p)
-{
-       int i;
-
-       /* Mask all hardware events */
-       /* XXX */
-
-       /* Acknowledge any previous events */
-       /* XXX */
-
-       __set_io_port_base(0xa0000000);
-
-       /* Assign all virtual IRQs to the System ASIC int. handler */
-       for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
-               irq_desc[i].chip = &systemasic_int;
-
-       board_time_init = aica_time_init;
-
-#ifdef CONFIG_PCI
-       if (gapspci_init() < 0)
-               printk(KERN_WARNING "GAPSPCI was not detected.\n");
-#endif
-}
-
-static struct sh_machine_vector mv_dreamcast __initmv = {
-       .mv_name                = "Sega Dreamcast",
-       .mv_setup               = dreamcast_setup,
-       .mv_irq_demux           = systemasic_irq_demux,
-};
diff --git a/arch/sh/boards/hp6xx/Makefile b/arch/sh/boards/hp6xx/Makefile
deleted file mode 100644 (file)
index b312427..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the HP6xx specific parts of the kernel
-#
-
-obj-y                  := setup.o
-obj-$(CONFIG_PM)       += pm.o pm_wakeup.o
-obj-$(CONFIG_APM_EMULATION)    += hp6xx_apm.o
diff --git a/arch/sh/boards/hp6xx/hp6xx_apm.c b/arch/sh/boards/hp6xx/hp6xx_apm.c
deleted file mode 100644 (file)
index 177f4f0..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * bios-less APM driver for hp680
- *
- * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com>
- * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License.
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/apm-emulation.h>
-#include <linux/io.h>
-#include <asm/adc.h>
-#include <asm/hp6xx.h>
-
-/* percentage values */
-#define APM_CRITICAL                   10
-#define APM_LOW                                30
-
-/* resonably sane values */
-#define HP680_BATTERY_MAX              898
-#define HP680_BATTERY_MIN              486
-#define HP680_BATTERY_AC_ON            1023
-
-#define MODNAME "hp6x0_apm"
-
-#define PGDR   0xa400012c
-
-static void hp6x0_apm_get_power_status(struct apm_power_info *info)
-{
-       int battery, backup, charging, percentage;
-       u8 pgdr;
-
-       battery         = adc_single(ADC_CHANNEL_BATTERY);
-       backup          = adc_single(ADC_CHANNEL_BACKUP);
-       charging        = adc_single(ADC_CHANNEL_CHARGE);
-
-       percentage = 100 * (battery - HP680_BATTERY_MIN) /
-                          (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
-
-       /* % of full battery */
-       info->battery_life = percentage;
-
-       /* We want our estimates in minutes */
-       info->units = 0;
-
-       /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
-       info->time = (2 * battery);
-
-       info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
-                        APM_AC_ONLINE : APM_AC_OFFLINE;
-
-       pgdr = ctrl_inb(PGDR);
-       if (pgdr & PGDR_MAIN_BATTERY_OUT) {
-               info->battery_status    = APM_BATTERY_STATUS_NOT_PRESENT;
-               info->battery_flag      = 0x80;
-       } else if (charging < 8) {
-               info->battery_status    = APM_BATTERY_STATUS_CHARGING;
-               info->battery_flag      = 0x08;
-               info->ac_line_status    = 0x01;
-       } else if (percentage <= APM_CRITICAL) {
-               info->battery_status    = APM_BATTERY_STATUS_CRITICAL;
-               info->battery_flag      = 0x04;
-       } else if (percentage <= APM_LOW) {
-               info->battery_status    = APM_BATTERY_STATUS_LOW;
-               info->battery_flag      = 0x02;
-       } else {
-               info->battery_status    = APM_BATTERY_STATUS_HIGH;
-               info->battery_flag      = 0x01;
-       }
-}
-
-static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
-{
-       if (!APM_DISABLED)
-               apm_queue_event(APM_USER_SUSPEND);
-
-       return IRQ_HANDLED;
-}
-
-static int __init hp6x0_apm_init(void)
-{
-       int ret;
-
-       ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
-                         IRQF_DISABLED, MODNAME, NULL);
-       if (unlikely(ret < 0)) {
-               printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
-                      HP680_BTN_IRQ);
-               return ret;
-       }
-
-       apm_get_power_status = hp6x0_apm_get_power_status;
-
-       return ret;
-}
-
-static void __exit hp6x0_apm_exit(void)
-{
-       free_irq(HP680_BTN_IRQ, 0);
-}
-
-module_init(hp6x0_apm_init);
-module_exit(hp6x0_apm_exit);
-
-MODULE_AUTHOR("Adriy Skulysh");
-MODULE_DESCRIPTION("hp6xx Advanced Power Management");
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/hp6xx/pm.c b/arch/sh/boards/hp6xx/pm.c
deleted file mode 100644 (file)
index d22f6ea..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * hp6x0 Power Management Routines
- *
- * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License.
- */
-#include <linux/init.h>
-#include <linux/suspend.h>
-#include <linux/errno.h>
-#include <linux/time.h>
-#include <asm/io.h>
-#include <asm/hd64461.h>
-#include <asm/hp6xx.h>
-#include <asm/cpu/dac.h>
-#include <asm/pm.h>
-
-#define STBCR          0xffffff82
-#define STBCR2         0xffffff88
-
-static int hp6x0_pm_enter(suspend_state_t state)
-{
-       u8 stbcr, stbcr2;
-#ifdef CONFIG_HD64461_ENABLER
-       u8 scr;
-       u16 hd64461_stbcr;
-#endif
-
-#ifdef CONFIG_HD64461_ENABLER
-       outb(0, HD64461_PCC1CSCIER);
-
-       scr = inb(HD64461_PCC1SCR);
-       scr |= HD64461_PCCSCR_VCC1;
-       outb(scr, HD64461_PCC1SCR);
-
-       hd64461_stbcr = inw(HD64461_STBCR);
-       hd64461_stbcr |= HD64461_STBCR_SPC1ST;
-       outw(hd64461_stbcr, HD64461_STBCR);
-#endif
-
-       ctrl_outb(0x1f, DACR);
-
-       stbcr = ctrl_inb(STBCR);
-       ctrl_outb(0x01, STBCR);
-
-       stbcr2 = ctrl_inb(STBCR2);
-       ctrl_outb(0x7f , STBCR2);
-
-       outw(0xf07f, HD64461_SCPUCR);
-
-       pm_enter();
-
-       outw(0, HD64461_SCPUCR);
-       ctrl_outb(stbcr, STBCR);
-       ctrl_outb(stbcr2, STBCR2);
-
-#ifdef CONFIG_HD64461_ENABLER
-       hd64461_stbcr = inw(HD64461_STBCR);
-       hd64461_stbcr &= ~HD64461_STBCR_SPC1ST;
-       outw(hd64461_stbcr, HD64461_STBCR);
-
-       outb(0x4c, HD64461_PCC1CSCIER);
-       outb(0x00, HD64461_PCC1CSCR);
-#endif
-
-       return 0;
-}
-
-static struct platform_suspend_ops hp6x0_pm_ops = {
-       .enter          = hp6x0_pm_enter,
-       .valid          = suspend_valid_only_mem,
-};
-
-static int __init hp6x0_pm_init(void)
-{
-       suspend_set_ops(&hp6x0_pm_ops);
-       return 0;
-}
-
-late_initcall(hp6x0_pm_init);
diff --git a/arch/sh/boards/hp6xx/pm_wakeup.S b/arch/sh/boards/hp6xx/pm_wakeup.S
deleted file mode 100644 (file)
index 45e9bf0..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
- *
- * 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.
- *
- */
-
-#include <linux/linkage.h>
-#include <asm/cpu/mmu_context.h>
-
-#define k0     r0
-#define k1     r1
-#define k2     r2
-#define k3     r3
-#define k4     r4
-
-/*
- * Kernel mode register usage:
- *     k0      scratch
- *     k1      scratch
- *     k2      scratch (Exception code)
- *     k3      scratch (Return address)
- *     k4      scratch
- *     k5      reserved
- *     k6      Global Interrupt Mask (0--15 << 4)
- *     k7      CURRENT_THREAD_INFO (pointer to current thread info)
- */
-
-ENTRY(wakeup_start)
-! clear STBY bit
-       mov     #-126, k2
-       and     #127, k0
-       mov.b   k0, @k2
-! enable refresh
-       mov.l   5f, k1
-       mov.w   6f, k0
-       mov.w   k0, @k1
-! jump to handler
-       mov.l   2f, k2
-       mov.l   3f, k3
-       mov.l   @k2, k2
-
-       mov.l   4f, k1
-       jmp     @k1
-       nop
-
-       .align  2
-1:     .long   EXPEVT
-2:     .long   INTEVT
-3:     .long   ret_from_irq
-4:     .long   handle_exception
-5:     .long   0xffffff68
-6:     .word   0x0524
-
-ENTRY(wakeup_end)
-       nop
diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c
deleted file mode 100644 (file)
index 2f414ac..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * linux/arch/sh/boards/hp6xx/setup.c
- *
- * Copyright (C) 2002 Andriy Skulysh
- * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com>
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Setup code for HP620/HP660/HP680/HP690 (internal peripherials only)
- */
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/hd64461.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/hp6xx.h>
-#include <asm/cpu/dac.h>
-
-#define        SCPCR   0xa4000116
-#define        SCPDR   0xa4000136
-
-/* CF Slot */
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start = 0x15000000 + 0x1f0,
-               .end   = 0x15000000 + 0x1f0 + 0x08 - 0x01,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = 0x15000000 + 0x1fe,
-               .end   = 0x15000000 + 0x1fe + 0x01,
-               .flags = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start = 77,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device = {
-       .name           =  "pata_platform",
-       .id             =  -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device jornadakbd_device = {
-       .name           = "jornada680_kbd",
-       .id             = -1,
-};
-
-static struct platform_device *hp6xx_devices[] __initdata = {
-       &cf_ide_device,
-       &jornadakbd_device,
-};
-
-static void __init hp6xx_init_irq(void)
-{
-       /* Gets touchscreen and powerbutton IRQ working */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static int __init hp6xx_devices_setup(void)
-{
-       return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices));
-}
-
-static void __init hp6xx_setup(char **cmdline_p)
-{
-       u8 v8;
-       u16 v;
-
-       v = inw(HD64461_STBCR);
-       v |=    HD64461_STBCR_SURTST | HD64461_STBCR_SIRST      |
-               HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST     |
-               HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST     |
-               HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST|
-               HD64461_STBCR_SAFECKE_IST;
-#ifndef CONFIG_HD64461_ENABLER
-       v |= HD64461_STBCR_SPC1ST;
-#endif
-       outw(v, HD64461_STBCR);
-       v = inw(HD64461_GPADR);
-       v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
-       outw(v, HD64461_GPADR);
-
-       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
-
-#ifndef CONFIG_HD64461_ENABLER
-       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
-#endif
-
-       sh_dac_output(0, DAC_SPEAKER_VOLUME);
-       sh_dac_disable(DAC_SPEAKER_VOLUME);
-       v8 = ctrl_inb(DACR);
-       v8 &= ~DACR_DAE;
-       ctrl_outb(v8,DACR);
-
-       v8 = ctrl_inb(SCPDR);
-       v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
-       v8 &= ~SCPDR_TS_SCAN_ENABLE;
-       ctrl_outb(v8, SCPDR);
-
-       v = ctrl_inw(SCPCR);
-       v &= ~SCPCR_TS_MASK;
-       v |= SCPCR_TS_ENABLE;
-       ctrl_outw(v, SCPCR);
-}
-device_initcall(hp6xx_devices_setup);
-
-static struct sh_machine_vector mv_hp6xx __initmv = {
-       .mv_name = "hp6xx",
-       .mv_setup = hp6xx_setup,
-       /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
-       .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
-       .mv_irq_demux = hd64461_irq_demux,
-       /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
-       .mv_init_irq = hp6xx_init_irq,
-};
diff --git a/arch/sh/boards/landisk/Makefile b/arch/sh/boards/landisk/Makefile
deleted file mode 100644 (file)
index a696b42..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
-#
-
-obj-y   := setup.o irq.o psw.o gio.o
diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c
deleted file mode 100644 (file)
index 0c15b0a..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * arch/sh/boards/landisk/gio.c - driver for landisk
- *
- * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
- * LANDISK and USL-5P Button, LED and GIO driver drive function.
- *
- *   Copylight (C) 2006 kogiidena
- *   Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
- *
- * 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.
- *
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/smp_lock.h>
-#include <linux/kdev_t.h>
-#include <linux/cdev.h>
-#include <linux/fs.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/landisk/gio.h>
-#include <asm/landisk/iodata_landisk.h>
-
-#define DEVCOUNT                4
-#define GIO_MINOR              2       /* GIO minor no. */
-
-static dev_t dev;
-static struct cdev *cdev_p;
-static int openCnt;
-
-static int gio_open(struct inode *inode, struct file *filp)
-{
-       int minor;
-       int ret = -ENOENT;
-
-       lock_kernel();
-       minor = MINOR(inode->i_rdev);
-       if (minor < DEVCOUNT) {
-               if (openCnt > 0) {
-                       ret = -EALREADY;
-               } else {
-                       openCnt++;
-                       ret = 0;
-               }
-       }
-       unlock_kernel();
-       return ret;
-}
-
-static int gio_close(struct inode *inode, struct file *filp)
-{
-       int minor;
-
-       minor = MINOR(inode->i_rdev);
-       if (minor < DEVCOUNT) {
-               openCnt--;
-       }
-       return 0;
-}
-
-static int gio_ioctl(struct inode *inode, struct file *filp,
-                            unsigned int cmd, unsigned long arg)
-{
-       unsigned int data;
-       static unsigned int addr = 0;
-
-       if (cmd & 0x01) {       /* write */
-               if (copy_from_user(&data, (int *)arg, sizeof(int))) {
-                       return -EFAULT;
-               }
-       }
-
-       switch (cmd) {
-       case GIODRV_IOCSGIOSETADDR:     /* address set */
-               addr = data;
-               break;
-
-       case GIODRV_IOCSGIODATA1:       /* write byte */
-               ctrl_outb((unsigned char)(0x0ff & data), addr);
-               break;
-
-       case GIODRV_IOCSGIODATA2:       /* write word */
-               if (addr & 0x01) {
-                       return -EFAULT;
-               }
-               ctrl_outw((unsigned short int)(0x0ffff & data), addr);
-               break;
-
-       case GIODRV_IOCSGIODATA4:       /* write long */
-               if (addr & 0x03) {
-                       return -EFAULT;
-               }
-               ctrl_outl(data, addr);
-               break;
-
-       case GIODRV_IOCGGIODATA1:       /* read byte */
-               data = ctrl_inb(addr);
-               break;
-
-       case GIODRV_IOCGGIODATA2:       /* read word */
-               if (addr & 0x01) {
-                       return -EFAULT;
-               }
-               data = ctrl_inw(addr);
-               break;
-
-       case GIODRV_IOCGGIODATA4:       /* read long */
-               if (addr & 0x03) {
-                       return -EFAULT;
-               }
-               data = ctrl_inl(addr);
-               break;
-       default:
-               return -EFAULT;
-               break;
-       }
-
-       if ((cmd & 0x01) == 0) {        /* read */
-               if (copy_to_user((int *)arg, &data, sizeof(int))) {
-                       return -EFAULT;
-               }
-       }
-       return 0;
-}
-
-static const struct file_operations gio_fops = {
-       .owner = THIS_MODULE,
-       .open = gio_open,       /* open */
-       .release = gio_close,   /* release */
-       .ioctl = gio_ioctl,     /* ioctl */
-};
-
-static int __init gio_init(void)
-{
-       int error;
-
-       printk(KERN_INFO "gio: driver initialized\n");
-
-       openCnt = 0;
-
-       if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
-               printk(KERN_ERR
-                      "gio: Couldn't alloc_chrdev_region, error=%d\n",
-                      error);
-               return 1;
-       }
-
-       cdev_p = cdev_alloc();
-       cdev_p->ops = &gio_fops;
-       error = cdev_add(cdev_p, dev, DEVCOUNT);
-       if (error) {
-               printk(KERN_ERR
-                      "gio: Couldn't cdev_add, error=%d\n", error);
-               return 1;
-       }
-
-       return 0;
-}
-
-static void __exit gio_exit(void)
-{
-       cdev_del(cdev_p);
-       unregister_chrdev_region(dev, DEVCOUNT);
-}
-
-module_init(gio_init);
-module_exit(gio_exit);
-
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/landisk/irq.c b/arch/sh/boards/landisk/irq.c
deleted file mode 100644 (file)
index 2586494..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * arch/sh/boards/landisk/irq.c
- *
- * I-O DATA Device, Inc. LANDISK Support
- *
- * Copyright (C) 2005-2007 kogiidena
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <asm/landisk/iodata_landisk.h>
-
-static void disable_landisk_irq(unsigned int irq)
-{
-       unsigned char mask = 0xff ^ (0x01 << (irq - 5));
-
-       ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
-}
-
-static void enable_landisk_irq(unsigned int irq)
-{
-       unsigned char value = (0x01 << (irq - 5));
-
-       ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
-}
-
-static struct irq_chip landisk_irq_chip __read_mostly = {
-       .name           = "LANDISK",
-       .mask           = disable_landisk_irq,
-       .unmask         = enable_landisk_irq,
-       .mask_ack       = disable_landisk_irq,
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_landisk_IRQ(void)
-{
-       int i;
-
-       for (i = 5; i < 14; i++) {
-               disable_irq_nosync(i);
-               set_irq_chip_and_handler_name(i, &landisk_irq_chip,
-                                             handle_level_irq, "level");
-               enable_landisk_irq(i);
-       }
-       ctrl_outb(0x00, PA_PWRINT_CLR);
-}
diff --git a/arch/sh/boards/landisk/psw.c b/arch/sh/boards/landisk/psw.c
deleted file mode 100644 (file)
index 5a9b70b..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * arch/sh/boards/landisk/psw.c
- *
- * push switch support for LANDISK and USL-5P
- *
- * Copyright (C) 2006-2007  Paul Mundt
- * Copyright (C) 2007  kogiidena
- *
- * 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.
- */
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <asm/landisk/iodata_landisk.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
-       struct platform_device *pdev = arg;
-       struct push_switch *psw = platform_get_drvdata(pdev);
-       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
-       unsigned int sw_value;
-       int ret = 0;
-
-       sw_value = (0x0ff & (~ctrl_inb(PA_STATUS)));
-
-       /* Nothing to do if there's no state change */
-       if (psw->state) {
-               ret = 1;
-               goto out;
-       }
-
-       /* Figure out who raised it */
-       if (sw_value & (1 << psw_info->bit)) {
-               psw->state = 1;
-               mod_timer(&psw->debounce, jiffies + 50);
-               ret = 1;
-       }
-
-out:
-       /* Clear the switch IRQs */
-       ctrl_outb(0x00, PA_PWRINT_CLR);
-
-       return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_power_resources[] = {
-       [0] = {
-               .start = IRQ_POWER,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource psw_usl5p_resources[] = {
-       [0] = {
-               .start = IRQ_BUTTON,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct push_switch_platform_info psw_power_platform_data = {
-       .name           = "psw_power",
-       .bit            = 4,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw1_platform_data = {
-       .name           = "psw1",
-       .bit            = 0,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw2_platform_data = {
-       .name           = "psw2",
-       .bit            = 2,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw3_platform_data = {
-       .name           = "psw3",
-       .bit            = 1,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device psw_power_switch_device = {
-       .name           = "push-switch",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(psw_power_resources),
-       .resource       = psw_power_resources,
-       .dev            = {
-               .platform_data = &psw_power_platform_data,
-       },
-};
-
-static struct platform_device psw1_switch_device = {
-       .name           = "push-switch",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev            = {
-               .platform_data = &psw1_platform_data,
-       },
-};
-
-static struct platform_device psw2_switch_device = {
-       .name           = "push-switch",
-       .id             = 2,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev            = {
-               .platform_data = &psw2_platform_data,
-       },
-};
-
-static struct platform_device psw3_switch_device = {
-       .name           = "push-switch",
-       .id             = 3,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev = {
-               .platform_data = &psw3_platform_data,
-       },
-};
-
-static struct platform_device *psw_devices[] = {
-       &psw_power_switch_device,
-       &psw1_switch_device,
-       &psw2_switch_device,
-       &psw3_switch_device,
-};
-
-static int __init psw_init(void)
-{
-       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-module_init(psw_init);
diff --git a/arch/sh/boards/landisk/setup.c b/arch/sh/boards/landisk/setup.c
deleted file mode 100644 (file)
index 2b708ec..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * arch/sh/boards/landisk/setup.c
- *
- * I-O DATA Device, Inc. LANDISK Support.
- *
- * Copyright (C) 2000 Kazumoto Kojima
- * Copyright (C) 2002 Paul Mundt
- * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005-2007 kogiidena
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/pm.h>
-#include <linux/mm.h>
-#include <asm/machvec.h>
-#include <asm/landisk/iodata_landisk.h>
-#include <asm/io.h>
-
-void init_landisk_IRQ(void);
-
-static void landisk_power_off(void)
-{
-        ctrl_outb(0x01, PA_SHUTDOWN);
-}
-
-static struct resource cf_ide_resources[3];
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev            = {
-               .platform_data = &pata_info,
-       },
-};
-
-static struct platform_device rtc_device = {
-       .name           = "rs5c313",
-       .id             = -1,
-};
-
-static struct platform_device *landisk_devices[] __initdata = {
-       &cf_ide_device,
-       &rtc_device,
-};
-
-static int __init landisk_devices_setup(void)
-{
-       pgprot_t prot;
-       unsigned long paddrbase;
-       void *cf_ide_base;
-
-       /* open I/O area window */
-       paddrbase = virt_to_phys((void *)PA_AREA5_IO);
-       prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
-       cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
-       if (!cf_ide_base) {
-               printk("allocate_cf_area : can't open CF I/O window!\n");
-               return -ENOMEM;
-       }
-
-       /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
-       cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
-       cf_ide_resources[0].end   = (unsigned long)cf_ide_base + 0x40 + 0x0f;
-       cf_ide_resources[0].flags = IORESOURCE_IO;
-       cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
-       cf_ide_resources[1].end   = (unsigned long)cf_ide_base + 0x2c + 0x03;
-       cf_ide_resources[1].flags = IORESOURCE_IO;
-       cf_ide_resources[2].start = IRQ_FATA;
-       cf_ide_resources[2].flags = IORESOURCE_IRQ;
-
-       return platform_add_devices(landisk_devices,
-                                   ARRAY_SIZE(landisk_devices));
-}
-
-__initcall(landisk_devices_setup);
-
-static void __init landisk_setup(char **cmdline_p)
-{
-        /* LED ON */
-       ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED);
-
-       printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
-       pm_power_off = landisk_power_off;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_landisk __initmv = {
-       .mv_name = "LANDISK",
-       .mv_nr_irqs = 72,
-       .mv_setup = landisk_setup,
-       .mv_init_irq = init_landisk_IRQ,
-};
diff --git a/arch/sh/boards/lboxre2/Makefile b/arch/sh/boards/lboxre2/Makefile
deleted file mode 100644 (file)
index e9ed140..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the L-BOX RE2 specific parts of the kernel
-# Copyright (c) 2007 Nobuhiro Iwamatsu
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/lboxre2/irq.c b/arch/sh/boards/lboxre2/irq.c
deleted file mode 100644 (file)
index 5a1c3bb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * linux/arch/sh/boards/lboxre2/irq.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support.
- *
- * 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.
- *
- */
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/lboxre2.h>
-
-/*
- * Initialize IRQ setting
- */
-void __init init_lboxre2_IRQ(void)
-{
-       make_imask_irq(IRQ_CF1);
-       make_imask_irq(IRQ_CF0);
-       make_imask_irq(IRQ_INTD);
-       make_imask_irq(IRQ_ETH1);
-       make_imask_irq(IRQ_ETH0);
-       make_imask_irq(IRQ_INTA);
-}
diff --git a/arch/sh/boards/lboxre2/setup.c b/arch/sh/boards/lboxre2/setup.c
deleted file mode 100644 (file)
index c74440d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * linux/arch/sh/boards/lbox/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support
- *
- * 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.
- *
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <asm/addrspace.h>
-#include <asm/lboxre2.h>
-#include <asm/io.h>
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = 0x1f0,
-               .end    = 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = 0x1f0 + 0x206,
-               .end    = 0x1f0 +8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = IRQ_CF0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device *lboxre2_devices[] __initdata = {
-       &cf_ide_device,
-};
-
-static int __init lboxre2_devices_setup(void)
-{
-       u32 cf0_io_base;        /* Boot CF base address */
-       pgprot_t prot;
-       unsigned long paddrbase, psize;
-
-       /* open I/O area window */
-       paddrbase = virt_to_phys((void*)PA_AREA5_IO);
-       psize = PAGE_SIZE;
-       prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16);
-       cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot);
-       if (!cf0_io_base) {
-               printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
-               return -ENOMEM;
-       }
-
-       cf_ide_resources[0].start += cf0_io_base ;
-       cf_ide_resources[0].end   += cf0_io_base ;
-       cf_ide_resources[1].start += cf0_io_base ;
-       cf_ide_resources[1].end   += cf0_io_base ;
-
-       return platform_add_devices(lboxre2_devices,
-                       ARRAY_SIZE(lboxre2_devices));
-
-}
-device_initcall(lboxre2_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_lboxre2 __initmv = {
-       .mv_name                = "L-BOX RE2",
-       .mv_nr_irqs             = 72,
-       .mv_init_irq            = init_lboxre2_IRQ,
-};
diff --git a/arch/sh/boards/mach-cayman/Makefile b/arch/sh/boards/mach-cayman/Makefile
new file mode 100644 (file)
index 0000000..489a8f8
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Hitachi Cayman specific parts of the kernel
+#
+obj-y := setup.o irq.o
+obj-$(CONFIG_HEARTBEAT)        += led.o
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c
new file mode 100644 (file)
index 0000000..ceb37ae
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support
+ *
+ * This file handles the board specific parts of the Cayman interrupt system
+ *
+ * Copyright (C) 2002 Stuart Menefy
+ *
+ * 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.
+ */
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/signal.h>
+#include <cpu/irq.h>
+#include <asm/page.h>
+
+/* Setup for the SMSC FDC37C935 / LAN91C100FD */
+#define SMSC_IRQ         IRQ_IRL1
+
+/* Setup for PCI Bus 2, which transmits interrupts via the EPLD */
+#define PCI2_IRQ         IRQ_IRL3
+
+unsigned long epld_virt;
+
+#define EPLD_BASE        0x04002000
+#define EPLD_STATUS_BASE (epld_virt + 0x10)
+#define EPLD_MASK_BASE   (epld_virt + 0x20)
+
+/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
+   the same SH-5 interrupt */
+
+static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id)
+{
+        printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n");
+       return IRQ_NONE;
+}
+
+static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
+{
+        printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq);
+       return IRQ_NONE;
+}
+
+static struct irqaction cayman_action_smsc = {
+       .name           = "Cayman SMSC Mux",
+       .handler        = cayman_interrupt_smsc,
+       .flags          = IRQF_DISABLED,
+};
+
+static struct irqaction cayman_action_pci2 = {
+       .name           = "Cayman PCI2 Mux",
+       .handler        = cayman_interrupt_pci2,
+       .flags          = IRQF_DISABLED,
+};
+
+static void enable_cayman_irq(unsigned int irq)
+{
+       unsigned long flags;
+       unsigned long mask;
+       unsigned int reg;
+       unsigned char bit;
+
+       irq -= START_EXT_IRQS;
+       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
+       bit = 1<<(irq % 8);
+       local_irq_save(flags);
+       mask = ctrl_inl(reg);
+       mask |= bit;
+       ctrl_outl(mask, reg);
+       local_irq_restore(flags);
+}
+
+void disable_cayman_irq(unsigned int irq)
+{
+       unsigned long flags;
+       unsigned long mask;
+       unsigned int reg;
+       unsigned char bit;
+
+       irq -= START_EXT_IRQS;
+       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
+       bit = 1<<(irq % 8);
+       local_irq_save(flags);
+       mask = ctrl_inl(reg);
+       mask &= ~bit;
+       ctrl_outl(mask, reg);
+       local_irq_restore(flags);
+}
+
+static void ack_cayman_irq(unsigned int irq)
+{
+       disable_cayman_irq(irq);
+}
+
+static void end_cayman_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_cayman_irq(irq);
+}
+
+static unsigned int startup_cayman_irq(unsigned int irq)
+{
+       enable_cayman_irq(irq);
+       return 0; /* never anything pending */
+}
+
+static void shutdown_cayman_irq(unsigned int irq)
+{
+       disable_cayman_irq(irq);
+}
+
+struct hw_interrupt_type cayman_irq_type = {
+       .typename       = "Cayman-IRQ",
+       .startup        = startup_cayman_irq,
+       .shutdown       = shutdown_cayman_irq,
+       .enable         = enable_cayman_irq,
+       .disable        = disable_cayman_irq,
+       .ack            = ack_cayman_irq,
+       .end            = end_cayman_irq,
+};
+
+int cayman_irq_demux(int evt)
+{
+       int irq = intc_evt_to_irq[evt];
+
+       if (irq == SMSC_IRQ) {
+               unsigned long status;
+               int i;
+
+               status = ctrl_inl(EPLD_STATUS_BASE) &
+                        ctrl_inl(EPLD_MASK_BASE) & 0xff;
+               if (status == 0) {
+                       irq = -1;
+               } else {
+                       for (i=0; i<8; i++) {
+                               if (status & (1<<i))
+                                       break;
+                       }
+                       irq = START_EXT_IRQS + i;
+               }
+       }
+
+       if (irq == PCI2_IRQ) {
+               unsigned long status;
+               int i;
+
+               status = ctrl_inl(EPLD_STATUS_BASE + 3 * sizeof(u32)) &
+                        ctrl_inl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff;
+               if (status == 0) {
+                       irq = -1;
+               } else {
+                       for (i=0; i<8; i++) {
+                               if (status & (1<<i))
+                                       break;
+                       }
+                       irq = START_EXT_IRQS + (3 * 8) + i;
+               }
+       }
+
+       return irq;
+}
+
+#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
+int cayman_irq_describe(char* p, int irq)
+{
+       if (irq < NR_INTC_IRQS) {
+               return intc_irq_describe(p, irq);
+       } else if (irq < NR_INTC_IRQS + 8) {
+               return sprintf(p, "(SMSC %d)", irq - NR_INTC_IRQS);
+       } else if ((irq >= NR_INTC_IRQS + 24) && (irq < NR_INTC_IRQS + 32)) {
+               return sprintf(p, "(PCI2 %d)", irq - (NR_INTC_IRQS + 24));
+       }
+
+       return 0;
+}
+#endif
+
+void init_cayman_irq(void)
+{
+       int i;
+
+       epld_virt = onchip_remap(EPLD_BASE, 1024, "EPLD");
+       if (!epld_virt) {
+               printk(KERN_ERR "Cayman IRQ: Unable to remap EPLD\n");
+               return;
+       }
+
+       for (i=0; i<NR_EXT_IRQS; i++) {
+               irq_desc[START_EXT_IRQS + i].chip = &cayman_irq_type;
+       }
+
+       /* Setup the SMSC interrupt */
+       setup_irq(SMSC_IRQ, &cayman_action_smsc);
+       setup_irq(PCI2_IRQ, &cayman_action_pci2);
+}
diff --git a/arch/sh/boards/mach-cayman/led.c b/arch/sh/boards/mach-cayman/led.c
new file mode 100644 (file)
index 0000000..a808eac
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * arch/sh/boards/cayman/led.c
+ *
+ * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Flash the LEDs
+ */
+#include <asm/io.h>
+
+/*
+** It is supposed these functions to be used for a low level
+** debugging (via Cayman LEDs), hence to be available as soon
+** as possible.
+** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped
+** (this happen when IRQ are initialized... quite late).
+** These triky dependencies should be removed. Temporary, it
+** may be enough to NOP until EPLD is mapped.
+*/
+
+extern unsigned long epld_virt;
+
+#define LED_ADDR      (epld_virt + 0x008)
+#define HDSP2534_ADDR (epld_virt + 0x100)
+
+void mach_led(int position, int value)
+{
+       if (!epld_virt)
+               return;
+
+       if (value)
+               ctrl_outl(0, LED_ADDR);
+       else
+               ctrl_outl(1, LED_ADDR);
+
+}
+
+void mach_alphanum(int position, unsigned char value)
+{
+       if (!epld_virt)
+               return;
+
+       ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2));
+}
+
+void mach_alphanum_brightness(int setting)
+{
+       ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0);
+}
diff --git a/arch/sh/boards/mach-cayman/setup.c b/arch/sh/boards/mach-cayman/setup.c
new file mode 100644 (file)
index 0000000..e7f9cc5
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * arch/sh/mach-cayman/setup.c
+ *
+ * SH5 Cayman support
+ *
+ * Copyright (C) 2002  David J. Mckay & Benedict Gaster
+ * Copyright (C) 2003 - 2007  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <cpu/irq.h>
+
+/*
+ * Platform Dependent Interrupt Priorities.
+ */
+
+/* Using defaults defined in irq.h */
+#define        RES NO_PRIORITY         /* Disabled */
+#define IR0 IRL0_PRIORITY      /* IRLs */
+#define IR1 IRL1_PRIORITY
+#define IR2 IRL2_PRIORITY
+#define IR3 IRL3_PRIORITY
+#define PCA INTA_PRIORITY      /* PCI Ints */
+#define PCB INTB_PRIORITY
+#define PCC INTC_PRIORITY
+#define PCD INTD_PRIORITY
+#define SER TOP_PRIORITY
+#define ERR TOP_PRIORITY
+#define PW0 TOP_PRIORITY
+#define PW1 TOP_PRIORITY
+#define PW2 TOP_PRIORITY
+#define PW3 TOP_PRIORITY
+#define DM0 NO_PRIORITY                /* DMA Ints */
+#define DM1 NO_PRIORITY
+#define DM2 NO_PRIORITY
+#define DM3 NO_PRIORITY
+#define DAE NO_PRIORITY
+#define TU0 TIMER_PRIORITY     /* TMU Ints */
+#define TU1 NO_PRIORITY
+#define TU2 NO_PRIORITY
+#define TI2 NO_PRIORITY
+#define ATI NO_PRIORITY                /* RTC Ints */
+#define PRI NO_PRIORITY
+#define CUI RTC_PRIORITY
+#define ERI SCIF_PRIORITY      /* SCIF Ints */
+#define RXI SCIF_PRIORITY
+#define BRI SCIF_PRIORITY
+#define TXI SCIF_PRIORITY
+#define ITI TOP_PRIORITY       /* WDT Ints */
+
+/* Setup for the SMSC FDC37C935 */
+#define SMSC_SUPERIO_BASE      0x04000000
+#define SMSC_CONFIG_PORT_ADDR  0x3f0
+#define SMSC_INDEX_PORT_ADDR   SMSC_CONFIG_PORT_ADDR
+#define SMSC_DATA_PORT_ADDR    0x3f1
+
+#define SMSC_ENTER_CONFIG_KEY  0x55
+#define SMSC_EXIT_CONFIG_KEY   0xaa
+
+#define SMCS_LOGICAL_DEV_INDEX 0x07
+#define SMSC_DEVICE_ID_INDEX   0x20
+#define SMSC_DEVICE_REV_INDEX  0x21
+#define SMSC_ACTIVATE_INDEX    0x30
+#define SMSC_PRIMARY_BASE_INDEX  0x60
+#define SMSC_SECONDARY_BASE_INDEX 0x62
+#define SMSC_PRIMARY_INT_INDEX 0x70
+#define SMSC_SECONDARY_INT_INDEX 0x72
+
+#define SMSC_IDE1_DEVICE       1
+#define SMSC_KEYBOARD_DEVICE   7
+#define SMSC_CONFIG_REGISTERS  8
+
+#define SMSC_SUPERIO_READ_INDEXED(index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       inb(SMSC_DATA_PORT_ADDR); })
+#define SMSC_SUPERIO_WRITE_INDEXED(val, index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       outb((val),   SMSC_DATA_PORT_ADDR); })
+
+#define IDE1_PRIMARY_BASE      0x01f0
+#define IDE1_SECONDARY_BASE    0x03f6
+
+unsigned long smsc_superio_virt;
+
+int platform_int_priority[NR_INTC_IRQS] = {
+       IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ  0- 7 */
+       RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ  8-15 */
+       PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */
+       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */
+       TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */
+       RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */
+       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */
+       RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */
+};
+
+static int __init smsc_superio_setup(void)
+{
+       unsigned char devid, devrev;
+
+       smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO");
+       if (!smsc_superio_virt) {
+               panic("Unable to remap SMSC SuperIO\n");
+       }
+
+       /* Initially the chip is in run state */
+       /* Put it into configuration state */
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       /* Read device ID info */
+       devid = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
+       devrev = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
+       printk("SMSC SuperIO devid %02x rev %02x\n", devid, devrev);
+
+       /* Select the keyboard device */
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+
+       /* enable it */
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+
+       /* Select the interrupts */
+       /* On a PC keyboard is IRQ1, mouse is IRQ12 */
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX);
+       SMSC_SUPERIO_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX);
+
+#ifdef CONFIG_IDE
+       /*
+        * Only IDE1 exists on the Cayman
+        */
+
+       /* Power it on */
+       SMSC_SUPERIO_WRITE_INDEXED(1 << SMSC_IDE1_DEVICE, 0x22);
+
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE >> 8,
+                                  SMSC_PRIMARY_BASE_INDEX + 0);
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE & 0xff,
+                                  SMSC_PRIMARY_BASE_INDEX + 1);
+
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE >> 8,
+                                  SMSC_SECONDARY_BASE_INDEX + 0);
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE & 0xff,
+                                  SMSC_SECONDARY_BASE_INDEX + 1);
+
+       SMSC_SUPERIO_WRITE_INDEXED(14, SMSC_PRIMARY_INT_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_CONFIG_REGISTERS,
+                                  SMCS_LOGICAL_DEV_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
+       SMSC_SUPERIO_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
+#endif
+
+       /* Exit the configuration state */
+       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       return 0;
+}
+__initcall(smsc_superio_setup);
+
+static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
+{
+       if (port < 0x400) {
+               extern unsigned long smsc_superio_virt;
+               return (void __iomem *)((port << 2) | smsc_superio_virt);
+       }
+
+       return (void __iomem *)port;
+}
+
+extern void init_cayman_irq(void);
+
+static struct sh_machine_vector mv_cayman __initmv = {
+       .mv_name                = "Hitachi Cayman",
+       .mv_nr_irqs             = 64,
+       .mv_ioport_map          = cayman_ioport_map,
+       .mv_init_irq            = init_cayman_irq,
+};
diff --git a/arch/sh/boards/mach-dreamcast/Makefile b/arch/sh/boards/mach-dreamcast/Makefile
new file mode 100644 (file)
index 0000000..7b97546
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Makefile for the Sega Dreamcast specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o rtc.o
+
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
new file mode 100644 (file)
index 0000000..67bdc33
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * arch/sh/boards/dreamcast/irq.c
+ *
+ * Holly IRQ support for the Sega Dreamcast.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
+ *
+ * This file is part of the LinuxDC project (www.linuxdc.org)
+ * Released under the terms of the GNU GPL v2.0
+ */
+
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <mach/sysasic.h>
+
+/* Dreamcast System ASIC Hardware Events -
+
+   The Dreamcast's System ASIC (a.k.a. Holly) is responsible for receiving
+   hardware events from system peripherals and triggering an SH7750 IRQ.
+   Hardware events can trigger IRQs 13, 11, or 9 depending on which bits are
+   set in the Event Mask Registers (EMRs).  When a hardware event is
+   triggered, it's corresponding bit in the Event Status Registers (ESRs)
+   is set, and that bit should be rewritten to the ESR to acknowledge that
+   event.
+
+   There are three 32-bit ESRs located at 0xa05f8900 - 0xa05f6908.  Event
+   types can be found in include/asm-sh/dreamcast/sysasic.h. There are three
+   groups of EMRs that parallel the ESRs.  Each EMR group corresponds to an
+   IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928
+   triggers IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9.
+
+   In the kernel, these events are mapped to virtual IRQs so that drivers can
+   respond to them as they would a normal interrupt.  In order to keep this
+   mapping simple, the events are mapped as:
+
+   6900/6910 - Events  0-31, IRQ 13
+   6904/6924 - Events 32-63, IRQ 11
+   6908/6938 - Events 64-95, IRQ  9
+
+*/
+
+#define ESR_BASE 0x005f6900    /* Base event status register */
+#define EMR_BASE 0x005f6910    /* Base event mask register */
+
+/* Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
+   1 = 0x6920, 2 = 0x6930; also determine the event offset */
+#define LEVEL(event) (((event) - HW_EVENT_IRQ_BASE) / 32)
+
+/* Return the hardware event's bit positon within the EMR/ESR */
+#define EVENT_BIT(event) (((event) - HW_EVENT_IRQ_BASE) & 31)
+
+/* For each of these *_irq routines, the IRQ passed in is the virtual IRQ
+   (logically mapped to the corresponding bit for the hardware event). */
+
+/* Disable the hardware event by masking its bit in its EMR */
+static inline void disable_systemasic_irq(unsigned int irq)
+{
+        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
+        __u32 mask;
+
+        mask = inl(emr);
+        mask &= ~(1 << EVENT_BIT(irq));
+        outl(mask, emr);
+}
+
+/* Enable the hardware event by setting its bit in its EMR */
+static inline void enable_systemasic_irq(unsigned int irq)
+{
+        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
+        __u32 mask;
+
+        mask = inl(emr);
+        mask |= (1 << EVENT_BIT(irq));
+        outl(mask, emr);
+}
+
+/* Acknowledge a hardware event by writing its bit back to its ESR */
+static void ack_systemasic_irq(unsigned int irq)
+{
+        __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
+        disable_systemasic_irq(irq);
+        outl((1 << EVENT_BIT(irq)), esr);
+}
+
+/* After a IRQ has been ack'd and responded to, it needs to be renabled */
+static void end_systemasic_irq(unsigned int irq)
+{
+        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+                enable_systemasic_irq(irq);
+}
+
+static unsigned int startup_systemasic_irq(unsigned int irq)
+{
+        enable_systemasic_irq(irq);
+
+        return 0;
+}
+
+static void shutdown_systemasic_irq(unsigned int irq)
+{
+        disable_systemasic_irq(irq);
+}
+
+struct hw_interrupt_type systemasic_int = {
+        .typename       = "System ASIC",
+        .startup        = startup_systemasic_irq,
+        .shutdown       = shutdown_systemasic_irq,
+        .enable         = enable_systemasic_irq,
+        .disable        = disable_systemasic_irq,
+        .ack            = ack_systemasic_irq,
+        .end            = end_systemasic_irq,
+};
+
+/*
+ * Map the hardware event indicated by the processor IRQ to a virtual IRQ.
+ */
+int systemasic_irq_demux(int irq)
+{
+        __u32 emr, esr, status, level;
+        __u32 j, bit;
+
+        switch (irq) {
+                case 13:
+                        level = 0;
+                        break;
+                case 11:
+                        level = 1;
+                        break;
+                case  9:
+                        level = 2;
+                        break;
+                default:
+                        return irq;
+        }
+        emr = EMR_BASE + (level << 4) + (level << 2);
+        esr = ESR_BASE + (level << 2);
+
+        /* Mask the ESR to filter any spurious, unwanted interrupts */
+        status = inl(esr);
+        status &= inl(emr);
+
+        /* Now scan and find the first set bit as the event to map */
+        for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {
+                if (status & bit) {
+                        irq = HW_EVENT_IRQ_BASE + j + (level << 5);
+                        return irq;
+                }
+        }
+
+        /* Not reached */
+        return irq;
+}
diff --git a/arch/sh/boards/mach-dreamcast/rtc.c b/arch/sh/boards/mach-dreamcast/rtc.c
new file mode 100644 (file)
index 0000000..a743368
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * arch/sh/boards/dreamcast/rtc.c
+ *
+ * Dreamcast AICA RTC routines.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
+ * Copyright (c) 2002 Paul Mundt <lethal@chaoticdreams.org>
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ */
+
+#include <linux/time.h>
+#include <asm/rtc.h>
+#include <asm/io.h>
+
+/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
+   seconds) to get the standard Unix Epoch when getting the time, and add
+   20 years when setting the time. */
+#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
+
+/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
+   registers.*/
+#define AICA_RTC_SECS_H                0xa0710000
+#define AICA_RTC_SECS_L                0xa0710004
+
+/**
+ * aica_rtc_gettimeofday - Get the time from the AICA RTC
+ * @ts: pointer to resulting timespec
+ *
+ * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
+ */
+static void aica_rtc_gettimeofday(struct timespec *ts)
+{
+       unsigned long val1, val2;
+
+       do {
+               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+
+               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+       } while (val1 != val2);
+
+       ts->tv_sec = val1 - TWENTY_YEARS;
+
+       /* Can't get nanoseconds with just a seconds counter. */
+       ts->tv_nsec = 0;
+}
+
+/**
+ * aica_rtc_settimeofday - Set the AICA RTC to the current time
+ * @secs: contains the time_t to set
+ *
+ * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
+ */
+static int aica_rtc_settimeofday(const time_t secs)
+{
+       unsigned long val1, val2;
+       unsigned long adj = secs + TWENTY_YEARS;
+
+       do {
+               ctrl_outl((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
+               ctrl_outl((adj & 0xffff), AICA_RTC_SECS_L);
+
+               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+
+               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+       } while (val1 != val2);
+
+       return 0;
+}
+
+void aica_time_init(void)
+{
+       rtc_sh_get_time = aica_rtc_gettimeofday;
+       rtc_sh_set_time = aica_rtc_settimeofday;
+}
+
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c
new file mode 100644 (file)
index 0000000..7d944fc
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * arch/sh/boards/dreamcast/setup.c
+ *
+ * Hardware support for the Sega Dreamcast.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
+ * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
+ *
+ * This file is part of the LinuxDC project (www.linuxdc.org)
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ * This file originally bore the message (with enclosed-$):
+ *     Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
+ *     SEGA Dreamcast support
+ */
+
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/device.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/rtc.h>
+#include <asm/machvec.h>
+#include <mach/sysasic.h>
+
+extern struct hw_interrupt_type systemasic_int;
+extern void aica_time_init(void);
+extern int gapspci_init(void);
+extern int systemasic_irq_demux(int);
+
+static void __init dreamcast_setup(char **cmdline_p)
+{
+       int i;
+
+       /* Mask all hardware events */
+       /* XXX */
+
+       /* Acknowledge any previous events */
+       /* XXX */
+
+       __set_io_port_base(0xa0000000);
+
+       /* Assign all virtual IRQs to the System ASIC int. handler */
+       for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
+               irq_desc[i].chip = &systemasic_int;
+
+       board_time_init = aica_time_init;
+
+#ifdef CONFIG_PCI
+       if (gapspci_init() < 0)
+               printk(KERN_WARNING "GAPSPCI was not detected.\n");
+#endif
+}
+
+static struct sh_machine_vector mv_dreamcast __initmv = {
+       .mv_name                = "Sega Dreamcast",
+       .mv_setup               = dreamcast_setup,
+       .mv_irq_demux           = systemasic_irq_demux,
+};
diff --git a/arch/sh/boards/mach-edosk7705/Makefile b/arch/sh/boards/mach-edosk7705/Makefile
new file mode 100644 (file)
index 0000000..14bdd53
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Makefile for the EDOSK7705 specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
+
diff --git a/arch/sh/boards/mach-edosk7705/io.c b/arch/sh/boards/mach-edosk7705/io.c
new file mode 100644 (file)
index 0000000..541cea2
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * arch/sh/boards/renesas/edosk7705/io.c
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routines for Hitachi EDOSK7705 board.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/edosk7705/io.h>
+#include <asm/addrspace.h>
+
+#define SMC_IOADDR     0xA2000000
+
+#define maybebadio(name,port) \
+  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
+        #name, (port), (__u32) __builtin_return_address(0))
+
+/* Map the Ethernet addresses as if it is at 0x300 - 0x320 */
+unsigned long sh_edosk7705_isa_port2addr(unsigned long port)
+{
+     if (port >= 0x300 && port < 0x320) {
+         /* SMC91C96 registers are 4 byte aligned rather than the
+          * usual 2 byte!
+          */
+         return SMC_IOADDR + ( (port - 0x300) * 2);
+     }
+
+     maybebadio(sh_edosk7705_isa_port2addr, port);
+     return port;
+}
+
+/* Trying to read / write bytes on odd-byte boundaries to the Ethernet
+ * registers causes problems. So we bit-shift the value and read / write
+ * in 2 byte chunks. Setting the low byte to 0 does not cause problems
+ * now as odd byte writes are only made on the bit mask / interrupt
+ * register. This may not be the case in future Mar-2003 SJD
+ */
+unsigned char sh_edosk7705_inb(unsigned long port)
+{
+       if (port >= 0x300 && port < 0x320 && port & 0x01) {
+               return (volatile unsigned char)(generic_inw(port -1) >> 8);
+       }
+       return *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port);
+}
+
+unsigned int sh_edosk7705_inl(unsigned long port)
+{
+       return *(volatile unsigned long *)port;
+}
+
+void sh_edosk7705_outb(unsigned char value, unsigned long port)
+{
+       if (port >= 0x300 && port < 0x320 && port & 0x01) {
+               generic_outw(((unsigned short)value << 8), port -1);
+               return;
+       }
+       *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port) = value;
+}
+
+void sh_edosk7705_outl(unsigned int value, unsigned long port)
+{
+       *(volatile unsigned long *)port = value;
+}
+
+void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *p = addr;
+       while (count--) *p++ = sh_edosk7705_inb(port);
+}
+
+void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned long *p = (unsigned long*)addr;
+       while (count--)
+               *p++ = *(volatile unsigned long *)port;
+}
+
+void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *p = (unsigned char*)addr;
+       while (count--) sh_edosk7705_outb(*p++, port);
+}
+
+void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned long *p = (unsigned long*)addr;
+       while (count--) sh_edosk7705_outl(*p++, port);
+}
+
diff --git a/arch/sh/boards/mach-edosk7705/setup.c b/arch/sh/boards/mach-edosk7705/setup.c
new file mode 100644 (file)
index 0000000..f076c45
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * arch/sh/boards/renesas/edosk7705/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for edosk7705 development
+ * board by S. Dunn, 2003.
+ */
+#include <linux/init.h>
+#include <asm/machvec.h>
+#include <asm/edosk7705/io.h>
+
+static void __init sh_edosk7705_init_irq(void)
+{
+       /* This is the Ethernet interrupt */
+       make_imask_irq(0x09);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_edosk7705 __initmv = {
+       .mv_name                = "EDOSK7705",
+       .mv_nr_irqs             = 80,
+
+       .mv_inb                 = sh_edosk7705_inb,
+       .mv_inl                 = sh_edosk7705_inl,
+       .mv_outb                = sh_edosk7705_outb,
+       .mv_outl                = sh_edosk7705_outl,
+
+       .mv_inl_p               = sh_edosk7705_inl,
+       .mv_outl_p              = sh_edosk7705_outl,
+
+       .mv_insb                = sh_edosk7705_insb,
+       .mv_insl                = sh_edosk7705_insl,
+       .mv_outsb               = sh_edosk7705_outsb,
+       .mv_outsl               = sh_edosk7705_outsl,
+
+       .mv_isa_port2addr       = sh_edosk7705_isa_port2addr,
+       .mv_init_irq            = sh_edosk7705_init_irq,
+};
diff --git a/arch/sh/boards/mach-highlander/Kconfig b/arch/sh/boards/mach-highlander/Kconfig
new file mode 100644 (file)
index 0000000..fc8f28e
--- /dev/null
@@ -0,0 +1,24 @@
+if SH_HIGHLANDER
+
+choice
+       prompt "Highlander options"
+       default SH_R7780MP
+
+config SH_R7780RP
+       bool "R7780RP-1 board support"
+       depends on CPU_SUBTYPE_SH7780
+
+config SH_R7780MP
+       bool "R7780MP board support"
+       depends on CPU_SUBTYPE_SH7780
+       help
+         Selecting this option will enable support for the mass-production
+         version of the R7780RP. If in doubt, say Y.
+
+config SH_R7785RP
+       bool "R7785RP board support"
+       depends on CPU_SUBTYPE_SH7785
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-highlander/Makefile b/arch/sh/boards/mach-highlander/Makefile
new file mode 100644 (file)
index 0000000..20a1008
--- /dev/null
@@ -0,0 +1,11 @@
+#
+# Makefile for the R7780RP-1 specific parts of the kernel
+#
+irqinit-$(CONFIG_SH_R7780MP)   := irq-r7780mp.o
+irqinit-$(CONFIG_SH_R7785RP)   := irq-r7785rp.o
+irqinit-$(CONFIG_SH_R7780RP)   := irq-r7780rp.o
+obj-y                          := setup.o $(irqinit-y)
+
+ifneq ($(CONFIG_SH_R7785RP),y)
+obj-$(CONFIG_PUSH_SWITCH)      += psw.o
+endif
diff --git a/arch/sh/boards/mach-highlander/irq-r7780mp.c b/arch/sh/boards/mach-highlander/irq-r7780mp.c
new file mode 100644 (file)
index 0000000..ae1cfcb
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Renesas Solutions Highlander R7780MP Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006  Paul Mundt
+ * Copyright (C) 2007  Magnus Damm
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+       CF,             /* Compact Flash */
+       TP,             /* Touch panel */
+       SCIF1,          /* FPGA SCIF1 */
+       SCIF0,          /* FPGA SCIF0 */
+       SMBUS,          /* SMBUS */
+       RTC,            /* RTC Alarm */
+       AX88796,        /* Ethernet controller */
+       PSW,            /* Push Switch */
+
+       /* external bus connector */
+       EXT1, EXT2, EXT4, EXT5, EXT6,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(TP, IRQ_TP),
+       INTC_IRQ(SCIF1, IRQ_SCIF1),
+       INTC_IRQ(SCIF0, IRQ_SCIF0),
+       INTC_IRQ(SMBUS, IRQ_SMBUS),
+       INTC_IRQ(RTC, IRQ_RTC),
+       INTC_IRQ(AX88796, IRQ_AX88796),
+       INTC_IRQ(PSW, IRQ_PSW),
+
+       INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
+       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
+       INTC_IRQ(EXT6, IRQ_EXT6),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
+           0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
+       IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
+       IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
+       0, IRQ_AX88796, IRQ_PSW,
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
+               printk(KERN_INFO "Using r7780mp interrupt controller.\n");
+               register_intc_controller(&intc_desc);
+               return irl2irq;
+       }
+
+       return NULL;
+}
diff --git a/arch/sh/boards/mach-highlander/irq-r7780rp.c b/arch/sh/boards/mach-highlander/irq-r7780rp.c
new file mode 100644 (file)
index 0000000..9d3921f
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Renesas Solutions Highlander R7780RP-1 Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006  Paul Mundt
+ * Copyright (C) 2008  Magnus Damm
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+
+       AX88796,          /* Ethernet controller */
+       PSW,              /* Push Switch */
+       CF,               /* Compact Flash */
+
+       PCI_A,
+       PCI_B,
+       PCI_C,
+       PCI_D,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
+       INTC_IRQ(PCI_B, 66),
+       INTC_IRQ(PCI_C, 67),
+       INTC_IRQ(PCI_D, 68),
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(PSW, IRQ_PSW),
+       INTC_IRQ(AX88796, IRQ_AX88796),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa5000000, 0, 16, /* IRLMSK */
+         { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
+           0, 0, 0, 0, 0, 0, PSW, AX88796 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       65, 66, 67, 68,
+       IRQ_CF, 0, 0, 0,
+       0, 0, 0, 0,
+       IRQ_AX88796, IRQ_PSW
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if (ctrl_inw(0xa5000600)) {
+               printk(KERN_INFO "Using r7780rp interrupt controller.\n");
+               register_intc_controller(&intc_desc);
+               return irl2irq;
+       }
+
+       return NULL;
+}
diff --git a/arch/sh/boards/mach-highlander/irq-r7785rp.c b/arch/sh/boards/mach-highlander/irq-r7785rp.c
new file mode 100644 (file)
index 0000000..896c045
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Renesas Solutions Highlander R7785RP Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006 - 2008  Paul Mundt
+ * Copyright (C) 2007  Magnus Damm
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* FPGA specific interrupt sources */
+       CF,             /* Compact Flash */
+       SMBUS,          /* SMBUS */
+       TP,             /* Touch panel */
+       RTC,            /* RTC Alarm */
+       TH_ALERT,       /* Temperature sensor */
+       AX88796,        /* Ethernet controller */
+
+       /* external bus connector */
+       EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(SMBUS, IRQ_SMBUS),
+       INTC_IRQ(TP, IRQ_TP),
+       INTC_IRQ(RTC, IRQ_RTC),
+       INTC_IRQ(TH_ALERT, IRQ_TH_ALERT),
+
+       INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1),
+       INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3),
+
+       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
+       INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7),
+
+       INTC_IRQ(AX88796, IRQ_AX88796),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa4000010, 0, 16, /* IRLMCR1 */
+         { 0, 0, 0, 0, CF, AX88796, SMBUS, TP,
+           RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } },
+       { 0xa4000012, 0, 16, /* IRLMCR2 */
+         { 0, 0, 0, 0, 0, 0, 0, 0,
+           EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       0, IRQ_CF, IRQ_EXT4, IRQ_EXT5,
+       IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP,
+       IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0,
+       IRQ_EXT1, IRQ_EXT2, IRQ_EXT3,
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000)
+               return NULL;
+
+       printk(KERN_INFO "Using r7785rp interrupt controller.\n");
+
+       ctrl_outw(0x0000, PA_IRLSSR1);  /* FPGA IRLSSR1(CF_CD clear) */
+
+       /* Setup the FPGA IRL */
+       ctrl_outw(0x0000, PA_IRLPRA);   /* FPGA IRLA */
+       ctrl_outw(0xe598, PA_IRLPRB);   /* FPGA IRLB */
+       ctrl_outw(0x7060, PA_IRLPRC);   /* FPGA IRLC */
+       ctrl_outw(0x0000, PA_IRLPRD);   /* FPGA IRLD */
+       ctrl_outw(0x4321, PA_IRLPRE);   /* FPGA IRLE */
+       ctrl_outw(0xdcba, PA_IRLPRF);   /* FPGA IRLF */
+
+       register_intc_controller(&intc_desc);
+       return irl2irq;
+}
diff --git a/arch/sh/boards/mach-highlander/psw.c b/arch/sh/boards/mach-highlander/psw.c
new file mode 100644 (file)
index 0000000..be8d547
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * arch/sh/boards/renesas/r7780rp/psw.c
+ *
+ * push switch support for RDBRP-1/RDBREVRP-1 debug boards.
+ *
+ * Copyright (C) 2006  Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <asm/r7780rp.h>
+#include <asm/push-switch.h>
+
+static irqreturn_t psw_irq_handler(int irq, void *arg)
+{
+       struct platform_device *pdev = arg;
+       struct push_switch *psw = platform_get_drvdata(pdev);
+       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
+       unsigned int l, mask;
+       int ret = 0;
+
+       l = ctrl_inw(PA_DBSW);
+
+       /* Nothing to do if there's no state change */
+       if (psw->state) {
+               ret = 1;
+               goto out;
+       }
+
+       mask = l & 0x70;
+       /* Figure out who raised it */
+       if (mask & (1 << psw_info->bit)) {
+               psw->state = !!(mask & (1 << psw_info->bit));
+               if (psw->state) /* debounce */
+                       mod_timer(&psw->debounce, jiffies + 50);
+
+               ret = 1;
+       }
+
+out:
+       /* Clear the switch IRQs */
+       l |= (0x7 << 12);
+       ctrl_outw(l, PA_DBSW);
+
+       return IRQ_RETVAL(ret);
+}
+
+static struct resource psw_resources[] = {
+       [0] = {
+               .start  = IRQ_PSW,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct push_switch_platform_info s2_platform_data = {
+       .name           = "s2",
+       .bit            = 6,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s2_switch_device = {
+       .name           = "push-switch",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s2_platform_data,
+       },
+};
+
+static struct push_switch_platform_info s3_platform_data = {
+       .name           = "s3",
+       .bit            = 5,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s3_switch_device = {
+       .name           = "push-switch",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s3_platform_data,
+       },
+};
+
+static struct push_switch_platform_info s4_platform_data = {
+       .name           = "s4",
+       .bit            = 4,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s4_switch_device = {
+       .name           = "push-switch",
+       .id             = 2,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s4_platform_data,
+       },
+};
+
+static struct platform_device *psw_devices[] = {
+       &s2_switch_device, &s3_switch_device, &s4_switch_device,
+};
+
+static int __init psw_init(void)
+{
+       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
+}
+module_init(psw_init);
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
new file mode 100644 (file)
index 0000000..bc79afb
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * arch/sh/boards/renesas/r7780rp/setup.c
+ *
+ * Renesas Solutions Highlander Support.
+ *
+ * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2005 - 2008 Paul Mundt
+ *
+ * This contains support for the R7780RP-1, R7780MP, and R7785RP
+ * Highlander modules.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <net/ax88796.h>
+#include <asm/machvec.h>
+#include <asm/r7780rp.h>
+#include <asm/clock.h>
+#include <asm/heartbeat.h>
+#include <asm/io.h>
+#include <asm/io_trapped.h>
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = 0xA4200000,
+               .end    = 0xA42000FF,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               .start  = IRQ_EXT1,             /* irq number */
+               .end    = IRQ_EXT1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource m66592_usb_peripheral_resources[] = {
+       [0] = {
+               .name   = "m66592_udc",
+               .start  = 0xb0000000,
+               .end    = 0xb00000FF,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "m66592_udc",
+               .start  = IRQ_EXT4,             /* irq number */
+               .end    = IRQ_EXT4,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device m66592_usb_peripheral_device = {
+       .name           = "m66592_udc",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
+       .resource       = m66592_usb_peripheral_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_AREA5_IO + 0x1000,
+               .end    = PA_AREA5_IO + 0x1000 + 0x08 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_AREA5_IO + 0x80c,
+               .end    = PA_AREA5_IO + 0x80c + 0x16 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start  = IRQ_CF,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev    = {
+               .platform_data  = &pata_info,
+       },
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_OBLED,
+               .end    = PA_OBLED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+#ifndef CONFIG_SH_R7785RP
+static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+};
+#endif
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+
+       /* R7785RP has a slightly more sensible FPGA.. */
+#ifndef CONFIG_SH_R7785RP
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+#endif
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct ax_plat_data ax88796_platdata = {
+       .flags          = AXFLG_HAS_93CX6,
+       .wordlength     = 2,
+       .dcr_val        = 0x1,
+       .rcr_val        = 0x40,
+};
+
+static struct resource ax88796_resources[] = {
+       {
+#ifdef CONFIG_SH_R7780RP
+               .start  = 0xa5800400,
+               .end    = 0xa5800400 + (0x20 * 0x2) - 1,
+#else
+               .start  = 0xa4100400,
+               .end    = 0xa4100400 + (0x20 * 0x2) - 1,
+#endif
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_AX88796,
+               .end    = IRQ_AX88796,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device ax88796_device = {
+       .name           = "ax88796",
+       .id             = 0,
+
+       .dev    = {
+               .platform_data = &ax88796_platdata,
+       },
+
+       .num_resources  = ARRAY_SIZE(ax88796_resources),
+       .resource       = ax88796_resources,
+};
+
+static struct resource smbus_resources[] = {
+       [0] = {
+               .start  = PA_SMCR,
+               .end    = PA_SMCR + 0x100 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_SMBUS,
+               .end    = IRQ_SMBUS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smbus_device = {
+       .name           = "i2c-highlander",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smbus_resources),
+       .resource       = smbus_resources,
+};
+
+static struct i2c_board_info __initdata highlander_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("r2025sd", 0x32),
+       },
+};
+
+static struct platform_device *r7780rp_devices[] __initdata = {
+       &r8a66597_usb_host_device,
+       &m66592_usb_peripheral_device,
+       &heartbeat_device,
+       &smbus_device,
+#ifndef CONFIG_SH_R7780RP
+       &ax88796_device,
+#endif
+};
+
+/*
+ * The CF is connected using a 16-bit bus where 8-bit operations are
+ * unsupported. The linux ata driver is however using 8-bit operations, so
+ * insert a trapped io filter to convert 8-bit operations into 16-bit.
+ */
+static struct trapped_io cf_trapped_io = {
+       .resource               = cf_ide_resources,
+       .num_resources          = 2,
+       .minimum_bus_width      = 16,
+};
+
+static int __init r7780rp_devices_setup(void)
+{
+       int ret = 0;
+
+#ifndef CONFIG_SH_R7780RP
+       if (register_trapped_io(&cf_trapped_io) == 0)
+               ret |= platform_device_register(&cf_ide_device);
+#endif
+
+       ret |= platform_add_devices(r7780rp_devices,
+                                   ARRAY_SIZE(r7780rp_devices));
+
+       ret |= i2c_register_board_info(0, highlander_i2c_devices,
+                                      ARRAY_SIZE(highlander_i2c_devices));
+
+       return ret;
+}
+device_initcall(r7780rp_devices_setup);
+
+/*
+ * Platform specific clocks
+ */
+static void ivdr_clk_enable(struct clk *clk)
+{
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
+}
+
+static void ivdr_clk_disable(struct clk *clk)
+{
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
+}
+
+static struct clk_ops ivdr_clk_ops = {
+       .enable         = ivdr_clk_enable,
+       .disable        = ivdr_clk_disable,
+};
+
+static struct clk ivdr_clk = {
+       .name           = "ivdr_clk",
+       .ops            = &ivdr_clk_ops,
+};
+
+static struct clk *r7780rp_clocks[] = {
+       &ivdr_clk,
+};
+
+static void r7780rp_power_off(void)
+{
+       if (mach_is_r7780mp() || mach_is_r7785rp())
+               ctrl_outw(0x0001, PA_POFF);
+}
+
+/*
+ * Initialize the board
+ */
+static void __init highlander_setup(char **cmdline_p)
+{
+       u16 ver = ctrl_inw(PA_VERREG);
+       int i;
+
+       printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
+                        mach_is_r7780rp() ? "R7780RP-1" :
+                        mach_is_r7780mp() ? "R7780MP"   :
+                                            "R7785RP");
+
+       printk(KERN_INFO "Board version: %d (revision %d), "
+                        "FPGA version: %d (revision %d)\n",
+                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
+                        (ver >>  4) & 0xf, ver & 0xf);
+
+       /*
+        * Enable the important clocks right away..
+        */
+       for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
+               struct clk *clk = r7780rp_clocks[i];
+
+               clk_register(clk);
+               clk_enable(clk);
+       }
+
+       ctrl_outw(0x0000, PA_OBLED);    /* Clear LED. */
+
+       if (mach_is_r7780rp())
+               ctrl_outw(0x0001, PA_SDPOW);    /* SD Power ON */
+
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL);     /* Si13112 */
+
+       pm_power_off = r7780rp_power_off;
+}
+
+static unsigned char irl2irq[HL_NR_IRL];
+
+static int highlander_irq_demux(int irq)
+{
+       if (irq >= HL_NR_IRL || !irl2irq[irq])
+               return irq;
+
+       return irl2irq[irq];
+}
+
+static void __init highlander_init_irq(void)
+{
+       unsigned char *ucp = highlander_plat_irq_setup();
+
+       if (ucp) {
+               plat_irq_setup_pins(IRQ_MODE_IRL3210);
+               memcpy(irl2irq, ucp, HL_NR_IRL);
+       }
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_highlander __initmv = {
+       .mv_name                = "Highlander",
+       .mv_setup               = highlander_setup,
+       .mv_init_irq            = highlander_init_irq,
+       .mv_irq_demux           = highlander_irq_demux,
+};
diff --git a/arch/sh/boards/mach-hp6xx/Makefile b/arch/sh/boards/mach-hp6xx/Makefile
new file mode 100644 (file)
index 0000000..b312427
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for the HP6xx specific parts of the kernel
+#
+
+obj-y                  := setup.o
+obj-$(CONFIG_PM)       += pm.o pm_wakeup.o
+obj-$(CONFIG_APM_EMULATION)    += hp6xx_apm.o
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
new file mode 100644 (file)
index 0000000..177f4f0
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * bios-less APM driver for hp680
+ *
+ * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com>
+ * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/apm-emulation.h>
+#include <linux/io.h>
+#include <asm/adc.h>
+#include <asm/hp6xx.h>
+
+/* percentage values */
+#define APM_CRITICAL                   10
+#define APM_LOW                                30
+
+/* resonably sane values */
+#define HP680_BATTERY_MAX              898
+#define HP680_BATTERY_MIN              486
+#define HP680_BATTERY_AC_ON            1023
+
+#define MODNAME "hp6x0_apm"
+
+#define PGDR   0xa400012c
+
+static void hp6x0_apm_get_power_status(struct apm_power_info *info)
+{
+       int battery, backup, charging, percentage;
+       u8 pgdr;
+
+       battery         = adc_single(ADC_CHANNEL_BATTERY);
+       backup          = adc_single(ADC_CHANNEL_BACKUP);
+       charging        = adc_single(ADC_CHANNEL_CHARGE);
+
+       percentage = 100 * (battery - HP680_BATTERY_MIN) /
+                          (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
+
+       /* % of full battery */
+       info->battery_life = percentage;
+
+       /* We want our estimates in minutes */
+       info->units = 0;
+
+       /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
+       info->time = (2 * battery);
+
+       info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
+                        APM_AC_ONLINE : APM_AC_OFFLINE;
+
+       pgdr = ctrl_inb(PGDR);
+       if (pgdr & PGDR_MAIN_BATTERY_OUT) {
+               info->battery_status    = APM_BATTERY_STATUS_NOT_PRESENT;
+               info->battery_flag      = 0x80;
+       } else if (charging < 8) {
+               info->battery_status    = APM_BATTERY_STATUS_CHARGING;
+               info->battery_flag      = 0x08;
+               info->ac_line_status    = 0x01;
+       } else if (percentage <= APM_CRITICAL) {
+               info->battery_status    = APM_BATTERY_STATUS_CRITICAL;
+               info->battery_flag      = 0x04;
+       } else if (percentage <= APM_LOW) {
+               info->battery_status    = APM_BATTERY_STATUS_LOW;
+               info->battery_flag      = 0x02;
+       } else {
+               info->battery_status    = APM_BATTERY_STATUS_HIGH;
+               info->battery_flag      = 0x01;
+       }
+}
+
+static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
+{
+       if (!APM_DISABLED)
+               apm_queue_event(APM_USER_SUSPEND);
+
+       return IRQ_HANDLED;
+}
+
+static int __init hp6x0_apm_init(void)
+{
+       int ret;
+
+       ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
+                         IRQF_DISABLED, MODNAME, NULL);
+       if (unlikely(ret < 0)) {
+               printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
+                      HP680_BTN_IRQ);
+               return ret;
+       }
+
+       apm_get_power_status = hp6x0_apm_get_power_status;
+
+       return ret;
+}
+
+static void __exit hp6x0_apm_exit(void)
+{
+       free_irq(HP680_BTN_IRQ, 0);
+}
+
+module_init(hp6x0_apm_init);
+module_exit(hp6x0_apm_exit);
+
+MODULE_AUTHOR("Adriy Skulysh");
+MODULE_DESCRIPTION("hp6xx Advanced Power Management");
+MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
new file mode 100644 (file)
index 0000000..e96684d
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * hp6x0 Power Management Routines
+ *
+ * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License.
+ */
+#include <linux/init.h>
+#include <linux/suspend.h>
+#include <linux/errno.h>
+#include <linux/time.h>
+#include <asm/io.h>
+#include <asm/hd64461.h>
+#include <asm/hp6xx.h>
+#include <cpu/dac.h>
+#include <asm/pm.h>
+
+#define STBCR          0xffffff82
+#define STBCR2         0xffffff88
+
+static int hp6x0_pm_enter(suspend_state_t state)
+{
+       u8 stbcr, stbcr2;
+#ifdef CONFIG_HD64461_ENABLER
+       u8 scr;
+       u16 hd64461_stbcr;
+#endif
+
+#ifdef CONFIG_HD64461_ENABLER
+       outb(0, HD64461_PCC1CSCIER);
+
+       scr = inb(HD64461_PCC1SCR);
+       scr |= HD64461_PCCSCR_VCC1;
+       outb(scr, HD64461_PCC1SCR);
+
+       hd64461_stbcr = inw(HD64461_STBCR);
+       hd64461_stbcr |= HD64461_STBCR_SPC1ST;
+       outw(hd64461_stbcr, HD64461_STBCR);
+#endif
+
+       ctrl_outb(0x1f, DACR);
+
+       stbcr = ctrl_inb(STBCR);
+       ctrl_outb(0x01, STBCR);
+
+       stbcr2 = ctrl_inb(STBCR2);
+       ctrl_outb(0x7f , STBCR2);
+
+       outw(0xf07f, HD64461_SCPUCR);
+
+       pm_enter();
+
+       outw(0, HD64461_SCPUCR);
+       ctrl_outb(stbcr, STBCR);
+       ctrl_outb(stbcr2, STBCR2);
+
+#ifdef CONFIG_HD64461_ENABLER
+       hd64461_stbcr = inw(HD64461_STBCR);
+       hd64461_stbcr &= ~HD64461_STBCR_SPC1ST;
+       outw(hd64461_stbcr, HD64461_STBCR);
+
+       outb(0x4c, HD64461_PCC1CSCIER);
+       outb(0x00, HD64461_PCC1CSCR);
+#endif
+
+       return 0;
+}
+
+static struct platform_suspend_ops hp6x0_pm_ops = {
+       .enter          = hp6x0_pm_enter,
+       .valid          = suspend_valid_only_mem,
+};
+
+static int __init hp6x0_pm_init(void)
+{
+       suspend_set_ops(&hp6x0_pm_ops);
+       return 0;
+}
+
+late_initcall(hp6x0_pm_init);
diff --git a/arch/sh/boards/mach-hp6xx/pm_wakeup.S b/arch/sh/boards/mach-hp6xx/pm_wakeup.S
new file mode 100644 (file)
index 0000000..44b648c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <cpu/mmu_context.h>
+
+#define k0     r0
+#define k1     r1
+#define k2     r2
+#define k3     r3
+#define k4     r4
+
+/*
+ * Kernel mode register usage:
+ *     k0      scratch
+ *     k1      scratch
+ *     k2      scratch (Exception code)
+ *     k3      scratch (Return address)
+ *     k4      scratch
+ *     k5      reserved
+ *     k6      Global Interrupt Mask (0--15 << 4)
+ *     k7      CURRENT_THREAD_INFO (pointer to current thread info)
+ */
+
+ENTRY(wakeup_start)
+! clear STBY bit
+       mov     #-126, k2
+       and     #127, k0
+       mov.b   k0, @k2
+! enable refresh
+       mov.l   5f, k1
+       mov.w   6f, k0
+       mov.w   k0, @k1
+! jump to handler
+       mov.l   2f, k2
+       mov.l   3f, k3
+       mov.l   @k2, k2
+
+       mov.l   4f, k1
+       jmp     @k1
+       nop
+
+       .align  2
+1:     .long   EXPEVT
+2:     .long   INTEVT
+3:     .long   ret_from_irq
+4:     .long   handle_exception
+5:     .long   0xffffff68
+6:     .word   0x0524
+
+ENTRY(wakeup_end)
+       nop
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
new file mode 100644 (file)
index 0000000..475b46c
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * linux/arch/sh/boards/hp6xx/setup.c
+ *
+ * Copyright (C) 2002 Andriy Skulysh
+ * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Setup code for HP620/HP660/HP680/HP690 (internal peripherials only)
+ */
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/hd64461.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/hp6xx.h>
+#include <cpu/dac.h>
+
+#define        SCPCR   0xa4000116
+#define        SCPDR   0xa4000136
+
+/* CF Slot */
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start = 0x15000000 + 0x1f0,
+               .end   = 0x15000000 + 0x1f0 + 0x08 - 0x01,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = 0x15000000 + 0x1fe,
+               .end   = 0x15000000 + 0x1fe + 0x01,
+               .flags = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start = 77,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device = {
+       .name           =  "pata_platform",
+       .id             =  -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device jornadakbd_device = {
+       .name           = "jornada680_kbd",
+       .id             = -1,
+};
+
+static struct platform_device *hp6xx_devices[] __initdata = {
+       &cf_ide_device,
+       &jornadakbd_device,
+};
+
+static void __init hp6xx_init_irq(void)
+{
+       /* Gets touchscreen and powerbutton IRQ working */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static int __init hp6xx_devices_setup(void)
+{
+       return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices));
+}
+
+static void __init hp6xx_setup(char **cmdline_p)
+{
+       u8 v8;
+       u16 v;
+
+       v = inw(HD64461_STBCR);
+       v |=    HD64461_STBCR_SURTST | HD64461_STBCR_SIRST      |
+               HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST     |
+               HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST     |
+               HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST|
+               HD64461_STBCR_SAFECKE_IST;
+#ifndef CONFIG_HD64461_ENABLER
+       v |= HD64461_STBCR_SPC1ST;
+#endif
+       outw(v, HD64461_STBCR);
+       v = inw(HD64461_GPADR);
+       v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
+       outw(v, HD64461_GPADR);
+
+       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
+
+#ifndef CONFIG_HD64461_ENABLER
+       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
+#endif
+
+       sh_dac_output(0, DAC_SPEAKER_VOLUME);
+       sh_dac_disable(DAC_SPEAKER_VOLUME);
+       v8 = ctrl_inb(DACR);
+       v8 &= ~DACR_DAE;
+       ctrl_outb(v8,DACR);
+
+       v8 = ctrl_inb(SCPDR);
+       v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
+       v8 &= ~SCPDR_TS_SCAN_ENABLE;
+       ctrl_outb(v8, SCPDR);
+
+       v = ctrl_inw(SCPCR);
+       v &= ~SCPCR_TS_MASK;
+       v |= SCPCR_TS_ENABLE;
+       ctrl_outw(v, SCPCR);
+}
+device_initcall(hp6xx_devices_setup);
+
+static struct sh_machine_vector mv_hp6xx __initmv = {
+       .mv_name = "hp6xx",
+       .mv_setup = hp6xx_setup,
+       /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
+       .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
+       .mv_irq_demux = hd64461_irq_demux,
+       /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
+       .mv_init_irq = hp6xx_init_irq,
+};
diff --git a/arch/sh/boards/mach-landisk/Makefile b/arch/sh/boards/mach-landisk/Makefile
new file mode 100644 (file)
index 0000000..a696b42
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
+#
+
+obj-y   := setup.o irq.o psw.o gio.o
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c
new file mode 100644 (file)
index 0000000..25cdf73
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * arch/sh/boards/landisk/gio.c - driver for landisk
+ *
+ * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
+ * LANDISK and USL-5P Button, LED and GIO driver drive function.
+ *
+ *   Copylight (C) 2006 kogiidena
+ *   Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
+ *
+ * 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.
+ *
+ */
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/smp_lock.h>
+#include <linux/kdev_t.h>
+#include <linux/cdev.h>
+#include <linux/fs.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <mach-landisk/mach/gio.h>
+#include <mach-landisk/mach/iodata_landisk.h>
+
+#define DEVCOUNT                4
+#define GIO_MINOR              2       /* GIO minor no. */
+
+static dev_t dev;
+static struct cdev *cdev_p;
+static int openCnt;
+
+static int gio_open(struct inode *inode, struct file *filp)
+{
+       int minor;
+       int ret = -ENOENT;
+
+       lock_kernel();
+       minor = MINOR(inode->i_rdev);
+       if (minor < DEVCOUNT) {
+               if (openCnt > 0) {
+                       ret = -EALREADY;
+               } else {
+                       openCnt++;
+                       ret = 0;
+               }
+       }
+       unlock_kernel();
+       return ret;
+}
+
+static int gio_close(struct inode *inode, struct file *filp)
+{
+       int minor;
+
+       minor = MINOR(inode->i_rdev);
+       if (minor < DEVCOUNT) {
+               openCnt--;
+       }
+       return 0;
+}
+
+static int gio_ioctl(struct inode *inode, struct file *filp,
+                            unsigned int cmd, unsigned long arg)
+{
+       unsigned int data;
+       static unsigned int addr = 0;
+
+       if (cmd & 0x01) {       /* write */
+               if (copy_from_user(&data, (int *)arg, sizeof(int))) {
+                       return -EFAULT;
+               }
+       }
+
+       switch (cmd) {
+       case GIODRV_IOCSGIOSETADDR:     /* address set */
+               addr = data;
+               break;
+
+       case GIODRV_IOCSGIODATA1:       /* write byte */
+               ctrl_outb((unsigned char)(0x0ff & data), addr);
+               break;
+
+       case GIODRV_IOCSGIODATA2:       /* write word */
+               if (addr & 0x01) {
+                       return -EFAULT;
+               }
+               ctrl_outw((unsigned short int)(0x0ffff & data), addr);
+               break;
+
+       case GIODRV_IOCSGIODATA4:       /* write long */
+               if (addr & 0x03) {
+                       return -EFAULT;
+               }
+               ctrl_outl(data, addr);
+               break;
+
+       case GIODRV_IOCGGIODATA1:       /* read byte */
+               data = ctrl_inb(addr);
+               break;
+
+       case GIODRV_IOCGGIODATA2:       /* read word */
+               if (addr & 0x01) {
+                       return -EFAULT;
+               }
+               data = ctrl_inw(addr);
+               break;
+
+       case GIODRV_IOCGGIODATA4:       /* read long */
+               if (addr & 0x03) {
+                       return -EFAULT;
+               }
+               data = ctrl_inl(addr);
+               break;
+       default:
+               return -EFAULT;
+               break;
+       }
+
+       if ((cmd & 0x01) == 0) {        /* read */
+               if (copy_to_user((int *)arg, &data, sizeof(int))) {
+                       return -EFAULT;
+               }
+       }
+       return 0;
+}
+
+static const struct file_operations gio_fops = {
+       .owner = THIS_MODULE,
+       .open = gio_open,       /* open */
+       .release = gio_close,   /* release */
+       .ioctl = gio_ioctl,     /* ioctl */
+};
+
+static int __init gio_init(void)
+{
+       int error;
+
+       printk(KERN_INFO "gio: driver initialized\n");
+
+       openCnt = 0;
+
+       if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
+               printk(KERN_ERR
+                      "gio: Couldn't alloc_chrdev_region, error=%d\n",
+                      error);
+               return 1;
+       }
+
+       cdev_p = cdev_alloc();
+       cdev_p->ops = &gio_fops;
+       error = cdev_add(cdev_p, dev, DEVCOUNT);
+       if (error) {
+               printk(KERN_ERR
+                      "gio: Couldn't cdev_add, error=%d\n", error);
+               return 1;
+       }
+
+       return 0;
+}
+
+static void __exit gio_exit(void)
+{
+       cdev_del(cdev_p);
+       unregister_chrdev_region(dev, DEVCOUNT);
+}
+
+module_init(gio_init);
+module_exit(gio_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c
new file mode 100644 (file)
index 0000000..7b284cd
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * arch/sh/boards/landisk/irq.c
+ *
+ * I-O DATA Device, Inc. LANDISK Support
+ *
+ * Copyright (C) 2005-2007 kogiidena
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <mach-landisk/mach/iodata_landisk.h>
+
+static void disable_landisk_irq(unsigned int irq)
+{
+       unsigned char mask = 0xff ^ (0x01 << (irq - 5));
+
+       ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
+}
+
+static void enable_landisk_irq(unsigned int irq)
+{
+       unsigned char value = (0x01 << (irq - 5));
+
+       ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
+}
+
+static struct irq_chip landisk_irq_chip __read_mostly = {
+       .name           = "LANDISK",
+       .mask           = disable_landisk_irq,
+       .unmask         = enable_landisk_irq,
+       .mask_ack       = disable_landisk_irq,
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_landisk_IRQ(void)
+{
+       int i;
+
+       for (i = 5; i < 14; i++) {
+               disable_irq_nosync(i);
+               set_irq_chip_and_handler_name(i, &landisk_irq_chip,
+                                             handle_level_irq, "level");
+               enable_landisk_irq(i);
+       }
+       ctrl_outb(0x00, PA_PWRINT_CLR);
+}
diff --git a/arch/sh/boards/mach-landisk/psw.c b/arch/sh/boards/mach-landisk/psw.c
new file mode 100644 (file)
index 0000000..e6b0efa
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * arch/sh/boards/landisk/psw.c
+ *
+ * push switch support for LANDISK and USL-5P
+ *
+ * Copyright (C) 2006-2007  Paul Mundt
+ * Copyright (C) 2007  kogiidena
+ *
+ * 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.
+ */
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <mach-landisk/mach/iodata_landisk.h>
+#include <asm/push-switch.h>
+
+static irqreturn_t psw_irq_handler(int irq, void *arg)
+{
+       struct platform_device *pdev = arg;
+       struct push_switch *psw = platform_get_drvdata(pdev);
+       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
+       unsigned int sw_value;
+       int ret = 0;
+
+       sw_value = (0x0ff & (~ctrl_inb(PA_STATUS)));
+
+       /* Nothing to do if there's no state change */
+       if (psw->state) {
+               ret = 1;
+               goto out;
+       }
+
+       /* Figure out who raised it */
+       if (sw_value & (1 << psw_info->bit)) {
+               psw->state = 1;
+               mod_timer(&psw->debounce, jiffies + 50);
+               ret = 1;
+       }
+
+out:
+       /* Clear the switch IRQs */
+       ctrl_outb(0x00, PA_PWRINT_CLR);
+
+       return IRQ_RETVAL(ret);
+}
+
+static struct resource psw_power_resources[] = {
+       [0] = {
+               .start = IRQ_POWER,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct resource psw_usl5p_resources[] = {
+       [0] = {
+               .start = IRQ_BUTTON,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct push_switch_platform_info psw_power_platform_data = {
+       .name           = "psw_power",
+       .bit            = 4,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw1_platform_data = {
+       .name           = "psw1",
+       .bit            = 0,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw2_platform_data = {
+       .name           = "psw2",
+       .bit            = 2,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw3_platform_data = {
+       .name           = "psw3",
+       .bit            = 1,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device psw_power_switch_device = {
+       .name           = "push-switch",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(psw_power_resources),
+       .resource       = psw_power_resources,
+       .dev            = {
+               .platform_data = &psw_power_platform_data,
+       },
+};
+
+static struct platform_device psw1_switch_device = {
+       .name           = "push-switch",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev            = {
+               .platform_data = &psw1_platform_data,
+       },
+};
+
+static struct platform_device psw2_switch_device = {
+       .name           = "push-switch",
+       .id             = 2,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev            = {
+               .platform_data = &psw2_platform_data,
+       },
+};
+
+static struct platform_device psw3_switch_device = {
+       .name           = "push-switch",
+       .id             = 3,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev = {
+               .platform_data = &psw3_platform_data,
+       },
+};
+
+static struct platform_device *psw_devices[] = {
+       &psw_power_switch_device,
+       &psw1_switch_device,
+       &psw2_switch_device,
+       &psw3_switch_device,
+};
+
+static int __init psw_init(void)
+{
+       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
+}
+module_init(psw_init);
diff --git a/arch/sh/boards/mach-landisk/setup.c b/arch/sh/boards/mach-landisk/setup.c
new file mode 100644 (file)
index 0000000..db22ea2
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * arch/sh/boards/landisk/setup.c
+ *
+ * I-O DATA Device, Inc. LANDISK Support.
+ *
+ * Copyright (C) 2000 Kazumoto Kojima
+ * Copyright (C) 2002 Paul Mundt
+ * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2005-2007 kogiidena
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/pm.h>
+#include <linux/mm.h>
+#include <asm/machvec.h>
+#include <mach-landisk/mach/iodata_landisk.h>
+#include <asm/io.h>
+
+void init_landisk_IRQ(void);
+
+static void landisk_power_off(void)
+{
+        ctrl_outb(0x01, PA_SHUTDOWN);
+}
+
+static struct resource cf_ide_resources[3];
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev            = {
+               .platform_data = &pata_info,
+       },
+};
+
+static struct platform_device rtc_device = {
+       .name           = "rs5c313",
+       .id             = -1,
+};
+
+static struct platform_device *landisk_devices[] __initdata = {
+       &cf_ide_device,
+       &rtc_device,
+};
+
+static int __init landisk_devices_setup(void)
+{
+       pgprot_t prot;
+       unsigned long paddrbase;
+       void *cf_ide_base;
+
+       /* open I/O area window */
+       paddrbase = virt_to_phys((void *)PA_AREA5_IO);
+       prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
+       cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
+       if (!cf_ide_base) {
+               printk("allocate_cf_area : can't open CF I/O window!\n");
+               return -ENOMEM;
+       }
+
+       /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
+       cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
+       cf_ide_resources[0].end   = (unsigned long)cf_ide_base + 0x40 + 0x0f;
+       cf_ide_resources[0].flags = IORESOURCE_IO;
+       cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
+       cf_ide_resources[1].end   = (unsigned long)cf_ide_base + 0x2c + 0x03;
+       cf_ide_resources[1].flags = IORESOURCE_IO;
+       cf_ide_resources[2].start = IRQ_FATA;
+       cf_ide_resources[2].flags = IORESOURCE_IRQ;
+
+       return platform_add_devices(landisk_devices,
+                                   ARRAY_SIZE(landisk_devices));
+}
+
+__initcall(landisk_devices_setup);
+
+static void __init landisk_setup(char **cmdline_p)
+{
+        /* LED ON */
+       ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED);
+
+       printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
+       pm_power_off = landisk_power_off;
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_landisk __initmv = {
+       .mv_name = "LANDISK",
+       .mv_nr_irqs = 72,
+       .mv_setup = landisk_setup,
+       .mv_init_irq = init_landisk_IRQ,
+};
diff --git a/arch/sh/boards/mach-lboxre2/Makefile b/arch/sh/boards/mach-lboxre2/Makefile
new file mode 100644 (file)
index 0000000..e9ed140
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the L-BOX RE2 specific parts of the kernel
+# Copyright (c) 2007 Nobuhiro Iwamatsu
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-lboxre2/irq.c b/arch/sh/boards/mach-lboxre2/irq.c
new file mode 100644 (file)
index 0000000..5a1c3bb
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/arch/sh/boards/lboxre2/irq.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * NTT COMWARE L-BOX RE2 Support.
+ *
+ * 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.
+ *
+ */
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/lboxre2.h>
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_lboxre2_IRQ(void)
+{
+       make_imask_irq(IRQ_CF1);
+       make_imask_irq(IRQ_CF0);
+       make_imask_irq(IRQ_INTD);
+       make_imask_irq(IRQ_ETH1);
+       make_imask_irq(IRQ_ETH0);
+       make_imask_irq(IRQ_INTA);
+}
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
new file mode 100644 (file)
index 0000000..c74440d
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * linux/arch/sh/boards/lbox/setup.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * NTT COMWARE L-BOX RE2 Support
+ *
+ * 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.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <asm/machvec.h>
+#include <asm/addrspace.h>
+#include <asm/lboxre2.h>
+#include <asm/io.h>
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = 0x1f0,
+               .end    = 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = 0x1f0 + 0x206,
+               .end    = 0x1f0 +8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = IRQ_CF0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device *lboxre2_devices[] __initdata = {
+       &cf_ide_device,
+};
+
+static int __init lboxre2_devices_setup(void)
+{
+       u32 cf0_io_base;        /* Boot CF base address */
+       pgprot_t prot;
+       unsigned long paddrbase, psize;
+
+       /* open I/O area window */
+       paddrbase = virt_to_phys((void*)PA_AREA5_IO);
+       psize = PAGE_SIZE;
+       prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16);
+       cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot);
+       if (!cf0_io_base) {
+               printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
+               return -ENOMEM;
+       }
+
+       cf_ide_resources[0].start += cf0_io_base ;
+       cf_ide_resources[0].end   += cf0_io_base ;
+       cf_ide_resources[1].start += cf0_io_base ;
+       cf_ide_resources[1].end   += cf0_io_base ;
+
+       return platform_add_devices(lboxre2_devices,
+                       ARRAY_SIZE(lboxre2_devices));
+
+}
+device_initcall(lboxre2_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_lboxre2 __initmv = {
+       .mv_name                = "L-BOX RE2",
+       .mv_nr_irqs             = 72,
+       .mv_init_irq            = init_lboxre2_IRQ,
+};
diff --git a/arch/sh/boards/mach-microdev/Makefile b/arch/sh/boards/mach-microdev/Makefile
new file mode 100644 (file)
index 0000000..1387dd6
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Makefile for the SuperH MicroDev specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o io.o
+
+obj-$(CONFIG_HEARTBEAT)        += led.o
+
diff --git a/arch/sh/boards/mach-microdev/io.c b/arch/sh/boards/mach-microdev/io.c
new file mode 100644 (file)
index 0000000..9f8a540
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * linux/arch/sh/boards/superh/microdev/io.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ * Copyright (C) 2003, 2004 SuperH, Inc.
+ * Copyright (C) 2004 Paul Mundt
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/wait.h>
+#include <asm/io.h>
+#include <asm/microdev.h>
+
+       /*
+        *      we need to have a 'safe' address to re-direct all I/O requests
+        *      that we do not explicitly wish to handle. This safe address
+        *      must have the following properies:
+        *
+        *              * writes are ignored (no exception)
+        *              * reads are benign (no side-effects)
+        *              * accesses of width 1, 2 and 4-bytes are all valid.
+        *
+        *      The Processor Version Register (PVR) has these properties.
+        */
+#define        PVR     0xff000030      /* Processor Version Register */
+
+
+#define        IO_IDE2_BASE            0x170ul /* I/O base for SMSC FDC37C93xAPM IDE #2 */
+#define        IO_IDE1_BASE            0x1f0ul /* I/O base for SMSC FDC37C93xAPM IDE #1 */
+#define IO_ISP1161_BASE                0x290ul /* I/O port for Philips ISP1161x USB chip */
+#define IO_SERIAL2_BASE                0x2f8ul /* I/O base for SMSC FDC37C93xAPM Serial #2 */
+#define        IO_LAN91C111_BASE       0x300ul /* I/O base for SMSC LAN91C111 Ethernet chip */
+#define        IO_IDE2_MISC            0x376ul /* I/O misc for SMSC FDC37C93xAPM IDE #2 */
+#define IO_SUPERIO_BASE                0x3f0ul /* I/O base for SMSC FDC37C93xAPM SuperIO chip */
+#define        IO_IDE1_MISC            0x3f6ul /* I/O misc for SMSC FDC37C93xAPM IDE #1 */
+#define IO_SERIAL1_BASE                0x3f8ul /* I/O base for SMSC FDC37C93xAPM Serial #1 */
+
+#define        IO_ISP1161_EXTENT       0x04ul  /* I/O extent for Philips ISP1161x USB chip */
+#define        IO_LAN91C111_EXTENT     0x10ul  /* I/O extent for SMSC LAN91C111 Ethernet chip */
+#define        IO_SUPERIO_EXTENT       0x02ul  /* I/O extent for SMSC FDC37C93xAPM SuperIO chip */
+#define        IO_IDE_EXTENT           0x08ul  /* I/O extent for IDE Task Register set */
+#define IO_SERIAL_EXTENT       0x10ul
+
+#define        IO_LAN91C111_PHYS       0xa7500000ul    /* Physical address of SMSC LAN91C111 Ethernet chip */
+#define        IO_ISP1161_PHYS         0xa7700000ul    /* Physical address of Philips ISP1161x USB chip */
+#define        IO_SUPERIO_PHYS         0xa7800000ul    /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
+
+/*
+ * map I/O ports to memory-mapped addresses
+ */
+static unsigned long microdev_isa_port2addr(unsigned long offset)
+{
+       unsigned long result;
+
+       if ((offset >= IO_LAN91C111_BASE) &&
+           (offset <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
+                       /*
+                        *      SMSC LAN91C111 Ethernet chip
+                        */
+               result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
+       } else if ((offset >= IO_SUPERIO_BASE) &&
+                  (offset <  IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Configuration Registers
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+#if 0
+       } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
+                  offset == KBD_STATUS_REG) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+#endif
+       } else if (((offset >= IO_IDE1_BASE) &&
+                   (offset <  IO_IDE1_BASE + IO_IDE_EXTENT)) ||
+                   (offset == IO_IDE1_MISC)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      IDE #1
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if (((offset >= IO_IDE2_BASE) &&
+                   (offset <  IO_IDE2_BASE + IO_IDE_EXTENT)) ||
+                   (offset == IO_IDE2_MISC)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      IDE #2
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_SERIAL1_BASE) &&
+                  (offset <  IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Serial #1
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_SERIAL2_BASE) &&
+                  (offset <  IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Serial #2
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_ISP1161_BASE) &&
+                  (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
+                       /*
+                        *      Philips USB ISP1161x chip
+                        */
+               result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
+       } else {
+                       /*
+                        *      safe default.
+                        */
+               printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
+                      __func__, offset);
+               result = PVR;
+       }
+
+       return result;
+}
+
+#define PORT2ADDR(x) (microdev_isa_port2addr(x))
+
+static inline void delay(void)
+{
+#if defined(CONFIG_PCI)
+       /* System board present, just make a dummy SRAM access.  (CS0 will be
+          mapped to PCI memory, probably good to avoid it.) */
+       ctrl_inw(0xa6800000);
+#else
+       /* CS0 will be mapped to flash, ROM etc so safe to access it. */
+       ctrl_inw(0xa0000000);
+#endif
+}
+
+unsigned char microdev_inb(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inb(port);
+#endif
+       return *(volatile unsigned char*)PORT2ADDR(port);
+}
+
+unsigned short microdev_inw(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inw(port);
+#endif
+       return *(volatile unsigned short*)PORT2ADDR(port);
+}
+
+unsigned int microdev_inl(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inl(port);
+#endif
+       return *(volatile unsigned int*)PORT2ADDR(port);
+}
+
+void microdev_outw(unsigned short b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outw(b, port);
+               return;
+       }
+#endif
+       *(volatile unsigned short*)PORT2ADDR(port) = b;
+}
+
+void microdev_outb(unsigned char b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outb(b, port);
+               return;
+       }
+#endif
+
+       /*
+        *      There is a board feature with the current SH4-202 MicroDev in
+        *      that the 2 byte enables (nBE0 and nBE1) are tied together (and
+        *      to the Chip Select Line (Ethernet_CS)). Due to this connectivity,
+        *      it is not possible to safely perform 8-bit writes to the
+        *      Ethernet registers, as 16-bits will be consumed from the Data
+        *      lines (corrupting the other byte).  Hence, this function is
+        *      written to implement 16-bit read/modify/write for all byte-wide
+        *      accesses.
+        *
+        *      Note: there is no problem with byte READS (even or odd).
+        *
+        *                      Sean McGoogan - 16th June 2003.
+        */
+       if ((port >= IO_LAN91C111_BASE) &&
+           (port <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
+                       /*
+                        * Then are trying to perform a byte-write to the
+                        * LAN91C111.  This needs special care.
+                        */
+               if (port % 2 == 1) {    /* is the port odd ? */
+                       /* unset bit-0, i.e. make even */
+                       const unsigned long evenPort = port-1;
+                       unsigned short word;
+
+                       /*
+                        * do a 16-bit read/write to write to 'port',
+                        * preserving even byte.
+                        *
+                        *      Even addresses are bits 0-7
+                        *      Odd  addresses are bits 8-15
+                        */
+                       word = microdev_inw(evenPort);
+                       word = (word & 0xffu) | (b << 8);
+                       microdev_outw(word, evenPort);
+               } else {
+                       /* else, we are trying to do an even byte write */
+                       unsigned short word;
+
+                       /*
+                        * do a 16-bit read/write to write to 'port',
+                        * preserving odd byte.
+                        *
+                        *      Even addresses are bits 0-7
+                        *      Odd  addresses are bits 8-15
+                        */
+                       word = microdev_inw(port);
+                       word = (word & 0xff00u) | (b);
+                       microdev_outw(word, port);
+               }
+       } else {
+               *(volatile unsigned char*)PORT2ADDR(port) = b;
+       }
+}
+
+void microdev_outl(unsigned int b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outl(b, port);
+               return;
+       }
+#endif
+       *(volatile unsigned int*)PORT2ADDR(port) = b;
+}
+
+unsigned char microdev_inb_p(unsigned long port)
+{
+       unsigned char v = microdev_inb(port);
+       delay();
+       return v;
+}
+
+unsigned short microdev_inw_p(unsigned long port)
+{
+       unsigned short v = microdev_inw(port);
+       delay();
+       return v;
+}
+
+unsigned int microdev_inl_p(unsigned long port)
+{
+       unsigned int v = microdev_inl(port);
+       delay();
+       return v;
+}
+
+void microdev_outb_p(unsigned char b, unsigned long port)
+{
+       microdev_outb(b, port);
+       delay();
+}
+
+void microdev_outw_p(unsigned short b, unsigned long port)
+{
+       microdev_outw(b, port);
+       delay();
+}
+
+void microdev_outl_p(unsigned int b, unsigned long port)
+{
+       microdev_outl(b, port);
+       delay();
+}
+
+void microdev_insb(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned char *port_addr;
+       unsigned char *buf = buffer;
+
+       port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_insw(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned short *port_addr;
+       unsigned short *buf = buffer;
+
+       port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_insl(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned long *port_addr;
+       unsigned int *buf = buffer;
+
+       port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_outsb(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned char *port_addr;
+       const unsigned char *buf = buffer;
+
+       port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
+
+void microdev_outsw(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned short *port_addr;
+       const unsigned short *buf = buffer;
+
+       port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
+
+void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned long *port_addr;
+       const unsigned int *buf = buffer;
+
+       port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
new file mode 100644 (file)
index 0000000..4d33507
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * arch/sh/boards/superh/microdev/irq.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/microdev.h>
+
+#define NUM_EXTERNAL_IRQS 16   /* IRL0 .. IRL15 */
+
+static const struct {
+       unsigned char fpgaIrq;
+       unsigned char mapped;
+       const char *name;
+} fpgaIrqTable[NUM_EXTERNAL_IRQS] = {
+       { 0,                            0,      "unused"   },           /* IRQ #0       IRL=15  0x200  */
+       { MICRODEV_FPGA_IRQ_KEYBOARD,   1,      "keyboard" },           /* IRQ #1       IRL=14  0x220  */
+       { MICRODEV_FPGA_IRQ_SERIAL1,    1,      "Serial #1"},           /* IRQ #2       IRL=13  0x240  */
+       { MICRODEV_FPGA_IRQ_ETHERNET,   1,      "Ethernet" },           /* IRQ #3       IRL=12  0x260  */
+       { MICRODEV_FPGA_IRQ_SERIAL2,    0,      "Serial #2"},           /* IRQ #4       IRL=11  0x280  */
+       { 0,                            0,      "unused"   },           /* IRQ #5       IRL=10  0x2a0  */
+       { 0,                            0,      "unused"   },           /* IRQ #6       IRL=9   0x2c0  */
+       { MICRODEV_FPGA_IRQ_USB_HC,     1,      "USB"      },           /* IRQ #7       IRL=8   0x2e0  */
+       { MICRODEV_IRQ_PCI_INTA,        1,      "PCI INTA" },           /* IRQ #8       IRL=7   0x300  */
+       { MICRODEV_IRQ_PCI_INTB,        1,      "PCI INTB" },           /* IRQ #9       IRL=6   0x320  */
+       { MICRODEV_IRQ_PCI_INTC,        1,      "PCI INTC" },           /* IRQ #10      IRL=5   0x340  */
+       { MICRODEV_IRQ_PCI_INTD,        1,      "PCI INTD" },           /* IRQ #11      IRL=4   0x360  */
+       { MICRODEV_FPGA_IRQ_MOUSE,      1,      "mouse"    },           /* IRQ #12      IRL=3   0x380  */
+       { MICRODEV_FPGA_IRQ_IDE2,       1,      "IDE #2"   },           /* IRQ #13      IRL=2   0x3a0  */
+       { MICRODEV_FPGA_IRQ_IDE1,       1,      "IDE #1"   },           /* IRQ #14      IRL=1   0x3c0  */
+       { 0,                            0,      "unused"   },           /* IRQ #15      IRL=0   0x3e0  */
+};
+
+#if (MICRODEV_LINUX_IRQ_KEYBOARD != 1)
+#  error Inconsistancy in defining the IRQ# for Keyboard!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_ETHERNET != 3)
+#  error Inconsistancy in defining the IRQ# for Ethernet!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_USB_HC != 7)
+#  error Inconsistancy in defining the IRQ# for USB!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_MOUSE != 12)
+#  error Inconsistancy in defining the IRQ# for PS/2 Mouse!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_IDE2 != 13)
+#  error Inconsistancy in defining the IRQ# for secondary IDE!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_IDE1 != 14)
+#  error Inconsistancy in defining the IRQ# for primary IDE!
+#endif
+
+static void enable_microdev_irq(unsigned int irq);
+static void disable_microdev_irq(unsigned int irq);
+
+       /* shutdown is same as "disable" */
+#define shutdown_microdev_irq disable_microdev_irq
+
+static void mask_and_ack_microdev(unsigned int);
+static void end_microdev_irq(unsigned int irq);
+
+static unsigned int startup_microdev_irq(unsigned int irq)
+{
+       enable_microdev_irq(irq);
+       return 0;               /* never anything pending */
+}
+
+static struct hw_interrupt_type microdev_irq_type = {
+       .typename = "MicroDev-IRQ",
+       .startup = startup_microdev_irq,
+       .shutdown = shutdown_microdev_irq,
+       .enable = enable_microdev_irq,
+       .disable = disable_microdev_irq,
+       .ack = mask_and_ack_microdev,
+       .end = end_microdev_irq
+};
+
+static void disable_microdev_irq(unsigned int irq)
+{
+       unsigned int fpgaIrq;
+
+       if (irq >= NUM_EXTERNAL_IRQS)
+               return;
+       if (!fpgaIrqTable[irq].mapped)
+               return;
+
+       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
+
+       /* disable interrupts on the FPGA INTC register */
+       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
+}
+
+static void enable_microdev_irq(unsigned int irq)
+{
+       unsigned long priorityReg, priorities, pri;
+       unsigned int fpgaIrq;
+
+       if (unlikely(irq >= NUM_EXTERNAL_IRQS))
+               return;
+       if (unlikely(!fpgaIrqTable[irq].mapped))
+               return;
+
+       pri = 15 - irq;
+
+       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
+       priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
+
+       /* set priority for the interrupt */
+       priorities = ctrl_inl(priorityReg);
+       priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
+       priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
+       ctrl_outl(priorities, priorityReg);
+
+       /* enable interrupts on the FPGA INTC register */
+       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
+}
+
+       /* This functions sets the desired irq handler to be a MicroDev type */
+static void __init make_microdev_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       irq_desc[irq].chip = &microdev_irq_type;
+       disable_microdev_irq(irq);
+}
+
+static void mask_and_ack_microdev(unsigned int irq)
+{
+       disable_microdev_irq(irq);
+}
+
+static void end_microdev_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_microdev_irq(irq);
+}
+
+extern void __init init_microdev_irq(void)
+{
+       int i;
+
+               /* disable interrupts on the FPGA INTC register */
+       ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG);
+
+       for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
+               make_microdev_irq(i);
+}
+
+extern void microdev_print_fpga_intc_status(void)
+{
+       volatile unsigned int * const intenb = (unsigned int*)MICRODEV_FPGA_INTENB_REG;
+       volatile unsigned int * const intdsb = (unsigned int*)MICRODEV_FPGA_INTDSB_REG;
+       volatile unsigned int * const intpria = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(0);
+       volatile unsigned int * const intprib = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(8);
+       volatile unsigned int * const intpric = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(16);
+       volatile unsigned int * const intprid = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(24);
+       volatile unsigned int * const intsrc = (unsigned int*)MICRODEV_FPGA_INTSRC_REG;
+       volatile unsigned int * const intreq = (unsigned int*)MICRODEV_FPGA_INTREQ_REG;
+
+       printk("-------------------------- microdev_print_fpga_intc_status() ------------------\n");
+       printk("FPGA_INTENB = 0x%08x\n", *intenb);
+       printk("FPGA_INTDSB = 0x%08x\n", *intdsb);
+       printk("FPGA_INTSRC = 0x%08x\n", *intsrc);
+       printk("FPGA_INTREQ = 0x%08x\n", *intreq);
+       printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria);
+       printk("-------------------------------------------------------------------------------\n");
+}
+
+
diff --git a/arch/sh/boards/mach-microdev/led.c b/arch/sh/boards/mach-microdev/led.c
new file mode 100644 (file)
index 0000000..36e54b4
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * linux/arch/sh/boards/superh/microdev/led.c
+ *
+ * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
+ * Copyright (C) 2003 Richard Curnow (Richard.Curnow@superh.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ */
+
+#include <asm/io.h>
+
+#define LED_REGISTER 0xa6104d20
+
+static void mach_led_d9(int value)
+{
+       unsigned long reg;
+       reg = ctrl_inl(LED_REGISTER);
+       reg &= ~1;
+       reg |= (value & 1);
+       ctrl_outl(reg, LED_REGISTER);
+       return;
+}
+
+static void mach_led_d10(int value)
+{
+       unsigned long reg;
+       reg = ctrl_inl(LED_REGISTER);
+       reg &= ~2;
+       reg |= ((value & 1) << 1);
+       ctrl_outl(reg, LED_REGISTER);
+       return;
+}
+
+
+#ifdef CONFIG_HEARTBEAT
+#include <linux/sched.h>
+
+static unsigned char banner_table[] = {
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x13, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x07,
+       0x13, 0x01, 0x13, 0x03,
+       0x11, 0x01, 0x11, 0x03,
+       0x13, 0x01, 0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x13, 0x01, 0x13, 0x01, 0x13, 0x03,
+       0x13, 0x01, 0x11, 0x01, 0x11, 0x03,
+       0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x13, 0x07,
+       0xff
+};
+
+static void banner(void)
+{
+       static int pos = 0;
+       static int count = 0;
+
+       if (count) {
+               count--;
+       } else {
+               int val = banner_table[pos];
+               if (val == 0xff) {
+                       pos = 0;
+                       val = banner_table[pos];
+               }
+               pos++;
+               mach_led_d10((val >> 4) & 1);
+               count = 10 * (val & 0xf);
+       }
+}
+
+/* From heartbeat_harp in the stboards directory */
+/* acts like an actual heart beat -- ie thump-thump-pause... */
+void microdev_heartbeat(void)
+{
+       static unsigned cnt = 0, period = 0, dist = 0;
+
+       if (cnt == 0 || cnt == dist)
+               mach_led_d9(1);
+       else if (cnt == 7 || cnt == dist+7)
+               mach_led_d9(0);
+
+       if (++cnt > period) {
+               cnt = 0;
+               /* The hyperbolic function below modifies the heartbeat period
+                * length in dependency of the current (5min) load. It goes
+                * through the points f(0)=126, f(1)=86, f(5)=51,
+                * f(inf)->30. */
+               period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
+               dist = period / 4;
+       }
+
+       banner();
+}
+
+#endif
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c
new file mode 100644 (file)
index 0000000..fc8cd06
--- /dev/null
@@ -0,0 +1,405 @@
+/*
+ * arch/sh/boards/superh/microdev/setup.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ * Copyright (C) 2003, 2004 SuperH, Inc.
+ * Copyright (C) 2004, 2005 Paul Mundt
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ioport.h>
+#include <video/s1d13xxxfb.h>
+#include <asm/microdev.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+
+extern void microdev_heartbeat(void);
+
+
+/****************************************************************************/
+
+
+       /*
+        * Setup for the SMSC FDC37C93xAPM
+        */
+#define SMSC_CONFIG_PORT_ADDR   (0x3F0)
+#define SMSC_INDEX_PORT_ADDR    SMSC_CONFIG_PORT_ADDR
+#define SMSC_DATA_PORT_ADDR     (SMSC_INDEX_PORT_ADDR + 1)
+
+#define SMSC_ENTER_CONFIG_KEY   0x55
+#define SMSC_EXIT_CONFIG_KEY    0xaa
+
+#define SMCS_LOGICAL_DEV_INDEX          0x07   /* Logical Device Number */
+#define SMSC_DEVICE_ID_INDEX    0x20   /* Device ID */
+#define SMSC_DEVICE_REV_INDEX   0x21   /* Device Revision */
+#define SMSC_ACTIVATE_INDEX     0x30   /* Activate */
+#define SMSC_PRIMARY_BASE_INDEX         0x60   /* Primary Base Address */
+#define SMSC_SECONDARY_BASE_INDEX 0x62 /* Secondary Base Address */
+#define SMSC_PRIMARY_INT_INDEX  0x70   /* Primary Interrupt Select */
+#define SMSC_SECONDARY_INT_INDEX 0x72  /* Secondary Interrupt Select */
+#define SMSC_HDCS0_INDEX        0xf0   /* HDCS0 Address Decoder */
+#define SMSC_HDCS1_INDEX        0xf1   /* HDCS1 Address Decoder */
+
+#define SMSC_IDE1_DEVICE       1       /* IDE #1 logical device */
+#define SMSC_IDE2_DEVICE       2       /* IDE #2 logical device */
+#define SMSC_PARALLEL_DEVICE   3       /* Parallel Port logical device */
+#define SMSC_SERIAL1_DEVICE    4       /* Serial #1 logical device */
+#define SMSC_SERIAL2_DEVICE    5       /* Serial #2 logical device */
+#define SMSC_KEYBOARD_DEVICE   7       /* Keyboard logical device */
+#define SMSC_CONFIG_REGISTERS  8       /* Configuration Registers (Aux I/O) */
+
+#define SMSC_READ_INDEXED(index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       inb(SMSC_DATA_PORT_ADDR); })
+#define SMSC_WRITE_INDEXED(val, index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       outb((val),   SMSC_DATA_PORT_ADDR); })
+
+#define        IDE1_PRIMARY_BASE       0x01f0  /* Task File Registe base for IDE #1 */
+#define        IDE1_SECONDARY_BASE     0x03f6  /* Miscellaneous AT registers for IDE #1 */
+#define        IDE2_PRIMARY_BASE       0x0170  /* Task File Registe base for IDE #2 */
+#define        IDE2_SECONDARY_BASE     0x0376  /* Miscellaneous AT registers for IDE #2 */
+
+#define SERIAL1_PRIMARY_BASE   0x03f8
+#define SERIAL2_PRIMARY_BASE   0x02f8
+
+#define        MSB(x)          ( (x) >> 8 )
+#define        LSB(x)          ( (x) & 0xff )
+
+       /* General-Purpose base address on CPU-board FPGA */
+#define        MICRODEV_FPGA_GP_BASE           0xa6100000ul
+
+       /* assume a Keyboard Controller is present */
+int microdev_kbd_controller_present = 1;
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start          = 0x300,
+               .end            = 0x300 + 0x0001000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = MICRODEV_LINUX_IRQ_ETHERNET,
+               .end            = MICRODEV_LINUX_IRQ_ETHERNET,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+#ifdef CONFIG_FB_S1D13XXX
+static struct s1d13xxxfb_regval s1d13806_initregs[] = {
+       { S1DREG_MISC,                  0x00 },
+       { S1DREG_COM_DISP_MODE,         0x00 },
+       { S1DREG_GPIO_CNF0,             0x00 },
+       { S1DREG_GPIO_CNF1,             0x00 },
+       { S1DREG_GPIO_CTL0,             0x00 },
+       { S1DREG_GPIO_CTL1,             0x00 },
+       { S1DREG_CLK_CNF,               0x02 },
+       { S1DREG_LCD_CLK_CNF,           0x01 },
+       { S1DREG_CRT_CLK_CNF,           0x03 },
+       { S1DREG_MPLUG_CLK_CNF,         0x03 },
+       { S1DREG_CPU2MEM_WST_SEL,       0x02 },
+       { S1DREG_SDRAM_REF_RATE,        0x03 },
+       { S1DREG_SDRAM_TC0,             0x00 },
+       { S1DREG_SDRAM_TC1,             0x01 },
+       { S1DREG_MEM_CNF,               0x80 },
+       { S1DREG_PANEL_TYPE,            0x25 },
+       { S1DREG_MOD_RATE,              0x00 },
+       { S1DREG_LCD_DISP_HWIDTH,       0x63 },
+       { S1DREG_LCD_NDISP_HPER,        0x1e },
+       { S1DREG_TFT_FPLINE_START,      0x06 },
+       { S1DREG_TFT_FPLINE_PWIDTH,     0x03 },
+       { S1DREG_LCD_DISP_VHEIGHT0,     0x57 },
+       { S1DREG_LCD_DISP_VHEIGHT1,     0x02 },
+       { S1DREG_LCD_NDISP_VPER,        0x00 },
+       { S1DREG_TFT_FPFRAME_START,     0x0a },
+       { S1DREG_TFT_FPFRAME_PWIDTH,    0x81 },
+       { S1DREG_LCD_DISP_MODE,         0x03 },
+       { S1DREG_LCD_MISC,              0x00 },
+       { S1DREG_LCD_DISP_START0,       0x00 },
+       { S1DREG_LCD_DISP_START1,       0x00 },
+       { S1DREG_LCD_DISP_START2,       0x00 },
+       { S1DREG_LCD_MEM_OFF0,          0x90 },
+       { S1DREG_LCD_MEM_OFF1,          0x01 },
+       { S1DREG_LCD_PIX_PAN,           0x00 },
+       { S1DREG_LCD_DISP_FIFO_HTC,     0x00 },
+       { S1DREG_LCD_DISP_FIFO_LTC,     0x00 },
+       { S1DREG_CRT_DISP_HWIDTH,       0x63 },
+       { S1DREG_CRT_NDISP_HPER,        0x1f },
+       { S1DREG_CRT_HRTC_START,        0x04 },
+       { S1DREG_CRT_HRTC_PWIDTH,       0x8f },
+       { S1DREG_CRT_DISP_VHEIGHT0,     0x57 },
+       { S1DREG_CRT_DISP_VHEIGHT1,     0x02 },
+       { S1DREG_CRT_NDISP_VPER,        0x1b },
+       { S1DREG_CRT_VRTC_START,        0x00 },
+       { S1DREG_CRT_VRTC_PWIDTH,       0x83 },
+       { S1DREG_TV_OUT_CTL,            0x10 },
+       { S1DREG_CRT_DISP_MODE,         0x05 },
+       { S1DREG_CRT_DISP_START0,       0x00 },
+       { S1DREG_CRT_DISP_START1,       0x00 },
+       { S1DREG_CRT_DISP_START2,       0x00 },
+       { S1DREG_CRT_MEM_OFF0,          0x20 },
+       { S1DREG_CRT_MEM_OFF1,          0x03 },
+       { S1DREG_CRT_PIX_PAN,           0x00 },
+       { S1DREG_CRT_DISP_FIFO_HTC,     0x00 },
+       { S1DREG_CRT_DISP_FIFO_LTC,     0x00 },
+       { S1DREG_LCD_CUR_CTL,           0x00 },
+       { S1DREG_LCD_CUR_START,         0x01 },
+       { S1DREG_LCD_CUR_XPOS0,         0x00 },
+       { S1DREG_LCD_CUR_XPOS1,         0x00 },
+       { S1DREG_LCD_CUR_YPOS0,         0x00 },
+       { S1DREG_LCD_CUR_YPOS1,         0x00 },
+       { S1DREG_LCD_CUR_BCTL0,         0x00 },
+       { S1DREG_LCD_CUR_GCTL0,         0x00 },
+       { S1DREG_LCD_CUR_RCTL0,         0x00 },
+       { S1DREG_LCD_CUR_BCTL1,         0x1f },
+       { S1DREG_LCD_CUR_GCTL1,         0x3f },
+       { S1DREG_LCD_CUR_RCTL1,         0x1f },
+       { S1DREG_LCD_CUR_FIFO_HTC,      0x00 },
+       { S1DREG_CRT_CUR_CTL,           0x00 },
+       { S1DREG_CRT_CUR_START,         0x01 },
+       { S1DREG_CRT_CUR_XPOS0,         0x00 },
+       { S1DREG_CRT_CUR_XPOS1,         0x00 },
+       { S1DREG_CRT_CUR_YPOS0,         0x00 },
+       { S1DREG_CRT_CUR_YPOS1,         0x00 },
+       { S1DREG_CRT_CUR_BCTL0,         0x00 },
+       { S1DREG_CRT_CUR_GCTL0,         0x00 },
+       { S1DREG_CRT_CUR_RCTL0,         0x00 },
+       { S1DREG_CRT_CUR_BCTL1,         0x1f },
+       { S1DREG_CRT_CUR_GCTL1,         0x3f },
+       { S1DREG_CRT_CUR_RCTL1,         0x1f },
+       { S1DREG_CRT_CUR_FIFO_HTC,      0x00 },
+       { S1DREG_BBLT_CTL0,             0x00 },
+       { S1DREG_BBLT_CTL1,             0x00 },
+       { S1DREG_BBLT_CC_EXP,           0x00 },
+       { S1DREG_BBLT_OP,               0x00 },
+       { S1DREG_BBLT_SRC_START0,       0x00 },
+       { S1DREG_BBLT_SRC_START1,       0x00 },
+       { S1DREG_BBLT_SRC_START2,       0x00 },
+       { S1DREG_BBLT_DST_START0,       0x00 },
+       { S1DREG_BBLT_DST_START1,       0x00 },
+       { S1DREG_BBLT_DST_START2,       0x00 },
+       { S1DREG_BBLT_MEM_OFF0,         0x00 },
+       { S1DREG_BBLT_MEM_OFF1,         0x00 },
+       { S1DREG_BBLT_WIDTH0,           0x00 },
+       { S1DREG_BBLT_WIDTH1,           0x00 },
+       { S1DREG_BBLT_HEIGHT0,          0x00 },
+       { S1DREG_BBLT_HEIGHT1,          0x00 },
+       { S1DREG_BBLT_BGC0,             0x00 },
+       { S1DREG_BBLT_BGC1,             0x00 },
+       { S1DREG_BBLT_FGC0,             0x00 },
+       { S1DREG_BBLT_FGC1,             0x00 },
+       { S1DREG_LKUP_MODE,             0x00 },
+       { S1DREG_LKUP_ADDR,             0x00 },
+       { S1DREG_PS_CNF,                0x10 },
+       { S1DREG_PS_STATUS,             0x00 },
+       { S1DREG_CPU2MEM_WDOGT,         0x00 },
+       { S1DREG_COM_DISP_MODE,         0x02 },
+};
+
+static struct s1d13xxxfb_pdata s1d13806_platform_data = {
+       .initregs       = s1d13806_initregs,
+       .initregssize   = ARRAY_SIZE(s1d13806_initregs),
+};
+
+static struct resource s1d13806_resources[] = {
+       [0] = {
+               .start          = 0x07200000,
+               .end            = 0x07200000 + 0x00200000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 0x07000000,
+               .end            = 0x07000000 + 0x00200000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device s1d13806_device = {
+       .name           = "s1d13806fb",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(s1d13806_resources),
+       .resource       = s1d13806_resources,
+
+       .dev = {
+               .platform_data  = &s1d13806_platform_data,
+       },
+};
+#endif
+
+static struct platform_device *microdev_devices[] __initdata = {
+       &smc91x_device,
+#ifdef CONFIG_FB_S1D13XXX
+       &s1d13806_device,
+#endif
+};
+
+static int __init microdev_devices_setup(void)
+{
+       return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
+}
+
+/*
+ * Setup for the SMSC FDC37C93xAPM
+ */
+static int __init smsc_superio_setup(void)
+{
+
+       unsigned char devid, devrev;
+
+               /* Initially the chip is in run state */
+               /* Put it into configuration state */
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+               /* Read device ID info */
+       devid  = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
+       devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
+       if ( (devid==0x30) && (devrev==0x01) )
+       {
+               printk("SMSC FDC37C93xAPM SuperIO device detected\n");
+       }
+       else
+       {               /* not the device identity we expected */
+               printk("Not detected a SMSC FDC37C93xAPM SuperIO device (devid=0x%02x, rev=0x%02x)\n",
+                       devid, devrev);
+                       /* inform the keyboard driver that we have no keyboard controller */
+               microdev_kbd_controller_present = 0;
+                       /* little point in doing anything else in this functon */
+               return 0;
+       }
+
+               /* Select the keyboard device */
+       SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_KEYBOARD, SMSC_PRIMARY_INT_INDEX);
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_MOUSE, SMSC_SECONDARY_INT_INDEX);
+
+               /* Select the Serial #1 device */
+       SMSC_WRITE_INDEXED(SMSC_SERIAL1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL1, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the Serial #2 device */
+       SMSC_WRITE_INDEXED(SMSC_SERIAL2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL2, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the IDE#1 device */
+       SMSC_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(MSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x0c, SMSC_HDCS0_INDEX);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS1_INDEX);
+               /* select the interrupt */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE1, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the IDE#2 device */
+       SMSC_WRITE_INDEXED(SMSC_IDE2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(MSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
+               /* select the interrupt */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE2, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the configuration registers */
+       SMSC_WRITE_INDEXED(SMSC_CONFIG_REGISTERS, SMCS_LOGICAL_DEV_INDEX);
+               /* enable the appropriate GPIO pins for IDE functionality:
+                * bit[0]   In/Out              1==input;  0==output
+                * bit[1]   Polarity            1==invert; 0==no invert
+                * bit[2]   Int Enb #1          1==Enable Combined IRQ #1; 0==disable
+                * bit[3:4] Function Select     00==original; 01==Alternate Function #1
+                */
+       SMSC_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
+       SMSC_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
+       SMSC_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
+       SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
+       SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
+
+               /* Exit the configuration state */
+       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       return 0;
+}
+
+static void __init microdev_setup(char **cmdline_p)
+{
+       int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
+       const int fpgaRevision = *fpgaRevisionRegister;
+       int * const CacheControlRegister = (int*)CCR;
+
+       device_initcall(microdev_devices_setup);
+       device_initcall(smsc_superio_setup);
+
+       printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
+               get_system_type(), fpgaRevision, *CacheControlRegister);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_sh4202_microdev __initmv = {
+       .mv_name                = "SH4-202 MicroDev",
+       .mv_setup               = microdev_setup,
+       .mv_nr_irqs             = 72,           /* QQQ need to check this - use the MACRO */
+
+       .mv_inb                 = microdev_inb,
+       .mv_inw                 = microdev_inw,
+       .mv_inl                 = microdev_inl,
+       .mv_outb                = microdev_outb,
+       .mv_outw                = microdev_outw,
+       .mv_outl                = microdev_outl,
+
+       .mv_inb_p               = microdev_inb_p,
+       .mv_inw_p               = microdev_inw_p,
+       .mv_inl_p               = microdev_inl_p,
+       .mv_outb_p              = microdev_outb_p,
+       .mv_outw_p              = microdev_outw_p,
+       .mv_outl_p              = microdev_outl_p,
+
+       .mv_insb                = microdev_insb,
+       .mv_insw                = microdev_insw,
+       .mv_insl                = microdev_insl,
+       .mv_outsb               = microdev_outsb,
+       .mv_outsw               = microdev_outsw,
+       .mv_outsl               = microdev_outsl,
+
+       .mv_init_irq            = init_microdev_irq,
+
+#ifdef CONFIG_HEARTBEAT
+       .mv_heartbeat           = microdev_heartbeat,
+#endif
+};
diff --git a/arch/sh/boards/mach-migor/Kconfig b/arch/sh/boards/mach-migor/Kconfig
new file mode 100644 (file)
index 0000000..a7b3b72
--- /dev/null
@@ -0,0 +1,15 @@
+if SH_MIGOR
+
+choice
+       prompt "Migo-R LCD Panel Board Selection"
+       default SH_MIGOR_QVGA
+
+config SH_MIGOR_QVGA
+       bool "QVGA (320x240)"
+
+config SH_MIGOR_RTA_WVGA
+       bool "RTA WVGA (800x480)"
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-migor/Makefile b/arch/sh/boards/mach-migor/Makefile
new file mode 100644 (file)
index 0000000..5f231dd
--- /dev/null
@@ -0,0 +1,2 @@
+obj-y   := setup.o
+obj-$(CONFIG_SH_MIGOR_QVGA)    +=  lcd_qvga.o
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
new file mode 100644 (file)
index 0000000..6e96095
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Support for SuperH MigoR Quarter VGA LCD Panel
+ *
+ * Copyright (C) 2008 Magnus Damm
+ *
+ * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd.
+ * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>,
+ *
+ * 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.
+ */
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/migor.h>
+
+/* LCD Module is a PH240320T according to board schematics. This module
+ * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
+ * Driver IC. This IC is connected to the SH7722 built-in LCDC using a
+ * SYS-80 interface configured in 16 bit mode.
+ *
+ * Index 0: "Device Code Read" returns 0x1505.
+ */
+
+static void reset_lcd_module(void)
+{
+       ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR);
+       mdelay(2);
+       ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR);
+       mdelay(1);
+}
+
+/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */
+
+static unsigned long adjust_reg18(unsigned short data)
+{
+       unsigned long tmp1, tmp2;
+
+       tmp1 = (data<<1 | 0x00000001) & 0x000001FF;
+       tmp2 = (data<<2 | 0x00000200) & 0x0003FE00;
+       return tmp1 | tmp2;
+}
+
+static void write_reg(void *sys_ops_handle,
+                      struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                      unsigned short reg, unsigned short data)
+{
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data));
+}
+
+static void write_reg16(void *sys_ops_handle,
+                       struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                       unsigned short reg, unsigned short data)
+{
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
+       sys_ops->write_data(sys_ops_handle, adjust_reg18(data));
+}
+
+static unsigned long read_reg16(void *sys_ops_handle,
+                               struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                               unsigned short reg)
+{
+       unsigned long data;
+
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
+       data = sys_ops->read_data(sys_ops_handle);
+       return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00);
+}
+
+static void migor_lcd_qvga_seq(void *sys_ops_handle,
+                              struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                              unsigned short const *data, int no_data)
+{
+       int i;
+
+       for (i = 0; i < no_data; i += 2)
+               write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]);
+}
+
+static const unsigned short sync_data[] = {
+       0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+
+static const unsigned short magic0_data[] = {
+       0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001,
+       0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116,
+       0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8,
+};
+
+static const unsigned short magic1_data[] = {
+       0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202,
+       0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303,
+       0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102,
+       0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300,
+       0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000,
+       0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000,
+       0x0015, 0x8000,
+};
+
+static const unsigned short magic2_data[] = {
+       0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021,
+};
+
+static const unsigned short magic3_data[] = {
+       0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
+};
+
+int migor_lcd_qvga_setup(void *board_data, void *sohandle,
+                        struct sh_mobile_lcdc_sys_bus_ops *so)
+{
+       unsigned long xres = 320;
+       unsigned long yres = 240;
+       int k;
+
+       reset_lcd_module();
+       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
+
+       if (read_reg16(sohandle, so, 0) != 0x1505)
+               return -ENODEV;
+
+       pr_info("Migo-R QVGA LCD Module detected.\n");
+
+       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
+       write_reg16(sohandle, so, 0x00A4, 0x0001);
+       mdelay(10);
+
+       migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data));
+       mdelay(100);
+
+       migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data));
+       write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1));
+       write_reg16(sohandle, so, 0x0051, 0x00ef);
+       write_reg16(sohandle, so, 0x0052, 0x0000);
+       write_reg16(sohandle, so, 0x0053, xres - 1);
+
+       migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data));
+       mdelay(10);
+
+       migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data));
+       mdelay(40);
+
+       /* clear GRAM to avoid displaying garbage */
+
+       write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */
+       write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */
+
+       for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */
+               write_reg16(sohandle, so, 0x0022, 0x0000);
+
+       write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */
+       write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */
+       write_reg16(sohandle, so, 0x0007, 0x0173);
+       mdelay(40);
+
+       /* enable display */
+       write_reg(sohandle, so, 0x00, 0x22);
+       mdelay(100);
+       return 0;
+}
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
new file mode 100644 (file)
index 0000000..e499ee3
--- /dev/null
@@ -0,0 +1,527 @@
+/*
+ * Renesas System Solutions Asia Pte. Ltd - Migo-R
+ *
+ * Copyright (C) 2008 Magnus Damm
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/nand.h>
+#include <linux/i2c.h>
+#include <linux/smc91x.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <media/soc_camera_platform.h>
+#include <media/sh_mobile_ceu.h>
+#include <asm/clock.h>
+#include <asm/machvec.h>
+#include <asm/io.h>
+#include <asm/sh_keysc.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/migor.h>
+
+/* Address     IRQ  Size  Bus  Description
+ * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
+ * 0x0c000000       64MB  64   SDRAM (2xK4M563233G)
+ * 0x10000000  IRQ0       16   Ethernet (SMC91C111)
+ * 0x14000000  IRQ4       16   USB 2.0 Host Controller (M66596)
+ * 0x18000000       8GB    8   NAND Flash (K9K8G08U0A)
+ */
+
+static struct smc91x_platdata smc91x_info = {
+       .flags = SMC91X_USE_16BIT,
+};
+
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "SMC91C111" ,
+               .start  = 0x10000300,
+               .end    = 0x1000030f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 32, /* IRQ0 */
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+       .dev    = {
+               .platform_data  = &smc91x_info,
+       },
+};
+
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = {
+               0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
+               0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
+               0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
+               0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
+               0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
+static struct mtd_partition migor_nor_flash_partitions[] =
+{
+       {
+               .name = "uboot",
+               .offset = 0,
+               .size = (1 * 1024 * 1024),
+               .mask_flags = MTD_WRITEABLE,    /* Read-only */
+       },
+       {
+               .name = "rootfs",
+               .offset = MTDPART_OFS_APPEND,
+               .size = (15 * 1024 * 1024),
+       },
+       {
+               .name = "other",
+               .offset = MTDPART_OFS_APPEND,
+               .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data migor_nor_flash_data = {
+       .width          = 2,
+       .parts          = migor_nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(migor_nor_flash_partitions),
+};
+
+static struct resource migor_nor_flash_resources[] = {
+       [0] = {
+               .name           = "NOR Flash",
+               .start          = 0x00000000,
+               .end            = 0x03ffffff,
+               .flags          = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device migor_nor_flash_device = {
+       .name           = "physmap-flash",
+       .resource       = migor_nor_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nor_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nor_flash_data,
+       },
+};
+
+static struct mtd_partition migor_nand_flash_partitions[] = {
+       {
+               .name           = "nanddata1",
+               .offset         = 0x0,
+               .size           = 512 * 1024 * 1024,
+       },
+       {
+               .name           = "nanddata2",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 512 * 1024 * 1024,
+       },
+};
+
+static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
+                                    unsigned int ctrl)
+{
+       struct nand_chip *chip = mtd->priv;
+
+       if (cmd == NAND_CMD_NONE)
+               return;
+
+       if (ctrl & NAND_CLE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00400000);
+       else if (ctrl & NAND_ALE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00800000);
+       else
+               writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int migor_nand_flash_ready(struct mtd_info *mtd)
+{
+       return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
+}
+
+struct platform_nand_data migor_nand_flash_data = {
+       .chip = {
+               .nr_chips = 1,
+               .partitions = migor_nand_flash_partitions,
+               .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
+               .chip_delay = 20,
+               .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
+       },
+       .ctrl = {
+               .dev_ready = migor_nand_flash_ready,
+               .cmd_ctrl = migor_nand_flash_cmd_ctl,
+       },
+};
+
+static struct resource migor_nand_flash_resources[] = {
+       [0] = {
+               .name           = "NAND Flash",
+               .start          = 0x18000000,
+               .end            = 0x18ffffff,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device migor_nand_flash_device = {
+       .name           = "gen_nand",
+       .resource       = migor_nand_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nand_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nand_flash_data,
+       }
+};
+
+static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
+#ifdef CONFIG_SH_MIGOR_RTA_WVGA
+       .clock_source = LCDC_CLK_BUS,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = RGB16,
+               .clock_divider = 2,
+               .lcd_cfg = {
+                       .name = "LB070WV1",
+                       .xres = 800,
+                       .yres = 480,
+                       .left_margin = 64,
+                       .right_margin = 16,
+                       .hsync_len = 120,
+                       .upper_margin = 1,
+                       .lower_margin = 17,
+                       .vsync_len = 2,
+                       .sync = 0,
+               },
+       }
+#endif
+#ifdef CONFIG_SH_MIGOR_QVGA
+       .clock_source = LCDC_CLK_PERIPHERAL,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = SYS16A,
+               .clock_divider = 10,
+               .lcd_cfg = {
+                       .name = "PH240320T",
+                       .xres = 320,
+                       .yres = 240,
+                       .left_margin = 0,
+                       .right_margin = 16,
+                       .hsync_len = 8,
+                       .upper_margin = 1,
+                       .lower_margin = 17,
+                       .vsync_len = 2,
+                       .sync = FB_SYNC_HOR_HIGH_ACT,
+               },
+               .board_cfg = {
+                       .setup_sys = migor_lcd_qvga_setup,
+               },
+               .sys_bus_cfg = {
+                       .ldmt2r = 0x06000a09,
+                       .ldmt3r = 0x180e3418,
+               },
+       }
+#endif
+};
+
+static struct resource migor_lcdc_resources[] = {
+       [0] = {
+               .name   = "LCDC",
+               .start  = 0xfe940000, /* P4-only space */
+               .end    = 0xfe941fff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device migor_lcdc_device = {
+       .name           = "sh_mobile_lcdc_fb",
+       .num_resources  = ARRAY_SIZE(migor_lcdc_resources),
+       .resource       = migor_lcdc_resources,
+       .dev    = {
+               .platform_data  = &sh_mobile_lcdc_info,
+       },
+};
+
+static struct clk *camera_clk;
+
+static void camera_power_on(void)
+{
+       unsigned char value;
+
+       camera_clk = clk_get(NULL, "video_clk");
+       clk_set_rate(camera_clk, 24000000);
+       clk_enable(camera_clk); /* start VIO_CKO */
+
+       mdelay(10);
+       value = ctrl_inb(PORT_PTDR);
+       value &= ~0x09;
+#ifndef CONFIG_SH_MIGOR_RTA_WVGA
+       value |= 0x01;
+#endif
+       ctrl_outb(value, PORT_PTDR);
+       mdelay(10);
+
+       ctrl_outb(value | 8, PORT_PTDR);
+}
+
+static void camera_power_off(void)
+{
+       clk_disable(camera_clk); /* stop VIO_CKO */
+       clk_put(camera_clk);
+
+       ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR);
+}
+
+#ifdef CONFIG_I2C
+static unsigned char camera_ov772x_magic[] =
+{
+       0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
+       0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
+       0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
+       0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
+       0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0,
+       0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00,
+       0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00,
+       0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2,
+       0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80,
+       0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00,
+       0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50,
+       0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60,
+       0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a,
+       0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f,
+       0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00,
+       0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01,
+       0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f,
+       0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f,
+       0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70,
+       0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e,
+       0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69,
+       0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f,
+       0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4,
+       0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00,
+       0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f,
+       0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08,
+       0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e,
+       0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02,
+       0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06,
+       0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40,
+       0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff,
+       0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f,
+       0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50,
+       0x2c, 0x78,
+};
+
+static int ov772x_set_capture(struct soc_camera_platform_info *info,
+                             int enable)
+{
+       struct i2c_adapter *a = i2c_get_adapter(0);
+       struct i2c_msg msg;
+       int ret = 0;
+       int i;
+
+       if (!enable)
+               return 0; /* camera_power_off() is enough */
+
+       for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) {
+               u_int8_t buf[8];
+
+               msg.addr = 0x21;
+               msg.buf = buf;
+               msg.len = 2;
+               msg.flags = 0;
+
+               buf[0] = camera_ov772x_magic[i];
+               buf[1] = camera_ov772x_magic[i + 1];
+
+               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
+       }
+
+       return ret;
+}
+
+static struct soc_camera_platform_info ov772x_info = {
+       .iface = 0,
+       .format_name = "RGB565",
+       .format_depth = 16,
+       .format = {
+               .pixelformat = V4L2_PIX_FMT_RGB565,
+               .colorspace = V4L2_COLORSPACE_SRGB,
+               .width = 320,
+               .height = 240,
+       },
+       .bus_param =  SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+       .set_capture = ov772x_set_capture,
+};
+
+static struct platform_device migor_camera_device = {
+       .name           = "soc_camera_platform",
+       .dev    = {
+               .platform_data  = &ov772x_info,
+       },
+};
+#endif /* CONFIG_I2C */
+
+static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
+       .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
+       | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
+       .enable_camera = camera_power_on,
+       .disable_camera = camera_power_off,
+};
+
+static struct resource migor_ceu_resources[] = {
+       [0] = {
+               .name   = "CEU",
+               .start  = 0xfe910000,
+               .end    = 0xfe91009f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 52,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               /* place holder for contiguous memory */
+       },
+};
+
+static struct platform_device migor_ceu_device = {
+       .name           = "sh_mobile_ceu",
+       .num_resources  = ARRAY_SIZE(migor_ceu_resources),
+       .resource       = migor_ceu_resources,
+       .dev    = {
+               .platform_data  = &sh_mobile_ceu_info,
+       },
+};
+
+static struct platform_device *migor_devices[] __initdata = {
+       &smc91x_eth_device,
+       &sh_keysc_device,
+       &migor_lcdc_device,
+       &migor_ceu_device,
+#ifdef CONFIG_I2C
+       &migor_camera_device,
+#endif
+       &migor_nor_flash_device,
+       &migor_nand_flash_device,
+};
+
+static struct i2c_board_info migor_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("rs5c372b", 0x32),
+       },
+       {
+               I2C_BOARD_INFO("migor_ts", 0x51),
+               .irq = 38, /* IRQ6 */
+       },
+};
+
+static int __init migor_devices_setup(void)
+{
+       clk_always_enable("mstp214"); /* KEYSC */
+       clk_always_enable("mstp200"); /* LCDC */
+       clk_always_enable("mstp203"); /* CEU */
+
+       platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
+
+       i2c_register_board_info(0, migor_i2c_devices,
+                               ARRAY_SIZE(migor_i2c_devices));
+       return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
+}
+__initcall(migor_devices_setup);
+
+static void __init migor_setup(char **cmdline_p)
+{
+       /* SMC91C111 - Enable IRQ0 */
+       ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
+
+       /* KEYSC */
+       ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
+
+       /* NAND Flash */
+       ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
+       ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
+                 BSC_CS6ABCR);
+
+       /* Touch Panel - Enable IRQ6 */
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
+       ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
+       ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
+
+#ifdef CONFIG_SH_MIGOR_RTA_WVGA
+       /* LCDC - WVGA - Enable RGB Interface signals */
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
+       ctrl_outw(0x0000, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR);
+       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
+#endif
+#ifdef CONFIG_SH_MIGOR_QVGA
+       /* LCDC - QVGA - Enable SYS Interface signals */
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
+       ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR);
+       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
+#endif
+
+       /* CEU */
+       ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR);
+       ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR);
+       ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR);
+       ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR);
+       ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC);
+       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB);
+}
+
+static struct sh_machine_vector mv_migor __initmv = {
+       .mv_name                = "Migo-R",
+       .mv_setup               = migor_setup,
+};
diff --git a/arch/sh/boards/mach-r2d/Kconfig b/arch/sh/boards/mach-r2d/Kconfig
new file mode 100644 (file)
index 0000000..8122a96
--- /dev/null
@@ -0,0 +1,23 @@
+if SH_RTS7751R2D
+
+menu "RTS7751R2D Board Revision"
+
+config RTS7751R2D_PLUS
+       bool "R2D-PLUS"
+       help
+         Selecting this option will configure the kernel for R2D-PLUS.
+
+         R2D-PLUS is the smaller of the two R2D board versions, equipped
+         with a single PCI slot.
+
+config RTS7751R2D_1
+       bool "R2D-1"
+       help
+         Selecting this option will configure the kernel for R2D-1.
+
+         R2D-1 is the larger of the two R2D board versions, equipped
+         with two PCI slots.
+endmenu
+
+endif
+
diff --git a/arch/sh/boards/mach-r2d/Makefile b/arch/sh/boards/mach-r2d/Makefile
new file mode 100644 (file)
index 0000000..0d4c75a
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the RTS7751R2D specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
new file mode 100644 (file)
index 0000000..8e49f6e
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
+ *
+ * Copyright (C) 2007  Magnus Damm
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1.
+ *
+ * Modified for RTS7751R2D by
+ * Atom Create Engineering Co., Ltd. 2002.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
+
+#define R2D_NR_IRL 13
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources (R2D-1 and R2D-PLUS) */
+       EXT,              /* EXT_INT0-3 */
+       RTC_T, RTC_A,     /* Real Time Clock */
+       AX88796,          /* Ethernet controller (R2D-1 board) */
+       KEY,              /* Key input (R2D-PLUS board) */
+       SDCARD,           /* SD Card */
+       CF_CD, CF_IDE,    /* CF Card Detect + CF IDE */
+       SM501,            /* SM501 aka Voyager */
+       PCI_INTD_RTL8139, /* Ethernet controller */
+       PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */
+       PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */
+       PCI_INTB_SLOT,    /* PCI Slot 3.3v (R2D-1 board) */
+       PCI_INTA_SLOT,    /* PCI Slot 3.3v */
+       TP,               /* Touch Panel */
+};
+
+#ifdef CONFIG_RTS7751R2D_1
+
+/* Vectors for R2D-1 */
+static struct intc_vect vectors_r2d_1[] __initdata = {
+       INTC_IRQ(EXT, IRQ_EXT),
+       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
+       INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD),
+       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */
+       INTC_IRQ(SM501, IRQ_VOYAGER),
+       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
+       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
+       INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB),
+       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
+       INTC_IRQ(TP, IRQ_TP),
+};
+
+/* IRLMSK mask register layout for R2D-1 */
+static struct intc_mask_reg mask_registers_r2d_1[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { TP, PCI_INTA_SLOT, PCI_INTB_SLOT,
+           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
+           SM501, CF_IDE, CF_CD, SDCARD, AX88796,
+           RTC_A, RTC_T, 0, 0, 0, EXT } },
+};
+
+/* IRLn to IRQ table for R2D-1 */
+static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = {
+       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
+       IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T,
+       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
+       IRQ_TP,
+};
+
+static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1,
+                        NULL, mask_registers_r2d_1, NULL, NULL);
+
+#endif /* CONFIG_RTS7751R2D_1 */
+
+#ifdef CONFIG_RTS7751R2D_PLUS
+
+/* Vectors for R2D-PLUS */
+static struct intc_vect vectors_r2d_plus[] __initdata = {
+       INTC_IRQ(EXT, IRQ_EXT),
+       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
+       INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD),
+       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE),
+       INTC_IRQ(SM501, IRQ_VOYAGER),
+       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
+       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
+       INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB),
+       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
+       INTC_IRQ(TP, IRQ_TP),
+};
+
+/* IRLMSK mask register layout for R2D-PLUS */
+static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139,
+           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
+           SM501, CF_IDE, CF_CD, SDCARD, KEY,
+           RTC_A, RTC_T, 0, 0, 0, EXT } },
+};
+
+/* IRLn to IRQ table for R2D-PLUS */
+static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = {
+       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
+       IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T,
+       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
+       IRQ_TP,
+};
+
+static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus,
+                        NULL, mask_registers_r2d_plus, NULL, NULL);
+
+#endif /* CONFIG_RTS7751R2D_PLUS */
+
+static unsigned char irl2irq[R2D_NR_IRL];
+
+int rts7751r2d_irq_demux(int irq)
+{
+       if (irq >= R2D_NR_IRL || !irl2irq[irq])
+               return irq;
+
+       return irl2irq[irq];
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_rts7751r2d_IRQ(void)
+{
+       struct intc_desc *d;
+
+       switch (ctrl_inw(PA_VERREG) & 0xf0) {
+#ifdef CONFIG_RTS7751R2D_PLUS
+       case 0x10:
+               printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
+               d = &intc_desc_r2d_plus;
+               memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL);
+               break;
+#endif
+#ifdef CONFIG_RTS7751R2D_1
+       case 0x00: /* according to manual */
+       case 0x30: /* in reality */
+               printk(KERN_INFO "Using R2D-1 interrupt controller.\n");
+               d = &intc_desc_r2d_1;
+               memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL);
+               break;
+#endif
+       default:
+               printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
+                      ctrl_inw(PA_VERREG));
+               return;
+       }
+
+       register_intc_controller(d);
+}
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
new file mode 100644 (file)
index 0000000..2308e87
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Renesas Technology Sales RTS7751R2D Support.
+ *
+ * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2004 - 2007 Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/sm501.h>
+#include <linux/sm501-regs.h>
+#include <linux/pm.h>
+#include <linux/fb.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+#include <asm/machvec.h>
+#include <asm/rts7751r2d.h>
+#include <asm/io.h>
+#include <asm/io_trapped.h>
+#include <asm/spi.h>
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_AREA5_IO + 0x1000,
+               .end    = PA_AREA5_IO + 0x1000 + 0x10 - 0x2,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_AREA5_IO + 0x80c,
+               .end    = PA_AREA5_IO + 0x80c,
+               .flags  = IORESOURCE_MEM,
+       },
+#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
+       [2] = {
+               .start  = IRQ_CF_IDE,
+               .flags  = IORESOURCE_IRQ,
+       },
+#endif
+};
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev    = {
+               .platform_data  = &pata_info,
+       },
+};
+
+static struct spi_board_info spi_bus[] = {
+       {
+               .modalias       = "rtc-r9701",
+               .max_speed_hz   = 1000000,
+               .mode           = SPI_MODE_3,
+       },
+};
+
+static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
+{
+       BUG_ON(cs != 0);  /* Single Epson RTC-9701JE attached on CS0 */
+       ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE);
+}
+
+static struct sh_spi_info spi_info = {
+       .num_chipselect = 1,
+       .chip_select = r2d_chip_select,
+};
+
+static struct resource spi_sh_sci_resources[] = {
+       {
+               .start  = 0xffe00000,
+               .end    = 0xffe0001f,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device spi_sh_sci_device  = {
+       .name           = "spi_sh_sci",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(spi_sh_sci_resources),
+       .resource       = spi_sh_sci_resources,
+       .dev    = {
+               .platform_data  = &spi_info,
+       },
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_OUTPORT,
+               .end    = PA_OUTPORT,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource sm501_resources[] = {
+       [0]     = {
+               .start  = 0x10000000,
+               .end    = 0x13e00000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1]     = {
+               .start  = 0x13e00000,
+               .end    = 0x13ffffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2]     = {
+               .start  = IRQ_VOYAGER,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct fb_videomode sm501_default_mode = {
+       .pixclock       = 35714,
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 105,
+       .right_margin   = 50,
+       .upper_margin   = 35,
+       .lower_margin   = 0,
+       .hsync_len      = 96,
+       .vsync_len      = 2,
+       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
+       .flags          = (SM501FB_FLAG_USE_INIT_MODE |
+                          SM501FB_FLAG_USE_HWCURSOR |
+                          SM501FB_FLAG_USE_HWACCEL |
+                          SM501FB_FLAG_DISABLE_AT_EXIT),
+
+};
+
+static struct sm501_platdata_fb sm501_fb_pdata = {
+       .fb_route       = SM501_FB_OWN,
+       .fb_crt         = &sm501_pdata_fbsub_crt,
+       .fb_pnl         = &sm501_pdata_fbsub_pnl,
+       .flags          = SM501_FBPD_SWAP_FB_ENDIAN,
+};
+
+static struct sm501_initdata sm501_initdata = {
+       .devices        = SM501_USE_USB_HOST | SM501_USE_UART0,
+};
+
+static struct sm501_platdata sm501_platform_data = {
+       .init           = &sm501_initdata,
+       .fb             = &sm501_fb_pdata,
+};
+
+static struct platform_device sm501_device = {
+       .name           = "sm501",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &sm501_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(sm501_resources),
+       .resource       = sm501_resources,
+};
+
+static struct platform_device *rts7751r2d_devices[] __initdata = {
+       &sm501_device,
+       &heartbeat_device,
+       &spi_sh_sci_device,
+};
+
+/*
+ * The CF is connected with a 16-bit bus where 8-bit operations are
+ * unsupported. The linux ata driver is however using 8-bit operations, so
+ * insert a trapped io filter to convert 8-bit operations into 16-bit.
+ */
+static struct trapped_io cf_trapped_io = {
+       .resource               = cf_ide_resources,
+       .num_resources          = 2,
+       .minimum_bus_width      = 16,
+};
+
+static int __init rts7751r2d_devices_setup(void)
+{
+       if (register_trapped_io(&cf_trapped_io) == 0)
+               platform_device_register(&cf_ide_device);
+
+       spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
+
+       return platform_add_devices(rts7751r2d_devices,
+                                   ARRAY_SIZE(rts7751r2d_devices));
+}
+__initcall(rts7751r2d_devices_setup);
+
+static void rts7751r2d_power_off(void)
+{
+       ctrl_outw(0x0001, PA_POWOFF);
+}
+
+/*
+ * Initialize the board
+ */
+static void __init rts7751r2d_setup(char **cmdline_p)
+{
+       void __iomem *sm501_reg;
+       u16 ver = ctrl_inw(PA_VERREG);
+
+       printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
+
+       printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
+                                       (ver >> 4) & 0xf, ver & 0xf);
+
+       ctrl_outw(0x0000, PA_OUTPORT);
+       pm_power_off = rts7751r2d_power_off;
+
+       /* sm501 dram configuration:
+        * ColSizeX = 11 - External Memory Column Size: 256 words.
+        * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
+        * RstX = 1 - External Memory Reset: Normal.
+        * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
+        * BwC =  1 - Local Memory Block Write Cycle Time: 2 clocks.
+        * BwP =  1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
+        * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
+        * Rst = 1 - Internal Memory Reset: Normal.
+        * RA = 1 - Internal Memory Remain in Active State: Do not remain.
+        */
+
+       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
+       writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_rts7751r2d __initmv = {
+       .mv_name                = "RTS7751R2D",
+       .mv_setup               = rts7751r2d_setup,
+       .mv_init_irq            = init_rts7751r2d_IRQ,
+       .mv_irq_demux           = rts7751r2d_irq_demux,
+};
diff --git a/arch/sh/boards/mach-sdk7780/Kconfig b/arch/sh/boards/mach-sdk7780/Kconfig
new file mode 100644 (file)
index 0000000..065f1df
--- /dev/null
@@ -0,0 +1,16 @@
+if SH_SDK7780
+
+choice
+       prompt "SDK7780 options"
+       default SH_SDK7780_BASE
+
+config SH_SDK7780_BASE
+       bool "SDK7780 with base-board support"
+       depends on CPU_SUBTYPE_SH7780
+       help
+         Selecting this option will enable support for the expansion
+         baseboard devices. If in doubt, say Y.
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-sdk7780/Makefile b/arch/sh/boards/mach-sdk7780/Makefile
new file mode 100644 (file)
index 0000000..3d8f0be
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the SDK7780 specific parts of the kernel
+#
+obj-y   := setup.o irq.o
+
diff --git a/arch/sh/boards/mach-sdk7780/irq.c b/arch/sh/boards/mach-sdk7780/irq.c
new file mode 100644 (file)
index 0000000..87cdc57
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * linux/arch/sh/boards/renesas/sdk7780/irq.c
+ *
+ * Renesas Technology Europe SDK7780 Support.
+ *
+ * Copyright (C) 2008  Nicholas Beck <nbeck@mpc-data.co.uk>
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/sdk7780.h>
+
+enum {
+       UNUSED = 0,
+       /* board specific interrupt sources */
+       SMC91C111,      /* Ethernet controller */
+};
+
+static struct intc_vect fpga_vectors[] __initdata = {
+       INTC_IRQ(SMC91C111, IRQ_ETHERNET),
+};
+
+static struct intc_mask_reg fpga_mask_registers[] __initdata = {
+       { 0, FPGA_IRQ0MR, 16,
+         { 0, 0, 0, 0, 0, 0, 0, 0,
+           0, 0, 0, SMC91C111, 0, 0, 0, 0 } },
+};
+
+static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors,
+                        NULL, fpga_mask_registers, NULL, NULL);
+
+void __init init_sdk7780_IRQ(void)
+{
+       printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
+
+       ctrl_outw(0xFFFF, FPGA_IRQ0MR);
+       /* Setup IRL 0-3 */
+       ctrl_outw(0x0003, FPGA_IMSR);
+       plat_irq_setup_pins(IRQ_MODE_IRL3210);
+
+       register_intc_controller(&fpga_intc_desc);
+}
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
new file mode 100644 (file)
index 0000000..acc5932
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * arch/sh/boards/renesas/sdk7780/setup.c
+ *
+ * Renesas Solutions SH7780 SDK Support
+ * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <asm/machvec.h>
+#include <asm/sdk7780.h>
+#include <asm/heartbeat.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+#define GPIO_PECR        0xFFEA0008
+
+//* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_ETHERNET,
+               .end    = IRQ_ETHERNET,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct platform_device *sdk7780_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+};
+
+static int __init sdk7780_devices_setup(void)
+{
+       return platform_add_devices(sdk7780_devices,
+               ARRAY_SIZE(sdk7780_devices));
+}
+device_initcall(sdk7780_devices_setup);
+
+static void __init sdk7780_setup(char **cmdline_p)
+{
+       u16 ver = ctrl_inw(FPGA_FPVERR);
+       u16 dateStamp = ctrl_inw(FPGA_FPDATER);
+
+       printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
+       printk(KERN_INFO "Board version: %d (revision %d), "
+                        "FPGA version: %d (revision %d), datestamp : %d\n",
+                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
+                        (ver >>  4) & 0xf, ver & 0xf,
+                        dateStamp);
+
+       /* Setup pin mux'ing for PCIC */
+       ctrl_outw(0x0000, GPIO_PECR);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7780 __initmv = {
+       .mv_name        = "Renesas SDK7780-R3" ,
+       .mv_setup               = sdk7780_setup,
+       .mv_nr_irqs             = 111,
+       .mv_init_irq    = init_sdk7780_IRQ,
+};
+
diff --git a/arch/sh/boards/mach-se/7206/Makefile b/arch/sh/boards/mach-se/7206/Makefile
new file mode 100644 (file)
index 0000000..63e7ed6
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 7206 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
new file mode 100644 (file)
index 0000000..9c3a332
--- /dev/null
@@ -0,0 +1,104 @@
+/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
+ *
+ * linux/arch/sh/boards/se/7206/io.c
+ *
+ * Copyright (C) 2006 Yoshinori Sato
+ *
+ * I/O routine for Hitachi 7206 SolutionEngine.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <mach-se/mach/se7206.h>
+
+
+static inline void delay(void)
+{
+       ctrl_inw(0x20000000);  /* P2 ROM Area */
+}
+
+/* MS7750 requires special versions of in*, out* routines, since
+   PC-like io ports are located at upper half byte of 16-bit word which
+   can be accessed only with 16-bit wide.  */
+
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port >= 0x2000 && port < 0x2020)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       else if (port >= 0x300 && port < 0x310)
+               return (volatile __u16 *) (PA_SMSC + (port - 0x300));
+
+       return (volatile __u16 *)port;
+}
+
+unsigned char se7206_inb(unsigned long port)
+{
+       return (*port2adr(port)) & 0xff;
+}
+
+unsigned char se7206_inb_p(unsigned long port)
+{
+       unsigned long v;
+
+       v = (*port2adr(port)) & 0xff;
+       delay();
+       return v;
+}
+
+unsigned short se7206_inw(unsigned long port)
+{
+       return *port2adr(port);;
+}
+
+void se7206_outb(unsigned char value, unsigned long port)
+{
+       *(port2adr(port)) = value;
+}
+
+void se7206_outb_p(unsigned char value, unsigned long port)
+{
+       *(port2adr(port)) = value;
+       delay();
+}
+
+void se7206_outw(unsigned short value, unsigned long port)
+{
+       *port2adr(port) = value;
+}
+
+void se7206_insb(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u8 *ap = addr;
+
+       while (count--)
+               *ap++ = *p;
+}
+
+void se7206_insw(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u16 *ap = addr;
+       while (count--)
+               *ap++ = *p;
+}
+
+void se7206_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u8 *ap = addr;
+
+       while (count--)
+               *p = *ap++;
+}
+
+void se7206_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u16 *ap = addr;
+       while (count--)
+               *p = *ap++;
+}
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c
new file mode 100644 (file)
index 0000000..aef7f05
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * linux/arch/sh/boards/se/7206/irq.c
+ *
+ * Copyright (C) 2005,2006 Yoshinori Sato
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <linux/interrupt.h>
+#include <mach-se/mach/se7206.h>
+
+#define INTSTS0 0x31800000
+#define INTSTS1 0x31800002
+#define INTMSK0 0x31800004
+#define INTMSK1 0x31800006
+#define INTSEL  0x31800008
+
+#define IRQ0_IRQ 64
+#define IRQ1_IRQ 65
+#define IRQ3_IRQ 67
+
+#define INTC_IPR01 0xfffe0818
+#define INTC_ICR1  0xfffe0802
+
+static void disable_se7206_irq(unsigned int irq)
+{
+       unsigned short val;
+       unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq)));
+       unsigned short msk0,msk1;
+
+       /* Set the priority in IPR to 0 */
+       val = ctrl_inw(INTC_IPR01);
+       val &= mask;
+       ctrl_outw(val, INTC_IPR01);
+       /* FPGA mask set */
+       msk0 = ctrl_inw(INTMSK0);
+       msk1 = ctrl_inw(INTMSK1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               msk0 |= 0x0010;
+               break;
+       case IRQ1_IRQ:
+               msk0 |= 0x000f;
+               break;
+       case IRQ3_IRQ:
+               msk0 |= 0x0f00;
+               msk1 |= 0x00ff;
+               break;
+       }
+       ctrl_outw(msk0, INTMSK0);
+       ctrl_outw(msk1, INTMSK1);
+}
+
+static void enable_se7206_irq(unsigned int irq)
+{
+       unsigned short val;
+       unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq)));
+       unsigned short msk0,msk1;
+
+       /* Set priority in IPR back to original value */
+       val = ctrl_inw(INTC_IPR01);
+       val |= value;
+       ctrl_outw(val, INTC_IPR01);
+
+       /* FPGA mask reset */
+       msk0 = ctrl_inw(INTMSK0);
+       msk1 = ctrl_inw(INTMSK1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               msk0 &= ~0x0010;
+               break;
+       case IRQ1_IRQ:
+               msk0 &= ~0x000f;
+               break;
+       case IRQ3_IRQ:
+               msk0 &= ~0x0f00;
+               msk1 &= ~0x00ff;
+               break;
+       }
+       ctrl_outw(msk0, INTMSK0);
+       ctrl_outw(msk1, INTMSK1);
+}
+
+static void eoi_se7206_irq(unsigned int irq)
+{
+       unsigned short sts0,sts1;
+
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_se7206_irq(irq);
+       /* FPGA isr clear */
+       sts0 = ctrl_inw(INTSTS0);
+       sts1 = ctrl_inw(INTSTS1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               sts0 &= ~0x0010;
+               break;
+       case IRQ1_IRQ:
+               sts0 &= ~0x000f;
+               break;
+       case IRQ3_IRQ:
+               sts0 &= ~0x0f00;
+               sts1 &= ~0x00ff;
+               break;
+       }
+       ctrl_outw(sts0, INTSTS0);
+       ctrl_outw(sts1, INTSTS1);
+}
+
+static struct irq_chip se7206_irq_chip __read_mostly = {
+       .name           = "SE7206-FPGA",
+       .mask           = disable_se7206_irq,
+       .unmask         = enable_se7206_irq,
+       .mask_ack       = disable_se7206_irq,
+       .eoi            = eoi_se7206_irq,
+};
+
+static void make_se7206_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       set_irq_chip_and_handler_name(irq, &se7206_irq_chip,
+                                     handle_level_irq, "level");
+       disable_se7206_irq(irq);
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7206_IRQ(void)
+{
+       make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
+       make_se7206_irq(IRQ1_IRQ); /* ATA */
+       make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
+       ctrl_outw(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */
+
+       /* FPGA System register setup*/
+       ctrl_outw(0x0000,INTSTS0); /* Clear INTSTS0 */
+       ctrl_outw(0x0000,INTSTS1); /* Clear INTSTS1 */
+       /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
+       ctrl_outw(0x0001,INTSEL);
+}
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
new file mode 100644 (file)
index 0000000..f546638
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ *
+ * linux/arch/sh/boards/se/7206/setup.c
+ *
+ * Copyright (C) 2006  Yoshinori Sato
+ * Copyright (C) 2007 - 2008  Paul Mundt
+ *
+ * Hitachi 7206 SolutionEngine Support.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/smc91x.h>
+#include <mach-se/mach/se7206.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+#include <asm/heartbeat.h>
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .name           = "smc91x-regs",
+               .start          = PA_SMSC + 0x300,
+               .end            = PA_SMSC + 0x300 + 0x020 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 64,
+               .end            = 64,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct smc91x_platdata smc91x_info = {
+       .flags  = SMC91X_USE_16BIT,
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .dev            = {
+               .dma_mask               = NULL,
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &smc91x_info,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 32,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *se7206_devices[] __initdata = {
+       &smc91x_device,
+       &heartbeat_device,
+};
+
+static int __init se7206_devices_setup(void)
+{
+       return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
+}
+__initcall(se7206_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_nr_irqs             = 256,
+       .mv_inb                 = se7206_inb,
+       .mv_inw                 = se7206_inw,
+       .mv_outb                = se7206_outb,
+       .mv_outw                = se7206_outw,
+
+       .mv_inb_p               = se7206_inb_p,
+       .mv_inw_p               = se7206_inw,
+       .mv_outb_p              = se7206_outb_p,
+       .mv_outw_p              = se7206_outw,
+
+       .mv_insb                = se7206_insb,
+       .mv_insw                = se7206_insw,
+       .mv_outsb               = se7206_outsb,
+       .mv_outsw               = se7206_outsw,
+
+       .mv_init_irq            = init_se7206_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7343/Makefile b/arch/sh/boards/mach-se/7343/Makefile
new file mode 100644 (file)
index 0000000..3024796
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 7343 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/7343/io.c b/arch/sh/boards/mach-se/7343/io.c
new file mode 100644 (file)
index 0000000..8741abc
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * arch/sh/boards/se/7343/io.c
+ *
+ * I/O routine for SH-Mobile3AS 7343 SolutionEngine.
+ *
+ */
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <mach-se/mach/se7343.h>
+
+#define badio(fn, a) panic("bad i/o operation %s for %08lx.", #fn, a)
+
+struct iop {
+       unsigned long start, end;
+       unsigned long base;
+       struct iop *(*check) (struct iop * p, unsigned long port);
+       unsigned char (*inb) (struct iop * p, unsigned long port);
+       unsigned short (*inw) (struct iop * p, unsigned long port);
+       void (*outb) (struct iop * p, unsigned char value, unsigned long port);
+       void (*outw) (struct iop * p, unsigned short value, unsigned long port);
+};
+
+struct iop *
+simple_check(struct iop *p, unsigned long port)
+{
+       static int count;
+
+       if (count < 100)
+               count++;
+
+       port &= 0xFFFF;
+
+       if ((p->start <= port) && (port <= p->end))
+               return p;
+       else
+               badio(check, port);
+}
+
+struct iop *
+ide_check(struct iop *p, unsigned long port)
+{
+       if (((0x1f0 <= port) && (port <= 0x1f7)) || (port == 0x3f7))
+               return p;
+       return NULL;
+}
+
+unsigned char
+simple_inb(struct iop *p, unsigned long port)
+{
+       return *(unsigned char *) (p->base + port);
+}
+
+unsigned short
+simple_inw(struct iop *p, unsigned long port)
+{
+       return *(unsigned short *) (p->base + port);
+}
+
+void
+simple_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       *(unsigned char *) (p->base + port) = value;
+}
+
+void
+simple_outw(struct iop *p, unsigned short value, unsigned long port)
+{
+       *(unsigned short *) (p->base + port) = value;
+}
+
+unsigned char
+pcc_inb(struct iop *p, unsigned long port)
+{
+       unsigned long addr = p->base + port + 0x40000;
+       unsigned long v;
+
+       if (port & 1)
+               addr += 0x00400000;
+       v = *(volatile unsigned char *) addr;
+       return v;
+}
+
+void
+pcc_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       unsigned long addr = p->base + port + 0x40000;
+
+       if (port & 1)
+               addr += 0x00400000;
+       *(volatile unsigned char *) addr = value;
+}
+
+unsigned char
+bad_inb(struct iop *p, unsigned long port)
+{
+       badio(inb, port);
+}
+
+void
+bad_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       badio(inw, port);
+}
+
+#ifdef CONFIG_SMC91X
+/* MSTLANEX01 LAN at 0xb400:0000 */
+static struct iop laniop = {
+       .start = 0x00,
+       .end = 0x0F,
+       .base = 0x04000000,
+       .check = simple_check,
+       .inb = simple_inb,
+       .inw = simple_inw,
+       .outb = simple_outb,
+       .outw = simple_outw,
+};
+#endif
+
+#ifdef CONFIG_NE2000
+/* NE2000 pc card NIC */
+static struct iop neiop = {
+       .start = 0x280,
+       .end = 0x29f,
+       .base = 0xb0600000 + 0x80,      /* soft 0x280 -> hard 0x300 */
+       .check = simple_check,
+       .inb = pcc_inb,
+       .inw = simple_inw,
+       .outb = pcc_outb,
+       .outw = simple_outw,
+};
+#endif
+
+#ifdef CONFIG_IDE
+/* CF in CF slot */
+static struct iop cfiop = {
+       .base = 0xb0600000,
+       .check = ide_check,
+       .inb = pcc_inb,
+       .inw = simple_inw,
+       .outb = pcc_outb,
+       .outw = simple_outw,
+};
+#endif
+
+static __inline__ struct iop *
+port2iop(unsigned long port)
+{
+       if (0) ;
+#if defined(CONFIG_SMC91X)
+       else if (laniop.check(&laniop, port))
+               return &laniop;
+#endif
+#if defined(CONFIG_NE2000)
+       else if (neiop.check(&neiop, port))
+               return &neiop;
+#endif
+#if defined(CONFIG_IDE)
+       else if (cfiop.check(&cfiop, port))
+               return &cfiop;
+#endif
+       else
+               return NULL;
+}
+
+static inline void
+delay(void)
+{
+       ctrl_inw(0xac000000);
+       ctrl_inw(0xac000000);
+}
+
+unsigned char
+sh7343se_inb(unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       return (p->inb) (p, port);
+}
+
+unsigned char
+sh7343se_inb_p(unsigned long port)
+{
+       unsigned char v = sh7343se_inb(port);
+       delay();
+       return v;
+}
+
+unsigned short
+sh7343se_inw(unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       return (p->inw) (p, port);
+}
+
+unsigned int
+sh7343se_inl(unsigned long port)
+{
+       badio(inl, port);
+}
+
+void
+sh7343se_outb(unsigned char value, unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       (p->outb) (p, value, port);
+}
+
+void
+sh7343se_outb_p(unsigned char value, unsigned long port)
+{
+       sh7343se_outb(value, port);
+       delay();
+}
+
+void
+sh7343se_outw(unsigned short value, unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       (p->outw) (p, value, port);
+}
+
+void
+sh7343se_outl(unsigned int value, unsigned long port)
+{
+       badio(outl, port);
+}
+
+void
+sh7343se_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *a = addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               *a++ = (p->inb) (p, port);
+}
+
+void
+sh7343se_insw(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned short *a = addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               *a++ = (p->inw) (p, port);
+}
+
+void
+sh7343se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       badio(insl, port);
+}
+
+void
+sh7343se_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *a = (unsigned char *) addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               (p->outb) (p, *a++, port);
+}
+
+void
+sh7343se_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned short *a = (unsigned short *) addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               (p->outw) (p, *a++, port);
+}
+
+void
+sh7343se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       badio(outsw, port);
+}
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
new file mode 100644 (file)
index 0000000..5d96e2e
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * linux/arch/sh/boards/se/7343/irq.c
+ *
+ * Copyright (C) 2008  Yoshihiro Shimoda
+ *
+ * Based on linux/arch/sh/boards/se/7722/irq.c
+ * Copyright (C) 2007  Nobuhiro Iwamatsu
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <mach-se/mach/se7343.h>
+
+static void disable_se7343_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
+}
+
+static void enable_se7343_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
+}
+
+static struct irq_chip se7343_irq_chip __read_mostly = {
+       .name           = "SE7343-FPGA",
+       .mask           = disable_se7343_irq,
+       .unmask         = enable_se7343_irq,
+       .mask_ack       = disable_se7343_irq,
+};
+
+static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
+{
+       unsigned short intv = ctrl_inw(PA_CPLD_ST);
+       struct irq_desc *ext_desc;
+       unsigned int ext_irq = SE7343_FPGA_IRQ_BASE;
+
+       intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
+
+       while (intv) {
+               if (intv & 1) {
+                       ext_desc = irq_desc + ext_irq;
+                       handle_level_irq(ext_irq, ext_desc);
+               }
+               intv >>= 1;
+               ext_irq++;
+       }
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_7343se_IRQ(void)
+{
+       int i;
+
+       ctrl_outw(0, PA_CPLD_IMSK);     /* disable all irqs */
+       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
+
+       for (i = 0; i < SE7343_FPGA_IRQ_NR; i++)
+               set_irq_chip_and_handler_name(SE7343_FPGA_IRQ_BASE + i,
+                                             &se7343_irq_chip,
+                                             handle_level_irq, "level");
+
+       set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ4_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ5_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
+}
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
new file mode 100644 (file)
index 0000000..486f40b
--- /dev/null
@@ -0,0 +1,152 @@
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+#include <asm/machvec.h>
+#include <mach-se/mach/se7343.h>
+#include <asm/heartbeat.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start  = 0x10000000,
+               .end    = 0x1000000F,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               /*
+                * shared with other devices via externel
+                * interrupt controller in FPGA...
+                */
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition nor_flash_partitions[] = {
+       {
+               .name           = "loader",
+               .offset         = 0x00000000,
+               .size           = 128 * 1024,
+       },
+       {
+               .name           = "rootfs",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 31 * 1024 * 1024,
+       },
+       {
+               .name           = "data",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data nor_flash_data = {
+       .width          = 2,
+       .parts          = nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
+};
+
+static struct resource nor_flash_resources[] = {
+       [0]     = {
+               .start  = 0x00000000,
+               .end    = 0x01ffffff,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device nor_flash_device = {
+       .name           = "physmap-flash",
+       .dev            = {
+               .platform_data  = &nor_flash_data,
+       },
+       .num_resources  = ARRAY_SIZE(nor_flash_resources),
+       .resource       = nor_flash_resources,
+};
+
+static struct platform_device *sh7343se_platform_devices[] __initdata = {
+       &smc91x_device,
+       &heartbeat_device,
+       &nor_flash_device,
+};
+
+static int __init sh7343se_devices_setup(void)
+{
+       return platform_add_devices(sh7343se_platform_devices,
+                                   ARRAY_SIZE(sh7343se_platform_devices));
+}
+device_initcall(sh7343se_devices_setup);
+
+/*
+ * Initialize the board
+ */
+static void __init sh7343se_setup(char **cmdline_p)
+{
+       ctrl_outw(0xf900, FPGA_OUT);    /* FPGA */
+
+       ctrl_outw(0x0002, PORT_PECR);   /* PORT E 1 = IRQ5 */
+       ctrl_outw(0x0020, PORT_PSELD);
+
+       printk(KERN_INFO "MS7343CP01 Setup...done\n");
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_7343se __initmv = {
+       .mv_name = "SolutionEngine 7343",
+       .mv_setup = sh7343se_setup,
+       .mv_nr_irqs = 108,
+       .mv_inb = sh7343se_inb,
+       .mv_inw = sh7343se_inw,
+       .mv_inl = sh7343se_inl,
+       .mv_outb = sh7343se_outb,
+       .mv_outw = sh7343se_outw,
+       .mv_outl = sh7343se_outl,
+
+       .mv_inb_p = sh7343se_inb_p,
+       .mv_inw_p = sh7343se_inw,
+       .mv_inl_p = sh7343se_inl,
+       .mv_outb_p = sh7343se_outb_p,
+       .mv_outw_p = sh7343se_outw,
+       .mv_outl_p = sh7343se_outl,
+
+       .mv_insb = sh7343se_insb,
+       .mv_insw = sh7343se_insw,
+       .mv_insl = sh7343se_insl,
+       .mv_outsb = sh7343se_outsb,
+       .mv_outsw = sh7343se_outsw,
+       .mv_outsl = sh7343se_outsl,
+
+       .mv_init_irq = init_7343se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/770x/Makefile b/arch/sh/boards/mach-se/770x/Makefile
new file mode 100644 (file)
index 0000000..8e624b0
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 770x SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/770x/io.c b/arch/sh/boards/mach-se/770x/io.c
new file mode 100644 (file)
index 0000000..28833c8
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * I/O routine for Hitachi SolutionEngine.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <mach-se/mach/se.h>
+
+/* MS7750 requires special versions of in*, out* routines, since
+   PC-like io ports are located at upper half byte of 16-bit word which
+   can be accessed only with 16-bit wide.  */
+
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port & 0xff000000)
+               return ( volatile __u16 *) port;
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       else if (port >= 0x1000)
+               return (volatile __u16 *) (PA_83902 + (port << 1));
+       else
+               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
+}
+
+static inline int
+shifted_port(unsigned long port)
+{
+       /* For IDE registers, value is not shifted */
+       if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
+               return 0;
+       else
+               return 1;
+}
+
+unsigned char se_inb(unsigned long port)
+{
+       if (shifted_port(port))
+               return (*port2adr(port) >> 8);
+       else
+               return (*port2adr(port))&0xff;
+}
+
+unsigned char se_inb_p(unsigned long port)
+{
+       unsigned long v;
+
+       if (shifted_port(port))
+               v = (*port2adr(port) >> 8);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short se_inw(unsigned long port)
+{
+       if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int se_inl(unsigned long port)
+{
+       maybebadio(port);
+       return 0;
+}
+
+void se_outb(unsigned char value, unsigned long port)
+{
+       if (shifted_port(port))
+               *(port2adr(port)) = value << 8;
+       else
+               *(port2adr(port)) = value;
+}
+
+void se_outb_p(unsigned char value, unsigned long port)
+{
+       if (shifted_port(port))
+               *(port2adr(port)) = value << 8;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void se_outw(unsigned short value, unsigned long port)
+{
+       if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void se_outl(unsigned int value, unsigned long port)
+{
+       maybebadio(port);
+}
+
+void se_insb(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u8 *ap = addr;
+
+       if (shifted_port(port)) {
+               while (count--)
+                       *ap++ = *p >> 8;
+       } else {
+               while (count--)
+                       *ap++ = *p;
+       }
+}
+
+void se_insw(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u16 *ap = addr;
+       while (count--)
+               *ap++ = *p;
+}
+
+void se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void se_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u8 *ap = addr;
+
+       if (shifted_port(port)) {
+               while (count--)
+                       *p = *ap++ << 8;
+       } else {
+               while (count--)
+                       *p = *ap++;
+       }
+}
+
+void se_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u16 *ap = addr;
+
+       while (count--)
+               *p = *ap++;
+}
+
+void se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-se/770x/irq.c b/arch/sh/boards/mach-se/770x/irq.c
new file mode 100644 (file)
index 0000000..ec1fea5
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * linux/arch/sh/boards/se/770x/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2006  Nobuhiro Iwamatsu
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <mach-se/mach/se.h>
+
+static struct ipr_data ipr_irq_table[] = {
+       /*
+       * Super I/O (Just mimic PC):
+       *  1: keyboard
+       *  3: serial 0
+       *  4: serial 1
+       *  5: printer
+       *  6: floppy
+       *  8: rtc
+       * 12: mouse
+       * 14: ide0
+       */
+#if defined(CONFIG_CPU_SUBTYPE_SH7705)
+       /* This is default value */
+       { 13, 0, 8,  0x0f-13, },
+       { 5 , 0, 4,  0x0f- 5, },
+       { 10, 1, 0,  0x0f-10, },
+       { 7 , 2, 4,  0x0f- 7, },
+       { 3 , 2, 0,  0x0f- 3, },
+       { 1 , 3, 12, 0x0f- 1, },
+       { 12, 3, 4,  0x0f-12, }, /* LAN */
+       { 2 , 4, 8,  0x0f- 2, }, /* PCIRQ2 */
+       { 6 , 4, 4,  0x0f- 6, }, /* PCIRQ1 */
+       { 14, 4, 0,  0x0f-14, }, /* PCIRQ0 */
+       { 0 , 5, 12, 0x0f   , }, 
+       { 4 , 5, 4,  0x0f- 4, },
+       { 8 , 6, 12, 0x0f- 8, },
+       { 9 , 6, 8,  0x0f- 9, },
+       { 11, 6, 4,  0x0f-11, },
+#else
+       { 14, 0,  8, 0x0f-14, },
+       { 12, 0,  4, 0x0f-12, },
+       {  8, 1,  4, 0x0f- 8, },
+       {  6, 2, 12, 0x0f- 6, },
+       {  5, 2,  8, 0x0f- 5, },
+       {  4, 2,  4, 0x0f- 4, },
+       {  3, 2,  0, 0x0f- 3, },
+       {  1, 3, 12, 0x0f- 1, },
+#if defined(CONFIG_STNIC)
+       /* ST NIC */
+       { 10, 3,  4, 0x0f-10, },        /* LAN */
+#endif
+       /* MRSHPC IRQs setting */
+       {  0, 4, 12, 0x0f- 0, },        /* PCIRQ3 */
+       { 11, 4,  8, 0x0f-11, },        /* PCIRQ2 */
+       {  9, 4,  4, 0x0f- 9, },        /* PCIRQ1 */
+       {  7, 4,  0, 0x0f- 7, },        /* PCIRQ0 */
+       /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
+       /* NOTE: #2 and #13 are not used on PC */
+       { 13, 6,  4, 0x0f-13, },        /* SLOTIRQ2 */
+       {  2, 6,  0, 0x0f- 2, },        /* SLOTIRQ1 */
+#endif
+};
+
+static unsigned long ipr_offsets[] = {
+       BCR_ILCRA,
+       BCR_ILCRB,
+       BCR_ILCRC,
+       BCR_ILCRD,
+       BCR_ILCRE,
+       BCR_ILCRF,
+       BCR_ILCRG,
+};
+
+static struct ipr_desc ipr_irq_desc = {
+       .ipr_offsets    = ipr_offsets,
+       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
+
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+       .chip = {
+               .name   = "IPR-se770x",
+       },
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se_IRQ(void)
+{
+       /* Disable all interrupts */
+       ctrl_outw(0, BCR_ILCRA);
+       ctrl_outw(0, BCR_ILCRB);
+       ctrl_outw(0, BCR_ILCRC);
+       ctrl_outw(0, BCR_ILCRD);
+       ctrl_outw(0, BCR_ILCRE);
+       ctrl_outw(0, BCR_ILCRF);
+       ctrl_outw(0, BCR_ILCRG);
+
+       register_ipr_controller(&ipr_irq_desc);
+}
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
new file mode 100644 (file)
index 0000000..9123d96
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * linux/arch/sh/boards/se/770x/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <mach-se/mach/se.h>
+#include <asm/io.h>
+#include <asm/smc37c93x.h>
+#include <asm/heartbeat.h>
+
+/*
+ * Configure the Super I/O chip
+ */
+static void __init smsc_config(int index, int data)
+{
+       outb_p(index, INDEX_PORT);
+       outb_p(data, DATA_PORT);
+}
+
+/* XXX: Another candidate for a more generic cchip machine vector */
+static void __init smsc_setup(char **cmdline_p)
+{
+       outb_p(CONFIG_ENTER, CONFIG_PORT);
+       outb_p(CONFIG_ENTER, CONFIG_PORT);
+
+       /* FDC */
+       smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
+
+       /* AUXIO (GPIO): to use IDE1 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
+       smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
+       smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
+
+       /* COM1 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IO_BASE_HI_INDEX, 0x03);
+       smsc_config(IO_BASE_LO_INDEX, 0xf8);
+       smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
+
+       /* COM2 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IO_BASE_HI_INDEX, 0x02);
+       smsc_config(IO_BASE_LO_INDEX, 0xf8);
+       smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
+
+       /* RTC */
+       smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
+
+       /* XXX: PARPORT, KBD, and MOUSE will come here... */
+       outb_p(CONFIG_EXIT, CONFIG_PORT);
+}
+
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start  = IRQ_CFCARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
+       defined(CONFIG_CPU_SUBTYPE_SH7712)
+/* SH771X Ethernet driver */
+static struct resource sh_eth0_resources[] = {
+       [0] = {
+               .start = SH_ETH0_BASE,
+               .end = SH_ETH0_BASE + 0x1B8,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = SH_ETH0_IRQ,
+               .end = SH_ETH0_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth0_device = {
+       .name = "sh-eth",
+       .id     = 0,
+       .dev = {
+               .platform_data = PHY_ID,
+       },
+       .num_resources = ARRAY_SIZE(sh_eth0_resources),
+       .resource = sh_eth0_resources,
+};
+
+static struct resource sh_eth1_resources[] = {
+       [0] = {
+               .start = SH_ETH1_BASE,
+               .end = SH_ETH1_BASE + 0x1B8,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = SH_ETH1_IRQ,
+               .end = SH_ETH1_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth1_device = {
+       .name = "sh-eth",
+       .id     = 1,
+       .dev = {
+               .platform_data = PHY_ID,
+       },
+       .num_resources = ARRAY_SIZE(sh_eth1_resources),
+       .resource = sh_eth1_resources,
+};
+#endif
+
+static struct platform_device *se_devices[] __initdata = {
+       &heartbeat_device,
+       &cf_ide_device,
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
+       defined(CONFIG_CPU_SUBTYPE_SH7712)
+       &sh_eth0_device,
+       &sh_eth1_device,
+#endif
+};
+
+static int __init se_devices_setup(void)
+{
+       return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
+}
+device_initcall(se_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_setup               = smsc_setup,
+#if defined(CONFIG_CPU_SH4)
+       .mv_nr_irqs             = 48,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
+       .mv_nr_irqs             = 32,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
+       .mv_nr_irqs             = 61,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
+       .mv_nr_irqs             = 86,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
+       .mv_nr_irqs             = 104,
+#endif
+
+       .mv_inb                 = se_inb,
+       .mv_inw                 = se_inw,
+       .mv_inl                 = se_inl,
+       .mv_outb                = se_outb,
+       .mv_outw                = se_outw,
+       .mv_outl                = se_outl,
+
+       .mv_inb_p               = se_inb_p,
+       .mv_inw_p               = se_inw,
+       .mv_inl_p               = se_inl,
+       .mv_outb_p              = se_outb_p,
+       .mv_outw_p              = se_outw,
+       .mv_outl_p              = se_outl,
+
+       .mv_insb                = se_insb,
+       .mv_insw                = se_insw,
+       .mv_insl                = se_insl,
+       .mv_outsb               = se_outsb,
+       .mv_outsw               = se_outsw,
+       .mv_outsl               = se_outsl,
+
+       .mv_init_irq            = init_se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7721/Makefile b/arch/sh/boards/mach-se/7721/Makefile
new file mode 100644 (file)
index 0000000..7f09030
--- /dev/null
@@ -0,0 +1 @@
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7721/irq.c b/arch/sh/boards/mach-se/7721/irq.c
new file mode 100644 (file)
index 0000000..b417acc
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * linux/arch/sh/boards/se/7721/irq.c
+ *
+ * Copyright (C) 2008  Renesas Solutions Corp.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <mach-se/mach/se7721.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+       MRSHPC,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
+};
+
+static struct intc_prio_reg prio_registers[] __initdata = {
+       { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
+         { 0, MRSHPC } },
+};
+
+static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
+                        NULL, NULL, prio_registers, NULL);
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7721_IRQ(void)
+{
+       /* PPCR */
+       ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
+
+       register_intc_controller(&intc_desc);
+       intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
+}
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
new file mode 100644 (file)
index 0000000..d3fc80f
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * linux/arch/sh/boards/se/7721/setup.c
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * Hitachi UL SolutionEngine 7721 Support.
+ *
+ * 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.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <mach-se/mach/se7721.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = MRSHPC_IRQ0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device *se7721_devices[] __initdata = {
+       &cf_ide_device,
+       &heartbeat_device
+};
+
+static int __init se7721_devices_setup(void)
+{
+       return platform_add_devices(se7721_devices,
+               ARRAY_SIZE(se7721_devices));
+}
+device_initcall(se7721_devices_setup);
+
+static void __init se7721_setup(char **cmdline_p)
+{
+       /* for USB */
+       ctrl_outw(0x0000, 0xA405010C);  /* PGCR */
+       ctrl_outw(0x0000, 0xA405010E);  /* PHCR */
+       ctrl_outw(0x00AA, 0xA4050118);  /* PPCR */
+       ctrl_outw(0x0000, 0xA4050124);  /* PSELA */
+}
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_se7721 __initmv = {
+       .mv_name                = "Solution Engine 7721",
+       .mv_setup               = se7721_setup,
+       .mv_nr_irqs             = 109,
+       .mv_init_irq            = init_se7721_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7722/Makefile b/arch/sh/boards/mach-se/7722/Makefile
new file mode 100644 (file)
index 0000000..8694373
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Makefile for the HITACHI UL SolutionEngine 7722 specific parts of the kernel
+#
+# 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.
+#
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
new file mode 100644 (file)
index 0000000..02d21a3
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * linux/arch/sh/boards/se/7722/irq.c
+ *
+ * Copyright (C) 2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7722 Support.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <mach-se/mach/se7722.h>
+
+static void disable_se7722_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
+}
+
+static void enable_se7722_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
+}
+
+static struct irq_chip se7722_irq_chip __read_mostly = {
+       .name           = "SE7722-FPGA",
+       .mask           = disable_se7722_irq,
+       .unmask         = enable_se7722_irq,
+       .mask_ack       = disable_se7722_irq,
+};
+
+static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
+{
+       unsigned short intv = ctrl_inw(IRQ01_STS);
+       struct irq_desc *ext_desc;
+       unsigned int ext_irq = SE7722_FPGA_IRQ_BASE;
+
+       intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
+
+       while (intv) {
+               if (intv & 1) {
+                       ext_desc = irq_desc + ext_irq;
+                       handle_level_irq(ext_irq, ext_desc);
+               }
+               intv >>= 1;
+               ext_irq++;
+       }
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7722_IRQ(void)
+{
+       int i;
+
+       ctrl_outw(0, IRQ01_MASK);       /* disable all irqs */
+       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
+
+       for (i = 0; i < SE7722_FPGA_IRQ_NR; i++)
+               set_irq_chip_and_handler_name(SE7722_FPGA_IRQ_BASE + i,
+                                             &se7722_irq_chip,
+                                             handle_level_irq, "level");
+
+       set_irq_chained_handler(IRQ0_IRQ, se7722_irq_demux);
+       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
+
+       set_irq_chained_handler(IRQ1_IRQ, se7722_irq_demux);
+       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
+}
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
new file mode 100644 (file)
index 0000000..fe6f965
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * linux/arch/sh/boards/se/7722/setup.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7722 Support.
+ *
+ * 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.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/input.h>
+#include <linux/smc91x.h>
+#include <asm/machvec.h>
+#include <asm/clock.h>
+#include <mach-se/mach/se7722.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+#include <asm/sh_keysc.h>
+
+/* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct smc91x_platdata smc91x_info = {
+       .flags = SMC91X_USE_16BIT,
+};
+
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data  = &smc91x_info,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 +8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = MRSHPC_IRQ0,
+               .end    = MRSHPC_IRQ0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = { /* SW1 -> SW30 */
+               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
+               KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
+               KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
+               KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
+               KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
+               KEY_Z,
+               KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
+static struct platform_device *se7722_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+       &cf_ide_device,
+       &sh_keysc_device,
+};
+
+static int __init se7722_devices_setup(void)
+{
+       clk_always_enable("mstp214"); /* KEYSC */
+
+       return platform_add_devices(se7722_devices,
+               ARRAY_SIZE(se7722_devices));
+}
+device_initcall(se7722_devices_setup);
+
+static void __init se7722_setup(char **cmdline_p)
+{
+       ctrl_outw(0x010D, FPGA_OUT);    /* FPGA */
+
+       ctrl_outw(0x0000, PORT_PECR);   /* PORT E 1 = IRQ5 ,E 0 = BS */
+       ctrl_outw(0x1000, PORT_PJCR);   /* PORT J 1 = IRQ1,J 0 =IRQ0 */
+
+       /* LCDC I/O */
+       ctrl_outw(0x0020, PORT_PSELD);
+
+       /* SIOF1*/
+       ctrl_outw(0x0003, PORT_PSELB);
+       ctrl_outw(0xe000, PORT_PSELC);
+       ctrl_outw(0x0000, PORT_PKCR);
+
+       /* LCDC */
+       ctrl_outw(0x4020, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(0x0002, PORT_PRCR);
+       ctrl_outw(0x0000, PORT_PXCR);   /* LCDC,CS6A */
+
+       /* KEYSC */
+       ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
+       ctrl_outw(0x0000, PORT_PYCR);
+       ctrl_outw(0x0000, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7722 __initmv = {
+       .mv_name                = "Solution Engine 7722" ,
+       .mv_setup               = se7722_setup ,
+       .mv_nr_irqs             = SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_NR,
+       .mv_init_irq            = init_se7722_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7751/Makefile b/arch/sh/boards/mach-se/7751/Makefile
new file mode 100644 (file)
index 0000000..dbc29f3
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for the 7751 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
+
+obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/sh/boards/mach-se/7751/io.c b/arch/sh/boards/mach-se/7751/io.c
new file mode 100644 (file)
index 0000000..6287ae5
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 SolutionEngine.
+ *
+ * Initial version only to support LAN access; some
+ * placeholder code from io_se.c left in with the
+ * expectation of later SuperIO and PCMCIA access.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <mach-se/mach/se7751.h>
+#include <asm/addrspace.h>
+
+static inline volatile u16 *port2adr(unsigned int port)
+{
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char sh7751se_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               return (*port2adr(port)) & 0xff;
+}
+
+unsigned char sh7751se_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+        if (PXSEG(port))
+                v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+                v = *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               v = (*port2adr(port)) & 0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short sh7751se_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int sh7751se_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void sh7751se_outb(unsigned char value, unsigned long port)
+{
+
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void sh7751se_outb_p(unsigned char value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void sh7751se_outw(unsigned short value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751se_outl(unsigned int value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-se/7751/irq.c b/arch/sh/boards/mach-se/7751/irq.c
new file mode 100644 (file)
index 0000000..5c9847e
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * linux/arch/sh/boards/se/7751/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for 7751 Solution Engine by
+ * Ian da Silva and Jeremy Siegel, 2001.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <mach-se/mach/se7751.h>
+
+static struct ipr_data ipr_irq_table[] = {
+       { 13, 3, 3, 2 },
+       /* Add additional entries here as drivers are added and tested. */
+};
+
+static unsigned long ipr_offsets[] = {
+       BCR_ILCRA,
+       BCR_ILCRB,
+       BCR_ILCRC,
+       BCR_ILCRD,
+       BCR_ILCRE,
+       BCR_ILCRF,
+       BCR_ILCRG,
+};
+
+static struct ipr_desc ipr_irq_desc = {
+       .ipr_offsets    = ipr_offsets,
+       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
+
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+
+       .chip = {
+               .name   = "IPR-se7751",
+       },
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_7751se_IRQ(void)
+{
+       register_ipr_controller(&ipr_irq_desc);
+}
diff --git a/arch/sh/boards/mach-se/7751/pci.c b/arch/sh/boards/mach-se/7751/pci.c
new file mode 100644 (file)
index 0000000..203b292
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * linux/arch/sh/boards/se/7751/pci.c
+ *
+ * Author:  Ian DaSilva (idasilva@mvista.com)
+ *
+ * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01)
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include "../../../drivers/pci/pci-sh7751.h"
+
+#define PCIMCR_MRSET_OFF       0xBFFFFFFF
+#define PCIMCR_RFSH_OFF                0xFFFFFFFB
+
+/*
+ * Only long word accesses of the PCIC's internal local registers and the
+ * configuration registers from the CPU is supported.
+ */
+#define PCIC_WRITE(x,v) writel((v), PCI_REG(x))
+#define PCIC_READ(x) readl(PCI_REG(x))
+
+/*
+ * Description:  This function sets up and initializes the pcic, sets
+ * up the BARS, maps the DRAM into the address space etc, etc.
+ */
+int __init pcibios_init_platform(void)
+{
+   unsigned long bcr1, wcr1, wcr2, wcr3, mcr;
+   unsigned short bcr2;
+
+   /*
+    * Initialize the slave bus controller on the pcic.  The values used
+    * here should not be hardcoded, but they should be taken from the bsc
+    * on the processor, to make this function as generic as possible.
+    * (i.e. Another sbc may usr different SDRAM timing settings -- in order
+    * for the pcic to work, its settings need to be exactly the same.)
+    */
+   bcr1 = (*(volatile unsigned long*)(SH7751_BCR1));
+   bcr2 = (*(volatile unsigned short*)(SH7751_BCR2));
+   wcr1 = (*(volatile unsigned long*)(SH7751_WCR1));
+   wcr2 = (*(volatile unsigned long*)(SH7751_WCR2));
+   wcr3 = (*(volatile unsigned long*)(SH7751_WCR3));
+   mcr = (*(volatile unsigned long*)(SH7751_MCR));
+
+   bcr1 = bcr1 | 0x00080000;  /* Enable Bit 19, BREQEN */
+   (*(volatile unsigned long*)(SH7751_BCR1)) = bcr1;   
+
+   bcr1 = bcr1 | 0x40080000;  /* Enable Bit 19 BREQEN, set PCIC to slave */
+   PCIC_WRITE(SH7751_PCIBCR1, bcr1);    /* PCIC BCR1 */
+   PCIC_WRITE(SH7751_PCIBCR2, bcr2);     /* PCIC BCR2 */
+   PCIC_WRITE(SH7751_PCIWCR1, wcr1);     /* PCIC WCR1 */
+   PCIC_WRITE(SH7751_PCIWCR2, wcr2);     /* PCIC WCR2 */
+   PCIC_WRITE(SH7751_PCIWCR3, wcr3);     /* PCIC WCR3 */
+   mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
+   PCIC_WRITE(SH7751_PCIMCR, mcr);      /* PCIC MCR */
+
+
+   /* Enable all interrupts, so we know what to fix */
+   PCIC_WRITE(SH7751_PCIINTM, 0x0000c3ff);
+   PCIC_WRITE(SH7751_PCIAINTM, 0x0000380f);
+
+   /* Set up standard PCI config registers */
+   PCIC_WRITE(SH7751_PCICONF1,         0xF39000C7); /* Bus Master, Mem & I/O access */
+   PCIC_WRITE(SH7751_PCICONF2,         0x00000000); /* PCI Class code & Revision ID */
+   PCIC_WRITE(SH7751_PCICONF4,         0xab000001); /* PCI I/O address (local regs) */
+   PCIC_WRITE(SH7751_PCICONF5,         0x0c000000); /* PCI MEM address (local RAM)  */
+   PCIC_WRITE(SH7751_PCICONF6,         0xd0000000); /* PCI MEM address (unused)     */
+   PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID & Vendor ID */
+   PCIC_WRITE(SH7751_PCILSR0, 0x03f00000);   /* MEM (full 64M exposed)       */
+   PCIC_WRITE(SH7751_PCILSR1, 0x00000000);   /* MEM (unused)                 */
+   PCIC_WRITE(SH7751_PCILAR0, 0x0c000000);   /* MEM (direct map from PCI)    */
+   PCIC_WRITE(SH7751_PCILAR1, 0x00000000);   /* MEM (unused)                 */
+
+   /* Now turn it on... */
+   PCIC_WRITE(SH7751_PCICR, 0xa5000001);
+
+   /*
+    * Set PCIMBR and PCIIOBR here, assuming a single window
+    * (16M MEM, 256K IO) is enough.  If a larger space is
+    * needed, the readx/writex and inx/outx functions will
+    * have to do more (e.g. setting registers for each call).
+    */
+
+   /*
+    * Set the MBR so PCI address is one-to-one with window,
+    * meaning all calls go straight through... use BUG_ON to
+    * catch erroneous assumption.
+    */
+   BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE);
+
+   PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM);
+
+   /* Set IOBR for window containing area specified in pci.h */
+   PCIC_WRITE(SH7751_PCIIOBR, (PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK));
+
+   /* All done, may as well say so... */
+   printk("SH7751 PCI: Finished initialization of the PCI controller\n");
+
+   return 1;
+}
+
+int __init pcibios_map_platform_irq(u8 slot, u8 pin)
+{
+        switch (slot) {
+        case 0: return 13;
+        case 1: return 13;     /* AMD Ethernet controller */
+        case 2: return -1;
+        case 3: return -1;
+        case 4: return -1;
+        default:
+                printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
+                return -1;
+        }
+}
+
+static struct resource sh7751_io_resource = {
+       .name   = "SH7751 IO",
+       .start  = SH7751_PCI_IO_BASE,
+       .end    = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
+       .flags  = IORESOURCE_IO
+};
+
+static struct resource sh7751_mem_resource = {
+       .name   = "SH7751 mem",
+       .start  = SH7751_PCI_MEMORY_BASE,
+       .end    = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
+       .flags  = IORESOURCE_MEM
+};
+
+extern struct pci_ops sh7751_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+       { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
+       { NULL, NULL, NULL, 0, 0 },
+};
+
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
new file mode 100644 (file)
index 0000000..5057251
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * linux/arch/sh/boards/se/7751/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for 7751 Solution Engine by
+ * Ian da Silva and Jeremy Siegel, 2001.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <mach-se/mach/se7751.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *se7751_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init se7751_devices_setup(void)
+{
+       return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
+}
+__initcall(se7751_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_7751se __initmv = {
+       .mv_name                = "7751 SolutionEngine",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = sh7751se_inb,
+       .mv_inw                 = sh7751se_inw,
+       .mv_inl                 = sh7751se_inl,
+       .mv_outb                = sh7751se_outb,
+       .mv_outw                = sh7751se_outw,
+       .mv_outl                = sh7751se_outl,
+
+       .mv_inb_p               = sh7751se_inb_p,
+       .mv_inw_p               = sh7751se_inw,
+       .mv_inl_p               = sh7751se_inl,
+       .mv_outb_p              = sh7751se_outb_p,
+       .mv_outw_p              = sh7751se_outw,
+       .mv_outl_p              = sh7751se_outl,
+
+       .mv_insl                = sh7751se_insl,
+       .mv_outsl               = sh7751se_outsl,
+
+       .mv_init_irq            = init_7751se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7780/Makefile b/arch/sh/boards/mach-se/7780/Makefile
new file mode 100644 (file)
index 0000000..6b88ada
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Makefile for the HITACHI UL SolutionEngine 7780 specific parts of the kernel
+#
+# 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.
+#
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7780/irq.c b/arch/sh/boards/mach-se/7780/irq.c
new file mode 100644 (file)
index 0000000..66ad292
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * linux/arch/sh/boards/se/7780/irq.c
+ *
+ * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7780 Support.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <mach-se/mach/se7780.h>
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7780_IRQ(void)
+{
+       /* enable all interrupt at FPGA */
+       ctrl_outw(0, FPGA_INTMSK1);
+       /* mask SM501 interrupt */
+       ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
+       /* enable all interrupt at FPGA */
+       ctrl_outw(0, FPGA_INTMSK2);
+
+       /* set FPGA INTSEL register */
+       /* FPGA + 0x06 */
+       ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
+               (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
+
+       /* FPGA + 0x08 */
+       ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
+               (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
+               (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
+               (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
+
+       /* FPGA + 0x0A */
+       ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
+
+       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
+}
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
new file mode 100644 (file)
index 0000000..1d3a867
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * linux/arch/sh/boards/se/7780/setup.c
+ *
+ * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7780 Support.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <mach-se/mach/se7780.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+/* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct platform_device *se7780_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+};
+
+static int __init se7780_devices_setup(void)
+{
+       return platform_add_devices(se7780_devices,
+               ARRAY_SIZE(se7780_devices));
+}
+device_initcall(se7780_devices_setup);
+
+#define GPIO_PHCR        0xFFEA000E
+#define GPIO_PMSELR      0xFFEA0080
+#define GPIO_PECR        0xFFEA0008
+
+static void __init se7780_setup(char **cmdline_p)
+{
+       /* "SH-Linux" on LED Display */
+       ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
+       ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
+       ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
+       ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
+       ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
+       ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
+       ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
+       ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
+
+       printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
+
+       /*
+        * PCI REQ/GNT setting
+        *   REQ0/GNT0 -> USB
+        *   REQ1/GNT1 -> PC Card
+        *   REQ2/GNT2 -> Serial ATA
+        *   REQ3/GNT3 -> PCI slot
+        */
+       ctrl_outw(0x0213, FPGA_REQSEL);
+
+       /* GPIO setting */
+       ctrl_outw(0x0000, GPIO_PECR);
+       ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
+       ctrl_outw(0x0c00, GPIO_PMSELR);
+
+       /* iVDR Power ON */
+       ctrl_outw(0x0001, FPGA_IVDRPW);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7780 __initmv = {
+       .mv_name                = "Solution Engine 7780" ,
+       .mv_setup               = se7780_setup ,
+       .mv_nr_irqs             = 111 ,
+       .mv_init_irq            = init_se7780_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/Makefile b/arch/sh/boards/mach-se/Makefile
new file mode 100644 (file)
index 0000000..2de42ba
--- /dev/null
@@ -0,0 +1,9 @@
+obj-$(CONFIG_SH_7619_SOLUTION_ENGINE)  += board-se7619.o
+
+obj-$(CONFIG_SH_SOLUTION_ENGINE)       += 770x/
+obj-$(CONFIG_SH_7206_SOLUTION_ENGINE)  += 7206/
+obj-$(CONFIG_SH_7722_SOLUTION_ENGINE)  += 7722/
+obj-$(CONFIG_SH_7751_SOLUTION_ENGINE)  += 7751/
+obj-$(CONFIG_SH_7780_SOLUTION_ENGINE)  += 7780/
+obj-$(CONFIG_SH_7343_SOLUTION_ENGINE)  += 7343/
+obj-$(CONFIG_SH_7721_SOLUTION_ENGINE)  += 7721/
diff --git a/arch/sh/boards/mach-se/board-se7619.c b/arch/sh/boards/mach-se/board-se7619.c
new file mode 100644 (file)
index 0000000..1d0ef7f
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * arch/sh/boards/se/7619/setup.c
+ *
+ * Copyright (C) 2006 Yoshinori Sato
+ *
+ * Hitachi SH7619 SolutionEngine Support.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_nr_irqs             = 108,
+};
diff --git a/arch/sh/boards/mach-sh03/Makefile b/arch/sh/boards/mach-sh03/Makefile
new file mode 100644 (file)
index 0000000..400306a
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel
+#
+
+obj-y   := setup.o rtc.o
diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c
new file mode 100644 (file)
index 0000000..0a9266b
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
+ *
+ *  Copyright (C) 2004  Saito.K & Jeanne(ksaito@interface.co.jp)
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/bcd.h>
+#include <linux/rtc.h>
+#include <linux/spinlock.h>
+#include <asm/io.h>
+#include <asm/rtc.h>
+
+#define RTC_BASE       0xb0000000
+#define RTC_SEC1       (RTC_BASE + 0)
+#define RTC_SEC10      (RTC_BASE + 1)
+#define RTC_MIN1       (RTC_BASE + 2)
+#define RTC_MIN10      (RTC_BASE + 3)
+#define RTC_HOU1       (RTC_BASE + 4)
+#define RTC_HOU10      (RTC_BASE + 5)
+#define RTC_WEE1       (RTC_BASE + 6)
+#define RTC_DAY1       (RTC_BASE + 7)
+#define RTC_DAY10      (RTC_BASE + 8)
+#define RTC_MON1       (RTC_BASE + 9)
+#define RTC_MON10      (RTC_BASE + 10)
+#define RTC_YEA1       (RTC_BASE + 11)
+#define RTC_YEA10      (RTC_BASE + 12)
+#define RTC_YEA100     (RTC_BASE + 13)
+#define RTC_YEA1000    (RTC_BASE + 14)
+#define RTC_CTL                (RTC_BASE + 15)
+#define RTC_BUSY       1
+#define RTC_STOP       2
+
+extern spinlock_t rtc_lock;
+
+unsigned long get_cmos_time(void)
+{
+       unsigned int year, mon, day, hour, min, sec;
+
+       spin_lock(&rtc_lock);
+ again:
+       do {
+               sec  = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
+               min  = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
+               hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10;
+               day  = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10;
+               mon  = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10;
+               year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10
+                    + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100
+                    + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000;
+       } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10);
+       if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
+           hour > 23 || min > 59 || sec > 59) {
+               printk(KERN_ERR
+                      "SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
+               printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
+                      year, mon, day, hour, min, sec);
+
+               ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10);
+               ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10);
+               ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10);
+               ctrl_outb(6, RTC_WEE1);
+               ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10);
+               ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10);
+               ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10);
+               ctrl_outb(0, RTC_YEA100);
+               ctrl_outb(2, RTC_YEA1000);
+               ctrl_outb(0, RTC_CTL);
+               goto again;
+       }
+
+       spin_unlock(&rtc_lock);
+       return mktime(year, mon, day, hour, min, sec);
+}
+
+void sh03_rtc_gettimeofday(struct timespec *tv)
+{
+
+       tv->tv_sec = get_cmos_time();
+       tv->tv_nsec = 0;
+}
+
+static int set_rtc_mmss(unsigned long nowtime)
+{
+       int retval = 0;
+       int real_seconds, real_minutes, cmos_minutes;
+       int i;
+
+       /* gets recalled with irq locally disabled */
+       spin_lock(&rtc_lock);
+       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
+               if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
+                       break;
+       cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
+       real_seconds = nowtime % 60;
+       real_minutes = nowtime / 60;
+       if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
+               real_minutes += 30;             /* correct for half hour time zone */
+       real_minutes %= 60;
+
+       if (abs(real_minutes - cmos_minutes) < 30) {
+               ctrl_outb(real_seconds % 10, RTC_SEC1);
+               ctrl_outb(real_seconds / 10, RTC_SEC10);
+               ctrl_outb(real_minutes % 10, RTC_MIN1);
+               ctrl_outb(real_minutes / 10, RTC_MIN10);
+       } else {
+               printk(KERN_WARNING
+                      "set_rtc_mmss: can't update from %d to %d\n",
+                      cmos_minutes, real_minutes);
+               retval = -1;
+       }
+       spin_unlock(&rtc_lock);
+
+       return retval;
+}
+
+int sh03_rtc_settimeofday(const time_t secs)
+{
+       unsigned long nowtime = secs;
+
+       return set_rtc_mmss(nowtime);
+}
+
+void sh03_time_init(void)
+{
+       rtc_sh_get_time = sh03_rtc_gettimeofday;
+       rtc_sh_set_time = sh03_rtc_settimeofday;
+}
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
new file mode 100644 (file)
index 0000000..5771219
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * linux/arch/sh/boards/sh03/setup.c
+ *
+ * Copyright (C) 2004  Interface Co.,Ltd. Saito.K
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/rtc.h>
+#include <mach-sh03/mach/io.h>
+#include <mach-sh03/mach/sh03.h>
+#include <asm/addrspace.h>
+
+static void __init init_sh03_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+extern void *cf_io_base;
+
+static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
+{
+       if (PXSEG(port))
+               return (void __iomem *)port;
+       /* CompactFlash (IDE) */
+       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
+               return (void __iomem *)((unsigned long)cf_io_base + port);
+
+        return (void __iomem *)(port + PCI_IO_BASE);
+}
+
+/* arch/sh/boards/sh03/rtc.c */
+void sh03_time_init(void);
+
+static void __init sh03_setup(char **cmdline_p)
+{
+       board_time_init = sh03_time_init;
+}
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = 0xa0800000,
+               .end    = 0xa0800000,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *sh03_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init sh03_devices_setup(void)
+{
+       return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
+}
+__initcall(sh03_devices_setup);
+
+static struct sh_machine_vector mv_sh03 __initmv = {
+       .mv_name                = "Interface (CTP/PCI-SH03)",
+       .mv_setup               = sh03_setup,
+       .mv_nr_irqs             = 48,
+       .mv_ioport_map          = sh03_ioport_map,
+       .mv_init_irq            = init_sh03_IRQ,
+};
diff --git a/arch/sh/boards/mach-sh7763rdp/Makefile b/arch/sh/boards/mach-sh7763rdp/Makefile
new file mode 100644 (file)
index 0000000..f6c0b55
--- /dev/null
@@ -0,0 +1 @@
+obj-y    := setup.o irq.o
diff --git a/arch/sh/boards/mach-sh7763rdp/irq.c b/arch/sh/boards/mach-sh7763rdp/irq.c
new file mode 100644 (file)
index 0000000..fd850ba
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * linux/arch/sh/boards/renesas/sh7763rdp/irq.c
+ *
+ * Renesas Solutions SH7763RDP Support.
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Copyright (C) 2008  Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ *
+ * 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.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/sh7763rdp.h>
+
+#define INTC_BASE              (0xFFD00000)
+#define INTC_INT2PRI7   (INTC_BASE+0x4001C)
+#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
+#define INTC_INT2MSKCR1        (INTC_BASE+0x400D4)
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_sh7763rdp_IRQ(void)
+{
+       /* GPIO enabled */
+       ctrl_outl(1 << 25, INTC_INT2MSKCR);
+
+       /* enable GPIO interrupts */
+       ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
+                 INTC_INT2PRI7);
+
+       /* USBH enabled */
+       ctrl_outl(1 << 17, INTC_INT2MSKCR1);
+
+       /* GETHER enabled */
+       ctrl_outl(1 << 16, INTC_INT2MSKCR1);
+
+       /* DMAC enabled */
+       ctrl_outl(1 << 8, INTC_INT2MSKCR);
+}
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
new file mode 100644 (file)
index 0000000..925f16a
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * linux/arch/sh/boards/renesas/sh7763rdp/setup.c
+ *
+ * Renesas Solutions sh7763rdp board
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/mtd/physmap.h>
+#include <asm/io.h>
+#include <asm/sh7763rdp.h>
+
+/* NOR Flash */
+static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
+       {
+               .name = "U-Boot",
+               .offset = 0,
+               .size = (2 * 128 * 1024),
+               .mask_flags = MTD_WRITEABLE,    /* Read-only */
+       }, {
+               .name = "Linux-Kernel",
+               .offset = MTDPART_OFS_APPEND,
+               .size = (20 * 128 * 1024),
+       }, {
+               .name = "Root Filesystem",
+               .offset = MTDPART_OFS_APPEND,
+               .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data sh7763rdp_nor_flash_data = {
+       .width = 2,
+       .parts = sh7763rdp_nor_flash_partitions,
+       .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
+};
+
+static struct resource sh7763rdp_nor_flash_resources[] = {
+       [0] = {
+               .name = "NOR Flash",
+               .start = 0,
+               .end = (64 * 1024 * 1024),
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device sh7763rdp_nor_flash_device = {
+       .name = "physmap-flash",
+       .resource = sh7763rdp_nor_flash_resources,
+       .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
+       .dev = {
+               .platform_data = &sh7763rdp_nor_flash_data,
+       },
+};
+
+static struct platform_device *sh7763rdp_devices[] __initdata = {
+       &sh7763rdp_nor_flash_device,
+};
+
+static int __init sh7763rdp_devices_setup(void)
+{
+       return platform_add_devices(sh7763rdp_devices,
+                                   ARRAY_SIZE(sh7763rdp_devices));
+}
+__initcall(sh7763rdp_devices_setup);
+
+static void __init sh7763rdp_setup(char **cmdline_p)
+{
+       /* Board version check */
+       if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
+               printk(KERN_INFO "RTE Standard Configuration\n");
+       else
+               printk(KERN_INFO "RTA Standard Configuration\n");
+
+       /* USB pin select bits (clear bit 5-2 to 0) */
+       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
+       /* USBH setup port I controls to other (clear bits 4-9 to 0) */
+       ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR);
+
+       /* Select USB Host controller */
+       ctrl_outw(0x00, USB_USBHSC);
+
+       /* For LCD */
+       /* set PTJ7-1, bits 15-2 of PJCR to 0 */
+       ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR);
+       /* set PTI5, bits 11-10 of PICR to 0 */
+       ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR);
+       ctrl_outw(0, PORT_PKCR);
+       ctrl_outw(0, PORT_PLCR);
+       /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
+       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
+       /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
+       ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
+
+       /* For HAC */
+       /* bit3-0  0100:HAC & SSI1 enable */
+       ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
+       /* bit14      1:SSI_HAC_CLK enable */
+       ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
+
+       /* SH-Ether */
+       ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
+       ctrl_outw(0x0, PORT_PFCR);
+       ctrl_outw(0x0, PORT_PFCR);
+       ctrl_outw(0x0, PORT_PFCR);
+
+       /* MMC */
+       /*selects SCIF and MMC other functions */
+       ctrl_outw(0x0001, PORT_PSEL0);
+       /* MMC clock operates */
+       ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1);
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR);
+       ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
+}
+
+static struct sh_machine_vector mv_sh7763rdp __initmv = {
+       .mv_name = "sh7763drp",
+       .mv_setup = sh7763rdp_setup,
+       .mv_nr_irqs = 112,
+       .mv_init_irq = init_sh7763rdp_IRQ,
+};
diff --git a/arch/sh/boards/mach-snapgear/Makefile b/arch/sh/boards/mach-snapgear/Makefile
new file mode 100644 (file)
index 0000000..d2d2f4b
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the SnapGear specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
diff --git a/arch/sh/boards/mach-snapgear/io.c b/arch/sh/boards/mach-snapgear/io.c
new file mode 100644 (file)
index 0000000..0f48242
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 SolutionEngine.
+ *
+ * Initial version only to support LAN access; some
+ * placeholder code from io_se.c left in with the
+ * expectation of later SuperIO and PCMCIA access.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+#ifdef CONFIG_SH_SECUREEDGE5410
+unsigned short secureedge5410_ioport;
+#endif
+
+static inline volatile __u16 *port2adr(unsigned int port)
+{
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char snapgear_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               return (*port2adr(port)) & 0xff;
+}
+
+unsigned char snapgear_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+       if (PXSEG(port))
+               v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               v = *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short snapgear_inw(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int snapgear_inl(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void snapgear_outb(unsigned char value, unsigned long port)
+{
+
+       if (PXSEG(port))
+               *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void snapgear_outb_p(unsigned char value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void snapgear_outw(unsigned short value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void snapgear_outl(unsigned int value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void snapgear_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-snapgear/setup.c b/arch/sh/boards/mach-snapgear/setup.c
new file mode 100644 (file)
index 0000000..a5e349d
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * linux/arch/sh/boards/snapgear/setup.c
+ *
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
+ *
+ * Based on files with the following comments:
+ *
+ *           Copyright (C) 2000  Kazumoto Kojima
+ *
+ *           Modified for 7751 Solution Engine by
+ *           Ian da Silva and Jeremy Siegel, 2001.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/timer.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <asm/machvec.h>
+#include <asm/snapgear.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <cpu/timer.h>
+
+/*
+ * EraseConfig handling functions
+ */
+
+static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
+{
+       (void)ctrl_inb(0xb8000000);     /* dummy read */
+
+       printk("SnapGear: erase switch interrupt!\n");
+
+       return IRQ_HANDLED;
+}
+
+static int __init eraseconfig_init(void)
+{
+       printk("SnapGear: EraseConfig init\n");
+       /* Setup "EraseConfig" switch on external IRQ 0 */
+       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
+                               "Erase Config", NULL))
+               printk("SnapGear: failed to register IRQ%d for Reset witch\n",
+                               IRL0_IRQ);
+       else
+               printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
+                               IRL0_IRQ);
+       return(0);
+}
+
+module_init(eraseconfig_init);
+
+/****************************************************************************/
+/*
+ * Initialize IRQ setting
+ *
+ * IRL0 = erase switch
+ * IRL1 = eth0
+ * IRL2 = eth1
+ * IRL3 = crypto
+ */
+
+static void __init init_snapgear_IRQ(void)
+{
+       printk("Setup SnapGear IRQ/IPR ...\n");
+       /* enable individual interrupt mode for externals */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_snapgear __initmv = {
+       .mv_name                = "SnapGear SecureEdge5410",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = snapgear_inb,
+       .mv_inw                 = snapgear_inw,
+       .mv_inl                 = snapgear_inl,
+       .mv_outb                = snapgear_outb,
+       .mv_outw                = snapgear_outw,
+       .mv_outl                = snapgear_outl,
+
+       .mv_inb_p               = snapgear_inb_p,
+       .mv_inw_p               = snapgear_inw,
+       .mv_inl_p               = snapgear_inl,
+       .mv_outb_p              = snapgear_outb_p,
+       .mv_outw_p              = snapgear_outw,
+       .mv_outl_p              = snapgear_outl,
+
+       .mv_init_irq            = init_snapgear_IRQ,
+};
diff --git a/arch/sh/boards/mach-systemh/Makefile b/arch/sh/boards/mach-systemh/Makefile
new file mode 100644 (file)
index 0000000..2cc6a23
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Makefile for the SystemH specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o io.o
+
+# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more
+# importantly, with the generic sh7751_pcic_init() code. For now, we'll
+# just abuse the hell out of kbuild, because we can..
+
+obj-$(CONFIG_PCI) += pci.o
+pci-y := ../../se/7751/pci.o
+
diff --git a/arch/sh/boards/mach-systemh/io.c b/arch/sh/boards/mach-systemh/io.c
new file mode 100644 (file)
index 0000000..1b767e1
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/io.c
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 Systemh.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/systemh7751.h>
+#include <asm/addrspace.h>
+#include <asm/io.h>
+
+#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
+                                                of smc lan chip*/
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char sh7751systemh_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned char *)ETHER_IOMAP(port);
+       else
+               return (*port2adr(port))&0xff;
+}
+
+unsigned char sh7751systemh_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+        if (PXSEG(port))
+                v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+                v = *(volatile unsigned char *)pci_ioaddr(port);
+       else if (port <= 0x3F1)
+               v = *(volatile unsigned char *)ETHER_IOMAP(port);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short sh7751systemh_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned int *)ETHER_IOMAP(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int sh7751systemh_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned int *)ETHER_IOMAP(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void sh7751systemh_outb(unsigned char value, unsigned long port)
+{
+
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void sh7751systemh_outb_p(unsigned char value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void sh7751systemh_outw(unsigned short value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned short *)ETHER_IOMAP(port) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751systemh_outl(unsigned int value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *p = addr;
+       while (count--) *p++ = sh7751systemh_inb(port);
+}
+
+void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned short *p = addr;
+       while (count--) *p++ = sh7751systemh_inw(port);
+}
+
+void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *p = (unsigned char*)addr;
+       while (count--) sh7751systemh_outb(*p++, port);
+}
+
+void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned short *p = (unsigned short*)addr;
+       while (count--) sh7751systemh_outw(*p++, port);
+}
+
+void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c
new file mode 100644 (file)
index 0000000..0ba2fe6
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by
+ * Jonathan Short.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <linux/hdreg.h>
+#include <linux/ide.h>
+#include <asm/io.h>
+#include <asm/systemh7751.h>
+#include <asm/smc37c93x.h>
+
+/* address of external interrupt mask register
+ * address must be set prior to use these (maybe in init_XXX_irq())
+ * XXX : is it better to use .config than specifying it in code? */
+static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
+static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
+
+/* forward declaration */
+static unsigned int startup_systemh_irq(unsigned int irq);
+static void shutdown_systemh_irq(unsigned int irq);
+static void enable_systemh_irq(unsigned int irq);
+static void disable_systemh_irq(unsigned int irq);
+static void mask_and_ack_systemh(unsigned int);
+static void end_systemh_irq(unsigned int irq);
+
+/* hw_interrupt_type */
+static struct hw_interrupt_type systemh_irq_type = {
+       .typename = " SystemH Register",
+       .startup = startup_systemh_irq,
+       .shutdown = shutdown_systemh_irq,
+       .enable = enable_systemh_irq,
+       .disable = disable_systemh_irq,
+       .ack = mask_and_ack_systemh,
+       .end = end_systemh_irq
+};
+
+static unsigned int startup_systemh_irq(unsigned int irq)
+{
+       enable_systemh_irq(irq);
+       return 0; /* never anything pending */
+}
+
+static void shutdown_systemh_irq(unsigned int irq)
+{
+       disable_systemh_irq(irq);
+}
+
+static void disable_systemh_irq(unsigned int irq)
+{
+       if (systemh_irq_mask_register) {
+               unsigned long val, mask = 0x01 << 1;
+
+               /* Clear the "irq"th bit in the mask and set it in the request */
+               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+               val &= ~mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+
+               val = ctrl_inl((unsigned long)systemh_irq_request_register);
+               val |= mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_request_register);
+       }
+}
+
+static void enable_systemh_irq(unsigned int irq)
+{
+       if (systemh_irq_mask_register) {
+               unsigned long val, mask = 0x01 << 1;
+
+               /* Set "irq"th bit in the mask register */
+               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+               val |= mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+       }
+}
+
+static void mask_and_ack_systemh(unsigned int irq)
+{
+       disable_systemh_irq(irq);
+}
+
+static void end_systemh_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_systemh_irq(irq);
+}
+
+void make_systemh_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       irq_desc[irq].chip = &systemh_irq_type;
+       disable_systemh_irq(irq);
+}
+
diff --git a/arch/sh/boards/mach-systemh/setup.c b/arch/sh/boards/mach-systemh/setup.c
new file mode 100644 (file)
index 0000000..ee78af8
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by Jonathan Short.
+ *
+ * Rewritten for 2.6 by Paul Mundt.
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <asm/machvec.h>
+#include <asm/systemh7751.h>
+
+extern void make_systemh_irq(unsigned int irq);
+
+/*
+ * Initialize IRQ setting
+ */
+static void __init sh7751systemh_init_irq(void)
+{
+       make_systemh_irq(0xb);  /* Ethernet interrupt */
+}
+
+static struct sh_machine_vector mv_7751systemh __initmv = {
+       .mv_name                = "7751 SystemH",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = sh7751systemh_inb,
+       .mv_inw                 = sh7751systemh_inw,
+       .mv_inl                 = sh7751systemh_inl,
+       .mv_outb                = sh7751systemh_outb,
+       .mv_outw                = sh7751systemh_outw,
+       .mv_outl                = sh7751systemh_outl,
+
+       .mv_inb_p               = sh7751systemh_inb_p,
+       .mv_inw_p               = sh7751systemh_inw,
+       .mv_inl_p               = sh7751systemh_inl,
+       .mv_outb_p              = sh7751systemh_outb_p,
+       .mv_outw_p              = sh7751systemh_outw,
+       .mv_outl_p              = sh7751systemh_outl,
+
+       .mv_insb                = sh7751systemh_insb,
+       .mv_insw                = sh7751systemh_insw,
+       .mv_insl                = sh7751systemh_insl,
+       .mv_outsb               = sh7751systemh_outsb,
+       .mv_outsw               = sh7751systemh_outsw,
+       .mv_outsl               = sh7751systemh_outsl,
+
+       .mv_init_irq            = sh7751systemh_init_irq,
+};
diff --git a/arch/sh/boards/mach-titan/Makefile b/arch/sh/boards/mach-titan/Makefile
new file mode 100644 (file)
index 0000000..08d7537
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Nimble Microsystems TITAN specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
diff --git a/arch/sh/boards/mach-titan/io.c b/arch/sh/boards/mach-titan/io.c
new file mode 100644 (file)
index 0000000..4730c1d
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ *     I/O routines for Titan
+ */
+#include <linux/pci.h>
+#include <asm/machvec.h>
+#include <asm/addrspace.h>
+#include <asm/titan.h>
+#include <asm/io.h>
+
+static inline unsigned int port2adr(unsigned int port)
+{
+        maybebadio((unsigned long)port);
+        return port;
+}
+
+u8 titan_inb(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inb(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inb(pci_ioaddr(port));
+        return ctrl_inw(port2adr(port)) & 0xff;
+}
+
+u8 titan_inb_p(unsigned long port)
+{
+        u8 v;
+
+        if (PXSEG(port))
+                v = ctrl_inb(port);
+        else if (is_pci_ioaddr(port))
+                v = ctrl_inb(pci_ioaddr(port));
+        else
+                v = ctrl_inw(port2adr(port)) & 0xff;
+        ctrl_delay();
+        return v;
+}
+
+u16 titan_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inw(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inw(pci_ioaddr(port));
+        else if (port >= 0x2000)
+                return ctrl_inw(port2adr(port));
+        else
+                maybebadio(port);
+        return 0;
+}
+
+u32 titan_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inl(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inl(pci_ioaddr(port));
+        else if (port >= 0x2000)
+                return ctrl_inw(port2adr(port));
+        else
+                maybebadio(port);
+        return 0;
+}
+
+void titan_outb(u8 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outb(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outb(value, pci_ioaddr(port));
+        else
+                ctrl_outw(value, port2adr(port));
+}
+
+void titan_outb_p(u8 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outb(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outb(value, pci_ioaddr(port));
+        else
+                ctrl_outw(value, port2adr(port));
+        ctrl_delay();
+}
+
+void titan_outw(u16 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outw(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outw(value, pci_ioaddr(port));
+        else if (port >= 0x2000)
+                ctrl_outw(value, port2adr(port));
+        else
+                maybebadio(port);
+}
+
+void titan_outl(u32 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outl(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outl(value, pci_ioaddr(port));
+        else
+                maybebadio(port);
+}
+
+void titan_insl(unsigned long port, void *dst, unsigned long count)
+{
+        maybebadio(port);
+}
+
+void titan_outsl(unsigned long port, const void *src, unsigned long count)
+{
+        maybebadio(port);
+}
+
+void __iomem *titan_ioport_map(unsigned long port, unsigned int size)
+{
+       if (PXSEG(port) || is_pci_memaddr(port))
+               return (void __iomem *)port;
+       else if (is_pci_ioaddr(port))
+               return (void __iomem *)pci_ioaddr(port);
+
+       return (void __iomem *)port2adr(port);
+}
diff --git a/arch/sh/boards/mach-titan/setup.c b/arch/sh/boards/mach-titan/setup.c
new file mode 100644 (file)
index 0000000..5de3b2a
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * arch/sh/boards/titan/setup.c - Setup for Titan
+ *
+ *  Copyright (C) 2006  Jamie Lenehan
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/titan.h>
+#include <asm/io.h>
+
+static void __init init_titan_irq(void)
+{
+       /* enable individual interrupt mode for externals */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static struct sh_machine_vector mv_titan __initmv = {
+       .mv_name =      "Titan",
+
+       .mv_inb =       titan_inb,
+       .mv_inw =       titan_inw,
+       .mv_inl =       titan_inl,
+       .mv_outb =      titan_outb,
+       .mv_outw =      titan_outw,
+       .mv_outl =      titan_outl,
+
+       .mv_inb_p =     titan_inb_p,
+       .mv_inw_p =     titan_inw,
+       .mv_inl_p =     titan_inl,
+       .mv_outb_p =    titan_outb_p,
+       .mv_outw_p =    titan_outw,
+       .mv_outl_p =    titan_outl,
+
+       .mv_insl =      titan_insl,
+       .mv_outsl =     titan_outsl,
+
+       .mv_ioport_map = titan_ioport_map,
+
+       .mv_init_irq =  init_titan_irq,
+};
diff --git a/arch/sh/boards/mach-x3proto/Makefile b/arch/sh/boards/mach-x3proto/Makefile
new file mode 100644 (file)
index 0000000..983e455
--- /dev/null
@@ -0,0 +1 @@
+obj-y += setup.o ilsel.o
diff --git a/arch/sh/boards/mach-x3proto/ilsel.c b/arch/sh/boards/mach-x3proto/ilsel.c
new file mode 100644 (file)
index 0000000..b5c673c
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * arch/sh/boards/renesas/x3proto/ilsel.c
+ *
+ * Helper routines for SH-X3 proto board ILSEL.
+ *
+ * Copyright (C) 2007 Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/bitmap.h>
+#include <linux/io.h>
+#include <asm/ilsel.h>
+
+/*
+ * ILSEL is split across:
+ *
+ *     ILSEL0 - 0xb8100004 [ Levels  1 -  4 ]
+ *     ILSEL1 - 0xb8100006 [ Levels  5 -  8 ]
+ *     ILSEL2 - 0xb8100008 [ Levels  9 - 12 ]
+ *     ILSEL3 - 0xb810000a [ Levels 13 - 15 ]
+ *
+ * With each level being relative to an ilsel_source_t.
+ */
+#define ILSEL_BASE     0xb8100004
+#define ILSEL_LEVELS   15
+
+/*
+ * ILSEL level map, in descending order from the highest level down.
+ *
+ * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping
+ * directly to IRLs. As the IRQs are numbered in reverse order relative
+ * to the interrupt level, the level map is carefully managed to ensure a
+ * 1:1 mapping between the bit position and the IRQ number.
+ *
+ * This careful constructions allows ilsel_enable*() to be referenced
+ * directly for hooking up an ILSEL set and getting back an IRQ which can
+ * subsequently be used for internal accounting in the (optional) disable
+ * path.
+ */
+static unsigned long ilsel_level_map;
+
+static inline unsigned int ilsel_offset(unsigned int bit)
+{
+       return ILSEL_LEVELS - bit - 1;
+}
+
+static inline unsigned long mk_ilsel_addr(unsigned int bit)
+{
+       return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
+}
+
+static inline unsigned int mk_ilsel_shift(unsigned int bit)
+{
+       return (ilsel_offset(bit) & 0x3) << 2;
+}
+
+static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
+{
+       unsigned int tmp, shift;
+       unsigned long addr;
+
+       addr = mk_ilsel_addr(bit);
+       shift = mk_ilsel_shift(bit);
+
+       pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
+                __func__, bit, addr, shift, set);
+
+       tmp = ctrl_inw(addr);
+       tmp &= ~(0xf << shift);
+       tmp |= set << shift;
+       ctrl_outw(tmp, addr);
+}
+
+/**
+ * ilsel_enable - Enable an ILSEL set.
+ * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
+ *
+ * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
+ * available interrupt level. Callers should take care to order callsites
+ * noting descending interrupt levels. Aliasing FPGA and external board
+ * IRQs need to use ilsel_enable_fixed().
+ *
+ * The return value is an IRQ number that can later be taken down with
+ * ilsel_disable().
+ */
+int ilsel_enable(ilsel_source_t set)
+{
+       unsigned int bit;
+
+       /* Aliased sources must use ilsel_enable_fixed() */
+       BUG_ON(set > ILSEL_KEY);
+
+       do {
+               bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
+       } while (test_and_set_bit(bit, &ilsel_level_map));
+
+       __ilsel_enable(set, bit);
+
+       return bit;
+}
+EXPORT_SYMBOL_GPL(ilsel_enable);
+
+/**
+ * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level
+ * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
+ * @level: Interrupt level (1 - 15)
+ *
+ * Enables a given ILSEL source at a fixed interrupt level. Necessary
+ * both for level reservation as well as for aliased sources that only
+ * exist on special ILSEL#s.
+ *
+ * Returns an IRQ number (as ilsel_enable()).
+ */
+int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)
+{
+       unsigned int bit = ilsel_offset(level - 1);
+
+       if (test_and_set_bit(bit, &ilsel_level_map))
+               return -EBUSY;
+
+       __ilsel_enable(set, bit);
+
+       return bit;
+}
+EXPORT_SYMBOL_GPL(ilsel_enable_fixed);
+
+/**
+ * ilsel_disable - Disable an ILSEL set
+ * @irq: Bit position for ILSEL set value (retval from enable routines)
+ *
+ * Disable a previously enabled ILSEL set.
+ */
+void ilsel_disable(unsigned int irq)
+{
+       unsigned long addr;
+       unsigned int tmp;
+
+       addr = mk_ilsel_addr(irq);
+
+       tmp = ctrl_inw(addr);
+       tmp &= ~(0xf << mk_ilsel_shift(irq));
+       ctrl_outw(tmp, addr);
+
+       clear_bit(irq, &ilsel_level_map);
+}
+EXPORT_SYMBOL_GPL(ilsel_disable);
diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c
new file mode 100644 (file)
index 0000000..abc5b6d
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * arch/sh/boards/renesas/x3proto/setup.c
+ *
+ * Renesas SH-X3 Prototype Board Support.
+ *
+ * Copyright (C) 2007 Paul Mundt
+ *
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <asm/ilsel.h>
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = 0xb8140020,
+               .end    = 0xb8140020,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start          = 0x18000300,
+               .end            = 0x18000300 + 0x10 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               /* Filled in by ilsel */
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .resource       = smc91x_resources,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+};
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = 0x18040000,
+               .end    = 0x18080000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               /* Filled in by ilsel */
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource m66592_usb_peripheral_resources[] = {
+       [0] = {
+               .name   = "m66592_udc",
+               .start  = 0x18080000,
+               .end    = 0x180c0000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "m66592_udc",
+               /* Filled in by ilsel */
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device m66592_usb_peripheral_device = {
+       .name           = "m66592_udc",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
+       .resource       = m66592_usb_peripheral_resources,
+};
+
+static struct platform_device *x3proto_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_device,
+       &r8a66597_usb_host_device,
+       &m66592_usb_peripheral_device,
+};
+
+static int __init x3proto_devices_setup(void)
+{
+       r8a66597_usb_host_resources[1].start =
+               r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
+
+       m66592_usb_peripheral_resources[1].start =
+               m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
+
+       smc91x_resources[1].start =
+               smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
+
+       return platform_add_devices(x3proto_devices,
+                                   ARRAY_SIZE(x3proto_devices));
+}
+device_initcall(x3proto_devices_setup);
+
+static void __init x3proto_init_irq(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRL3210);
+
+       /* Set ICR0.LVLMODE */
+       ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
+}
+
+static struct sh_machine_vector mv_x3proto __initmv = {
+       .mv_name                = "x3proto",
+       .mv_init_irq            = x3proto_init_irq,
+};
diff --git a/arch/sh/boards/magicpanelr2/Kconfig b/arch/sh/boards/magicpanelr2/Kconfig
deleted file mode 100644 (file)
index b0abddc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-if SH_MAGIC_PANEL_R2
-
-menu "Magic Panel R2 options"
-
-config SH_MAGIC_PANEL_R2_VERSION
-       int SH_MAGIC_PANEL_R2_VERSION
-       default "3"
-       help
-         Set the version of the Magic Panel R2
-
-endmenu
-
-endif
diff --git a/arch/sh/boards/magicpanelr2/Makefile b/arch/sh/boards/magicpanelr2/Makefile
deleted file mode 100644 (file)
index 7a6d586..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Magic Panel specific parts
-#
-
-obj-y   := setup.o
\ No newline at end of file
diff --git a/arch/sh/boards/magicpanelr2/setup.c b/arch/sh/boards/magicpanelr2/setup.c
deleted file mode 100644 (file)
index f3b8b07..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * linux/arch/sh/boards/magicpanel/setup.c
- *
- *  Copyright (C) 2007  Markus Brunner, Mark Jonas
- *
- *  Magic Panel Release 2 board setup
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <asm/magicpanelr2.h>
-#include <asm/heartbeat.h>
-
-#define LAN9115_READY  (ctrl_inl(0xA8000084UL) & 0x00000001UL)
-
-/* Prefer cmdline over RedBoot */
-static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
-
-/* Wait until reset finished. Timeout is 100ms. */
-static int __init ethernet_reset_finished(void)
-{
-       int i;
-
-       if (LAN9115_READY)
-               return 1;
-
-       for (i = 0; i < 10; ++i) {
-               mdelay(10);
-               if (LAN9115_READY)
-                       return 1;
-       }
-
-       return 0;
-}
-
-static void __init reset_ethernet(void)
-{
-       /* PMDR: LAN_RESET=on */
-       CLRBITS_OUTB(0x10, PORT_PMDR);
-
-       udelay(200);
-
-       /* PMDR: LAN_RESET=off */
-       SETBITS_OUTB(0x10, PORT_PMDR);
-}
-
-static void __init setup_chip_select(void)
-{
-       /* CS2: LAN (0x08000000 - 0x0bffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x36db0400, CS2BCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x000003c0, CS2WCR);
-
-       /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS4BCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS4WCR);
-
-       /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS5ABCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS5AWCR);
-
-       /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS5BBCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS5BWCR);
-
-       /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS6ABCR);
-       /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
-       ctrl_outl(0x001009C1, CS6AWCR);
-}
-
-static void __init setup_port_multiplexing(void)
-{
-       /* A7 GPO(LED8);     A6 GPO(LED7);     A5 GPO(LED6);      A4 GPO(LED5);
-        * A3 GPO(LED4);     A2 GPO(LED3);     A1 GPO(LED2);      A0 GPO(LED1);
-        */
-       ctrl_outw(0x5555, PORT_PACR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* B7 GPO(RST4);   B6 GPO(RST3);  B5 GPO(RST2);    B4 GPO(RST1);
-        * B3 GPO(PB3);    B2 GPO(PB2);   B1 GPO(PB1);     B0 GPO(PB0);
-        */
-       ctrl_outw(0x5555, PORT_PBCR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* C7 GPO(PC7);   C6 GPO(PC6);    C5 GPO(PC5);     C4 GPO(PC4);
-        * C3 LCD_DATA3;  C2 LCD_DATA2;   C1 LCD_DATA1;    C0 LCD_DATA0;
-        */
-       ctrl_outw(0x5500, PORT_PCCR);   /* 01 01 01 01 00 00 00 00 */
-
-       /* D7 GPO(PD7); D6 GPO(PD6);    D5 GPO(PD5);       D4 GPO(PD4);
-        * D3 GPO(PD3); D2 GPO(PD2);    D1 GPO(PD1);       D0 GPO(PD0);
-        */
-       ctrl_outw(0x5555, PORT_PDCR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* E7 (x);        E6 GPI(nu);    E5 GPI(nu);      E4 LCD_M_DISP;
-        * E3 LCD_CL1;    E2 LCD_CL2;    E1 LCD_DON;      E0 LCD_FLM;
-        */
-       ctrl_outw(0x3C00, PORT_PECR);   /* 00 11 11 00 00 00 00 00 */
-
-       /* F7 (x);           F6 DA1(VLCD);     F5 DA0(nc);        F4 AN3;
-        * F3 AN2(MID_AD);   F2 AN1(EARTH_AD); F1 AN0(TEMP);      F0 GPI+(nc);
-        */
-       ctrl_outw(0x0002, PORT_PFCR);   /* 00 00 00 00 00 00 00 10 */
-
-       /* G7 (x);        G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
-        * G3 GPI(KEY1);  G2 GPO(LED11);        G1 GPO(LED10);     G0 GPO(LED9);
-        */
-       ctrl_outw(0x03D5, PORT_PGCR);   /* 00 00 00 11 11 01 01 01 */
-
-       /* H7 (x);            H6 /RAS(BRAS);      H5 /CAS(BCAS); H4 CKE(BCKE);
-        * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR;   H0 USB1_PWR;
-        */
-       ctrl_outw(0x0050, PORT_PHCR);   /* 00 00 00 00 01 01 00 00 */
-
-       /* J7 (x);        J6 AUDCK;        J5 ASEBRKAK;     J4 AUDATA3;
-        * J3 AUDATA2;    J2 AUDATA1;      J1 AUDATA0;      J0 AUDSYNC;
-        */
-       ctrl_outw(0x0000, PORT_PJCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* K7 (x);          K6 (x);          K5 (x);       K4 (x);
-        * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
-        */
-       ctrl_outw(0x00FF, PORT_PKCR);   /* 00 00 00 00 11 11 11 11 */
-
-       /* L7 TRST;        L6 TMS;           L5 TDO;              L4 TDI;
-        * L3 TCK;         L2 (x);           L1 (x);              L0 (x);
-        */
-       ctrl_outw(0x0000, PORT_PLCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* M7 GPO(CURRENT_SINK);    M6 GPO(PWR_SWITCH);     M5 GPO(LAN_SPEED);
-        * M4 GPO(LAN_RESET);       M3 GPO(BUZZER);         M2 GPO(LCD_BL);
-        * M1 CS5B(CAN3_CS);        M0 GPI+(nc);
-        */
-       ctrl_outw(0x5552, PORT_PMCR);      /* 01 01 01 01 01 01 00 10 */
-
-       /* CURRENT_SINK=off,    PWR_SWITCH=off, LAN_SPEED=100MBit,
-        * LAN_RESET=off,       BUZZER=off,     LCD_BL=off
-        */
-#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
-       ctrl_outb(0x30, PORT_PMDR);
-#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
-       ctrl_outb(0xF0, PORT_PMDR);
-#else
-#error Unknown revision of PLATFORM_MP_R2
-#endif
-
-       /* P7 (x);             P6 (x);            P5 (x);
-        * P4 GPO(nu);         P3 IRQ3(LAN_IRQ);  P2 IRQ2(CAN3_IRQ);
-        * P1 IRQ1(CAN2_IRQ);  P0 IRQ0(CAN1_IRQ)
-        */
-       ctrl_outw(0x0100, PORT_PPCR);   /* 00 00 00 01 00 00 00 00 */
-       ctrl_outb(0x10, PORT_PPDR);
-
-       /* R7 A25;           R6 A24;         R5 A23;              R4 A22;
-        * R3 A21;           R2 A20;         R1 A19;              R0 A0;
-        */
-       ctrl_outw(0x0000, PORT_PRCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* S7 (x);              S6 (x);        S5 (x);       S4 GPO(EEPROM_CS2);
-        * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD; S0 SIOF0_SCK;
-        */
-       ctrl_outw(0x0140, PORT_PSCR);   /* 00 00 00 01 01 00 00 00 */
-
-       /* T7 (x);         T6 (x);        T5 (x);         T4 COM1_CTS;
-        * T3 COM1_RTS;    T2 COM1_TXD;   T1 COM1_RXD;    T0 GPO(WDOG)
-        */
-       ctrl_outw(0x0001, PORT_PTCR);   /* 00 00 00 00 00 00 00 01 */
-
-       /* U7 (x);           U6 (x);       U5 (x);        U4 GPI+(/AC_FAULT);
-        * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD;  U0 TOUCH_SCK;
-        */
-       ctrl_outw(0x0240, PORT_PUCR);   /* 00 00 00 10 01 00 00 00 */
-
-       /* V7 (x);        V6 (x);       V5 (x);           V4 GPO(MID2);
-        * V3 GPO(MID1);  V2 CARD_TxD;  V1 CARD_RxD;      V0 GPI+(/BAT_FAULT);
-        */
-       ctrl_outw(0x0142, PORT_PVCR);   /* 00 00 00 01 01 00 00 10 */
-}
-
-static void __init mpr2_setup(char **cmdline_p)
-{
-       __set_io_port_base(0xa0000000);
-
-       /* set Pin Select Register A:
-        * /PCC_CD1, /PCC_CD2,  PCC_BVD1, PCC_BVD2,
-        * /IOIS16,  IRQ4,      IRQ5,     USB1d_SUSPEND
-        */
-       ctrl_outw(0xAABC, PORT_PSELA);
-       /* set Pin Select Register B:
-        * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
-        * LCD_VEPWC,  IIC_SDA,    IIC_SCL, Reserved
-        */
-       ctrl_outw(0x3C00, PORT_PSELB);
-       /* set Pin Select Register C:
-        * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
-        */
-       ctrl_outw(0x0000, PORT_PSELC);
-       /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
-        * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
-        */
-       ctrl_outw(0x0000, PORT_PSELD);
-       /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
-       ctrl_outw(0x0101, PORT_UTRCTL);
-       /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
-       ctrl_outw(0xA5C0, PORT_UCLKCR_W);
-
-       setup_chip_select();
-
-       setup_port_multiplexing();
-
-       reset_ethernet();
-
-       printk(KERN_INFO "Magic Panel Release 2 A.%i\n",
-                               CONFIG_SH_MAGIC_PANEL_R2_VERSION);
-
-       if (ethernet_reset_finished() == 0)
-               printk(KERN_WARNING "Ethernet not ready\n");
-}
-
-static struct resource smc911x_resources[] = {
-       [0] = {
-               .start          = 0xa8000000,
-               .end            = 0xabffffff,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 35,
-               .end            = 35,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc911x_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc911x_resources),
-       .resource       = smc911x_resources,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .flags          = HEARTBEAT_INVERTED,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition *parsed_partitions;
-
-static struct mtd_partition mpr2_partitions[] = {
-       /* Reserved for bootloader, read-only */
-       {
-               .name = "Bootloader",
-               .offset = 0x00000000UL,
-               .size = MPR2_MTD_BOOTLOADER_SIZE,
-               .mask_flags = MTD_WRITEABLE,
-       },
-       /* Reserved for kernel image */
-       {
-               .name = "Kernel",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MPR2_MTD_KERNEL_SIZE,
-       },
-       /* Rest is used for Flash FS */
-       {
-               .name = "Flash_FS",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MTDPART_SIZ_FULL,
-       }
-};
-
-static struct physmap_flash_data flash_data = {
-       .width          = 2,
-};
-
-static struct resource flash_resource = {
-       .start          = 0x00000000,
-       .end            = 0x2000000UL,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
-       .name           = "physmap-flash",
-       .id             = -1,
-       .resource       = &flash_resource,
-       .num_resources  = 1,
-       .dev            = {
-               .platform_data = &flash_data,
-       },
-};
-
-static struct mtd_info *flash_mtd;
-
-static struct map_info mpr2_flash_map = {
-       .name = "Magic Panel R2 Flash",
-       .size = 0x2000000UL,
-       .bankwidth = 2,
-};
-
-static void __init set_mtd_partitions(void)
-{
-       int nr_parts = 0;
-
-       simple_map_init(&mpr2_flash_map);
-       flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
-       nr_parts = parse_mtd_partitions(flash_mtd, probes,
-                                       &parsed_partitions, 0);
-       /* If there is no partition table, used the hard coded table */
-       if (nr_parts <= 0) {
-               flash_data.parts = mpr2_partitions;
-               flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
-       } else {
-               flash_data.nr_parts = nr_parts;
-               flash_data.parts = parsed_partitions;
-       }
-}
-
-/*
- * Add all resources to the platform_device
- */
-
-static struct platform_device *mpr2_devices[] __initdata = {
-       &heartbeat_device,
-       &smc911x_device,
-       &flash_device,
-};
-
-
-static int __init mpr2_devices_setup(void)
-{
-       set_mtd_partitions();
-       return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
-}
-device_initcall(mpr2_devices_setup);
-
-/*
- * Initialize IRQ setting
- */
-static void __init init_mpr2_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
-
-       set_irq_type(32, IRQ_TYPE_LEVEL_LOW);    /* IRQ0 CAN1 */
-       set_irq_type(33, IRQ_TYPE_LEVEL_LOW);    /* IRQ1 CAN2 */
-       set_irq_type(34, IRQ_TYPE_LEVEL_LOW);    /* IRQ2 CAN3 */
-       set_irq_type(35, IRQ_TYPE_LEVEL_LOW);    /* IRQ3 SMSC9115 */
-       set_irq_type(36, IRQ_TYPE_EDGE_RISING);  /* IRQ4 touchscreen */
-       set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
-
-       intc_set_priority(32, 13);              /* IRQ0 CAN1 */
-       intc_set_priority(33, 13);              /* IRQ0 CAN2 */
-       intc_set_priority(34, 13);              /* IRQ0 CAN3 */
-       intc_set_priority(35, 6);               /* IRQ3 SMSC9115 */
-}
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_mpr2 __initmv = {
-       .mv_name                = "mpr2",
-       .mv_setup               = mpr2_setup,
-       .mv_init_irq            = init_mpr2_IRQ,
-};
diff --git a/arch/sh/boards/renesas/ap325rxa/Makefile b/arch/sh/boards/renesas/ap325rxa/Makefile
deleted file mode 100644 (file)
index f663768..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y  := setup.o
diff --git a/arch/sh/boards/renesas/ap325rxa/setup.c b/arch/sh/boards/renesas/ap325rxa/setup.c
deleted file mode 100644 (file)
index 7fa7446..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Renesas - AP-325RXA
- * (Compatible with Algo System ., LTD. - AP-320A)
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Author : Yusuke Goda <goda.yuske@renesas.com>
- *
- * 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.
- */
-
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/delay.h>
-#include <linux/smc911x.h>
-#include <media/soc_camera_platform.h>
-#include <media/sh_mobile_ceu.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/io.h>
-#include <asm/clock.h>
-
-static struct smc911x_platdata smc911x_info = {
-       .flags = SMC911X_USE_32BIT,
-       .irq_flags = IRQF_TRIGGER_LOW,
-};
-
-static struct resource smc9118_resources[] = {
-       [0] = {
-               .start  = 0xb6080000,
-               .end    = 0xb60fffff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 35,
-               .end    = 35,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device smc9118_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc9118_resources),
-       .resource       = smc9118_resources,
-       .dev            = {
-               .platform_data = &smc911x_info,
-       },
-};
-
-static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
-       {
-                .name = "uboot",
-                .offset = 0,
-                .size = (1 * 1024 * 1024),
-                .mask_flags = MTD_WRITEABLE,   /* Read-only */
-       }, {
-                .name = "kernel",
-                .offset = MTDPART_OFS_APPEND,
-                .size = (2 * 1024 * 1024),
-       }, {
-                .name = "other",
-                .offset = MTDPART_OFS_APPEND,
-                .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data ap325rxa_nor_flash_data = {
-       .width          = 2,
-       .parts          = ap325rxa_nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
-};
-
-static struct resource ap325rxa_nor_flash_resources[] = {
-       [0] = {
-               .name   = "NOR Flash",
-               .start  = 0x00000000,
-               .end    = 0x00ffffff,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device ap325rxa_nor_flash_device = {
-       .name           = "physmap-flash",
-       .resource       = ap325rxa_nor_flash_resources,
-       .num_resources  = ARRAY_SIZE(ap325rxa_nor_flash_resources),
-       .dev            = {
-               .platform_data = &ap325rxa_nor_flash_data,
-       },
-};
-
-#define FPGA_LCDREG    0xB4100180
-#define FPGA_BKLREG    0xB4100212
-#define FPGA_LCDREG_VAL        0x0018
-#define PORT_PHCR      0xA405010E
-#define PORT_PLCR      0xA4050114
-#define PORT_PMCR      0xA4050116
-#define PORT_PRCR      0xA405011C
-#define PORT_PSCR      0xA405011E
-#define PORT_PZCR      0xA405014C
-#define PORT_HIZCRA    0xA4050158
-#define PORT_MSELCRB   0xA4050182
-#define PORT_PSDR      0xA405013E
-#define PORT_PZDR      0xA405016C
-#define PORT_PSELD     0xA4050154
-
-static void ap320_wvga_power_on(void *board_data)
-{
-       msleep(100);
-
-       /* ASD AP-320/325 LCD ON */
-       ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG);
-
-       /* backlight */
-       ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR);
-       ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR);
-       ctrl_outw(0x100, FPGA_BKLREG);
-}
-
-static struct sh_mobile_lcdc_info lcdc_info = {
-       .clock_source = LCDC_CLK_EXTERNAL,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = RGB18,
-               .clock_divider = 1,
-               .lcd_cfg = {
-                       .name = "LB070WV1",
-                       .xres = 800,
-                       .yres = 480,
-                       .left_margin = 40,
-                       .right_margin = 160,
-                       .hsync_len = 8,
-                       .upper_margin = 63,
-                       .lower_margin = 80,
-                       .vsync_len = 1,
-                       .sync = 0, /* hsync and vsync are active low */
-               },
-               .board_cfg = {
-                       .display_on = ap320_wvga_power_on,
-               },
-       }
-};
-
-static struct resource lcdc_resources[] = {
-       [0] = {
-               .name   = "LCDC",
-               .start  = 0xfe940000, /* P4-only space */
-               .end    = 0xfe941fff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device lcdc_device = {
-       .name           = "sh_mobile_lcdc_fb",
-       .num_resources  = ARRAY_SIZE(lcdc_resources),
-       .resource       = lcdc_resources,
-       .dev            = {
-               .platform_data  = &lcdc_info,
-       },
-};
-
-static unsigned char camera_ncm03j_magic[] =
-{
-       0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
-       0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
-       0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
-       0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
-       0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
-       0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
-       0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
-       0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
-       0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
-       0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
-       0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
-       0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
-       0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
-       0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
-       0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
-       0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
-};
-
-static int camera_set_capture(struct soc_camera_platform_info *info,
-                             int enable)
-{
-       struct i2c_adapter *a = i2c_get_adapter(0);
-       struct i2c_msg msg;
-       int ret = 0;
-       int i;
-
-       if (!enable)
-               return 0; /* no disable for now */
-
-       for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
-               u_int8_t buf[8];
-
-               msg.addr = 0x6e;
-               msg.buf = buf;
-               msg.len = 2;
-               msg.flags = 0;
-
-               buf[0] = camera_ncm03j_magic[i];
-               buf[1] = camera_ncm03j_magic[i + 1];
-
-               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
-       }
-
-       return ret;
-}
-
-static struct soc_camera_platform_info camera_info = {
-       .iface = 0,
-       .format_name = "UYVY",
-       .format_depth = 16,
-       .format = {
-               .pixelformat = V4L2_PIX_FMT_UYVY,
-               .colorspace = V4L2_COLORSPACE_SMPTE170M,
-               .width = 640,
-               .height = 480,
-       },
-       .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-       .set_capture = camera_set_capture,
-};
-
-static struct platform_device camera_device = {
-       .name           = "soc_camera_platform",
-       .dev            = {
-               .platform_data  = &camera_info,
-       },
-};
-
-static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
-       .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-};
-
-static struct resource ceu_resources[] = {
-       [0] = {
-               .name   = "CEU",
-               .start  = 0xfe910000,
-               .end    = 0xfe91009f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 52,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [2] = {
-               /* place holder for contiguous memory */
-       },
-};
-
-static struct platform_device ceu_device = {
-       .name           = "sh_mobile_ceu",
-       .num_resources  = ARRAY_SIZE(ceu_resources),
-       .resource       = ceu_resources,
-       .dev            = {
-               .platform_data  = &sh_mobile_ceu_info,
-       },
-};
-
-static struct platform_device *ap325rxa_devices[] __initdata = {
-       &smc9118_device,
-       &ap325rxa_nor_flash_device,
-       &lcdc_device,
-       &ceu_device,
-       &camera_device,
-};
-
-static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
-};
-
-static int __init ap325rxa_devices_setup(void)
-{
-       clk_always_enable("mstp200"); /* LCDC */
-       clk_always_enable("mstp203"); /* CEU */
-
-       platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
-
-       i2c_register_board_info(0, ap325rxa_i2c_devices,
-                               ARRAY_SIZE(ap325rxa_i2c_devices));
-       return platform_add_devices(ap325rxa_devices,
-                               ARRAY_SIZE(ap325rxa_devices));
-}
-device_initcall(ap325rxa_devices_setup);
-
-static void __init ap325rxa_setup(char **cmdline_p)
-{
-       /* LCDC configuration */
-       ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR);
-       ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR);
-       ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA);
-
-       /* CEU */
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
-       ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
-       ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
-}
-
-static struct sh_machine_vector mv_ap325rxa __initmv = {
-       .mv_name = "AP-325RXA",
-       .mv_setup = ap325rxa_setup,
-};
diff --git a/arch/sh/boards/renesas/edosk7705/Makefile b/arch/sh/boards/renesas/edosk7705/Makefile
deleted file mode 100644 (file)
index 14bdd53..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Makefile for the EDOSK7705 specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
-
diff --git a/arch/sh/boards/renesas/edosk7705/io.c b/arch/sh/boards/renesas/edosk7705/io.c
deleted file mode 100644 (file)
index 541cea2..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * arch/sh/boards/renesas/edosk7705/io.c
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routines for Hitachi EDOSK7705 board.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/edosk7705/io.h>
-#include <asm/addrspace.h>
-
-#define SMC_IOADDR     0xA2000000
-
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
-/* Map the Ethernet addresses as if it is at 0x300 - 0x320 */
-unsigned long sh_edosk7705_isa_port2addr(unsigned long port)
-{
-     if (port >= 0x300 && port < 0x320) {
-         /* SMC91C96 registers are 4 byte aligned rather than the
-          * usual 2 byte!
-          */
-         return SMC_IOADDR + ( (port - 0x300) * 2);
-     }
-
-     maybebadio(sh_edosk7705_isa_port2addr, port);
-     return port;
-}
-
-/* Trying to read / write bytes on odd-byte boundaries to the Ethernet
- * registers causes problems. So we bit-shift the value and read / write
- * in 2 byte chunks. Setting the low byte to 0 does not cause problems
- * now as odd byte writes are only made on the bit mask / interrupt
- * register. This may not be the case in future Mar-2003 SJD
- */
-unsigned char sh_edosk7705_inb(unsigned long port)
-{
-       if (port >= 0x300 && port < 0x320 && port & 0x01) {
-               return (volatile unsigned char)(generic_inw(port -1) >> 8);
-       }
-       return *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port);
-}
-
-unsigned int sh_edosk7705_inl(unsigned long port)
-{
-       return *(volatile unsigned long *)port;
-}
-
-void sh_edosk7705_outb(unsigned char value, unsigned long port)
-{
-       if (port >= 0x300 && port < 0x320 && port & 0x01) {
-               generic_outw(((unsigned short)value << 8), port -1);
-               return;
-       }
-       *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port) = value;
-}
-
-void sh_edosk7705_outl(unsigned int value, unsigned long port)
-{
-       *(volatile unsigned long *)port = value;
-}
-
-void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *p = addr;
-       while (count--) *p++ = sh_edosk7705_inb(port);
-}
-
-void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned long *p = (unsigned long*)addr;
-       while (count--)
-               *p++ = *(volatile unsigned long *)port;
-}
-
-void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *p = (unsigned char*)addr;
-       while (count--) sh_edosk7705_outb(*p++, port);
-}
-
-void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned long *p = (unsigned long*)addr;
-       while (count--) sh_edosk7705_outl(*p++, port);
-}
-
diff --git a/arch/sh/boards/renesas/edosk7705/setup.c b/arch/sh/boards/renesas/edosk7705/setup.c
deleted file mode 100644 (file)
index f076c45..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * arch/sh/boards/renesas/edosk7705/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for edosk7705 development
- * board by S. Dunn, 2003.
- */
-#include <linux/init.h>
-#include <asm/machvec.h>
-#include <asm/edosk7705/io.h>
-
-static void __init sh_edosk7705_init_irq(void)
-{
-       /* This is the Ethernet interrupt */
-       make_imask_irq(0x09);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_edosk7705 __initmv = {
-       .mv_name                = "EDOSK7705",
-       .mv_nr_irqs             = 80,
-
-       .mv_inb                 = sh_edosk7705_inb,
-       .mv_inl                 = sh_edosk7705_inl,
-       .mv_outb                = sh_edosk7705_outb,
-       .mv_outl                = sh_edosk7705_outl,
-
-       .mv_inl_p               = sh_edosk7705_inl,
-       .mv_outl_p              = sh_edosk7705_outl,
-
-       .mv_insb                = sh_edosk7705_insb,
-       .mv_insl                = sh_edosk7705_insl,
-       .mv_outsb               = sh_edosk7705_outsb,
-       .mv_outsl               = sh_edosk7705_outsl,
-
-       .mv_isa_port2addr       = sh_edosk7705_isa_port2addr,
-       .mv_init_irq            = sh_edosk7705_init_irq,
-};
diff --git a/arch/sh/boards/renesas/migor/Kconfig b/arch/sh/boards/renesas/migor/Kconfig
deleted file mode 100644 (file)
index a7b3b72..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if SH_MIGOR
-
-choice
-       prompt "Migo-R LCD Panel Board Selection"
-       default SH_MIGOR_QVGA
-
-config SH_MIGOR_QVGA
-       bool "QVGA (320x240)"
-
-config SH_MIGOR_RTA_WVGA
-       bool "RTA WVGA (800x480)"
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/migor/Makefile b/arch/sh/boards/renesas/migor/Makefile
deleted file mode 100644 (file)
index 5f231dd..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-obj-y   := setup.o
-obj-$(CONFIG_SH_MIGOR_QVGA)    +=  lcd_qvga.o
diff --git a/arch/sh/boards/renesas/migor/lcd_qvga.c b/arch/sh/boards/renesas/migor/lcd_qvga.c
deleted file mode 100644 (file)
index 6e96095..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Support for SuperH MigoR Quarter VGA LCD Panel
- *
- * Copyright (C) 2008 Magnus Damm
- *
- * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd.
- * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>,
- *
- * 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.
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/fb.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/migor.h>
-
-/* LCD Module is a PH240320T according to board schematics. This module
- * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
- * Driver IC. This IC is connected to the SH7722 built-in LCDC using a
- * SYS-80 interface configured in 16 bit mode.
- *
- * Index 0: "Device Code Read" returns 0x1505.
- */
-
-static void reset_lcd_module(void)
-{
-       ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR);
-       mdelay(2);
-       ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR);
-       mdelay(1);
-}
-
-/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */
-
-static unsigned long adjust_reg18(unsigned short data)
-{
-       unsigned long tmp1, tmp2;
-
-       tmp1 = (data<<1 | 0x00000001) & 0x000001FF;
-       tmp2 = (data<<2 | 0x00000200) & 0x0003FE00;
-       return tmp1 | tmp2;
-}
-
-static void write_reg(void *sys_ops_handle,
-                      struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                      unsigned short reg, unsigned short data)
-{
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data));
-}
-
-static void write_reg16(void *sys_ops_handle,
-                       struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                       unsigned short reg, unsigned short data)
-{
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
-       sys_ops->write_data(sys_ops_handle, adjust_reg18(data));
-}
-
-static unsigned long read_reg16(void *sys_ops_handle,
-                               struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                               unsigned short reg)
-{
-       unsigned long data;
-
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
-       data = sys_ops->read_data(sys_ops_handle);
-       return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00);
-}
-
-static void migor_lcd_qvga_seq(void *sys_ops_handle,
-                              struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                              unsigned short const *data, int no_data)
-{
-       int i;
-
-       for (i = 0; i < no_data; i += 2)
-               write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]);
-}
-
-static const unsigned short sync_data[] = {
-       0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-
-static const unsigned short magic0_data[] = {
-       0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001,
-       0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116,
-       0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8,
-};
-
-static const unsigned short magic1_data[] = {
-       0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202,
-       0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303,
-       0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102,
-       0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300,
-       0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000,
-       0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000,
-       0x0015, 0x8000,
-};
-
-static const unsigned short magic2_data[] = {
-       0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021,
-};
-
-static const unsigned short magic3_data[] = {
-       0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
-};
-
-int migor_lcd_qvga_setup(void *board_data, void *sohandle,
-                        struct sh_mobile_lcdc_sys_bus_ops *so)
-{
-       unsigned long xres = 320;
-       unsigned long yres = 240;
-       int k;
-
-       reset_lcd_module();
-       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
-
-       if (read_reg16(sohandle, so, 0) != 0x1505)
-               return -ENODEV;
-
-       pr_info("Migo-R QVGA LCD Module detected.\n");
-
-       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
-       write_reg16(sohandle, so, 0x00A4, 0x0001);
-       mdelay(10);
-
-       migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data));
-       mdelay(100);
-
-       migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data));
-       write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1));
-       write_reg16(sohandle, so, 0x0051, 0x00ef);
-       write_reg16(sohandle, so, 0x0052, 0x0000);
-       write_reg16(sohandle, so, 0x0053, xres - 1);
-
-       migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data));
-       mdelay(10);
-
-       migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data));
-       mdelay(40);
-
-       /* clear GRAM to avoid displaying garbage */
-
-       write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */
-       write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */
-
-       for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */
-               write_reg16(sohandle, so, 0x0022, 0x0000);
-
-       write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */
-       write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */
-       write_reg16(sohandle, so, 0x0007, 0x0173);
-       mdelay(40);
-
-       /* enable display */
-       write_reg(sohandle, so, 0x00, 0x22);
-       mdelay(100);
-       return 0;
-}
diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c
deleted file mode 100644 (file)
index 7bd365a..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Renesas System Solutions Asia Pte. Ltd - Migo-R
- *
- * Copyright (C) 2008 Magnus Damm
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/nand.h>
-#include <linux/i2c.h>
-#include <linux/smc91x.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <media/soc_camera_platform.h>
-#include <media/sh_mobile_ceu.h>
-#include <asm/clock.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/sh_keysc.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/migor.h>
-
-/* Address     IRQ  Size  Bus  Description
- * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
- * 0x0c000000       64MB  64   SDRAM (2xK4M563233G)
- * 0x10000000  IRQ0       16   Ethernet (SMC91C111)
- * 0x14000000  IRQ4       16   USB 2.0 Host Controller (M66596)
- * 0x18000000       8GB    8   NAND Flash (K9K8G08U0A)
- */
-
-static struct smc91x_platdata smc91x_info = {
-       .flags = SMC91X_USE_16BIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "SMC91C111" ,
-               .start  = 0x10000300,
-               .end    = 0x1000030f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 32, /* IRQ0 */
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-       .dev    = {
-               .platform_data  = &smc91x_info,
-       },
-};
-
-static struct sh_keysc_info sh_keysc_info = {
-       .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
-       .scan_timing = 3,
-       .delay = 5,
-       .keycodes = {
-               0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
-               0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
-               0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
-               0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
-               0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
-       },
-};
-
-static struct resource sh_keysc_resources[] = {
-       [0] = {
-               .start  = 0x044b0000,
-               .end    = 0x044b000f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 79,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_keysc_device = {
-       .name           = "sh_keysc",
-       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
-       .resource       = sh_keysc_resources,
-       .dev    = {
-               .platform_data  = &sh_keysc_info,
-       },
-};
-
-static struct mtd_partition migor_nor_flash_partitions[] =
-{
-       {
-               .name = "uboot",
-               .offset = 0,
-               .size = (1 * 1024 * 1024),
-               .mask_flags = MTD_WRITEABLE,    /* Read-only */
-       },
-       {
-               .name = "rootfs",
-               .offset = MTDPART_OFS_APPEND,
-               .size = (15 * 1024 * 1024),
-       },
-       {
-               .name = "other",
-               .offset = MTDPART_OFS_APPEND,
-               .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data migor_nor_flash_data = {
-       .width          = 2,
-       .parts          = migor_nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(migor_nor_flash_partitions),
-};
-
-static struct resource migor_nor_flash_resources[] = {
-       [0] = {
-               .name           = "NOR Flash",
-               .start          = 0x00000000,
-               .end            = 0x03ffffff,
-               .flags          = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device migor_nor_flash_device = {
-       .name           = "physmap-flash",
-       .resource       = migor_nor_flash_resources,
-       .num_resources  = ARRAY_SIZE(migor_nor_flash_resources),
-       .dev            = {
-               .platform_data = &migor_nor_flash_data,
-       },
-};
-
-static struct mtd_partition migor_nand_flash_partitions[] = {
-       {
-               .name           = "nanddata1",
-               .offset         = 0x0,
-               .size           = 512 * 1024 * 1024,
-       },
-       {
-               .name           = "nanddata2",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 512 * 1024 * 1024,
-       },
-};
-
-static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
-                                    unsigned int ctrl)
-{
-       struct nand_chip *chip = mtd->priv;
-
-       if (cmd == NAND_CMD_NONE)
-               return;
-
-       if (ctrl & NAND_CLE)
-               writeb(cmd, chip->IO_ADDR_W + 0x00400000);
-       else if (ctrl & NAND_ALE)
-               writeb(cmd, chip->IO_ADDR_W + 0x00800000);
-       else
-               writeb(cmd, chip->IO_ADDR_W);
-}
-
-static int migor_nand_flash_ready(struct mtd_info *mtd)
-{
-       return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
-}
-
-struct platform_nand_data migor_nand_flash_data = {
-       .chip = {
-               .nr_chips = 1,
-               .partitions = migor_nand_flash_partitions,
-               .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
-               .chip_delay = 20,
-               .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
-       },
-       .ctrl = {
-               .dev_ready = migor_nand_flash_ready,
-               .cmd_ctrl = migor_nand_flash_cmd_ctl,
-       },
-};
-
-static struct resource migor_nand_flash_resources[] = {
-       [0] = {
-               .name           = "NAND Flash",
-               .start          = 0x18000000,
-               .end            = 0x18ffffff,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device migor_nand_flash_device = {
-       .name           = "gen_nand",
-       .resource       = migor_nand_flash_resources,
-       .num_resources  = ARRAY_SIZE(migor_nand_flash_resources),
-       .dev            = {
-               .platform_data = &migor_nand_flash_data,
-       }
-};
-
-static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
-#ifdef CONFIG_SH_MIGOR_RTA_WVGA
-       .clock_source = LCDC_CLK_BUS,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = RGB16,
-               .clock_divider = 2,
-               .lcd_cfg = {
-                       .name = "LB070WV1",
-                       .xres = 800,
-                       .yres = 480,
-                       .left_margin = 64,
-                       .right_margin = 16,
-                       .hsync_len = 120,
-                       .upper_margin = 1,
-                       .lower_margin = 17,
-                       .vsync_len = 2,
-                       .sync = 0,
-               },
-       }
-#endif
-#ifdef CONFIG_SH_MIGOR_QVGA
-       .clock_source = LCDC_CLK_PERIPHERAL,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = SYS16A,
-               .clock_divider = 10,
-               .lcd_cfg = {
-                       .name = "PH240320T",
-                       .xres = 320,
-                       .yres = 240,
-                       .left_margin = 0,
-                       .right_margin = 16,
-                       .hsync_len = 8,
-                       .upper_margin = 1,
-                       .lower_margin = 17,
-                       .vsync_len = 2,
-                       .sync = FB_SYNC_HOR_HIGH_ACT,
-               },
-               .board_cfg = {
-                       .setup_sys = migor_lcd_qvga_setup,
-               },
-               .sys_bus_cfg = {
-                       .ldmt2r = 0x06000a09,
-                       .ldmt3r = 0x180e3418,
-               },
-       }
-#endif
-};
-
-static struct resource migor_lcdc_resources[] = {
-       [0] = {
-               .name   = "LCDC",
-               .start  = 0xfe940000, /* P4-only space */
-               .end    = 0xfe941fff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device migor_lcdc_device = {
-       .name           = "sh_mobile_lcdc_fb",
-       .num_resources  = ARRAY_SIZE(migor_lcdc_resources),
-       .resource       = migor_lcdc_resources,
-       .dev    = {
-               .platform_data  = &sh_mobile_lcdc_info,
-       },
-};
-
-static struct clk *camera_clk;
-
-static void camera_power_on(void)
-{
-       unsigned char value;
-
-       camera_clk = clk_get(NULL, "video_clk");
-       clk_set_rate(camera_clk, 24000000);
-       clk_enable(camera_clk); /* start VIO_CKO */
-
-       mdelay(10);
-       value = ctrl_inb(PORT_PTDR);
-       value &= ~0x09;
-#ifndef CONFIG_SH_MIGOR_RTA_WVGA
-       value |= 0x01;
-#endif
-       ctrl_outb(value, PORT_PTDR);
-       mdelay(10);
-
-       ctrl_outb(value | 8, PORT_PTDR);
-}
-
-static void camera_power_off(void)
-{
-       clk_disable(camera_clk); /* stop VIO_CKO */
-       clk_put(camera_clk);
-
-       ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR);
-}
-
-static unsigned char camera_ov772x_magic[] =
-{
-       0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
-       0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
-       0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
-       0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
-       0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0,
-       0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00,
-       0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00,
-       0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2,
-       0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80,
-       0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00,
-       0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50,
-       0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60,
-       0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a,
-       0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f,
-       0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00,
-       0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01,
-       0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f,
-       0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f,
-       0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70,
-       0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e,
-       0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69,
-       0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f,
-       0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4,
-       0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00,
-       0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f,
-       0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08,
-       0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e,
-       0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02,
-       0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06,
-       0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40,
-       0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff,
-       0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f,
-       0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50,
-       0x2c, 0x78,
-};
-
-static int ov772x_set_capture(struct soc_camera_platform_info *info,
-                             int enable)
-{
-       struct i2c_adapter *a = i2c_get_adapter(0);
-       struct i2c_msg msg;
-       int ret = 0;
-       int i;
-
-       if (!enable)
-               return 0; /* camera_power_off() is enough */
-
-       for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) {
-               u_int8_t buf[8];
-
-               msg.addr = 0x21;
-               msg.buf = buf;
-               msg.len = 2;
-               msg.flags = 0;
-
-               buf[0] = camera_ov772x_magic[i];
-               buf[1] = camera_ov772x_magic[i + 1];
-
-               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
-       }
-
-       return ret;
-}
-
-static struct soc_camera_platform_info ov772x_info = {
-       .iface = 0,
-       .format_name = "RGB565",
-       .format_depth = 16,
-       .format = {
-               .pixelformat = V4L2_PIX_FMT_RGB565,
-               .colorspace = V4L2_COLORSPACE_SRGB,
-               .width = 320,
-               .height = 240,
-       },
-       .bus_param =  SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-       .set_capture = ov772x_set_capture,
-};
-
-static struct platform_device migor_camera_device = {
-       .name           = "soc_camera_platform",
-       .dev    = {
-               .platform_data  = &ov772x_info,
-       },
-};
-
-static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
-       .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
-       | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
-       .enable_camera = camera_power_on,
-       .disable_camera = camera_power_off,
-};
-
-static struct resource migor_ceu_resources[] = {
-       [0] = {
-               .name   = "CEU",
-               .start  = 0xfe910000,
-               .end    = 0xfe91009f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 52,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [2] = {
-               /* place holder for contiguous memory */
-       },
-};
-
-static struct platform_device migor_ceu_device = {
-       .name           = "sh_mobile_ceu",
-       .num_resources  = ARRAY_SIZE(migor_ceu_resources),
-       .resource       = migor_ceu_resources,
-       .dev    = {
-               .platform_data  = &sh_mobile_ceu_info,
-       },
-};
-
-static struct platform_device *migor_devices[] __initdata = {
-       &smc91x_eth_device,
-       &sh_keysc_device,
-       &migor_lcdc_device,
-       &migor_ceu_device,
-       &migor_camera_device,
-       &migor_nor_flash_device,
-       &migor_nand_flash_device,
-};
-
-static struct i2c_board_info migor_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("rs5c372b", 0x32),
-       },
-       {
-               I2C_BOARD_INFO("migor_ts", 0x51),
-               .irq = 38, /* IRQ6 */
-       },
-};
-
-static int __init migor_devices_setup(void)
-{
-       clk_always_enable("mstp214"); /* KEYSC */
-       clk_always_enable("mstp200"); /* LCDC */
-       clk_always_enable("mstp203"); /* CEU */
-
-       platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
-
-       i2c_register_board_info(0, migor_i2c_devices,
-                               ARRAY_SIZE(migor_i2c_devices));
-       return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
-}
-__initcall(migor_devices_setup);
-
-static void __init migor_setup(char **cmdline_p)
-{
-       /* SMC91C111 - Enable IRQ0 */
-       ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
-
-       /* KEYSC */
-       ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
-       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
-       ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
-
-       /* NAND Flash */
-       ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
-       ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
-                 BSC_CS6ABCR);
-
-       /* Touch Panel - Enable IRQ6 */
-       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
-       ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
-       ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
-
-#ifdef CONFIG_SH_MIGOR_RTA_WVGA
-       /* LCDC - WVGA - Enable RGB Interface signals */
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
-       ctrl_outw(0x0000, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR);
-       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
-#endif
-#ifdef CONFIG_SH_MIGOR_QVGA
-       /* LCDC - QVGA - Enable SYS Interface signals */
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
-       ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR);
-       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
-#endif
-
-       /* CEU */
-       ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR);
-       ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR);
-       ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR);
-       ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR);
-       ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC);
-       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB);
-}
-
-static struct sh_machine_vector mv_migor __initmv = {
-       .mv_name                = "Migo-R",
-       .mv_setup               = migor_setup,
-};
diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig
deleted file mode 100644 (file)
index fc8f28e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-if SH_HIGHLANDER
-
-choice
-       prompt "Highlander options"
-       default SH_R7780MP
-
-config SH_R7780RP
-       bool "R7780RP-1 board support"
-       depends on CPU_SUBTYPE_SH7780
-
-config SH_R7780MP
-       bool "R7780MP board support"
-       depends on CPU_SUBTYPE_SH7780
-       help
-         Selecting this option will enable support for the mass-production
-         version of the R7780RP. If in doubt, say Y.
-
-config SH_R7785RP
-       bool "R7785RP board support"
-       depends on CPU_SUBTYPE_SH7785
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile
deleted file mode 100644 (file)
index 20a1008..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the R7780RP-1 specific parts of the kernel
-#
-irqinit-$(CONFIG_SH_R7780MP)   := irq-r7780mp.o
-irqinit-$(CONFIG_SH_R7785RP)   := irq-r7785rp.o
-irqinit-$(CONFIG_SH_R7780RP)   := irq-r7780rp.o
-obj-y                          := setup.o $(irqinit-y)
-
-ifneq ($(CONFIG_SH_R7785RP),y)
-obj-$(CONFIG_PUSH_SWITCH)      += psw.o
-endif
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
deleted file mode 100644 (file)
index ae1cfcb..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Renesas Solutions Highlander R7780MP Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006  Paul Mundt
- * Copyright (C) 2007  Magnus Damm
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-       CF,             /* Compact Flash */
-       TP,             /* Touch panel */
-       SCIF1,          /* FPGA SCIF1 */
-       SCIF0,          /* FPGA SCIF0 */
-       SMBUS,          /* SMBUS */
-       RTC,            /* RTC Alarm */
-       AX88796,        /* Ethernet controller */
-       PSW,            /* Push Switch */
-
-       /* external bus connector */
-       EXT1, EXT2, EXT4, EXT5, EXT6,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(TP, IRQ_TP),
-       INTC_IRQ(SCIF1, IRQ_SCIF1),
-       INTC_IRQ(SCIF0, IRQ_SCIF0),
-       INTC_IRQ(SMBUS, IRQ_SMBUS),
-       INTC_IRQ(RTC, IRQ_RTC),
-       INTC_IRQ(AX88796, IRQ_AX88796),
-       INTC_IRQ(PSW, IRQ_PSW),
-
-       INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
-       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
-       INTC_IRQ(EXT6, IRQ_EXT6),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
-           0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
-       IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
-       IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
-       0, IRQ_AX88796, IRQ_PSW,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
-               printk(KERN_INFO "Using r7780mp interrupt controller.\n");
-               register_intc_controller(&intc_desc);
-               return irl2irq;
-       }
-
-       return NULL;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c
deleted file mode 100644 (file)
index 9d3921f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Renesas Solutions Highlander R7780RP-1 Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006  Paul Mundt
- * Copyright (C) 2008  Magnus Damm
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-
-       AX88796,          /* Ethernet controller */
-       PSW,              /* Push Switch */
-       CF,               /* Compact Flash */
-
-       PCI_A,
-       PCI_B,
-       PCI_C,
-       PCI_D,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
-       INTC_IRQ(PCI_B, 66),
-       INTC_IRQ(PCI_C, 67),
-       INTC_IRQ(PCI_D, 68),
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(PSW, IRQ_PSW),
-       INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa5000000, 0, 16, /* IRLMSK */
-         { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
-           0, 0, 0, 0, 0, 0, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       65, 66, 67, 68,
-       IRQ_CF, 0, 0, 0,
-       0, 0, 0, 0,
-       IRQ_AX88796, IRQ_PSW
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if (ctrl_inw(0xa5000600)) {
-               printk(KERN_INFO "Using r7780rp interrupt controller.\n");
-               register_intc_controller(&intc_desc);
-               return irl2irq;
-       }
-
-       return NULL;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c
deleted file mode 100644 (file)
index 896c045..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Renesas Solutions Highlander R7785RP Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006 - 2008  Paul Mundt
- * Copyright (C) 2007  Magnus Damm
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* FPGA specific interrupt sources */
-       CF,             /* Compact Flash */
-       SMBUS,          /* SMBUS */
-       TP,             /* Touch panel */
-       RTC,            /* RTC Alarm */
-       TH_ALERT,       /* Temperature sensor */
-       AX88796,        /* Ethernet controller */
-
-       /* external bus connector */
-       EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(SMBUS, IRQ_SMBUS),
-       INTC_IRQ(TP, IRQ_TP),
-       INTC_IRQ(RTC, IRQ_RTC),
-       INTC_IRQ(TH_ALERT, IRQ_TH_ALERT),
-
-       INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1),
-       INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3),
-
-       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
-       INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7),
-
-       INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa4000010, 0, 16, /* IRLMCR1 */
-         { 0, 0, 0, 0, CF, AX88796, SMBUS, TP,
-           RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } },
-       { 0xa4000012, 0, 16, /* IRLMCR2 */
-         { 0, 0, 0, 0, 0, 0, 0, 0,
-           EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       0, IRQ_CF, IRQ_EXT4, IRQ_EXT5,
-       IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP,
-       IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0,
-       IRQ_EXT1, IRQ_EXT2, IRQ_EXT3,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000)
-               return NULL;
-
-       printk(KERN_INFO "Using r7785rp interrupt controller.\n");
-
-       ctrl_outw(0x0000, PA_IRLSSR1);  /* FPGA IRLSSR1(CF_CD clear) */
-
-       /* Setup the FPGA IRL */
-       ctrl_outw(0x0000, PA_IRLPRA);   /* FPGA IRLA */
-       ctrl_outw(0xe598, PA_IRLPRB);   /* FPGA IRLB */
-       ctrl_outw(0x7060, PA_IRLPRC);   /* FPGA IRLC */
-       ctrl_outw(0x0000, PA_IRLPRD);   /* FPGA IRLD */
-       ctrl_outw(0x4321, PA_IRLPRE);   /* FPGA IRLE */
-       ctrl_outw(0xdcba, PA_IRLPRF);   /* FPGA IRLF */
-
-       register_intc_controller(&intc_desc);
-       return irl2irq;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/psw.c b/arch/sh/boards/renesas/r7780rp/psw.c
deleted file mode 100644 (file)
index c844dfa..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * arch/sh/boards/renesas/r7780rp/psw.c
- *
- * push switch support for RDBRP-1/RDBREVRP-1 debug boards.
- *
- * Copyright (C) 2006  Paul Mundt
- *
- * 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.
- */
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <asm/mach/r7780rp.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
-       struct platform_device *pdev = arg;
-       struct push_switch *psw = platform_get_drvdata(pdev);
-       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
-       unsigned int l, mask;
-       int ret = 0;
-
-       l = ctrl_inw(PA_DBSW);
-
-       /* Nothing to do if there's no state change */
-       if (psw->state) {
-               ret = 1;
-               goto out;
-       }
-
-       mask = l & 0x70;
-       /* Figure out who raised it */
-       if (mask & (1 << psw_info->bit)) {
-               psw->state = !!(mask & (1 << psw_info->bit));
-               if (psw->state) /* debounce */
-                       mod_timer(&psw->debounce, jiffies + 50);
-
-               ret = 1;
-       }
-
-out:
-       /* Clear the switch IRQs */
-       l |= (0x7 << 12);
-       ctrl_outw(l, PA_DBSW);
-
-       return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_resources[] = {
-       [0] = {
-               .start  = IRQ_PSW,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct push_switch_platform_info s2_platform_data = {
-       .name           = "s2",
-       .bit            = 6,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s2_switch_device = {
-       .name           = "push-switch",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s2_platform_data,
-       },
-};
-
-static struct push_switch_platform_info s3_platform_data = {
-       .name           = "s3",
-       .bit            = 5,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s3_switch_device = {
-       .name           = "push-switch",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s3_platform_data,
-       },
-};
-
-static struct push_switch_platform_info s4_platform_data = {
-       .name           = "s4",
-       .bit            = 4,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s4_switch_device = {
-       .name           = "push-switch",
-       .id             = 2,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s4_platform_data,
-       },
-};
-
-static struct platform_device *psw_devices[] = {
-       &s2_switch_device, &s3_switch_device, &s4_switch_device,
-};
-
-static int __init psw_init(void)
-{
-       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-module_init(psw_init);
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
deleted file mode 100644 (file)
index bc79afb..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * arch/sh/boards/renesas/r7780rp/setup.c
- *
- * Renesas Solutions Highlander Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005 - 2008 Paul Mundt
- *
- * This contains support for the R7780RP-1, R7780MP, and R7785RP
- * Highlander modules.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <net/ax88796.h>
-#include <asm/machvec.h>
-#include <asm/r7780rp.h>
-#include <asm/clock.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = 0xA4200000,
-               .end    = 0xA42000FF,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               .start  = IRQ_EXT1,             /* irq number */
-               .end    = IRQ_EXT1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
-       [0] = {
-               .name   = "m66592_udc",
-               .start  = 0xb0000000,
-               .end    = 0xb00000FF,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "m66592_udc",
-               .start  = IRQ_EXT4,             /* irq number */
-               .end    = IRQ_EXT4,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
-       .name           = "m66592_udc",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
-       .resource       = m66592_usb_peripheral_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_AREA5_IO + 0x1000,
-               .end    = PA_AREA5_IO + 0x1000 + 0x08 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_AREA5_IO + 0x80c,
-               .end    = PA_AREA5_IO + 0x80c + 0x16 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = IRQ_CF,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev    = {
-               .platform_data  = &pata_info,
-       },
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_OBLED,
-               .end    = PA_OBLED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-#ifndef CONFIG_SH_R7785RP
-static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-};
-#endif
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-
-       /* R7785RP has a slightly more sensible FPGA.. */
-#ifndef CONFIG_SH_R7785RP
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-#endif
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct ax_plat_data ax88796_platdata = {
-       .flags          = AXFLG_HAS_93CX6,
-       .wordlength     = 2,
-       .dcr_val        = 0x1,
-       .rcr_val        = 0x40,
-};
-
-static struct resource ax88796_resources[] = {
-       {
-#ifdef CONFIG_SH_R7780RP
-               .start  = 0xa5800400,
-               .end    = 0xa5800400 + (0x20 * 0x2) - 1,
-#else
-               .start  = 0xa4100400,
-               .end    = 0xa4100400 + (0x20 * 0x2) - 1,
-#endif
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = IRQ_AX88796,
-               .end    = IRQ_AX88796,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device ax88796_device = {
-       .name           = "ax88796",
-       .id             = 0,
-
-       .dev    = {
-               .platform_data = &ax88796_platdata,
-       },
-
-       .num_resources  = ARRAY_SIZE(ax88796_resources),
-       .resource       = ax88796_resources,
-};
-
-static struct resource smbus_resources[] = {
-       [0] = {
-               .start  = PA_SMCR,
-               .end    = PA_SMCR + 0x100 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_SMBUS,
-               .end    = IRQ_SMBUS,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smbus_device = {
-       .name           = "i2c-highlander",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(smbus_resources),
-       .resource       = smbus_resources,
-};
-
-static struct i2c_board_info __initdata highlander_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("r2025sd", 0x32),
-       },
-};
-
-static struct platform_device *r7780rp_devices[] __initdata = {
-       &r8a66597_usb_host_device,
-       &m66592_usb_peripheral_device,
-       &heartbeat_device,
-       &smbus_device,
-#ifndef CONFIG_SH_R7780RP
-       &ax88796_device,
-#endif
-};
-
-/*
- * The CF is connected using a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
-       .resource               = cf_ide_resources,
-       .num_resources          = 2,
-       .minimum_bus_width      = 16,
-};
-
-static int __init r7780rp_devices_setup(void)
-{
-       int ret = 0;
-
-#ifndef CONFIG_SH_R7780RP
-       if (register_trapped_io(&cf_trapped_io) == 0)
-               ret |= platform_device_register(&cf_ide_device);
-#endif
-
-       ret |= platform_add_devices(r7780rp_devices,
-                                   ARRAY_SIZE(r7780rp_devices));
-
-       ret |= i2c_register_board_info(0, highlander_i2c_devices,
-                                      ARRAY_SIZE(highlander_i2c_devices));
-
-       return ret;
-}
-device_initcall(r7780rp_devices_setup);
-
-/*
- * Platform specific clocks
- */
-static void ivdr_clk_enable(struct clk *clk)
-{
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
-}
-
-static void ivdr_clk_disable(struct clk *clk)
-{
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
-}
-
-static struct clk_ops ivdr_clk_ops = {
-       .enable         = ivdr_clk_enable,
-       .disable        = ivdr_clk_disable,
-};
-
-static struct clk ivdr_clk = {
-       .name           = "ivdr_clk",
-       .ops            = &ivdr_clk_ops,
-};
-
-static struct clk *r7780rp_clocks[] = {
-       &ivdr_clk,
-};
-
-static void r7780rp_power_off(void)
-{
-       if (mach_is_r7780mp() || mach_is_r7785rp())
-               ctrl_outw(0x0001, PA_POFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init highlander_setup(char **cmdline_p)
-{
-       u16 ver = ctrl_inw(PA_VERREG);
-       int i;
-
-       printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
-                        mach_is_r7780rp() ? "R7780RP-1" :
-                        mach_is_r7780mp() ? "R7780MP"   :
-                                            "R7785RP");
-
-       printk(KERN_INFO "Board version: %d (revision %d), "
-                        "FPGA version: %d (revision %d)\n",
-                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
-                        (ver >>  4) & 0xf, ver & 0xf);
-
-       /*
-        * Enable the important clocks right away..
-        */
-       for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
-               struct clk *clk = r7780rp_clocks[i];
-
-               clk_register(clk);
-               clk_enable(clk);
-       }
-
-       ctrl_outw(0x0000, PA_OBLED);    /* Clear LED. */
-
-       if (mach_is_r7780rp())
-               ctrl_outw(0x0001, PA_SDPOW);    /* SD Power ON */
-
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL);     /* Si13112 */
-
-       pm_power_off = r7780rp_power_off;
-}
-
-static unsigned char irl2irq[HL_NR_IRL];
-
-static int highlander_irq_demux(int irq)
-{
-       if (irq >= HL_NR_IRL || !irl2irq[irq])
-               return irq;
-
-       return irl2irq[irq];
-}
-
-static void __init highlander_init_irq(void)
-{
-       unsigned char *ucp = highlander_plat_irq_setup();
-
-       if (ucp) {
-               plat_irq_setup_pins(IRQ_MODE_IRL3210);
-               memcpy(irl2irq, ucp, HL_NR_IRL);
-       }
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_highlander __initmv = {
-       .mv_name                = "Highlander",
-       .mv_setup               = highlander_setup,
-       .mv_init_irq            = highlander_init_irq,
-       .mv_irq_demux           = highlander_irq_demux,
-};
diff --git a/arch/sh/boards/renesas/rsk7203/Makefile b/arch/sh/boards/renesas/rsk7203/Makefile
deleted file mode 100644 (file)
index f663768..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y  := setup.o
diff --git a/arch/sh/boards/renesas/rsk7203/setup.c b/arch/sh/boards/renesas/rsk7203/setup.c
deleted file mode 100644 (file)
index 0bbda04..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Renesas Technology Europe RSK+ 7203 Support.
- *
- * Copyright (C) 2008 Paul Mundt
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-
-static struct resource smc911x_resources[] = {
-       [0] = {
-               .start          = 0x24000000,
-               .end            = 0x24000000 + 0x100,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 64,
-               .end            = 64,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc911x_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc911x_resources),
-       .resource       = smc911x_resources,
-};
-
-static const char *probes[] = { "cmdlinepart", NULL };
-
-static struct mtd_partition *parsed_partitions;
-
-static struct mtd_partition rsk7203_partitions[] = {
-       {
-               .name           = "Bootloader",
-               .offset         = 0x00000000,
-               .size           = 0x00040000,
-               .mask_flags     = MTD_WRITEABLE,
-       }, {
-               .name           = "Kernel",
-               .offset         = MTDPART_OFS_NXTBLK,
-               .size           = 0x001c0000,
-       }, {
-               .name           = "Flash_FS",
-               .offset         = MTDPART_OFS_NXTBLK,
-               .size           = MTDPART_SIZ_FULL,
-       }
-};
-
-static struct physmap_flash_data flash_data = {
-       .width          = 2,
-};
-
-static struct resource flash_resource = {
-       .start          = 0x20000000,
-       .end            = 0x20400000,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
-       .name           = "physmap-flash",
-       .id             = -1,
-       .resource       = &flash_resource,
-       .num_resources  = 1,
-       .dev            = {
-               .platform_data = &flash_data,
-       },
-};
-
-static struct mtd_info *flash_mtd;
-
-static struct map_info rsk7203_flash_map = {
-       .name           = "RSK+ Flash",
-       .size           = 0x400000,
-       .bankwidth      = 2,
-};
-
-static void __init set_mtd_partitions(void)
-{
-       int nr_parts = 0;
-
-       simple_map_init(&rsk7203_flash_map);
-       flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
-       nr_parts = parse_mtd_partitions(flash_mtd, probes,
-                                       &parsed_partitions, 0);
-       /* If there is no partition table, used the hard coded table */
-       if (nr_parts <= 0) {
-               flash_data.parts = rsk7203_partitions;
-               flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
-       } else {
-               flash_data.nr_parts = nr_parts;
-               flash_data.parts = parsed_partitions;
-       }
-}
-
-
-static struct platform_device *rsk7203_devices[] __initdata = {
-       &smc911x_device,
-       &flash_device,
-};
-
-static int __init rsk7203_devices_setup(void)
-{
-       set_mtd_partitions();
-       return platform_add_devices(rsk7203_devices,
-                                   ARRAY_SIZE(rsk7203_devices));
-}
-device_initcall(rsk7203_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rsk7203 __initmv = {
-       .mv_name        = "RSK+7203",
-};
diff --git a/arch/sh/boards/renesas/rts7751r2d/Kconfig b/arch/sh/boards/renesas/rts7751r2d/Kconfig
deleted file mode 100644 (file)
index 8122a96..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-if SH_RTS7751R2D
-
-menu "RTS7751R2D Board Revision"
-
-config RTS7751R2D_PLUS
-       bool "R2D-PLUS"
-       help
-         Selecting this option will configure the kernel for R2D-PLUS.
-
-         R2D-PLUS is the smaller of the two R2D board versions, equipped
-         with a single PCI slot.
-
-config RTS7751R2D_1
-       bool "R2D-1"
-       help
-         Selecting this option will configure the kernel for R2D-1.
-
-         R2D-1 is the larger of the two R2D board versions, equipped
-         with two PCI slots.
-endmenu
-
-endif
-
diff --git a/arch/sh/boards/renesas/rts7751r2d/Makefile b/arch/sh/boards/renesas/rts7751r2d/Makefile
deleted file mode 100644 (file)
index 0d4c75a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the RTS7751R2D specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c
deleted file mode 100644 (file)
index 8e49f6e..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
- *
- * Copyright (C) 2007  Magnus Damm
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1.
- *
- * Modified for RTS7751R2D by
- * Atom Create Engineering Co., Ltd. 2002.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <asm/rts7751r2d.h>
-
-#define R2D_NR_IRL 13
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources (R2D-1 and R2D-PLUS) */
-       EXT,              /* EXT_INT0-3 */
-       RTC_T, RTC_A,     /* Real Time Clock */
-       AX88796,          /* Ethernet controller (R2D-1 board) */
-       KEY,              /* Key input (R2D-PLUS board) */
-       SDCARD,           /* SD Card */
-       CF_CD, CF_IDE,    /* CF Card Detect + CF IDE */
-       SM501,            /* SM501 aka Voyager */
-       PCI_INTD_RTL8139, /* Ethernet controller */
-       PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */
-       PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */
-       PCI_INTB_SLOT,    /* PCI Slot 3.3v (R2D-1 board) */
-       PCI_INTA_SLOT,    /* PCI Slot 3.3v */
-       TP,               /* Touch Panel */
-};
-
-#ifdef CONFIG_RTS7751R2D_1
-
-/* Vectors for R2D-1 */
-static struct intc_vect vectors_r2d_1[] __initdata = {
-       INTC_IRQ(EXT, IRQ_EXT),
-       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
-       INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD),
-       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */
-       INTC_IRQ(SM501, IRQ_VOYAGER),
-       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
-       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
-       INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB),
-       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
-       INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-1 */
-static struct intc_mask_reg mask_registers_r2d_1[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { TP, PCI_INTA_SLOT, PCI_INTB_SLOT,
-           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
-           SM501, CF_IDE, CF_CD, SDCARD, AX88796,
-           RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-1 */
-static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = {
-       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
-       IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T,
-       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
-       IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1,
-                        NULL, mask_registers_r2d_1, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_1 */
-
-#ifdef CONFIG_RTS7751R2D_PLUS
-
-/* Vectors for R2D-PLUS */
-static struct intc_vect vectors_r2d_plus[] __initdata = {
-       INTC_IRQ(EXT, IRQ_EXT),
-       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
-       INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD),
-       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE),
-       INTC_IRQ(SM501, IRQ_VOYAGER),
-       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
-       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
-       INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB),
-       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
-       INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-PLUS */
-static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139,
-           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
-           SM501, CF_IDE, CF_CD, SDCARD, KEY,
-           RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-PLUS */
-static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = {
-       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
-       IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T,
-       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
-       IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus,
-                        NULL, mask_registers_r2d_plus, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_PLUS */
-
-static unsigned char irl2irq[R2D_NR_IRL];
-
-int rts7751r2d_irq_demux(int irq)
-{
-       if (irq >= R2D_NR_IRL || !irl2irq[irq])
-               return irq;
-
-       return irl2irq[irq];
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_rts7751r2d_IRQ(void)
-{
-       struct intc_desc *d;
-
-       switch (ctrl_inw(PA_VERREG) & 0xf0) {
-#ifdef CONFIG_RTS7751R2D_PLUS
-       case 0x10:
-               printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
-               d = &intc_desc_r2d_plus;
-               memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL);
-               break;
-#endif
-#ifdef CONFIG_RTS7751R2D_1
-       case 0x00: /* according to manual */
-       case 0x30: /* in reality */
-               printk(KERN_INFO "Using R2D-1 interrupt controller.\n");
-               d = &intc_desc_r2d_1;
-               memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL);
-               break;
-#endif
-       default:
-               printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
-                      ctrl_inw(PA_VERREG));
-               return;
-       }
-
-       register_intc_controller(d);
-}
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
deleted file mode 100644 (file)
index 2308e87..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Renesas Technology Sales RTS7751R2D Support.
- *
- * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2004 - 2007 Paul Mundt
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/pm.h>
-#include <linux/fb.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_bitbang.h>
-#include <asm/machvec.h>
-#include <asm/rts7751r2d.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-#include <asm/spi.h>
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_AREA5_IO + 0x1000,
-               .end    = PA_AREA5_IO + 0x1000 + 0x10 - 0x2,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_AREA5_IO + 0x80c,
-               .end    = PA_AREA5_IO + 0x80c,
-               .flags  = IORESOURCE_MEM,
-       },
-#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
-       [2] = {
-               .start  = IRQ_CF_IDE,
-               .flags  = IORESOURCE_IRQ,
-       },
-#endif
-};
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev    = {
-               .platform_data  = &pata_info,
-       },
-};
-
-static struct spi_board_info spi_bus[] = {
-       {
-               .modalias       = "rtc-r9701",
-               .max_speed_hz   = 1000000,
-               .mode           = SPI_MODE_3,
-       },
-};
-
-static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
-{
-       BUG_ON(cs != 0);  /* Single Epson RTC-9701JE attached on CS0 */
-       ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE);
-}
-
-static struct sh_spi_info spi_info = {
-       .num_chipselect = 1,
-       .chip_select = r2d_chip_select,
-};
-
-static struct resource spi_sh_sci_resources[] = {
-       {
-               .start  = 0xffe00000,
-               .end    = 0xffe0001f,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device spi_sh_sci_device  = {
-       .name           = "spi_sh_sci",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(spi_sh_sci_resources),
-       .resource       = spi_sh_sci_resources,
-       .dev    = {
-               .platform_data  = &spi_info,
-       },
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_OUTPORT,
-               .end    = PA_OUTPORT,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource sm501_resources[] = {
-       [0]     = {
-               .start  = 0x10000000,
-               .end    = 0x13e00000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 0x13e00000,
-               .end    = 0x13ffffff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2]     = {
-               .start  = IRQ_VOYAGER,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct fb_videomode sm501_default_mode = {
-       .pixclock       = 35714,
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 105,
-       .right_margin   = 50,
-       .upper_margin   = 35,
-       .lower_margin   = 0,
-       .hsync_len      = 96,
-       .vsync_len      = 2,
-       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
-       .flags          = (SM501FB_FLAG_USE_INIT_MODE |
-                          SM501FB_FLAG_USE_HWCURSOR |
-                          SM501FB_FLAG_USE_HWACCEL |
-                          SM501FB_FLAG_DISABLE_AT_EXIT),
-
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
-       .fb_route       = SM501_FB_OWN,
-       .fb_crt         = &sm501_pdata_fbsub_crt,
-       .fb_pnl         = &sm501_pdata_fbsub_pnl,
-       .flags          = SM501_FBPD_SWAP_FB_ENDIAN,
-};
-
-static struct sm501_initdata sm501_initdata = {
-       .devices        = SM501_USE_USB_HOST | SM501_USE_UART0,
-};
-
-static struct sm501_platdata sm501_platform_data = {
-       .init           = &sm501_initdata,
-       .fb             = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
-       .name           = "sm501",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &sm501_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(sm501_resources),
-       .resource       = sm501_resources,
-};
-
-static struct platform_device *rts7751r2d_devices[] __initdata = {
-       &sm501_device,
-       &heartbeat_device,
-       &spi_sh_sci_device,
-};
-
-/*
- * The CF is connected with a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
-       .resource               = cf_ide_resources,
-       .num_resources          = 2,
-       .minimum_bus_width      = 16,
-};
-
-static int __init rts7751r2d_devices_setup(void)
-{
-       if (register_trapped_io(&cf_trapped_io) == 0)
-               platform_device_register(&cf_ide_device);
-
-       spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
-
-       return platform_add_devices(rts7751r2d_devices,
-                                   ARRAY_SIZE(rts7751r2d_devices));
-}
-__initcall(rts7751r2d_devices_setup);
-
-static void rts7751r2d_power_off(void)
-{
-       ctrl_outw(0x0001, PA_POWOFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init rts7751r2d_setup(char **cmdline_p)
-{
-       void __iomem *sm501_reg;
-       u16 ver = ctrl_inw(PA_VERREG);
-
-       printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
-
-       printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
-                                       (ver >> 4) & 0xf, ver & 0xf);
-
-       ctrl_outw(0x0000, PA_OUTPORT);
-       pm_power_off = rts7751r2d_power_off;
-
-       /* sm501 dram configuration:
-        * ColSizeX = 11 - External Memory Column Size: 256 words.
-        * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
-        * RstX = 1 - External Memory Reset: Normal.
-        * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
-        * BwC =  1 - Local Memory Block Write Cycle Time: 2 clocks.
-        * BwP =  1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
-        * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
-        * Rst = 1 - Internal Memory Reset: Normal.
-        * RA = 1 - Internal Memory Remain in Active State: Do not remain.
-        */
-
-       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
-       writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rts7751r2d __initmv = {
-       .mv_name                = "RTS7751R2D",
-       .mv_setup               = rts7751r2d_setup,
-       .mv_init_irq            = init_rts7751r2d_IRQ,
-       .mv_irq_demux           = rts7751r2d_irq_demux,
-};
diff --git a/arch/sh/boards/renesas/sdk7780/Kconfig b/arch/sh/boards/renesas/sdk7780/Kconfig
deleted file mode 100644 (file)
index 065f1df..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-if SH_SDK7780
-
-choice
-       prompt "SDK7780 options"
-       default SH_SDK7780_BASE
-
-config SH_SDK7780_BASE
-       bool "SDK7780 with base-board support"
-       depends on CPU_SUBTYPE_SH7780
-       help
-         Selecting this option will enable support for the expansion
-         baseboard devices. If in doubt, say Y.
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/sdk7780/Makefile b/arch/sh/boards/renesas/sdk7780/Makefile
deleted file mode 100644 (file)
index 3d8f0be..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SDK7780 specific parts of the kernel
-#
-obj-y   := setup.o irq.o
-
diff --git a/arch/sh/boards/renesas/sdk7780/irq.c b/arch/sh/boards/renesas/sdk7780/irq.c
deleted file mode 100644 (file)
index 87cdc57..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sdk7780/irq.c
- *
- * Renesas Technology Europe SDK7780 Support.
- *
- * Copyright (C) 2008  Nicholas Beck <nbeck@mpc-data.co.uk>
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/sdk7780.h>
-
-enum {
-       UNUSED = 0,
-       /* board specific interrupt sources */
-       SMC91C111,      /* Ethernet controller */
-};
-
-static struct intc_vect fpga_vectors[] __initdata = {
-       INTC_IRQ(SMC91C111, IRQ_ETHERNET),
-};
-
-static struct intc_mask_reg fpga_mask_registers[] __initdata = {
-       { 0, FPGA_IRQ0MR, 16,
-         { 0, 0, 0, 0, 0, 0, 0, 0,
-           0, 0, 0, SMC91C111, 0, 0, 0, 0 } },
-};
-
-static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors,
-                        NULL, fpga_mask_registers, NULL, NULL);
-
-void __init init_sdk7780_IRQ(void)
-{
-       printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
-
-       ctrl_outw(0xFFFF, FPGA_IRQ0MR);
-       /* Setup IRL 0-3 */
-       ctrl_outw(0x0003, FPGA_IMSR);
-       plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
-       register_intc_controller(&fpga_intc_desc);
-}
diff --git a/arch/sh/boards/renesas/sdk7780/setup.c b/arch/sh/boards/renesas/sdk7780/setup.c
deleted file mode 100644 (file)
index acc5932..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * arch/sh/boards/renesas/sdk7780/setup.c
- *
- * Renesas Solutions SH7780 SDK Support
- * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <asm/sdk7780.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-#define GPIO_PECR        0xFFEA0008
-
-//* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_ETHERNET,
-               .end    = IRQ_ETHERNET,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct platform_device *sdk7780_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-};
-
-static int __init sdk7780_devices_setup(void)
-{
-       return platform_add_devices(sdk7780_devices,
-               ARRAY_SIZE(sdk7780_devices));
-}
-device_initcall(sdk7780_devices_setup);
-
-static void __init sdk7780_setup(char **cmdline_p)
-{
-       u16 ver = ctrl_inw(FPGA_FPVERR);
-       u16 dateStamp = ctrl_inw(FPGA_FPDATER);
-
-       printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
-       printk(KERN_INFO "Board version: %d (revision %d), "
-                        "FPGA version: %d (revision %d), datestamp : %d\n",
-                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
-                        (ver >>  4) & 0xf, ver & 0xf,
-                        dateStamp);
-
-       /* Setup pin mux'ing for PCIC */
-       ctrl_outw(0x0000, GPIO_PECR);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
-       .mv_name        = "Renesas SDK7780-R3" ,
-       .mv_setup               = sdk7780_setup,
-       .mv_nr_irqs             = 111,
-       .mv_init_irq    = init_sdk7780_IRQ,
-};
-
diff --git a/arch/sh/boards/renesas/sh7763rdp/Makefile b/arch/sh/boards/renesas/sh7763rdp/Makefile
deleted file mode 100644 (file)
index f6c0b55..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y    := setup.o irq.o
diff --git a/arch/sh/boards/renesas/sh7763rdp/irq.c b/arch/sh/boards/renesas/sh7763rdp/irq.c
deleted file mode 100644 (file)
index fd850ba..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/irq.c
- *
- * Renesas Solutions SH7763RDP Support.
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008  Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- *
- * 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.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/sh7763rdp.h>
-
-#define INTC_BASE              (0xFFD00000)
-#define INTC_INT2PRI7   (INTC_BASE+0x4001C)
-#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
-#define INTC_INT2MSKCR1        (INTC_BASE+0x400D4)
-
-/*
- * Initialize IRQ setting
- */
-void __init init_sh7763rdp_IRQ(void)
-{
-       /* GPIO enabled */
-       ctrl_outl(1 << 25, INTC_INT2MSKCR);
-
-       /* enable GPIO interrupts */
-       ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
-                 INTC_INT2PRI7);
-
-       /* USBH enabled */
-       ctrl_outl(1 << 17, INTC_INT2MSKCR1);
-
-       /* GETHER enabled */
-       ctrl_outl(1 << 16, INTC_INT2MSKCR1);
-
-       /* DMAC enabled */
-       ctrl_outl(1 << 8, INTC_INT2MSKCR);
-}
diff --git a/arch/sh/boards/renesas/sh7763rdp/setup.c b/arch/sh/boards/renesas/sh7763rdp/setup.c
deleted file mode 100644 (file)
index 925f16a..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/setup.c
- *
- * Renesas Solutions sh7763rdp board
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mtd/physmap.h>
-#include <asm/io.h>
-#include <asm/sh7763rdp.h>
-
-/* NOR Flash */
-static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
-       {
-               .name = "U-Boot",
-               .offset = 0,
-               .size = (2 * 128 * 1024),
-               .mask_flags = MTD_WRITEABLE,    /* Read-only */
-       }, {
-               .name = "Linux-Kernel",
-               .offset = MTDPART_OFS_APPEND,
-               .size = (20 * 128 * 1024),
-       }, {
-               .name = "Root Filesystem",
-               .offset = MTDPART_OFS_APPEND,
-               .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data sh7763rdp_nor_flash_data = {
-       .width = 2,
-       .parts = sh7763rdp_nor_flash_partitions,
-       .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
-};
-
-static struct resource sh7763rdp_nor_flash_resources[] = {
-       [0] = {
-               .name = "NOR Flash",
-               .start = 0,
-               .end = (64 * 1024 * 1024),
-               .flags = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device sh7763rdp_nor_flash_device = {
-       .name = "physmap-flash",
-       .resource = sh7763rdp_nor_flash_resources,
-       .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
-       .dev = {
-               .platform_data = &sh7763rdp_nor_flash_data,
-       },
-};
-
-static struct platform_device *sh7763rdp_devices[] __initdata = {
-       &sh7763rdp_nor_flash_device,
-};
-
-static int __init sh7763rdp_devices_setup(void)
-{
-       return platform_add_devices(sh7763rdp_devices,
-                                   ARRAY_SIZE(sh7763rdp_devices));
-}
-__initcall(sh7763rdp_devices_setup);
-
-static void __init sh7763rdp_setup(char **cmdline_p)
-{
-       /* Board version check */
-       if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
-               printk(KERN_INFO "RTE Standard Configuration\n");
-       else
-               printk(KERN_INFO "RTA Standard Configuration\n");
-
-       /* USB pin select bits (clear bit 5-2 to 0) */
-       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
-       /* USBH setup port I controls to other (clear bits 4-9 to 0) */
-       ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR);
-
-       /* Select USB Host controller */
-       ctrl_outw(0x00, USB_USBHSC);
-
-       /* For LCD */
-       /* set PTJ7-1, bits 15-2 of PJCR to 0 */
-       ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR);
-       /* set PTI5, bits 11-10 of PICR to 0 */
-       ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR);
-       ctrl_outw(0, PORT_PKCR);
-       ctrl_outw(0, PORT_PLCR);
-       /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
-       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
-       /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
-       ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
-
-       /* For HAC */
-       /* bit3-0  0100:HAC & SSI1 enable */
-       ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
-       /* bit14      1:SSI_HAC_CLK enable */
-       ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
-
-       /* SH-Ether */
-       ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
-       ctrl_outw(0x0, PORT_PFCR);
-       ctrl_outw(0x0, PORT_PFCR);
-       ctrl_outw(0x0, PORT_PFCR);
-
-       /* MMC */
-       /*selects SCIF and MMC other functions */
-       ctrl_outw(0x0001, PORT_PSEL0);
-       /* MMC clock operates */
-       ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1);
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR);
-       ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
-}
-
-static struct sh_machine_vector mv_sh7763rdp __initmv = {
-       .mv_name = "sh7763drp",
-       .mv_setup = sh7763rdp_setup,
-       .mv_nr_irqs = 112,
-       .mv_init_irq = init_sh7763rdp_IRQ,
-};
diff --git a/arch/sh/boards/renesas/sh7785lcr/Makefile b/arch/sh/boards/renesas/sh7785lcr/Makefile
deleted file mode 100644 (file)
index 7703756..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y   := setup.o
diff --git a/arch/sh/boards/renesas/sh7785lcr/setup.c b/arch/sh/boards/renesas/sh7785lcr/setup.c
deleted file mode 100644 (file)
index b95d674..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Renesas Technology Corp. R0P7785LC0011RL Support.
- *
- * Copyright (C) 2008  Yoshihiro Shimoda
- *
- * 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.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/fb.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/i2c-pca-platform.h>
-#include <linux/i2c-algo-pca.h>
-#include <asm/heartbeat.h>
-#include <asm/sh7785lcr.h>
-
-/*
- * NOTE: This board has 2 physical memory maps.
- *      Please look at include/asm-sh/sh7785lcr.h or hardware manual.
- */
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PLD_LEDCR,
-               .end    = PLD_LEDCR,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 8,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
-       {
-               .name           = "loader",
-               .offset         = 0x00000000,
-               .size           = 512 * 1024,
-       },
-       {
-               .name           = "bootenv",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 512 * 1024,
-       },
-       {
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 4 * 1024 * 1024,
-       },
-       {
-               .name           = "data",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data nor_flash_data = {
-       .width          = 4,
-       .parts          = nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
-       [0]     = {
-               .start  = NOR_FLASH_ADDR,
-               .end    = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device nor_flash_device = {
-       .name           = "physmap-flash",
-       .dev            = {
-               .platform_data  = &nor_flash_data,
-       },
-       .num_resources  = ARRAY_SIZE(nor_flash_resources),
-       .resource       = nor_flash_resources,
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = R8A66597_ADDR,
-               .end    = R8A66597_ADDR + R8A66597_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               .start  = 2,
-               .end    = 2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource sm501_resources[] = {
-       [0]     = {
-               .start  = SM107_MEM_ADDR,
-               .end    = SM107_MEM_ADDR + SM107_MEM_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = SM107_REG_ADDR,
-               .end    = SM107_REG_ADDR + SM107_REG_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2]     = {
-               .start  = 10,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct fb_videomode sm501_default_mode_crt = {
-       .pixclock       = 35714,        /* 28MHz */
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 105,
-       .right_margin   = 16,
-       .upper_margin   = 33,
-       .lower_margin   = 10,
-       .hsync_len      = 39,
-       .vsync_len      = 2,
-       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct fb_videomode sm501_default_mode_pnl = {
-       .pixclock       = 40000,        /* 25MHz */
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 2,
-       .right_margin   = 16,
-       .upper_margin   = 33,
-       .lower_margin   = 10,
-       .hsync_len      = 39,
-       .vsync_len      = 2,
-       .sync           = 0,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode_pnl,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT |
-                         SM501FB_FLAG_PANEL_NO_VBIASEN,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode_crt,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
-       .fb_route       = SM501_FB_OWN,
-       .fb_crt         = &sm501_pdata_fbsub_crt,
-       .fb_pnl         = &sm501_pdata_fbsub_pnl,
-};
-
-static struct sm501_initdata sm501_initdata = {
-       .gpio_high      = {
-               .set    = 0x00001fe0,
-               .mask   = 0x0,
-       },
-       .devices        = 0,
-       .mclk           = 84 * 1000000,
-       .m1xclk         = 112 * 1000000,
-};
-
-static struct sm501_platdata sm501_platform_data = {
-       .init           = &sm501_initdata,
-       .fb             = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
-       .name           = "sm501",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &sm501_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(sm501_resources),
-       .resource       = sm501_resources,
-};
-
-static struct resource i2c_resources[] = {
-       [0] = {
-               .start  = PCA9564_ADDR,
-               .end    = PCA9564_ADDR + PCA9564_SIZE - 1,
-               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-       },
-       [1] = {
-               .start  = 12,
-               .end    = 12,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
-       .gpio                   = 0,
-       .i2c_clock_speed        = I2C_PCA_CON_330kHz,
-       .timeout                = 100,
-};
-
-static struct platform_device i2c_device = {
-       .name           = "i2c-pca-platform",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &i2c_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(i2c_resources),
-       .resource       = i2c_resources,
-};
-
-static struct platform_device *sh7785lcr_devices[] __initdata = {
-       &heartbeat_device,
-       &nor_flash_device,
-       &r8a66597_usb_host_device,
-       &sm501_device,
-       &i2c_device,
-};
-
-static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("r2025sd", 0x32),
-       },
-};
-
-static int __init sh7785lcr_devices_setup(void)
-{
-       i2c_register_board_info(0, sh7785lcr_i2c_devices,
-                               ARRAY_SIZE(sh7785lcr_i2c_devices));
-
-       return platform_add_devices(sh7785lcr_devices,
-                                   ARRAY_SIZE(sh7785lcr_devices));
-}
-__initcall(sh7785lcr_devices_setup);
-
-/* Initialize IRQ setting */
-void __init init_sh7785lcr_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ7654);
-       plat_irq_setup_pins(IRQ_MODE_IRQ3210);
-}
-
-static void sh7785lcr_power_off(void)
-{
-       ctrl_outb(0x01, P2SEGADDR(PLD_POFCR));
-}
-
-/* Initialize the board */
-static void __init sh7785lcr_setup(char **cmdline_p)
-{
-       void __iomem *sm501_reg;
-
-       printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n");
-
-       pm_power_off = sh7785lcr_power_off;
-
-       /* sm501 DRAM configuration */
-       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
-       writel(0x000307c2, sm501_reg);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh7785lcr __initmv = {
-       .mv_name                = "SH7785LCR",
-       .mv_setup               = sh7785lcr_setup,
-       .mv_init_irq            = init_sh7785lcr_IRQ,
-};
-
diff --git a/arch/sh/boards/renesas/systemh/Makefile b/arch/sh/boards/renesas/systemh/Makefile
deleted file mode 100644 (file)
index 2cc6a23..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Makefile for the SystemH specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o io.o
-
-# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more
-# importantly, with the generic sh7751_pcic_init() code. For now, we'll
-# just abuse the hell out of kbuild, because we can..
-
-obj-$(CONFIG_PCI) += pci.o
-pci-y := ../../se/7751/pci.o
-
diff --git a/arch/sh/boards/renesas/systemh/io.c b/arch/sh/boards/renesas/systemh/io.c
deleted file mode 100644 (file)
index 1b767e1..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/io.c
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 Systemh.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/systemh7751.h>
-#include <asm/addrspace.h>
-#include <asm/io.h>
-
-#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
-                                                of smc lan chip*/
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char sh7751systemh_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned char *)ETHER_IOMAP(port);
-       else
-               return (*port2adr(port))&0xff;
-}
-
-unsigned char sh7751systemh_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-        if (PXSEG(port))
-                v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-                v = *(volatile unsigned char *)pci_ioaddr(port);
-       else if (port <= 0x3F1)
-               v = *(volatile unsigned char *)ETHER_IOMAP(port);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short sh7751systemh_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned int *)ETHER_IOMAP(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int sh7751systemh_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned int *)ETHER_IOMAP(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void sh7751systemh_outb(unsigned char value, unsigned long port)
-{
-
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void sh7751systemh_outb_p(unsigned char value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void sh7751systemh_outw(unsigned short value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned short *)ETHER_IOMAP(port) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751systemh_outl(unsigned int value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *p = addr;
-       while (count--) *p++ = sh7751systemh_inb(port);
-}
-
-void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned short *p = addr;
-       while (count--) *p++ = sh7751systemh_inw(port);
-}
-
-void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *p = (unsigned char*)addr;
-       while (count--) sh7751systemh_outb(*p++, port);
-}
-
-void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned short *p = (unsigned short*)addr;
-       while (count--) sh7751systemh_outw(*p++, port);
-}
-
-void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/renesas/systemh/irq.c b/arch/sh/boards/renesas/systemh/irq.c
deleted file mode 100644 (file)
index 0ba2fe6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SystemH Support.
- *
- * Modified for 7751 SystemH by
- * Jonathan Short.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-
-#include <linux/hdreg.h>
-#include <linux/ide.h>
-#include <asm/io.h>
-#include <asm/systemh7751.h>
-#include <asm/smc37c93x.h>
-
-/* address of external interrupt mask register
- * address must be set prior to use these (maybe in init_XXX_irq())
- * XXX : is it better to use .config than specifying it in code? */
-static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
-static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
-
-/* forward declaration */
-static unsigned int startup_systemh_irq(unsigned int irq);
-static void shutdown_systemh_irq(unsigned int irq);
-static void enable_systemh_irq(unsigned int irq);
-static void disable_systemh_irq(unsigned int irq);
-static void mask_and_ack_systemh(unsigned int);
-static void end_systemh_irq(unsigned int irq);
-
-/* hw_interrupt_type */
-static struct hw_interrupt_type systemh_irq_type = {
-       .typename = " SystemH Register",
-       .startup = startup_systemh_irq,
-       .shutdown = shutdown_systemh_irq,
-       .enable = enable_systemh_irq,
-       .disable = disable_systemh_irq,
-       .ack = mask_and_ack_systemh,
-       .end = end_systemh_irq
-};
-
-static unsigned int startup_systemh_irq(unsigned int irq)
-{
-       enable_systemh_irq(irq);
-       return 0; /* never anything pending */
-}
-
-static void shutdown_systemh_irq(unsigned int irq)
-{
-       disable_systemh_irq(irq);
-}
-
-static void disable_systemh_irq(unsigned int irq)
-{
-       if (systemh_irq_mask_register) {
-               unsigned long val, mask = 0x01 << 1;
-
-               /* Clear the "irq"th bit in the mask and set it in the request */
-               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
-               val &= ~mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
-
-               val = ctrl_inl((unsigned long)systemh_irq_request_register);
-               val |= mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_request_register);
-       }
-}
-
-static void enable_systemh_irq(unsigned int irq)
-{
-       if (systemh_irq_mask_register) {
-               unsigned long val, mask = 0x01 << 1;
-
-               /* Set "irq"th bit in the mask register */
-               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
-               val |= mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
-       }
-}
-
-static void mask_and_ack_systemh(unsigned int irq)
-{
-       disable_systemh_irq(irq);
-}
-
-static void end_systemh_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_systemh_irq(irq);
-}
-
-void make_systemh_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       irq_desc[irq].chip = &systemh_irq_type;
-       disable_systemh_irq(irq);
-}
-
diff --git a/arch/sh/boards/renesas/systemh/setup.c b/arch/sh/boards/renesas/systemh/setup.c
deleted file mode 100644 (file)
index ee78af8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- * Copyright (C) 2003  Paul Mundt
- *
- * Hitachi SystemH Support.
- *
- * Modified for 7751 SystemH by Jonathan Short.
- *
- * Rewritten for 2.6 by Paul Mundt.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <asm/machvec.h>
-#include <asm/systemh7751.h>
-
-extern void make_systemh_irq(unsigned int irq);
-
-/*
- * Initialize IRQ setting
- */
-static void __init sh7751systemh_init_irq(void)
-{
-       make_systemh_irq(0xb);  /* Ethernet interrupt */
-}
-
-static struct sh_machine_vector mv_7751systemh __initmv = {
-       .mv_name                = "7751 SystemH",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = sh7751systemh_inb,
-       .mv_inw                 = sh7751systemh_inw,
-       .mv_inl                 = sh7751systemh_inl,
-       .mv_outb                = sh7751systemh_outb,
-       .mv_outw                = sh7751systemh_outw,
-       .mv_outl                = sh7751systemh_outl,
-
-       .mv_inb_p               = sh7751systemh_inb_p,
-       .mv_inw_p               = sh7751systemh_inw,
-       .mv_inl_p               = sh7751systemh_inl,
-       .mv_outb_p              = sh7751systemh_outb_p,
-       .mv_outw_p              = sh7751systemh_outw,
-       .mv_outl_p              = sh7751systemh_outl,
-
-       .mv_insb                = sh7751systemh_insb,
-       .mv_insw                = sh7751systemh_insw,
-       .mv_insl                = sh7751systemh_insl,
-       .mv_outsb               = sh7751systemh_outsb,
-       .mv_outsw               = sh7751systemh_outsw,
-       .mv_outsl               = sh7751systemh_outsl,
-
-       .mv_init_irq            = sh7751systemh_init_irq,
-};
diff --git a/arch/sh/boards/renesas/x3proto/Makefile b/arch/sh/boards/renesas/x3proto/Makefile
deleted file mode 100644 (file)
index 983e455..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += setup.o ilsel.o
diff --git a/arch/sh/boards/renesas/x3proto/ilsel.c b/arch/sh/boards/renesas/x3proto/ilsel.c
deleted file mode 100644 (file)
index b5c673c..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * arch/sh/boards/renesas/x3proto/ilsel.c
- *
- * Helper routines for SH-X3 proto board ILSEL.
- *
- * Copyright (C) 2007 Paul Mundt
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/bitmap.h>
-#include <linux/io.h>
-#include <asm/ilsel.h>
-
-/*
- * ILSEL is split across:
- *
- *     ILSEL0 - 0xb8100004 [ Levels  1 -  4 ]
- *     ILSEL1 - 0xb8100006 [ Levels  5 -  8 ]
- *     ILSEL2 - 0xb8100008 [ Levels  9 - 12 ]
- *     ILSEL3 - 0xb810000a [ Levels 13 - 15 ]
- *
- * With each level being relative to an ilsel_source_t.
- */
-#define ILSEL_BASE     0xb8100004
-#define ILSEL_LEVELS   15
-
-/*
- * ILSEL level map, in descending order from the highest level down.
- *
- * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping
- * directly to IRLs. As the IRQs are numbered in reverse order relative
- * to the interrupt level, the level map is carefully managed to ensure a
- * 1:1 mapping between the bit position and the IRQ number.
- *
- * This careful constructions allows ilsel_enable*() to be referenced
- * directly for hooking up an ILSEL set and getting back an IRQ which can
- * subsequently be used for internal accounting in the (optional) disable
- * path.
- */
-static unsigned long ilsel_level_map;
-
-static inline unsigned int ilsel_offset(unsigned int bit)
-{
-       return ILSEL_LEVELS - bit - 1;
-}
-
-static inline unsigned long mk_ilsel_addr(unsigned int bit)
-{
-       return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
-}
-
-static inline unsigned int mk_ilsel_shift(unsigned int bit)
-{
-       return (ilsel_offset(bit) & 0x3) << 2;
-}
-
-static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
-{
-       unsigned int tmp, shift;
-       unsigned long addr;
-
-       addr = mk_ilsel_addr(bit);
-       shift = mk_ilsel_shift(bit);
-
-       pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
-                __func__, bit, addr, shift, set);
-
-       tmp = ctrl_inw(addr);
-       tmp &= ~(0xf << shift);
-       tmp |= set << shift;
-       ctrl_outw(tmp, addr);
-}
-
-/**
- * ilsel_enable - Enable an ILSEL set.
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- *
- * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
- * available interrupt level. Callers should take care to order callsites
- * noting descending interrupt levels. Aliasing FPGA and external board
- * IRQs need to use ilsel_enable_fixed().
- *
- * The return value is an IRQ number that can later be taken down with
- * ilsel_disable().
- */
-int ilsel_enable(ilsel_source_t set)
-{
-       unsigned int bit;
-
-       /* Aliased sources must use ilsel_enable_fixed() */
-       BUG_ON(set > ILSEL_KEY);
-
-       do {
-               bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
-       } while (test_and_set_bit(bit, &ilsel_level_map));
-
-       __ilsel_enable(set, bit);
-
-       return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable);
-
-/**
- * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- * @level: Interrupt level (1 - 15)
- *
- * Enables a given ILSEL source at a fixed interrupt level. Necessary
- * both for level reservation as well as for aliased sources that only
- * exist on special ILSEL#s.
- *
- * Returns an IRQ number (as ilsel_enable()).
- */
-int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)
-{
-       unsigned int bit = ilsel_offset(level - 1);
-
-       if (test_and_set_bit(bit, &ilsel_level_map))
-               return -EBUSY;
-
-       __ilsel_enable(set, bit);
-
-       return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable_fixed);
-
-/**
- * ilsel_disable - Disable an ILSEL set
- * @irq: Bit position for ILSEL set value (retval from enable routines)
- *
- * Disable a previously enabled ILSEL set.
- */
-void ilsel_disable(unsigned int irq)
-{
-       unsigned long addr;
-       unsigned int tmp;
-
-       addr = mk_ilsel_addr(irq);
-
-       tmp = ctrl_inw(addr);
-       tmp &= ~(0xf << mk_ilsel_shift(irq));
-       ctrl_outw(tmp, addr);
-
-       clear_bit(irq, &ilsel_level_map);
-}
-EXPORT_SYMBOL_GPL(ilsel_disable);
diff --git a/arch/sh/boards/renesas/x3proto/setup.c b/arch/sh/boards/renesas/x3proto/setup.c
deleted file mode 100644 (file)
index abc5b6d..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * arch/sh/boards/renesas/x3proto/setup.c
- *
- * Renesas SH-X3 Prototype Board Support.
- *
- * Copyright (C) 2007 Paul Mundt
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-#include <asm/ilsel.h>
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = 0xb8140020,
-               .end    = 0xb8140020,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start          = 0x18000300,
-               .end            = 0x18000300 + 0x10 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               /* Filled in by ilsel */
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .resource       = smc91x_resources,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = 0x18040000,
-               .end    = 0x18080000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               /* Filled in by ilsel */
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
-       [0] = {
-               .name   = "m66592_udc",
-               .start  = 0x18080000,
-               .end    = 0x180c0000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "m66592_udc",
-               /* Filled in by ilsel */
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
-       .name           = "m66592_udc",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
-       .resource       = m66592_usb_peripheral_resources,
-};
-
-static struct platform_device *x3proto_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_device,
-       &r8a66597_usb_host_device,
-       &m66592_usb_peripheral_device,
-};
-
-static int __init x3proto_devices_setup(void)
-{
-       r8a66597_usb_host_resources[1].start =
-               r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
-
-       m66592_usb_peripheral_resources[1].start =
-               m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
-
-       smc91x_resources[1].start =
-               smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
-
-       return platform_add_devices(x3proto_devices,
-                                   ARRAY_SIZE(x3proto_devices));
-}
-device_initcall(x3proto_devices_setup);
-
-static void __init x3proto_init_irq(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
-       /* Set ICR0.LVLMODE */
-       ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
-}
-
-static struct sh_machine_vector mv_x3proto __initmv = {
-       .mv_name                = "x3proto",
-       .mv_init_irq            = x3proto_init_irq,
-};
diff --git a/arch/sh/boards/se/7206/Makefile b/arch/sh/boards/se/7206/Makefile
deleted file mode 100644 (file)
index 63e7ed6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7206 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/7206/io.c b/arch/sh/boards/se/7206/io.c
deleted file mode 100644 (file)
index 1308e61..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
- *
- * linux/arch/sh/boards/se/7206/io.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- *
- * I/O routine for Hitachi 7206 SolutionEngine.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/se7206.h>
-
-
-static inline void delay(void)
-{
-       ctrl_inw(0x20000000);  /* P2 ROM Area */
-}
-
-/* MS7750 requires special versions of in*, out* routines, since
-   PC-like io ports are located at upper half byte of 16-bit word which
-   can be accessed only with 16-bit wide.  */
-
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port >= 0x2000 && port < 0x2020)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       else if (port >= 0x300 && port < 0x310)
-               return (volatile __u16 *) (PA_SMSC + (port - 0x300));
-
-       return (volatile __u16 *)port;
-}
-
-unsigned char se7206_inb(unsigned long port)
-{
-       return (*port2adr(port)) & 0xff;
-}
-
-unsigned char se7206_inb_p(unsigned long port)
-{
-       unsigned long v;
-
-       v = (*port2adr(port)) & 0xff;
-       delay();
-       return v;
-}
-
-unsigned short se7206_inw(unsigned long port)
-{
-       return *port2adr(port);;
-}
-
-void se7206_outb(unsigned char value, unsigned long port)
-{
-       *(port2adr(port)) = value;
-}
-
-void se7206_outb_p(unsigned char value, unsigned long port)
-{
-       *(port2adr(port)) = value;
-       delay();
-}
-
-void se7206_outw(unsigned short value, unsigned long port)
-{
-       *port2adr(port) = value;
-}
-
-void se7206_insb(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u8 *ap = addr;
-
-       while (count--)
-               *ap++ = *p;
-}
-
-void se7206_insw(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u16 *ap = addr;
-       while (count--)
-               *ap++ = *p;
-}
-
-void se7206_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u8 *ap = addr;
-
-       while (count--)
-               *p = *ap++;
-}
-
-void se7206_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u16 *ap = addr;
-       while (count--)
-               *p = *ap++;
-}
diff --git a/arch/sh/boards/se/7206/irq.c b/arch/sh/boards/se/7206/irq.c
deleted file mode 100644 (file)
index 9d5bfc7..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7206/irq.c
- *
- * Copyright (C) 2005,2006 Yoshinori Sato
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/interrupt.h>
-#include <asm/se7206.h>
-
-#define INTSTS0 0x31800000
-#define INTSTS1 0x31800002
-#define INTMSK0 0x31800004
-#define INTMSK1 0x31800006
-#define INTSEL  0x31800008
-
-#define IRQ0_IRQ 64
-#define IRQ1_IRQ 65
-#define IRQ3_IRQ 67
-
-#define INTC_IPR01 0xfffe0818
-#define INTC_ICR1  0xfffe0802
-
-static void disable_se7206_irq(unsigned int irq)
-{
-       unsigned short val;
-       unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq)));
-       unsigned short msk0,msk1;
-
-       /* Set the priority in IPR to 0 */
-       val = ctrl_inw(INTC_IPR01);
-       val &= mask;
-       ctrl_outw(val, INTC_IPR01);
-       /* FPGA mask set */
-       msk0 = ctrl_inw(INTMSK0);
-       msk1 = ctrl_inw(INTMSK1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               msk0 |= 0x0010;
-               break;
-       case IRQ1_IRQ:
-               msk0 |= 0x000f;
-               break;
-       case IRQ3_IRQ:
-               msk0 |= 0x0f00;
-               msk1 |= 0x00ff;
-               break;
-       }
-       ctrl_outw(msk0, INTMSK0);
-       ctrl_outw(msk1, INTMSK1);
-}
-
-static void enable_se7206_irq(unsigned int irq)
-{
-       unsigned short val;
-       unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq)));
-       unsigned short msk0,msk1;
-
-       /* Set priority in IPR back to original value */
-       val = ctrl_inw(INTC_IPR01);
-       val |= value;
-       ctrl_outw(val, INTC_IPR01);
-
-       /* FPGA mask reset */
-       msk0 = ctrl_inw(INTMSK0);
-       msk1 = ctrl_inw(INTMSK1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               msk0 &= ~0x0010;
-               break;
-       case IRQ1_IRQ:
-               msk0 &= ~0x000f;
-               break;
-       case IRQ3_IRQ:
-               msk0 &= ~0x0f00;
-               msk1 &= ~0x00ff;
-               break;
-       }
-       ctrl_outw(msk0, INTMSK0);
-       ctrl_outw(msk1, INTMSK1);
-}
-
-static void eoi_se7206_irq(unsigned int irq)
-{
-       unsigned short sts0,sts1;
-
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_se7206_irq(irq);
-       /* FPGA isr clear */
-       sts0 = ctrl_inw(INTSTS0);
-       sts1 = ctrl_inw(INTSTS1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               sts0 &= ~0x0010;
-               break;
-       case IRQ1_IRQ:
-               sts0 &= ~0x000f;
-               break;
-       case IRQ3_IRQ:
-               sts0 &= ~0x0f00;
-               sts1 &= ~0x00ff;
-               break;
-       }
-       ctrl_outw(sts0, INTSTS0);
-       ctrl_outw(sts1, INTSTS1);
-}
-
-static struct irq_chip se7206_irq_chip __read_mostly = {
-       .name           = "SE7206-FPGA",
-       .mask           = disable_se7206_irq,
-       .unmask         = enable_se7206_irq,
-       .mask_ack       = disable_se7206_irq,
-       .eoi            = eoi_se7206_irq,
-};
-
-static void make_se7206_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       set_irq_chip_and_handler_name(irq, &se7206_irq_chip,
-                                     handle_level_irq, "level");
-       disable_se7206_irq(irq);
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7206_IRQ(void)
-{
-       make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
-       make_se7206_irq(IRQ1_IRQ); /* ATA */
-       make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
-       ctrl_outw(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */
-
-       /* FPGA System register setup*/
-       ctrl_outw(0x0000,INTSTS0); /* Clear INTSTS0 */
-       ctrl_outw(0x0000,INTSTS1); /* Clear INTSTS1 */
-       /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
-       ctrl_outw(0x0001,INTSEL);
-}
diff --git a/arch/sh/boards/se/7206/setup.c b/arch/sh/boards/se/7206/setup.c
deleted file mode 100644 (file)
index 4fe84cc..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * linux/arch/sh/boards/se/7206/setup.c
- *
- * Copyright (C) 2006  Yoshinori Sato
- * Copyright (C) 2007 - 2008  Paul Mundt
- *
- * Hitachi 7206 SolutionEngine Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/smc91x.h>
-#include <asm/se7206.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <asm/heartbeat.h>
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .name           = "smc91x-regs",
-               .start          = PA_SMSC + 0x300,
-               .end            = PA_SMSC + 0x300 + 0x020 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 64,
-               .end            = 64,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct smc91x_platdata smc91x_info = {
-       .flags  = SMC91X_USE_16BIT,
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .dev            = {
-               .dma_mask               = NULL,
-               .coherent_dma_mask      = 0xffffffff,
-               .platform_data          = &smc91x_info,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 32,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *se7206_devices[] __initdata = {
-       &smc91x_device,
-       &heartbeat_device,
-};
-
-static int __init se7206_devices_setup(void)
-{
-       return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
-}
-__initcall(se7206_devices_setup);
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 256,
-       .mv_inb                 = se7206_inb,
-       .mv_inw                 = se7206_inw,
-       .mv_outb                = se7206_outb,
-       .mv_outw                = se7206_outw,
-
-       .mv_inb_p               = se7206_inb_p,
-       .mv_inw_p               = se7206_inw,
-       .mv_outb_p              = se7206_outb_p,
-       .mv_outw_p              = se7206_outw,
-
-       .mv_insb                = se7206_insb,
-       .mv_insw                = se7206_insw,
-       .mv_outsb               = se7206_outsb,
-       .mv_outsw               = se7206_outsw,
-
-       .mv_init_irq            = init_se7206_IRQ,
-};
diff --git a/arch/sh/boards/se/7343/Makefile b/arch/sh/boards/se/7343/Makefile
deleted file mode 100644 (file)
index 3024796..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7343 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/7343/io.c b/arch/sh/boards/se/7343/io.c
deleted file mode 100644 (file)
index 3a6d114..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * arch/sh/boards/se/7343/io.c
- *
- * I/O routine for SH-Mobile3AS 7343 SolutionEngine.
- *
- */
-#include <linux/kernel.h>
-#include <asm/io.h>
-#include <asm/mach/se7343.h>
-
-#define badio(fn, a) panic("bad i/o operation %s for %08lx.", #fn, a)
-
-struct iop {
-       unsigned long start, end;
-       unsigned long base;
-       struct iop *(*check) (struct iop * p, unsigned long port);
-       unsigned char (*inb) (struct iop * p, unsigned long port);
-       unsigned short (*inw) (struct iop * p, unsigned long port);
-       void (*outb) (struct iop * p, unsigned char value, unsigned long port);
-       void (*outw) (struct iop * p, unsigned short value, unsigned long port);
-};
-
-struct iop *
-simple_check(struct iop *p, unsigned long port)
-{
-       static int count;
-
-       if (count < 100)
-               count++;
-
-       port &= 0xFFFF;
-
-       if ((p->start <= port) && (port <= p->end))
-               return p;
-       else
-               badio(check, port);
-}
-
-struct iop *
-ide_check(struct iop *p, unsigned long port)
-{
-       if (((0x1f0 <= port) && (port <= 0x1f7)) || (port == 0x3f7))
-               return p;
-       return NULL;
-}
-
-unsigned char
-simple_inb(struct iop *p, unsigned long port)
-{
-       return *(unsigned char *) (p->base + port);
-}
-
-unsigned short
-simple_inw(struct iop *p, unsigned long port)
-{
-       return *(unsigned short *) (p->base + port);
-}
-
-void
-simple_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       *(unsigned char *) (p->base + port) = value;
-}
-
-void
-simple_outw(struct iop *p, unsigned short value, unsigned long port)
-{
-       *(unsigned short *) (p->base + port) = value;
-}
-
-unsigned char
-pcc_inb(struct iop *p, unsigned long port)
-{
-       unsigned long addr = p->base + port + 0x40000;
-       unsigned long v;
-
-       if (port & 1)
-               addr += 0x00400000;
-       v = *(volatile unsigned char *) addr;
-       return v;
-}
-
-void
-pcc_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       unsigned long addr = p->base + port + 0x40000;
-
-       if (port & 1)
-               addr += 0x00400000;
-       *(volatile unsigned char *) addr = value;
-}
-
-unsigned char
-bad_inb(struct iop *p, unsigned long port)
-{
-       badio(inb, port);
-}
-
-void
-bad_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       badio(inw, port);
-}
-
-#ifdef CONFIG_SMC91X
-/* MSTLANEX01 LAN at 0xb400:0000 */
-static struct iop laniop = {
-       .start = 0x00,
-       .end = 0x0F,
-       .base = 0x04000000,
-       .check = simple_check,
-       .inb = simple_inb,
-       .inw = simple_inw,
-       .outb = simple_outb,
-       .outw = simple_outw,
-};
-#endif
-
-#ifdef CONFIG_NE2000
-/* NE2000 pc card NIC */
-static struct iop neiop = {
-       .start = 0x280,
-       .end = 0x29f,
-       .base = 0xb0600000 + 0x80,      /* soft 0x280 -> hard 0x300 */
-       .check = simple_check,
-       .inb = pcc_inb,
-       .inw = simple_inw,
-       .outb = pcc_outb,
-       .outw = simple_outw,
-};
-#endif
-
-#ifdef CONFIG_IDE
-/* CF in CF slot */
-static struct iop cfiop = {
-       .base = 0xb0600000,
-       .check = ide_check,
-       .inb = pcc_inb,
-       .inw = simple_inw,
-       .outb = pcc_outb,
-       .outw = simple_outw,
-};
-#endif
-
-static __inline__ struct iop *
-port2iop(unsigned long port)
-{
-       if (0) ;
-#if defined(CONFIG_SMC91X)
-       else if (laniop.check(&laniop, port))
-               return &laniop;
-#endif
-#if defined(CONFIG_NE2000)
-       else if (neiop.check(&neiop, port))
-               return &neiop;
-#endif
-#if defined(CONFIG_IDE)
-       else if (cfiop.check(&cfiop, port))
-               return &cfiop;
-#endif
-       else
-               return NULL;
-}
-
-static inline void
-delay(void)
-{
-       ctrl_inw(0xac000000);
-       ctrl_inw(0xac000000);
-}
-
-unsigned char
-sh7343se_inb(unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       return (p->inb) (p, port);
-}
-
-unsigned char
-sh7343se_inb_p(unsigned long port)
-{
-       unsigned char v = sh7343se_inb(port);
-       delay();
-       return v;
-}
-
-unsigned short
-sh7343se_inw(unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       return (p->inw) (p, port);
-}
-
-unsigned int
-sh7343se_inl(unsigned long port)
-{
-       badio(inl, port);
-}
-
-void
-sh7343se_outb(unsigned char value, unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       (p->outb) (p, value, port);
-}
-
-void
-sh7343se_outb_p(unsigned char value, unsigned long port)
-{
-       sh7343se_outb(value, port);
-       delay();
-}
-
-void
-sh7343se_outw(unsigned short value, unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       (p->outw) (p, value, port);
-}
-
-void
-sh7343se_outl(unsigned int value, unsigned long port)
-{
-       badio(outl, port);
-}
-
-void
-sh7343se_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *a = addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               *a++ = (p->inb) (p, port);
-}
-
-void
-sh7343se_insw(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned short *a = addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               *a++ = (p->inw) (p, port);
-}
-
-void
-sh7343se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       badio(insl, port);
-}
-
-void
-sh7343se_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *a = (unsigned char *) addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               (p->outb) (p, *a++, port);
-}
-
-void
-sh7343se_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned short *a = (unsigned short *) addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               (p->outw) (p, *a++, port);
-}
-
-void
-sh7343se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       badio(outsw, port);
-}
diff --git a/arch/sh/boards/se/7343/irq.c b/arch/sh/boards/se/7343/irq.c
deleted file mode 100644 (file)
index 1112e86..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7343/irq.c
- *
- * Copyright (C) 2008  Yoshihiro Shimoda
- *
- * Based on linux/arch/sh/boards/se/7722/irq.c
- * Copyright (C) 2007  Nobuhiro Iwamatsu
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7343.h>
-
-static void disable_se7343_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
-}
-
-static void enable_se7343_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
-}
-
-static struct irq_chip se7343_irq_chip __read_mostly = {
-       .name           = "SE7343-FPGA",
-       .mask           = disable_se7343_irq,
-       .unmask         = enable_se7343_irq,
-       .mask_ack       = disable_se7343_irq,
-};
-
-static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
-{
-       unsigned short intv = ctrl_inw(PA_CPLD_ST);
-       struct irq_desc *ext_desc;
-       unsigned int ext_irq = SE7343_FPGA_IRQ_BASE;
-
-       intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
-
-       while (intv) {
-               if (intv & 1) {
-                       ext_desc = irq_desc + ext_irq;
-                       handle_level_irq(ext_irq, ext_desc);
-               }
-               intv >>= 1;
-               ext_irq++;
-       }
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7343se_IRQ(void)
-{
-       int i;
-
-       ctrl_outw(0, PA_CPLD_IMSK);     /* disable all irqs */
-       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
-
-       for (i = 0; i < SE7343_FPGA_IRQ_NR; i++)
-               set_irq_chip_and_handler_name(SE7343_FPGA_IRQ_BASE + i,
-                                             &se7343_irq_chip,
-                                             handle_level_irq, "level");
-
-       set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ4_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ5_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
diff --git a/arch/sh/boards/se/7343/setup.c b/arch/sh/boards/se/7343/setup.c
deleted file mode 100644 (file)
index 8ae718d..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <asm/machvec.h>
-#include <asm/mach/se7343.h>
-#include <asm/heartbeat.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start  = 0x10000000,
-               .end    = 0x1000000F,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               /*
-                * shared with other devices via externel
-                * interrupt controller in FPGA...
-                */
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
-       {
-               .name           = "loader",
-               .offset         = 0x00000000,
-               .size           = 128 * 1024,
-       },
-       {
-               .name           = "rootfs",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 31 * 1024 * 1024,
-       },
-       {
-               .name           = "data",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data nor_flash_data = {
-       .width          = 2,
-       .parts          = nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
-       [0]     = {
-               .start  = 0x00000000,
-               .end    = 0x01ffffff,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device nor_flash_device = {
-       .name           = "physmap-flash",
-       .dev            = {
-               .platform_data  = &nor_flash_data,
-       },
-       .num_resources  = ARRAY_SIZE(nor_flash_resources),
-       .resource       = nor_flash_resources,
-};
-
-static struct platform_device *sh7343se_platform_devices[] __initdata = {
-       &smc91x_device,
-       &heartbeat_device,
-       &nor_flash_device,
-};
-
-static int __init sh7343se_devices_setup(void)
-{
-       return platform_add_devices(sh7343se_platform_devices,
-                                   ARRAY_SIZE(sh7343se_platform_devices));
-}
-device_initcall(sh7343se_devices_setup);
-
-/*
- * Initialize the board
- */
-static void __init sh7343se_setup(char **cmdline_p)
-{
-       ctrl_outw(0xf900, FPGA_OUT);    /* FPGA */
-
-       ctrl_outw(0x0002, PORT_PECR);   /* PORT E 1 = IRQ5 */
-       ctrl_outw(0x0020, PORT_PSELD);
-
-       printk(KERN_INFO "MS7343CP01 Setup...done\n");
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7343se __initmv = {
-       .mv_name = "SolutionEngine 7343",
-       .mv_setup = sh7343se_setup,
-       .mv_nr_irqs = 108,
-       .mv_inb = sh7343se_inb,
-       .mv_inw = sh7343se_inw,
-       .mv_inl = sh7343se_inl,
-       .mv_outb = sh7343se_outb,
-       .mv_outw = sh7343se_outw,
-       .mv_outl = sh7343se_outl,
-
-       .mv_inb_p = sh7343se_inb_p,
-       .mv_inw_p = sh7343se_inw,
-       .mv_inl_p = sh7343se_inl,
-       .mv_outb_p = sh7343se_outb_p,
-       .mv_outw_p = sh7343se_outw,
-       .mv_outl_p = sh7343se_outl,
-
-       .mv_insb = sh7343se_insb,
-       .mv_insw = sh7343se_insw,
-       .mv_insl = sh7343se_insl,
-       .mv_outsb = sh7343se_outsb,
-       .mv_outsw = sh7343se_outsw,
-       .mv_outsl = sh7343se_outsl,
-
-       .mv_init_irq = init_7343se_IRQ,
-};
diff --git a/arch/sh/boards/se/7619/Makefile b/arch/sh/boards/se/7619/Makefile
deleted file mode 100644 (file)
index d21775c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7619 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o
diff --git a/arch/sh/boards/se/7619/setup.c b/arch/sh/boards/se/7619/setup.c
deleted file mode 100644 (file)
index 1d0ef7f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/sh/boards/se/7619/setup.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- *
- * Hitachi SH7619 SolutionEngine Support.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 108,
-};
diff --git a/arch/sh/boards/se/770x/Makefile b/arch/sh/boards/se/770x/Makefile
deleted file mode 100644 (file)
index 8e624b0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 770x SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/770x/io.c b/arch/sh/boards/se/770x/io.c
deleted file mode 100644 (file)
index b1ec085..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * I/O routine for Hitachi SolutionEngine.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/se.h>
-
-/* MS7750 requires special versions of in*, out* routines, since
-   PC-like io ports are located at upper half byte of 16-bit word which
-   can be accessed only with 16-bit wide.  */
-
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port & 0xff000000)
-               return ( volatile __u16 *) port;
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       else if (port >= 0x1000)
-               return (volatile __u16 *) (PA_83902 + (port << 1));
-       else
-               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
-}
-
-static inline int
-shifted_port(unsigned long port)
-{
-       /* For IDE registers, value is not shifted */
-       if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
-               return 0;
-       else
-               return 1;
-}
-
-unsigned char se_inb(unsigned long port)
-{
-       if (shifted_port(port))
-               return (*port2adr(port) >> 8);
-       else
-               return (*port2adr(port))&0xff;
-}
-
-unsigned char se_inb_p(unsigned long port)
-{
-       unsigned long v;
-
-       if (shifted_port(port))
-               v = (*port2adr(port) >> 8);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short se_inw(unsigned long port)
-{
-       if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int se_inl(unsigned long port)
-{
-       maybebadio(port);
-       return 0;
-}
-
-void se_outb(unsigned char value, unsigned long port)
-{
-       if (shifted_port(port))
-               *(port2adr(port)) = value << 8;
-       else
-               *(port2adr(port)) = value;
-}
-
-void se_outb_p(unsigned char value, unsigned long port)
-{
-       if (shifted_port(port))
-               *(port2adr(port)) = value << 8;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void se_outw(unsigned short value, unsigned long port)
-{
-       if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void se_outl(unsigned int value, unsigned long port)
-{
-       maybebadio(port);
-}
-
-void se_insb(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u8 *ap = addr;
-
-       if (shifted_port(port)) {
-               while (count--)
-                       *ap++ = *p >> 8;
-       } else {
-               while (count--)
-                       *ap++ = *p;
-       }
-}
-
-void se_insw(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u16 *ap = addr;
-       while (count--)
-               *ap++ = *p;
-}
-
-void se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void se_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u8 *ap = addr;
-
-       if (shifted_port(port)) {
-               while (count--)
-                       *p = *ap++ << 8;
-       } else {
-               while (count--)
-                       *p = *ap++;
-       }
-}
-
-void se_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u16 *ap = addr;
-
-       while (count--)
-               *p = *ap++;
-}
-
-void se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/se/770x/irq.c b/arch/sh/boards/se/770x/irq.c
deleted file mode 100644 (file)
index cdb0807..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * linux/arch/sh/boards/se/770x/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- * Copyright (C) 2006  Nobuhiro Iwamatsu
- *
- * Hitachi SolutionEngine Support.
- *
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se.h>
-
-static struct ipr_data ipr_irq_table[] = {
-       /*
-       * Super I/O (Just mimic PC):
-       *  1: keyboard
-       *  3: serial 0
-       *  4: serial 1
-       *  5: printer
-       *  6: floppy
-       *  8: rtc
-       * 12: mouse
-       * 14: ide0
-       */
-#if defined(CONFIG_CPU_SUBTYPE_SH7705)
-       /* This is default value */
-       { 13, 0, 8,  0x0f-13, },
-       { 5 , 0, 4,  0x0f- 5, },
-       { 10, 1, 0,  0x0f-10, },
-       { 7 , 2, 4,  0x0f- 7, },
-       { 3 , 2, 0,  0x0f- 3, },
-       { 1 , 3, 12, 0x0f- 1, },
-       { 12, 3, 4,  0x0f-12, }, /* LAN */
-       { 2 , 4, 8,  0x0f- 2, }, /* PCIRQ2 */
-       { 6 , 4, 4,  0x0f- 6, }, /* PCIRQ1 */
-       { 14, 4, 0,  0x0f-14, }, /* PCIRQ0 */
-       { 0 , 5, 12, 0x0f   , }, 
-       { 4 , 5, 4,  0x0f- 4, },
-       { 8 , 6, 12, 0x0f- 8, },
-       { 9 , 6, 8,  0x0f- 9, },
-       { 11, 6, 4,  0x0f-11, },
-#else
-       { 14, 0,  8, 0x0f-14, },
-       { 12, 0,  4, 0x0f-12, },
-       {  8, 1,  4, 0x0f- 8, },
-       {  6, 2, 12, 0x0f- 6, },
-       {  5, 2,  8, 0x0f- 5, },
-       {  4, 2,  4, 0x0f- 4, },
-       {  3, 2,  0, 0x0f- 3, },
-       {  1, 3, 12, 0x0f- 1, },
-#if defined(CONFIG_STNIC)
-       /* ST NIC */
-       { 10, 3,  4, 0x0f-10, },        /* LAN */
-#endif
-       /* MRSHPC IRQs setting */
-       {  0, 4, 12, 0x0f- 0, },        /* PCIRQ3 */
-       { 11, 4,  8, 0x0f-11, },        /* PCIRQ2 */
-       {  9, 4,  4, 0x0f- 9, },        /* PCIRQ1 */
-       {  7, 4,  0, 0x0f- 7, },        /* PCIRQ0 */
-       /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
-       /* NOTE: #2 and #13 are not used on PC */
-       { 13, 6,  4, 0x0f-13, },        /* SLOTIRQ2 */
-       {  2, 6,  0, 0x0f- 2, },        /* SLOTIRQ1 */
-#endif
-};
-
-static unsigned long ipr_offsets[] = {
-       BCR_ILCRA,
-       BCR_ILCRB,
-       BCR_ILCRC,
-       BCR_ILCRD,
-       BCR_ILCRE,
-       BCR_ILCRF,
-       BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
-       .ipr_offsets    = ipr_offsets,
-       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
-
-       .ipr_data       = ipr_irq_table,
-       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
-       .chip = {
-               .name   = "IPR-se770x",
-       },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se_IRQ(void)
-{
-       /* Disable all interrupts */
-       ctrl_outw(0, BCR_ILCRA);
-       ctrl_outw(0, BCR_ILCRB);
-       ctrl_outw(0, BCR_ILCRC);
-       ctrl_outw(0, BCR_ILCRD);
-       ctrl_outw(0, BCR_ILCRE);
-       ctrl_outw(0, BCR_ILCRF);
-       ctrl_outw(0, BCR_ILCRG);
-
-       register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c
deleted file mode 100644 (file)
index cf4a5ba..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * linux/arch/sh/boards/se/770x/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se.h>
-#include <asm/io.h>
-#include <asm/smc37c93x.h>
-#include <asm/heartbeat.h>
-
-/*
- * Configure the Super I/O chip
- */
-static void __init smsc_config(int index, int data)
-{
-       outb_p(index, INDEX_PORT);
-       outb_p(data, DATA_PORT);
-}
-
-/* XXX: Another candidate for a more generic cchip machine vector */
-static void __init smsc_setup(char **cmdline_p)
-{
-       outb_p(CONFIG_ENTER, CONFIG_PORT);
-       outb_p(CONFIG_ENTER, CONFIG_PORT);
-
-       /* FDC */
-       smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
-
-       /* AUXIO (GPIO): to use IDE1 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
-       smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
-       smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
-
-       /* COM1 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IO_BASE_HI_INDEX, 0x03);
-       smsc_config(IO_BASE_LO_INDEX, 0xf8);
-       smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
-
-       /* COM2 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IO_BASE_HI_INDEX, 0x02);
-       smsc_config(IO_BASE_LO_INDEX, 0xf8);
-       smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
-
-       /* RTC */
-       smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
-
-       /* XXX: PARPORT, KBD, and MOUSE will come here... */
-       outb_p(CONFIG_EXIT, CONFIG_PORT);
-}
-
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = IRQ_CFCARD,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SH771X Ethernet driver */
-static struct resource sh_eth0_resources[] = {
-       [0] = {
-               .start = SH_ETH0_BASE,
-               .end = SH_ETH0_BASE + 0x1B8,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = SH_ETH0_IRQ,
-               .end = SH_ETH0_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_eth0_device = {
-       .name = "sh-eth",
-       .id     = 0,
-       .dev = {
-               .platform_data = PHY_ID,
-       },
-       .num_resources = ARRAY_SIZE(sh_eth0_resources),
-       .resource = sh_eth0_resources,
-};
-
-static struct resource sh_eth1_resources[] = {
-       [0] = {
-               .start = SH_ETH1_BASE,
-               .end = SH_ETH1_BASE + 0x1B8,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = SH_ETH1_IRQ,
-               .end = SH_ETH1_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_eth1_device = {
-       .name = "sh-eth",
-       .id     = 1,
-       .dev = {
-               .platform_data = PHY_ID,
-       },
-       .num_resources = ARRAY_SIZE(sh_eth1_resources),
-       .resource = sh_eth1_resources,
-};
-
-static struct platform_device *se_devices[] __initdata = {
-       &heartbeat_device,
-       &cf_ide_device,
-       &sh_eth0_device,
-       &sh_eth1_device,
-};
-
-static int __init se_devices_setup(void)
-{
-       return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
-}
-device_initcall(se_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_setup               = smsc_setup,
-#if defined(CONFIG_CPU_SH4)
-       .mv_nr_irqs             = 48,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
-       .mv_nr_irqs             = 32,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
-       .mv_nr_irqs             = 61,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
-       .mv_nr_irqs             = 86,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-       .mv_nr_irqs             = 104,
-#endif
-
-       .mv_inb                 = se_inb,
-       .mv_inw                 = se_inw,
-       .mv_inl                 = se_inl,
-       .mv_outb                = se_outb,
-       .mv_outw                = se_outw,
-       .mv_outl                = se_outl,
-
-       .mv_inb_p               = se_inb_p,
-       .mv_inw_p               = se_inw,
-       .mv_inl_p               = se_inl,
-       .mv_outb_p              = se_outb_p,
-       .mv_outw_p              = se_outw,
-       .mv_outl_p              = se_outl,
-
-       .mv_insb                = se_insb,
-       .mv_insw                = se_insw,
-       .mv_insl                = se_insl,
-       .mv_outsb               = se_outsb,
-       .mv_outsw               = se_outsw,
-       .mv_outsl               = se_outsl,
-
-       .mv_init_irq            = init_se_IRQ,
-};
diff --git a/arch/sh/boards/se/7721/Makefile b/arch/sh/boards/se/7721/Makefile
deleted file mode 100644 (file)
index 7f09030..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7721/irq.c b/arch/sh/boards/se/7721/irq.c
deleted file mode 100644 (file)
index c4fdd62..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7721/irq.c
- *
- * Copyright (C) 2008  Renesas Solutions Corp.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <asm/se7721.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-       MRSHPC,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
-};
-
-static struct intc_prio_reg prio_registers[] __initdata = {
-       { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
-         { 0, MRSHPC } },
-};
-
-static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
-                        NULL, NULL, prio_registers, NULL);
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7721_IRQ(void)
-{
-       /* PPCR */
-       ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
-
-       register_intc_controller(&intc_desc);
-       intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
-}
diff --git a/arch/sh/boards/se/7721/setup.c b/arch/sh/boards/se/7721/setup.c
deleted file mode 100644 (file)
index 1be3e92..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7721/setup.c
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- *
- * Hitachi UL SolutionEngine 7721 Support.
- *
- * 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.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7721.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = MRSHPC_IRQ0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device *se7721_devices[] __initdata = {
-       &cf_ide_device,
-       &heartbeat_device
-};
-
-static int __init se7721_devices_setup(void)
-{
-       return platform_add_devices(se7721_devices,
-               ARRAY_SIZE(se7721_devices));
-}
-device_initcall(se7721_devices_setup);
-
-static void __init se7721_setup(char **cmdline_p)
-{
-       /* for USB */
-       ctrl_outw(0x0000, 0xA405010C);  /* PGCR */
-       ctrl_outw(0x0000, 0xA405010E);  /* PHCR */
-       ctrl_outw(0x00AA, 0xA4050118);  /* PPCR */
-       ctrl_outw(0x0000, 0xA4050124);  /* PSELA */
-}
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_se7721 __initmv = {
-       .mv_name                = "Solution Engine 7721",
-       .mv_setup               = se7721_setup,
-       .mv_nr_irqs             = 109,
-       .mv_init_irq            = init_se7721_IRQ,
-};
diff --git a/arch/sh/boards/se/7722/Makefile b/arch/sh/boards/se/7722/Makefile
deleted file mode 100644 (file)
index 8694373..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for the HITACHI UL SolutionEngine 7722 specific parts of the kernel
-#
-# 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.
-#
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7722/irq.c b/arch/sh/boards/se/7722/irq.c
deleted file mode 100644 (file)
index 0b03f3f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7722/irq.c
- *
- * Copyright (C) 2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7722 Support.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7722.h>
-
-static void disable_se7722_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
-}
-
-static void enable_se7722_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
-}
-
-static struct irq_chip se7722_irq_chip __read_mostly = {
-       .name           = "SE7722-FPGA",
-       .mask           = disable_se7722_irq,
-       .unmask         = enable_se7722_irq,
-       .mask_ack       = disable_se7722_irq,
-};
-
-static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
-{
-       unsigned short intv = ctrl_inw(IRQ01_STS);
-       struct irq_desc *ext_desc;
-       unsigned int ext_irq = SE7722_FPGA_IRQ_BASE;
-
-       intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
-
-       while (intv) {
-               if (intv & 1) {
-                       ext_desc = irq_desc + ext_irq;
-                       handle_level_irq(ext_irq, ext_desc);
-               }
-               intv >>= 1;
-               ext_irq++;
-       }
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7722_IRQ(void)
-{
-       int i;
-
-       ctrl_outw(0, IRQ01_MASK);       /* disable all irqs */
-       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
-
-       for (i = 0; i < SE7722_FPGA_IRQ_NR; i++)
-               set_irq_chip_and_handler_name(SE7722_FPGA_IRQ_BASE + i,
-                                             &se7722_irq_chip,
-                                             handle_level_irq, "level");
-
-       set_irq_chained_handler(IRQ0_IRQ, se7722_irq_demux);
-       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-
-       set_irq_chained_handler(IRQ1_IRQ, se7722_irq_demux);
-       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c
deleted file mode 100644 (file)
index 6e228ea..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7722/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7722 Support.
- *
- * 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.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/input.h>
-#include <linux/smc91x.h>
-#include <asm/machvec.h>
-#include <asm/clock.h>
-#include <asm/se7722.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-#include <asm/sh_keysc.h>
-
-/* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct smc91x_platdata smc91x_info = {
-       .flags = SMC91X_USE_16BIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-               .platform_data  = &smc91x_info,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 +8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = MRSHPC_IRQ0,
-               .end    = MRSHPC_IRQ0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct sh_keysc_info sh_keysc_info = {
-       .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
-       .scan_timing = 3,
-       .delay = 5,
-       .keycodes = { /* SW1 -> SW30 */
-               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
-               KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
-               KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
-               KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
-               KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
-               KEY_Z,
-               KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
-       },
-};
-
-static struct resource sh_keysc_resources[] = {
-       [0] = {
-               .start  = 0x044b0000,
-               .end    = 0x044b000f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 79,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_keysc_device = {
-       .name           = "sh_keysc",
-       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
-       .resource       = sh_keysc_resources,
-       .dev    = {
-               .platform_data  = &sh_keysc_info,
-       },
-};
-
-static struct platform_device *se7722_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-       &cf_ide_device,
-       &sh_keysc_device,
-};
-
-static int __init se7722_devices_setup(void)
-{
-       clk_always_enable("mstp214"); /* KEYSC */
-
-       return platform_add_devices(se7722_devices,
-               ARRAY_SIZE(se7722_devices));
-}
-device_initcall(se7722_devices_setup);
-
-static void __init se7722_setup(char **cmdline_p)
-{
-       ctrl_outw(0x010D, FPGA_OUT);    /* FPGA */
-
-       ctrl_outw(0x0000, PORT_PECR);   /* PORT E 1 = IRQ5 ,E 0 = BS */
-       ctrl_outw(0x1000, PORT_PJCR);   /* PORT J 1 = IRQ1,J 0 =IRQ0 */
-
-       /* LCDC I/O */
-       ctrl_outw(0x0020, PORT_PSELD);
-
-       /* SIOF1*/
-       ctrl_outw(0x0003, PORT_PSELB);
-       ctrl_outw(0xe000, PORT_PSELC);
-       ctrl_outw(0x0000, PORT_PKCR);
-
-       /* LCDC */
-       ctrl_outw(0x4020, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(0x0002, PORT_PRCR);
-       ctrl_outw(0x0000, PORT_PXCR);   /* LCDC,CS6A */
-
-       /* KEYSC */
-       ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
-       ctrl_outw(0x0000, PORT_PYCR);
-       ctrl_outw(0x0000, PORT_PZCR);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7722 __initmv = {
-       .mv_name                = "Solution Engine 7722" ,
-       .mv_setup               = se7722_setup ,
-       .mv_nr_irqs             = SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_NR,
-       .mv_init_irq            = init_se7722_IRQ,
-};
diff --git a/arch/sh/boards/se/7751/Makefile b/arch/sh/boards/se/7751/Makefile
deleted file mode 100644 (file)
index dbc29f3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the 7751 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
-
-obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/sh/boards/se/7751/io.c b/arch/sh/boards/se/7751/io.c
deleted file mode 100644 (file)
index e8d846c..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 SolutionEngine.
- *
- * Initial version only to support LAN access; some
- * placeholder code from io_se.c left in with the
- * expectation of later SuperIO and PCMCIA access.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/se7751.h>
-#include <asm/addrspace.h>
-
-static inline volatile u16 *port2adr(unsigned int port)
-{
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char sh7751se_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               return (*port2adr(port)) & 0xff;
-}
-
-unsigned char sh7751se_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-        if (PXSEG(port))
-                v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-                v = *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               v = (*port2adr(port)) & 0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short sh7751se_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int sh7751se_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void sh7751se_outb(unsigned char value, unsigned long port)
-{
-
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void sh7751se_outb_p(unsigned char value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void sh7751se_outw(unsigned short value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751se_outl(unsigned int value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/se/7751/irq.c b/arch/sh/boards/se/7751/irq.c
deleted file mode 100644 (file)
index c3d1259..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/se7751.h>
-
-static struct ipr_data ipr_irq_table[] = {
-       { 13, 3, 3, 2 },
-       /* Add additional entries here as drivers are added and tested. */
-};
-
-static unsigned long ipr_offsets[] = {
-       BCR_ILCRA,
-       BCR_ILCRB,
-       BCR_ILCRC,
-       BCR_ILCRD,
-       BCR_ILCRE,
-       BCR_ILCRF,
-       BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
-       .ipr_offsets    = ipr_offsets,
-       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
-
-       .ipr_data       = ipr_irq_table,
-       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
-
-       .chip = {
-               .name   = "IPR-se7751",
-       },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7751se_IRQ(void)
-{
-       register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/se/7751/pci.c b/arch/sh/boards/se/7751/pci.c
deleted file mode 100644 (file)
index 203b292..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/pci.c
- *
- * Author:  Ian DaSilva (idasilva@mvista.com)
- *
- * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01)
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include "../../../drivers/pci/pci-sh7751.h"
-
-#define PCIMCR_MRSET_OFF       0xBFFFFFFF
-#define PCIMCR_RFSH_OFF                0xFFFFFFFB
-
-/*
- * Only long word accesses of the PCIC's internal local registers and the
- * configuration registers from the CPU is supported.
- */
-#define PCIC_WRITE(x,v) writel((v), PCI_REG(x))
-#define PCIC_READ(x) readl(PCI_REG(x))
-
-/*
- * Description:  This function sets up and initializes the pcic, sets
- * up the BARS, maps the DRAM into the address space etc, etc.
- */
-int __init pcibios_init_platform(void)
-{
-   unsigned long bcr1, wcr1, wcr2, wcr3, mcr;
-   unsigned short bcr2;
-
-   /*
-    * Initialize the slave bus controller on the pcic.  The values used
-    * here should not be hardcoded, but they should be taken from the bsc
-    * on the processor, to make this function as generic as possible.
-    * (i.e. Another sbc may usr different SDRAM timing settings -- in order
-    * for the pcic to work, its settings need to be exactly the same.)
-    */
-   bcr1 = (*(volatile unsigned long*)(SH7751_BCR1));
-   bcr2 = (*(volatile unsigned short*)(SH7751_BCR2));
-   wcr1 = (*(volatile unsigned long*)(SH7751_WCR1));
-   wcr2 = (*(volatile unsigned long*)(SH7751_WCR2));
-   wcr3 = (*(volatile unsigned long*)(SH7751_WCR3));
-   mcr = (*(volatile unsigned long*)(SH7751_MCR));
-
-   bcr1 = bcr1 | 0x00080000;  /* Enable Bit 19, BREQEN */
-   (*(volatile unsigned long*)(SH7751_BCR1)) = bcr1;   
-
-   bcr1 = bcr1 | 0x40080000;  /* Enable Bit 19 BREQEN, set PCIC to slave */
-   PCIC_WRITE(SH7751_PCIBCR1, bcr1);    /* PCIC BCR1 */
-   PCIC_WRITE(SH7751_PCIBCR2, bcr2);     /* PCIC BCR2 */
-   PCIC_WRITE(SH7751_PCIWCR1, wcr1);     /* PCIC WCR1 */
-   PCIC_WRITE(SH7751_PCIWCR2, wcr2);     /* PCIC WCR2 */
-   PCIC_WRITE(SH7751_PCIWCR3, wcr3);     /* PCIC WCR3 */
-   mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
-   PCIC_WRITE(SH7751_PCIMCR, mcr);      /* PCIC MCR */
-
-
-   /* Enable all interrupts, so we know what to fix */
-   PCIC_WRITE(SH7751_PCIINTM, 0x0000c3ff);
-   PCIC_WRITE(SH7751_PCIAINTM, 0x0000380f);
-
-   /* Set up standard PCI config registers */
-   PCIC_WRITE(SH7751_PCICONF1,         0xF39000C7); /* Bus Master, Mem & I/O access */
-   PCIC_WRITE(SH7751_PCICONF2,         0x00000000); /* PCI Class code & Revision ID */
-   PCIC_WRITE(SH7751_PCICONF4,         0xab000001); /* PCI I/O address (local regs) */
-   PCIC_WRITE(SH7751_PCICONF5,         0x0c000000); /* PCI MEM address (local RAM)  */
-   PCIC_WRITE(SH7751_PCICONF6,         0xd0000000); /* PCI MEM address (unused)     */
-   PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID & Vendor ID */
-   PCIC_WRITE(SH7751_PCILSR0, 0x03f00000);   /* MEM (full 64M exposed)       */
-   PCIC_WRITE(SH7751_PCILSR1, 0x00000000);   /* MEM (unused)                 */
-   PCIC_WRITE(SH7751_PCILAR0, 0x0c000000);   /* MEM (direct map from PCI)    */
-   PCIC_WRITE(SH7751_PCILAR1, 0x00000000);   /* MEM (unused)                 */
-
-   /* Now turn it on... */
-   PCIC_WRITE(SH7751_PCICR, 0xa5000001);
-
-   /*
-    * Set PCIMBR and PCIIOBR here, assuming a single window
-    * (16M MEM, 256K IO) is enough.  If a larger space is
-    * needed, the readx/writex and inx/outx functions will
-    * have to do more (e.g. setting registers for each call).
-    */
-
-   /*
-    * Set the MBR so PCI address is one-to-one with window,
-    * meaning all calls go straight through... use BUG_ON to
-    * catch erroneous assumption.
-    */
-   BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE);
-
-   PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM);
-
-   /* Set IOBR for window containing area specified in pci.h */
-   PCIC_WRITE(SH7751_PCIIOBR, (PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK));
-
-   /* All done, may as well say so... */
-   printk("SH7751 PCI: Finished initialization of the PCI controller\n");
-
-   return 1;
-}
-
-int __init pcibios_map_platform_irq(u8 slot, u8 pin)
-{
-        switch (slot) {
-        case 0: return 13;
-        case 1: return 13;     /* AMD Ethernet controller */
-        case 2: return -1;
-        case 3: return -1;
-        case 4: return -1;
-        default:
-                printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
-                return -1;
-        }
-}
-
-static struct resource sh7751_io_resource = {
-       .name   = "SH7751 IO",
-       .start  = SH7751_PCI_IO_BASE,
-       .end    = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
-       .flags  = IORESOURCE_IO
-};
-
-static struct resource sh7751_mem_resource = {
-       .name   = "SH7751 mem",
-       .start  = SH7751_PCI_MEMORY_BASE,
-       .end    = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
-       .flags  = IORESOURCE_MEM
-};
-
-extern struct pci_ops sh7751_pci_ops;
-
-struct pci_channel board_pci_channels[] = {
-       { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
-       { NULL, NULL, NULL, 0, 0 },
-};
-
diff --git a/arch/sh/boards/se/7751/setup.c b/arch/sh/boards/se/7751/setup.c
deleted file mode 100644 (file)
index deefbfd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7751.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *se7751_devices[] __initdata = {
-       &heartbeat_device,
-};
-
-static int __init se7751_devices_setup(void)
-{
-       return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
-}
-__initcall(se7751_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7751se __initmv = {
-       .mv_name                = "7751 SolutionEngine",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = sh7751se_inb,
-       .mv_inw                 = sh7751se_inw,
-       .mv_inl                 = sh7751se_inl,
-       .mv_outb                = sh7751se_outb,
-       .mv_outw                = sh7751se_outw,
-       .mv_outl                = sh7751se_outl,
-
-       .mv_inb_p               = sh7751se_inb_p,
-       .mv_inw_p               = sh7751se_inw,
-       .mv_inl_p               = sh7751se_inl,
-       .mv_outb_p              = sh7751se_outb_p,
-       .mv_outw_p              = sh7751se_outw,
-       .mv_outl_p              = sh7751se_outl,
-
-       .mv_insl                = sh7751se_insl,
-       .mv_outsl               = sh7751se_outsl,
-
-       .mv_init_irq            = init_7751se_IRQ,
-};
diff --git a/arch/sh/boards/se/7780/Makefile b/arch/sh/boards/se/7780/Makefile
deleted file mode 100644 (file)
index 6b88ada..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for the HITACHI UL SolutionEngine 7780 specific parts of the kernel
-#
-# 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.
-#
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7780/irq.c b/arch/sh/boards/se/7780/irq.c
deleted file mode 100644 (file)
index 6bd70da..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7780/irq.c
- *
- * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7780.h>
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7780_IRQ(void)
-{
-       /* enable all interrupt at FPGA */
-       ctrl_outw(0, FPGA_INTMSK1);
-       /* mask SM501 interrupt */
-       ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
-       /* enable all interrupt at FPGA */
-       ctrl_outw(0, FPGA_INTMSK2);
-
-       /* set FPGA INTSEL register */
-       /* FPGA + 0x06 */
-       ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
-               (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
-
-       /* FPGA + 0x08 */
-       ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
-               (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
-               (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
-               (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
-
-       /* FPGA + 0x0A */
-       ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
-
-       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
-}
diff --git a/arch/sh/boards/se/7780/setup.c b/arch/sh/boards/se/7780/setup.c
deleted file mode 100644 (file)
index 0f08ab3..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7780/setup.c
- *
- * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7780.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-/* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct platform_device *se7780_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-};
-
-static int __init se7780_devices_setup(void)
-{
-       return platform_add_devices(se7780_devices,
-               ARRAY_SIZE(se7780_devices));
-}
-device_initcall(se7780_devices_setup);
-
-#define GPIO_PHCR        0xFFEA000E
-#define GPIO_PMSELR      0xFFEA0080
-#define GPIO_PECR        0xFFEA0008
-
-static void __init se7780_setup(char **cmdline_p)
-{
-       /* "SH-Linux" on LED Display */
-       ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
-       ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
-       ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
-       ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
-       ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
-       ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
-       ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
-       ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
-
-       printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
-
-       /*
-        * PCI REQ/GNT setting
-        *   REQ0/GNT0 -> USB
-        *   REQ1/GNT1 -> PC Card
-        *   REQ2/GNT2 -> Serial ATA
-        *   REQ3/GNT3 -> PCI slot
-        */
-       ctrl_outw(0x0213, FPGA_REQSEL);
-
-       /* GPIO setting */
-       ctrl_outw(0x0000, GPIO_PECR);
-       ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
-       ctrl_outw(0x0c00, GPIO_PMSELR);
-
-       /* iVDR Power ON */
-       ctrl_outw(0x0001, FPGA_IVDRPW);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
-       .mv_name                = "Solution Engine 7780" ,
-       .mv_setup               = se7780_setup ,
-       .mv_nr_irqs             = 111 ,
-       .mv_init_irq            = init_se7780_IRQ,
-};
diff --git a/arch/sh/boards/sh03/Makefile b/arch/sh/boards/sh03/Makefile
deleted file mode 100644 (file)
index 400306a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel
-#
-
-obj-y   := setup.o rtc.o
diff --git a/arch/sh/boards/sh03/rtc.c b/arch/sh/boards/sh03/rtc.c
deleted file mode 100644 (file)
index 0a9266b..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
- *
- *  Copyright (C) 2004  Saito.K & Jeanne(ksaito@interface.co.jp)
- *
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/bcd.h>
-#include <linux/rtc.h>
-#include <linux/spinlock.h>
-#include <asm/io.h>
-#include <asm/rtc.h>
-
-#define RTC_BASE       0xb0000000
-#define RTC_SEC1       (RTC_BASE + 0)
-#define RTC_SEC10      (RTC_BASE + 1)
-#define RTC_MIN1       (RTC_BASE + 2)
-#define RTC_MIN10      (RTC_BASE + 3)
-#define RTC_HOU1       (RTC_BASE + 4)
-#define RTC_HOU10      (RTC_BASE + 5)
-#define RTC_WEE1       (RTC_BASE + 6)
-#define RTC_DAY1       (RTC_BASE + 7)
-#define RTC_DAY10      (RTC_BASE + 8)
-#define RTC_MON1       (RTC_BASE + 9)
-#define RTC_MON10      (RTC_BASE + 10)
-#define RTC_YEA1       (RTC_BASE + 11)
-#define RTC_YEA10      (RTC_BASE + 12)
-#define RTC_YEA100     (RTC_BASE + 13)
-#define RTC_YEA1000    (RTC_BASE + 14)
-#define RTC_CTL                (RTC_BASE + 15)
-#define RTC_BUSY       1
-#define RTC_STOP       2
-
-extern spinlock_t rtc_lock;
-
-unsigned long get_cmos_time(void)
-{
-       unsigned int year, mon, day, hour, min, sec;
-
-       spin_lock(&rtc_lock);
- again:
-       do {
-               sec  = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
-               min  = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
-               hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10;
-               day  = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10;
-               mon  = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10;
-               year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10
-                    + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100
-                    + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000;
-       } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10);
-       if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
-           hour > 23 || min > 59 || sec > 59) {
-               printk(KERN_ERR
-                      "SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
-               printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
-                      year, mon, day, hour, min, sec);
-
-               ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10);
-               ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10);
-               ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10);
-               ctrl_outb(6, RTC_WEE1);
-               ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10);
-               ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10);
-               ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10);
-               ctrl_outb(0, RTC_YEA100);
-               ctrl_outb(2, RTC_YEA1000);
-               ctrl_outb(0, RTC_CTL);
-               goto again;
-       }
-
-       spin_unlock(&rtc_lock);
-       return mktime(year, mon, day, hour, min, sec);
-}
-
-void sh03_rtc_gettimeofday(struct timespec *tv)
-{
-
-       tv->tv_sec = get_cmos_time();
-       tv->tv_nsec = 0;
-}
-
-static int set_rtc_mmss(unsigned long nowtime)
-{
-       int retval = 0;
-       int real_seconds, real_minutes, cmos_minutes;
-       int i;
-
-       /* gets recalled with irq locally disabled */
-       spin_lock(&rtc_lock);
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
-                       break;
-       cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
-       real_seconds = nowtime % 60;
-       real_minutes = nowtime / 60;
-       if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-               real_minutes += 30;             /* correct for half hour time zone */
-       real_minutes %= 60;
-
-       if (abs(real_minutes - cmos_minutes) < 30) {
-               ctrl_outb(real_seconds % 10, RTC_SEC1);
-               ctrl_outb(real_seconds / 10, RTC_SEC10);
-               ctrl_outb(real_minutes % 10, RTC_MIN1);
-               ctrl_outb(real_minutes / 10, RTC_MIN10);
-       } else {
-               printk(KERN_WARNING
-                      "set_rtc_mmss: can't update from %d to %d\n",
-                      cmos_minutes, real_minutes);
-               retval = -1;
-       }
-       spin_unlock(&rtc_lock);
-
-       return retval;
-}
-
-int sh03_rtc_settimeofday(const time_t secs)
-{
-       unsigned long nowtime = secs;
-
-       return set_rtc_mmss(nowtime);
-}
-
-void sh03_time_init(void)
-{
-       rtc_sh_get_time = sh03_rtc_gettimeofday;
-       rtc_sh_set_time = sh03_rtc_settimeofday;
-}
diff --git a/arch/sh/boards/sh03/setup.c b/arch/sh/boards/sh03/setup.c
deleted file mode 100644 (file)
index 934ac4f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * linux/arch/sh/boards/sh03/setup.c
- *
- * Copyright (C) 2004  Interface Co.,Ltd. Saito.K
- *
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/platform_device.h>
-#include <asm/io.h>
-#include <asm/rtc.h>
-#include <asm/sh03/io.h>
-#include <asm/sh03/sh03.h>
-#include <asm/addrspace.h>
-
-static void __init init_sh03_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-extern void *cf_io_base;
-
-static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
-{
-       if (PXSEG(port))
-               return (void __iomem *)port;
-       /* CompactFlash (IDE) */
-       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
-               return (void __iomem *)((unsigned long)cf_io_base + port);
-
-        return (void __iomem *)(port + PCI_IO_BASE);
-}
-
-/* arch/sh/boards/sh03/rtc.c */
-void sh03_time_init(void);
-
-static void __init sh03_setup(char **cmdline_p)
-{
-       board_time_init = sh03_time_init;
-}
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = 0xa0800000,
-               .end    = 0xa0800000,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *sh03_devices[] __initdata = {
-       &heartbeat_device,
-};
-
-static int __init sh03_devices_setup(void)
-{
-       return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
-}
-__initcall(sh03_devices_setup);
-
-static struct sh_machine_vector mv_sh03 __initmv = {
-       .mv_name                = "Interface (CTP/PCI-SH03)",
-       .mv_setup               = sh03_setup,
-       .mv_nr_irqs             = 48,
-       .mv_ioport_map          = sh03_ioport_map,
-       .mv_init_irq            = init_sh03_IRQ,
-};
diff --git a/arch/sh/boards/shmin/Makefile b/arch/sh/boards/shmin/Makefile
deleted file mode 100644 (file)
index 3190cc7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SHMIN board.
-#
-
-obj-y   := setup.o
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c
deleted file mode 100644 (file)
index 16e5dae..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * arch/sh/boards/shmin/setup.c
- *
- * Copyright (C) 2006 Takashi YOSHII
- *
- * SHMIN Support.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/machvec.h>
-#include <asm/shmin.h>
-#include <asm/clock.h>
-#include <asm/io.h>
-
-#define PFC_PHCR       0xa400010eUL
-#define INTC_ICR1      0xa4000010UL
-
-static void __init init_shmin_irq(void)
-{
-       ctrl_outw(0x2a00, PFC_PHCR);    // IRQ0-3=IRQ
-       ctrl_outw(0x0aaa, INTC_ICR1);   // IRQ0-3=IRQ-mode,Low-active.
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
-{
-       static int dummy;
-
-       if ((port & ~0x1f) == SHMIN_NE_BASE)
-               return (void __iomem *)(SHMIN_IO_BASE + port);
-
-       dummy = 0;
-
-       return &dummy;
-
-}
-
-static struct sh_machine_vector mv_shmin __initmv = {
-       .mv_name        = "SHMIN",
-       .mv_init_irq    = init_shmin_irq,
-       .mv_ioport_map  = shmin_ioport_map,
-};
diff --git a/arch/sh/boards/snapgear/Makefile b/arch/sh/boards/snapgear/Makefile
deleted file mode 100644 (file)
index d2d2f4b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SnapGear specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
diff --git a/arch/sh/boards/snapgear/io.c b/arch/sh/boards/snapgear/io.c
deleted file mode 100644 (file)
index 0f48242..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 SolutionEngine.
- *
- * Initial version only to support LAN access; some
- * placeholder code from io_se.c left in with the
- * expectation of later SuperIO and PCMCIA access.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-#ifdef CONFIG_SH_SECUREEDGE5410
-unsigned short secureedge5410_ioport;
-#endif
-
-static inline volatile __u16 *port2adr(unsigned int port)
-{
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char snapgear_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               return (*port2adr(port)) & 0xff;
-}
-
-unsigned char snapgear_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-       if (PXSEG(port))
-               v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               v = *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short snapgear_inw(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int snapgear_inl(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void snapgear_outb(unsigned char value, unsigned long port)
-{
-
-       if (PXSEG(port))
-               *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void snapgear_outb_p(unsigned char value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void snapgear_outw(unsigned short value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void snapgear_outl(unsigned int value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void snapgear_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c
deleted file mode 100644 (file)
index 7022483..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * linux/arch/sh/boards/snapgear/setup.c
- *
- * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
- * Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
- *
- * Based on files with the following comments:
- *
- *           Copyright (C) 2000  Kazumoto Kojima
- *
- *           Modified for 7751 Solution Engine by
- *           Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/timer.h>
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <asm/machvec.h>
-#include <asm/snapgear.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/cpu/timer.h>
-
-/*
- * EraseConfig handling functions
- */
-
-static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
-{
-       (void)ctrl_inb(0xb8000000);     /* dummy read */
-
-       printk("SnapGear: erase switch interrupt!\n");
-
-       return IRQ_HANDLED;
-}
-
-static int __init eraseconfig_init(void)
-{
-       printk("SnapGear: EraseConfig init\n");
-       /* Setup "EraseConfig" switch on external IRQ 0 */
-       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
-                               "Erase Config", NULL))
-               printk("SnapGear: failed to register IRQ%d for Reset witch\n",
-                               IRL0_IRQ);
-       else
-               printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
-                               IRL0_IRQ);
-       return(0);
-}
-
-module_init(eraseconfig_init);
-
-/****************************************************************************/
-/*
- * Initialize IRQ setting
- *
- * IRL0 = erase switch
- * IRL1 = eth0
- * IRL2 = eth1
- * IRL3 = crypto
- */
-
-static void __init init_snapgear_IRQ(void)
-{
-       printk("Setup SnapGear IRQ/IPR ...\n");
-       /* enable individual interrupt mode for externals */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_snapgear __initmv = {
-       .mv_name                = "SnapGear SecureEdge5410",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = snapgear_inb,
-       .mv_inw                 = snapgear_inw,
-       .mv_inl                 = snapgear_inl,
-       .mv_outb                = snapgear_outb,
-       .mv_outw                = snapgear_outw,
-       .mv_outl                = snapgear_outl,
-
-       .mv_inb_p               = snapgear_inb_p,
-       .mv_inw_p               = snapgear_inw,
-       .mv_inl_p               = snapgear_inl,
-       .mv_outb_p              = snapgear_outb_p,
-       .mv_outw_p              = snapgear_outw,
-       .mv_outl_p              = snapgear_outl,
-
-       .mv_init_irq            = init_snapgear_IRQ,
-};
diff --git a/arch/sh/boards/superh/microdev/Makefile b/arch/sh/boards/superh/microdev/Makefile
deleted file mode 100644 (file)
index 1387dd6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Makefile for the SuperH MicroDev specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o io.o
-
-obj-$(CONFIG_HEARTBEAT)        += led.o
-
diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c
deleted file mode 100644 (file)
index 9f8a540..0000000
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * linux/arch/sh/boards/superh/microdev/io.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/wait.h>
-#include <asm/io.h>
-#include <asm/microdev.h>
-
-       /*
-        *      we need to have a 'safe' address to re-direct all I/O requests
-        *      that we do not explicitly wish to handle. This safe address
-        *      must have the following properies:
-        *
-        *              * writes are ignored (no exception)
-        *              * reads are benign (no side-effects)
-        *              * accesses of width 1, 2 and 4-bytes are all valid.
-        *
-        *      The Processor Version Register (PVR) has these properties.
-        */
-#define        PVR     0xff000030      /* Processor Version Register */
-
-
-#define        IO_IDE2_BASE            0x170ul /* I/O base for SMSC FDC37C93xAPM IDE #2 */
-#define        IO_IDE1_BASE            0x1f0ul /* I/O base for SMSC FDC37C93xAPM IDE #1 */
-#define IO_ISP1161_BASE                0x290ul /* I/O port for Philips ISP1161x USB chip */
-#define IO_SERIAL2_BASE                0x2f8ul /* I/O base for SMSC FDC37C93xAPM Serial #2 */
-#define        IO_LAN91C111_BASE       0x300ul /* I/O base for SMSC LAN91C111 Ethernet chip */
-#define        IO_IDE2_MISC            0x376ul /* I/O misc for SMSC FDC37C93xAPM IDE #2 */
-#define IO_SUPERIO_BASE                0x3f0ul /* I/O base for SMSC FDC37C93xAPM SuperIO chip */
-#define        IO_IDE1_MISC            0x3f6ul /* I/O misc for SMSC FDC37C93xAPM IDE #1 */
-#define IO_SERIAL1_BASE                0x3f8ul /* I/O base for SMSC FDC37C93xAPM Serial #1 */
-
-#define        IO_ISP1161_EXTENT       0x04ul  /* I/O extent for Philips ISP1161x USB chip */
-#define        IO_LAN91C111_EXTENT     0x10ul  /* I/O extent for SMSC LAN91C111 Ethernet chip */
-#define        IO_SUPERIO_EXTENT       0x02ul  /* I/O extent for SMSC FDC37C93xAPM SuperIO chip */
-#define        IO_IDE_EXTENT           0x08ul  /* I/O extent for IDE Task Register set */
-#define IO_SERIAL_EXTENT       0x10ul
-
-#define        IO_LAN91C111_PHYS       0xa7500000ul    /* Physical address of SMSC LAN91C111 Ethernet chip */
-#define        IO_ISP1161_PHYS         0xa7700000ul    /* Physical address of Philips ISP1161x USB chip */
-#define        IO_SUPERIO_PHYS         0xa7800000ul    /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
-
-/*
- * map I/O ports to memory-mapped addresses
- */
-static unsigned long microdev_isa_port2addr(unsigned long offset)
-{
-       unsigned long result;
-
-       if ((offset >= IO_LAN91C111_BASE) &&
-           (offset <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
-                       /*
-                        *      SMSC LAN91C111 Ethernet chip
-                        */
-               result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
-       } else if ((offset >= IO_SUPERIO_BASE) &&
-                  (offset <  IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Configuration Registers
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-#if 0
-       } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
-                  offset == KBD_STATUS_REG) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-#endif
-       } else if (((offset >= IO_IDE1_BASE) &&
-                   (offset <  IO_IDE1_BASE + IO_IDE_EXTENT)) ||
-                   (offset == IO_IDE1_MISC)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      IDE #1
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if (((offset >= IO_IDE2_BASE) &&
-                   (offset <  IO_IDE2_BASE + IO_IDE_EXTENT)) ||
-                   (offset == IO_IDE2_MISC)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      IDE #2
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_SERIAL1_BASE) &&
-                  (offset <  IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Serial #1
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_SERIAL2_BASE) &&
-                  (offset <  IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Serial #2
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_ISP1161_BASE) &&
-                  (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
-                       /*
-                        *      Philips USB ISP1161x chip
-                        */
-               result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
-       } else {
-                       /*
-                        *      safe default.
-                        */
-               printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
-                      __func__, offset);
-               result = PVR;
-       }
-
-       return result;
-}
-
-#define PORT2ADDR(x) (microdev_isa_port2addr(x))
-
-static inline void delay(void)
-{
-#if defined(CONFIG_PCI)
-       /* System board present, just make a dummy SRAM access.  (CS0 will be
-          mapped to PCI memory, probably good to avoid it.) */
-       ctrl_inw(0xa6800000);
-#else
-       /* CS0 will be mapped to flash, ROM etc so safe to access it. */
-       ctrl_inw(0xa0000000);
-#endif
-}
-
-unsigned char microdev_inb(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inb(port);
-#endif
-       return *(volatile unsigned char*)PORT2ADDR(port);
-}
-
-unsigned short microdev_inw(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inw(port);
-#endif
-       return *(volatile unsigned short*)PORT2ADDR(port);
-}
-
-unsigned int microdev_inl(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inl(port);
-#endif
-       return *(volatile unsigned int*)PORT2ADDR(port);
-}
-
-void microdev_outw(unsigned short b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outw(b, port);
-               return;
-       }
-#endif
-       *(volatile unsigned short*)PORT2ADDR(port) = b;
-}
-
-void microdev_outb(unsigned char b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outb(b, port);
-               return;
-       }
-#endif
-
-       /*
-        *      There is a board feature with the current SH4-202 MicroDev in
-        *      that the 2 byte enables (nBE0 and nBE1) are tied together (and
-        *      to the Chip Select Line (Ethernet_CS)). Due to this connectivity,
-        *      it is not possible to safely perform 8-bit writes to the
-        *      Ethernet registers, as 16-bits will be consumed from the Data
-        *      lines (corrupting the other byte).  Hence, this function is
-        *      written to implement 16-bit read/modify/write for all byte-wide
-        *      accesses.
-        *
-        *      Note: there is no problem with byte READS (even or odd).
-        *
-        *                      Sean McGoogan - 16th June 2003.
-        */
-       if ((port >= IO_LAN91C111_BASE) &&
-           (port <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
-                       /*
-                        * Then are trying to perform a byte-write to the
-                        * LAN91C111.  This needs special care.
-                        */
-               if (port % 2 == 1) {    /* is the port odd ? */
-                       /* unset bit-0, i.e. make even */
-                       const unsigned long evenPort = port-1;
-                       unsigned short word;
-
-                       /*
-                        * do a 16-bit read/write to write to 'port',
-                        * preserving even byte.
-                        *
-                        *      Even addresses are bits 0-7
-                        *      Odd  addresses are bits 8-15
-                        */
-                       word = microdev_inw(evenPort);
-                       word = (word & 0xffu) | (b << 8);
-                       microdev_outw(word, evenPort);
-               } else {
-                       /* else, we are trying to do an even byte write */
-                       unsigned short word;
-
-                       /*
-                        * do a 16-bit read/write to write to 'port',
-                        * preserving odd byte.
-                        *
-                        *      Even addresses are bits 0-7
-                        *      Odd  addresses are bits 8-15
-                        */
-                       word = microdev_inw(port);
-                       word = (word & 0xff00u) | (b);
-                       microdev_outw(word, port);
-               }
-       } else {
-               *(volatile unsigned char*)PORT2ADDR(port) = b;
-       }
-}
-
-void microdev_outl(unsigned int b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outl(b, port);
-               return;
-       }
-#endif
-       *(volatile unsigned int*)PORT2ADDR(port) = b;
-}
-
-unsigned char microdev_inb_p(unsigned long port)
-{
-       unsigned char v = microdev_inb(port);
-       delay();
-       return v;
-}
-
-unsigned short microdev_inw_p(unsigned long port)
-{
-       unsigned short v = microdev_inw(port);
-       delay();
-       return v;
-}
-
-unsigned int microdev_inl_p(unsigned long port)
-{
-       unsigned int v = microdev_inl(port);
-       delay();
-       return v;
-}
-
-void microdev_outb_p(unsigned char b, unsigned long port)
-{
-       microdev_outb(b, port);
-       delay();
-}
-
-void microdev_outw_p(unsigned short b, unsigned long port)
-{
-       microdev_outw(b, port);
-       delay();
-}
-
-void microdev_outl_p(unsigned int b, unsigned long port)
-{
-       microdev_outl(b, port);
-       delay();
-}
-
-void microdev_insb(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned char *port_addr;
-       unsigned char *buf = buffer;
-
-       port_addr = (volatile unsigned char *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_insw(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned short *port_addr;
-       unsigned short *buf = buffer;
-
-       port_addr = (volatile unsigned short *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_insl(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned long *port_addr;
-       unsigned int *buf = buffer;
-
-       port_addr = (volatile unsigned long *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned char *port_addr;
-       const unsigned char *buf = buffer;
-
-       port_addr = (volatile unsigned char *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
-
-void microdev_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned short *port_addr;
-       const unsigned short *buf = buffer;
-
-       port_addr = (volatile unsigned short *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
-
-void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned long *port_addr;
-       const unsigned int *buf = buffer;
-
-       port_addr = (volatile unsigned long *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c
deleted file mode 100644 (file)
index 4d33507..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * arch/sh/boards/superh/microdev/irq.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/microdev.h>
-
-#define NUM_EXTERNAL_IRQS 16   /* IRL0 .. IRL15 */
-
-static const struct {
-       unsigned char fpgaIrq;
-       unsigned char mapped;
-       const char *name;
-} fpgaIrqTable[NUM_EXTERNAL_IRQS] = {
-       { 0,                            0,      "unused"   },           /* IRQ #0       IRL=15  0x200  */
-       { MICRODEV_FPGA_IRQ_KEYBOARD,   1,      "keyboard" },           /* IRQ #1       IRL=14  0x220  */
-       { MICRODEV_FPGA_IRQ_SERIAL1,    1,      "Serial #1"},           /* IRQ #2       IRL=13  0x240  */
-       { MICRODEV_FPGA_IRQ_ETHERNET,   1,      "Ethernet" },           /* IRQ #3       IRL=12  0x260  */
-       { MICRODEV_FPGA_IRQ_SERIAL2,    0,      "Serial #2"},           /* IRQ #4       IRL=11  0x280  */
-       { 0,                            0,      "unused"   },           /* IRQ #5       IRL=10  0x2a0  */
-       { 0,                            0,      "unused"   },           /* IRQ #6       IRL=9   0x2c0  */
-       { MICRODEV_FPGA_IRQ_USB_HC,     1,      "USB"      },           /* IRQ #7       IRL=8   0x2e0  */
-       { MICRODEV_IRQ_PCI_INTA,        1,      "PCI INTA" },           /* IRQ #8       IRL=7   0x300  */
-       { MICRODEV_IRQ_PCI_INTB,        1,      "PCI INTB" },           /* IRQ #9       IRL=6   0x320  */
-       { MICRODEV_IRQ_PCI_INTC,        1,      "PCI INTC" },           /* IRQ #10      IRL=5   0x340  */
-       { MICRODEV_IRQ_PCI_INTD,        1,      "PCI INTD" },           /* IRQ #11      IRL=4   0x360  */
-       { MICRODEV_FPGA_IRQ_MOUSE,      1,      "mouse"    },           /* IRQ #12      IRL=3   0x380  */
-       { MICRODEV_FPGA_IRQ_IDE2,       1,      "IDE #2"   },           /* IRQ #13      IRL=2   0x3a0  */
-       { MICRODEV_FPGA_IRQ_IDE1,       1,      "IDE #1"   },           /* IRQ #14      IRL=1   0x3c0  */
-       { 0,                            0,      "unused"   },           /* IRQ #15      IRL=0   0x3e0  */
-};
-
-#if (MICRODEV_LINUX_IRQ_KEYBOARD != 1)
-#  error Inconsistancy in defining the IRQ# for Keyboard!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_ETHERNET != 3)
-#  error Inconsistancy in defining the IRQ# for Ethernet!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_USB_HC != 7)
-#  error Inconsistancy in defining the IRQ# for USB!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_MOUSE != 12)
-#  error Inconsistancy in defining the IRQ# for PS/2 Mouse!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE2 != 13)
-#  error Inconsistancy in defining the IRQ# for secondary IDE!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE1 != 14)
-#  error Inconsistancy in defining the IRQ# for primary IDE!
-#endif
-
-static void enable_microdev_irq(unsigned int irq);
-static void disable_microdev_irq(unsigned int irq);
-
-       /* shutdown is same as "disable" */
-#define shutdown_microdev_irq disable_microdev_irq
-
-static void mask_and_ack_microdev(unsigned int);
-static void end_microdev_irq(unsigned int irq);
-
-static unsigned int startup_microdev_irq(unsigned int irq)
-{
-       enable_microdev_irq(irq);
-       return 0;               /* never anything pending */
-}
-
-static struct hw_interrupt_type microdev_irq_type = {
-       .typename = "MicroDev-IRQ",
-       .startup = startup_microdev_irq,
-       .shutdown = shutdown_microdev_irq,
-       .enable = enable_microdev_irq,
-       .disable = disable_microdev_irq,
-       .ack = mask_and_ack_microdev,
-       .end = end_microdev_irq
-};
-
-static void disable_microdev_irq(unsigned int irq)
-{
-       unsigned int fpgaIrq;
-
-       if (irq >= NUM_EXTERNAL_IRQS)
-               return;
-       if (!fpgaIrqTable[irq].mapped)
-               return;
-
-       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
-
-       /* disable interrupts on the FPGA INTC register */
-       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
-}
-
-static void enable_microdev_irq(unsigned int irq)
-{
-       unsigned long priorityReg, priorities, pri;
-       unsigned int fpgaIrq;
-
-       if (unlikely(irq >= NUM_EXTERNAL_IRQS))
-               return;
-       if (unlikely(!fpgaIrqTable[irq].mapped))
-               return;
-
-       pri = 15 - irq;
-
-       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
-       priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
-
-       /* set priority for the interrupt */
-       priorities = ctrl_inl(priorityReg);
-       priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
-       priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
-       ctrl_outl(priorities, priorityReg);
-
-       /* enable interrupts on the FPGA INTC register */
-       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
-}
-
-       /* This functions sets the desired irq handler to be a MicroDev type */
-static void __init make_microdev_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       irq_desc[irq].chip = &microdev_irq_type;
-       disable_microdev_irq(irq);
-}
-
-static void mask_and_ack_microdev(unsigned int irq)
-{
-       disable_microdev_irq(irq);
-}
-
-static void end_microdev_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_microdev_irq(irq);
-}
-
-extern void __init init_microdev_irq(void)
-{
-       int i;
-
-               /* disable interrupts on the FPGA INTC register */
-       ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG);
-
-       for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
-               make_microdev_irq(i);
-}
-
-extern void microdev_print_fpga_intc_status(void)
-{
-       volatile unsigned int * const intenb = (unsigned int*)MICRODEV_FPGA_INTENB_REG;
-       volatile unsigned int * const intdsb = (unsigned int*)MICRODEV_FPGA_INTDSB_REG;
-       volatile unsigned int * const intpria = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(0);
-       volatile unsigned int * const intprib = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(8);
-       volatile unsigned int * const intpric = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(16);
-       volatile unsigned int * const intprid = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(24);
-       volatile unsigned int * const intsrc = (unsigned int*)MICRODEV_FPGA_INTSRC_REG;
-       volatile unsigned int * const intreq = (unsigned int*)MICRODEV_FPGA_INTREQ_REG;
-
-       printk("-------------------------- microdev_print_fpga_intc_status() ------------------\n");
-       printk("FPGA_INTENB = 0x%08x\n", *intenb);
-       printk("FPGA_INTDSB = 0x%08x\n", *intdsb);
-       printk("FPGA_INTSRC = 0x%08x\n", *intsrc);
-       printk("FPGA_INTREQ = 0x%08x\n", *intreq);
-       printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria);
-       printk("-------------------------------------------------------------------------------\n");
-}
-
-
diff --git a/arch/sh/boards/superh/microdev/led.c b/arch/sh/boards/superh/microdev/led.c
deleted file mode 100644 (file)
index 36e54b4..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * linux/arch/sh/boards/superh/microdev/led.c
- *
- * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
- * Copyright (C) 2003 Richard Curnow (Richard.Curnow@superh.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- */
-
-#include <asm/io.h>
-
-#define LED_REGISTER 0xa6104d20
-
-static void mach_led_d9(int value)
-{
-       unsigned long reg;
-       reg = ctrl_inl(LED_REGISTER);
-       reg &= ~1;
-       reg |= (value & 1);
-       ctrl_outl(reg, LED_REGISTER);
-       return;
-}
-
-static void mach_led_d10(int value)
-{
-       unsigned long reg;
-       reg = ctrl_inl(LED_REGISTER);
-       reg &= ~2;
-       reg |= ((value & 1) << 1);
-       ctrl_outl(reg, LED_REGISTER);
-       return;
-}
-
-
-#ifdef CONFIG_HEARTBEAT
-#include <linux/sched.h>
-
-static unsigned char banner_table[] = {
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x13, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x07,
-       0x13, 0x01, 0x13, 0x03,
-       0x11, 0x01, 0x11, 0x03,
-       0x13, 0x01, 0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x13, 0x01, 0x13, 0x01, 0x13, 0x03,
-       0x13, 0x01, 0x11, 0x01, 0x11, 0x03,
-       0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x13, 0x07,
-       0xff
-};
-
-static void banner(void)
-{
-       static int pos = 0;
-       static int count = 0;
-
-       if (count) {
-               count--;
-       } else {
-               int val = banner_table[pos];
-               if (val == 0xff) {
-                       pos = 0;
-                       val = banner_table[pos];
-               }
-               pos++;
-               mach_led_d10((val >> 4) & 1);
-               count = 10 * (val & 0xf);
-       }
-}
-
-/* From heartbeat_harp in the stboards directory */
-/* acts like an actual heart beat -- ie thump-thump-pause... */
-void microdev_heartbeat(void)
-{
-       static unsigned cnt = 0, period = 0, dist = 0;
-
-       if (cnt == 0 || cnt == dist)
-               mach_led_d9(1);
-       else if (cnt == 7 || cnt == dist+7)
-               mach_led_d9(0);
-
-       if (++cnt > period) {
-               cnt = 0;
-               /* The hyperbolic function below modifies the heartbeat period
-                * length in dependency of the current (5min) load. It goes
-                * through the points f(0)=126, f(1)=86, f(5)=51,
-                * f(inf)->30. */
-               period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
-               dist = period / 4;
-       }
-
-       banner();
-}
-
-#endif
diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c
deleted file mode 100644 (file)
index fc8cd06..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * arch/sh/boards/superh/microdev/setup.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004, 2005 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ioport.h>
-#include <video/s1d13xxxfb.h>
-#include <asm/microdev.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-extern void microdev_heartbeat(void);
-
-
-/****************************************************************************/
-
-
-       /*
-        * Setup for the SMSC FDC37C93xAPM
-        */
-#define SMSC_CONFIG_PORT_ADDR   (0x3F0)
-#define SMSC_INDEX_PORT_ADDR    SMSC_CONFIG_PORT_ADDR
-#define SMSC_DATA_PORT_ADDR     (SMSC_INDEX_PORT_ADDR + 1)
-
-#define SMSC_ENTER_CONFIG_KEY   0x55
-#define SMSC_EXIT_CONFIG_KEY    0xaa
-
-#define SMCS_LOGICAL_DEV_INDEX          0x07   /* Logical Device Number */
-#define SMSC_DEVICE_ID_INDEX    0x20   /* Device ID */
-#define SMSC_DEVICE_REV_INDEX   0x21   /* Device Revision */
-#define SMSC_ACTIVATE_INDEX     0x30   /* Activate */
-#define SMSC_PRIMARY_BASE_INDEX         0x60   /* Primary Base Address */
-#define SMSC_SECONDARY_BASE_INDEX 0x62 /* Secondary Base Address */
-#define SMSC_PRIMARY_INT_INDEX  0x70   /* Primary Interrupt Select */
-#define SMSC_SECONDARY_INT_INDEX 0x72  /* Secondary Interrupt Select */
-#define SMSC_HDCS0_INDEX        0xf0   /* HDCS0 Address Decoder */
-#define SMSC_HDCS1_INDEX        0xf1   /* HDCS1 Address Decoder */
-
-#define SMSC_IDE1_DEVICE       1       /* IDE #1 logical device */
-#define SMSC_IDE2_DEVICE       2       /* IDE #2 logical device */
-#define SMSC_PARALLEL_DEVICE   3       /* Parallel Port logical device */
-#define SMSC_SERIAL1_DEVICE    4       /* Serial #1 logical device */
-#define SMSC_SERIAL2_DEVICE    5       /* Serial #2 logical device */
-#define SMSC_KEYBOARD_DEVICE   7       /* Keyboard logical device */
-#define SMSC_CONFIG_REGISTERS  8       /* Configuration Registers (Aux I/O) */
-
-#define SMSC_READ_INDEXED(index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       inb(SMSC_DATA_PORT_ADDR); })
-#define SMSC_WRITE_INDEXED(val, index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       outb((val),   SMSC_DATA_PORT_ADDR); })
-
-#define        IDE1_PRIMARY_BASE       0x01f0  /* Task File Registe base for IDE #1 */
-#define        IDE1_SECONDARY_BASE     0x03f6  /* Miscellaneous AT registers for IDE #1 */
-#define        IDE2_PRIMARY_BASE       0x0170  /* Task File Registe base for IDE #2 */
-#define        IDE2_SECONDARY_BASE     0x0376  /* Miscellaneous AT registers for IDE #2 */
-
-#define SERIAL1_PRIMARY_BASE   0x03f8
-#define SERIAL2_PRIMARY_BASE   0x02f8
-
-#define        MSB(x)          ( (x) >> 8 )
-#define        LSB(x)          ( (x) & 0xff )
-
-       /* General-Purpose base address on CPU-board FPGA */
-#define        MICRODEV_FPGA_GP_BASE           0xa6100000ul
-
-       /* assume a Keyboard Controller is present */
-int microdev_kbd_controller_present = 1;
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start          = 0x300,
-               .end            = 0x300 + 0x0001000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = MICRODEV_LINUX_IRQ_ETHERNET,
-               .end            = MICRODEV_LINUX_IRQ_ETHERNET,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-#ifdef CONFIG_FB_S1D13XXX
-static struct s1d13xxxfb_regval s1d13806_initregs[] = {
-       { S1DREG_MISC,                  0x00 },
-       { S1DREG_COM_DISP_MODE,         0x00 },
-       { S1DREG_GPIO_CNF0,             0x00 },
-       { S1DREG_GPIO_CNF1,             0x00 },
-       { S1DREG_GPIO_CTL0,             0x00 },
-       { S1DREG_GPIO_CTL1,             0x00 },
-       { S1DREG_CLK_CNF,               0x02 },
-       { S1DREG_LCD_CLK_CNF,           0x01 },
-       { S1DREG_CRT_CLK_CNF,           0x03 },
-       { S1DREG_MPLUG_CLK_CNF,         0x03 },
-       { S1DREG_CPU2MEM_WST_SEL,       0x02 },
-       { S1DREG_SDRAM_REF_RATE,        0x03 },
-       { S1DREG_SDRAM_TC0,             0x00 },
-       { S1DREG_SDRAM_TC1,             0x01 },
-       { S1DREG_MEM_CNF,               0x80 },
-       { S1DREG_PANEL_TYPE,            0x25 },
-       { S1DREG_MOD_RATE,              0x00 },
-       { S1DREG_LCD_DISP_HWIDTH,       0x63 },
-       { S1DREG_LCD_NDISP_HPER,        0x1e },
-       { S1DREG_TFT_FPLINE_START,      0x06 },
-       { S1DREG_TFT_FPLINE_PWIDTH,     0x03 },
-       { S1DREG_LCD_DISP_VHEIGHT0,     0x57 },
-       { S1DREG_LCD_DISP_VHEIGHT1,     0x02 },
-       { S1DREG_LCD_NDISP_VPER,        0x00 },
-       { S1DREG_TFT_FPFRAME_START,     0x0a },
-       { S1DREG_TFT_FPFRAME_PWIDTH,    0x81 },
-       { S1DREG_LCD_DISP_MODE,         0x03 },
-       { S1DREG_LCD_MISC,              0x00 },
-       { S1DREG_LCD_DISP_START0,       0x00 },
-       { S1DREG_LCD_DISP_START1,       0x00 },
-       { S1DREG_LCD_DISP_START2,       0x00 },
-       { S1DREG_LCD_MEM_OFF0,          0x90 },
-       { S1DREG_LCD_MEM_OFF1,          0x01 },
-       { S1DREG_LCD_PIX_PAN,           0x00 },
-       { S1DREG_LCD_DISP_FIFO_HTC,     0x00 },
-       { S1DREG_LCD_DISP_FIFO_LTC,     0x00 },
-       { S1DREG_CRT_DISP_HWIDTH,       0x63 },
-       { S1DREG_CRT_NDISP_HPER,        0x1f },
-       { S1DREG_CRT_HRTC_START,        0x04 },
-       { S1DREG_CRT_HRTC_PWIDTH,       0x8f },
-       { S1DREG_CRT_DISP_VHEIGHT0,     0x57 },
-       { S1DREG_CRT_DISP_VHEIGHT1,     0x02 },
-       { S1DREG_CRT_NDISP_VPER,        0x1b },
-       { S1DREG_CRT_VRTC_START,        0x00 },
-       { S1DREG_CRT_VRTC_PWIDTH,       0x83 },
-       { S1DREG_TV_OUT_CTL,            0x10 },
-       { S1DREG_CRT_DISP_MODE,         0x05 },
-       { S1DREG_CRT_DISP_START0,       0x00 },
-       { S1DREG_CRT_DISP_START1,       0x00 },
-       { S1DREG_CRT_DISP_START2,       0x00 },
-       { S1DREG_CRT_MEM_OFF0,          0x20 },
-       { S1DREG_CRT_MEM_OFF1,          0x03 },
-       { S1DREG_CRT_PIX_PAN,           0x00 },
-       { S1DREG_CRT_DISP_FIFO_HTC,     0x00 },
-       { S1DREG_CRT_DISP_FIFO_LTC,     0x00 },
-       { S1DREG_LCD_CUR_CTL,           0x00 },
-       { S1DREG_LCD_CUR_START,         0x01 },
-       { S1DREG_LCD_CUR_XPOS0,         0x00 },
-       { S1DREG_LCD_CUR_XPOS1,         0x00 },
-       { S1DREG_LCD_CUR_YPOS0,         0x00 },
-       { S1DREG_LCD_CUR_YPOS1,         0x00 },
-       { S1DREG_LCD_CUR_BCTL0,         0x00 },
-       { S1DREG_LCD_CUR_GCTL0,         0x00 },
-       { S1DREG_LCD_CUR_RCTL0,         0x00 },
-       { S1DREG_LCD_CUR_BCTL1,         0x1f },
-       { S1DREG_LCD_CUR_GCTL1,         0x3f },
-       { S1DREG_LCD_CUR_RCTL1,         0x1f },
-       { S1DREG_LCD_CUR_FIFO_HTC,      0x00 },
-       { S1DREG_CRT_CUR_CTL,           0x00 },
-       { S1DREG_CRT_CUR_START,         0x01 },
-       { S1DREG_CRT_CUR_XPOS0,         0x00 },
-       { S1DREG_CRT_CUR_XPOS1,         0x00 },
-       { S1DREG_CRT_CUR_YPOS0,         0x00 },
-       { S1DREG_CRT_CUR_YPOS1,         0x00 },
-       { S1DREG_CRT_CUR_BCTL0,         0x00 },
-       { S1DREG_CRT_CUR_GCTL0,         0x00 },
-       { S1DREG_CRT_CUR_RCTL0,         0x00 },
-       { S1DREG_CRT_CUR_BCTL1,         0x1f },
-       { S1DREG_CRT_CUR_GCTL1,         0x3f },
-       { S1DREG_CRT_CUR_RCTL1,         0x1f },
-       { S1DREG_CRT_CUR_FIFO_HTC,      0x00 },
-       { S1DREG_BBLT_CTL0,             0x00 },
-       { S1DREG_BBLT_CTL1,             0x00 },
-       { S1DREG_BBLT_CC_EXP,           0x00 },
-       { S1DREG_BBLT_OP,               0x00 },
-       { S1DREG_BBLT_SRC_START0,       0x00 },
-       { S1DREG_BBLT_SRC_START1,       0x00 },
-       { S1DREG_BBLT_SRC_START2,       0x00 },
-       { S1DREG_BBLT_DST_START0,       0x00 },
-       { S1DREG_BBLT_DST_START1,       0x00 },
-       { S1DREG_BBLT_DST_START2,       0x00 },
-       { S1DREG_BBLT_MEM_OFF0,         0x00 },
-       { S1DREG_BBLT_MEM_OFF1,         0x00 },
-       { S1DREG_BBLT_WIDTH0,           0x00 },
-       { S1DREG_BBLT_WIDTH1,           0x00 },
-       { S1DREG_BBLT_HEIGHT0,          0x00 },
-       { S1DREG_BBLT_HEIGHT1,          0x00 },
-       { S1DREG_BBLT_BGC0,             0x00 },
-       { S1DREG_BBLT_BGC1,             0x00 },
-       { S1DREG_BBLT_FGC0,             0x00 },
-       { S1DREG_BBLT_FGC1,             0x00 },
-       { S1DREG_LKUP_MODE,             0x00 },
-       { S1DREG_LKUP_ADDR,             0x00 },
-       { S1DREG_PS_CNF,                0x10 },
-       { S1DREG_PS_STATUS,             0x00 },
-       { S1DREG_CPU2MEM_WDOGT,         0x00 },
-       { S1DREG_COM_DISP_MODE,         0x02 },
-};
-
-static struct s1d13xxxfb_pdata s1d13806_platform_data = {
-       .initregs       = s1d13806_initregs,
-       .initregssize   = ARRAY_SIZE(s1d13806_initregs),
-};
-
-static struct resource s1d13806_resources[] = {
-       [0] = {
-               .start          = 0x07200000,
-               .end            = 0x07200000 + 0x00200000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 0x07000000,
-               .end            = 0x07000000 + 0x00200000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device s1d13806_device = {
-       .name           = "s1d13806fb",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(s1d13806_resources),
-       .resource       = s1d13806_resources,
-
-       .dev = {
-               .platform_data  = &s1d13806_platform_data,
-       },
-};
-#endif
-
-static struct platform_device *microdev_devices[] __initdata = {
-       &smc91x_device,
-#ifdef CONFIG_FB_S1D13XXX
-       &s1d13806_device,
-#endif
-};
-
-static int __init microdev_devices_setup(void)
-{
-       return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
-}
-
-/*
- * Setup for the SMSC FDC37C93xAPM
- */
-static int __init smsc_superio_setup(void)
-{
-
-       unsigned char devid, devrev;
-
-               /* Initially the chip is in run state */
-               /* Put it into configuration state */
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-               /* Read device ID info */
-       devid  = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
-       devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
-       if ( (devid==0x30) && (devrev==0x01) )
-       {
-               printk("SMSC FDC37C93xAPM SuperIO device detected\n");
-       }
-       else
-       {               /* not the device identity we expected */
-               printk("Not detected a SMSC FDC37C93xAPM SuperIO device (devid=0x%02x, rev=0x%02x)\n",
-                       devid, devrev);
-                       /* inform the keyboard driver that we have no keyboard controller */
-               microdev_kbd_controller_present = 0;
-                       /* little point in doing anything else in this functon */
-               return 0;
-       }
-
-               /* Select the keyboard device */
-       SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_KEYBOARD, SMSC_PRIMARY_INT_INDEX);
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_MOUSE, SMSC_SECONDARY_INT_INDEX);
-
-               /* Select the Serial #1 device */
-       SMSC_WRITE_INDEXED(SMSC_SERIAL1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL1, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the Serial #2 device */
-       SMSC_WRITE_INDEXED(SMSC_SERIAL2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL2, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the IDE#1 device */
-       SMSC_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(MSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x0c, SMSC_HDCS0_INDEX);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS1_INDEX);
-               /* select the interrupt */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE1, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the IDE#2 device */
-       SMSC_WRITE_INDEXED(SMSC_IDE2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(MSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
-               /* select the interrupt */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE2, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the configuration registers */
-       SMSC_WRITE_INDEXED(SMSC_CONFIG_REGISTERS, SMCS_LOGICAL_DEV_INDEX);
-               /* enable the appropriate GPIO pins for IDE functionality:
-                * bit[0]   In/Out              1==input;  0==output
-                * bit[1]   Polarity            1==invert; 0==no invert
-                * bit[2]   Int Enb #1          1==Enable Combined IRQ #1; 0==disable
-                * bit[3:4] Function Select     00==original; 01==Alternate Function #1
-                */
-       SMSC_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
-       SMSC_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
-       SMSC_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
-       SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
-       SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
-
-               /* Exit the configuration state */
-       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       return 0;
-}
-
-static void __init microdev_setup(char **cmdline_p)
-{
-       int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
-       const int fpgaRevision = *fpgaRevisionRegister;
-       int * const CacheControlRegister = (int*)CCR;
-
-       device_initcall(microdev_devices_setup);
-       device_initcall(smsc_superio_setup);
-
-       printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
-               get_system_type(), fpgaRevision, *CacheControlRegister);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh4202_microdev __initmv = {
-       .mv_name                = "SH4-202 MicroDev",
-       .mv_setup               = microdev_setup,
-       .mv_nr_irqs             = 72,           /* QQQ need to check this - use the MACRO */
-
-       .mv_inb                 = microdev_inb,
-       .mv_inw                 = microdev_inw,
-       .mv_inl                 = microdev_inl,
-       .mv_outb                = microdev_outb,
-       .mv_outw                = microdev_outw,
-       .mv_outl                = microdev_outl,
-
-       .mv_inb_p               = microdev_inb_p,
-       .mv_inw_p               = microdev_inw_p,
-       .mv_inl_p               = microdev_inl_p,
-       .mv_outb_p              = microdev_outb_p,
-       .mv_outw_p              = microdev_outw_p,
-       .mv_outl_p              = microdev_outl_p,
-
-       .mv_insb                = microdev_insb,
-       .mv_insw                = microdev_insw,
-       .mv_insl                = microdev_insl,
-       .mv_outsb               = microdev_outsb,
-       .mv_outsw               = microdev_outsw,
-       .mv_outsl               = microdev_outsl,
-
-       .mv_init_irq            = init_microdev_irq,
-
-#ifdef CONFIG_HEARTBEAT
-       .mv_heartbeat           = microdev_heartbeat,
-#endif
-};
diff --git a/arch/sh/boards/titan/Makefile b/arch/sh/boards/titan/Makefile
deleted file mode 100644 (file)
index 08d7537..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Nimble Microsystems TITAN specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
diff --git a/arch/sh/boards/titan/io.c b/arch/sh/boards/titan/io.c
deleted file mode 100644 (file)
index 4730c1d..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *     I/O routines for Titan
- */
-#include <linux/pci.h>
-#include <asm/machvec.h>
-#include <asm/addrspace.h>
-#include <asm/titan.h>
-#include <asm/io.h>
-
-static inline unsigned int port2adr(unsigned int port)
-{
-        maybebadio((unsigned long)port);
-        return port;
-}
-
-u8 titan_inb(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inb(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inb(pci_ioaddr(port));
-        return ctrl_inw(port2adr(port)) & 0xff;
-}
-
-u8 titan_inb_p(unsigned long port)
-{
-        u8 v;
-
-        if (PXSEG(port))
-                v = ctrl_inb(port);
-        else if (is_pci_ioaddr(port))
-                v = ctrl_inb(pci_ioaddr(port));
-        else
-                v = ctrl_inw(port2adr(port)) & 0xff;
-        ctrl_delay();
-        return v;
-}
-
-u16 titan_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inw(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inw(pci_ioaddr(port));
-        else if (port >= 0x2000)
-                return ctrl_inw(port2adr(port));
-        else
-                maybebadio(port);
-        return 0;
-}
-
-u32 titan_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inl(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inl(pci_ioaddr(port));
-        else if (port >= 0x2000)
-                return ctrl_inw(port2adr(port));
-        else
-                maybebadio(port);
-        return 0;
-}
-
-void titan_outb(u8 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outb(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outb(value, pci_ioaddr(port));
-        else
-                ctrl_outw(value, port2adr(port));
-}
-
-void titan_outb_p(u8 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outb(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outb(value, pci_ioaddr(port));
-        else
-                ctrl_outw(value, port2adr(port));
-        ctrl_delay();
-}
-
-void titan_outw(u16 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outw(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outw(value, pci_ioaddr(port));
-        else if (port >= 0x2000)
-                ctrl_outw(value, port2adr(port));
-        else
-                maybebadio(port);
-}
-
-void titan_outl(u32 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outl(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outl(value, pci_ioaddr(port));
-        else
-                maybebadio(port);
-}
-
-void titan_insl(unsigned long port, void *dst, unsigned long count)
-{
-        maybebadio(port);
-}
-
-void titan_outsl(unsigned long port, const void *src, unsigned long count)
-{
-        maybebadio(port);
-}
-
-void __iomem *titan_ioport_map(unsigned long port, unsigned int size)
-{
-       if (PXSEG(port) || is_pci_memaddr(port))
-               return (void __iomem *)port;
-       else if (is_pci_ioaddr(port))
-               return (void __iomem *)pci_ioaddr(port);
-
-       return (void __iomem *)port2adr(port);
-}
diff --git a/arch/sh/boards/titan/setup.c b/arch/sh/boards/titan/setup.c
deleted file mode 100644 (file)
index 5de3b2a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * arch/sh/boards/titan/setup.c - Setup for Titan
- *
- *  Copyright (C) 2006  Jamie Lenehan
- *
- * 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.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/titan.h>
-#include <asm/io.h>
-
-static void __init init_titan_irq(void)
-{
-       /* enable individual interrupt mode for externals */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static struct sh_machine_vector mv_titan __initmv = {
-       .mv_name =      "Titan",
-
-       .mv_inb =       titan_inb,
-       .mv_inw =       titan_inw,
-       .mv_inl =       titan_inl,
-       .mv_outb =      titan_outb,
-       .mv_outw =      titan_outw,
-       .mv_outl =      titan_outl,
-
-       .mv_inb_p =     titan_inb_p,
-       .mv_inw_p =     titan_inw,
-       .mv_inl_p =     titan_inl,
-       .mv_outb_p =    titan_outb_p,
-       .mv_outw_p =    titan_outw,
-       .mv_outl_p =    titan_outl,
-
-       .mv_insl =      titan_insl,
-       .mv_outsl =     titan_outsl,
-
-       .mv_ioport_map = titan_ioport_map,
-
-       .mv_init_irq =  init_titan_irq,
-};
index 8b37869a822759efd58dbddfd007590aa873db76..5b54965eef9819779613856a572311c928b386cd 100644 (file)
@@ -18,9 +18,10 @@ CONFIG_PAGE_OFFSET   ?= 0x80000000
 CONFIG_MEMORY_START    ?= 0x0c000000
 CONFIG_BOOT_LINK_OFFSET        ?= 0x00800000
 CONFIG_ZERO_PAGE_OFFSET        ?= 0x00001000
+CONFIG_ENTRY_OFFSET    ?= 0x00001000
 
 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
-       CONFIG_ZERO_PAGE_OFFSET
+       CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET
 
 targets := zImage vmlinux.srec uImage uImage.srec
 subdir- := compressed
index f72c1989f5f2f5934e7940490560a2eeac04bb0a..622eac3cf556c10f9496fb11c4d85f6609218e3b 100644 (file)
@@ -14,8 +14,8 @@
  *   Copyright (C) 2002 Stuart Menefy (stuart.menefy@st.com)
  */
 #include <asm/cache.h>
-#include <asm/cpu/mmu_context.h>
-#include <asm/cpu/registers.h>
+#include <cpu/mmu_context.h>
+#include <cpu/registers.h>
 
 /*
  * Fixed TLB entries to identity map the beginning of RAM
index 5471df53753c3ac7978bb4dd601683212bc268f4..29926a9b9ce2248a3f8cb03feee5d38ea75a86c0 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc4
-# Wed Jun  4 17:30:00 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:18:59 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -79,9 +80,14 @@ CONFIG_SLAB=y
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
 # CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -99,6 +105,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -175,6 +182,7 @@ CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -376,6 +384,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=y
@@ -466,6 +476,7 @@ 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_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
@@ -512,10 +523,10 @@ CONFIG_SCSI_WAIT_SCAN=m
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH 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
@@ -587,6 +598,7 @@ CONFIG_INPUT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
@@ -620,6 +632,7 @@ CONFIG_HW_RANDOM=y
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 # CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -631,6 +644,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 
@@ -667,10 +681,6 @@ CONFIG_SSB_POSSIBLE=y
 # Console display driver support
 #
 CONFIG_DUMMY_CONSOLE=y
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
@@ -679,6 +689,7 @@ CONFIG_DUMMY_CONSOLE=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_ACCESSIBILITY is not set
 # CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -752,6 +763,7 @@ CONFIG_TMPFS=y
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -762,17 +774,16 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 # CONFIG_NFSD_V4 is not set
-CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -842,6 +853,7 @@ CONFIG_FRAME_WARN=1024
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
@@ -898,6 +910,10 @@ CONFIG_CRYPTO_CBC=y
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
@@ -937,6 +953,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 57728788b7531ad83b0d1193da4113ee4daa17fe..d4075283956d37a19e67d4bbf56613d449f6522b 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc7
-# Fri Sep 21 15:46:27 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:34:24 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -19,6 +21,7 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -37,12 +40,15 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 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 is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -55,21 +61,38 @@ 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_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+# CONFIG_OPROFILE is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
@@ -80,6 +103,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -93,13 +117,17 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
 CONFIG_CPU_SH4=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -108,6 +136,7 @@ CONFIG_CPU_SH4=y
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
 # CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 CONFIG_CPU_SUBTYPE_SH7091=y
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -116,14 +145,17 @@ CONFIG_CPU_SUBTYPE_SH7091=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
@@ -133,6 +165,7 @@ CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_MEMORY_SIZE=0x01000000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -142,12 +175,15 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_HUGETLB_PAGE_SIZE_64K=y
 # CONFIG_HUGETLB_PAGE_SIZE_256K is not set
 # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
 # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
 # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_512MB is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -155,6 +191,8 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+# 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=0
@@ -194,6 +232,7 @@ CONFIG_SH_PCLK_FREQ=49876504
 # CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -204,7 +243,10 @@ CONFIG_CPU_FREQ_TABLE=y
 CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
@@ -239,12 +281,15 @@ 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_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -263,10 +308,7 @@ CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+CONFIG_PCI_LEGACY=y
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -291,6 +333,7 @@ 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
@@ -309,6 +352,7 @@ CONFIG_IP_FIB_HASH=y
 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
@@ -316,8 +360,6 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -334,10 +376,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -345,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # 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
@@ -366,6 +405,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_STANDALONE is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
@@ -374,6 +414,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_MTD is not set
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
+CONFIG_GDROM=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
@@ -384,11 +425,15 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -400,44 +445,49 @@ CONFIG_MISC_DEVICES=y
 # CONFIG_SCSI_NETLINK is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
+# CONFIG_FUSION is not set
 
 #
-# Fusion MPT device support
+# IEEE 1394 (FireWire) support
 #
-# CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support
+# Enable only one of the two stacks, unless you know what you are doing
 #
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 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_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -449,6 +499,7 @@ CONFIG_8139TOO=y
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -464,12 +515,12 @@ CONFIG_8139TOO=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -491,7 +542,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -505,6 +555,8 @@ CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_MAPLE is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_SERIAL is not set
@@ -530,10 +582,13 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -553,6 +608,19 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
 
@@ -568,45 +636,40 @@ CONFIG_SH_WDT=y
 #
 # CONFIG_PCIPCWATCHDOG is not set
 # CONFIG_WDTPCI is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-CONFIG_DEVPORT=y
-# CONFIG_I2C is not set
 
 #
-# SPI support
+# Sonics Silicon Backplane
 #
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-# CONFIG_HWMON is not set
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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_DAB is not set
+# CONFIG_VIDEO_MEDIA is not set
 
 #
-# Graphics support
+# Multimedia drivers
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_DAB is not set
 
 #
-# Display device support
+# Graphics support
 #
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
@@ -615,11 +678,12 @@ CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -653,7 +717,15 @@ CONFIG_FB_PVR2=y
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+# CONFIG_FB_SH_MOBILE_LCDC is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -680,49 +752,30 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_SUPERH_MONO is not set
 # CONFIG_LOGO_SUPERH_VGA16 is not set
 CONFIG_LOGO_SUPERH_CLUT224=y
-
-#
-# 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=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -735,14 +788,11 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # 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_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_DNOTIFY 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
@@ -771,7 +821,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -786,14 +835,14 @@ CONFIG_RAMFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_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
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
@@ -807,35 +856,25 @@ CONFIG_RAMFS=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-CONFIG_PROFILING=y
-# CONFIG_OPROFILE is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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 is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 # CONFIG_SH_KGDB is not set
@@ -845,14 +884,95 @@ CONFIG_ENABLE_MUST_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-# CONFIG_CRYPTO is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 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 is not set
+# 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
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 756d38dc2f717655ee3458e7a00ada63ba231c7a..41e25b3a5b012ef39745bec8e75ad89a7015b025 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc4
-# Tue Sep 11 19:42:44 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:24:57 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -20,6 +22,7 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -34,12 +37,15 @@ CONFIG_SWAP=y
 # CONFIG_SYSVIPC is not set
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
-# CONFIG_USER_NS 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 is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -52,6 +58,7 @@ 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
@@ -64,6 +71,19 @@ 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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
@@ -73,6 +93,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -86,13 +107,17 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
 CONFIG_CPU_SH3=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -101,6 +126,7 @@ CONFIG_CPU_SUBTYPE_SH7709=y
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
 # CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -109,14 +135,17 @@ CONFIG_CPU_SUBTYPE_SH7709=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
@@ -126,6 +155,7 @@ CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0d000000
 CONFIG_MEMORY_SIZE=0x00400000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -135,7 +165,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -143,6 +175,8 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+# 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=0
@@ -181,6 +215,7 @@ CONFIG_SH_PCLK_FREQ=22110000
 # CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -219,11 +254,14 @@ 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_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -237,10 +275,6 @@ CONFIG_BOOT_LINK_OFFSET=0x00800000
 #
 CONFIG_ISA=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 CONFIG_PCCARD=y
 # CONFIG_PCMCIA_DEBUG is not set
 CONFIG_PCMCIA=y
@@ -263,11 +297,12 @@ CONFIG_BINFMT_ELF=y
 #
 # Power management options (EXPERIMENTAL)
 #
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_PM=y
-CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_PM_SLEEP=y
 CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
 CONFIG_APM_EMULATION=y
 
 #
@@ -282,9 +317,12 @@ CONFIG_APM_EMULATION=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_STANDALONE is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_MTD is not set
 # CONFIG_PARPORT is not set
@@ -294,8 +332,11 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_BLK_DEV_HD 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
 
 #
@@ -332,6 +373,7 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
@@ -342,14 +384,17 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
 # CONFIG_SCSI_NCR53C406A is not set
 # CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_MV is not set
 # CONFIG_PATA_LEGACY is not set
 # CONFIG_PATA_PCMCIA is not set
 # CONFIG_PATA_QDI is not set
@@ -370,11 +415,9 @@ CONFIG_INPUT_POLLDEV=y
 #
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_TSDEV=y
-CONFIG_INPUT_TSDEV_SCREEN_X=240
-CONFIG_INPUT_TSDEV_SCREEN_Y=320
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT_APMPOWER is not set
 
 #
 # Input Device Drivers
@@ -387,6 +430,7 @@ CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
 CONFIG_KEYBOARD_HP6XX=y
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
@@ -395,12 +439,15 @@ CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_GUNZE is not set
 # CONFIG_TOUCHSCREEN_ELO is not set
 # CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
 # CONFIG_TOUCHSCREEN_MK712 is not set
 CONFIG_TOUCHSCREEN_HP600=y
+# CONFIG_TOUCHSCREEN_HTCPEN is not set
 # CONFIG_TOUCHSCREEN_PENMOUNT is not set
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
 # CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
 # CONFIG_INPUT_MISC is not set
 
 #
@@ -417,9 +464,11 @@ CONFIG_SERIO=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -439,7 +488,6 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=64
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -454,39 +502,45 @@ CONFIG_HW_RANDOM=y
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
-# CONFIG_DAB is not set
+# CONFIG_VIDEO_MEDIA is not set
 
 #
-# Graphics support
+# Multimedia drivers
 #
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_LCD_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_HP680=y
+# CONFIG_DAB is not set
 
 #
-# Display device support
+# Graphics support
 #
-# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -495,11 +549,12 @@ CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -511,7 +566,20 @@ CONFIG_FB_DEFERRED_IO=y
 #
 # CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_HIT=y
+CONFIG_FB_SH_MOBILE_LCDC=y
 # CONFIG_FB_VIRTUAL is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_PLATFORM is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+CONFIG_BACKLIGHT_HP680=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -533,15 +601,13 @@ CONFIG_FONT_PEARL_8x8=y
 # CONFIG_FONT_SUN12x22 is not set
 # CONFIG_FONT_10x18 is not set
 # CONFIG_LOGO is not set
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_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
@@ -564,9 +630,10 @@ CONFIG_RTC_INTF_DEV=y
 #
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_STK17TA8 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
@@ -575,23 +642,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -606,13 +657,10 @@ CONFIG_EXT2_FS=y
 # 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_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -643,7 +691,6 @@ CONFIG_SYSFS=y
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -658,8 +705,11 @@ CONFIG_RAMFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_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
 
@@ -668,10 +718,6 @@ CONFIG_RAMFS=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
@@ -713,23 +759,22 @@ CONFIG_NLS_CODEPAGE_850=y
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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 is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 # CONFIG_SH_KGDB is not set
@@ -739,50 +784,95 @@ CONFIG_ENABLE_MUST_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 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
+
+#
+# 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=y
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=y
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL 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_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=y
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-# CONFIG_CRYPTO_DES is not set
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_LZO is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 38f934ab50c76b7f12308255e25b8ab027378c62..99cc39c5c6ca7495bc06fc394b7a62048468dfce 100644 (file)
@@ -1,44 +1,53 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19
-# Thu Dec  7 17:13:04 2006
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:35:07 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-# CONFIG_GENERIC_TIME is not set
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_SYS_SUPPORTS_PCI=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+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_INITRAMFS_SOURCE=""
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
@@ -50,34 +59,48 @@ 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_SHMEM=y
-CONFIG_SLAB=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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 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
-
-#
-# Block layer
-#
 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -91,67 +114,26 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
-# CONFIG_SH_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SOLUTION_ENGINE is not set
-# CONFIG_SH_7300_SOLUTION_ENGINE is not set
-# CONFIG_SH_7343_SOLUTION_ENGINE is not set
-# CONFIG_SH_73180_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SYSTEMH is not set
-# CONFIG_SH_HP6XX is not set
-# CONFIG_SH_EC3104 is not set
-# CONFIG_SH_SATURN is not set
-# CONFIG_SH_DREAMCAST is not set
-# CONFIG_SH_BIGSUR is not set
-# CONFIG_SH_MPC1211 is not set
-# CONFIG_SH_SH03 is not set
-# CONFIG_SH_SECUREEDGE5410 is not set
-# CONFIG_SH_HS7751RVOIP is not set
-# CONFIG_SH_7710VOIPGW is not set
-# CONFIG_SH_RTS7751R2D is not set
-# CONFIG_SH_R7780RP is not set
-# CONFIG_SH_EDOSK7705 is not set
-# CONFIG_SH_SH4202_MICRODEV is not set
-CONFIG_SH_LANDISK=y
-# CONFIG_SH_TITAN is not set
-# CONFIG_SH_SHMIN is not set
-# CONFIG_SH_7206_SOLUTION_ENGINE is not set
-# CONFIG_SH_7619_SOLUTION_ENGINE is not set
-# CONFIG_SH_UNKNOWN is not set
-
-#
-# Processor selection
-#
 CONFIG_CPU_SH4=y
-
-#
-# SH-2 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7604 is not set
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
-
-#
-# SH-2A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-
-#
-# SH-3 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
-
-#
-# SH-4 Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -160,53 +142,60 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-
-#
-# ST40 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
-
-#
-# SH-4A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
-
-#
-# SH4AL-DSP Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
+# CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
 #
+CONFIG_QUICKLIST=y
 CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_MEMORY_SIZE=0x04000000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 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_STATIC=y
+# 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=0
+CONFIG_NR_QUICK=2
 
 #
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -214,19 +203,32 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_CPU_LITTLE_ENDIAN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 # CONFIG_SH_STORE_QUEUES is not set
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
 CONFIG_CPU_HAS_PTEA=y
+CONFIG_CPU_HAS_FPU=y
 
 #
-# Timer support
+# Board support
+#
+# CONFIG_SH_7751_SYSTEMH is not set
+# CONFIG_SH_SECUREEDGE5410 is not set
+# CONFIG_SH_RTS7751R2D is not set
+CONFIG_SH_LANDISK=y
+# CONFIG_SH_TITAN is not set
+# CONFIG_SH_LBOX_RE2 is not set
+
+#
+# Timer and clock configuration
 #
 CONFIG_SH_TMU=y
 CONFIG_SH_TIMER_IRQ=16
 CONFIG_SH_PCLK_FREQ=33333333
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -241,12 +243,11 @@ CONFIG_SH_PCLK_FREQ=33333333
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
-CONFIG_HEARTBEAT=y
 
 #
 # Additional SuperH Device Drivers
 #
+CONFIG_HEARTBEAT=y
 # CONFIG_PUSH_SWITCH is not set
 
 #
@@ -254,13 +255,17 @@ CONFIG_HEARTBEAT=y
 #
 # 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_KEXEC=y
-# CONFIG_SMP is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -273,16 +278,12 @@ CONFIG_BOOT_LINK_OFFSET=0x00800000
 #
 # Bus options
 #
-CONFIG_ISA=y
 CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
-# CONFIG_PCI_MULTITHREAD_PROBE is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 CONFIG_PCCARD=y
 # CONFIG_PCMCIA_DEBUG is not set
 CONFIG_PCMCIA=y
@@ -301,28 +302,15 @@ CONFIG_YENTA_ENE_TUNE=y
 CONFIG_YENTA_TOSHIBA=y
 # CONFIG_PD6729 is not set
 # CONFIG_I82092 is not set
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-CONFIG_PCMCIA_PROBE=y
 CONFIG_PCCARD_NONSTATIC=y
-
-#
-# PCI Hotplug Support
-#
 # CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
-#
-# Power management options (EXPERIMENTAL)
-#
-# CONFIG_PM is not set
-
 #
 # Networking
 #
@@ -331,13 +319,14 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 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
@@ -364,49 +353,36 @@ CONFIG_IP_PNP=y
 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
-
-#
-# IP: Virtual Server Configuration
-#
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 
 #
 # Core Netfilter Configuration
 #
-# CONFIG_NETFILTER_NETLINK is not set
-# CONFIG_NF_CONNTRACK_ENABLED is not set
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
 # CONFIG_NETFILTER_XTABLES is not set
 
 #
 # IP: Netfilter Configuration
 #
 CONFIG_IP_NF_QUEUE=m
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -421,10 +397,6 @@ CONFIG_ATALK=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -432,9 +404,20 @@ CONFIG_ATALK=m
 #
 # 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
@@ -443,35 +426,17 @@ CONFIG_ATALK=m
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNP is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
@@ -484,63 +449,66 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
 CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
+CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
 # CONFIG_BLK_DEV_IDECS is not set
+# CONFIG_BLK_DEV_DELKIN is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 CONFIG_BLK_DEV_IDESCSI=y
 # CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
 
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+CONFIG_BLK_DEV_IDEDMA_SFF=y
+
+#
+# PCI IDE chipsets support
+#
 CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_IDEPCI_PCIBUS_ORDER=y
 CONFIG_BLK_DEV_OFFBOARD=y
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_PCI_AUTO=y
-CONFIG_IDEDMA_ONLYDISK=y
 CONFIG_BLK_DEV_AEC62XX=y
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT8213 is not set
 # CONFIG_BLK_DEV_IT821X is not set
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -550,18 +518,15 @@ CONFIG_BLK_DEV_AEC62XX=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
-# CONFIG_IDE_ARM is not set
-# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_TC86C001 is not set
 CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
-CONFIG_IDEDMA_AUTO=y
-# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -583,6 +548,7 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -590,77 +556,43 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
-# CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_DTC3280 is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_QLA_ISCSI is not set
 # CONFIG_SCSI_LPFC is not set
-# CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
-
-#
-# PCMCIA SCSI adapter support
-#
-# CONFIG_PCMCIA_AHA152X is not set
-# CONFIG_PCMCIA_FDOMAIN is not set
-# CONFIG_PCMCIA_NINJA_SCSI is not set
-# CONFIG_PCMCIA_QLOGIC is not set
-# CONFIG_PCMCIA_SYM53C500 is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=m
 CONFIG_MD_LINEAR=m
@@ -671,76 +603,49 @@ CONFIG_MD_RAID1=m
 # CONFIG_MD_MULTIPATH is not set
 # CONFIG_MD_FAULTY is not set
 # CONFIG_BLK_DEV_DM is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
-# CONFIG_IEEE1394 is not set
 
 #
-# I2O device support
+# Enable only one of the two stacks, unless you know what you are doing
 #
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
-
-#
-# ARCnet devices
-#
+# CONFIG_VETH is not set
 # CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_SMC91X is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-
-#
-# Tulip family network device support
-#
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
-# CONFIG_NET_ISA 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_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
-# CONFIG_AC3200 is not set
-# CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_CS89x0 is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -748,18 +653,20 @@ CONFIG_NET_PCI=y
 # CONFIG_NE2K_PCI is not set
 CONFIG_8139CP=y
 # CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
-
-#
-# Ethernet (1000 Mbit)
-#
+# CONFIG_SC92031 is not set
+CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -767,58 +674,53 @@ CONFIG_8139CP=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
-
-#
-# Ethernet (10000 Mbit)
-#
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
-
-#
-# Token Ring devices
-#
+# CONFIG_NIU is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Wireless LAN
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
-# PCMCIA network device support
+# USB Network Adapters
 #
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+# CONFIG_USB_USBNET is not set
 # CONFIG_NET_PCMCIA is not set
-
-#
-# Wan interfaces
-#
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -826,6 +728,7 @@ CONFIG_8139CP=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -835,7 +738,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -845,6 +747,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # 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
 
@@ -858,10 +761,13 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -880,22 +786,10 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 
 #
 # PCMCIA character devices
@@ -903,65 +797,77 @@ CONFIG_HW_RANDOM=y
 # CONFIG_SYNCLINK_CS is not set
 # CONFIG_CARDMAN_4000 is not set
 # CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
+CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_I5K_AMB is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 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 is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
-CONFIG_VIDEO_DEV=m
-CONFIG_VIDEO_V4L1=y
-CONFIG_VIDEO_V4L1_COMPAT=y
-CONFIG_VIDEO_V4L2=y
 
 #
-# Video Capture Adapters
+# Multimedia core support
 #
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=m
 
 #
-# Video Capture Adapters
+# Multimedia drivers
 #
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
 # CONFIG_VIDEO_ADV_DEBUG is not set
 CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 # CONFIG_VIDEO_VIVI is not set
-# CONFIG_VIDEO_PMS is not set
 # CONFIG_VIDEO_CPIA is not set
 # CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_STRADIS is not set
-
-#
-# V4L USB devices
-#
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_USB_VIDEO_CLASS is not set
+# CONFIG_USB_GSPCA is not set
 CONFIG_VIDEO_USBVIDEO=m
 CONFIG_USB_VICAM=m
 CONFIG_USB_IBMCAM=m
@@ -975,106 +881,100 @@ CONFIG_USB_STV680=m
 # CONFIG_USB_ZC0301 is not set
 CONFIG_USB_PWC=m
 # CONFIG_USB_PWC_DEBUG is not set
-
-#
-# Radio Adapters
-#
-# CONFIG_RADIO_CADET is not set
-# CONFIG_RADIO_RTRACK is not set
-# CONFIG_RADIO_RTRACK2 is not set
-# CONFIG_RADIO_AZTECH is not set
-# CONFIG_RADIO_GEMTEK is not set
+# CONFIG_USB_ZR364XX is not set
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+# CONFIG_SOC_CAMERA is not set
+# CONFIG_VIDEO_SH_MOBILE_CEU is not set
+CONFIG_RADIO_ADAPTERS=y
 # CONFIG_RADIO_GEMTEK_PCI is not set
 # CONFIG_RADIO_MAXIRADIO is not set
 # CONFIG_RADIO_MAESTRO is not set
-# CONFIG_RADIO_SF16FMI is not set
-# CONFIG_RADIO_SF16FMR2 is not set
-# CONFIG_RADIO_TERRATEC is not set
-# CONFIG_RADIO_TRUST is not set
-# CONFIG_RADIO_TYPHOON is not set
-# CONFIG_RADIO_ZOLTRIX is not set
 CONFIG_USB_DSBR=m
+# CONFIG_USB_SI470X is not set
+# CONFIG_DAB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Graphics support
 #
-# CONFIG_DVB is not set
-CONFIG_USB_DABUSB=m
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Graphics support
+# Display device support
 #
-CONFIG_FIRMWARE_EDID=y
-# CONFIG_FB is not set
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
 #
-# CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FONT_8x16=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=m
-
-#
-# Advanced Linux Sound Architecture
-#
 # CONFIG_SND is not set
+CONFIG_SOUND_PRIME=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
-# Open Sound System
+# USB Input Devices
 #
-CONFIG_SOUND_PRIME=m
-# CONFIG_OSS_OBSOLETE_DRIVER is not set
-# CONFIG_SOUND_BT878 is not set
-# CONFIG_SOUND_ES1371 is not set
-# CONFIG_SOUND_ICH is not set
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_VIA82CXXX is not set
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
 
 #
-# USB support
+# USB HID Boot Protocol drivers
 #
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
 # CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_MULTITHREAD_PROBE is not set
 # CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=y
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_UHCI_HCD is not set
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
 #
 # CONFIG_USB_ACM is not set
 CONFIG_USB_PRINTER=m
+# CONFIG_USB_WDM is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1094,66 +994,28 @@ CONFIG_USB_STORAGE_SDDR09=y
 CONFIG_USB_STORAGE_SDDR55=y
 CONFIG_USB_STORAGE_JUMPSHOT=y
 # CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
-#
-# USB Input Devices
-#
-CONFIG_USB_HID=m
-CONFIG_USB_HIDINPUT=y
-# CONFIG_USB_HIDINPUT_POWERBOOK is not set
-# CONFIG_HID_FF is not set
-# CONFIG_USB_HIDDEV is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_TOUCHSCREEN is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_ATI_REMOTE2 is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
-
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-CONFIG_USB_PEGASUS=m
-CONFIG_USB_RTL8150=m
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 CONFIG_USB_SERIAL=m
+# CONFIG_USB_EZUSB is not set
 # CONFIG_USB_SERIAL_GENERIC is not set
 # CONFIG_USB_SERIAL_AIRCABLE is not set
-# CONFIG_USB_SERIAL_AIRPRIME is not set
 # CONFIG_USB_SERIAL_ARK3116 is not set
 # CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
 # CONFIG_USB_SERIAL_CP2101 is not set
@@ -1168,6 +1030,7 @@ CONFIG_USB_SERIAL_FTDI_SIO=m
 # CONFIG_USB_SERIAL_EDGEPORT_TI is not set
 # CONFIG_USB_SERIAL_GARMIN is not set
 # CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_IUU is not set
 # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
 # CONFIG_USB_SERIAL_KEYSPAN is not set
 # CONFIG_USB_SERIAL_KLSI is not set
@@ -1175,8 +1038,11 @@ CONFIG_USB_SERIAL_FTDI_SIO=m
 # CONFIG_USB_SERIAL_MCT_U232 is not set
 # CONFIG_USB_SERIAL_MOS7720 is not set
 # CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
 # CONFIG_USB_SERIAL_NAVMAN is not set
 CONFIG_USB_SERIAL_PL2303=m
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
 # CONFIG_USB_SERIAL_SAFE is not set
 # CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
@@ -1197,6 +1063,7 @@ CONFIG_USB_EMI26=m
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -1208,61 +1075,18 @@ CONFIG_USB_SISUSBVGA=m
 CONFIG_USB_SISUSBVGA_CON=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
 # CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -1276,7 +1100,6 @@ CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_SECURITY is not set
 # CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=y
 # CONFIG_REISERFS_CHECK is not set
@@ -1285,14 +1108,11 @@ CONFIG_REISERFS_FS=y
 # 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_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-CONFIG_ROMFS_FS=y
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -1328,7 +1148,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1343,26 +1162,24 @@ CONFIG_RAMFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
 # CONFIG_SYSV_FS is not set
 CONFIG_UFS_FS=m
 # CONFIG_UFS_FS_WRITE is not set
 # CONFIG_UFS_DEBUG is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 # CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -1376,17 +1193,12 @@ CONFIG_SMB_FS=m
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1427,46 +1239,128 @@ CONFIG_NLS_CODEPAGE_932=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
+# CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 # CONFIG_EARLY_PRINTK is not set
-# CONFIG_KGDB is not set
+# CONFIG_SH_KGDB is not set
 
 #
 # Security options
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 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 is not set
+# 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
 
 #
-# Cryptographic options
+# Compression
 #
-# CONFIG_CRYPTO is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index b68b6cdbb78f06d940024cf48a1885d51a258ad8..aecdfd33c695ae6b7ca38031e5e604e0fbe50d29 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc4
-# Sat Mar 24 22:04:27 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:39:41 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -11,37 +13,40 @@ CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-# CONFIG_GENERIC_TIME is not set
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_SYS_SUPPORTS_PCI=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+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 is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -54,34 +59,48 @@ 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_SHMEM=y
-CONFIG_SLAB=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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 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
-
-#
-# Block layer
-#
 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -95,66 +114,26 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
-# CONFIG_SH_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SOLUTION_ENGINE is not set
-# CONFIG_SH_7300_SOLUTION_ENGINE is not set
-# CONFIG_SH_7343_SOLUTION_ENGINE is not set
-# CONFIG_SH_73180_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SYSTEMH is not set
-# CONFIG_SH_HP6XX is not set
-# CONFIG_SH_SATURN is not set
-# CONFIG_SH_DREAMCAST is not set
-# CONFIG_SH_MPC1211 is not set
-# CONFIG_SH_SH03 is not set
-# CONFIG_SH_SECUREEDGE5410 is not set
-# CONFIG_SH_HS7751RVOIP is not set
-# CONFIG_SH_7710VOIPGW is not set
-# CONFIG_SH_RTS7751R2D is not set
-# CONFIG_SH_HIGHLANDER is not set
-# CONFIG_SH_EDOSK7705 is not set
-# CONFIG_SH_SH4202_MICRODEV is not set
-# CONFIG_SH_LANDISK is not set
-# CONFIG_SH_TITAN is not set
-# CONFIG_SH_SHMIN is not set
-# CONFIG_SH_7206_SOLUTION_ENGINE is not set
-# CONFIG_SH_7619_SOLUTION_ENGINE is not set
-CONFIG_SH_LBOX_RE2=y
-# CONFIG_SH_UNKNOWN is not set
-
-#
-# Processor selection
-#
 CONFIG_CPU_SH4=y
-
-#
-# SH-2 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7604 is not set
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
-
-#
-# SH-2A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-
-#
-# SH-3 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
-
-#
-# SH-4 Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -163,55 +142,60 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-
-#
-# ST40 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
-
-#
-# SH-4A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
-
-#
-# SH4AL-DSP Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
 #
+CONFIG_QUICKLIST=y
 CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_MEMORY_SIZE=0x04000000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 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_STATIC=y
+# 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=0
+CONFIG_NR_QUICK=2
 
 #
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -219,12 +203,21 @@ CONFIG_ZONE_DMA_FLAG=0
 CONFIG_CPU_LITTLE_ENDIAN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 # CONFIG_SH_STORE_QUEUES is not set
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
 CONFIG_CPU_HAS_PTEA=y
+CONFIG_CPU_HAS_FPU=y
+
+#
+# Board support
+#
+# CONFIG_SH_7751_SYSTEMH is not set
+# CONFIG_SH_SECUREEDGE5410 is not set
+# CONFIG_SH_RTS7751R2D is not set
+# CONFIG_SH_LANDISK is not set
+# CONFIG_SH_TITAN is not set
+CONFIG_SH_LBOX_RE2=y
 
 #
 # Timer and clock configuration
@@ -232,6 +225,10 @@ CONFIG_CPU_HAS_PTEA=y
 CONFIG_SH_TMU=y
 CONFIG_SH_TIMER_IRQ=16
 CONFIG_SH_PCLK_FREQ=40000000
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -246,7 +243,6 @@ CONFIG_SH_PCLK_FREQ=40000000
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
 
 #
 # Additional SuperH Device Drivers
@@ -262,11 +258,14 @@ 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_KEXEC=y
-# CONFIG_SMP is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -280,15 +279,12 @@ CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/sda1"
 #
 # Bus options
 #
-CONFIG_ISA=y
 CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 CONFIG_PCCARD=y
 CONFIG_PCMCIA_DEBUG=y
 CONFIG_PCMCIA=y
@@ -306,28 +302,15 @@ CONFIG_YENTA_O2=y
 # CONFIG_YENTA_TOSHIBA is not set
 # CONFIG_PD6729 is not set
 # CONFIG_I82092 is not set
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-CONFIG_PCMCIA_PROBE=y
 CONFIG_PCCARD_NONSTATIC=y
-
-#
-# PCI Hotplug Support
-#
 # CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
-#
-# Power management options (EXPERIMENTAL)
-#
-# CONFIG_PM is not set
-
 #
 # Networking
 #
@@ -336,7 +319,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -344,6 +326,7 @@ 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
@@ -370,29 +353,26 @@ CONFIG_IP_PNP=y
 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
-
-#
-# IP: Virtual Server Configuration
-#
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 
 #
 # Core Netfilter Configuration
 #
-# CONFIG_NETFILTER_NETLINK is not set
-# CONFIG_NF_CONNTRACK_ENABLED is not set
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
 # CONFIG_NETFILTER_XTABLES is not set
 
 #
@@ -401,20 +381,8 @@ CONFIG_NETFILTER=y
 # CONFIG_IP_NF_QUEUE is not set
 # CONFIG_IP_NF_IPTABLES is not set
 # CONFIG_IP_NF_ARPTABLES is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -427,10 +395,6 @@ CONFIG_NETFILTER=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -438,9 +402,20 @@ CONFIG_NETFILTER=y
 #
 # 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
@@ -449,36 +424,17 @@ CONFIG_NETFILTER=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNP is not set
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
@@ -490,19 +446,18 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -510,6 +465,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -531,6 +487,7 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -538,71 +495,49 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
-# CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_DTC3280 is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_QLA_ISCSI is not set
 # CONFIG_SCSI_LPFC is not set
-# CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
-
-#
-# PCMCIA SCSI adapter support
-#
-# CONFIG_PCMCIA_AHA152X is not set
-# CONFIG_PCMCIA_FDOMAIN is not set
-# CONFIG_PCMCIA_NINJA_SCSI is not set
-# CONFIG_PCMCIA_QLOGIC is not set
-# CONFIG_PCMCIA_SYM53C500 is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -612,7 +547,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -622,6 +556,7 @@ CONFIG_ATA=y
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
 # CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
 # CONFIG_PATA_CMD64X is not set
 # CONFIG_PATA_CS5520 is not set
 # CONFIG_PATA_CS5530 is not set
@@ -635,18 +570,18 @@ CONFIG_ATA=y
 # CONFIG_PATA_IT821X is not set
 # CONFIG_PATA_IT8213 is not set
 # CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_LEGACY is not set
 # CONFIG_PATA_TRIFLEX is not set
 # CONFIG_PATA_MARVELL is not set
 # CONFIG_PATA_MPIIX is not set
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
 # CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
 # CONFIG_PATA_OPTIDMA is not set
 # CONFIG_PATA_PCMCIA is not set
 # CONFIG_PATA_PDC_OLD is not set
-# CONFIG_PATA_QDI is not set
 # CONFIG_PATA_RADISYS is not set
 # CONFIG_PATA_RZ1000 is not set
 # CONFIG_PATA_SC1200 is not set
@@ -656,88 +591,52 @@ CONFIG_ATA=y
 # CONFIG_PATA_SIS is not set
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
-# CONFIG_PATA_WINBOND_VLB is not set
 CONFIG_PATA_PLATFORM=y
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
-# CONFIG_IEEE1394 is not set
 
 #
-# I2O device support
+# Enable only one of the two stacks, unless you know what you are doing
 #
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
 # 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
-
-#
-# ARCnet devices
-#
+# CONFIG_VETH is not set
 # CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_SMC91X is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-
-#
-# Tulip family network device support
-#
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
-# CONFIG_NET_ISA 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_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
-# CONFIG_AC3200 is not set
-# CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_CS89x0 is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -749,19 +648,20 @@ CONFIG_8139TOO_PIO=y
 CONFIG_8139TOO_TUNE_TWISTER=y
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_SC92031 is not set
-
-#
-# Ethernet (1000 Mbit)
-#
+CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -769,36 +669,33 @@ CONFIG_8139TOO_TUNE_TWISTER=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
-
-#
-# Ethernet (10000 Mbit)
-#
+# CONFIG_ATL1E is not set
+CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
-
-#
-# Token Ring devices
-#
+# CONFIG_NIU is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# PCMCIA network device support
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 CONFIG_NET_PCMCIA=y
 # CONFIG_PCMCIA_3C589 is not set
 # CONFIG_PCMCIA_3C574 is not set
@@ -808,29 +705,16 @@ CONFIG_PCMCIA_PCNET=y
 # CONFIG_PCMCIA_SMC91C92 is not set
 # CONFIG_PCMCIA_XIRC2PS is not set
 # CONFIG_PCMCIA_AXNET is not set
-
-#
-# Wan interfaces
-#
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -838,6 +722,7 @@ CONFIG_PCMCIA_PCNET=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -847,7 +732,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -857,6 +741,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # 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
 
@@ -870,10 +755,13 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -892,22 +780,10 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 
 #
 # PCMCIA character devices
@@ -915,125 +791,104 @@ CONFIG_HW_RANDOM=y
 # CONFIG_SYNCLINK_CS is not set
 # CONFIG_CARDMAN_4000 is not set
 # CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
+CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_I5K_AMB is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
 # CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 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 is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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
 
 #
-# Digital Video Broadcasting Devices
+# Multimedia drivers
 #
-# CONFIG_DVB is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Console display driver support
+# Display device support
 #
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
-# Sound
+# Console display driver support
 #
+CONFIG_DUMMY_CONSOLE=y
 # CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
-
-#
-# USB support
-#
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -1047,37 +902,29 @@ CONFIG_RTC_INTF_SYSFS=y
 CONFIG_RTC_INTF_PROC=y
 CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
-
-#
-# RTC drivers
-#
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_SH is not set
 # CONFIG_RTC_DRV_TEST is not set
-# CONFIG_RTC_DRV_V3020 is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
 
 #
-# DMA Devices
+# SPI RTC drivers
 #
 
 #
-# Auxiliary Display support
+# 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
 
 #
-# Virtualization
+# on-CPU RTC drivers
 #
+# CONFIG_RTC_DRV_SH is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -1091,20 +938,16 @@ CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_SECURITY is not set
 # CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG 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_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-CONFIG_ROMFS_FS=y
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -1136,7 +979,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1151,14 +993,14 @@ CONFIG_RAMFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
@@ -1166,17 +1008,12 @@ CONFIG_RAMFS=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1217,30 +1054,24 @@ CONFIG_NLS_CODEPAGE_437=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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 is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 # CONFIG_EARLY_PRINTK is not set
@@ -1251,20 +1082,100 @@ CONFIG_SH_STANDARD_BIOS=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 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 is not set
+# 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
 
 #
-# Cryptographic options
+# Compression
 #
-# CONFIG_CRYPTO is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index f8398a5f10eecaaa258cec4270b7d27d9cdaabeb..a3a80f3d27c0592d10a85f499ab88c5d2ebd55f3 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc2
-# Fri Aug 17 12:15:16 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:41:08 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -18,6 +20,7 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -35,12 +38,16 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 CONFIG_AUDIT=y
+# CONFIG_AUDITSYSCALL is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -48,6 +55,7 @@ CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_UID16=y
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -55,6 +63,7 @@ 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
@@ -67,10 +76,24 @@ 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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -81,6 +104,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -94,13 +118,17 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
 CONFIG_CPU_SH3=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -109,6 +137,7 @@ CONFIG_CPU_SH3=y
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
 CONFIG_CPU_SUBTYPE_SH7720=y
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -117,14 +146,17 @@ CONFIG_CPU_SUBTYPE_SH7720=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
@@ -134,6 +166,7 @@ CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0C000000
 CONFIG_MEMORY_SIZE=0x03F00000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -143,7 +176,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -151,6 +186,8 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+# 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=0
@@ -173,7 +210,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SH_DSP=y
 CONFIG_SH_ADC=y
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
 CONFIG_CPU_HAS_DSP=y
 
@@ -196,6 +232,7 @@ CONFIG_SH_PCLK_FREQ=24000000
 # CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -228,11 +265,14 @@ 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_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -245,10 +285,6 @@ CONFIG_BOOT_LINK_OFFSET=0x00800000
 # Bus options
 #
 # CONFIG_ARCH_SUPPORTS_MSI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 
 #
@@ -289,6 +325,7 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -296,8 +333,6 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -314,10 +349,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -325,6 +356,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # 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
@@ -346,9 +378,12 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
@@ -362,6 +397,7 @@ CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
 CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
 
 #
 # User Modules And Translation Layers
@@ -374,6 +410,7 @@ CONFIG_MTD_BLOCK=y
 # 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
@@ -408,7 +445,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_START=0x0000000
 CONFIG_MTD_PHYSMAP_LEN=0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=0
-# CONFIG_MTD_SOLUTIONENGINE is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -440,11 +476,14 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD 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
 
 #
@@ -457,18 +496,24 @@ CONFIG_MISC_DEVICES=y
 # 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_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_SMC91X is not set
 CONFIG_SMC911X=y
+# 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
 
@@ -477,10 +522,10 @@ CONFIG_SMC911X=y
 #
 # 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_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -502,7 +547,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
@@ -516,6 +560,7 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_SERIAL is not set
@@ -539,9 +584,11 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -569,60 +616,72 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM 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 is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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=y
 
 #
 # 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
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
 
 #
 # Console display driver support
 #
 CONFIG_DUMMY_CONSOLE=y
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_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 is not set
@@ -644,9 +703,10 @@ CONFIG_RTC_INTF_DEV=y
 #
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_STK17TA8 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
@@ -655,23 +715,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -684,18 +728,14 @@ CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
 # CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG 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_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # 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
@@ -724,7 +764,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -744,30 +783,29 @@ CONFIG_JFFS2_FS_DEBUG=0
 # 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_OMFS_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
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-CONFIG_SUNRPC_BIND34=y
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -781,10 +819,6 @@ CONFIG_SUNRPC_BIND34=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="cp437"
 CONFIG_NLS_CODEPAGE_437=y
@@ -825,23 +859,16 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
@@ -852,6 +879,7 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
@@ -866,11 +894,16 @@ CONFIG_DEBUG_KOBJECT=y
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
-# CONFIG_FORCED_INLINING is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 CONFIG_EARLY_SCIF_CONSOLE=y
 CONFIG_EARLY_SCIF_CONSOLE_PORT=0xa4430000
@@ -879,6 +912,7 @@ CONFIG_EARLY_PRINTK=y
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_4KSTACKS is not set
+# CONFIG_IRQSTACKS is not set
 CONFIG_SH_KGDB=y
 
 #
@@ -904,14 +938,17 @@ CONFIG_KGDB_DEFBITS_8=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index e89d951c3c16b6ad327eb4b72a6c0c1279a1c2c4..e4b900e72dcd95f19256ae0761e49714a9ba0397 100644 (file)
@@ -1,28 +1,35 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Tue Oct  3 11:27:01 2006
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:47:16 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
@@ -31,10 +38,16 @@ CONFIG_SWAP=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+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
@@ -47,29 +60,42 @@ 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_SHMEM=y
-CONFIG_SLAB=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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 # CONFIG_MODULES is not set
-
-#
-# Block layer
-#
 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -83,59 +109,26 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
-# CONFIG_SH_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SOLUTION_ENGINE is not set
-# CONFIG_SH_7300_SOLUTION_ENGINE is not set
-# CONFIG_SH_7343_SOLUTION_ENGINE is not set
-# CONFIG_SH_73180_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SYSTEMH is not set
-# CONFIG_SH_HP6XX is not set
-# CONFIG_SH_EC3104 is not set
-# CONFIG_SH_SATURN is not set
-# CONFIG_SH_DREAMCAST is not set
-# CONFIG_SH_BIGSUR is not set
-# CONFIG_SH_MPC1211 is not set
-# CONFIG_SH_SH03 is not set
-# CONFIG_SH_SECUREEDGE5410 is not set
-# CONFIG_SH_HS7751RVOIP is not set
-# CONFIG_SH_7710VOIPGW is not set
-# CONFIG_SH_RTS7751R2D is not set
-# CONFIG_SH_R7780RP is not set
-# CONFIG_SH_EDOSK7705 is not set
-CONFIG_SH_SH4202_MICRODEV=y
-# CONFIG_SH_LANDISK is not set
-# CONFIG_SH_TITAN is not set
-# CONFIG_SH_SHMIN is not set
-# CONFIG_SH_UNKNOWN is not set
-
-#
-# Processor selection
-#
 CONFIG_CPU_SH4=y
-
-#
-# SH-2 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7604 is not set
-
-#
-# SH-3 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
+# CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
-
-#
-# SH-4 Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -144,67 +137,94 @@ CONFIG_CPU_SH4=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 CONFIG_CPU_SUBTYPE_SH4_202=y
-
-#
-# ST40 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
-
-#
-# SH-4A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
-
-#
-# SH4AL-DSP Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SH7785 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
+# CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
 #
+CONFIG_QUICKLIST=y
 CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x08000000
 CONFIG_MEMORY_SIZE=0x04000000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_HUGETLB_PAGE_SIZE_64K=y
+# CONFIG_HUGETLB_PAGE_SIZE_256K is not set
 # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_512MB 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_STATIC=y
+# 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=0
+CONFIG_NR_QUICK=2
 
 #
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-CONFIG_SH_WRITETHROUGH=y
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 # CONFIG_SH_STORE_QUEUES is not set
 CONFIG_CPU_HAS_INTEVT=y
 CONFIG_CPU_HAS_SR_RB=y
+CONFIG_CPU_HAS_PTEA=y
+CONFIG_CPU_HAS_FPU=y
 
 #
-# Timer support
+# Board support
+#
+CONFIG_SH_SH4202_MICRODEV=y
+
+#
+# Timer and clock configuration
 #
 CONFIG_SH_TMU=y
+CONFIG_SH_TIMER_IRQ=16
 CONFIG_SH_PCLK_FREQ=66000000
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -214,6 +234,7 @@ CONFIG_SH_PCLK_FREQ=66000000
 #
 # DMA support
 #
+CONFIG_SH_DMA_API=y
 CONFIG_SH_DMA=y
 CONFIG_NR_ONCHIP_DMA_CHANNELS=4
 # CONFIG_NR_DMA_CHANNELS_BOOL is not set
@@ -221,22 +242,30 @@ CONFIG_NR_ONCHIP_DMA_CHANNELS=4
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
+
+#
+# Additional SuperH Device Drivers
+#
 CONFIG_HEARTBEAT=y
+# CONFIG_PUSH_SWITCH is not set
 
 #
 # Kernel features
 #
 # 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_KEXEC is not set
-# CONFIG_SMP is not set
+# CONFIG_CRASH_DUMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
@@ -251,29 +280,15 @@ CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/hda1"
 # Bus options
 #
 CONFIG_SUPERHYWAY=y
-# CONFIG_PCI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
-#
-# PCI Hotplug Support
-#
-
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
-#
-# Power management options (EXPERIMENTAL)
-#
-# CONFIG_PM is not set
-
 #
 # Networking
 #
@@ -282,12 +297,13 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 # CONFIG_PACKET is not set
 # CONFIG_UNIX is not set
 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
@@ -308,30 +324,19 @@ CONFIG_IP_PNP=y
 # 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_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -344,10 +349,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -355,9 +356,20 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # 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
@@ -366,159 +378,96 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # 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
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD 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_BLK_DEV_INITRD=y
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+# CONFIG_BLK_DEV_HD 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=y
 CONFIG_IDE_MAX_HWIFS=1
 CONFIG_BLK_DEV_IDE=y
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
 # CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
 
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
-# CONFIG_IDE_ARM is not set
+# CONFIG_BLK_DEV_PLATFORM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_HD 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
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
 # 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
-
-#
-# PHY device support
-#
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 CONFIG_SMC91X=y
+# CONFIG_SMC911X 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=y
+CONFIG_NETDEV_10000=y
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
+# 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_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -536,6 +485,7 @@ CONFIG_SMC91X=y
 # Character devices
 #
 # CONFIG_VT is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -554,143 +504,93 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
-
-#
-# I2C support
-#
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
 # CONFIG_SENSORS_VT1211 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 is not set
 
 #
-# Misc devices
+# Sonics Silicon Backplane
 #
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
 
 #
-# Digital Video Broadcasting Devices
+# Multimedia drivers
 #
-# CONFIG_DVB is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Sound
+# Display device support
 #
+# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB_ARCH_HAS_HCD is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 # CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -702,20 +602,18 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG 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_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -747,7 +645,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -762,21 +659,20 @@ CONFIG_RAMFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_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
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
@@ -789,17 +685,12 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
@@ -840,76 +731,127 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
+# CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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 is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_UNWIND_INFO is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
-# CONFIG_KGDB is not set
+# CONFIG_SH_KGDB is not set
 
 #
 # Security options
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
 
 #
-# Cryptographic options
+# Crypto core or helper
 #
-CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_MANAGER=y
-# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC 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=y
+# 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_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_DEFLATE is not set
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C 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
 
 #
-# Hardware crypto devices
+# 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 is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 287408b2ace6bf5e430bf0c66634bfa831a3d7c1..c4b3e1d8950d9bac9766e56e560231ab6ff11024 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc3
-# Thu May 22 14:30:07 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:44:41 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -77,9 +78,14 @@ CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
 # CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -90,12 +96,13 @@ CONFIG_MODULES=y
 # CONFIG_MODULE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -173,7 +180,9 @@ CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_FLATMEM_MANUAL is not set
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -216,6 +225,8 @@ CONFIG_CPU_HAS_DSP=y
 #
 # CONFIG_SH_7722_SOLUTION_ENGINE is not set
 CONFIG_SH_MIGOR=y
+CONFIG_SH_MIGOR_QVGA=y
+# CONFIG_SH_MIGOR_RTA_WVGA is not set
 
 #
 # Timer and clock configuration
@@ -362,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_CFG80211 is not set
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
@@ -378,6 +390,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=y
@@ -475,6 +489,7 @@ 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_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
@@ -521,10 +536,10 @@ CONFIG_SCSI_WAIT_SCAN=m
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH 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
@@ -537,6 +552,7 @@ CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 CONFIG_SMC91X=y
+# CONFIG_SMC911X 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
@@ -602,6 +618,7 @@ CONFIG_KEYBOARD_SH_KEYSC=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
@@ -636,21 +653,35 @@ CONFIG_I2C_BOARDINFO=y
 #
 # I2C Hardware Bus support
 #
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
 # CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_SH_MOBILE=y
 # CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_STUB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
 # CONFIG_I2C_PCA_PLATFORM is not set
-CONFIG_I2C_SH_MOBILE=y
+# CONFIG_I2C_STUB is not set
 
 #
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
+# CONFIG_AT24 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
@@ -663,6 +694,7 @@ CONFIG_I2C_SH_MOBILE=y
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 # CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -674,6 +706,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 
@@ -710,10 +743,6 @@ CONFIG_SSB_POSSIBLE=y
 # Console display driver support
 #
 CONFIG_DUMMY_CONSOLE=y
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
@@ -738,7 +767,7 @@ CONFIG_USB_GADGET_SELECTED=y
 # CONFIG_USB_GADGET_ATMEL_USBA is not set
 # CONFIG_USB_GADGET_FSL_USB2 is not set
 # CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_PXA25X is not set
 CONFIG_USB_GADGET_M66592=y
 CONFIG_USB_M66592=y
 CONFIG_SUPERH_BUILT_IN_M66592=y
@@ -757,6 +786,7 @@ CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_G_SERIAL=y
 # CONFIG_USB_MIDI_GADGET is not set
 # CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
@@ -790,6 +820,7 @@ CONFIG_RTC_DRV_RS5C372=y
 # 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
@@ -810,6 +841,7 @@ CONFIG_RTC_DRV_RS5C372=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -870,6 +902,7 @@ CONFIG_TMPFS=y
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -899,6 +932,7 @@ CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 CONFIG_EARLY_SCIF_CONSOLE=y
@@ -955,6 +989,10 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
@@ -994,6 +1032,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 1a072615ffd41a1c62c1dbc547d43cbfa61657b3..57a300797584baa5656c25bb90e41641a17b0f96 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc4
-# Thu Mar  6 15:39:59 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:51:13 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -84,13 +85,20 @@ CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=m
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
@@ -101,6 +109,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -115,7 +124,6 @@ CONFIG_IOSCHED_NOOP=y
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
 CONFIG_CLASSIC_RCU=y
-# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
@@ -126,6 +134,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
 # CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -143,6 +152,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
 # CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 CONFIG_CPU_SUBTYPE_SH7780=y
@@ -173,7 +183,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_HUGETLB_PAGE_SIZE_64K=y
 # CONFIG_HUGETLB_PAGE_SIZE_256K is not set
 # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
@@ -188,6 +200,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
 # 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=0
@@ -268,7 +281,7 @@ CONFIG_KEXEC=y
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_RCU_TRACE=y
+# CONFIG_PREEMPT_RCU is not set
 CONFIG_GUSA=y
 
 #
@@ -348,14 +361,13 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL 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_STP=m
 CONFIG_BRIDGE=m
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
@@ -384,6 +396,7 @@ CONFIG_LLC=m
 #
 # CONFIG_CFG80211 is not set
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
@@ -400,6 +413,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
@@ -420,12 +435,14 @@ 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_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 CONFIG_EEPROM_93CX6=y
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -499,9 +516,13 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -511,7 +532,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 CONFIG_SATA_SIL=y
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -556,17 +576,21 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
 # CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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
@@ -585,6 +609,7 @@ CONFIG_AX88796_93CX6=y
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -593,7 +618,6 @@ CONFIG_AX88796_93CX6=y
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=m
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
@@ -616,32 +640,28 @@ CONFIG_8139TOO_8129=y
 # CONFIG_TLAN is not set
 CONFIG_VIA_RHINE=m
 CONFIG_VIA_RHINE_MMIO=y
-# CONFIG_VIA_RHINE_NAPI is not set
 # CONFIG_SC92031 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 CONFIG_E1000=m
-# CONFIG_E1000_NAPI is not set
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
 # CONFIG_E1000E is not set
-# CONFIG_E1000E_ENABLED is not set
 # CONFIG_IP1000 is not set
 # CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 CONFIG_R8169=y
-# CONFIG_R8169_NAPI is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
@@ -654,6 +674,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -661,6 +682,7 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
@@ -701,6 +723,7 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
@@ -722,6 +745,7 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 # CONFIG_VT is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -750,12 +774,7 @@ CONFIG_HW_RANDOM=y
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
@@ -776,6 +795,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 CONFIG_THERMAL=y
+# CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -787,13 +807,24 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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=y
 
 #
@@ -809,24 +840,9 @@ CONFIG_DAB=y
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=m
-
-#
-# Advanced Linux Sound Architecture
-#
 # CONFIG_SND is not set
-
-#
-# Open Sound System
-#
 CONFIG_SOUND_PRIME=m
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
@@ -836,6 +852,8 @@ CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -844,6 +862,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
@@ -879,10 +898,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -903,7 +919,6 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
@@ -957,6 +972,7 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 CONFIG_MINIX_FS=y
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -967,20 +983,17 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
-CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=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 is not set
@@ -1043,6 +1056,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1050,9 +1064,12 @@ CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_DEBUG_SPINLOCK is not set
@@ -1066,6 +1083,8 @@ CONFIG_SCHED_DEBUG=y
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_FRAME_POINTER is not set
@@ -1091,51 +1110,84 @@ CONFIG_DEBUG_STACKOVERFLOW=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
-# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=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=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL 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_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_SEED 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
@@ -1144,8 +1196,10 @@ CONFIG_CRYPTO_HW=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 0dc1ce7b9349897fd38125016a224cdcd11626b3..1d09d24d429853890130f8c936d509e1b3e24e05 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc3
-# Fri Nov 23 14:03:57 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 00:59:19 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -21,6 +22,8 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_IO_TRAPPED=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -39,18 +42,16 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS 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_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
-# CONFIG_SYSFS_DEPRECATED 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 is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -64,20 +65,37 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 # CONFIG_FUTEX is not set
 CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
 CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
@@ -88,6 +106,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -101,6 +120,7 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
@@ -109,7 +129,10 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SH4A=y
 CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -118,6 +141,7 @@ CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
 # CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -126,12 +150,15 @@ CONFIG_CPU_SHX2=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 CONFIG_CPU_SUBTYPE_SH7785=y
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
 # CONFIG_CPU_SUBTYPE_SH5_101 is not set
 # CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
@@ -157,7 +184,9 @@ CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 # CONFIG_HUGETLB_PAGE_SIZE_64K is not set
 # CONFIG_HUGETLB_PAGE_SIZE_256K is not set
 CONFIG_HUGETLB_PAGE_SIZE_1MB=y
@@ -173,6 +202,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y
 CONFIG_SPARSEMEM_STATIC=y
 # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 # CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
@@ -202,6 +232,7 @@ CONFIG_CPU_HAS_FPU=y
 # Board support
 #
 CONFIG_SH_HIGHLANDER=y
+# CONFIG_SH_SH7785LCR is not set
 # CONFIG_SH_R7780RP is not set
 # CONFIG_SH_R7780MP is not set
 CONFIG_SH_R7785RP=y
@@ -245,12 +276,13 @@ 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_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
+# CONFIG_PREEMPT_RCU is not set
 CONFIG_GUSA=y
 
 #
@@ -295,6 +327,7 @@ 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
@@ -329,14 +362,13 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL 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_STP=m
 CONFIG_BRIDGE=m
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
@@ -355,6 +387,7 @@ CONFIG_LLC=m
 #
 # 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
@@ -364,6 +397,7 @@ CONFIG_LLC=m
 #
 # CONFIG_CFG80211 is not set
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
@@ -380,6 +414,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
@@ -397,14 +433,18 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 CONFIG_EEPROM_93CX6=y
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -464,6 +504,7 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -476,9 +517,13 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -488,7 +533,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 CONFIG_SATA_SIL=y
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -517,6 +561,7 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_MPIIX is not set
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
 # CONFIG_PATA_NS87410 is not set
 # CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
@@ -532,24 +577,27 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
 # CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -576,20 +624,21 @@ CONFIG_NETDEV_1000=y
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
 # CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 CONFIG_R8169=y
-# CONFIG_R8169_NAPI is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
@@ -601,6 +650,8 @@ CONFIG_NETDEV_10000=y
 # CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -608,13 +659,13 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -649,6 +700,7 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
@@ -670,7 +722,9 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 # CONFIG_VT is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -697,12 +751,7 @@ CONFIG_HW_RANDOM=y
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
@@ -722,6 +771,8 @@ CONFIG_HWMON=y
 # 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 is not set
 
 #
@@ -733,13 +784,24 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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
 
 #
@@ -751,15 +813,15 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
-# CONFIG_FB_CFB_FILLRECT is not set
-# CONFIG_FB_CFB_COPYAREA is not set
-# CONFIG_FB_CFB_IMAGEBLIT is not set
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
 # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -792,6 +854,8 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_SH_MOBILE_LCDC=m
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
@@ -800,24 +864,9 @@ CONFIG_FB_DEFERRED_IO=y
 #
 # CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_LOGO is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=m
-
-#
-# Advanced Linux Sound Architecture
-#
 # CONFIG_SND is not set
-
-#
-# Open Sound System
-#
 CONFIG_SOUND_PRIME=m
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
@@ -827,17 +876,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
@@ -861,9 +910,10 @@ CONFIG_RTC_INTF_DEV=y
 #
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_STK17TA8 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
@@ -872,10 +922,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -896,14 +943,11 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-CONFIG_MINIX_FS=y
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 CONFIG_FUSE_FS=m
@@ -951,8 +995,11 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_OMFS_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
@@ -960,20 +1007,17 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
-CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=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 is not set
@@ -1028,10 +1072,6 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 # CONFIG_DLM is not set
-CONFIG_INSTRUMENTATION=y
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
-# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
@@ -1040,6 +1080,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1050,6 +1091,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_PREEMPT is not set
 CONFIG_DEBUG_SPINLOCK=y
@@ -1066,12 +1108,14 @@ CONFIG_STACKTRACE=y
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
-CONFIG_FORCED_INLINING=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
@@ -1091,54 +1135,96 @@ CONFIG_4KSTACKS=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=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=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL 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_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index a0ebd439cbd20c535016840b823ab986bbc17548..840fe3843ffae31ce0360cdc06fbbf09816f4456 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc4
-# Tue Jun  3 13:02:42 2008
+# Linux kernel version: 2.6.26
+# Mon Jul 28 22:23:03 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
@@ -33,21 +33,22 @@ CONFIG_LOCALVERSION=""
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
-# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+# CONFIG_IKCONFIG_PROC is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_GROUP_SCHED=y
-CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_RT_GROUP_SCHED is not set
-CONFIG_USER_SCHED=y
-# CONFIG_CGROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
-# CONFIG_NAMESPACES is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -72,26 +73,36 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLAB=y
+# CONFIG_SLAB is not set
 # CONFIG_SLUB is not set
-# CONFIG_SLOB is not set
+CONFIG_SLOB=y
 CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
 # CONFIG_HAVE_DMA_ATTRS is not set
-CONFIG_SLABINFO=y
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_RT_MUTEXES=y
 CONFIG_TINY_SHMEM=y
 CONFIG_BASE_SMALL=0
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+# CONFIG_MODULE_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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -162,7 +173,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -196,6 +209,7 @@ CONFIG_CPU_HAS_FPU=y
 #
 # Board support
 #
+CONFIG_SH_RSK7203=y
 
 #
 # Timer and clock configuration
@@ -274,6 +288,7 @@ CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ignore_loglevel"
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_FDPIC=y
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_ZFLAT=y
 CONFIG_BINFMT_SHARED_FLAT=y
@@ -424,8 +439,8 @@ CONFIG_MTD_CFI_UTIL=y
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=0x20000000
-CONFIG_MTD_PHYSMAP_LEN=0x01000000
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=4
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -456,9 +471,11 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
@@ -475,7 +492,6 @@ CONFIG_HAVE_IDE=y
 # 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
@@ -487,15 +503,15 @@ CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
-CONFIG_SMC91X=y
+# CONFIG_SMC91X is not set
+CONFIG_SMC911X=y
 # 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=y
-# CONFIG_E1000E_ENABLED is not set
-CONFIG_NETDEV_10000=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
 
 #
 # Wireless LAN
@@ -503,6 +519,15 @@ CONFIG_NETDEV_10000=y
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
 # CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -587,6 +612,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 
@@ -605,6 +631,7 @@ CONFIG_SSB_POSSIBLE=y
 # Multimedia drivers
 #
 CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
@@ -618,26 +645,96 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
 # 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
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 # CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
 # CONFIG_USB_OTG_WHITELIST is not set
 # CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+CONFIG_USB_R8A66597_HCD=y
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -677,6 +774,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -734,6 +832,7 @@ CONFIG_SYSFS=y
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 CONFIG_ROMFS_FS=y
@@ -743,12 +842,11 @@ CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
 CONFIG_LOCKD=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -775,16 +873,20 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
-# CONFIG_DEBUG_OBJECTS is not set
-# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_OBJECTS=y
+# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
+# CONFIG_DEBUG_OBJECTS_FREE is not set
+# CONFIG_DEBUG_OBJECTS_TIMERS is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
@@ -797,12 +899,14 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_DEBUG_VM is not set
-# CONFIG_DEBUG_WRITECOUNT is not set
-# CONFIG_DEBUG_LIST is not set
-# CONFIG_DEBUG_SG is not set
+CONFIG_DEBUG_VM=y
+CONFIG_DEBUG_WRITECOUNT=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_DEBUG_LIST=y
+CONFIG_DEBUG_SG=y
 CONFIG_FRAME_POINTER=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
@@ -830,6 +934,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 3a915fd436d911d29ee9fd0fd3316dabee5de523..8413236c1b37399783141d097b9de2b78e100a21 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24
-# Thu Feb  7 16:25:55 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:55:52 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -20,6 +21,8 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_IO_TRAPPED=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -36,17 +39,15 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 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_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 is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -76,22 +77,31 @@ CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 # CONFIG_MODULE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -106,7 +116,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
-# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
@@ -116,6 +125,7 @@ CONFIG_CPU_SH4=y
 # CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
 # CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -133,6 +143,7 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
 # CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
@@ -140,6 +151,7 @@ CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
 # CONFIG_CPU_SUBTYPE_SH5_101 is not set
 # CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
@@ -161,7 +173,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -170,6 +184,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
 # 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=0
@@ -256,7 +271,6 @@ CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
-CONFIG_RCU_TRACE=y
 CONFIG_GUSA=y
 # CONFIG_GUSA_RB is not set
 
@@ -332,8 +346,6 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -367,6 +379,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_CFG80211 is not set
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
@@ -383,6 +396,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
@@ -399,14 +414,18 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -466,6 +485,7 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -478,9 +498,13 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -490,7 +514,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -535,17 +558,21 @@ CONFIG_ATA=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
 # CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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
@@ -564,6 +591,7 @@ CONFIG_MII=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
 # CONFIG_ENC28J60 is not set
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -599,7 +627,6 @@ CONFIG_NETDEV_1000=y
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
 # CONFIG_E1000E is not set
-# CONFIG_E1000E_ENABLED is not set
 # CONFIG_IP1000 is not set
 # CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
@@ -609,12 +636,12 @@ CONFIG_NETDEV_1000=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
@@ -627,6 +654,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -634,6 +662,7 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -690,9 +719,11 @@ CONFIG_INPUT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -726,10 +757,6 @@ CONFIG_HW_RANDOM=y
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 CONFIG_SPI=y
 CONFIG_SPI_MASTER=y
 
@@ -765,6 +792,8 @@ CONFIG_HWMON=y
 # 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 is not set
 
 #
@@ -776,13 +805,24 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 CONFIG_MFD_SM501=y
+# 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=y
 # CONFIG_USB_DABUSB is not set
 
@@ -802,8 +842,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -836,6 +876,8 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_SH_MOBILE_LCDC=m
 CONFIG_FB_SM501=y
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
@@ -862,15 +904,7 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_SUPERH_MONO is not set
 # CONFIG_LOGO_SUPERH_VGA16 is not set
 CONFIG_LOGO_SUPERH_CLUT224=y
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
 CONFIG_SND=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
@@ -884,21 +918,17 @@ CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
+CONFIG_SND_VMASTER=y
 CONFIG_SND_MPU401_UART=m
 CONFIG_SND_OPL3_LIB=m
 CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-
-#
-# PCI devices
-#
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_PCI=y
 # CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALS300 is not set
 # CONFIG_SND_ALI5451 is not set
@@ -907,6 +937,7 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
@@ -957,43 +988,13 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_VIRTUOSO is not set
 # CONFIG_SND_VX222 is not set
 CONFIG_SND_YMFPCI=m
-CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y
-# CONFIG_SND_AC97_POWER_SAVE is not set
-
-#
-# SPI devices
-#
-
-#
-# SUPERH devices
-#
-
-#
-# USB devices
-#
+CONFIG_SND_SPI=y
+CONFIG_SND_SUPERH=y
+CONFIG_SND_USB=y
 # CONFIG_SND_USB_AUDIO is not set
 # CONFIG_SND_USB_CAIAQ is not set
-
-#
-# System on Chip audio support
-#
 # CONFIG_SND_SOC is not set
-
-#
-# SoC Audio support for SuperH
-#
-
-#
-# ALSA SoC audio for Freescale SOCs
-#
-
-#
-# Open Sound System
-#
 CONFIG_SOUND_PRIME=m
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
 CONFIG_AC97_BUS=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
@@ -1022,12 +1023,16 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 # CONFIG_USB_EHCI_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1041,6 +1046,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 #
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1060,7 +1066,9 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
 # CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 CONFIG_USB_LIBUSUAL=y
 
 #
@@ -1096,9 +1104,12 @@ CONFIG_USB_LIBUSUAL=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
@@ -1118,6 +1129,8 @@ CONFIG_RTC_INTF_DEV=y
 #
 # SPI RTC drivers
 #
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
 # CONFIG_RTC_DRV_MAX6902 is not set
 CONFIG_RTC_DRV_R9701=y
 # CONFIG_RTC_DRV_RS5C348 is not set
@@ -1137,10 +1150,7 @@ CONFIG_RTC_DRV_R9701=y
 # on-CPU RTC drivers
 #
 # CONFIG_RTC_DRV_SH is not set
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -1155,14 +1165,11 @@ CONFIG_EXT2_FS=y
 # 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_OCFS2_FS is not set
-CONFIG_MINIX_FS=y
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -1208,8 +1215,11 @@ CONFIG_TMPFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_OMFS_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
@@ -1275,12 +1285,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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_DEBUG_MEMORY_INIT is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 CONFIG_EARLY_SCIF_CONSOLE=y
@@ -1295,48 +1307,81 @@ CONFIG_EARLY_PRINTK=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
-# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Crypto core or helper
+#
 # CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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
-# CONFIG_CRYPTO_NULL is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_CBC is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-# CONFIG_CRYPTO_DES is not set
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_SEED 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
@@ -1345,8 +1390,10 @@ CONFIG_CRYPTO_HW=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 0a6d3b9e648bc0214f62904192bc00cf89d53120..7d9fa6e9ded5f65641976b9fab586b755c344c9c 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24
-# Thu Feb  7 16:17:47 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 01:59:18 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -20,6 +21,8 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_IO_TRAPPED=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -36,17 +39,15 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 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_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 is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -76,22 +77,31 @@ CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 # CONFIG_MODULE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -106,7 +116,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
-# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
@@ -116,6 +125,7 @@ CONFIG_CPU_SH4=y
 # CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
 # CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -133,6 +143,7 @@ CONFIG_CPU_SH4=y
 CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
 # CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
@@ -140,6 +151,7 @@ CONFIG_CPU_SUBTYPE_SH7751R=y
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
 # CONFIG_CPU_SUBTYPE_SH5_101 is not set
 # CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
@@ -161,7 +173,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -170,6 +184,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
 # 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=0
@@ -256,7 +271,6 @@ CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
-CONFIG_RCU_TRACE=y
 CONFIG_GUSA=y
 # CONFIG_GUSA_RB is not set
 
@@ -332,8 +346,6 @@ CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -367,6 +379,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_CFG80211 is not set
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
@@ -383,6 +396,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
@@ -399,14 +414,18 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -466,6 +485,7 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -478,9 +498,13 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -490,7 +514,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -535,17 +558,21 @@ CONFIG_ATA=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 CONFIG_PATA_PLATFORM=y
+# CONFIG_PATA_SCH is not set
 # CONFIG_MD is not set
 # CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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
@@ -564,6 +591,7 @@ CONFIG_MII=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
 # CONFIG_ENC28J60 is not set
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -599,7 +627,6 @@ CONFIG_NETDEV_1000=y
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
 # CONFIG_E1000E is not set
-# CONFIG_E1000E_ENABLED is not set
 # CONFIG_IP1000 is not set
 # CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
@@ -609,12 +636,12 @@ CONFIG_NETDEV_1000=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
@@ -627,6 +654,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -634,6 +662,7 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -690,9 +719,11 @@ CONFIG_INPUT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -726,10 +757,6 @@ CONFIG_HW_RANDOM=y
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 CONFIG_SPI=y
 CONFIG_SPI_MASTER=y
 
@@ -765,6 +792,8 @@ CONFIG_HWMON=y
 # 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 is not set
 
 #
@@ -776,13 +805,24 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 CONFIG_MFD_SM501=y
+# 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=y
 # CONFIG_USB_DABUSB is not set
 
@@ -802,8 +842,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -836,6 +876,8 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_SH_MOBILE_LCDC=m
 CONFIG_FB_SM501=y
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
@@ -862,15 +904,7 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_SUPERH_MONO is not set
 # CONFIG_LOGO_SUPERH_VGA16 is not set
 CONFIG_LOGO_SUPERH_CLUT224=y
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
 CONFIG_SND=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
@@ -884,21 +918,17 @@ CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
+CONFIG_SND_VMASTER=y
 CONFIG_SND_MPU401_UART=m
 CONFIG_SND_OPL3_LIB=m
 CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-
-#
-# PCI devices
-#
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_PCI=y
 # CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALS300 is not set
 # CONFIG_SND_ALI5451 is not set
@@ -907,6 +937,7 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
@@ -957,43 +988,13 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_VIRTUOSO is not set
 # CONFIG_SND_VX222 is not set
 CONFIG_SND_YMFPCI=m
-CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y
-# CONFIG_SND_AC97_POWER_SAVE is not set
-
-#
-# SPI devices
-#
-
-#
-# SUPERH devices
-#
-
-#
-# USB devices
-#
+CONFIG_SND_SPI=y
+CONFIG_SND_SUPERH=y
+CONFIG_SND_USB=y
 # CONFIG_SND_USB_AUDIO is not set
 # CONFIG_SND_USB_CAIAQ is not set
-
-#
-# System on Chip audio support
-#
 # CONFIG_SND_SOC is not set
-
-#
-# SoC Audio support for SuperH
-#
-
-#
-# ALSA SoC audio for Freescale SOCs
-#
-
-#
-# Open Sound System
-#
 CONFIG_SOUND_PRIME=m
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
 CONFIG_AC97_BUS=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
@@ -1022,12 +1023,16 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 # CONFIG_USB_EHCI_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1041,6 +1046,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 #
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1060,7 +1066,9 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
 # CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 CONFIG_USB_LIBUSUAL=y
 
 #
@@ -1096,9 +1104,12 @@ CONFIG_USB_LIBUSUAL=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
@@ -1118,6 +1129,8 @@ CONFIG_RTC_INTF_DEV=y
 #
 # SPI RTC drivers
 #
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
 # CONFIG_RTC_DRV_MAX6902 is not set
 CONFIG_RTC_DRV_R9701=y
 # CONFIG_RTC_DRV_RS5C348 is not set
@@ -1137,10 +1150,7 @@ CONFIG_RTC_DRV_R9701=y
 # on-CPU RTC drivers
 #
 # CONFIG_RTC_DRV_SH is not set
-
-#
-# Userspace I/O
-#
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -1155,14 +1165,11 @@ CONFIG_EXT2_FS=y
 # 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_OCFS2_FS is not set
-CONFIG_MINIX_FS=y
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -1208,8 +1215,11 @@ CONFIG_TMPFS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_OMFS_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
@@ -1275,12 +1285,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # 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_DEBUG_MEMORY_INIT is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 CONFIG_EARLY_SCIF_CONSOLE=y
@@ -1295,48 +1307,81 @@ CONFIG_EARLY_PRINTK=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
-# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Crypto core or helper
+#
 # CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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
-# CONFIG_CRYPTO_NULL is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_CBC is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-# CONFIG_CRYPTO_DES is not set
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_SEED 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
@@ -1345,8 +1390,10 @@ CONFIG_CRYPTO_HW=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index bb9bcd6591ab5edf22cc69d8f96b93253c03adc3..6d834f2429058bcf80e4834e8a7508e2b81931cd 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc7
-# Tue Jan 22 11:34:03 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 02:00:12 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -20,6 +21,7 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -38,24 +40,23 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=18
 # CONFIG_CGROUPS is not set
-CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_UID16=y
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -63,11 +64,13 @@ 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_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -75,11 +78,24 @@ CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 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
@@ -90,6 +106,7 @@ CONFIG_LBD=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -103,6 +120,7 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
@@ -113,6 +131,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
 # CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -130,6 +149,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
 # CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 CONFIG_CPU_SUBTYPE_SH7780=y
@@ -137,6 +157,7 @@ CONFIG_CPU_SUBTYPE_SH7780=y
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
 # CONFIG_CPU_SUBTYPE_SH5_101 is not set
 # CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
@@ -159,7 +180,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_HUGETLB_PAGE_SIZE_64K=y
 # CONFIG_HUGETLB_PAGE_SIZE_256K is not set
 # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
@@ -174,6 +197,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
 # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=0
@@ -205,7 +229,6 @@ CONFIG_CPU_HAS_FPU=y
 # CONFIG_SH_7780_SOLUTION_ENGINE is not set
 CONFIG_SH_SDK7780=y
 # CONFIG_SH_HIGHLANDER is not set
-# CONFIG_SH_SDK7780_STANDALONE is not set
 CONFIG_SH_SDK7780_BASE=y
 
 #
@@ -250,12 +273,13 @@ 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_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
+# CONFIG_PREEMPT_RCU is not set
 CONFIG_GUSA=y
 
 #
@@ -321,6 +345,7 @@ 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=y
@@ -370,8 +395,10 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=y
 # CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
 CONFIG_IPV6_SIT=y
+CONFIG_IPV6_NDISC_NODETYPE=y
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_IP_DCCP is not set
@@ -397,7 +424,6 @@ CONFIG_NET_SCHED=y
 # CONFIG_NET_SCH_HTB is not set
 # CONFIG_NET_SCH_HFSC is not set
 # CONFIG_NET_SCH_PRIO is not set
-# CONFIG_NET_SCH_RR is not set
 # CONFIG_NET_SCH_RED is not set
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TEQL is not set
@@ -405,7 +431,6 @@ CONFIG_NET_SCHED=y
 # CONFIG_NET_SCH_GRED is not set
 # CONFIG_NET_SCH_DSMARK is not set
 # CONFIG_NET_SCH_NETEM is not set
-# CONFIG_NET_SCH_INGRESS is not set
 
 #
 # Classification
@@ -417,9 +442,9 @@ CONFIG_NET_SCHED=y
 # CONFIG_NET_CLS_U32 is not set
 # CONFIG_NET_CLS_RSVP is not set
 # CONFIG_NET_CLS_RSVP6 is not set
+# CONFIG_NET_CLS_FLOW is not set
 # CONFIG_NET_EMATCH is not set
 # CONFIG_NET_CLS_ACT is not set
-# CONFIG_NET_CLS_POLICE is not set
 CONFIG_NET_SCH_FIFO=y
 
 #
@@ -427,6 +452,7 @@ CONFIG_NET_SCH_FIFO=y
 #
 # 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
@@ -452,6 +478,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
@@ -475,16 +503,18 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
 CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
 # CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
@@ -492,6 +522,7 @@ CONFIG_IDEDISK_MULTI_MODE=y
 # CONFIG_BLK_DEV_IDECS is not set
 # CONFIG_BLK_DEV_DELKIN is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
@@ -501,14 +532,12 @@ CONFIG_IDE_PROC_FS=y
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_PLATFORM=y
 
 #
 # PCI IDE chipsets support
 #
 CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_BLK_DEV_GENERIC=y
@@ -518,10 +547,8 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
@@ -537,10 +564,7 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_BLK_DEV_TC86C001 is not set
-# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
-# CONFIG_IDE_ARCH_OBSOLETE_INIT is not set
-# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
@@ -600,6 +624,7 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -613,9 +638,13 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
 # CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
 # CONFIG_ATA_PIIX is not set
 # CONFIG_SATA_MV is not set
@@ -625,7 +654,6 @@ CONFIG_ATA=y
 # CONFIG_SATA_PROMISE is not set
 # CONFIG_SATA_SX4 is not set
 # CONFIG_SATA_SIL is not set
-# CONFIG_SATA_SIL24 is not set
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
@@ -654,6 +682,7 @@ CONFIG_ATA=y
 # CONFIG_PATA_MPIIX is not set
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
 # CONFIG_PATA_NS87410 is not set
 # CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
@@ -670,6 +699,7 @@ CONFIG_ATA=y
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 # CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
 CONFIG_MD=y
 # CONFIG_BLK_DEV_MD is not set
 CONFIG_BLK_DEV_DM=y
@@ -686,11 +716,14 @@ CONFIG_BLK_DEV_DM=y
 #
 # IEEE 1394 (FireWire) support
 #
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O 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
@@ -708,6 +741,7 @@ CONFIG_MII=y
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 CONFIG_SMC91X=y
+# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -726,6 +760,7 @@ CONFIG_SMC91X=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -743,7 +778,6 @@ CONFIG_SMC91X=y
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 CONFIG_NETCONSOLE=y
 # CONFIG_NETCONSOLE_DYNAMIC is not set
 CONFIG_NETPOLL=y
@@ -780,6 +814,7 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
 CONFIG_MOUSE_PS2_ALPS=y
@@ -812,10 +847,13 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -847,22 +885,20 @@ CONFIG_HW_RANDOM=y
 # CONFIG_SYNCLINK_CS is not set
 # CONFIG_CARDMAN_4000 is not set
 # CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
 # CONFIG_PDA_POWER is not set
 # CONFIG_BATTERY_DS2760 is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -870,8 +906,10 @@ CONFIG_POWER_SUPPLY=y
 #
 CONFIG_SSB_POSSIBLE=y
 CONFIG_SSB=y
+CONFIG_SSB_SPROM=y
 CONFIG_SSB_PCIHOST_POSSIBLE=y
 CONFIG_SSB_PCIHOST=y
+# CONFIG_SSB_B43_PCI_BRIDGE is not set
 CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
 # CONFIG_SSB_PCMCIAHOST is not set
 # CONFIG_SSB_SILENT is not set
@@ -882,13 +920,24 @@ CONFIG_SSB_DRIVER_PCICORE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # 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
 
 #
@@ -900,15 +949,15 @@ CONFIG_SSB_DRIVER_PCICORE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
-# CONFIG_FB_CFB_FILLRECT is not set
-# CONFIG_FB_CFB_COPYAREA is not set
-# CONFIG_FB_CFB_IMAGEBLIT is not set
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
 # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -941,6 +990,8 @@ CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_SH_MOBILE_LCDC=m
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
@@ -970,24 +1021,9 @@ CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_LOGO_SUPERH_MONO=y
 CONFIG_LOGO_SUPERH_VGA16=y
 CONFIG_LOGO_SUPERH_CLUT224=y
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
 # CONFIG_SND is not set
-
-#
-# Open Sound System
-#
 CONFIG_SOUND_PRIME=y
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
@@ -1006,6 +1042,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
 CONFIG_USB_DEBUG=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
@@ -1014,15 +1051,18 @@ CONFIG_USB_DEVICEFS=y
 # CONFIG_USB_DEVICE_CLASS is not set
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=y
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 # CONFIG_USB_OHCI_HCD is not set
 # CONFIG_USB_UHCI_HCD is not set
 # CONFIG_USB_SL811_HCD is not set
@@ -1033,6 +1073,7 @@ CONFIG_USB_EHCI_HCD=y
 #
 # CONFIG_USB_ACM is not set
 CONFIG_USB_PRINTER=y
+# CONFIG_USB_WDM is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1054,6 +1095,7 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1067,10 +1109,6 @@ CONFIG_USB_MON=y
 # USB port drivers
 #
 # CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
 # CONFIG_USB_SERIAL is not set
 
 #
@@ -1096,16 +1134,10 @@ CONFIG_USB_MON=y
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
+# CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 
@@ -1117,13 +1149,11 @@ CONFIG_LEDS_CLASS=y
 # LED Triggers
 #
 # CONFIG_LEDS_TRIGGERS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1145,14 +1175,11 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-CONFIG_MINIX_FS=y
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
 # CONFIG_FUSE_FS is not set
@@ -1203,8 +1230,11 @@ CONFIG_HUGETLB_PAGE=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_OMFS_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
@@ -1212,19 +1242,16 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 # CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
-CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1279,7 +1306,6 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 # CONFIG_DLM is not set
-# CONFIG_INSTRUMENTATION is not set
 
 #
 # Kernel hacking
@@ -1288,6 +1314,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_UNUSED_SYMBOLS=y
 # CONFIG_DEBUG_FS is not set
@@ -1295,10 +1322,14 @@ CONFIG_UNUSED_SYMBOLS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_SCHEDSTATS is not set
 CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
 CONFIG_DEBUG_PREEMPT=y
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
@@ -1313,12 +1344,14 @@ CONFIG_DEBUG_PREEMPT=y
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_FRAME_POINTER is not set
-# CONFIG_FORCED_INLINING is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
@@ -1338,52 +1371,94 @@ CONFIG_DEBUG_STACKOVERFLOW=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 # CONFIG_CRYPTO_MANAGER is not set
+# 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 is not set
+# 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
-# CONFIG_CRYPTO_NULL 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_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_CBC is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT 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_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS 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_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 6b34baa26eae1bcabe2b0834f1ce850a28a41af6..af15cbef12baf96a5471f57a5bdbe42ec4064803 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc4
-# Tue Jun  3 20:27:08 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 02:06:07 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -87,9 +88,14 @@ CONFIG_PROFILING=y
 # CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
 # CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_RT_MUTEXES=y
 CONFIG_TINY_SHMEM=y
 CONFIG_BASE_SMALL=0
@@ -99,12 +105,13 @@ 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 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -175,7 +182,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -294,6 +303,7 @@ CONFIG_CF_BASE_ADDR=0xb8000000
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_FDPIC=y
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_ZFLAT=y
 CONFIG_BINFMT_SHARED_FLAT=y
@@ -487,6 +497,7 @@ 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_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 CONFIG_EEPROM_93CX6=y
 # CONFIG_ENCLOSURE_SERVICES is not set
@@ -503,7 +514,6 @@ CONFIG_HAVE_IDE=y
 # 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
@@ -516,6 +526,7 @@ CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 CONFIG_SMC91X=y
+# CONFIG_SMC911X 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
@@ -583,6 +594,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 # CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -594,6 +606,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 
@@ -625,10 +638,6 @@ CONFIG_SSB_POSSIBLE=y
 # 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
@@ -669,6 +678,7 @@ CONFIG_RTC_INTF_DEV=y
 # on-CPU RTC drivers
 #
 CONFIG_RTC_DRV_SH=y
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -728,6 +738,7 @@ CONFIG_CONFIGFS_FS=y
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 CONFIG_ROMFS_FS=y
@@ -738,13 +749,12 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -776,6 +786,8 @@ CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
@@ -795,6 +807,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_VM=y
 # CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 CONFIG_DEBUG_LIST=y
 # CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
@@ -860,6 +873,10 @@ CONFIG_CRYPTO_ALGAPI=y
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
@@ -899,6 +916,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=y
 CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
 CONFIG_CRC_ITU_T=y
 CONFIG_CRC32=y
 CONFIG_CRC7=y
index 7b72736384474f23ca39f755a0bfbcc9ee61786b..4e30b70377e264d4ee82ec6694c2c48fb891962e 100644 (file)
@@ -1,10 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc8
-# Mon Jul  7 13:12:45 2008
+# Linux kernel version: 2.6.26
+# Wed Jul 30 02:08:38 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -77,9 +78,14 @@ CONFIG_SLAB=y
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
 # CONFIG_HAVE_KPROBES is not set
 # CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
 # CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_TINY_SHMEM=y
@@ -90,12 +96,13 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-# CONFIG_KMOD 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
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -171,6 +178,7 @@ CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -368,6 +376,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=y
@@ -455,6 +465,7 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_MISC_DEVICES is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
@@ -497,10 +508,10 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_SAS_LIBSAS is not set
 # CONFIG_SCSI_SRP_ATTRS is not set
 # CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH 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
@@ -513,13 +524,13 @@ CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 CONFIG_SMC91X=y
+# CONFIG_SMC911X 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=y
-# CONFIG_E1000E_ENABLED is not set
 CONFIG_NETDEV_10000=y
 
 #
@@ -572,6 +583,7 @@ CONFIG_INPUT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
@@ -617,6 +629,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 
@@ -646,6 +659,7 @@ CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 # CONFIG_VIDEO_VIVI is not set
 # CONFIG_VIDEO_CPIA is not set
 # CONFIG_SOC_CAMERA is not set
+# CONFIG_VIDEO_SH_MOBILE_CEU is not set
 CONFIG_RADIO_ADAPTERS=y
 # CONFIG_DAB is not set
 
@@ -657,9 +671,9 @@ CONFIG_RADIO_ADAPTERS=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_DDC is not set
-# CONFIG_FB_CFB_FILLRECT is not set
-# CONFIG_FB_CFB_COPYAREA is not set
-# CONFIG_FB_CFB_IMAGEBLIT is not set
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
 # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
@@ -676,6 +690,7 @@ CONFIG_FIRMWARE_EDID=y
 # Frame buffer hardware drivers
 #
 # CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_SH_MOBILE_LCDC=m
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
@@ -690,15 +705,7 @@ CONFIG_FIRMWARE_EDID=y
 CONFIG_DUMMY_CONSOLE=y
 # CONFIG_FRAMEBUFFER_CONSOLE is not set
 # CONFIG_LOGO is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
 CONFIG_SND=y
 CONFIG_SND_TIMER=y
 CONFIG_SND_PCM=y
@@ -714,40 +721,14 @@ CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
+CONFIG_SND_DRIVERS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-
-#
-# SUPERH devices
-#
-
-#
-# System on Chip audio support
-#
+CONFIG_SND_SUPERH=y
 # CONFIG_SND_SOC is not set
-
-#
-# SoC Audio support for SuperH
-#
-
-#
-# ALSA SoC audio for Freescale SOCs
-#
-
-#
-# SoC Audio for the Texas Instruments OMAP
-#
-
-#
-# Open Sound System
-#
 # CONFIG_SOUND_PRIME is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
@@ -759,6 +740,7 @@ CONFIG_HID=y
 # CONFIG_NEW_LEDS is not set
 # CONFIG_ACCESSIBILITY is not set
 # CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 
 #
@@ -836,6 +818,7 @@ CONFIG_JFFS2_RTIME=y
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -854,7 +837,6 @@ CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -885,6 +867,7 @@ CONFIG_FRAME_WARN=1024
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 CONFIG_EARLY_SCIF_CONSOLE=y
@@ -941,6 +924,10 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
@@ -980,6 +967,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
index 3a3c3c1f507d92f5e61d5692c4479e54accae1cf..80c1c72edb562593636dfc8e7c06e80c68479d15 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc4
-# Fri Jun 15 19:43:06 2007
+# Linux kernel version: 2.6.26
+# Wed Jul 30 02:12:32 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -17,27 +19,26 @@ CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SYSVIPC is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -49,6 +50,7 @@ CONFIG_EMBEDDED=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 # CONFIG_ELF_CORE is not set
+CONFIG_COMPAT_BRK=y
 # CONFIG_BASE_FULL is not set
 # CONFIG_FUTEX is not set
 CONFIG_ANON_INODES=y
@@ -60,20 +62,26 @@ CONFIG_EVENTFD=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_EFFICIENT_UNALIGNED_ACCESS is not set
+# CONFIG_HAVE_IOREMAP_PROT is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+CONFIG_HAVE_CLK=y
+CONFIG_SLABINFO=y
 CONFIG_TINY_SHMEM=y
 CONFIG_BASE_SMALL=1
-
-#
-# Loadable module support
-#
 # CONFIG_MODULES is not set
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -87,14 +95,17 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System type
 #
 CONFIG_CPU_SH2=y
 CONFIG_CPU_SUBTYPE_SH7619=y
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -102,6 +113,8 @@ CONFIG_CPU_SUBTYPE_SH7619=y
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -110,14 +123,17 @@ CONFIG_CPU_SUBTYPE_SH7619=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
+# CONFIG_CPU_SUBTYPE_SH7723 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
@@ -126,6 +142,7 @@ CONFIG_QUICKLIST=y
 CONFIG_PAGE_OFFSET=0x00000000
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_MEMORY_SIZE=0x04000000
+CONFIG_29BIT=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_DEFAULT=y
@@ -134,7 +151,9 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_ENTRY_OFFSET=0x00001000
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -142,6 +161,8 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+# 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=0
@@ -151,7 +172,9 @@ CONFIG_NR_QUICK=2
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-CONFIG_SH_WRITETHROUGH=y
+# CONFIG_CACHE_WRITEBACK is not set
+CONFIG_CACHE_WRITETHROUGH=y
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -159,8 +182,6 @@ CONFIG_SH_WRITETHROUGH=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_SH_FPU_EMU is not set
-# CONFIG_SH_DSP is not set
-CONFIG_CPU_HAS_IPR_IRQ=y
 
 #
 # Board support
@@ -185,7 +206,6 @@ CONFIG_SH_CLK_MD=5
 #
 # DMA support
 #
-# CONFIG_SH_DMA is not set
 
 #
 # Companion Chips
@@ -205,11 +225,13 @@ CONFIG_HZ_100=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
 
 #
 # Boot options
@@ -221,15 +243,13 @@ CONFIG_BOOT_LINK_OFFSET=0x00800000
 #
 # Bus options
 #
+# CONFIG_CF_ENABLER is not set
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_FDPIC=y
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_ZFLAT=y
 # CONFIG_BINFMT_SHARED_FLAT is not set
@@ -250,10 +270,6 @@ CONFIG_BINFMT_ZFLAT=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=y
@@ -263,6 +279,7 @@ CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
 # CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
 
 #
 # User Modules And Translation Layers
@@ -275,6 +292,7 @@ CONFIG_MTD_BLOCK=y
 # 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
@@ -334,29 +352,17 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# Misc devices
-#
-# CONFIG_BLINK is not set
+# CONFIG_BLK_DEV_HD 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
 
 #
@@ -364,21 +370,10 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 #
 # 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
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# ISDN subsystem
-#
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -386,13 +381,13 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 #
 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_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -416,6 +411,7 @@ CONFIG_INPUT=y
 # Character devices
 #
 # CONFIG_VT is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -433,123 +429,84 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_UNIX98_PTYS is not set
 # CONFIG_LEGACY_PTYS is not set
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
 
 #
-# Dallas's 1-wire bus
+# Sonics Silicon Backplane
 #
-# CONFIG_W1 is not set
-# CONFIG_HWMON is not set
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
-CONFIG_DAB=y
+# CONFIG_VIDEO_MEDIA is not set
 
 #
-# Graphics support
+# Multimedia drivers
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_DAB=y
 
 #
-# Display device support
+# Graphics support
 #
-# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Sound
+# Display device support
 #
+# CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
-
-#
-# USB support
-#
-# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 # CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_RTC_CLASS is not set
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -561,12 +518,9 @@ CONFIG_HID=y
 # 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=y
+# CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # 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
@@ -592,7 +546,6 @@ CONFIG_PROC_SYSCTL=y
 # CONFIG_SYSFS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 
 #
 # Miscellaneous filesystems
@@ -607,8 +560,11 @@ CONFIG_RAMFS=y
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
 
@@ -617,28 +573,23 @@ CONFIG_RAMFS=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 
@@ -646,20 +597,20 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # Security options
 #
 # CONFIG_KEYS is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_HAS_IOMEM=y
index 0caf11bb7e27993ae65d6e0ae5ff1531514c931a..af7bb589c2c8bcad3a1e902e456c3465095c1b6f 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <asm/cacheflush.h>
-#include <asm/mach/sysasic.h>
-#include <asm/mach/dma.h>
+#include <mach/sysasic.h>
+#include <mach/dma.h>
 #include <asm/dma.h>
 
 struct g2_channel {
index 838fad566eaf68f8e4282fa4f218c02915e15147..391cbe1c295662e8a769838ea37b36fd5be7d5a5 100644 (file)
@@ -13,8 +13,8 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
-#include <asm/mach/sysasic.h>
-#include <asm/mach/dma.h>
+#include <mach/sysasic.h>
+#include <mach/dma.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 
index 71ff3d6f26e2924462de6132ca9242685c9ddacf..b2ffe649c7c039d9bc3a03c7527ad37922a62552 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
-#include <asm/dreamcast/dma.h>
+#include <mach-dreamcast/mach/dma.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 #include "dma-sh.h"
index 0f591fbc922d3070af86ca8a4a01ca80db0ec86a..b05af34fc15de0b6e5f40e500784bbf98b12cf31 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __DMA_SH_H
 #define __DMA_SH_H
 
-#include <asm/cpu/dma.h>
+#include <cpu/dma.h>
 
 /* Definitions for the SuperH DMAC */
 #define REQ_L  0x00000000
index c44699301eeb1ba5df4e09d0ce0b40f1cae6ec9f..2bf85cf091e13bda25657f76bd1d9c4952ebeedc 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/mach/pci.h>
+#include <mach/pci.h>
 
 static void __init gapspci_fixup_resources(struct pci_dev *dev)
 {
index 980275ffa30b72d51600d170ba639b31871c8b34..5ccf9ea3a9de5dd629ca5dc88cb2364ffe06c2a8 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/types.h>
-#include <asm/cpu/irq.h>
+#include <cpu/irq.h>
 #include "pci-sh5.h"
 
 static inline u8 bridge_swizzle(u8 pin, u8 slot)
index f54c291db37b1d10d8944f2657b62ba3b396da99..f5d2a2aa6f3f88b00ecb46700d245b98b182390f 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/mach/pci.h>
+#include <mach/pci.h>
 
 static struct resource gapspci_io_resource = {
        .name   = "GAPSPCI IO",
index bbdb48c124a238ce4016279383906ac6aa1c55ed..3145c62484d618be0d3453d05d0a2c2b383dda97 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <asm/se7780.h>
+#include <mach-se/mach/se7780.h>
 #include <asm/io.h>
 #include "pci-sh4.h"
 
index a00a4df8c02d0a5cde1190164929eec48bc41d0b..7a97438762c836f5860e3854e95ea243ae0b9ac1 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/irq.h>
-#include <asm/cpu/irq.h>
+#include <cpu/irq.h>
 #include <asm/pci.h>
 #include <asm/io.h>
 #include "pci-sh5.h"
diff --git a/arch/sh/include/asm/.gitignore b/arch/sh/include/asm/.gitignore
new file mode 100644 (file)
index 0000000..378db77
--- /dev/null
@@ -0,0 +1 @@
+machtypes.h
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
new file mode 100644 (file)
index 0000000..43910cd
--- /dev/null
@@ -0,0 +1,8 @@
+include include/asm-generic/Kbuild.asm
+
+header-y += cpu-features.h
+
+unifdef-y += unistd_32.h
+unifdef-y += unistd_64.h
+unifdef-y += posix_types_32.h
+unifdef-y += posix_types_64.h
diff --git a/arch/sh/include/asm/a.out.h b/arch/sh/include/asm/a.out.h
new file mode 100644 (file)
index 0000000..1f93130
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __ASM_SH_A_OUT_H
+#define __ASM_SH_A_OUT_H
+
+struct exec
+{
+  unsigned long a_info;                /* Use macros N_MAGIC, etc for access */
+  unsigned a_text;             /* length of text, in bytes */
+  unsigned a_data;             /* length of data, in bytes */
+  unsigned a_bss;              /* length of uninitialized data area for file, in bytes */
+  unsigned a_syms;             /* length of symbol table data in file, in bytes */
+  unsigned a_entry;            /* start address */
+  unsigned a_trsize;           /* length of relocation info for text, in bytes */
+  unsigned a_drsize;           /* length of relocation info for data, in bytes */
+};
+
+#define N_TRSIZE(a)    ((a).a_trsize)
+#define N_DRSIZE(a)    ((a).a_drsize)
+#define N_SYMSIZE(a)   ((a).a_syms)
+
+#endif /* __ASM_SH_A_OUT_H */
diff --git a/arch/sh/include/asm/adc.h b/arch/sh/include/asm/adc.h
new file mode 100644 (file)
index 0000000..48824c1
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_ADC_H
+#define __ASM_ADC_H
+#ifdef __KERNEL__
+/*
+ * Copyright (C) 2004  Andriy Skulysh
+ */
+
+#include <cpu/adc.h>
+
+int adc_single(unsigned int channel);
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_ADC_H */
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h
new file mode 100644 (file)
index 0000000..2702d81
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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) 1999 by Kaz Kojima
+ *
+ * Defitions for the address spaces of the SH CPUs.
+ */
+#ifndef __ASM_SH_ADDRSPACE_H
+#define __ASM_SH_ADDRSPACE_H
+
+#ifdef __KERNEL__
+
+#include <cpu/addrspace.h>
+
+/* If this CPU supports segmentation, hook up the helpers */
+#ifdef P1SEG
+
+/*
+   [ P0/U0 (virtual) ]         0x00000000     <------ User space
+   [ P1 (fixed)   cached ]     0x80000000     <------ Kernel space
+   [ P2 (fixed)  non-cachable] 0xA0000000     <------ Physical access
+   [ P3 (virtual) cached]      0xC0000000     <------ vmalloced area
+   [ P4 control   ]            0xE0000000
+ */
+
+/* Returns the privileged segment base of a given address  */
+#define PXSEG(a)       (((unsigned long)(a)) & 0xe0000000)
+
+/* Returns the physical address of a PnSEG (n=1,2) address   */
+#define PHYSADDR(a)    (((unsigned long)(a)) & 0x1fffffff)
+
+#ifdef CONFIG_29BIT
+/*
+ * Map an address to a certain privileged segment
+ */
+#define P1SEGADDR(a)   \
+       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P1SEG))
+#define P2SEGADDR(a)   \
+       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P2SEG))
+#define P3SEGADDR(a)   \
+       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
+#define P4SEGADDR(a)   \
+       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))
+#endif /* 29BIT */
+#endif /* P1SEG */
+
+/* Check if an address can be reached in 29 bits */
+#define IS_29BIT(a)    (((unsigned long)(a)) < 0x20000000)
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_ADDRSPACE_H */
diff --git a/arch/sh/include/asm/atomic-grb.h b/arch/sh/include/asm/atomic-grb.h
new file mode 100644 (file)
index 0000000..4c5b7db
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef __ASM_SH_ATOMIC_GRB_H
+#define __ASM_SH_ATOMIC_GRB_H
+
+static inline void atomic_add(int i, atomic_t *v)
+{
+       int tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   add     %2,   %0      \n\t" /* add */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (i)
+               : "memory" , "r0", "r1");
+}
+
+static inline void atomic_sub(int i, atomic_t *v)
+{
+       int tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov     r15,  r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   sub     %2,   %0      \n\t" /* sub */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (i)
+               : "memory" , "r0", "r1");
+}
+
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       int tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   add     %2,   %0      \n\t" /* add */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (i)
+               : "memory" , "r0", "r1");
+
+       return tmp;
+}
+
+static inline int atomic_sub_return(int i, atomic_t *v)
+{
+       int tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   sub     %2,   %0      \n\t" /* sub */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (i)
+               : "memory", "r0", "r1");
+
+       return tmp;
+}
+
+static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
+{
+       int tmp;
+       unsigned int _mask = ~mask;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   and     %2,   %0      \n\t" /* add */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (_mask)
+               : "memory" , "r0", "r1");
+}
+
+static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
+{
+       int tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   or      %2,   %0      \n\t" /* or */
+               "   mov.l   %0,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "+r"  (v)
+               : "r"   (mask)
+               : "memory" , "r0", "r1");
+}
+
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+{
+       int ret;
+
+       __asm__ __volatile__ (
+               "   .align 2            \n\t"
+               "   mova     1f,  r0    \n\t"
+               "   nop                 \n\t"
+               "   mov     r15,  r1    \n\t"
+               "   mov    #-8,  r15    \n\t"
+               "   mov.l   @%1,  %0    \n\t"
+               "   cmp/eq   %2,  %0    \n\t"
+               "   bf       1f         \n\t"
+               "   mov.l    %3, @%1    \n\t"
+               "1: mov      r1,  r15   \n\t"
+               : "=&r" (ret)
+               : "r" (v), "r" (old), "r" (new)
+               : "memory" , "r0", "r1" , "t");
+
+       return ret;
+}
+
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
+{
+       int ret;
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+               "   .align 2            \n\t"
+               "   mova    1f,   r0    \n\t"
+               "   nop                 \n\t"
+               "   mov    r15,   r1    \n\t"
+               "   mov    #-12,  r15   \n\t"
+               "   mov.l  @%2,   %1    \n\t"
+               "   mov     %1,   %0    \n\t"
+               "   cmp/eq  %4,   %0    \n\t"
+               "   bt/s    1f          \n\t"
+               "    add    %3,   %1    \n\t"
+               "   mov.l   %1,  @%2    \n\t"
+               "1: mov     r1,   r15   \n\t"
+               : "=&r" (ret), "=&r" (tmp)
+               : "r" (v), "r" (a), "r" (u)
+               : "memory" , "r0", "r1" , "t");
+
+       return ret != u;
+}
+#endif /* __ASM_SH_ATOMIC_GRB_H */
diff --git a/arch/sh/include/asm/atomic-irq.h b/arch/sh/include/asm/atomic-irq.h
new file mode 100644 (file)
index 0000000..74f7943
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef __ASM_SH_ATOMIC_IRQ_H
+#define __ASM_SH_ATOMIC_IRQ_H
+
+/*
+ * 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 flags;
+
+       local_irq_save(flags);
+       *(long *)v += i;
+       local_irq_restore(flags);
+}
+
+static inline void atomic_sub(int i, atomic_t *v)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       *(long *)v -= i;
+       local_irq_restore(flags);
+}
+
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       unsigned long temp, flags;
+
+       local_irq_save(flags);
+       temp = *(long *)v;
+       temp += i;
+       *(long *)v = temp;
+       local_irq_restore(flags);
+
+       return temp;
+}
+
+static inline int atomic_sub_return(int i, atomic_t *v)
+{
+       unsigned long temp, flags;
+
+       local_irq_save(flags);
+       temp = *(long *)v;
+       temp -= i;
+       *(long *)v = temp;
+       local_irq_restore(flags);
+
+       return temp;
+}
+
+static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       *(long *)v &= ~mask;
+       local_irq_restore(flags);
+}
+
+static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       *(long *)v |= mask;
+       local_irq_restore(flags);
+}
+
+#endif /* __ASM_SH_ATOMIC_IRQ_H */
diff --git a/arch/sh/include/asm/atomic-llsc.h b/arch/sh/include/asm/atomic-llsc.h
new file mode 100644 (file)
index 0000000..4b00b78
--- /dev/null
@@ -0,0 +1,107 @@
+#ifndef __ASM_SH_ATOMIC_LLSC_H
+#define __ASM_SH_ATOMIC_LLSC_H
+
+/*
+ * 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 tmp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_add    \n"
+"      add     %1, %0                          \n"
+"      movco.l %0, @%2                         \n"
+"      bf      1b                              \n"
+       : "=&z" (tmp)
+       : "r" (i), "r" (&v->counter)
+       : "t");
+}
+
+static inline void atomic_sub(int i, atomic_t *v)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_sub    \n"
+"      sub     %1, %0                          \n"
+"      movco.l %0, @%2                         \n"
+"      bf      1b                              \n"
+       : "=&z" (tmp)
+       : "r" (i), "r" (&v->counter)
+       : "t");
+}
+
+/*
+ * SH-4A note:
+ *
+ * We basically get atomic_xxx_return() for free compared with
+ * atomic_xxx(). movli.l/movco.l require r0 due to the instruction
+ * encoding, so the retval is automatically set without having to
+ * do any special work.
+ */
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       unsigned long temp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_add_return     \n"
+"      add     %1, %0                                  \n"
+"      movco.l %0, @%2                                 \n"
+"      bf      1b                                      \n"
+"      synco                                           \n"
+       : "=&z" (temp)
+       : "r" (i), "r" (&v->counter)
+       : "t");
+
+       return temp;
+}
+
+static inline int atomic_sub_return(int i, atomic_t *v)
+{
+       unsigned long temp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_sub_return     \n"
+"      sub     %1, %0                                  \n"
+"      movco.l %0, @%2                                 \n"
+"      bf      1b                                      \n"
+"      synco                                           \n"
+       : "=&z" (temp)
+       : "r" (i), "r" (&v->counter)
+       : "t");
+
+       return temp;
+}
+
+static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_clear_mask     \n"
+"      and     %1, %0                                  \n"
+"      movco.l %0, @%2                                 \n"
+"      bf      1b                                      \n"
+       : "=&z" (tmp)
+       : "r" (~mask), "r" (&v->counter)
+       : "t");
+}
+
+static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+"1:    movli.l @%2, %0         ! atomic_set_mask       \n"
+"      or      %1, %0                                  \n"
+"      movco.l %0, @%2                                 \n"
+"      bf      1b                                      \n"
+       : "=&z" (tmp)
+       : "r" (mask), "r" (&v->counter)
+       : "t");
+}
+
+#endif /* __ASM_SH_ATOMIC_LLSC_H */
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..c043ef0
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef __ASM_SH_ATOMIC_H
+#define __ASM_SH_ATOMIC_H
+
+/*
+ * Atomic operations that C can't guarantee us.  Useful for
+ * resource counting etc..
+ *
+ */
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
+
+#define atomic_read(v)         ((v)->counter)
+#define atomic_set(v,i)                ((v)->counter = (i))
+
+#include <linux/compiler.h>
+#include <asm/system.h>
+
+#if defined(CONFIG_GUSA_RB)
+#include <asm/atomic-grb.h>
+#elif defined(CONFIG_CPU_SH4A)
+#include <asm/atomic-llsc.h>
+#else
+#include <asm/atomic-irq.h>
+#endif
+
+#define atomic_add_negative(a, v)      (atomic_add_return((a), (v)) < 0)
+
+#define atomic_dec_return(v) atomic_sub_return(1,(v))
+#define atomic_inc_return(v) atomic_add_return(1,(v))
+
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+
+#define atomic_inc(v) atomic_add(1,(v))
+#define atomic_dec(v) atomic_sub(1,(v))
+
+#ifndef CONFIG_GUSA_RB
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+{
+       int ret;
+       unsigned long flags;
+
+       local_irq_save(flags);
+       ret = v->counter;
+       if (likely(ret == old))
+               v->counter = new;
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
+{
+       int ret;
+       unsigned long flags;
+
+       local_irq_save(flags);
+       ret = v->counter;
+       if (ret != u)
+               v->counter += a;
+       local_irq_restore(flags);
+
+       return ret != u;
+}
+#endif
+
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+
+/* Atomic operations are already serializing on SH */
+#define smp_mb__before_atomic_dec()    barrier()
+#define smp_mb__after_atomic_dec()     barrier()
+#define smp_mb__before_atomic_inc()    barrier()
+#define smp_mb__after_atomic_inc()     barrier()
+
+#include <asm-generic/atomic.h>
+#endif /* __ASM_SH_ATOMIC_H */
diff --git a/arch/sh/include/asm/auxvec.h b/arch/sh/include/asm/auxvec.h
new file mode 100644 (file)
index 0000000..483effd
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef __ASM_SH_AUXVEC_H
+#define __ASM_SH_AUXVEC_H
+
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them.
+ */
+
+/*
+ * This entry gives some information about the FPU initialization
+ * performed by the kernel.
+ */
+#define AT_FPUCW               18      /* Used FPU control word.  */
+
+#if defined(CONFIG_VSYSCALL) || !defined(__KERNEL__)
+/*
+ * Only define this in the vsyscall case, the entry point to
+ * the vsyscall page gets placed here. The kernel will attempt
+ * to build a gate VMA we don't care about otherwise..
+ */
+#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.
+ */
+#define AT_L1I_CACHESHAPE      34
+#define AT_L1D_CACHESHAPE      35
+#define AT_L2_CACHESHAPE       36
+
+#endif /* __ASM_SH_AUXVEC_H */
diff --git a/arch/sh/include/asm/bitops-grb.h b/arch/sh/include/asm/bitops-grb.h
new file mode 100644 (file)
index 0000000..a5907b9
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef __ASM_SH_BITOPS_GRB_H
+#define __ASM_SH_BITOPS_GRB_H
+
+static inline void set_bit(int nr, volatile void * addr)
+{
+       int     mask;
+       volatile unsigned int *a = addr;
+       unsigned long tmp;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+                "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+                "   mov.l  @%1,   %0      \n\t" /* load  old value */
+                "   or      %2,   %0      \n\t" /* or */
+                "   mov.l   %0,   @%1     \n\t" /* store new value */
+                "1: mov     r1,   r15     \n\t" /* LOGOUT */
+                : "=&r" (tmp),
+                  "+r"  (a)
+                : "r"   (mask)
+                : "memory" , "r0", "r1");
+}
+
+static inline void clear_bit(int nr, volatile void * addr)
+{
+       int     mask;
+       volatile unsigned int *a = addr;
+        unsigned long tmp;
+
+       a += nr >> 5;
+        mask = ~(1 << (nr & 0x1f));
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+                "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+                "   mov.l  @%1,   %0      \n\t" /* load  old value */
+                "   and     %2,   %0      \n\t" /* and */
+                "   mov.l   %0,   @%1     \n\t" /* store new value */
+                "1: mov     r1,   r15     \n\t" /* LOGOUT */
+                : "=&r" (tmp),
+                  "+r"  (a)
+                : "r"   (mask)
+                : "memory" , "r0", "r1");
+}
+
+static inline void change_bit(int nr, volatile void * addr)
+{
+        int     mask;
+        volatile unsigned int *a = addr;
+        unsigned long tmp;
+
+        a += nr >> 5;
+        mask = 1 << (nr & 0x1f);
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+                "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
+                "   mov.l  @%1,   %0      \n\t" /* load  old value */
+                "   xor     %2,   %0      \n\t" /* xor */
+                "   mov.l   %0,   @%1     \n\t" /* store new value */
+                "1: mov     r1,   r15     \n\t" /* LOGOUT */
+                : "=&r" (tmp),
+                  "+r"  (a)
+                : "r"   (mask)
+                : "memory" , "r0", "r1");
+}
+
+static inline int test_and_set_bit(int nr, volatile void * addr)
+{
+        int     mask, retval;
+       volatile unsigned int *a = addr;
+        unsigned long tmp;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+                "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+                "   mov   #-14,   r15     \n\t" /* LOGIN: r15 = size */
+                "   mov.l  @%2,   %0      \n\t" /* load old value */
+                "   mov     %0,   %1      \n\t"
+                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
+                "   mov    #-1,   %1      \n\t" /* retvat = -1 */
+                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
+                "   or      %3,   %0      \n\t"
+                "   mov.l   %0,  @%2      \n\t" /* store new value */
+                "1: mov     r1,  r15      \n\t" /* LOGOUT */
+                : "=&r" (tmp),
+                  "=&r" (retval),
+                  "+r"  (a)
+                : "r"   (mask)
+                : "memory" , "r0", "r1" ,"t");
+
+        return retval;
+}
+
+static inline int test_and_clear_bit(int nr, volatile void * addr)
+{
+        int     mask, retval,not_mask;
+        volatile unsigned int *a = addr;
+        unsigned long tmp;
+
+        a += nr >> 5;
+        mask = 1 << (nr & 0x1f);
+
+       not_mask = ~mask;
+
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov   #-14,   r15     \n\t" /* LOGIN */
+               "   mov.l  @%2,   %0      \n\t" /* load old value */
+                "   mov     %0,   %1      \n\t" /* %1 = *a */
+                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
+               "   mov    #-1,   %1      \n\t" /* retvat = -1 */
+                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
+                "   and     %4,   %0      \n\t"
+                "   mov.l   %0,  @%2      \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (tmp),
+                 "=&r" (retval),
+                 "+r"  (a)
+               : "r"   (mask),
+                 "r"   (not_mask)
+               : "memory" , "r0", "r1", "t");
+
+        return retval;
+}
+
+static inline int test_and_change_bit(int nr, volatile void * addr)
+{
+        int     mask, retval;
+        volatile unsigned int *a = addr;
+        unsigned long tmp;
+
+        a += nr >> 5;
+        mask = 1 << (nr & 0x1f);
+
+        __asm__ __volatile__ (
+                "   .align 2              \n\t"
+                "   mova    1f,   r0      \n\t" /* r0 = end point */
+                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+                "   mov   #-14,   r15     \n\t" /* LOGIN */
+                "   mov.l  @%2,   %0      \n\t" /* load old value */
+                "   mov     %0,   %1      \n\t" /* %1 = *a */
+                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
+                "   mov    #-1,   %1      \n\t" /* retvat = -1 */
+                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
+                "   xor     %3,   %0      \n\t"
+                "   mov.l   %0,  @%2      \n\t" /* store new value */
+                "1: mov     r1,   r15     \n\t" /* LOGOUT */
+                : "=&r" (tmp),
+                  "=&r" (retval),
+                  "+r"  (a)
+                : "r"   (mask)
+                : "memory" , "r0", "r1", "t");
+
+        return retval;
+}
+#endif /* __ASM_SH_BITOPS_GRB_H */
diff --git a/arch/sh/include/asm/bitops-irq.h b/arch/sh/include/asm/bitops-irq.h
new file mode 100644 (file)
index 0000000..653a127
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef __ASM_SH_BITOPS_IRQ_H
+#define __ASM_SH_BITOPS_IRQ_H
+
+static inline void set_bit(int nr, volatile void *addr)
+{
+       int     mask;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       *a |= mask;
+       local_irq_restore(flags);
+}
+
+static inline void clear_bit(int nr, volatile void *addr)
+{
+       int     mask;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       *a &= ~mask;
+       local_irq_restore(flags);
+}
+
+static inline void change_bit(int nr, volatile void *addr)
+{
+       int     mask;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       *a ^= mask;
+       local_irq_restore(flags);
+}
+
+static inline int test_and_set_bit(int nr, volatile void *addr)
+{
+       int     mask, retval;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       retval = (mask & *a) != 0;
+       *a |= mask;
+       local_irq_restore(flags);
+
+       return retval;
+}
+
+static inline int test_and_clear_bit(int nr, volatile void *addr)
+{
+       int     mask, retval;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       retval = (mask & *a) != 0;
+       *a &= ~mask;
+       local_irq_restore(flags);
+
+       return retval;
+}
+
+static inline int test_and_change_bit(int nr, volatile void *addr)
+{
+       int     mask, retval;
+       volatile unsigned int *a = addr;
+       unsigned long flags;
+
+       a += nr >> 5;
+       mask = 1 << (nr & 0x1f);
+       local_irq_save(flags);
+       retval = (mask & *a) != 0;
+       *a ^= mask;
+       local_irq_restore(flags);
+
+       return retval;
+}
+
+#endif /* __ASM_SH_BITOPS_IRQ_H */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..d7d382f
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef __ASM_SH_BITOPS_H
+#define __ASM_SH_BITOPS_H
+
+#ifdef __KERNEL__
+
+#ifndef _LINUX_BITOPS_H
+#error only <linux/bitops.h> can be included directly
+#endif
+
+#include <asm/system.h>
+/* For __swab32 */
+#include <asm/byteorder.h>
+
+#ifdef CONFIG_GUSA_RB
+#include <asm/bitops-grb.h>
+#else
+#include <asm/bitops-irq.h>
+#endif
+
+
+/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit()     barrier()
+#define smp_mb__after_clear_bit()      barrier()
+
+#include <asm-generic/bitops/non-atomic.h>
+
+#ifdef CONFIG_SUPERH32
+static inline unsigned long ffz(unsigned long word)
+{
+       unsigned long result;
+
+       __asm__("1:\n\t"
+               "shlr   %1\n\t"
+               "bt/s   1b\n\t"
+               " add   #1, %0"
+               : "=r" (result), "=r" (word)
+               : "0" (~0L), "1" (word)
+               : "t");
+       return result;
+}
+
+/**
+ * __ffs - find first bit in word.
+ * @word: The word to search
+ *
+ * Undefined if no bit exists, so code should check against 0 first.
+ */
+static inline unsigned long __ffs(unsigned long word)
+{
+       unsigned long result;
+
+       __asm__("1:\n\t"
+               "shlr   %1\n\t"
+               "bf/s   1b\n\t"
+               " add   #1, %0"
+               : "=r" (result), "=r" (word)
+               : "0" (~0L), "1" (word)
+               : "t");
+       return result;
+}
+#else
+static inline unsigned long ffz(unsigned long word)
+{
+       unsigned long result, __d2, __d3;
+
+        __asm__("gettr  tr0, %2\n\t"
+                "pta    $+32, tr0\n\t"
+                "andi   %1, 1, %3\n\t"
+                "beq    %3, r63, tr0\n\t"
+                "pta    $+4, tr0\n"
+                "0:\n\t"
+                "shlri.l        %1, 1, %1\n\t"
+                "addi   %0, 1, %0\n\t"
+                "andi   %1, 1, %3\n\t"
+                "beqi   %3, 1, tr0\n"
+                "1:\n\t"
+                "ptabs  %2, tr0\n\t"
+                : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3)
+                : "0" (0L), "1" (word));
+
+       return result;
+}
+
+#include <asm-generic/bitops/__ffs.h>
+#endif
+
+#include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/ffs.h>
+#include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
+#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/ext2-non-atomic.h>
+#include <asm-generic/bitops/ext2-atomic.h>
+#include <asm-generic/bitops/minix.h>
+#include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
+#include <asm-generic/bitops/fls64.h>
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_BITOPS_H */
diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
new file mode 100644 (file)
index 0000000..c017180
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef __ASM_SH_BUG_H
+#define __ASM_SH_BUG_H
+
+#define TRAPA_BUG_OPCODE       0xc33e  /* trapa #0x3e */
+
+#ifdef CONFIG_GENERIC_BUG
+#define HAVE_ARCH_BUG
+#define HAVE_ARCH_WARN_ON
+
+/**
+ * _EMIT_BUG_ENTRY
+ * %1 - __FILE__
+ * %2 - __LINE__
+ * %3 - trap type
+ * %4 - sizeof(struct bug_entry)
+ *
+ * The trapa opcode itself sits in %0.
+ * The %O notation is used to avoid # generation.
+ *
+ * The offending file and line are encoded in the __bug_table section.
+ */
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+#define _EMIT_BUG_ENTRY                                \
+       "\t.pushsection __bug_table,\"a\"\n"    \
+       "2:\t.long 1b, %O1\n"                   \
+       "\t.short %O2, %O3\n"                   \
+       "\t.org 2b+%O4\n"                       \
+       "\t.popsection\n"
+#else
+#define _EMIT_BUG_ENTRY                                \
+       "\t.pushsection __bug_table,\"a\"\n"    \
+       "2:\t.long 1b\n"                        \
+       "\t.short %O3\n"                        \
+       "\t.org 2b+%O4\n"                       \
+       "\t.popsection\n"
+#endif
+
+#define BUG()                                          \
+do {                                                   \
+       __asm__ __volatile__ (                          \
+               "1:\t.short %O0\n"                      \
+               _EMIT_BUG_ENTRY                         \
+                :                                      \
+                : "n" (TRAPA_BUG_OPCODE),              \
+                  "i" (__FILE__),                      \
+                  "i" (__LINE__), "i" (0),             \
+                  "i" (sizeof(struct bug_entry)));     \
+} while (0)
+
+#define __WARN()                                       \
+do {                                                   \
+       __asm__ __volatile__ (                          \
+               "1:\t.short %O0\n"                      \
+                _EMIT_BUG_ENTRY                        \
+                :                                      \
+                : "n" (TRAPA_BUG_OPCODE),              \
+                  "i" (__FILE__),                      \
+                  "i" (__LINE__),                      \
+                  "i" (BUGFLAG_WARNING),               \
+                  "i" (sizeof(struct bug_entry)));     \
+} while (0)
+
+#define WARN_ON(x) ({                                          \
+       int __ret_warn_on = !!(x);                              \
+       if (__builtin_constant_p(__ret_warn_on)) {              \
+               if (__ret_warn_on)                              \
+                       __WARN();                               \
+       } else {                                                \
+               if (unlikely(__ret_warn_on))                    \
+                       __WARN();                               \
+       }                                                       \
+       unlikely(__ret_warn_on);                                \
+})
+
+#endif /* CONFIG_GENERIC_BUG */
+
+#include <asm-generic/bug.h>
+
+#endif /* __ASM_SH_BUG_H */
diff --git a/arch/sh/include/asm/bugs.h b/arch/sh/include/asm/bugs.h
new file mode 100644 (file)
index 0000000..121b2ec
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef __ASM_SH_BUGS_H
+#define __ASM_SH_BUGS_H
+
+/*
+ * This is included by init/main.c to check for architecture-dependent bugs.
+ *
+ * Needs:
+ *     void check_bugs(void);
+ */
+
+/*
+ * I don't know of any Super-H bugs yet.
+ */
+
+#include <asm/processor.h>
+
+static void __init check_bugs(void)
+{
+       extern unsigned long loops_per_jiffy;
+       char *p = &init_utsname()->machine[2]; /* "sh" */
+
+       current_cpu_data.loops_per_jiffy = loops_per_jiffy;
+
+       switch (current_cpu_data.type) {
+       case CPU_SH7619:
+               *p++ = '2';
+               break;
+       case CPU_SH7203 ... CPU_MXG:
+               *p++ = '2';
+               *p++ = 'a';
+               break;
+       case CPU_SH7705 ... CPU_SH7729:
+               *p++ = '3';
+               break;
+       case CPU_SH7750 ... CPU_SH4_501:
+               *p++ = '4';
+               break;
+       case CPU_SH7763 ... CPU_SHX3:
+               *p++ = '4';
+               *p++ = 'a';
+               break;
+       case CPU_SH7343 ... CPU_SH7366:
+               *p++ = '4';
+               *p++ = 'a';
+               *p++ = 'l';
+               *p++ = '-';
+               *p++ = 'd';
+               *p++ = 's';
+               *p++ = 'p';
+               break;
+       case CPU_SH5_101 ... CPU_SH5_103:
+               *p++ = '6';
+               *p++ = '4';
+               break;
+       case CPU_SH_NONE:
+               /*
+                * Specifically use CPU_SH_NONE rather than default:,
+                * so we're able to have the compiler whine about
+                * unhandled enumerations.
+                */
+               break;
+       }
+
+       printk("CPU: %s\n", get_cpu_subtype(&current_cpu_data));
+
+#ifndef __LITTLE_ENDIAN__
+       /* 'eb' means 'Endian Big' */
+       *p++ = 'e';
+       *p++ = 'b';
+#endif
+       *p = '\0';
+}
+#endif /* __ASM_SH_BUGS_H */
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h
new file mode 100644 (file)
index 0000000..4c13e61
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef __ASM_SH_BYTEORDER_H
+#define __ASM_SH_BYTEORDER_H
+
+/*
+ * Copyright (C) 1999  Niibe Yutaka
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ */
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+       __asm__(
+#ifdef __SH5__
+               "byterev        %0, %0\n\t"
+               "shari          %0, 32, %0"
+#else
+               "swap.b         %0, %0\n\t"
+               "swap.w         %0, %0\n\t"
+               "swap.b         %0, %0"
+#endif
+               : "=r" (x)
+               : "0" (x));
+
+       return x;
+}
+
+static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
+{
+       __asm__(
+#ifdef __SH5__
+               "byterev        %0, %0\n\t"
+               "shari          %0, 32, %0"
+#else
+               "swap.b         %0, %0"
+#endif
+               : "=r" (x)
+               :  "0" (x));
+
+       return x;
+}
+
+static inline __u64 ___arch__swab64(__u64 val)
+{
+       union {
+               struct { __u32 a,b; } s;
+               __u64 u;
+       } v, w;
+       v.u = val;
+       w.s.b = ___arch__swab32(v.s.a);
+       w.s.a = ___arch__swab32(v.s.b);
+       return w.u;
+}
+
+#define __arch__swab64(x) ___arch__swab64(x)
+#define __arch__swab32(x) ___arch__swab32(x)
+#define __arch__swab16(x) ___arch__swab16(x)
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#  define __BYTEORDER_HAS_U64__
+#  define __SWAB_64_THRU_32__
+#endif
+
+#ifdef __LITTLE_ENDIAN__
+#include <linux/byteorder/little_endian.h>
+#else
+#include <linux/byteorder/big_endian.h>
+#endif
+
+#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h
new file mode 100644 (file)
index 0000000..02df18e
--- /dev/null
@@ -0,0 +1,51 @@
+/* $Id: cache.h,v 1.6 2004/03/11 18:08:05 lethal Exp $
+ *
+ * include/asm-sh/cache.h
+ *
+ * Copyright 1999 (C) Niibe Yutaka
+ * Copyright 2002, 2003 (C) Paul Mundt
+ */
+#ifndef __ASM_SH_CACHE_H
+#define __ASM_SH_CACHE_H
+#ifdef __KERNEL__
+
+#include <linux/init.h>
+#include <cpu/cache.h>
+
+#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
+
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
+#ifndef __ASSEMBLY__
+struct cache_info {
+       unsigned int ways;              /* Number of cache ways */
+       unsigned int sets;              /* Number of cache sets */
+       unsigned int linesz;            /* Cache line size (bytes) */
+
+       unsigned int way_size;          /* sets * line size */
+
+       /*
+        * way_incr is the address offset for accessing the next way
+        * in memory mapped cache array ops.
+        */
+       unsigned int way_incr;
+       unsigned int entry_shift;
+       unsigned int entry_mask;
+
+       /*
+        * Compute a mask which selects the address bits which overlap between
+        * 1. those used to select the cache set during indexing
+        * 2. those in the physical page number.
+        */
+       unsigned int alias_mask;
+
+       unsigned int n_aliases;         /* Number of aliases */
+
+       unsigned long flags;
+};
+
+int __init detect_cpu_and_cache_system(void);
+
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_CACHE_H */
diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..09acbc3
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef __ASM_SH_CACHEFLUSH_H
+#define __ASM_SH_CACHEFLUSH_H
+
+#ifdef __KERNEL__
+
+#ifdef CONFIG_CACHE_OFF
+/*
+ * Nothing to do when the cache is disabled, initial flush and explicit
+ * disabling is handled at CPU init time.
+ *
+ * See arch/sh/kernel/cpu/init.c:cache_init().
+ */
+#define p3_cache_init()                                do { } while (0)
+#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_icache_range(start, end)         do { } while (0)
+#define flush_icache_page(vma,pg)              do { } while (0)
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+#define flush_cache_sigtramp(vaddr)            do { } while (0)
+#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
+#define __flush_wback_region(start, size)      do { (void)(start); } while (0)
+#define __flush_purge_region(start, size)      do { (void)(start); } while (0)
+#define __flush_invalidate_region(start, size) do { (void)(start); } while (0)
+#else
+#include <cpu/cacheflush.h>
+
+/*
+ * Consistent DMA requires that the __flush_xxx() primitives must be set
+ * for any of the enabled non-coherent caches (most of the UP CPUs),
+ * regardless of PIPT or VIPT cache configurations.
+ */
+
+/* Flush (write-back only) a region (smaller than a page) */
+extern void __flush_wback_region(void *start, int size);
+/* Flush (write-back & invalidate) a region (smaller than a page) */
+extern void __flush_purge_region(void *start, int size);
+/* Flush (invalidate only) a region (smaller than a page) */
+extern void __flush_invalidate_region(void *start, int size);
+#endif
+
+#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+static inline void flush_kernel_dcache_page(struct page *page)
+{
+       flush_dcache_page(page);
+}
+
+#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
+extern void copy_to_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len);
+
+extern void copy_from_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len);
+#else
+#define copy_to_user_page(vma, page, vaddr, dst, src, len)     \
+       do {                                                    \
+               flush_cache_page(vma, vaddr, page_to_pfn(page));\
+               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)   \
+       do {                                                    \
+               flush_cache_page(vma, vaddr, page_to_pfn(page));\
+               memcpy(dst, src, len);                          \
+       } while (0)
+#endif
+
+#define flush_cache_vmap(start, end)           flush_cache_all()
+#define flush_cache_vunmap(start, end)         flush_cache_all()
+
+#define HAVE_ARCH_UNMAPPED_AREA
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_CACHEFLUSH_H */
diff --git a/arch/sh/include/asm/checksum.h b/arch/sh/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..67496ab
--- /dev/null
@@ -0,0 +1,5 @@
+#ifdef CONFIG_SUPERH32
+# include "checksum_32.h"
+#else
+# include "checksum_64.h"
+#endif
diff --git a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h
new file mode 100644 (file)
index 0000000..14b7ac2
--- /dev/null
@@ -0,0 +1,215 @@
+#ifndef __ASM_SH_CHECKSUM_H
+#define __ASM_SH_CHECKSUM_H
+
+/*
+ * 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) 1999 by Kaz Kojima & Niibe Yutaka
+ */
+
+#include <linux/in6.h>
+
+/*
+ * 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
+ */
+asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
+
+/*
+ * the same as csum_partial, but copies from src while it
+ * checksums, and handles user-space pointer exceptions correctly, when needed.
+ *
+ * here even more important to align src and dst on a 32-bit (or even
+ * better 64-bit) boundary
+ */
+
+asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
+                                           int len, __wsum sum,
+                                           int *src_err_ptr, int *dst_err_ptr);
+
+/*
+ *     Note: when you get a NULL pointer exception here this means someone
+ *     passed in an incorrect kernel address to one of these functions.
+ *
+ *     If you use these functions directly please don't forget the
+ *     access_ok().
+ */
+static inline
+__wsum csum_partial_copy_nocheck(const void *src, void *dst,
+                                int len, __wsum sum)
+{
+       return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
+}
+
+static inline
+__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
+                                  int len, __wsum sum, int *err_ptr)
+{
+       return csum_partial_copy_generic((__force const void *)src, dst,
+                                       len, sum, err_ptr, NULL);
+}
+
+/*
+ *     Fold a partial checksum
+ */
+
+static inline __sum16 csum_fold(__wsum sum)
+{
+       unsigned int __dummy;
+       __asm__("swap.w %0, %1\n\t"
+               "extu.w %0, %0\n\t"
+               "extu.w %1, %1\n\t"
+               "add    %1, %0\n\t"
+               "swap.w %0, %1\n\t"
+               "add    %1, %0\n\t"
+               "not    %0, %0\n\t"
+               : "=r" (sum), "=&r" (__dummy)
+               : "0" (sum)
+               : "t");
+       return (__force __sum16)sum;
+}
+
+/*
+ *     This is a version of ip_compute_csum() optimized for IP headers,
+ *     which always checksum on 4 octet boundaries.
+ *
+ *      i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted
+ *      for linux by * Arnt Gulbrandsen.
+ */
+static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
+{
+       unsigned int sum, __dummy0, __dummy1;
+
+       __asm__ __volatile__(
+               "mov.l  @%1+, %0\n\t"
+               "mov.l  @%1+, %3\n\t"
+               "add    #-2, %2\n\t"
+               "clrt\n\t"
+               "1:\t"
+               "addc   %3, %0\n\t"
+               "movt   %4\n\t"
+               "mov.l  @%1+, %3\n\t"
+               "dt     %2\n\t"
+               "bf/s   1b\n\t"
+               " cmp/eq #1, %4\n\t"
+               "addc   %3, %0\n\t"
+               "addc   %2, %0"     /* Here %2 is 0, add carry-bit */
+       /* Since the input registers which are loaded with iph and ihl
+          are modified, we must also specify them as outputs, or gcc
+          will assume they contain their original values. */
+       : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1)
+       : "1" (iph), "2" (ihl)
+       : "t", "memory");
+
+       return  csum_fold(sum);
+}
+
+static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
+                                       unsigned short len,
+                                       unsigned short proto,
+                                       __wsum sum)
+{
+#ifdef __LITTLE_ENDIAN__
+       unsigned long len_proto = (proto + len) << 8;
+#else
+       unsigned long len_proto = proto + len;
+#endif
+       __asm__("clrt\n\t"
+               "addc   %0, %1\n\t"
+               "addc   %2, %1\n\t"
+               "addc   %3, %1\n\t"
+               "movt   %0\n\t"
+               "add    %1, %0"
+               : "=r" (sum), "=r" (len_proto)
+               : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum)
+               : "t");
+
+       return sum;
+}
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
+                                       unsigned short len,
+                                       unsigned short proto,
+                                       __wsum sum)
+{
+       return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
+}
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+static inline __sum16 ip_compute_csum(const void *buff, int len)
+{
+    return csum_fold(csum_partial(buff, len, 0));
+}
+
+#define _HAVE_ARCH_IPV6_CSUM
+static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
+                                     const struct in6_addr *daddr,
+                                     __u32 len, unsigned short proto,
+                                     __wsum sum)
+{
+       unsigned int __dummy;
+       __asm__("clrt\n\t"
+               "mov.l  @(0,%2), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(4,%2), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(8,%2), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(12,%2), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(0,%3), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(4,%3), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(8,%3), %1\n\t"
+               "addc   %1, %0\n\t"
+               "mov.l  @(12,%3), %1\n\t"
+               "addc   %1, %0\n\t"
+               "addc   %4, %0\n\t"
+               "addc   %5, %0\n\t"
+               "movt   %1\n\t"
+               "add    %1, %0\n"
+               : "=r" (sum), "=&r" (__dummy)
+               : "r" (saddr), "r" (daddr),
+                 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
+               : "t");
+
+       return csum_fold(sum);
+}
+
+/*
+ *     Copy and checksum to user
+ */
+#define HAVE_CSUM_COPY_USER
+static inline __wsum csum_and_copy_to_user(const void *src,
+                                          void __user *dst,
+                                          int len, __wsum sum,
+                                          int *err_ptr)
+{
+       if (access_ok(VERIFY_WRITE, dst, len))
+               return csum_partial_copy_generic((__force const void *)src,
+                                               dst, len, sum, NULL, err_ptr);
+
+       if (len)
+               *err_ptr = -EFAULT;
+
+       return (__force __wsum)-1; /* invalid checksum */
+}
+#endif /* __ASM_SH_CHECKSUM_H */
diff --git a/arch/sh/include/asm/checksum_64.h b/arch/sh/include/asm/checksum_64.h
new file mode 100644 (file)
index 0000000..9c62a03
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef __ASM_SH_CHECKSUM_64_H
+#define __ASM_SH_CHECKSUM_64_H
+
+/*
+ * include/asm-sh/checksum_64.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ *
+ * 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.
+ */
+
+/*
+ * 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
+ */
+asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
+
+/*
+ *     Note: when you get a NULL pointer exception here this means someone
+ *     passed in an incorrect kernel address to one of these functions.
+ *
+ *     If you use these functions directly please don't forget the
+ *     access_ok().
+ */
+
+
+__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len,
+                                      __wsum sum);
+
+__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
+                                        int len, __wsum sum, int *err_ptr);
+
+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;
+}
+
+__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
+
+__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
+                                unsigned short len, unsigned short proto,
+                                __wsum sum);
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
+                                                  unsigned short len,
+                                                  unsigned short proto,
+                                                  __wsum sum)
+{
+       return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
+}
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+static inline __sum16 ip_compute_csum(const void *buff, int len)
+{
+       return csum_fold(csum_partial(buff, len, 0));
+}
+
+#endif /* __ASM_SH_CHECKSUM_64_H */
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
new file mode 100644 (file)
index 0000000..720dfab
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef __ASM_SH_CLOCK_H
+#define __ASM_SH_CLOCK_H
+
+#include <linux/kref.h>
+#include <linux/list.h>
+#include <linux/seq_file.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+struct clk;
+
+struct clk_ops {
+       void (*init)(struct clk *clk);
+       void (*enable)(struct clk *clk);
+       void (*disable)(struct clk *clk);
+       void (*recalc)(struct clk *clk);
+       int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
+       long (*round_rate)(struct clk *clk, unsigned long rate);
+};
+
+struct clk {
+       struct list_head        node;
+       const char              *name;
+       int                     id;
+       struct module           *owner;
+
+       struct clk              *parent;
+       struct clk_ops          *ops;
+
+       struct kref             kref;
+
+       unsigned long           rate;
+       unsigned long           flags;
+       unsigned long           arch_flags;
+};
+
+#define CLK_ALWAYS_ENABLED     (1 << 0)
+#define CLK_RATE_PROPAGATES    (1 << 1)
+
+/* Should be defined by processor-specific code */
+void arch_init_clk_ops(struct clk_ops **, int type);
+
+/* arch/sh/kernel/cpu/clock.c */
+int clk_init(void);
+
+void clk_recalc_rate(struct clk *);
+
+int clk_register(struct clk *);
+void clk_unregister(struct clk *);
+
+static inline int clk_always_enable(const char *id)
+{
+       struct clk *clk;
+       int ret;
+
+       clk = clk_get(NULL, id);
+       if (IS_ERR(clk))
+               return PTR_ERR(clk);
+
+       ret = clk_enable(clk);
+       if (ret)
+               clk_put(clk);
+
+       return ret;
+}
+
+/* the exported API, in addition to clk_set_rate */
+/**
+ * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
+ * @clk: clock source
+ * @rate: desired clock rate in Hz
+ * @algo_id: algorithm id to be passed down to ops->set_rate
+ *
+ * Returns success (0) or negative errno.
+ */
+int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
+
+enum clk_sh_algo_id {
+       NO_CHANGE = 0,
+
+       IUS_N1_N1,
+       IUS_322,
+       IUS_522,
+       IUS_N11,
+
+       SB_N1,
+
+       SB3_N1,
+       SB3_32,
+       SB3_43,
+       SB3_54,
+
+       BP_N1,
+
+       IP_N1,
+};
+#endif /* __ASM_SH_CLOCK_H */
diff --git a/arch/sh/include/asm/cmpxchg-grb.h b/arch/sh/include/asm/cmpxchg-grb.h
new file mode 100644 (file)
index 0000000..e2681ab
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef __ASM_SH_CMPXCHG_GRB_H
+#define __ASM_SH_CMPXCHG_GRB_H
+
+static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
+{
+       unsigned long retval;
+
+       __asm__ __volatile__ (
+               "   .align 2              \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   nop                   \n\t"
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-4,   r15     \n\t" /* LOGIN */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   mov.l   %2,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (retval),
+                 "+r"  (m)
+               : "r"   (val)
+               : "memory", "r0", "r1");
+
+       return retval;
+}
+
+static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
+{
+       unsigned long retval;
+
+       __asm__ __volatile__ (
+               "   .align  2             \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-6,   r15     \n\t" /* LOGIN */
+               "   mov.b  @%1,   %0      \n\t" /* load  old value */
+               "   extu.b  %0,   %0      \n\t" /* extend as unsigned */
+               "   mov.b   %2,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (retval),
+                 "+r"  (m)
+               : "r"   (val)
+               : "memory" , "r0", "r1");
+
+       return retval;
+}
+
+static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
+                                         unsigned long new)
+{
+       unsigned long retval;
+
+       __asm__ __volatile__ (
+               "   .align  2             \n\t"
+               "   mova    1f,   r0      \n\t" /* r0 = end point */
+               "   nop                   \n\t"
+               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
+               "   mov    #-8,   r15     \n\t" /* LOGIN */
+               "   mov.l  @%1,   %0      \n\t" /* load  old value */
+               "   cmp/eq  %0,   %2      \n\t"
+               "   bf            1f      \n\t" /* if not equal */
+               "   mov.l   %2,   @%1     \n\t" /* store new value */
+               "1: mov     r1,   r15     \n\t" /* LOGOUT */
+               : "=&r" (retval),
+                 "+r"  (m)
+               : "r"   (new)
+               : "memory" , "r0", "r1", "t");
+
+       return retval;
+}
+
+#endif /* __ASM_SH_CMPXCHG_GRB_H */
diff --git a/arch/sh/include/asm/cmpxchg-irq.h b/arch/sh/include/asm/cmpxchg-irq.h
new file mode 100644 (file)
index 0000000..43049ec
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef __ASM_SH_CMPXCHG_IRQ_H
+#define __ASM_SH_CMPXCHG_IRQ_H
+
+static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
+{
+       unsigned long flags, retval;
+
+       local_irq_save(flags);
+       retval = *m;
+       *m = val;
+       local_irq_restore(flags);
+       return retval;
+}
+
+static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
+{
+       unsigned long flags, retval;
+
+       local_irq_save(flags);
+       retval = *m;
+       *m = val & 0xff;
+       local_irq_restore(flags);
+       return retval;
+}
+
+static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
+       unsigned long new)
+{
+       __u32 retval;
+       unsigned long flags;
+
+       local_irq_save(flags);
+       retval = *m;
+       if (retval == old)
+               *m = new;
+       local_irq_restore(flags);       /* implies memory barrier  */
+       return retval;
+}
+
+#endif /* __ASM_SH_CMPXCHG_IRQ_H */
diff --git a/arch/sh/include/asm/cpu-features.h b/arch/sh/include/asm/cpu-features.h
new file mode 100644 (file)
index 0000000..86308aa
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __ASM_SH_CPU_FEATURES_H
+#define __ASM_SH_CPU_FEATURES_H
+
+/*
+ * Processor flags
+ *
+ * Note: When adding a new flag, keep cpu_flags[] in
+ * arch/sh/kernel/setup.c in sync so symbolic name
+ * mapping of the processor flags has a chance of being
+ * reasonably accurate.
+ *
+ * These flags are also available through the ELF
+ * auxiliary vector as AT_HWCAP.
+ */
+#define CPU_HAS_FPU            0x0001  /* Hardware FPU support */
+#define CPU_HAS_P2_FLUSH_BUG   0x0002  /* Need to flush the cache in P2 area */
+#define CPU_HAS_MMU_PAGE_ASSOC 0x0004  /* SH3: TLB way selection bit support */
+#define CPU_HAS_DSP            0x0008  /* SH-DSP: DSP support */
+#define CPU_HAS_PERF_COUNTER   0x0010  /* Hardware performance counters */
+#define CPU_HAS_PTEA           0x0020  /* PTEA register */
+#define CPU_HAS_LLSC           0x0040  /* movli.l/movco.l */
+#define CPU_HAS_L2_CACHE       0x0080  /* Secondary cache / URAM */
+#define CPU_HAS_OP32           0x0100  /* 32-bit instruction support */
+
+#endif /* __ASM_SH_CPU_FEATURES_H */
diff --git a/arch/sh/include/asm/cputime.h b/arch/sh/include/asm/cputime.h
new file mode 100644 (file)
index 0000000..6ca395d
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __SH_CPUTIME_H
+#define __SH_CPUTIME_H
+
+#include <asm-generic/cputime.h>
+
+#endif /* __SH_CPUTIME_H */
diff --git a/arch/sh/include/asm/current.h b/arch/sh/include/asm/current.h
new file mode 100644 (file)
index 0000000..62b6388
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __ASM_SH_CURRENT_H
+#define __ASM_SH_CURRENT_H
+
+/*
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ */
+
+#include <linux/thread_info.h>
+
+struct task_struct;
+
+static __inline__ struct task_struct * get_current(void)
+{
+       return current_thread_info()->task;
+}
+
+#define current get_current()
+
+#endif /* __ASM_SH_CURRENT_H */
diff --git a/arch/sh/include/asm/delay.h b/arch/sh/include/asm/delay.h
new file mode 100644 (file)
index 0000000..4b16bf9
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __ASM_SH_DELAY_H
+#define __ASM_SH_DELAY_H
+
+/*
+ * Copyright (C) 1993 Linus Torvalds
+ *
+ * Delay routines calling functions in arch/sh/lib/delay.c
+ */
+
+extern void __bad_udelay(void);
+extern void __bad_ndelay(void);
+
+extern void __udelay(unsigned long usecs);
+extern void __ndelay(unsigned long nsecs);
+extern void __const_udelay(unsigned long xloops);
+extern void __delay(unsigned long loops);
+
+#define udelay(n) (__builtin_constant_p(n) ? \
+       ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
+       __udelay(n))
+
+#define ndelay(n) (__builtin_constant_p(n) ? \
+       ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
+       __ndelay(n))
+
+#endif /* __ASM_SH_DELAY_H */
diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h
new file mode 100644 (file)
index 0000000..efd511d
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Arch specific extensions to struct device
+ *
+ * This file is released under the GPLv2
+ */
+#include <asm-generic/device.h>
+
+struct platform_device;
+/* allocate contiguous memory chunk and fill in struct resource */
+int platform_resource_setup_memory(struct platform_device *pdev,
+                                  char *name, unsigned long memsize);
+
diff --git a/arch/sh/include/asm/div64.h b/arch/sh/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/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..627315e
--- /dev/null
@@ -0,0 +1,193 @@
+#ifndef __ASM_SH_DMA_MAPPING_H
+#define __ASM_SH_DMA_MAPPING_H
+
+#include <linux/mm.h>
+#include <linux/scatterlist.h>
+#include <asm/cacheflush.h>
+#include <asm/io.h>
+#include <asm-generic/dma-coherent.h>
+
+extern struct bus_type pci_bus_type;
+
+#define dma_supported(dev, mask)       (1)
+
+static inline int dma_set_mask(struct device *dev, u64 mask)
+{
+       if (!dev->dma_mask || !dma_supported(dev, mask))
+               return -EIO;
+
+       *dev->dma_mask = mask;
+
+       return 0;
+}
+
+void *dma_alloc_coherent(struct device *dev, size_t size,
+                        dma_addr_t *dma_handle, gfp_t flag);
+
+void dma_free_coherent(struct device *dev, size_t size,
+                      void *vaddr, dma_addr_t dma_handle);
+
+void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+                   enum dma_data_direction dir);
+
+#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)
+
+static inline dma_addr_t dma_map_single(struct device *dev,
+                                       void *ptr, size_t size,
+                                       enum dma_data_direction dir)
+{
+#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
+       if (dev->bus == &pci_bus_type)
+               return virt_to_phys(ptr);
+#endif
+       dma_cache_sync(dev, ptr, size, dir);
+
+       return virt_to_phys(ptr);
+}
+
+#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
+
+static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
+                            int nents, enum dma_data_direction dir)
+{
+       int i;
+
+       for (i = 0; i < nents; i++) {
+#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
+               dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
+#endif
+               sg[i].dma_address = sg_phys(&sg[i]);
+       }
+
+       return nents;
+}
+
+#define dma_unmap_sg(dev, sg, nents, dir)      do { } while (0)
+
+static inline dma_addr_t 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, dir);
+}
+
+static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
+                                 size_t size, enum dma_data_direction dir)
+{
+       dma_unmap_single(dev, dma_address, size, dir);
+}
+
+static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
+                                  size_t size, enum dma_data_direction dir)
+{
+#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
+       if (dev->bus == &pci_bus_type)
+               return;
+#endif
+       dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir);
+}
+
+static inline void dma_sync_single_range(struct device *dev,
+                                        dma_addr_t dma_handle,
+                                        unsigned long offset, size_t size,
+                                        enum dma_data_direction dir)
+{
+#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
+       if (dev->bus == &pci_bus_type)
+               return;
+#endif
+       dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
+}
+
+static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
+                              int nelems, enum dma_data_direction dir)
+{
+       int i;
+
+       for (i = 0; i < nelems; i++) {
+#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
+               dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
+#endif
+               sg[i].dma_address = sg_phys(&sg[i]);
+       }
+}
+
+static inline void dma_sync_single_for_cpu(struct device *dev,
+                                          dma_addr_t dma_handle, size_t size,
+                                          enum dma_data_direction dir)
+{
+       dma_sync_single(dev, dma_handle, size, dir);
+}
+
+static inline void dma_sync_single_for_device(struct device *dev,
+                                             dma_addr_t dma_handle,
+                                             size_t size,
+                                             enum dma_data_direction dir)
+{
+       dma_sync_single(dev, dma_handle, size, dir);
+}
+
+static inline void dma_sync_single_range_for_cpu(struct device *dev,
+                                                dma_addr_t dma_handle,
+                                                unsigned long offset,
+                                                size_t size,
+                                                enum dma_data_direction direction)
+{
+       dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
+}
+
+static inline void dma_sync_single_range_for_device(struct device *dev,
+                                                   dma_addr_t dma_handle,
+                                                   unsigned long offset,
+                                                   size_t size,
+                                                   enum dma_data_direction direction)
+{
+       dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
+}
+
+
+static inline void dma_sync_sg_for_cpu(struct device *dev,
+                                      struct scatterlist *sg, int nelems,
+                                      enum dma_data_direction dir)
+{
+       dma_sync_sg(dev, sg, nelems, dir);
+}
+
+static inline void dma_sync_sg_for_device(struct device *dev,
+                                         struct scatterlist *sg, int nelems,
+                                         enum dma_data_direction dir)
+{
+       dma_sync_sg(dev, sg, nelems, dir);
+}
+
+
+static inline int dma_get_cache_alignment(void)
+{
+       /*
+        * Each processor family will define its own L1_CACHE_SHIFT,
+        * L1_CACHE_BYTES wraps to this, so this is always safe.
+        */
+       return L1_CACHE_BYTES;
+}
+
+static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+       return dma_addr == 0;
+}
+
+#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
+
+extern int
+dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
+                           dma_addr_t device_addr, size_t size, int flags);
+
+extern void
+dma_release_declared_memory(struct device *dev);
+
+extern void *
+dma_mark_declared_memory_occupied(struct device *dev,
+                                 dma_addr_t device_addr, size_t size);
+
+#endif /* __ASM_SH_DMA_MAPPING_H */
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
new file mode 100644 (file)
index 0000000..beca712
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * include/asm-sh/dma.h
+ *
+ * Copyright (C) 2003, 2004  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_DMA_H
+#define __ASM_SH_DMA_H
+#ifdef __KERNEL__
+
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/sysdev.h>
+#include <cpu/dma.h>
+
+/* The maximum address that we can perform a DMA transfer to on this platform */
+/* Don't define MAX_DMA_ADDRESS; it's useless on the SuperH and any
+   occurrence should be flagged as an error.  */
+/* But... */
+/* XXX: This is not applicable to SuperH, just needed for alloc_bootmem */
+#define MAX_DMA_ADDRESS                (PAGE_OFFSET+0x10000000)
+
+#ifdef CONFIG_NR_DMA_CHANNELS
+#  define MAX_DMA_CHANNELS     (CONFIG_NR_DMA_CHANNELS)
+#else
+#  define MAX_DMA_CHANNELS     (CONFIG_NR_ONCHIP_DMA_CHANNELS)
+#endif
+
+/*
+ * Read and write modes can mean drastically different things depending on the
+ * channel configuration. Consult your DMAC documentation and module
+ * implementation for further clues.
+ */
+#define DMA_MODE_READ          0x00
+#define DMA_MODE_WRITE         0x01
+#define DMA_MODE_MASK          0x01
+
+#define DMA_AUTOINIT           0x10
+
+/*
+ * DMAC (dma_info) flags
+ */
+enum {
+       DMAC_CHANNELS_CONFIGURED        = 0x01,
+       DMAC_CHANNELS_TEI_CAPABLE       = 0x02, /* Transfer end interrupt */
+};
+
+/*
+ * DMA channel capabilities / flags
+ */
+enum {
+       DMA_CONFIGURED                  = 0x01,
+
+       /*
+        * Transfer end interrupt, inherited from DMAC.
+        * wait_queue used in dma_wait_for_completion.
+        */
+       DMA_TEI_CAPABLE                 = 0x02,
+};
+
+extern spinlock_t dma_spin_lock;
+
+struct dma_channel;
+
+struct dma_ops {
+       int (*request)(struct dma_channel *chan);
+       void (*free)(struct dma_channel *chan);
+
+       int (*get_residue)(struct dma_channel *chan);
+       int (*xfer)(struct dma_channel *chan);
+       int (*configure)(struct dma_channel *chan, unsigned long flags);
+       int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
+};
+
+struct dma_channel {
+       char dev_id[16];                /* unique name per DMAC of channel */
+
+       unsigned int chan;              /* DMAC channel number */
+       unsigned int vchan;             /* Virtual channel number */
+
+       unsigned int mode;
+       unsigned int count;
+
+       unsigned long sar;
+       unsigned long dar;
+
+       const char **caps;
+
+       unsigned long flags;
+       atomic_t busy;
+
+       wait_queue_head_t wait_queue;
+
+       struct sys_device dev;
+       void *priv_data;
+};
+
+struct dma_info {
+       struct platform_device *pdev;
+
+       const char *name;
+       unsigned int nr_channels;
+       unsigned long flags;
+
+       struct dma_ops *ops;
+       struct dma_channel *channels;
+
+       struct list_head list;
+       int first_channel_nr;
+       int first_vchannel_nr;
+};
+
+struct dma_chan_caps {
+       int ch_num;
+       const char **caplist;
+};
+
+#define to_dma_channel(channel) container_of(channel, struct dma_channel, dev)
+
+/* arch/sh/drivers/dma/dma-api.c */
+extern int dma_xfer(unsigned int chan, unsigned long from,
+                   unsigned long to, size_t size, unsigned int mode);
+
+#define dma_write(chan, from, to, size)        \
+       dma_xfer(chan, from, to, size, DMA_MODE_WRITE)
+#define dma_write_page(chan, from, to) \
+       dma_write(chan, from, to, PAGE_SIZE)
+
+#define dma_read(chan, from, to, size) \
+       dma_xfer(chan, from, to, size, DMA_MODE_READ)
+#define dma_read_page(chan, from, to)  \
+       dma_read(chan, from, to, PAGE_SIZE)
+
+extern int request_dma_bycap(const char **dmac, const char **caps,
+                            const char *dev_id);
+extern int request_dma(unsigned int chan, const char *dev_id);
+extern void free_dma(unsigned int chan);
+extern int get_dma_residue(unsigned int chan);
+extern struct dma_info *get_dma_info(unsigned int chan);
+extern struct dma_channel *get_dma_channel(unsigned int chan);
+extern void dma_wait_for_completion(unsigned int chan);
+extern void dma_configure_channel(unsigned int chan, unsigned long flags);
+
+extern int register_dmac(struct dma_info *info);
+extern void unregister_dmac(struct dma_info *info);
+extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
+
+extern int dma_extend(unsigned int chan, unsigned long op, void *param);
+extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
+
+/* arch/sh/drivers/dma/dma-sysfs.c */
+extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);
+extern void dma_remove_sysfs_files(struct dma_channel *, struct dma_info *);
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy   (0)
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_DMA_H */
diff --git a/arch/sh/include/asm/dmabrg.h b/arch/sh/include/asm/dmabrg.h
new file mode 100644 (file)
index 0000000..c5edba2
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SH7760 DMABRG (USB/Audio) support
+ */
+
+#ifndef _DMABRG_H_
+#define _DMABRG_H_
+
+/* IRQ sources */
+#define DMABRGIRQ_USBDMA       0
+#define DMABRGIRQ_USBDMAERR    1
+#define DMABRGIRQ_A0TXF                2
+#define DMABRGIRQ_A0TXH                3
+#define DMABRGIRQ_A0RXF                4
+#define DMABRGIRQ_A0RXH                5
+#define DMABRGIRQ_A1TXF                6
+#define DMABRGIRQ_A1TXH                7
+#define DMABRGIRQ_A1RXF                8
+#define DMABRGIRQ_A1RXH                9
+
+extern int dmabrg_request_irq(unsigned int, void(*)(void *), void *);
+extern void dmabrg_free_irq(unsigned int);
+
+#endif
diff --git a/arch/sh/include/asm/edosk7705.h b/arch/sh/include/asm/edosk7705.h
new file mode 100644 (file)
index 0000000..5bdc9d9
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * include/asm-sh/edosk7705.h
+ *
+ * Modified version of io_se.h for the EDOSK7705 specific functions.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * IO functions for an Hitachi EDOSK7705 development board
+ */
+
+#ifndef __ASM_SH_EDOSK7705_IO_H
+#define __ASM_SH_EDOSK7705_IO_H
+
+#include <asm/io_generic.h>
+
+extern unsigned char sh_edosk7705_inb(unsigned long port);
+extern unsigned int sh_edosk7705_inl(unsigned long port);
+
+extern void sh_edosk7705_outb(unsigned char value, unsigned long port);
+extern void sh_edosk7705_outl(unsigned int value, unsigned long port);
+
+extern void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count);
+extern void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count);
+extern void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count);
+extern void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count);
+
+extern unsigned long sh_edosk7705_isa_port2addr(unsigned long offset);
+
+#endif /* __ASM_SH_EDOSK7705_IO_H */
diff --git a/arch/sh/include/asm/elf.h b/arch/sh/include/asm/elf.h
new file mode 100644 (file)
index 0000000..f01449a
--- /dev/null
@@ -0,0 +1,244 @@
+#ifndef __ASM_SH_ELF_H
+#define __ASM_SH_ELF_H
+
+#include <linux/utsname.h>
+#include <asm/auxvec.h>
+#include <asm/ptrace.h>
+#include <asm/user.h>
+
+/* ELF header e_flags defines */
+#define EF_SH_PIC              0x100   /* -fpic */
+#define EF_SH_FDPIC            0x8000  /* -mfdpic */
+
+/* SH (particularly SHcompact) relocation types  */
+#define        R_SH_NONE               0
+#define        R_SH_DIR32              1
+#define        R_SH_REL32              2
+#define        R_SH_DIR8WPN            3
+#define        R_SH_IND12W             4
+#define        R_SH_DIR8WPL            5
+#define        R_SH_DIR8WPZ            6
+#define        R_SH_DIR8BP             7
+#define        R_SH_DIR8W              8
+#define        R_SH_DIR8L              9
+#define        R_SH_SWITCH16           25
+#define        R_SH_SWITCH32           26
+#define        R_SH_USES               27
+#define        R_SH_COUNT              28
+#define        R_SH_ALIGN              29
+#define        R_SH_CODE               30
+#define        R_SH_DATA               31
+#define        R_SH_LABEL              32
+#define        R_SH_SWITCH8            33
+#define        R_SH_GNU_VTINHERIT      34
+#define        R_SH_GNU_VTENTRY        35
+#define        R_SH_TLS_GD_32          144
+#define        R_SH_TLS_LD_32          145
+#define        R_SH_TLS_LDO_32         146
+#define        R_SH_TLS_IE_32          147
+#define        R_SH_TLS_LE_32          148
+#define        R_SH_TLS_DTPMOD32       149
+#define        R_SH_TLS_DTPOFF32       150
+#define        R_SH_TLS_TPOFF32        151
+#define        R_SH_GOT32              160
+#define        R_SH_PLT32              161
+#define        R_SH_COPY               162
+#define        R_SH_GLOB_DAT           163
+#define        R_SH_JMP_SLOT           164
+#define        R_SH_RELATIVE           165
+#define        R_SH_GOTOFF             166
+#define        R_SH_GOTPC              167
+
+/* FDPIC relocs */
+#define R_SH_GOT20             70
+#define R_SH_GOTOFF20          71
+#define R_SH_GOTFUNCDESC       72
+#define R_SH_GOTFUNCDESC20     73
+#define R_SH_GOTOFFFUNCDESC    74
+#define R_SH_GOTOFFFUNCDESC20  75
+#define R_SH_FUNCDESC          76
+#define R_SH_FUNCDESC_VALUE    77
+
+#if 0 /* XXX - later .. */
+#define R_SH_GOT20             198
+#define R_SH_GOTOFF20          199
+#define R_SH_GOTFUNCDESC       200
+#define R_SH_GOTFUNCDESC20     201
+#define R_SH_GOTOFFFUNCDESC    202
+#define R_SH_GOTOFFFUNCDESC20  203
+#define R_SH_FUNCDESC          204
+#define R_SH_FUNCDESC_VALUE    205
+#endif
+
+/* SHmedia relocs */
+#define R_SH_IMM_LOW16         246
+#define R_SH_IMM_LOW16_PCREL   247
+#define R_SH_IMM_MEDLOW16      248
+#define R_SH_IMM_MEDLOW16_PCREL        249
+/* Keep this the last entry.  */
+#define        R_SH_NUM                256
+
+/*
+ * ELF register definitions..
+ */
+
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_fpu_struct elf_fpregset_t;
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS      ELFCLASS32
+#ifdef __LITTLE_ENDIAN__
+#define ELF_DATA       ELFDATA2LSB
+#else
+#define ELF_DATA       ELFDATA2MSB
+#endif
+#define ELF_ARCH       EM_SH
+
+#ifdef __KERNEL__
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x)              ((x)->e_machine == EM_SH)
+#define elf_check_fdpic(x)             ((x)->e_flags & EF_SH_FDPIC)
+#define elf_check_const_displacement(x)        ((x)->e_flags & EF_SH_PIC)
+
+#define USE_ELF_CORE_DUMP
+#define ELF_FDPIC_CORE_EFLAGS  EF_SH_FDPIC
+#define ELF_EXEC_PAGESIZE      PAGE_SIZE
+
+/* 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         (2 * TASK_SIZE / 3)
+
+#define ELF_CORE_COPY_REGS(_dest,_regs)                                \
+       memcpy((char *) &_dest, (char *) _regs,                 \
+              sizeof(struct pt_regs));
+
+/* This yields a mask that user programs can use to figure out what
+   instruction set this CPU supports.  This could be done in user space,
+   but it's not easy, and we've already done it here.  */
+
+#define ELF_HWCAP      (boot_cpu_data.flags)
+
+/* 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.
+
+   For the moment, we have only optimizations for the Intel generations,
+   but that could change... */
+
+#define ELF_PLATFORM   (utsname()->machine)
+
+#ifdef __SH5__
+#define ELF_PLAT_INIT(_r, load_addr) \
+  do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
+       _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
+       _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
+       _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; _r->regs[15]=0; \
+       _r->regs[16]=0; _r->regs[17]=0; _r->regs[18]=0; _r->regs[19]=0; \
+       _r->regs[20]=0; _r->regs[21]=0; _r->regs[22]=0; _r->regs[23]=0; \
+       _r->regs[24]=0; _r->regs[25]=0; _r->regs[26]=0; _r->regs[27]=0; \
+       _r->regs[28]=0; _r->regs[29]=0; _r->regs[30]=0; _r->regs[31]=0; \
+       _r->regs[32]=0; _r->regs[33]=0; _r->regs[34]=0; _r->regs[35]=0; \
+       _r->regs[36]=0; _r->regs[37]=0; _r->regs[38]=0; _r->regs[39]=0; \
+       _r->regs[40]=0; _r->regs[41]=0; _r->regs[42]=0; _r->regs[43]=0; \
+       _r->regs[44]=0; _r->regs[45]=0; _r->regs[46]=0; _r->regs[47]=0; \
+       _r->regs[48]=0; _r->regs[49]=0; _r->regs[50]=0; _r->regs[51]=0; \
+       _r->regs[52]=0; _r->regs[53]=0; _r->regs[54]=0; _r->regs[55]=0; \
+       _r->regs[56]=0; _r->regs[57]=0; _r->regs[58]=0; _r->regs[59]=0; \
+       _r->regs[60]=0; _r->regs[61]=0; _r->regs[62]=0; \
+       _r->tregs[0]=0; _r->tregs[1]=0; _r->tregs[2]=0; _r->tregs[3]=0; \
+       _r->tregs[4]=0; _r->tregs[5]=0; _r->tregs[6]=0; _r->tregs[7]=0; \
+       _r->sr = SR_FD | SR_MMU; } while (0)
+#else
+#define ELF_PLAT_INIT(_r, load_addr) \
+  do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
+       _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
+       _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
+       _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; \
+       _r->sr = SR_FD; } while (0)
+
+#define ELF_FDPIC_PLAT_INIT(_r, _exec_map_addr, _interp_map_addr,      \
+                           _dynamic_addr)                              \
+do {                                                                   \
+       _r->regs[0]     = 0;                                            \
+       _r->regs[1]     = 0;                                            \
+       _r->regs[2]     = 0;                                            \
+       _r->regs[3]     = 0;                                            \
+       _r->regs[4]     = 0;                                            \
+       _r->regs[5]     = 0;                                            \
+       _r->regs[6]     = 0;                                            \
+       _r->regs[7]     = 0;                                            \
+       _r->regs[8]     = _exec_map_addr;                               \
+       _r->regs[9]     = _interp_map_addr;                             \
+       _r->regs[10]    = _dynamic_addr;                                \
+       _r->regs[11]    = 0;                                            \
+       _r->regs[12]    = 0;                                            \
+       _r->regs[13]    = 0;                                            \
+       _r->regs[14]    = 0;                                            \
+       _r->sr          = SR_FD;                                        \
+} while (0)
+#endif
+
+#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT)
+struct task_struct;
+extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
+extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
+
+#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
+#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
+
+#ifdef CONFIG_VSYSCALL
+/* vDSO has arch_setup_additional_pages */
+#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
+struct linux_binprm;
+extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+                                      int executable_stack);
+
+extern unsigned int vdso_enabled;
+extern void __kernel_vsyscall;
+
+#define VDSO_BASE              ((unsigned long)current->mm->context.vdso)
+#define VDSO_SYM(x)            (VDSO_BASE + (unsigned long)(x))
+
+#define VSYSCALL_AUX_ENT                                       \
+       if (vdso_enabled)                                       \
+               NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
+#else
+#define VSYSCALL_AUX_ENT
+#endif /* CONFIG_VSYSCALL */
+
+#ifdef CONFIG_SH_FPU
+#define FPU_AUX_ENT    NEW_AUX_ENT(AT_FPUCW, FPSCR_INIT)
+#else
+#define FPU_AUX_ENT
+#endif
+
+extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;
+
+/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
+#define ARCH_DLINFO                                            \
+do {                                                           \
+       /* Optional FPU initialization */                       \
+       FPU_AUX_ENT;                                            \
+                                                               \
+       /* Optional vsyscall entry */                           \
+       VSYSCALL_AUX_ENT;                                       \
+                                                               \
+       /* Cache desc */                                        \
+       NEW_AUX_ENT(AT_L1I_CACHESHAPE, l1i_cache_shape);        \
+       NEW_AUX_ENT(AT_L1D_CACHESHAPE, l1d_cache_shape);        \
+       NEW_AUX_ENT(AT_L2_CACHESHAPE, l2_cache_shape);          \
+} while (0)
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_ELF_H */
diff --git a/arch/sh/include/asm/emergency-restart.h b/arch/sh/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/sh/include/asm/entry-macros.S b/arch/sh/include/asm/entry-macros.S
new file mode 100644 (file)
index 0000000..2dab0b8
--- /dev/null
@@ -0,0 +1,33 @@
+! entry.S macro define
+       
+       .macro  cli
+       stc     sr, r0
+       or      #0xf0, r0
+       ldc     r0, sr
+       .endm
+
+       .macro  sti
+       mov     #0xf0, r11
+       extu.b  r11, r11
+       not     r11, r11
+       stc     sr, r10
+       and     r11, r10
+#ifdef CONFIG_CPU_HAS_SR_RB
+       stc     k_g_imask, r11
+       or      r11, r10
+#endif
+       ldc     r10, sr
+       .endm
+
+       .macro  get_current_thread_info, ti, tmp
+#ifdef CONFIG_CPU_HAS_SR_RB
+       stc     r7_bank, \ti
+#else
+       mov     #((THREAD_SIZE - 1) >> 10) ^ 0xff, \tmp
+       shll8   \tmp
+       shll2   \tmp
+       mov     r15, \ti
+       and     \tmp, \ti
+#endif 
+       .endm
+
diff --git a/arch/sh/include/asm/errno.h b/arch/sh/include/asm/errno.h
new file mode 100644 (file)
index 0000000..51cf6f9
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_ERRNO_H
+#define __ASM_SH_ERRNO_H
+
+#include <asm-generic/errno.h>
+
+#endif /* __ASM_SH_ERRNO_H */
diff --git a/arch/sh/include/asm/fb.h b/arch/sh/include/asm/fb.h
new file mode 100644 (file)
index 0000000..d92e99c
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _ASM_FB_H_
+#define _ASM_FB_H_
+
+#include <linux/fb.h>
+#include <linux/fs.h>
+#include <asm/page.h>
+
+static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
+                               unsigned long off)
+{
+       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+}
+
+static inline int fb_is_primary_device(struct fb_info *info)
+{
+       return 0;
+}
+
+#endif /* _ASM_FB_H_ */
diff --git a/arch/sh/include/asm/fcntl.h b/arch/sh/include/asm/fcntl.h
new file mode 100644 (file)
index 0000000..46ab12d
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/fcntl.h>
diff --git a/arch/sh/include/asm/fixmap.h b/arch/sh/include/asm/fixmap.h
new file mode 100644 (file)
index 0000000..721fcc4
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ *
+ * 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) 1998 Ingo Molnar
+ *
+ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
+ */
+
+#ifndef _ASM_FIXMAP_H
+#define _ASM_FIXMAP_H
+
+#include <linux/kernel.h>
+#include <asm/page.h>
+#ifdef CONFIG_HIGHMEM
+#include <linux/threads.h>
+#include <asm/kmap_types.h>
+#endif
+
+/*
+ * Here we define all the compile-time 'special' virtual
+ * addresses. The point is to have a constant address at
+ * compile time, but to set the physical address only
+ * in the boot process. We allocate these special  addresses
+ * from the end of P3 backwards.
+ * Also this lets us do fail-safe vmalloc(), we
+ * can guarantee that these special addresses and
+ * vmalloc()-ed addresses never overlap.
+ *
+ * these 'compile-time allocated' memory buffers are
+ * fixed-size 4k pages. (or larger if used with an increment
+ * highger than 1) use fixmap_set(idx,phys) to associate
+ * physical memory with fixmap indices.
+ *
+ * TLB entries of such buffers will not be flushed across
+ * task switches.
+ */
+
+/*
+ * on UP currently we will have no trace of the fixmap mechanizm,
+ * no page table allocations, etc. This might change in the
+ * future, say framebuffers for the console driver(s) could be
+ * fix-mapped?
+ */
+enum fixed_addresses {
+#define FIX_N_COLOURS 16
+       FIX_CMAP_BEGIN,
+       FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
+       FIX_UNCACHED,
+#ifdef CONFIG_HIGHMEM
+       FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
+       FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
+#endif
+       __end_of_fixed_addresses
+};
+
+extern void __set_fixmap(enum fixed_addresses idx,
+                        unsigned long phys, pgprot_t flags);
+
+#define set_fixmap(idx, phys) \
+               __set_fixmap(idx, phys, PAGE_KERNEL)
+/*
+ * Some hardware wants to get fixmapped without caching.
+ */
+#define set_fixmap_nocache(idx, phys) \
+               __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
+/*
+ * used by vmalloc.c.
+ *
+ * Leave one empty page between vmalloc'ed areas and
+ * the start of the fixmap, and leave one page empty
+ * at the top of mem..
+ */
+#ifdef CONFIG_SUPERH32
+#define FIXADDR_TOP    (P4SEG - PAGE_SIZE)
+#else
+#define FIXADDR_TOP    (0xff000000 - PAGE_SIZE)
+#endif
+#define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
+#define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
+
+#define __fix_to_virt(x)       (FIXADDR_TOP - ((x) << PAGE_SHIFT))
+#define __virt_to_fix(x)       ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+
+extern void __this_fixmap_does_not_exist(void);
+
+/*
+ * 'index to address' translation. If anyone tries to use the idx
+ * directly without tranlation, we catch the bug with a NULL-deference
+ * kernel oops. Illegal ranges of incoming indices are caught too.
+ */
+static inline unsigned long fix_to_virt(const unsigned int idx)
+{
+       /*
+        * this branch gets completely eliminated after inlining,
+        * except when someone tries to use fixaddr indices in an
+        * illegal way. (such as mixing up address types or using
+        * out-of-range indices).
+        *
+        * If it doesn't get removed, the linker will complain
+        * loudly with a reasonably clear error message..
+        */
+       if (idx >= __end_of_fixed_addresses)
+               __this_fixmap_does_not_exist();
+
+        return __fix_to_virt(idx);
+}
+
+static inline unsigned long virt_to_fix(const unsigned long vaddr)
+{
+       BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+       return __virt_to_fix(vaddr);
+}
+#endif
diff --git a/arch/sh/include/asm/flat.h b/arch/sh/include/asm/flat.h
new file mode 100644 (file)
index 0000000..0cc8002
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * include/asm-sh/flat.h
+ *
+ * uClinux flat-format executables
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_FLAT_H
+#define __ASM_SH_FLAT_H
+
+#define        flat_stack_align(sp)                    /* nothing needed */
+#define        flat_argvp_envp_on_stack()              0
+#define        flat_old_ram_flag(flags)                (flags)
+#define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
+#define        flat_get_addr_from_rp(rp, relval, flags, p)     get_unaligned(rp)
+#define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
+#define        flat_get_relocate_addr(rel)             (rel)
+#define        flat_set_persistent(relval, p)          ({ (void)p; 0; })
+
+#endif /* __ASM_SH_FLAT_H */
diff --git a/arch/sh/include/asm/fpu.h b/arch/sh/include/asm/fpu.h
new file mode 100644 (file)
index 0000000..91462fe
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __ASM_SH_FPU_H
+#define __ASM_SH_FPU_H
+
+#ifndef __ASSEMBLY__
+#include <linux/preempt.h>
+#include <asm/ptrace.h>
+
+#ifdef CONFIG_SH_FPU
+static inline void release_fpu(struct pt_regs *regs)
+{
+       regs->sr |= SR_FD;
+}
+
+static inline void grab_fpu(struct pt_regs *regs)
+{
+       regs->sr &= ~SR_FD;
+}
+
+struct task_struct;
+
+extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
+#else
+
+#define release_fpu(regs)      do { } while (0)
+#define grab_fpu(regs)         do { } while (0)
+
+static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+}
+#endif
+
+extern int do_fpu_inst(unsigned short, struct pt_regs *);
+
+static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       preempt_disable();
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
+               save_fpu(tsk, regs);
+       preempt_enable();
+}
+
+static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       preempt_disable();
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
+               clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+               release_fpu(regs);
+       }
+       preempt_enable();
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_SH_FPU_H */
diff --git a/arch/sh/include/asm/freq.h b/arch/sh/include/asm/freq.h
new file mode 100644 (file)
index 0000000..4ece90b
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * include/asm-sh/freq.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_FREQ_H
+#define __ASM_SH_FREQ_H
+#ifdef __KERNEL__
+
+#include <cpu/freq.h>
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_FREQ_H */
diff --git a/arch/sh/include/asm/futex-irq.h b/arch/sh/include/asm/futex-irq.h
new file mode 100644 (file)
index 0000000..a9f16a7
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef __ASM_SH_FUTEX_IRQ_H
+#define __ASM_SH_FUTEX_IRQ_H
+
+#include <asm/system.h>
+
+static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr,
+                                          int *oldval)
+{
+       unsigned long flags;
+       int ret;
+
+       local_irq_save(flags);
+
+       ret = get_user(*oldval, uaddr);
+       if (!ret)
+               ret = put_user(oparg, uaddr);
+
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr,
+                                          int *oldval)
+{
+       unsigned long flags;
+       int ret;
+
+       local_irq_save(flags);
+
+       ret = get_user(*oldval, uaddr);
+       if (!ret)
+               ret = put_user(*oldval + oparg, uaddr);
+
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr,
+                                         int *oldval)
+{
+       unsigned long flags;
+       int ret;
+
+       local_irq_save(flags);
+
+       ret = get_user(*oldval, uaddr);
+       if (!ret)
+               ret = put_user(*oldval | oparg, uaddr);
+
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr,
+                                          int *oldval)
+{
+       unsigned long flags;
+       int ret;
+
+       local_irq_save(flags);
+
+       ret = get_user(*oldval, uaddr);
+       if (!ret)
+               ret = put_user(*oldval & oparg, uaddr);
+
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr,
+                                          int *oldval)
+{
+       unsigned long flags;
+       int ret;
+
+       local_irq_save(flags);
+
+       ret = get_user(*oldval, uaddr);
+       if (!ret)
+               ret = put_user(*oldval ^ oparg, uaddr);
+
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr,
+                                                  int oldval, int newval)
+{
+       unsigned long flags;
+       int ret, prev = 0;
+
+       local_irq_save(flags);
+
+       ret = get_user(prev, uaddr);
+       if (!ret && oldval == prev)
+               ret = put_user(newval, uaddr);
+
+       local_irq_restore(flags);
+
+       if (ret)
+               return ret;
+
+       return prev;
+}
+
+#endif /* __ASM_SH_FUTEX_IRQ_H */
diff --git a/arch/sh/include/asm/futex.h b/arch/sh/include/asm/futex.h
new file mode 100644 (file)
index 0000000..68256ec
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef __ASM_SH_FUTEX_H
+#define __ASM_SH_FUTEX_H
+
+#ifdef __KERNEL__
+
+#include <linux/futex.h>
+#include <linux/uaccess.h>
+#include <asm/errno.h>
+
+/* XXX: UP variants, fix for SH-4A and SMP.. */
+#include <asm/futex-irq.h>
+
+static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
+{
+       int op = (encoded_op >> 28) & 7;
+       int cmp = (encoded_op >> 24) & 15;
+       int oparg = (encoded_op << 8) >> 20;
+       int cmparg = (encoded_op << 20) >> 20;
+       int oldval = 0, ret;
+
+       if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
+               oparg = 1 << oparg;
+
+       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
+               return -EFAULT;
+
+       pagefault_disable();
+
+       switch (op) {
+       case FUTEX_OP_SET:
+               ret = atomic_futex_op_xchg_set(oparg, uaddr, &oldval);
+               break;
+       case FUTEX_OP_ADD:
+               ret = atomic_futex_op_xchg_add(oparg, uaddr, &oldval);
+               break;
+       case FUTEX_OP_OR:
+               ret = atomic_futex_op_xchg_or(oparg, uaddr, &oldval);
+               break;
+       case FUTEX_OP_ANDN:
+               ret = atomic_futex_op_xchg_and(~oparg, uaddr, &oldval);
+               break;
+       case FUTEX_OP_XOR:
+               ret = atomic_futex_op_xchg_xor(oparg, uaddr, &oldval);
+               break;
+       default:
+               ret = -ENOSYS;
+               break;
+       }
+
+       pagefault_enable();
+
+       if (!ret) {
+               switch (cmp) {
+               case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
+               case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
+               case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
+               case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
+               case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
+               case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
+               default: ret = -ENOSYS;
+               }
+       }
+
+       return ret;
+}
+
+static inline int
+futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
+{
+       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
+               return -EFAULT;
+
+       return atomic_futex_op_cmpxchg_inatomic(uaddr, oldval, newval);
+}
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_FUTEX_H */
diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h
new file mode 100644 (file)
index 0000000..cf32bd2
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ *  include/asm-sh/gpio.h
+ *
+ *  Copyright (C) 2007 Markus Brunner, Mark Jonas
+ *
+ *  Addresses for the Pin Function Controller
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_GPIO_H
+#define __ASM_SH_GPIO_H
+
+#if defined(CONFIG_CPU_SH3)
+#include <cpu/gpio.h>
+#endif
+
+#endif /* __ASM_SH_GPIO_H */
diff --git a/arch/sh/include/asm/hardirq.h b/arch/sh/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..715ee23
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __ASM_SH_HARDIRQ_H
+#define __ASM_SH_HARDIRQ_H
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+/* entry.S is sensitive to the offsets of these fields */
+typedef struct {
+       unsigned int __softirq_pending;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+
+extern void ack_bad_irq(unsigned int irq);
+
+#endif /* __ASM_SH_HARDIRQ_H */
diff --git a/arch/sh/include/asm/hd64461.h b/arch/sh/include/asm/hd64461.h
new file mode 100644 (file)
index 0000000..8c1353b
--- /dev/null
@@ -0,0 +1,250 @@
+#ifndef __ASM_SH_HD64461
+#define __ASM_SH_HD64461
+/*
+ *     Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
+ *     Copyright (C) 2004 Paul Mundt
+ *     Copyright (C) 2000 YAEGASHI Takeshi
+ *
+ *             Hitachi HD64461 companion chip support
+ *     (please note manual reference 0x10000000 = 0xb0000000)
+ */
+
+/* Constants for PCMCIA mappings */
+#define        HD64461_PCC_WINDOW      0x01000000
+
+/* Area 6 - Slot 0 - memory and/or IO card */
+#define        HD64461_PCC0_BASE       (CONFIG_HD64461_IOBASE + 0x8000000)
+#define        HD64461_PCC0_ATTR       (HD64461_PCC0_BASE)                             /* 0xb80000000 */
+#define        HD64461_PCC0_COMM       (HD64461_PCC0_BASE+HD64461_PCC_WINDOW)          /* 0xb90000000 */
+#define        HD64461_PCC0_IO         (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW)        /* 0xba0000000 */
+
+/* Area 5 - Slot 1 - memory card only */
+#define        HD64461_PCC1_BASE       (CONFIG_HD64461_IOBASE + 0x4000000)
+#define        HD64461_PCC1_ATTR       (HD64461_PCC1_BASE)                             /* 0xb4000000 */
+#define        HD64461_PCC1_COMM       (HD64461_PCC1_BASE+HD64461_PCC_WINDOW)          /* 0xb5000000 */
+
+/* Standby Control Register for HD64461 */
+#define        HD64461_STBCR                   CONFIG_HD64461_IOBASE
+#define        HD64461_STBCR_CKIO_STBY         0x2000
+#define        HD64461_STBCR_SAFECKE_IST       0x1000
+#define        HD64461_STBCR_SLCKE_IST         0x0800
+#define        HD64461_STBCR_SAFECKE_OST       0x0400
+#define        HD64461_STBCR_SLCKE_OST         0x0200
+#define        HD64461_STBCR_SMIAST            0x0100
+#define        HD64461_STBCR_SLCDST            0x0080
+#define        HD64461_STBCR_SPC0ST            0x0040
+#define        HD64461_STBCR_SPC1ST            0x0020
+#define        HD64461_STBCR_SAFEST            0x0010
+#define        HD64461_STBCR_STM0ST            0x0008
+#define        HD64461_STBCR_STM1ST            0x0004
+#define        HD64461_STBCR_SIRST             0x0002
+#define        HD64461_STBCR_SURTST            0x0001
+
+/* System Configuration Register */
+#define        HD64461_SYSCR           (CONFIG_HD64461_IOBASE + 0x02)
+
+/* CPU Data Bus Control Register */
+#define        HD64461_SCPUCR          (CONFIG_HD64461_IOBASE + 0x04)
+
+/* Base Address Register */
+#define        HD64461_LCDCBAR         (CONFIG_HD64461_IOBASE + 0x1000)
+
+/* Line increment address */
+#define        HD64461_LCDCLOR         (CONFIG_HD64461_IOBASE + 0x1002)
+
+/* Controls LCD controller */
+#define        HD64461_LCDCCR          (CONFIG_HD64461_IOBASE + 0x1004)
+
+/* LCCDR control bits */
+#define        HD64461_LCDCCR_STBACK   0x0400  /* Standby Back */
+#define        HD64461_LCDCCR_STREQ    0x0100  /* Standby Request */
+#define        HD64461_LCDCCR_MOFF     0x0080  /* Memory Off */
+#define        HD64461_LCDCCR_REFSEL   0x0040  /* Refresh Select */
+#define        HD64461_LCDCCR_EPON     0x0020  /* End Power On */
+#define        HD64461_LCDCCR_SPON     0x0010  /* Start Power On */
+
+/* Controls LCD (1) */
+#define        HD64461_LDR1            (CONFIG_HD64461_IOBASE + 0x1010)
+#define        HD64461_LDR1_DON        0x01    /* Display On */
+#define        HD64461_LDR1_DINV       0x80    /* Display Invert */
+
+/* Controls LCD (2) */
+#define        HD64461_LDR2            (CONFIG_HD64461_IOBASE + 0x1012)
+#define        HD64461_LDHNCR          (CONFIG_HD64461_IOBASE + 0x1014)        /* Number of horizontal characters */
+#define        HD64461_LDHNSR          (CONFIG_HD64461_IOBASE + 0x1016)        /* Specify output start position + width of CL1 */
+#define        HD64461_LDVNTR          (CONFIG_HD64461_IOBASE + 0x1018)        /* Specify total vertical lines */
+#define        HD64461_LDVNDR          (CONFIG_HD64461_IOBASE + 0x101a)        /* specify number of display vertical lines */
+#define        HD64461_LDVSPR          (CONFIG_HD64461_IOBASE + 0x101c)        /* specify vertical synchronization pos and AC nr */
+
+/* Controls LCD (3) */
+#define        HD64461_LDR3            (CONFIG_HD64461_IOBASE + 0x101e)
+
+/* Palette Registers */
+#define        HD64461_CPTWAR          (CONFIG_HD64461_IOBASE + 0x1030)        /* Color Palette Write Address Register */
+#define        HD64461_CPTWDR          (CONFIG_HD64461_IOBASE + 0x1032)        /* Color Palette Write Data Register */
+#define        HD64461_CPTRAR          (CONFIG_HD64461_IOBASE + 0x1034)        /* Color Palette Read Address Register */
+#define        HD64461_CPTRDR          (CONFIG_HD64461_IOBASE + 0x1036)        /* Color Palette Read Data Register */
+
+#define        HD64461_GRDOR           (CONFIG_HD64461_IOBASE + 0x1040)        /* Display Resolution Offset Register */
+#define        HD64461_GRSCR           (CONFIG_HD64461_IOBASE + 0x1042)        /* Solid Color Register */
+#define        HD64461_GRCFGR          (CONFIG_HD64461_IOBASE + 0x1044)        /* Accelerator Configuration Register */
+
+#define        HD64461_GRCFGR_ACCSTATUS        0x10    /* Accelerator Status */
+#define        HD64461_GRCFGR_ACCRESET         0x08    /* Accelerator Reset */
+#define        HD64461_GRCFGR_ACCSTART_BITBLT  0x06    /* Accelerator Start BITBLT */
+#define        HD64461_GRCFGR_ACCSTART_LINE    0x04    /* Accelerator Start Line Drawing */
+#define        HD64461_GRCFGR_COLORDEPTH16     0x01    /* Sets Colordepth 16 for Accelerator */
+#define        HD64461_GRCFGR_COLORDEPTH8      0x01    /* Sets Colordepth 8 for Accelerator */
+
+/* Line Drawing Registers */
+#define        HD64461_LNSARH          (CONFIG_HD64461_IOBASE + 0x1046)        /* Line Start Address Register (H) */
+#define        HD64461_LNSARL          (CONFIG_HD64461_IOBASE + 0x1048)        /* Line Start Address Register (L) */
+#define        HD64461_LNAXLR          (CONFIG_HD64461_IOBASE + 0x104a)        /* Axis Pixel Length Register */
+#define        HD64461_LNDGR           (CONFIG_HD64461_IOBASE + 0x104c)        /* Diagonal Register */
+#define        HD64461_LNAXR           (CONFIG_HD64461_IOBASE + 0x104e)        /* Axial Register */
+#define        HD64461_LNERTR          (CONFIG_HD64461_IOBASE + 0x1050)        /* Start Error Term Register */
+#define        HD64461_LNMDR           (CONFIG_HD64461_IOBASE + 0x1052)        /* Line Mode Register */
+
+/* BitBLT Registers */
+#define        HD64461_BBTSSARH        (CONFIG_HD64461_IOBASE + 0x1054)        /* Source Start Address Register (H) */
+#define        HD64461_BBTSSARL        (CONFIG_HD64461_IOBASE + 0x1056)        /* Source Start Address Register (L) */
+#define        HD64461_BBTDSARH        (CONFIG_HD64461_IOBASE + 0x1058)        /* Destination Start Address Register (H) */
+#define        HD64461_BBTDSARL        (CONFIG_HD64461_IOBASE + 0x105a)        /* Destination Start Address Register (L) */
+#define        HD64461_BBTDWR          (CONFIG_HD64461_IOBASE + 0x105c)        /* Destination Block Width Register */
+#define        HD64461_BBTDHR          (CONFIG_HD64461_IOBASE + 0x105e)        /* Destination Block Height Register */
+#define        HD64461_BBTPARH         (CONFIG_HD64461_IOBASE + 0x1060)        /* Pattern Start Address Register (H) */
+#define        HD64461_BBTPARL         (CONFIG_HD64461_IOBASE + 0x1062)        /* Pattern Start Address Register (L) */
+#define        HD64461_BBTMARH         (CONFIG_HD64461_IOBASE + 0x1064)        /* Mask Start Address Register (H) */
+#define        HD64461_BBTMARL         (CONFIG_HD64461_IOBASE + 0x1066)        /* Mask Start Address Register (L) */
+#define        HD64461_BBTROPR         (CONFIG_HD64461_IOBASE + 0x1068)        /* ROP Register */
+#define        HD64461_BBTMDR          (CONFIG_HD64461_IOBASE + 0x106a)        /* BitBLT Mode Register */
+
+/* PC Card Controller Registers */
+/* Maps to Physical Area 6 */
+#define        HD64461_PCC0ISR         (CONFIG_HD64461_IOBASE + 0x2000)        /* socket 0 interface status */
+#define        HD64461_PCC0GCR         (CONFIG_HD64461_IOBASE + 0x2002)        /* socket 0 general control */
+#define        HD64461_PCC0CSCR        (CONFIG_HD64461_IOBASE + 0x2004)        /* socket 0 card status change */
+#define        HD64461_PCC0CSCIER      (CONFIG_HD64461_IOBASE + 0x2006)        /* socket 0 card status change interrupt enable */
+#define        HD64461_PCC0SCR         (CONFIG_HD64461_IOBASE + 0x2008)        /* socket 0 software control */
+/* Maps to Physical Area 5 */
+#define        HD64461_PCC1ISR         (CONFIG_HD64461_IOBASE + 0x2010)        /* socket 1 interface status */
+#define        HD64461_PCC1GCR         (CONFIG_HD64461_IOBASE + 0x2012)        /* socket 1 general control */
+#define        HD64461_PCC1CSCR        (CONFIG_HD64461_IOBASE + 0x2014)        /* socket 1 card status change */
+#define        HD64461_PCC1CSCIER      (CONFIG_HD64461_IOBASE + 0x2016)        /* socket 1 card status change interrupt enable */
+#define        HD64461_PCC1SCR         (CONFIG_HD64461_IOBASE + 0x2018)        /* socket 1 software control */
+
+/* PCC Interface Status Register */
+#define        HD64461_PCCISR_READY            0x80    /* card ready */
+#define        HD64461_PCCISR_MWP              0x40    /* card write-protected */
+#define        HD64461_PCCISR_VS2              0x20    /* voltage select pin 2 */
+#define        HD64461_PCCISR_VS1              0x10    /* voltage select pin 1 */
+#define        HD64461_PCCISR_CD2              0x08    /* card detect 2 */
+#define        HD64461_PCCISR_CD1              0x04    /* card detect 1 */
+#define        HD64461_PCCISR_BVD2             0x02    /* battery 1 */
+#define        HD64461_PCCISR_BVD1             0x01    /* battery 1 */
+
+#define        HD64461_PCCISR_PCD_MASK         0x0c    /* card detect */
+#define        HD64461_PCCISR_BVD_MASK         0x03    /* battery voltage */
+#define        HD64461_PCCISR_BVD_BATGOOD      0x03    /* battery good */
+#define        HD64461_PCCISR_BVD_BATWARN      0x01    /* battery low warning */
+#define        HD64461_PCCISR_BVD_BATDEAD1     0x02    /* battery dead */
+#define        HD64461_PCCISR_BVD_BATDEAD2     0x00    /* battery dead */
+
+/* PCC General Control Register */
+#define        HD64461_PCCGCR_DRVE             0x80    /* output drive */
+#define        HD64461_PCCGCR_PCCR             0x40    /* PC card reset */
+#define        HD64461_PCCGCR_PCCT             0x20    /* PC card type, 1=IO&mem, 0=mem */
+#define        HD64461_PCCGCR_VCC0             0x10    /* voltage control pin VCC0SEL0 */
+#define        HD64461_PCCGCR_PMMOD            0x08    /* memory mode */
+#define        HD64461_PCCGCR_PA25             0x04    /* pin A25 */
+#define        HD64461_PCCGCR_PA24             0x02    /* pin A24 */
+#define        HD64461_PCCGCR_REG              0x01    /* pin PCC0REG# */
+
+/* PCC Card Status Change Register */
+#define        HD64461_PCCCSCR_SCDI            0x80    /* sw card detect intr */
+#define        HD64461_PCCCSCR_SRV1            0x40    /* reserved */
+#define        HD64461_PCCCSCR_IREQ            0x20    /* IREQ intr req */
+#define        HD64461_PCCCSCR_SC              0x10    /* STSCHG (status change) pin */
+#define        HD64461_PCCCSCR_CDC             0x08    /* CD (card detect) change */
+#define        HD64461_PCCCSCR_RC              0x04    /* READY change */
+#define        HD64461_PCCCSCR_BW              0x02    /* battery warning change */
+#define        HD64461_PCCCSCR_BD              0x01    /* battery dead change */
+
+/* PCC Card Status Change Interrupt Enable Register */
+#define        HD64461_PCCCSCIER_CRE           0x80    /* change reset enable */
+#define        HD64461_PCCCSCIER_IREQE_MASK    0x60    /* IREQ enable */
+#define        HD64461_PCCCSCIER_IREQE_DISABLED 0x00   /* IREQ disabled */
+#define        HD64461_PCCCSCIER_IREQE_LEVEL   0x20    /* IREQ level-triggered */
+#define        HD64461_PCCCSCIER_IREQE_FALLING 0x40    /* IREQ falling-edge-trig */
+#define        HD64461_PCCCSCIER_IREQE_RISING  0x60    /* IREQ rising-edge-trig */
+
+#define        HD64461_PCCCSCIER_SCE           0x10    /* status change enable */
+#define        HD64461_PCCCSCIER_CDE           0x08    /* card detect change enable */
+#define        HD64461_PCCCSCIER_RE            0x04    /* ready change enable */
+#define        HD64461_PCCCSCIER_BWE           0x02    /* battery warn change enable */
+#define        HD64461_PCCCSCIER_BDE           0x01    /* battery dead change enable*/
+
+/* PCC Software Control Register */
+#define        HD64461_PCCSCR_VCC1             0x02    /* voltage control pin 1 */
+#define        HD64461_PCCSCR_SWP              0x01    /* write protect */
+
+/* PCC0 Output Pins Control Register */
+#define        HD64461_P0OCR           (CONFIG_HD64461_IOBASE + 0x202a)
+
+/* PCC1 Output Pins Control Register */
+#define        HD64461_P1OCR           (CONFIG_HD64461_IOBASE + 0x202c)
+
+/* PC Card General Control Register */
+#define        HD64461_PGCR            (CONFIG_HD64461_IOBASE + 0x202e)
+
+/* Port Control Registers */
+#define        HD64461_GPACR           (CONFIG_HD64461_IOBASE + 0x4000)        /* Port A - Handles IRDA/TIMER */
+#define        HD64461_GPBCR           (CONFIG_HD64461_IOBASE + 0x4002)        /* Port B - Handles UART */
+#define        HD64461_GPCCR           (CONFIG_HD64461_IOBASE + 0x4004)        /* Port C - Handles PCMCIA 1 */
+#define        HD64461_GPDCR           (CONFIG_HD64461_IOBASE + 0x4006)        /* Port D - Handles PCMCIA 1 */
+
+/* Port Control Data Registers */
+#define        HD64461_GPADR           (CONFIG_HD64461_IOBASE + 0x4010)        /* A */
+#define        HD64461_GPBDR           (CONFIG_HD64461_IOBASE + 0x4012)        /* B */
+#define        HD64461_GPCDR           (CONFIG_HD64461_IOBASE + 0x4014)        /* C */
+#define        HD64461_GPDDR           (CONFIG_HD64461_IOBASE + 0x4016)        /* D */
+
+/* Interrupt Control Registers */
+#define        HD64461_GPAICR          (CONFIG_HD64461_IOBASE + 0x4020)        /* A */
+#define        HD64461_GPBICR          (CONFIG_HD64461_IOBASE + 0x4022)        /* B */
+#define        HD64461_GPCICR          (CONFIG_HD64461_IOBASE + 0x4024)        /* C */
+#define        HD64461_GPDICR          (CONFIG_HD64461_IOBASE + 0x4026)        /* D */
+
+/* Interrupt Status Registers */
+#define        HD64461_GPAISR          (CONFIG_HD64461_IOBASE + 0x4040)        /* A */
+#define        HD64461_GPBISR          (CONFIG_HD64461_IOBASE + 0x4042)        /* B */
+#define        HD64461_GPCISR          (CONFIG_HD64461_IOBASE + 0x4044)        /* C */
+#define        HD64461_GPDISR          (CONFIG_HD64461_IOBASE + 0x4046)        /* D */
+
+/* Interrupt Request Register & Interrupt Mask Register */
+#define        HD64461_NIRR            (CONFIG_HD64461_IOBASE + 0x5000)
+#define        HD64461_NIMR            (CONFIG_HD64461_IOBASE + 0x5002)
+
+#define        HD64461_IRQBASE         OFFCHIP_IRQ_BASE
+#define        OFFCHIP_IRQ_BASE        64
+#define        HD64461_IRQ_NUM         16
+
+#define        HD64461_IRQ_UART        (HD64461_IRQBASE+5)
+#define        HD64461_IRQ_IRDA        (HD64461_IRQBASE+6)
+#define        HD64461_IRQ_TMU1        (HD64461_IRQBASE+9)
+#define        HD64461_IRQ_TMU0        (HD64461_IRQBASE+10)
+#define        HD64461_IRQ_GPIO        (HD64461_IRQBASE+11)
+#define        HD64461_IRQ_AFE         (HD64461_IRQBASE+12)
+#define        HD64461_IRQ_PCC1        (HD64461_IRQBASE+13)
+#define        HD64461_IRQ_PCC0        (HD64461_IRQBASE+14)
+
+#define __IO_PREFIX    hd64461
+#include <asm/io_generic.h>
+
+/* arch/sh/cchips/hd6446x/hd64461/setup.c */
+int hd64461_irq_demux(int irq);
+void hd64461_register_irq_demux(int irq,
+                               int (*demux) (int irq, void *dev), void *dev);
+void hd64461_unregister_irq_demux(int irq);
+
+#endif
diff --git a/arch/sh/include/asm/hd64465/gpio.h b/arch/sh/include/asm/hd64465/gpio.h
new file mode 100644 (file)
index 0000000..a3cdca2
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _ASM_SH_HD64465_GPIO_
+#define _ASM_SH_HD64465_GPIO_ 1
+/*
+ * $Id: gpio.h,v 1.3 2003/05/04 19:30:14 lethal Exp $
+ *
+ * Hitachi HD64465 companion chip: General Purpose IO pins support.
+ * This layer enables other device drivers to configure GPIO
+ * pins, get and set their values, and register an interrupt
+ * routine for when input pins change in hardware.
+ *
+ * by Greg Banks <gbanks@pocketpenguins.com>
+ * (c) 2000 PocketPenguins Inc.
+ */
+#include <asm/hd64465.h>
+
+/* Macro to construct a portpin number (used in all
+ * subsequent functions) from a port letter and a pin
+ * number, e.g. HD64465_GPIO_PORTPIN('A', 5).
+ */
+#define HD64465_GPIO_PORTPIN(port,pin) (((port)-'A')<<3|(pin))
+
+/* Pin configuration constants for _configure() */
+#define HD64465_GPIO_FUNCTION2 0       /* use the pin's *other* function */
+#define HD64465_GPIO_OUT       1       /* output */
+#define HD64465_GPIO_IN_PULLUP 2       /* input, pull-up MOS on */
+#define HD64465_GPIO_IN                3       /* input */
+
+/* Configure a pin's direction */
+extern void hd64465_gpio_configure(int portpin, int direction);
+
+/* Get, set value */
+extern void hd64465_gpio_set_pin(int portpin, unsigned int value);
+extern unsigned int hd64465_gpio_get_pin(int portpin);
+extern void hd64465_gpio_set_port(int port, unsigned int value);
+extern unsigned int hd64465_gpio_get_port(int port);
+
+/* mode constants for _register_irq() */
+#define HD64465_GPIO_FALLING   0
+#define HD64465_GPIO_RISING    1
+
+/* Interrupt on external value change */
+extern void hd64465_gpio_register_irq(int portpin, int mode,
+       void (*handler)(int portpin, void *dev), void *dev);
+extern void hd64465_gpio_unregister_irq(int portpin);
+
+#endif /* _ASM_SH_HD64465_GPIO_  */
diff --git a/arch/sh/include/asm/hd64465/hd64465.h b/arch/sh/include/asm/hd64465/hd64465.h
new file mode 100644 (file)
index 0000000..cfd0e80
--- /dev/null
@@ -0,0 +1,256 @@
+#ifndef _ASM_SH_HD64465_
+#define _ASM_SH_HD64465_ 1
+/*
+ * $Id: hd64465.h,v 1.3 2003/05/04 19:30:15 lethal Exp $
+ *
+ * Hitachi HD64465 companion chip support
+ *
+ * by Greg Banks <gbanks@pocketpenguins.com>
+ * (c) 2000 PocketPenguins Inc.
+ *
+ * Derived from <asm/hd64461.h> which bore the message:
+ * Copyright (C) 2000 YAEGASHI Takeshi
+ */
+#include <asm/io.h>
+#include <asm/irq.h>
+
+/*
+ * Note that registers are defined here as virtual port numbers,
+ * which have no meaning except to get translated by hd64465_isa_port2addr()
+ * to an address in the range 0xb0000000-0xb3ffffff.  Note that
+ * this translation happens to consist of adding the lower 16 bits
+ * of the virtual port number to 0xb0000000.  Note also that the manual
+ * shows addresses as absolute physical addresses starting at 0x10000000,
+ * so e.g. the NIRR register is listed as 0x15000 here, 0x10005000 in the
+ * manual, and accessed using address 0xb0005000 - Greg.
+ */
+
+/* System registers */
+#define HD64465_REG_SRR     0x1000c    /* System Revision Register */
+#define HD64465_REG_SDID    0x10010    /* System Device ID Reg */
+#define     HD64465_SDID            0x8122  /* 64465 device ID */
+
+/* Power Management registers */
+#define HD64465_REG_SMSCR   0x10000    /* System Module Standby Control Reg */
+#define            HD64465_SMSCR_PS2ST     0x4000  /* PS/2 Standby */
+#define            HD64465_SMSCR_ADCST     0x1000  /* ADC Standby */
+#define            HD64465_SMSCR_UARTST    0x0800  /* UART Standby */
+#define            HD64465_SMSCR_SCDIST    0x0200  /* Serial Codec Standby */
+#define            HD64465_SMSCR_PPST      0x0100  /* Parallel Port Standby */
+#define            HD64465_SMSCR_PC0ST     0x0040  /* PCMCIA0 Standby */
+#define            HD64465_SMSCR_PC1ST     0x0020  /* PCMCIA1 Standby */
+#define            HD64465_SMSCR_AFEST     0x0010  /* AFE Standby */
+#define            HD64465_SMSCR_TM0ST     0x0008  /* Timer0 Standby */
+#define            HD64465_SMSCR_TM1ST     0x0004  /* Timer1 Standby */
+#define            HD64465_SMSCR_IRDAST    0x0002  /* IRDA Standby */
+#define            HD64465_SMSCR_KBCST     0x0001  /* Keyboard Controller Standby */
+/* Interrupt Controller registers */
+#define HD64465_REG_NIRR    0x15000    /* Interrupt Request Register */
+#define HD64465_REG_NIMR    0x15002    /* Interrupt Mask Register */
+#define HD64465_REG_NITR    0x15004    /* Interrupt Trigger Mode Register */
+
+/* Timer registers */
+#define HD64465_REG_TCVR1   0x16000    /* Timer 1 constant value register  */
+#define HD64465_REG_TCVR0   0x16002    /* Timer 0 constant value register  */
+#define HD64465_REG_TRVR1   0x16004    /* Timer 1 read value register  */
+#define HD64465_REG_TRVR0   0x16006    /* Timer 0 read value register  */
+#define HD64465_REG_TCR1    0x16008    /* Timer 1 control register  */
+#define HD64465_REG_TCR0    0x1600A    /* Timer 0 control register  */
+#define            HD64465_TCR_EADT    0x10        /* Enable ADTRIG# signal */
+#define            HD64465_TCR_ETMO    0x08        /* Enable TMO signal */
+#define            HD64465_TCR_PST_MASK 0x06       /* Clock Prescale */
+#define            HD64465_TCR_PST_1   0x06        /* 1:1 */
+#define            HD64465_TCR_PST_4   0x04        /* 1:4 */
+#define            HD64465_TCR_PST_8   0x02        /* 1:8 */
+#define            HD64465_TCR_PST_16  0x00        /* 1:16 */
+#define            HD64465_TCR_TSTP    0x01        /* Start/Stop timer */
+#define HD64465_REG_TIRR    0x1600C    /* Timer interrupt request register  */
+#define HD64465_REG_TIDR    0x1600E    /* Timer interrupt disable register  */
+#define HD64465_REG_PWM1CS  0x16010    /* PWM 1 clock scale register  */
+#define HD64465_REG_PWM1LPC 0x16012    /* PWM 1 low pulse width counter register  */
+#define HD64465_REG_PWM1HPC 0x16014    /* PWM 1 high pulse width counter register  */
+#define HD64465_REG_PWM0CS  0x16018    /* PWM 0 clock scale register  */
+#define HD64465_REG_PWM0LPC 0x1601A    /* PWM 0 low pulse width counter register  */
+#define HD64465_REG_PWM0HPC 0x1601C    /* PWM 0 high pulse width counter register  */
+
+/* Analog/Digital Converter registers */
+#define HD64465_REG_ADDRA   0x1E000    /* A/D data register A */
+#define HD64465_REG_ADDRB   0x1E002    /* A/D data register B */
+#define HD64465_REG_ADDRC   0x1E004    /* A/D data register C */
+#define HD64465_REG_ADDRD   0x1E006    /* A/D data register D */
+#define HD64465_REG_ADCSR   0x1E008    /* A/D control/status register */
+#define     HD64465_ADCSR_ADF      0x80    /* A/D End Flag */
+#define     HD64465_ADCSR_ADST     0x40    /* A/D Start Flag */
+#define     HD64465_ADCSR_ADIS     0x20    /* A/D Interrupt Status */
+#define     HD64465_ADCSR_TRGE     0x10    /* A/D Trigger Enable */
+#define     HD64465_ADCSR_ADIE     0x08    /* A/D Interrupt Enable */
+#define     HD64465_ADCSR_SCAN     0x04    /* A/D Scan Mode */
+#define     HD64465_ADCSR_CH_MASK   0x03    /* A/D Channel */
+#define HD64465_REG_ADCALCR 0x1E00A    /* A/D calibration sample control */
+#define HD64465_REG_ADCAL   0x1E00C    /* A/D calibration data register */
+
+
+/* General Purpose I/O ports registers */
+#define HD64465_REG_GPACR   0x14000    /* Port A Control Register */
+#define HD64465_REG_GPBCR   0x14002    /* Port B Control Register */
+#define HD64465_REG_GPCCR   0x14004    /* Port C Control Register */
+#define HD64465_REG_GPDCR   0x14006    /* Port D Control Register */
+#define HD64465_REG_GPECR   0x14008    /* Port E Control Register */
+#define HD64465_REG_GPADR   0x14010    /* Port A Data Register */
+#define HD64465_REG_GPBDR   0x14012    /* Port B Data Register */
+#define HD64465_REG_GPCDR   0x14014    /* Port C Data Register */
+#define HD64465_REG_GPDDR   0x14016    /* Port D Data Register */
+#define HD64465_REG_GPEDR   0x14018    /* Port E Data Register */
+#define HD64465_REG_GPAICR  0x14020    /* Port A Interrupt Control Register */
+#define HD64465_REG_GPBICR  0x14022    /* Port B Interrupt Control Register */
+#define HD64465_REG_GPCICR  0x14024    /* Port C Interrupt Control Register */
+#define HD64465_REG_GPDICR  0x14026    /* Port D Interrupt Control Register */
+#define HD64465_REG_GPEICR  0x14028    /* Port E Interrupt Control Register */
+#define HD64465_REG_GPAISR  0x14040    /* Port A Interrupt Status Register */
+#define HD64465_REG_GPBISR  0x14042    /* Port B Interrupt Status Register */
+#define HD64465_REG_GPCISR  0x14044    /* Port C Interrupt Status Register */
+#define HD64465_REG_GPDISR  0x14046    /* Port D Interrupt Status Register */
+#define HD64465_REG_GPEISR  0x14048    /* Port E Interrupt Status Register */
+
+/* PCMCIA bridge interface */
+#define HD64465_REG_PCC0ISR    0x12000 /* socket 0 interface status */ 
+#define     HD64465_PCCISR_PREADY       0x80    /* mem card ready / io card IREQ */
+#define     HD64465_PCCISR_PIREQ        0x80
+#define     HD64465_PCCISR_PMWP         0x40    /* mem card write-protected */
+#define     HD64465_PCCISR_PVS2         0x20    /* voltage select pin 2 */
+#define     HD64465_PCCISR_PVS1         0x10    /* voltage select pin 1 */
+#define     HD64465_PCCISR_PCD_MASK     0x0c    /* card detect */
+#define     HD64465_PCCISR_PBVD_MASK     0x03    /* battery voltage */
+#define     HD64465_PCCISR_PBVD_BATGOOD  0x03    /* battery good */
+#define     HD64465_PCCISR_PBVD_BATWARN  0x01    /* battery low warning */
+#define     HD64465_PCCISR_PBVD_BATDEAD1 0x02    /* battery dead */
+#define     HD64465_PCCISR_PBVD_BATDEAD2 0x00    /* battery dead */
+#define HD64465_REG_PCC0GCR    0x12002 /* socket 0 general control */ 
+#define     HD64465_PCCGCR_PDRV         0x80    /* output drive */
+#define     HD64465_PCCGCR_PCCR         0x40    /* PC card reset */
+#define     HD64465_PCCGCR_PCCT         0x20    /* PC card type, 1=IO&mem, 0=mem */
+#define     HD64465_PCCGCR_PVCC0        0x10    /* voltage control pin VCC0SEL0 */
+#define     HD64465_PCCGCR_PMMOD        0x08    /* memory mode */
+#define     HD64465_PCCGCR_PPA25        0x04    /* pin A25 */
+#define     HD64465_PCCGCR_PPA24        0x02    /* pin A24 */
+#define     HD64465_PCCGCR_PREG         0x01    /* ping PCC0REG# */
+#define HD64465_REG_PCC0CSCR   0x12004 /* socket 0 card status change */ 
+#define     HD64465_PCCCSCR_PSCDI       0x80    /* sw card detect intr */
+#define     HD64465_PCCCSCR_PSWSEL      0x40    /* power select */
+#define     HD64465_PCCCSCR_PIREQ       0x20    /* IREQ intr req */
+#define     HD64465_PCCCSCR_PSC         0x10    /* STSCHG (status change) pin */
+#define     HD64465_PCCCSCR_PCDC        0x08    /* CD (card detect) change */
+#define     HD64465_PCCCSCR_PRC         0x04    /* ready change */
+#define     HD64465_PCCCSCR_PBW         0x02    /* battery warning change */
+#define     HD64465_PCCCSCR_PBD         0x01    /* battery dead change */
+#define HD64465_REG_PCC0CSCIER 0x12006 /* socket 0 card status change interrupt enable */ 
+#define     HD64465_PCCCSCIER_PCRE      0x80    /* change reset enable */
+#define     HD64465_PCCCSCIER_PIREQE_MASK      0x60   /* IREQ enable */
+#define     HD64465_PCCCSCIER_PIREQE_DISABLED  0x00   /* IREQ disabled */
+#define     HD64465_PCCCSCIER_PIREQE_LEVEL     0x20   /* IREQ level-triggered */
+#define     HD64465_PCCCSCIER_PIREQE_FALLING   0x40   /* IREQ falling-edge-trig */
+#define     HD64465_PCCCSCIER_PIREQE_RISING    0x60   /* IREQ rising-edge-trig */
+#define     HD64465_PCCCSCIER_PSCE      0x10    /* status change enable */
+#define     HD64465_PCCCSCIER_PCDE      0x08    /* card detect change enable */
+#define     HD64465_PCCCSCIER_PRE       0x04    /* ready change enable */
+#define     HD64465_PCCCSCIER_PBWE      0x02    /* battery warn change enable */
+#define     HD64465_PCCCSCIER_PBDE      0x01    /* battery dead change enable*/
+#define HD64465_REG_PCC0SCR    0x12008 /* socket 0 software control */ 
+#define     HD64465_PCCSCR_SHDN         0x10    /* TPS2206 SHutDowN pin */
+#define     HD64465_PCCSCR_SWP          0x01    /* write protect */
+#define HD64465_REG_PCCPSR     0x1200A /* serial power switch control */ 
+#define HD64465_REG_PCC1ISR    0x12010 /* socket 1 interface status */ 
+#define HD64465_REG_PCC1GCR    0x12012 /* socket 1 general control */ 
+#define HD64465_REG_PCC1CSCR   0x12014 /* socket 1 card status change */ 
+#define HD64465_REG_PCC1CSCIER 0x12016 /* socket 1 card status change interrupt enable */ 
+#define HD64465_REG_PCC1SCR    0x12018 /* socket 1 software control */ 
+
+
+/* PS/2 Keyboard and mouse controller -- *not* register compatible */
+#define HD64465_REG_KBCSR      0x1dc00 /* Keyboard Control/Status reg */
+#define     HD64465_KBCSR_KBCIE         0x8000    /* KBCK Input Enable */
+#define     HD64465_KBCSR_KBCOE         0x4000    /* KBCK Output Enable */
+#define     HD64465_KBCSR_KBDOE         0x2000    /* KB DATA Output Enable */
+#define     HD64465_KBCSR_KBCD          0x1000    /* KBCK Driven */
+#define     HD64465_KBCSR_KBDD          0x0800    /* KB DATA Driven */
+#define     HD64465_KBCSR_KBCS          0x0400    /* KBCK pin Status */
+#define     HD64465_KBCSR_KBDS          0x0200    /* KB DATA pin Status */
+#define     HD64465_KBCSR_KBDP          0x0100    /* KB DATA Parity bit */
+#define     HD64465_KBCSR_KBD_MASK      0x00ff    /* KD DATA shift reg */
+#define HD64465_REG_KBISR      0x1dc04 /* Keyboard Interrupt Status reg */
+#define     HD64465_KBISR_KBRDF         0x0001    /* KB Received Data Full */
+#define HD64465_REG_MSCSR      0x1dc10 /* Mouse Control/Status reg */
+#define HD64465_REG_MSISR      0x1dc14 /* Mouse Interrupt Status reg */
+
+
+/*
+ * Logical address at which the HD64465 is mapped.  Note that this
+ * should always be in the P2 segment (uncached and untranslated).
+ */
+#ifndef CONFIG_HD64465_IOBASE
+#define CONFIG_HD64465_IOBASE  0xb0000000
+#endif
+/*
+ * The HD64465 multiplexes all its modules' interrupts onto
+ * this single interrupt.
+ */
+#ifndef CONFIG_HD64465_IRQ
+#define CONFIG_HD64465_IRQ     5
+#endif
+
+
+#define _HD64465_IO_MASK       0xf8000000
+#define is_hd64465_addr(addr) \
+       ((addr & _HD64465_IO_MASK) == (CONFIG_HD64465_IOBASE & _HD64465_IO_MASK))
+
+/*
+ * A range of 16 virtual interrupts generated by
+ * demuxing the HD64465 muxed interrupt.
+ */
+#define HD64465_IRQ_BASE       OFFCHIP_IRQ_BASE
+#define HD64465_IRQ_NUM        16
+#define HD64465_IRQ_ADC        (HD64465_IRQ_BASE+0)
+#define HD64465_IRQ_USB        (HD64465_IRQ_BASE+1)
+#define HD64465_IRQ_SCDI       (HD64465_IRQ_BASE+2)
+#define HD64465_IRQ_PARALLEL   (HD64465_IRQ_BASE+3)
+/* bit 4 is reserved */
+#define HD64465_IRQ_UART       (HD64465_IRQ_BASE+5)
+#define HD64465_IRQ_IRDA       (HD64465_IRQ_BASE+6)
+#define HD64465_IRQ_PS2MOUSE   (HD64465_IRQ_BASE+7)
+#define HD64465_IRQ_KBC        (HD64465_IRQ_BASE+8)
+#define HD64465_IRQ_TIMER1     (HD64465_IRQ_BASE+9)
+#define HD64465_IRQ_TIMER0     (HD64465_IRQ_BASE+10)
+#define HD64465_IRQ_GPIO       (HD64465_IRQ_BASE+11)
+#define HD64465_IRQ_AFE        (HD64465_IRQ_BASE+12)
+#define HD64465_IRQ_PCMCIA1    (HD64465_IRQ_BASE+13)
+#define HD64465_IRQ_PCMCIA0    (HD64465_IRQ_BASE+14)
+#define HD64465_IRQ_PS2KBD             (HD64465_IRQ_BASE+15)
+
+/* Constants for PCMCIA mappings */
+#define HD64465_PCC_WINDOW     0x01000000
+
+#define HD64465_PCC0_BASE      0xb8000000      /* area 6 */
+#define HD64465_PCC0_ATTR      (HD64465_PCC0_BASE)
+#define HD64465_PCC0_COMM      (HD64465_PCC0_BASE+HD64465_PCC_WINDOW)
+#define HD64465_PCC0_IO                (HD64465_PCC0_BASE+2*HD64465_PCC_WINDOW)
+
+#define HD64465_PCC1_BASE      0xb4000000      /* area 5 */
+#define HD64465_PCC1_ATTR      (HD64465_PCC1_BASE)
+#define HD64465_PCC1_COMM      (HD64465_PCC1_BASE+HD64465_PCC_WINDOW)
+#define HD64465_PCC1_IO                (HD64465_PCC1_BASE+2*HD64465_PCC_WINDOW)
+
+/*
+ * Base of USB controller interface (as memory)
+ */
+#define HD64465_USB_BASE       (CONFIG_HD64465_IOBASE+0xb000)
+#define HD64465_USB_LEN        0x1000
+/*
+ * Base of embedded SRAM, used for USB controller.
+ */
+#define HD64465_SRAM_BASE      (CONFIG_HD64465_IOBASE+0x9000)
+#define HD64465_SRAM_LEN       0x1000
+
+
+
+#endif /* _ASM_SH_HD64465_  */
diff --git a/arch/sh/include/asm/hd64465/io.h b/arch/sh/include/asm/hd64465/io.h
new file mode 100644 (file)
index 0000000..139f147
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-sh/hd64465/io.h
+ *
+ * By Greg Banks <gbanks@pocketpenguins.com>
+ * (c) 2000 PocketPenguins Inc.
+ *
+ * Derived from io_hd64461.h, which bore the message:
+ * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * IO functions for an HD64465 "Windows CE Intelligent Peripheral Controller".
+ */
+
+#ifndef _ASM_SH_IO_HD64465_H
+#define _ASM_SH_IO_HD64465_H
+
+extern unsigned char hd64465_inb(unsigned long port);
+extern unsigned short hd64465_inw(unsigned long port);
+extern unsigned int hd64465_inl(unsigned long port);
+
+extern void hd64465_outb(unsigned char value, unsigned long port);
+extern void hd64465_outw(unsigned short value, unsigned long port);
+extern void hd64465_outl(unsigned int value, unsigned long port);
+
+extern unsigned char hd64465_inb_p(unsigned long port);
+extern void hd64465_outb_p(unsigned char value, unsigned long port);
+
+extern unsigned long hd64465_isa_port2addr(unsigned long offset);
+extern int hd64465_irq_demux(int irq);
+/* Provision for generic secondary demux step -- used by PCMCIA code */
+extern void hd64465_register_irq_demux(int irq,
+               int (*demux)(int irq, void *dev), void *dev);
+extern void hd64465_unregister_irq_demux(int irq);
+/* Set this variable to 1 to see port traffic */
+extern int hd64465_io_debug;
+/* Map a range of ports to a range of kernel virtual memory.
+ */
+extern void hd64465_port_map(unsigned short baseport, unsigned int nports,
+                            unsigned long addr, unsigned char shift);
+extern void hd64465_port_unmap(unsigned short baseport, unsigned int nports);
+
+#endif /* _ASM_SH_IO_HD64465_H */
diff --git a/arch/sh/include/asm/heartbeat.h b/arch/sh/include/asm/heartbeat.h
new file mode 100644 (file)
index 0000000..724a43e
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __ASM_SH_HEARTBEAT_H
+#define __ASM_SH_HEARTBEAT_H
+
+#include <linux/timer.h>
+
+#define HEARTBEAT_INVERTED     (1 << 0)
+
+struct heartbeat_data {
+       void __iomem *base;
+       unsigned char *bit_pos;
+       unsigned int nr_bits;
+       struct timer_list timer;
+       unsigned int regsize;
+       unsigned long flags;
+};
+
+#endif /* __ASM_SH_HEARTBEAT_H */
diff --git a/arch/sh/include/asm/hp6xx.h b/arch/sh/include/asm/hp6xx.h
new file mode 100644 (file)
index 0000000..0d4165a
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ASM_SH_HP6XX_H
+#define __ASM_SH_HP6XX_H
+
+/*
+ * Copyright (C) 2003, 2004, 2005  Andriy Skulysh
+ *
+ * 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.
+ *
+ */
+
+#define HP680_BTN_IRQ          32      /* IRQ0_IRQ */
+#define HP680_TS_IRQ           35      /* IRQ3_IRQ */
+#define HP680_HD64461_IRQ      36      /* IRQ4_IRQ */
+
+#define DAC_LCD_BRIGHTNESS     0
+#define DAC_SPEAKER_VOLUME     1
+
+#define PGDR_OPENED            0x01
+#define PGDR_MAIN_BATTERY_OUT  0x04
+#define PGDR_PLAY_BUTTON       0x08
+#define PGDR_REWIND_BUTTON     0x10
+#define PGDR_RECORD_BUTTON     0x20
+
+#define PHDR_TS_PEN_DOWN       0x08
+
+#define PJDR_LED_BLINK         0x02
+
+#define PKDR_LED_GREEN         0x10
+
+#define SCPDR_TS_SCAN_ENABLE   0x20
+#define SCPDR_TS_SCAN_Y                0x02
+#define SCPDR_TS_SCAN_X                0x01
+
+#define SCPCR_TS_ENABLE                0x405
+#define SCPCR_TS_MASK          0xc0f
+
+#define ADC_CHANNEL_TS_Y       1
+#define ADC_CHANNEL_TS_X       2
+#define ADC_CHANNEL_BATTERY    3
+#define ADC_CHANNEL_BACKUP     4
+#define ADC_CHANNEL_CHARGE     5
+
+#define HD64461_GPADR_SPEAKER  0x01
+#define HD64461_GPADR_PCMCIA0  (0x02|0x08)
+
+#define HD64461_GPBDR_LCDOFF   0x01
+#define HD64461_GPBDR_LCD_CONTRAST_MASK        0x78
+#define HD64461_GPBDR_LED_RED  0x80
+
+#include <asm/hd64461.h>
+#include <asm/io.h>
+
+#define PJDR   0xa4000130
+#define PKDR   0xa4000132
+
+#endif /* __ASM_SH_HP6XX_H */
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
new file mode 100644 (file)
index 0000000..967068f
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef _ASM_SH_HUGETLB_H
+#define _ASM_SH_HUGETLB_H
+
+#include <asm/page.h>
+
+
+static inline int is_hugepage_only_range(struct mm_struct *mm,
+                                        unsigned long addr,
+                                        unsigned long len) {
+       return 0;
+}
+
+/*
+ * If the arch doesn't supply something else, assume that hugepage
+ * size aligned regions are ok without further preparation.
+ */
+static inline int prepare_hugepage_range(struct file *file,
+                       unsigned long addr, unsigned long len)
+{
+       if (len & ~HPAGE_MASK)
+               return -EINVAL;
+       if (addr & ~HPAGE_MASK)
+               return -EINVAL;
+       return 0;
+}
+
+static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) {
+}
+
+static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
+                                         unsigned long addr, unsigned long end,
+                                         unsigned long floor,
+                                         unsigned long ceiling)
+{
+       free_pgd_range(tlb, addr, end, floor, ceiling);
+}
+
+static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
+                                  pte_t *ptep, pte_t pte)
+{
+       set_pte_at(mm, addr, ptep, pte);
+}
+
+static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
+                                           unsigned long addr, pte_t *ptep)
+{
+       return ptep_get_and_clear(mm, addr, ptep);
+}
+
+static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
+                                        unsigned long addr, pte_t *ptep)
+{
+}
+
+static inline int huge_pte_none(pte_t pte)
+{
+       return pte_none(pte);
+}
+
+static inline pte_t huge_pte_wrprotect(pte_t pte)
+{
+       return pte_wrprotect(pte);
+}
+
+static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
+                                          unsigned long addr, pte_t *ptep)
+{
+       ptep_set_wrprotect(mm, addr, ptep);
+}
+
+static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+                                            unsigned long addr, pte_t *ptep,
+                                            pte_t pte, int dirty)
+{
+       return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
+}
+
+static inline pte_t huge_ptep_get(pte_t *ptep)
+{
+       return *ptep;
+}
+
+static inline int arch_prepare_hugepage(struct page *page)
+{
+       return 0;
+}
+
+static inline void arch_release_hugepage(struct page *page)
+{
+}
+
+#endif /* _ASM_SH_HUGETLB_H */
diff --git a/arch/sh/include/asm/hw_irq.h b/arch/sh/include/asm/hw_irq.h
new file mode 100644 (file)
index 0000000..d557b00
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef __ASM_SH_HW_IRQ_H
+#define __ASM_SH_HW_IRQ_H
+
+#include <linux/init.h>
+#include <asm/atomic.h>
+
+extern atomic_t irq_err_count;
+
+struct ipr_data {
+       unsigned char irq;
+       unsigned char ipr_idx;          /* Index for the IPR registered */
+       unsigned char shift;            /* Number of bits to shift the data */
+       unsigned char priority;         /* The priority */
+};
+
+struct ipr_desc {
+       unsigned long *ipr_offsets;
+       unsigned int nr_offsets;
+       struct ipr_data *ipr_data;
+       unsigned int nr_irqs;
+       struct irq_chip chip;
+};
+
+void register_ipr_controller(struct ipr_desc *);
+
+typedef unsigned char intc_enum;
+
+struct intc_vect {
+       intc_enum enum_id;
+       unsigned short vect;
+};
+
+#define INTC_VECT(enum_id, vect) { enum_id, vect }
+#define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq))
+
+struct intc_group {
+       intc_enum enum_id;
+       intc_enum enum_ids[32];
+};
+
+#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
+
+struct intc_mask_reg {
+       unsigned long set_reg, clr_reg, reg_width;
+       intc_enum enum_ids[32];
+#ifdef CONFIG_SMP
+       unsigned long smp;
+#endif
+};
+
+struct intc_prio_reg {
+       unsigned long set_reg, clr_reg, reg_width, field_width;
+       intc_enum enum_ids[16];
+#ifdef CONFIG_SMP
+       unsigned long smp;
+#endif
+};
+
+struct intc_sense_reg {
+       unsigned long reg, reg_width, field_width;
+       intc_enum enum_ids[16];
+};
+
+#ifdef CONFIG_SMP
+#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
+#else
+#define INTC_SMP(stride, nr)
+#endif
+
+struct intc_desc {
+       struct intc_vect *vectors;
+       unsigned int nr_vectors;
+       struct intc_group *groups;
+       unsigned int nr_groups;
+       struct intc_mask_reg *mask_regs;
+       unsigned int nr_mask_regs;
+       struct intc_prio_reg *prio_regs;
+       unsigned int nr_prio_regs;
+       struct intc_sense_reg *sense_regs;
+       unsigned int nr_sense_regs;
+       char *name;
+#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
+       struct intc_mask_reg *ack_regs;
+       unsigned int nr_ack_regs;
+#endif
+};
+
+#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
+#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups,           \
+       mask_regs, prio_regs, sense_regs)                               \
+struct intc_desc symbol __initdata = {                                 \
+       _INTC_ARRAY(vectors), _INTC_ARRAY(groups),                      \
+       _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs),                 \
+       _INTC_ARRAY(sense_regs),                                        \
+       chipname,                                                       \
+}
+
+#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
+#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups,       \
+       mask_regs, prio_regs, sense_regs, ack_regs)                     \
+struct intc_desc symbol __initdata = {                                 \
+       _INTC_ARRAY(vectors), _INTC_ARRAY(groups),                      \
+       _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs),                 \
+       _INTC_ARRAY(sense_regs),                                        \
+       chipname,                                                       \
+       _INTC_ARRAY(ack_regs),                                          \
+}
+#endif
+
+void __init register_intc_controller(struct intc_desc *desc);
+int intc_set_priority(unsigned int irq, unsigned int prio);
+
+void __init plat_irq_setup(void);
+#ifdef CONFIG_CPU_SH3
+void __init plat_irq_setup_sh3(void);
+#endif
+
+enum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210,
+       IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK,
+       IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
+void __init plat_irq_setup_pins(int mode);
+
+#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/arch/sh/include/asm/i2c-sh7760.h b/arch/sh/include/asm/i2c-sh7760.h
new file mode 100644 (file)
index 0000000..2418211
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * MMIO/IRQ and platform data for SH7760 I2C channels
+ */
+
+#ifndef _I2C_SH7760_H_
+#define _I2C_SH7760_H_
+
+#define SH7760_I2C_DEVNAME     "sh7760-i2c"
+
+#define SH7760_I2C0_MMIO       0xFE140000
+#define SH7760_I2C0_MMIOEND    0xFE14003B
+#define SH7760_I2C0_IRQ                62
+
+#define SH7760_I2C1_MMIO       0xFE150000
+#define SH7760_I2C1_MMIOEND    0xFE15003B
+#define SH7760_I2C1_IRQ                63
+
+struct sh7760_i2c_platdata {
+       unsigned int speed_khz;
+};
+
+#endif
diff --git a/arch/sh/include/asm/ilsel.h b/arch/sh/include/asm/ilsel.h
new file mode 100644 (file)
index 0000000..e3d304b
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __ASM_SH_ILSEL_H
+#define __ASM_SH_ILSEL_H
+
+typedef enum {
+       ILSEL_NONE,
+       ILSEL_LAN,
+       ILSEL_USBH_I,
+       ILSEL_USBH_S,
+       ILSEL_USBH_V,
+       ILSEL_RTC,
+       ILSEL_USBP_I,
+       ILSEL_USBP_S,
+       ILSEL_USBP_V,
+       ILSEL_KEY,
+
+       /*
+        * ILSEL Aliases - corner cases for interleaved level tables.
+        *
+        * Someone thought this was a good idea and less hassle than
+        * demuxing a shared vector, really.
+        */
+
+       /* ILSEL0 and 2 */
+       ILSEL_FPGA0,
+       ILSEL_FPGA1,
+       ILSEL_EX1,
+       ILSEL_EX2,
+       ILSEL_EX3,
+       ILSEL_EX4,
+
+       /* ILSEL1 and 3 */
+       ILSEL_FPGA2 = ILSEL_FPGA0,
+       ILSEL_FPGA3 = ILSEL_FPGA1,
+       ILSEL_EX5 = ILSEL_EX1,
+       ILSEL_EX6 = ILSEL_EX2,
+       ILSEL_EX7 = ILSEL_EX3,
+       ILSEL_EX8 = ILSEL_EX4,
+} ilsel_source_t;
+
+/* arch/sh/boards/renesas/x3proto/ilsel.c */
+int ilsel_enable(ilsel_source_t set);
+int ilsel_enable_fixed(ilsel_source_t set, unsigned int level);
+void ilsel_disable(unsigned int irq);
+
+#endif /* __ASM_SH_ILSEL_H */
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
new file mode 100644 (file)
index 0000000..a4fbf0c
--- /dev/null
@@ -0,0 +1,366 @@
+#ifndef __ASM_SH_IO_H
+#define __ASM_SH_IO_H
+
+/*
+ * Convention:
+ *    read{b,w,l}/write{b,w,l} are for PCI,
+ *    while in{b,w,l}/out{b,w,l} are for ISA
+ * These may (will) be platform specific function.
+ * In addition we have 'pausing' versions: in{b,w,l}_p/out{b,w,l}_p
+ * and 'string' versions: ins{b,w,l}/outs{b,w,l}
+ * For read{b,w,l} and write{b,w,l} there are also __raw versions, which
+ * do not have a memory barrier after them.
+ *
+ * In addition, we have
+ *   ctrl_in{b,w,l}/ctrl_out{b,w,l} for SuperH specific I/O.
+ *   which are processor specific.
+ */
+
+/*
+ * We follow the Alpha convention here:
+ *  __inb expands to an inline function call (which calls via the mv)
+ *  _inb  is a real function call (note ___raw fns are _ version of __raw)
+ *  inb   by default expands to _inb, but the machine specific code may
+ *        define it to __inb if it chooses.
+ */
+#include <asm/cache.h>
+#include <asm/system.h>
+#include <asm/addrspace.h>
+#include <asm/machvec.h>
+#include <asm/pgtable.h>
+#include <asm-generic/iomap.h>
+
+#ifdef __KERNEL__
+
+/*
+ * Depending on which platform we are running on, we need different
+ * I/O functions.
+ */
+#define __IO_PREFIX    generic
+#include <asm/io_generic.h>
+#include <asm/io_trapped.h>
+
+#define maybebadio(port) \
+  printk(KERN_ERR "bad PC-like io %s:%u for port 0x%lx at 0x%08x\n", \
+        __FUNCTION__, __LINE__, (port), (u32)__builtin_return_address(0))
+
+/*
+ * Since boards are able to define their own set of I/O routines through
+ * their respective machine vector, we always wrap through the mv.
+ *
+ * Also, in the event that a board hasn't provided its own definition for
+ * a given routine, it will be wrapped to generic code at run-time.
+ */
+
+#define __inb(p)       sh_mv.mv_inb((p))
+#define __inw(p)       sh_mv.mv_inw((p))
+#define __inl(p)       sh_mv.mv_inl((p))
+#define __outb(x,p)    sh_mv.mv_outb((x),(p))
+#define __outw(x,p)    sh_mv.mv_outw((x),(p))
+#define __outl(x,p)    sh_mv.mv_outl((x),(p))
+
+#define __inb_p(p)     sh_mv.mv_inb_p((p))
+#define __inw_p(p)     sh_mv.mv_inw_p((p))
+#define __inl_p(p)     sh_mv.mv_inl_p((p))
+#define __outb_p(x,p)  sh_mv.mv_outb_p((x),(p))
+#define __outw_p(x,p)  sh_mv.mv_outw_p((x),(p))
+#define __outl_p(x,p)  sh_mv.mv_outl_p((x),(p))
+
+#define __insb(p,b,c)  sh_mv.mv_insb((p), (b), (c))
+#define __insw(p,b,c)  sh_mv.mv_insw((p), (b), (c))
+#define __insl(p,b,c)  sh_mv.mv_insl((p), (b), (c))
+#define __outsb(p,b,c) sh_mv.mv_outsb((p), (b), (c))
+#define __outsw(p,b,c) sh_mv.mv_outsw((p), (b), (c))
+#define __outsl(p,b,c) sh_mv.mv_outsl((p), (b), (c))
+
+#define __readb(a)     sh_mv.mv_readb((a))
+#define __readw(a)     sh_mv.mv_readw((a))
+#define __readl(a)     sh_mv.mv_readl((a))
+#define __writeb(v,a)  sh_mv.mv_writeb((v),(a))
+#define __writew(v,a)  sh_mv.mv_writew((v),(a))
+#define __writel(v,a)  sh_mv.mv_writel((v),(a))
+
+#define inb            __inb
+#define inw            __inw
+#define inl            __inl
+#define outb           __outb
+#define outw           __outw
+#define outl           __outl
+
+#define inb_p          __inb_p
+#define inw_p          __inw_p
+#define inl_p          __inl_p
+#define outb_p         __outb_p
+#define outw_p         __outw_p
+#define outl_p         __outl_p
+
+#define insb           __insb
+#define insw           __insw
+#define insl           __insl
+#define outsb          __outsb
+#define outsw          __outsw
+#define outsl          __outsl
+
+#define __raw_readb(a)         __readb((void __iomem *)(a))
+#define __raw_readw(a)         __readw((void __iomem *)(a))
+#define __raw_readl(a)         __readl((void __iomem *)(a))
+#define __raw_writeb(v, a)     __writeb(v, (void __iomem *)(a))
+#define __raw_writew(v, a)     __writew(v, (void __iomem *)(a))
+#define __raw_writel(v, a)     __writel(v, (void __iomem *)(a))
+
+void __raw_writesl(unsigned long addr, const void *data, int longlen);
+void __raw_readsl(unsigned long addr, void *data, int longlen);
+
+/*
+ * The platform header files may define some of these macros to use
+ * the inlined versions where appropriate.  These macros may also be
+ * redefined by userlevel programs.
+ */
+#ifdef __readb
+# define readb(a)      ({ unsigned int r_ = __raw_readb(a); mb(); r_; })
+#endif
+#ifdef __raw_readw
+# define readw(a)      ({ unsigned int r_ = __raw_readw(a); mb(); r_; })
+#endif
+#ifdef __raw_readl
+# define readl(a)      ({ unsigned int r_ = __raw_readl(a); mb(); r_; })
+#endif
+
+#ifdef __raw_writeb
+# define writeb(v,a)   ({ __raw_writeb((v),(a)); mb(); })
+#endif
+#ifdef __raw_writew
+# define writew(v,a)   ({ __raw_writew((v),(a)); mb(); })
+#endif
+#ifdef __raw_writel
+# define writel(v,a)   ({ __raw_writel((v),(a)); mb(); })
+#endif
+
+#define __BUILD_MEMORY_STRING(bwlq, type)                              \
+                                                                       \
+static inline void writes##bwlq(volatile void __iomem *mem,            \
+                               const void *addr, unsigned int count)   \
+{                                                                      \
+       const volatile type *__addr = addr;                             \
+                                                                       \
+       while (count--) {                                               \
+               __raw_write##bwlq(*__addr, mem);                        \
+               __addr++;                                               \
+       }                                                               \
+}                                                                      \
+                                                                       \
+static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
+                              unsigned int count)                      \
+{                                                                      \
+       volatile type *__addr = addr;                                   \
+                                                                       \
+       while (count--) {                                               \
+               *__addr = __raw_read##bwlq(mem);                        \
+               __addr++;                                               \
+       }                                                               \
+}
+
+__BUILD_MEMORY_STRING(b, u8)
+__BUILD_MEMORY_STRING(w, u16)
+#define writesl __raw_writesl
+#define readsl  __raw_readsl
+
+#define readb_relaxed(a) readb(a)
+#define readw_relaxed(a) readw(a)
+#define readl_relaxed(a) readl(a)
+
+/* Simple MMIO */
+#define ioread8(a)             readb(a)
+#define ioread16(a)            readw(a)
+#define ioread16be(a)          be16_to_cpu(__raw_readw((a)))
+#define ioread32(a)            readl(a)
+#define ioread32be(a)          be32_to_cpu(__raw_readl((a)))
+
+#define iowrite8(v,a)          writeb((v),(a))
+#define iowrite16(v,a)         writew((v),(a))
+#define iowrite16be(v,a)       __raw_writew(cpu_to_be16((v)),(a))
+#define iowrite32(v,a)         writel((v),(a))
+#define iowrite32be(v,a)       __raw_writel(cpu_to_be32((v)),(a))
+
+#define ioread8_rep(a, d, c)   readsb((a), (d), (c))
+#define ioread16_rep(a, d, c)  readsw((a), (d), (c))
+#define ioread32_rep(a, d, c)  readsl((a), (d), (c))
+
+#define iowrite8_rep(a, s, c)  writesb((a), (s), (c))
+#define iowrite16_rep(a, s, c) writesw((a), (s), (c))
+#define iowrite32_rep(a, s, c) writesl((a), (s), (c))
+
+#define mmiowb()       wmb()   /* synco on SH-4A, otherwise a nop */
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+/*
+ * This function provides a method for the generic case where a board-specific
+ * ioport_map simply needs to return the port + some arbitrary port base.
+ *
+ * We use this at board setup time to implicitly set the port base, and
+ * as a result, we can use the generic ioport_map.
+ */
+static inline void __set_io_port_base(unsigned long pbase)
+{
+       extern unsigned long generic_io_base;
+
+       generic_io_base = pbase;
+}
+
+#define __ioport_map(p, n) sh_mv.mv_ioport_map((p), (n))
+
+/* We really want to try and get these to memcpy etc */
+extern void memcpy_fromio(void *, volatile void __iomem *, unsigned long);
+extern void memcpy_toio(volatile void __iomem *, const void *, unsigned long);
+extern void memset_io(volatile void __iomem *, int, unsigned long);
+
+/* SuperH on-chip I/O functions */
+static inline unsigned char ctrl_inb(unsigned long addr)
+{
+       return *(volatile unsigned char*)addr;
+}
+
+static inline unsigned short ctrl_inw(unsigned long addr)
+{
+       return *(volatile unsigned short*)addr;
+}
+
+static inline unsigned int ctrl_inl(unsigned long addr)
+{
+       return *(volatile unsigned long*)addr;
+}
+
+static inline unsigned long long ctrl_inq(unsigned long addr)
+{
+       return *(volatile unsigned long long*)addr;
+}
+
+static inline void ctrl_outb(unsigned char b, unsigned long addr)
+{
+       *(volatile unsigned char*)addr = b;
+}
+
+static inline void ctrl_outw(unsigned short b, unsigned long addr)
+{
+       *(volatile unsigned short*)addr = b;
+}
+
+static inline void ctrl_outl(unsigned int b, unsigned long addr)
+{
+        *(volatile unsigned long*)addr = b;
+}
+
+static inline void ctrl_outq(unsigned long long b, unsigned long addr)
+{
+       *(volatile unsigned long long*)addr = b;
+}
+
+static inline void ctrl_delay(void)
+{
+#ifdef P2SEG
+       ctrl_inw(P2SEG);
+#endif
+}
+
+/* Quad-word real-mode I/O, don't ask.. */
+unsigned long long peek_real_address_q(unsigned long long addr);
+unsigned long long poke_real_address_q(unsigned long long addr,
+                                      unsigned long long val);
+
+#if !defined(CONFIG_MMU)
+#define virt_to_phys(address)  ((unsigned long)(address))
+#define phys_to_virt(address)  ((void *)(address))
+#else
+#define virt_to_phys(address)  (__pa(address))
+#define phys_to_virt(address)  (__va(address))
+#endif
+
+/*
+ * On 32-bit SH, we traditionally have the whole physical address space
+ * mapped at all times (as MIPS does), so "ioremap()" and "iounmap()" do
+ * not need to do anything but place the address in the proper segment.
+ * This is true for P1 and P2 addresses, as well as some P3 ones.
+ * However, most of the P3 addresses and newer cores using extended
+ * addressing need to map through page tables, so the ioremap()
+ * implementation becomes a bit more complicated.
+ *
+ * See arch/sh/mm/ioremap.c for additional notes on this.
+ *
+ * We cheat a bit and always return uncachable areas until we've fixed
+ * the drivers to handle caching properly.
+ *
+ * On the SH-5 the concept of segmentation in the 1:1 PXSEG sense simply
+ * doesn't exist, so everything must go through page tables.
+ */
+#ifdef CONFIG_MMU
+void __iomem *__ioremap(unsigned long offset, unsigned long size,
+                       unsigned long flags);
+void __iounmap(void __iomem *addr);
+
+/* arch/sh/mm/ioremap_64.c */
+unsigned long onchip_remap(unsigned long addr, unsigned long size,
+                          const char *name);
+extern void onchip_unmap(unsigned long vaddr);
+#else
+#define __ioremap(offset, size, flags) ((void __iomem *)(offset))
+#define __iounmap(addr)                        do { } while (0)
+#define onchip_remap(addr, size, name) (addr)
+#define onchip_unmap(addr)             do { } while (0)
+#endif /* CONFIG_MMU */
+
+static inline void __iomem *
+__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
+{
+#ifdef CONFIG_SUPERH32
+       unsigned long last_addr = offset + size - 1;
+#endif
+       void __iomem *ret;
+
+       ret = __ioremap_trapped(offset, size);
+       if (ret)
+               return ret;
+
+#ifdef CONFIG_SUPERH32
+       /*
+        * For P1 and P2 space this is trivial, as everything is already
+        * mapped. Uncached access for P1 addresses are done through P2.
+        * In the P3 case or for addresses outside of the 29-bit space,
+        * mapping must be done by the PMB or by using page tables.
+        */
+       if (likely(PXSEG(offset) < P3SEG && PXSEG(last_addr) < P3SEG)) {
+               if (unlikely(flags & _PAGE_CACHABLE))
+                       return (void __iomem *)P1SEGADDR(offset);
+
+               return (void __iomem *)P2SEGADDR(offset);
+       }
+#endif
+
+       return __ioremap(offset, size, flags);
+}
+
+#define ioremap(offset, size)                          \
+       __ioremap_mode((offset), (size), 0)
+#define ioremap_nocache(offset, size)                  \
+       __ioremap_mode((offset), (size), 0)
+#define ioremap_cache(offset, size)                    \
+       __ioremap_mode((offset), (size), _PAGE_CACHABLE)
+#define p3_ioremap(offset, size, flags)                        \
+       __ioremap((offset), (size), (flags))
+#define iounmap(addr)                                  \
+       __iounmap((addr))
+
+/*
+ * 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 /* __ASM_SH_IO_H */
diff --git a/arch/sh/include/asm/io_generic.h b/arch/sh/include/asm/io_generic.h
new file mode 100644 (file)
index 0000000..92fc607
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Trivial I/O routine definitions, intentionally meant to be included
+ * multiple times. Ugly I/O routine concatenation helpers taken from
+ * alpha. Must be included _before_ io.h to avoid preprocessor-induced
+ * routine mismatch.
+ */
+#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
+#define _IO_CONCAT(a,b)        a ## _ ## b
+
+#ifndef __IO_PREFIX
+#error "Don't include this header without a valid system prefix"
+#endif
+
+u8 IO_CONCAT(__IO_PREFIX,inb)(unsigned long);
+u16 IO_CONCAT(__IO_PREFIX,inw)(unsigned long);
+u32 IO_CONCAT(__IO_PREFIX,inl)(unsigned long);
+
+void IO_CONCAT(__IO_PREFIX,outb)(u8, unsigned long);
+void IO_CONCAT(__IO_PREFIX,outw)(u16, unsigned long);
+void IO_CONCAT(__IO_PREFIX,outl)(u32, unsigned long);
+
+u8 IO_CONCAT(__IO_PREFIX,inb_p)(unsigned long);
+u16 IO_CONCAT(__IO_PREFIX,inw_p)(unsigned long);
+u32 IO_CONCAT(__IO_PREFIX,inl_p)(unsigned long);
+void IO_CONCAT(__IO_PREFIX,outb_p)(u8, unsigned long);
+void IO_CONCAT(__IO_PREFIX,outw_p)(u16, unsigned long);
+void IO_CONCAT(__IO_PREFIX,outl_p)(u32, unsigned long);
+
+void IO_CONCAT(__IO_PREFIX,insb)(unsigned long, void *dst, unsigned long count);
+void IO_CONCAT(__IO_PREFIX,insw)(unsigned long, void *dst, unsigned long count);
+void IO_CONCAT(__IO_PREFIX,insl)(unsigned long, void *dst, unsigned long count);
+void IO_CONCAT(__IO_PREFIX,outsb)(unsigned long, const void *src, unsigned long count);
+void IO_CONCAT(__IO_PREFIX,outsw)(unsigned long, const void *src, unsigned long count);
+void IO_CONCAT(__IO_PREFIX,outsl)(unsigned long, const void *src, unsigned long count);
+
+u8 IO_CONCAT(__IO_PREFIX,readb)(void __iomem *);
+u16 IO_CONCAT(__IO_PREFIX,readw)(void __iomem *);
+u32 IO_CONCAT(__IO_PREFIX,readl)(void __iomem *);
+void IO_CONCAT(__IO_PREFIX,writeb)(u8, void __iomem *);
+void IO_CONCAT(__IO_PREFIX,writew)(u16, void __iomem *);
+void IO_CONCAT(__IO_PREFIX,writel)(u32, void __iomem *);
+
+void *IO_CONCAT(__IO_PREFIX,ioremap)(unsigned long offset, unsigned long size);
+void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr);
+
+void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size);
+void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr);
+
+#undef __IO_PREFIX
diff --git a/arch/sh/include/asm/io_trapped.h b/arch/sh/include/asm/io_trapped.h
new file mode 100644 (file)
index 0000000..f1251d4
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ASM_SH_IO_TRAPPED_H
+#define __ASM_SH_IO_TRAPPED_H
+
+#include <linux/list.h>
+#include <linux/ioport.h>
+#include <asm/page.h>
+
+#define IO_TRAPPED_MAGIC 0xfeedbeef
+
+struct trapped_io {
+       unsigned int magic;
+       struct resource *resource;
+       unsigned int num_resources;
+       unsigned int minimum_bus_width;
+       struct list_head list;
+       void __iomem *virt_base;
+} __aligned(PAGE_SIZE);
+
+#ifdef CONFIG_IO_TRAPPED
+int register_trapped_io(struct trapped_io *tiop);
+int handle_trapped_io(struct pt_regs *regs, unsigned long address);
+
+void __iomem *match_trapped_io_handler(struct list_head *list,
+                                      unsigned long offset,
+                                      unsigned long size);
+
+#ifdef CONFIG_HAS_IOMEM
+extern struct list_head trapped_mem;
+
+static inline void __iomem *
+__ioremap_trapped(unsigned long offset, unsigned long size)
+{
+       return match_trapped_io_handler(&trapped_mem, offset, size);
+}
+#else
+#define __ioremap_trapped(offset, size) NULL
+#endif
+
+#ifdef CONFIG_HAS_IOPORT
+extern struct list_head trapped_io;
+
+static inline void __iomem *
+__ioport_map_trapped(unsigned long offset, unsigned long size)
+{
+       return match_trapped_io_handler(&trapped_io, offset, size);
+}
+#else
+#define __ioport_map_trapped(offset, size) NULL
+#endif
+
+#else
+#define register_trapped_io(tiop) (-1)
+#define handle_trapped_io(tiop, address) 0
+#define __ioremap_trapped(offset, size) NULL
+#define __ioport_map_trapped(offset, size) NULL
+#endif
+
+#endif /* __ASM_SH_IO_TRAPPED_H */
diff --git a/arch/sh/include/asm/ioctl.h b/arch/sh/include/asm/ioctl.h
new file mode 100644 (file)
index 0000000..b279fe0
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/ioctl.h>
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/asm/ioctls.h
new file mode 100644 (file)
index 0000000..c212c37
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef __ASM_SH_IOCTLS_H
+#define __ASM_SH_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 TCGETS         0x5401
+#define TCSETS         0x5402
+#define TCSETSW                0x5403
+#define TCSETSF                0x5404
+
+#define TCGETA         0x80127417      /* _IOR('t', 23, struct termio) */
+#define TCSETA         0x40127418      /* _IOW('t', 24, struct termio) */
+#define TCSETAW                0x40127419      /* _IOW('t', 25, struct termio) */
+#define TCSETAF                0x4012741C      /* _IOW('t', 28, struct termio) */
+
+#define TCSBRK         _IO('t', 29)
+#define TCXONC         _IO('t', 30)
+#define TCFLSH         _IO('t', 31)
+
+#define TIOCSWINSZ     0x40087467      /* _IOW('t', 103, struct winsize) */
+#define TIOCGWINSZ     0x80087468      /* _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 TIOCSPGRP      _IOW('t', 118, int)
+#define TIOCGPGRP      _IOR('t', 119, int)
+
+#define TIOCEXCL       _IO('T', 12) /* 0x540C */
+#define TIOCNXCL       _IO('T', 13) /* 0x540D */
+#define TIOCSCTTY      _IO('T', 14) /* 0x540E */
+
+#define TIOCSTI                _IOW('T', 18, char) /* 0x5412 */
+#define TIOCMGET       _IOR('T', 21, unsigned int) /* 0x5415 */
+#define TIOCMBIS       _IOW('T', 22, unsigned int) /* 0x5416 */
+#define TIOCMBIC       _IOW('T', 23, unsigned int) /* 0x5417 */
+#define TIOCMSET       _IOW('T', 24, unsigned int) /* 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 TIOCGSOFTCAR   _IOR('T', 25, unsigned int) /* 0x5419 */
+#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int) /* 0x541A */
+#define TIOCLINUX      _IOW('T', 28, char) /* 0x541C */
+#define TIOCCONS       _IO('T', 29) /* 0x541D */
+#define TIOCGSERIAL    0x803C541E      /* _IOR('T', 30, struct serial_struct) 0x541E */
+#define TIOCSSERIAL    0x403C541F      /* _IOW('T', 31, struct serial_struct) 0x541F */
+#define TIOCPKT                _IOW('T', 32, int) /* 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      _IO('T', 34) /* 0x5422 */
+#define TIOCSETD       _IOW('T', 35, int) /* 0x5423 */
+#define TIOCGETD       _IOR('T', 36, int) /* 0x5424 */
+#define TCSBRKP                _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
+#define TIOCSBRK       _IO('T', 39) /* 0x5427 */ /* BSD compatibility */
+#define TIOCCBRK       _IO('T', 40) /* 0x5428 */ /* BSD compatibility */
+#define TIOCGSID       _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
+#define TCGETS2                _IOR('T', 42, struct termios2)
+#define TCSETS2                _IOW('T', 43, struct termios2)
+#define TCSETSW2       _IOW('T', 44, struct termios2)
+#define TCSETSF2       _IOW('T', 45, struct termios2)
+#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  _IO('T', 83) /* 0x5453 */
+#define TIOCSERGWILD   _IOR('T', 84,  int) /* 0x5454 */
+#define TIOCSERSWILD   _IOW('T', 85,  int) /* 0x5455 */
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x80d85458      /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
+#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
+  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
+#define TIOCSERGETMULTI 0x80A8545A     /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
+#define TIOCSERSETMULTI 0x40A8545B     /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
+
+#define TIOCMIWAIT     _IO('T', 92) /* 0x545C */       /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
+
+#endif /* __ASM_SH_IOCTLS_H */
diff --git a/arch/sh/include/asm/ipcbuf.h b/arch/sh/include/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..5ffc997
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __ASM_SH_IPCBUF_H__
+#define __ASM_SH_IPCBUF_H__
+
+/*
+ * The ipc64_perm structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t and seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct ipc64_perm
+{
+       __kernel_key_t          key;
+       __kernel_uid32_t        uid;
+       __kernel_gid32_t        gid;
+       __kernel_uid32_t        cuid;
+       __kernel_gid32_t        cgid;
+       __kernel_mode_t         mode;
+       unsigned short          __pad1;
+       unsigned short          seq;
+       unsigned short          __pad2;
+       unsigned long           __unused1;
+       unsigned long           __unused2;
+};
+
+#endif /* __ASM_SH_IPCBUF_H__ */
diff --git a/arch/sh/include/asm/irq.h b/arch/sh/include/asm/irq.h
new file mode 100644 (file)
index 0000000..6195a53
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __ASM_SH_IRQ_H
+#define __ASM_SH_IRQ_H
+
+#include <asm/machvec.h>
+
+/*
+ * A sane default based on a reasonable vector table size, platforms are
+ * advised to cap this at the hard limit that they're interested in
+ * through the machvec.
+ */
+#define NR_IRQS 256
+
+/*
+ * Convert back and forth between INTEVT and IRQ values.
+ */
+#ifdef CONFIG_CPU_HAS_INTEVT
+#define evt2irq(evt)           (((evt) >> 5) - 16)
+#define irq2evt(irq)           (((irq) + 16) << 5)
+#else
+#define evt2irq(evt)           (evt)
+#define irq2evt(irq)           (irq)
+#endif
+
+/*
+ * Simple Mask Register Support
+ */
+extern void make_maskreg_irq(unsigned int irq);
+extern unsigned short *irq_mask_register;
+
+/*
+ * PINT IRQs
+ */
+void init_IRQ_pint(void);
+void make_imask_irq(unsigned int irq);
+
+static inline int generic_irq_demux(int irq)
+{
+       return irq;
+}
+
+#define irq_canonicalize(irq)  (irq)
+#define irq_demux(irq)         sh_mv.mv_irq_demux(irq)
+
+#ifdef CONFIG_IRQSTACKS
+extern void irq_ctx_init(int cpu);
+extern void irq_ctx_exit(int cpu);
+# define __ARCH_HAS_DO_SOFTIRQ
+#else
+# define irq_ctx_init(cpu) do { } while (0)
+# define irq_ctx_exit(cpu) do { } while (0)
+#endif
+
+#ifdef CONFIG_CPU_SH5
+#include <cpu/irq.h>
+#endif
+
+#endif /* __ASM_SH_IRQ_H */
diff --git a/arch/sh/include/asm/irq_regs.h b/arch/sh/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/sh/include/asm/irqflags.h b/arch/sh/include/asm/irqflags.h
new file mode 100644 (file)
index 0000000..46e71da
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ASM_SH_IRQFLAGS_H
+#define __ASM_SH_IRQFLAGS_H
+
+#ifdef CONFIG_SUPERH32
+#include "irqflags_32.h"
+#else
+#include "irqflags_64.h"
+#endif
+
+#define raw_local_save_flags(flags) \
+               do { (flags) = __raw_local_save_flags(); } while (0)
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return (flags != 0);
+}
+
+static inline int raw_irqs_disabled(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       return raw_irqs_disabled_flags(flags);
+}
+
+#define raw_local_irq_save(flags) \
+               do { (flags) = __raw_local_irq_save(); } while (0)
+
+static inline void raw_local_irq_restore(unsigned long flags)
+{
+       if ((flags & 0xf0) != 0xf0)
+               raw_local_irq_enable();
+}
+
+#endif /* __ASM_SH_IRQFLAGS_H */
diff --git a/arch/sh/include/asm/irqflags_32.h b/arch/sh/include/asm/irqflags_32.h
new file mode 100644 (file)
index 0000000..60218f5
--- /dev/null
@@ -0,0 +1,99 @@
+#ifndef __ASM_SH_IRQFLAGS_32_H
+#define __ASM_SH_IRQFLAGS_32_H
+
+static inline void raw_local_irq_enable(void)
+{
+       unsigned long __dummy0, __dummy1;
+
+       __asm__ __volatile__ (
+               "stc    sr, %0\n\t"
+               "and    %1, %0\n\t"
+#ifdef CONFIG_CPU_HAS_SR_RB
+               "stc    r6_bank, %1\n\t"
+               "or     %1, %0\n\t"
+#endif
+               "ldc    %0, sr\n\t"
+               : "=&r" (__dummy0), "=r" (__dummy1)
+               : "1" (~0x000000f0)
+               : "memory"
+       );
+}
+
+static inline void raw_local_irq_disable(void)
+{
+       unsigned long flags;
+
+       __asm__ __volatile__ (
+               "stc    sr, %0\n\t"
+               "or     #0xf0, %0\n\t"
+               "ldc    %0, sr\n\t"
+               : "=&z" (flags)
+               : /* no inputs */
+               : "memory"
+       );
+}
+
+static inline void set_bl_bit(void)
+{
+       unsigned long __dummy0, __dummy1;
+
+       __asm__ __volatile__ (
+               "stc    sr, %0\n\t"
+               "or     %2, %0\n\t"
+               "and    %3, %0\n\t"
+               "ldc    %0, sr\n\t"
+               : "=&r" (__dummy0), "=r" (__dummy1)
+               : "r" (0x10000000), "r" (0xffffff0f)
+               : "memory"
+       );
+}
+
+static inline void clear_bl_bit(void)
+{
+       unsigned long __dummy0, __dummy1;
+
+       __asm__ __volatile__ (
+               "stc    sr, %0\n\t"
+               "and    %2, %0\n\t"
+               "ldc    %0, sr\n\t"
+               : "=&r" (__dummy0), "=r" (__dummy1)
+               : "1" (~0x10000000)
+               : "memory"
+       );
+}
+
+static inline unsigned long __raw_local_save_flags(void)
+{
+       unsigned long flags;
+
+       __asm__ __volatile__ (
+               "stc    sr, %0\n\t"
+               "and    #0xf0, %0\n\t"
+               : "=&z" (flags)
+               : /* no inputs */
+               : "memory"
+       );
+
+       return flags;
+}
+
+static inline unsigned long __raw_local_irq_save(void)
+{
+       unsigned long flags, __dummy;
+
+       __asm__ __volatile__ (
+               "stc    sr, %1\n\t"
+               "mov    %1, %0\n\t"
+               "or     #0xf0, %0\n\t"
+               "ldc    %0, sr\n\t"
+               "mov    %1, %0\n\t"
+               "and    #0xf0, %0\n\t"
+               : "=&z" (flags), "=&r" (__dummy)
+               : /* no inputs */
+               : "memory"
+       );
+
+       return flags;
+}
+
+#endif /* __ASM_SH_IRQFLAGS_32_H */
diff --git a/arch/sh/include/asm/irqflags_64.h b/arch/sh/include/asm/irqflags_64.h
new file mode 100644 (file)
index 0000000..88f6522
--- /dev/null
@@ -0,0 +1,85 @@
+#ifndef __ASM_SH_IRQFLAGS_64_H
+#define __ASM_SH_IRQFLAGS_64_H
+
+#include <cpu/registers.h>
+
+#define SR_MASK_LL     0x00000000000000f0LL
+#define SR_BL_LL       0x0000000010000000LL
+
+static inline void raw_local_irq_enable(void)
+{
+       unsigned long long __dummy0, __dummy1 = ~SR_MASK_LL;
+
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "and       %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy0)
+                            : "r" (__dummy1));
+}
+
+static inline void raw_local_irq_disable(void)
+{
+       unsigned long long __dummy0, __dummy1 = SR_MASK_LL;
+
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "or        %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy0)
+                            : "r" (__dummy1));
+}
+
+static inline void set_bl_bit(void)
+{
+       unsigned long long __dummy0, __dummy1 = SR_BL_LL;
+
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "or        %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy0)
+                            : "r" (__dummy1));
+
+}
+
+static inline void clear_bl_bit(void)
+{
+       unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
+
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "and       %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy0)
+                            : "r" (__dummy1));
+}
+
+static inline unsigned long __raw_local_save_flags(void)
+{
+       unsigned long long __dummy = SR_MASK_LL;
+       unsigned long flags;
+
+       __asm__ __volatile__ (
+               "getcon " __SR ", %0\n\t"
+               "and    %0, %1, %0"
+               : "=&r" (flags)
+               : "r" (__dummy));
+
+       return flags;
+}
+
+static inline unsigned long __raw_local_irq_save(void)
+{
+       unsigned long long __dummy0, __dummy1 = SR_MASK_LL;
+       unsigned long flags;
+
+       __asm__ __volatile__ (
+               "getcon " __SR ", %1\n\t"
+               "or     %1, r63, %0\n\t"
+               "or     %1, %2, %1\n\t"
+               "putcon %1, " __SR "\n\t"
+               "and    %0, %2, %0"
+               : "=&r" (flags), "=&r" (__dummy0)
+               : "r" (__dummy1));
+
+       return flags;
+}
+
+#endif /* __ASM_SH_IRQFLAGS_64_H */
diff --git a/arch/sh/include/asm/kdebug.h b/arch/sh/include/asm/kdebug.h
new file mode 100644 (file)
index 0000000..49cd690
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __ASM_SH_KDEBUG_H
+#define __ASM_SH_KDEBUG_H
+
+/* Grossly misnamed. */
+enum die_val {
+       DIE_TRAP,
+};
+
+#endif /* __ASM_SH_KDEBUG_H */
diff --git a/arch/sh/include/asm/kexec.h b/arch/sh/include/asm/kexec.h
new file mode 100644 (file)
index 0000000..00f4260
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef __ASM_SH_KEXEC_H
+#define __ASM_SH_KEXEC_H
+
+#include <asm/ptrace.h>
+#include <asm/string.h>
+
+/*
+ * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
+ * I.e. Maximum page that is mapped directly into kernel memory,
+ * and kmap is not required.
+ *
+ * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
+ * calculation for the amount of memory directly mappable into the
+ * kernel memory space.
+ */
+
+/* Maximum physical address we can use pages from */
+#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
+/* Maximum address we can reach in physical address mode */
+#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
+/* Maximum address we can use for the control code buffer */
+#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
+
+#define KEXEC_CONTROL_CODE_SIZE        4096
+
+/* The native architecture */
+#define KEXEC_ARCH KEXEC_ARCH_SH
+
+static inline void crash_setup_regs(struct pt_regs *newregs,
+                                   struct pt_regs *oldregs)
+{
+       if (oldregs)
+               memcpy(newregs, oldregs, sizeof(*newregs));
+       else {
+               __asm__ __volatile__ ("mov r0, %0" : "=r" (newregs->regs[0]));
+               __asm__ __volatile__ ("mov r1, %0" : "=r" (newregs->regs[1]));
+               __asm__ __volatile__ ("mov r2, %0" : "=r" (newregs->regs[2]));
+               __asm__ __volatile__ ("mov r3, %0" : "=r" (newregs->regs[3]));
+               __asm__ __volatile__ ("mov r4, %0" : "=r" (newregs->regs[4]));
+               __asm__ __volatile__ ("mov r5, %0" : "=r" (newregs->regs[5]));
+               __asm__ __volatile__ ("mov r6, %0" : "=r" (newregs->regs[6]));
+               __asm__ __volatile__ ("mov r7, %0" : "=r" (newregs->regs[7]));
+               __asm__ __volatile__ ("mov r8, %0" : "=r" (newregs->regs[8]));
+               __asm__ __volatile__ ("mov r9, %0" : "=r" (newregs->regs[9]));
+               __asm__ __volatile__ ("mov r10, %0" : "=r" (newregs->regs[10]));
+               __asm__ __volatile__ ("mov r11, %0" : "=r" (newregs->regs[11]));
+               __asm__ __volatile__ ("mov r12, %0" : "=r" (newregs->regs[12]));
+               __asm__ __volatile__ ("mov r13, %0" : "=r" (newregs->regs[13]));
+               __asm__ __volatile__ ("mov r14, %0" : "=r" (newregs->regs[14]));
+               __asm__ __volatile__ ("mov r15, %0" : "=r" (newregs->regs[15]));
+
+               __asm__ __volatile__ ("sts pr, %0" : "=r" (newregs->pr));
+               __asm__ __volatile__ ("sts macl, %0" : "=r" (newregs->macl));
+               __asm__ __volatile__ ("sts mach, %0" : "=r" (newregs->mach));
+
+               __asm__ __volatile__ ("stc gbr, %0" : "=r" (newregs->gbr));
+               __asm__ __volatile__ ("stc sr, %0" : "=r" (newregs->sr));
+
+               newregs->pc = (unsigned long)current_text_addr();
+       }
+}
+#endif /* __ASM_SH_KEXEC_H */
diff --git a/arch/sh/include/asm/kgdb.h b/arch/sh/include/asm/kgdb.h
new file mode 100644 (file)
index 0000000..24e4207
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Based on original code by Glenn Engel, Jim Kingdon,
+ * David Grothe <dave@gcom.com>, Tigran Aivazian, <tigran@sco.com> and
+ * Amit S. Kale <akale@veritas.com>
+ * 
+ * Super-H port based on sh-stub.c (Ben Lee and Steve Chamberlain) by
+ * Henry Bell <henry.bell@st.com>
+ * 
+ * Header file for low-level support for remote debug using GDB. 
+ *
+ */
+
+#ifndef __KGDB_H
+#define __KGDB_H
+
+#include <asm/ptrace.h>
+
+/* Same as pt_regs but has vbr in place of syscall_nr */
+struct kgdb_regs {
+        unsigned long regs[16];
+        unsigned long pc;
+        unsigned long pr;
+        unsigned long sr;
+        unsigned long gbr;
+        unsigned long mach;
+        unsigned long macl;
+        unsigned long vbr;
+};
+
+/* State info */
+extern char kgdb_in_gdb_mode;
+extern int kgdb_nofault;       /* Ignore bus errors (in gdb mem access) */
+extern char in_nmi;            /* Debounce flag to prevent NMI reentry*/
+
+/* SCI */
+extern int kgdb_portnum;
+extern int kgdb_baud;
+extern char kgdb_parity;
+extern char kgdb_bits;
+
+/* Init and interface stuff */
+extern int kgdb_init(void);
+extern int (*kgdb_getchar)(void);
+extern void (*kgdb_putchar)(int);
+
+/* Trap functions */
+typedef void (kgdb_debug_hook_t)(struct pt_regs *regs);
+typedef void (kgdb_bus_error_hook_t)(void);
+extern kgdb_debug_hook_t  *kgdb_debug_hook;
+extern kgdb_bus_error_hook_t *kgdb_bus_err_hook;
+
+/* Console */
+struct console;
+void kgdb_console_write(struct console *co, const char *s, unsigned count);
+extern int kgdb_console_setup(struct console *, char *);
+
+/* Prototypes for jmp fns */
+#define _JBLEN 9
+typedef        int jmp_buf[_JBLEN];
+extern void    longjmp(jmp_buf __jmpb, int __retval);
+extern int     setjmp(jmp_buf __jmpb);
+
+/* Forced breakpoint */
+#define breakpoint()   __asm__ __volatile__("trapa   #0x3c")
+
+#endif
diff --git a/arch/sh/include/asm/kmap_types.h b/arch/sh/include/asm/kmap_types.h
new file mode 100644 (file)
index 0000000..84d565c
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __SH_KMAP_TYPES_H
+#define __SH_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/sh/include/asm/lboxre2.h b/arch/sh/include/asm/lboxre2.h
new file mode 100644 (file)
index 0000000..e6d1605
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __ASM_SH_LBOXRE2_H
+#define __ASM_SH_LBOXRE2_H
+
+/*
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * NTT COMWARE L-BOX RE2 support
+ *
+ * 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.
+ *
+ */
+
+#define IRQ_CF1                9       /* CF1 */
+#define IRQ_CF0                10      /* CF0 */
+#define IRQ_INTD       11      /* INTD */
+#define IRQ_ETH1       12      /* Ether1 */
+#define IRQ_ETH0       13      /* Ether0 */
+#define IRQ_INTA       14      /* INTA */
+
+void init_lboxre2_IRQ(void);
+
+#define __IO_PREFIX    lboxre2
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_LBOXRE2_H */
diff --git a/arch/sh/include/asm/linkage.h b/arch/sh/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..3565a4f
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN .balign 4
+#define __ALIGN_STR ".balign 4"
+
+#endif
diff --git a/arch/sh/include/asm/local.h b/arch/sh/include/asm/local.h
new file mode 100644 (file)
index 0000000..9ed9b9c
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_SH_LOCAL_H
+#define __ASM_SH_LOCAL_H
+
+#include <asm-generic/local.h>
+
+#endif /* __ASM_SH_LOCAL_H */
+
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
new file mode 100644 (file)
index 0000000..b2e4124
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * include/asm-sh/machvec.h
+ *
+ * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+
+#ifndef _ASM_SH_MACHVEC_H
+#define _ASM_SH_MACHVEC_H
+
+#include <linux/types.h>
+#include <linux/time.h>
+#include <asm/machtypes.h>
+
+struct device;
+
+struct sh_machine_vector {
+       void (*mv_setup)(char **cmdline_p);
+       const char *mv_name;
+       int mv_nr_irqs;
+
+       u8 (*mv_inb)(unsigned long);
+       u16 (*mv_inw)(unsigned long);
+       u32 (*mv_inl)(unsigned long);
+       void (*mv_outb)(u8, unsigned long);
+       void (*mv_outw)(u16, unsigned long);
+       void (*mv_outl)(u32, unsigned long);
+
+       u8 (*mv_inb_p)(unsigned long);
+       u16 (*mv_inw_p)(unsigned long);
+       u32 (*mv_inl_p)(unsigned long);
+       void (*mv_outb_p)(u8, unsigned long);
+       void (*mv_outw_p)(u16, unsigned long);
+       void (*mv_outl_p)(u32, unsigned long);
+
+       void (*mv_insb)(unsigned long, void *dst, unsigned long count);
+       void (*mv_insw)(unsigned long, void *dst, unsigned long count);
+       void (*mv_insl)(unsigned long, void *dst, unsigned long count);
+       void (*mv_outsb)(unsigned long, const void *src, unsigned long count);
+       void (*mv_outsw)(unsigned long, const void *src, unsigned long count);
+       void (*mv_outsl)(unsigned long, const void *src, unsigned long count);
+
+       u8 (*mv_readb)(void __iomem *);
+       u16 (*mv_readw)(void __iomem *);
+       u32 (*mv_readl)(void __iomem *);
+       void (*mv_writeb)(u8, void __iomem *);
+       void (*mv_writew)(u16, void __iomem *);
+       void (*mv_writel)(u32, void __iomem *);
+
+       int (*mv_irq_demux)(int irq);
+
+       void (*mv_init_irq)(void);
+       void (*mv_init_pci)(void);
+
+       void (*mv_heartbeat)(void);
+
+       void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
+       void (*mv_ioport_unmap)(void __iomem *);
+};
+
+extern struct sh_machine_vector sh_mv;
+
+#define get_system_type()      sh_mv.mv_name
+
+#define __initmv \
+       __used __section(.machvec.init)
+
+#endif /* _ASM_SH_MACHVEC_H */
diff --git a/arch/sh/include/asm/magicpanelr2.h b/arch/sh/include/asm/magicpanelr2.h
new file mode 100644 (file)
index 0000000..c644a77
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *  include/asm-sh/magicpanelr2.h
+ *
+ *  Copyright (C) 2007  Markus Brunner, Mark Jonas
+ *
+ *  I/O addresses and bitmasks for Magic Panel Release 2 board
+ *
+ * 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.
+ */
+
+#ifndef __ASM_SH_MAGICPANELR2_H
+#define __ASM_SH_MAGICPANELR2_H
+
+#include <asm/gpio.h>
+
+#define __IO_PREFIX mpr2
+#include <asm/io_generic.h>
+
+
+#define SETBITS_OUTB(mask, reg)   ctrl_outb(ctrl_inb(reg) | mask, reg)
+#define SETBITS_OUTW(mask, reg)   ctrl_outw(ctrl_inw(reg) | mask, reg)
+#define SETBITS_OUTL(mask, reg)   ctrl_outl(ctrl_inl(reg) | mask, reg)
+#define CLRBITS_OUTB(mask, reg)   ctrl_outb(ctrl_inb(reg) & ~mask, reg)
+#define CLRBITS_OUTW(mask, reg)   ctrl_outw(ctrl_inw(reg) & ~mask, reg)
+#define CLRBITS_OUTL(mask, reg)   ctrl_outl(ctrl_inl(reg) & ~mask, reg)
+
+
+#define PA_LED          PORT_PADR      /* LED */
+
+
+/* BSC */
+#define CMNCR           0xA4FD0000UL
+#define CS0BCR          0xA4FD0004UL
+#define CS2BCR          0xA4FD0008UL
+#define CS3BCR          0xA4FD000CUL
+#define CS4BCR          0xA4FD0010UL
+#define CS5ABCR         0xA4FD0014UL
+#define CS5BBCR         0xA4FD0018UL
+#define CS6ABCR         0xA4FD001CUL
+#define CS6BBCR         0xA4FD0020UL
+#define CS0WCR          0xA4FD0024UL
+#define CS2WCR          0xA4FD0028UL
+#define CS3WCR          0xA4FD002CUL
+#define CS4WCR          0xA4FD0030UL
+#define CS5AWCR         0xA4FD0034UL
+#define CS5BWCR         0xA4FD0038UL
+#define CS6AWCR         0xA4FD003CUL
+#define CS6BWCR         0xA4FD0040UL
+
+
+/* usb */
+
+#define PORT_UTRCTL            0xA405012CUL
+#define PORT_UCLKCR_W          0xA40A0008UL
+
+#define INTC_ICR0              0xA414FEE0UL
+#define INTC_ICR1              0xA4140010UL
+#define INTC_ICR2              0xA4140012UL
+
+/* MTD */
+
+#define MPR2_MTD_BOOTLOADER_SIZE       0x00060000UL
+#define MPR2_MTD_KERNEL_SIZE           0x00200000UL
+
+#endif  /* __ASM_SH_MAGICPANELR2_H */
diff --git a/arch/sh/include/asm/mc146818rtc.h b/arch/sh/include/asm/mc146818rtc.h
new file mode 100644 (file)
index 0000000..0aee96a
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
+
+#endif /* _ASM_MC146818RTC_H */
diff --git a/arch/sh/include/asm/microdev.h b/arch/sh/include/asm/microdev.h
new file mode 100644 (file)
index 0000000..1aed158
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * linux/include/asm-sh/microdev.h
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ *
+ * Definitions for the SuperH SH4-202 MicroDev board.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+#ifndef __ASM_SH_MICRODEV_H
+#define __ASM_SH_MICRODEV_H
+
+extern void init_microdev_irq(void);
+extern void microdev_print_fpga_intc_status(void);
+
+/*
+ * The following are useful macros for manipulating the interrupt
+ * controller (INTC) on the CPU-board FPGA.  should be noted that there
+ * is an INTC on the FPGA, and a separate INTC on the SH4-202 core -
+ * these are two different things, both of which need to be prorammed to
+ * correctly route - unfortunately, they have the same name and
+ * abbreviations!
+ */
+#define        MICRODEV_FPGA_INTC_BASE         0xa6110000ul                            /* INTC base address on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTENB_REG        (MICRODEV_FPGA_INTC_BASE+0ul)           /* Interrupt Enable Register on INTC on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTDSB_REG        (MICRODEV_FPGA_INTC_BASE+8ul)           /* Interrupt Disable Register on INTC on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTC_MASK(n)      (1ul<<(n))                              /* Interrupt mask to enable/disable INTC in CPU-board FPGA */
+#define        MICRODEV_FPGA_INTPRI_REG(n)     (MICRODEV_FPGA_INTC_BASE+0x10+((n)/8)*8)/* Interrupt Priority Register on INTC on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTPRI_LEVEL(n,x) ((x)<<(((n)%8)*4))                      /* MICRODEV_FPGA_INTPRI_LEVEL(int_number, int_level) */
+#define        MICRODEV_FPGA_INTPRI_MASK(n)    (MICRODEV_FPGA_INTPRI_LEVEL((n),0xful)) /* Interrupt Priority Mask on INTC on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTSRC_REG        (MICRODEV_FPGA_INTC_BASE+0x30ul)        /* Interrupt Source Register on INTC on CPU-board FPGA */
+#define        MICRODEV_FPGA_INTREQ_REG        (MICRODEV_FPGA_INTC_BASE+0x38ul)        /* Interrupt Request Register on INTC on CPU-board FPGA */
+
+
+/*
+ * The following are the IRQ numbers for the Linux Kernel for external
+ * interrupts.  i.e. the numbers seen by 'cat /proc/interrupt'.
+ */
+#define MICRODEV_LINUX_IRQ_KEYBOARD     1      /* SuperIO Keyboard */
+#define MICRODEV_LINUX_IRQ_SERIAL1      2      /* SuperIO Serial #1 */
+#define MICRODEV_LINUX_IRQ_ETHERNET     3      /* on-board Ethnernet */
+#define MICRODEV_LINUX_IRQ_SERIAL2      4      /* SuperIO Serial #2 */
+#define MICRODEV_LINUX_IRQ_USB_HC       7      /* on-board USB HC */
+#define MICRODEV_LINUX_IRQ_MOUSE       12      /* SuperIO PS/2 Mouse */
+#define MICRODEV_LINUX_IRQ_IDE2                13      /* SuperIO IDE #2 */
+#define MICRODEV_LINUX_IRQ_IDE1                14      /* SuperIO IDE #1 */
+
+/*
+ * The following are the IRQ numbers for the INTC on the FPGA for
+ * external interrupts.  i.e. the bits in the INTC registers in the
+ * FPGA.
+ */
+#define MICRODEV_FPGA_IRQ_KEYBOARD      1      /* SuperIO Keyboard */
+#define MICRODEV_FPGA_IRQ_SERIAL1       3      /* SuperIO Serial #1 */
+#define MICRODEV_FPGA_IRQ_SERIAL2       4      /* SuperIO Serial #2 */
+#define MICRODEV_FPGA_IRQ_MOUSE                12      /* SuperIO PS/2 Mouse */
+#define MICRODEV_FPGA_IRQ_IDE1         14      /* SuperIO IDE #1 */
+#define MICRODEV_FPGA_IRQ_IDE2         15      /* SuperIO IDE #2 */
+#define MICRODEV_FPGA_IRQ_USB_HC       16      /* on-board USB HC */
+#define MICRODEV_FPGA_IRQ_ETHERNET     18      /* on-board Ethnernet */
+
+#define MICRODEV_IRQ_PCI_INTA           8
+#define MICRODEV_IRQ_PCI_INTB           9
+#define MICRODEV_IRQ_PCI_INTC          10
+#define MICRODEV_IRQ_PCI_INTD          11
+
+#define __IO_PREFIX microdev
+#include <asm/io_generic.h>
+
+#if defined(CONFIG_PCI)
+unsigned char  microdev_pci_inb(unsigned long port);
+unsigned short microdev_pci_inw(unsigned long port);
+unsigned long  microdev_pci_inl(unsigned long port);
+void           microdev_pci_outb(unsigned char  data, unsigned long port);
+void           microdev_pci_outw(unsigned short data, unsigned long port);
+void           microdev_pci_outl(unsigned long  data, unsigned long port);
+#endif
+
+#endif /* __ASM_SH_MICRODEV_H */
diff --git a/arch/sh/include/asm/migor.h b/arch/sh/include/asm/migor.h
new file mode 100644 (file)
index 0000000..10016e0
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef __ASM_SH_MIGOR_H
+#define __ASM_SH_MIGOR_H
+
+/*
+ * linux/include/asm-sh/migor.h
+ *
+ * Copyright (C) 2008 Renesas Solutions
+ *
+ * Portions Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * 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.
+ *
+ */
+#include <asm/addrspace.h>
+
+/* GPIO */
+#define PORT_PACR 0xa4050100
+#define PORT_PDCR 0xa4050106
+#define PORT_PECR 0xa4050108
+#define PORT_PHCR 0xa405010e
+#define PORT_PJCR 0xa4050110
+#define PORT_PKCR 0xa4050112
+#define PORT_PLCR 0xa4050114
+#define PORT_PMCR 0xa4050116
+#define PORT_PRCR 0xa405011c
+#define PORT_PTCR 0xa4050140
+#define PORT_PUCR 0xa4050142
+#define PORT_PVCR 0xa4050144
+#define PORT_PWCR 0xa4050146
+#define PORT_PXCR 0xa4050148
+#define PORT_PYCR 0xa405014a
+#define PORT_PZCR 0xa405014c
+#define PORT_PADR 0xa4050120
+#define PORT_PHDR 0xa405012e
+#define PORT_PTDR 0xa4050160
+#define PORT_PWDR 0xa4050166
+
+#define PORT_HIZCRA 0xa4050158
+#define PORT_HIZCRC 0xa405015c
+
+#define PORT_MSELCRB 0xa4050182
+
+#define MSTPCR1 0xa4150034
+#define MSTPCR2 0xa4150038
+
+#define PORT_PSELA 0xa405014e
+#define PORT_PSELB 0xa4050150
+#define PORT_PSELC 0xa4050152
+#define PORT_PSELD 0xa4050154
+#define PORT_PSELE 0xa4050156
+
+#define PORT_HIZCRA 0xa4050158
+#define PORT_HIZCRB 0xa405015a
+#define PORT_HIZCRC 0xa405015c
+
+#define BSC_CS6ABCR 0xfec1001c
+
+#include <asm/sh_mobile_lcdc.h>
+
+int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle,
+                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
+
+#endif /* __ASM_SH_MIGOR_H */
diff --git a/arch/sh/include/asm/mman.h b/arch/sh/include/asm/mman.h
new file mode 100644 (file)
index 0000000..156eb02
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __ASM_SH_MMAN_H
+#define __ASM_SH_MMAN_H
+
+#include <asm-generic/mman.h>
+
+#define MAP_GROWSDOWN  0x0100          /* stack-like segment */
+#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
+#define MAP_LOCKED     0x2000          /* pages are locked */
+#define MAP_NORESERVE  0x4000          /* don't check for reservations */
+#define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
+#define MAP_NONBLOCK   0x10000         /* do not block on IO */
+
+#define MCL_CURRENT    1               /* lock all current mappings */
+#define MCL_FUTURE     2               /* lock all future mappings */
+
+#endif /* __ASM_SH_MMAN_H */
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..fdcb93b
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef __MMU_H
+#define __MMU_H
+
+/* Default "unsigned long" context */
+typedef unsigned long mm_context_id_t[NR_CPUS];
+
+typedef struct {
+#ifdef CONFIG_MMU
+       mm_context_id_t         id;
+       void                    *vdso;
+#else
+       struct vm_list_struct   *vmlist;
+       unsigned long           end_brk;
+#endif
+#ifdef CONFIG_BINFMT_ELF_FDPIC
+       unsigned long           exec_fdpic_loadmap;
+       unsigned long           interp_fdpic_loadmap;
+#endif
+} mm_context_t;
+
+/*
+ * Privileged Space Mapping Buffer (PMB) definitions
+ */
+#define PMB_PASCR              0xff000070
+#define PMB_IRMCR              0xff000078
+
+#define PMB_ADDR               0xf6100000
+#define PMB_DATA               0xf7100000
+#define PMB_ENTRY_MAX          16
+#define PMB_E_MASK             0x0000000f
+#define PMB_E_SHIFT            8
+
+#define PMB_SZ_16M             0x00000000
+#define PMB_SZ_64M             0x00000010
+#define PMB_SZ_128M            0x00000080
+#define PMB_SZ_512M            0x00000090
+#define PMB_SZ_MASK            PMB_SZ_512M
+#define PMB_C                  0x00000008
+#define PMB_WT                 0x00000001
+#define PMB_UB                 0x00000200
+#define PMB_V                  0x00000100
+
+#define PMB_NO_ENTRY           (-1)
+
+struct pmb_entry;
+
+struct pmb_entry {
+       unsigned long vpn;
+       unsigned long ppn;
+       unsigned long flags;
+
+       /*
+        * 0 .. NR_PMB_ENTRIES for specific entry selection, or
+        * PMB_NO_ENTRY to search for a free one
+        */
+       int entry;
+
+       struct pmb_entry *next;
+       /* Adjacent entry link for contiguous multi-entry mappings */
+       struct pmb_entry *link;
+};
+
+/* arch/sh/mm/pmb.c */
+int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
+                   unsigned long flags, int *entry);
+int set_pmb_entry(struct pmb_entry *pmbe);
+void clear_pmb_entry(struct pmb_entry *pmbe);
+struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
+                           unsigned long flags);
+void pmb_free(struct pmb_entry *pmbe);
+long pmb_remap(unsigned long virt, unsigned long phys,
+              unsigned long size, unsigned long flags);
+void pmb_unmap(unsigned long addr);
+
+#endif /* __MMU_H */
+
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
new file mode 100644 (file)
index 0000000..04c0c97
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2003 - 2007 Paul Mundt
+ *
+ * ASID handling idea taken from MIPS implementation.
+ */
+#ifndef __ASM_SH_MMU_CONTEXT_H
+#define __ASM_SH_MMU_CONTEXT_H
+
+#ifdef __KERNEL__
+#include <cpu/mmu_context.h>
+#include <asm/tlbflush.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+#include <asm-generic/mm_hooks.h>
+
+/*
+ * The MMU "context" consists of two things:
+ *    (a) TLB cache version (or round, cycle whatever expression you like)
+ *    (b) ASID (Address Space IDentifier)
+ */
+#define MMU_CONTEXT_ASID_MASK          0x000000ff
+#define MMU_CONTEXT_VERSION_MASK       0xffffff00
+#define MMU_CONTEXT_FIRST_VERSION      0x00000100
+#define NO_CONTEXT                     0
+
+/* ASID is 8-bit value, so it can't be 0x100 */
+#define MMU_NO_ASID                    0x100
+
+#define asid_cache(cpu)                (cpu_data[cpu].asid_cache)
+
+#ifdef CONFIG_MMU
+#define cpu_context(cpu, mm)   ((mm)->context.id[cpu])
+
+#define cpu_asid(cpu, mm)      \
+       (cpu_context((cpu), (mm)) & MMU_CONTEXT_ASID_MASK)
+
+/*
+ * Virtual Page Number mask
+ */
+#define MMU_VPN_MASK   0xfffff000
+
+#if defined(CONFIG_SUPERH32)
+#include "mmu_context_32.h"
+#else
+#include "mmu_context_64.h"
+#endif
+
+/*
+ * Get MMU context if needed.
+ */
+static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu)
+{
+       unsigned long asid = asid_cache(cpu);
+
+       /* Check if we have old version of context. */
+       if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0)
+               /* It's up to date, do nothing */
+               return;
+
+       /* It's old, we need to get new context with new version. */
+       if (!(++asid & MMU_CONTEXT_ASID_MASK)) {
+               /*
+                * We exhaust ASID of this version.
+                * Flush all TLB and start new cycle.
+                */
+               flush_tlb_all();
+
+#ifdef CONFIG_SUPERH64
+               /*
+                * The SH-5 cache uses the ASIDs, requiring both the I and D
+                * cache to be flushed when the ASID is exhausted. Weak.
+                */
+               flush_cache_all();
+#endif
+
+               /*
+                * Fix version; Note that we avoid version #0
+                * to distingush NO_CONTEXT.
+                */
+               if (!asid)
+                       asid = MMU_CONTEXT_FIRST_VERSION;
+       }
+
+       cpu_context(cpu, mm) = asid_cache(cpu) = asid;
+}
+
+/*
+ * Initialize the context related info for a new mm_struct
+ * instance.
+ */
+static inline int init_new_context(struct task_struct *tsk,
+                                  struct mm_struct *mm)
+{
+       int i;
+
+       for (i = 0; i < num_online_cpus(); i++)
+               cpu_context(i, mm) = NO_CONTEXT;
+
+       return 0;
+}
+
+/*
+ * After we have set current->mm to a new value, this activates
+ * the context for the new mm so we see the new mappings.
+ */
+static inline void activate_context(struct mm_struct *mm, unsigned int cpu)
+{
+       get_mmu_context(mm, cpu);
+       set_asid(cpu_asid(cpu, mm));
+}
+
+static inline void switch_mm(struct mm_struct *prev,
+                            struct mm_struct *next,
+                            struct task_struct *tsk)
+{
+       unsigned int cpu = smp_processor_id();
+
+       if (likely(prev != next)) {
+               cpu_set(cpu, next->cpu_vm_mask);
+               set_TTB(next->pgd);
+               activate_context(next, cpu);
+       } else
+               if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
+                       activate_context(next, cpu);
+}
+#else
+#define get_mmu_context(mm)            do { } while (0)
+#define init_new_context(tsk,mm)       (0)
+#define destroy_context(mm)            do { } while (0)
+#define set_asid(asid)                 do { } while (0)
+#define get_asid()                     (0)
+#define cpu_asid(cpu, mm)              ({ (void)cpu; 0; })
+#define switch_and_save_asid(asid)     (0)
+#define set_TTB(pgd)                   do { } while (0)
+#define get_TTB()                      (0)
+#define activate_context(mm,cpu)       do { } while (0)
+#define switch_mm(prev,next,tsk)       do { } while (0)
+#endif /* CONFIG_MMU */
+
+#define activate_mm(prev, next)                switch_mm((prev),(next),NULL)
+#define deactivate_mm(tsk,mm)          do { } while (0)
+#define enter_lazy_tlb(mm,tsk)         do { } while (0)
+
+#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
+/*
+ * If this processor has an MMU, we need methods to turn it off/on ..
+ * paging_init() will also have to be updated for the processor in
+ * question.
+ */
+static inline void enable_mmu(void)
+{
+       unsigned int cpu = smp_processor_id();
+
+       /* Enable MMU */
+       ctrl_outl(MMU_CONTROL_INIT, MMUCR);
+       ctrl_barrier();
+
+       if (asid_cache(cpu) == NO_CONTEXT)
+               asid_cache(cpu) = MMU_CONTEXT_FIRST_VERSION;
+
+       set_asid(asid_cache(cpu) & MMU_CONTEXT_ASID_MASK);
+}
+
+static inline void disable_mmu(void)
+{
+       unsigned long cr;
+
+       cr = ctrl_inl(MMUCR);
+       cr &= ~MMU_CONTROL_INIT;
+       ctrl_outl(cr, MMUCR);
+
+       ctrl_barrier();
+}
+#else
+/*
+ * MMU control handlers for processors lacking memory
+ * management hardware.
+ */
+#define enable_mmu()   do { } while (0)
+#define disable_mmu()  do { } while (0)
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_MMU_CONTEXT_H */
diff --git a/arch/sh/include/asm/mmu_context_32.h b/arch/sh/include/asm/mmu_context_32.h
new file mode 100644 (file)
index 0000000..f4f9aeb
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __ASM_SH_MMU_CONTEXT_32_H
+#define __ASM_SH_MMU_CONTEXT_32_H
+
+/*
+ * Destroy context related info for an mm_struct that is about
+ * to be put to rest.
+ */
+static inline void destroy_context(struct mm_struct *mm)
+{
+       /* Do nothing */
+}
+
+static inline void set_asid(unsigned long asid)
+{
+       unsigned long __dummy;
+
+       __asm__ __volatile__ ("mov.l    %2, %0\n\t"
+                             "and      %3, %0\n\t"
+                             "or       %1, %0\n\t"
+                             "mov.l    %0, %2"
+                             : "=&r" (__dummy)
+                             : "r" (asid), "m" (__m(MMU_PTEH)),
+                               "r" (0xffffff00));
+}
+
+static inline unsigned long get_asid(void)
+{
+       unsigned long asid;
+
+       __asm__ __volatile__ ("mov.l    %1, %0"
+                             : "=r" (asid)
+                             : "m" (__m(MMU_PTEH)));
+       asid &= MMU_CONTEXT_ASID_MASK;
+       return asid;
+}
+
+/* MMU_TTB is used for optimizing the fault handling. */
+static inline void set_TTB(pgd_t *pgd)
+{
+       ctrl_outl((unsigned long)pgd, MMU_TTB);
+}
+
+static inline pgd_t *get_TTB(void)
+{
+       return (pgd_t *)ctrl_inl(MMU_TTB);
+}
+#endif /* __ASM_SH_MMU_CONTEXT_32_H */
diff --git a/arch/sh/include/asm/mmu_context_64.h b/arch/sh/include/asm/mmu_context_64.h
new file mode 100644 (file)
index 0000000..de12102
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef __ASM_SH_MMU_CONTEXT_64_H
+#define __ASM_SH_MMU_CONTEXT_64_H
+
+/*
+ * sh64-specific mmu_context interface.
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003 - 2007  Paul Mundt
+ *
+ * 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.
+ */
+#include <cpu/registers.h>
+#include <asm/cacheflush.h>
+
+#define SR_ASID_MASK           0xffffffffff00ffffULL
+#define SR_ASID_SHIFT          16
+
+/*
+ * Destroy context related info for an mm_struct that is about
+ * to be put to rest.
+ */
+static inline void destroy_context(struct mm_struct *mm)
+{
+       /* Well, at least free TLB entries */
+       flush_tlb_mm(mm);
+}
+
+static inline unsigned long get_asid(void)
+{
+       unsigned long long sr;
+
+       asm volatile ("getcon   " __SR ", %0\n\t"
+                     : "=r" (sr));
+
+       sr = (sr >> SR_ASID_SHIFT) & MMU_CONTEXT_ASID_MASK;
+       return (unsigned long) sr;
+}
+
+/* Set ASID into SR */
+static inline void set_asid(unsigned long asid)
+{
+       unsigned long long sr, pc;
+
+       asm volatile ("getcon   " __SR ", %0" : "=r" (sr));
+
+       sr = (sr & SR_ASID_MASK) | (asid << SR_ASID_SHIFT);
+
+       /*
+        * It is possible that this function may be inlined and so to avoid
+        * the assembler reporting duplicate symbols we make use of the
+        * gas trick of generating symbols using numerics and forward
+        * reference.
+        */
+       asm volatile ("movi     1, %1\n\t"
+                     "shlli    %1, 28, %1\n\t"
+                     "or       %0, %1, %1\n\t"
+                     "putcon   %1, " __SR "\n\t"
+                     "putcon   %0, " __SSR "\n\t"
+                     "movi     1f, %1\n\t"
+                     "ori      %1, 1 , %1\n\t"
+                     "putcon   %1, " __SPC "\n\t"
+                     "rte\n"
+                     "1:\n\t"
+                     : "=r" (sr), "=r" (pc) : "0" (sr));
+}
+
+/* arch/sh/kernel/cpu/sh5/entry.S */
+extern unsigned long switch_and_save_asid(unsigned long new_asid);
+
+/* No spare register to twiddle, so use a software cache */
+extern pgd_t *mmu_pdtp_cache;
+
+#define set_TTB(pgd)   (mmu_pdtp_cache = (pgd))
+#define get_TTB()      (mmu_pdtp_cache)
+
+#endif /* __ASM_SH_MMU_CONTEXT_64_H */
diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h
new file mode 100644 (file)
index 0000000..2969253
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef __ASM_SH_MMZONE_H
+#define __ASM_SH_MMZONE_H
+
+#ifdef __KERNEL__
+
+#ifdef CONFIG_NEED_MULTIPLE_NODES
+extern struct pglist_data *node_data[];
+#define NODE_DATA(nid)         (node_data[nid])
+
+#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
+#define node_end_pfn(nid)      (NODE_DATA(nid)->node_start_pfn + \
+                                NODE_DATA(nid)->node_spanned_pages)
+
+static inline int pfn_to_nid(unsigned long pfn)
+{
+       int nid;
+
+       for (nid = 0; nid < MAX_NUMNODES; nid++)
+               if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
+                       break;
+
+       return nid;
+}
+
+static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
+{
+       return NODE_DATA(pfn_to_nid(pfn));
+}
+
+/* arch/sh/mm/numa.c */
+void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
+#else
+static inline void
+setup_bootmem_node(int nid, unsigned long start, unsigned long end)
+{
+}
+#endif /* CONFIG_NEED_MULTIPLE_NODES */
+
+/* Platform specific mem init */
+void __init plat_mem_setup(void);
+
+/* arch/sh/kernel/setup.c */
+void __init setup_bootmem_allocator(unsigned long start_pfn);
+void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
+                              unsigned long end_pfn);
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_MMZONE_H */
diff --git a/arch/sh/include/asm/module.h b/arch/sh/include/asm/module.h
new file mode 100644 (file)
index 0000000..46eccd3
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _ASM_SH_MODULE_H
+#define _ASM_SH_MODULE_H
+
+/*
+ * This file contains the SH architecture specific module code.
+ */
+
+struct mod_arch_specific {
+       /* Nothing to see here .. */
+};
+
+#define Elf_Shdr               Elf32_Shdr
+#define Elf_Sym                        Elf32_Sym
+#define Elf_Ehdr               Elf32_Ehdr
+
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+# ifdef CONFIG_CPU_SH2
+#  define MODULE_PROC_FAMILY "SH2LE "
+# elif defined  CONFIG_CPU_SH3
+#  define MODULE_PROC_FAMILY "SH3LE "
+# elif defined  CONFIG_CPU_SH4
+#  define MODULE_PROC_FAMILY "SH4LE "
+# elif defined  CONFIG_CPU_SH5
+#  define MODULE_PROC_FAMILY "SH5LE "
+# else
+#  error unknown processor family
+# endif
+#else
+# ifdef CONFIG_CPU_SH2
+#  define MODULE_PROC_FAMILY "SH2BE "
+# elif defined  CONFIG_CPU_SH3
+#  define MODULE_PROC_FAMILY "SH3BE "
+# elif defined  CONFIG_CPU_SH4
+#  define MODULE_PROC_FAMILY "SH4BE "
+# elif defined  CONFIG_CPU_SH5
+#  define MODULE_PROC_FAMILY "SH5BE "
+# else
+#  error unknown processor family
+# endif
+#endif
+
+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
+
+#endif /* _ASM_SH_MODULE_H */
diff --git a/arch/sh/include/asm/msgbuf.h b/arch/sh/include/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..5174323
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __ASM_SH_MSGBUF_H
+#define __ASM_SH_MSGBUF_H
+
+/* 
+ * The msqid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct msqid64_ds {
+       struct ipc64_perm msg_perm;
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       unsigned long   __unused1;
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       unsigned long   __unused2;
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned long   __unused3;
+       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  __unused4;
+       unsigned long  __unused5;
+};
+
+#endif /* __ASM_SH_MSGBUF_H */
diff --git a/arch/sh/include/asm/mutex.h b/arch/sh/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/sh/include/asm/page.h b/arch/sh/include/asm/page.h
new file mode 100644 (file)
index 0000000..77fb8bf
--- /dev/null
@@ -0,0 +1,183 @@
+#ifndef __ASM_SH_PAGE_H
+#define __ASM_SH_PAGE_H
+
+/*
+ * Copyright (C) 1999  Niibe Yutaka
+ */
+
+#include <linux/const.h>
+
+/* PAGE_SHIFT determines the page size */
+#if defined(CONFIG_PAGE_SIZE_4KB)
+# define PAGE_SHIFT    12
+#elif defined(CONFIG_PAGE_SIZE_8KB)
+# define PAGE_SHIFT    13
+#elif defined(CONFIG_PAGE_SIZE_16KB)
+# define PAGE_SHIFT    14
+#elif defined(CONFIG_PAGE_SIZE_64KB)
+# define PAGE_SHIFT    16
+#else
+# error "Bogus kernel page size?"
+#endif
+
+#define PAGE_SIZE      (_AC(1, UL) << PAGE_SHIFT)
+#define PAGE_MASK      (~(PAGE_SIZE-1))
+#define PTE_MASK       PAGE_MASK
+
+#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
+#define HPAGE_SHIFT    16
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
+#define HPAGE_SHIFT    18
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
+#define HPAGE_SHIFT    20
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
+#define HPAGE_SHIFT    22
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
+#define HPAGE_SHIFT    26
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
+#define HPAGE_SHIFT    29
+#endif
+
+#ifdef CONFIG_HUGETLB_PAGE
+#define HPAGE_SIZE             (1UL << HPAGE_SHIFT)
+#define HPAGE_MASK             (~(HPAGE_SIZE-1))
+#define HUGETLB_PAGE_ORDER     (HPAGE_SHIFT-PAGE_SHIFT)
+#endif
+
+#ifndef __ASSEMBLY__
+
+extern unsigned long shm_align_mask;
+extern unsigned long max_low_pfn, min_low_pfn;
+extern unsigned long memory_start, memory_end;
+
+extern void clear_page(void *to);
+extern void copy_page(void *to, void *from);
+
+#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
+       (defined(CONFIG_CPU_SH5) || defined(CONFIG_CPU_SH4) || \
+        defined(CONFIG_SH7705_CACHE_32KB))
+struct page;
+struct vm_area_struct;
+extern void clear_user_page(void *to, unsigned long address, struct page *page);
+extern void copy_user_page(void *to, void *from, unsigned long address,
+                          struct page *page);
+#if defined(CONFIG_CPU_SH4)
+extern void copy_user_highpage(struct page *to, struct page *from,
+                              unsigned long vaddr, struct vm_area_struct *vma);
+#define __HAVE_ARCH_COPY_USER_HIGHPAGE
+#endif
+#else
+#define clear_user_page(page, vaddr, pg)       clear_page(page)
+#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
+#endif
+
+/*
+ * These are used to make use of C type-checking..
+ */
+#ifdef CONFIG_X2TLB
+typedef struct { unsigned long pte_low, pte_high; } pte_t;
+typedef struct { unsigned long long pgprot; } pgprot_t;
+typedef struct { unsigned long long pgd; } pgd_t;
+#define pte_val(x) \
+       ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
+#define __pte(x) \
+       ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
+#elif defined(CONFIG_SUPERH32)
+typedef struct { unsigned long pte_low; } pte_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+typedef struct { unsigned long pgd; } pgd_t;
+#define pte_val(x)     ((x).pte_low)
+#define __pte(x)       ((pte_t) { (x) } )
+#else
+typedef struct { unsigned long long pte_low; } pte_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+typedef struct { unsigned long pgd; } pgd_t;
+#define pte_val(x)     ((x).pte_low)
+#define __pte(x)       ((pte_t) { (x) } )
+#endif
+
+#define pgd_val(x)     ((x).pgd)
+#define pgprot_val(x)  ((x).pgprot)
+
+#define __pgd(x) ((pgd_t) { (x) } )
+#define __pgprot(x)    ((pgprot_t) { (x) } )
+
+typedef struct page *pgtable_t;
+
+#endif /* !__ASSEMBLY__ */
+
+/*
+ * __MEMORY_START and SIZE are the physical addresses and size of RAM.
+ */
+#define __MEMORY_START         CONFIG_MEMORY_START
+#define __MEMORY_SIZE          CONFIG_MEMORY_SIZE
+
+/*
+ * PAGE_OFFSET is the virtual address of the start of kernel address
+ * space.
+ */
+#define PAGE_OFFSET            CONFIG_PAGE_OFFSET
+
+/*
+ * Virtual to physical RAM address translation.
+ *
+ * In 29 bit mode, the physical offset of RAM from address 0 is visible in
+ * the kernel virtual address space, and thus we don't have to take
+ * this into account when translating. However in 32 bit mode this offset
+ * is not visible (it is part of the PMB mapping) and so needs to be
+ * added or subtracted as required.
+ */
+#ifdef CONFIG_32BIT
+#define __pa(x)        ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START)
+#define __va(x)        ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START))
+#else
+#define __pa(x)        ((unsigned long)(x)-PAGE_OFFSET)
+#define __va(x)        ((void *)((unsigned long)(x)+PAGE_OFFSET))
+#endif
+
+#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
+#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
+
+/*
+ * PFN = physical frame number (ie PFN 0 == physical address 0)
+ * PFN_START is the PFN of the first page of RAM. By defining this we
+ * don't have struct page entries for the portion of address space
+ * between physical address 0 and the start of RAM.
+ */
+#define PFN_START              (__MEMORY_START >> PAGE_SHIFT)
+#define ARCH_PFN_OFFSET                (PFN_START)
+#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+#ifdef CONFIG_FLATMEM
+#define pfn_valid(pfn)         ((pfn) >= min_low_pfn && (pfn) < max_low_pfn)
+#endif
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
+
+#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>
+
+/* vDSO support */
+#ifdef CONFIG_VSYSCALL
+#define __HAVE_ARCH_GATE_AREA
+#endif
+
+/*
+ * Some drivers need to perform DMA into kmalloc'ed buffers
+ * and so we have to increase the kmalloc minalign for this.
+ */
+#define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
+
+#ifdef CONFIG_SUPERH64
+/*
+ * While BYTES_PER_WORD == 4 on the current sh64 ABI, GCC will still
+ * happily generate {ld/st}.q pairs, requiring us to have 8-byte
+ * alignment to avoid traps. The kmalloc alignment is gauranteed by
+ * virtue of L1_CACHE_BYTES, requiring this to only be special cased
+ * for slab caches.
+ */
+#define ARCH_SLAB_MINALIGN     8
+#endif
+
+#endif /* __ASM_SH_PAGE_H */
diff --git a/arch/sh/include/asm/param.h b/arch/sh/include/asm/param.h
new file mode 100644 (file)
index 0000000..ae245af
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef __ASM_SH_PARAM_H
+#define __ASM_SH_PARAM_H
+
+#ifdef __KERNEL__
+# define HZ            CONFIG_HZ
+# define USER_HZ       100             /* User interfaces are in "ticks" */
+# define CLOCKS_PER_SEC        (USER_HZ)       /* frequency at which times() counts */
+#endif
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE  4096
+
+#ifndef NOGROUP
+#define NOGROUP                (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64      /* max length of hostname */
+
+#endif /* __ASM_SH_PARAM_H */
diff --git a/arch/sh/include/asm/parport.h b/arch/sh/include/asm/parport.h
new file mode 100644 (file)
index 0000000..f67ba60
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * 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_SH_PARPORT_H
+#define __ASM_SH_PARPORT_H
+
+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_SH_PARPORT_H */
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
new file mode 100644 (file)
index 0000000..df1d383
--- /dev/null
@@ -0,0 +1,144 @@
+#ifndef __ASM_SH_PCI_H
+#define __ASM_SH_PCI_H
+
+#ifdef __KERNEL__
+
+#include <linux/dma-mapping.h>
+
+/* Can be used to override the logic in pci_scan_bus for skipping
+   already-configured bus numbers - to be used for buggy BIOSes
+   or architectures with incomplete PCI setup by the loader */
+
+#define pcibios_assign_all_busses()    1
+#define pcibios_scan_all_fns(a, b)     0
+
+/*
+ * A board can define one or more PCI channels that represent built-in (or
+ * external) PCI controllers.
+ */
+struct pci_channel {
+       struct pci_ops *pci_ops;
+       struct resource *io_resource;
+       struct resource *mem_resource;
+       int first_devfn;
+       int last_devfn;
+};
+
+/*
+ * Each board initializes this array and terminates it with a NULL entry.
+ */
+extern struct pci_channel board_pci_channels[];
+
+#define PCIBIOS_MIN_IO         board_pci_channels->io_resource->start
+#define PCIBIOS_MIN_MEM                board_pci_channels->mem_resource->start
+
+/*
+ * I/O routine helpers
+ */
+#if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785)
+#define PCI_IO_AREA            0xFE400000
+#define PCI_IO_SIZE            0x00400000
+#elif defined(CONFIG_CPU_SH5)
+extern unsigned long PCI_IO_AREA;
+#define PCI_IO_SIZE            0x00010000
+#else
+#define PCI_IO_AREA            0xFE240000
+#define PCI_IO_SIZE            0x00040000
+#endif
+
+#define PCI_MEM_SIZE           0x01000000
+
+#define SH4_PCIIOBR_MASK       0xFFFC0000
+#define pci_ioaddr(addr)       (PCI_IO_AREA + (addr & ~SH4_PCIIOBR_MASK))
+
+#if defined(CONFIG_PCI)
+#define is_pci_ioaddr(port)            \
+       (((port) >= PCIBIOS_MIN_IO) &&  \
+        ((port) < (PCIBIOS_MIN_IO + PCI_IO_SIZE)))
+#define is_pci_memaddr(port)           \
+       (((port) >= PCIBIOS_MIN_MEM) && \
+        ((port) < (PCIBIOS_MIN_MEM + PCI_MEM_SIZE)))
+#else
+#define is_pci_ioaddr(port)    (0)
+#define is_pci_memaddr(port)   (0)
+#endif
+
+struct pci_dev;
+
+extern void pcibios_set_master(struct pci_dev *dev);
+
+static inline void pcibios_penalize_isa_irq(int irq, int active)
+{
+       /* We don't do dynamic PCI IRQ allocation */
+}
+
+/* Dynamic DMA mapping stuff.
+ * SuperH has everything mapped statically like x86.
+ */
+
+/* The PCI address space does 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    (1)
+
+#include <linux/types.h>
+#include <linux/slab.h>
+#include <asm/scatterlist.h>
+#include <linux/string.h>
+#include <asm/io.h>
+
+/* pci_unmap_{single,page} being a nop depends upon the
+ * configuration.
+ */
+#ifdef CONFIG_SH_PCIDMA_NONCOHERENT
+#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))
+#else
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME)         (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)        do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME)           (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL)  do { } while (0)
+#endif
+
+#ifdef CONFIG_PCI
+static inline void pci_dma_burst_advice(struct pci_dev *pdev,
+                                       enum pci_dma_burst_strategy *strat,
+                                       unsigned long *strategy_parameter)
+{
+       *strat = PCI_DMA_BURST_INFINITY;
+       *strategy_parameter = ~0UL;
+}
+#endif
+
+/* Board-specific fixup routines. */
+void pcibios_fixup(void);
+int pcibios_init_platform(void);
+int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin);
+
+#ifdef CONFIG_PCI_AUTO
+int pciauto_assign_resources(int busno, struct pci_channel *hose);
+#endif
+
+#endif /* __KERNEL__ */
+
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
+/* generic DMA-mapping stuff */
+#include <asm-generic/pci-dma-compat.h>
+
+#endif /* __ASM_SH_PCI_H */
+
diff --git a/arch/sh/include/asm/percpu.h b/arch/sh/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..4db4b39
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ARCH_SH_PERCPU
+#define __ARCH_SH_PERCPU
+
+#include <asm-generic/percpu.h>
+
+#endif /* __ARCH_SH_PERCPU */
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
new file mode 100644 (file)
index 0000000..84dd2db
--- /dev/null
@@ -0,0 +1,96 @@
+#ifndef __ASM_SH_PGALLOC_H
+#define __ASM_SH_PGALLOC_H
+
+#include <linux/quicklist.h>
+#include <asm/page.h>
+
+#define QUICK_PGD 0    /* We preserve special mappings over free */
+#define QUICK_PT 1     /* Other page table pages that are zero on free */
+
+static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
+                                      pte_t *pte)
+{
+       set_pmd(pmd, __pmd((unsigned long)pte));
+}
+
+static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
+                               pgtable_t pte)
+{
+       set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
+}
+#define pmd_pgtable(pmd) pmd_page(pmd)
+
+static inline void pgd_ctor(void *x)
+{
+       pgd_t *pgd = x;
+
+       memcpy(pgd + USER_PTRS_PER_PGD,
+              swapper_pg_dir + USER_PTRS_PER_PGD,
+              (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+}
+
+/*
+ * Allocate and free page tables.
+ */
+static inline pgd_t *pgd_alloc(struct mm_struct *mm)
+{
+       return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
+}
+
+static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
+{
+       quicklist_free(QUICK_PGD, NULL, pgd);
+}
+
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
+                                         unsigned long address)
+{
+       return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
+}
+
+static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
+                                       unsigned long address)
+{
+       struct page *page;
+       void *pg;
+
+       pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
+       if (!pg)
+               return NULL;
+       page = virt_to_page(pg);
+       pgtable_page_ctor(page);
+       return page;
+}
+
+static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+{
+       quicklist_free(QUICK_PT, NULL, pte);
+}
+
+static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
+{
+       pgtable_page_dtor(pte);
+       quicklist_free_page(QUICK_PT, NULL, pte);
+}
+
+#define __pte_free_tlb(tlb,pte)                                \
+do {                                                   \
+       pgtable_page_dtor(pte);                         \
+       tlb_remove_page((tlb), (pte));                  \
+} while (0)
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+
+#define pmd_free(mm, x)                        do { } while (0)
+#define __pmd_free_tlb(tlb,x)          do { } while (0)
+
+static inline void check_pgt_cache(void)
+{
+       quicklist_trim(QUICK_PGD, NULL, 25, 16);
+       quicklist_trim(QUICK_PT, NULL, 25, 16);
+}
+
+#endif /* __ASM_SH_PGALLOC_H */
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..a4a8f8b
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * This file contains the functions and defines necessary to modify and
+ * use the SuperH page table tree.
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2002 - 2007 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_PGTABLE_H
+#define __ASM_SH_PGTABLE_H
+
+#include <asm-generic/pgtable-nopmd.h>
+#include <asm/page.h>
+
+#ifndef __ASSEMBLY__
+#include <asm/addrspace.h>
+#include <asm/fixmap.h>
+
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+
+#endif /* !__ASSEMBLY__ */
+
+/*
+ * Effective and physical address definitions, to aid with sign
+ * extension.
+ */
+#define NEFF           32
+#define        NEFF_SIGN       (1LL << (NEFF - 1))
+#define        NEFF_MASK       (-1LL << NEFF)
+
+#ifdef CONFIG_29BIT
+#define NPHYS          29
+#else
+#define NPHYS          32
+#endif
+
+#define        NPHYS_SIGN      (1LL << (NPHYS - 1))
+#define        NPHYS_MASK      (-1LL << NPHYS)
+
+/*
+ * traditional two-level paging structure
+ */
+/* PTE bits */
+#if defined(CONFIG_X2TLB) || defined(CONFIG_SUPERH64)
+# define PTE_MAGNITUDE 3       /* 64-bit PTEs on extended mode SH-X2 TLB */
+#else
+# define PTE_MAGNITUDE 2       /* 32-bit PTEs */
+#endif
+#define PTE_SHIFT      PAGE_SHIFT
+#define PTE_BITS       (PTE_SHIFT - PTE_MAGNITUDE)
+
+/* PGD bits */
+#define PGDIR_SHIFT    (PTE_SHIFT + PTE_BITS)
+#define PGDIR_SIZE     (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK     (~(PGDIR_SIZE-1))
+
+/* Entries per level */
+#define PTRS_PER_PTE   (PAGE_SIZE / (1 << PTE_MAGNITUDE))
+#define PTRS_PER_PGD   (PAGE_SIZE / sizeof(pgd_t))
+
+#define USER_PTRS_PER_PGD      (TASK_SIZE/PGDIR_SIZE)
+#define FIRST_USER_ADDRESS     0
+
+#ifdef CONFIG_32BIT
+#define PHYS_ADDR_MASK         0xffffffff
+#else
+#define PHYS_ADDR_MASK         0x1fffffff
+#endif
+
+#define PTE_PHYS_MASK          (PHYS_ADDR_MASK & PAGE_MASK)
+
+#ifdef CONFIG_SUPERH32
+#define VMALLOC_START  (P3SEG)
+#else
+#define VMALLOC_START  (0xf0000000)
+#endif
+#define VMALLOC_END    (FIXADDR_START-2*PAGE_SIZE)
+
+#if defined(CONFIG_SUPERH32)
+#include <asm/pgtable_32.h>
+#else
+#include <asm/pgtable_64.h>
+#endif
+
+/*
+ * SH-X and lower (legacy) SuperH parts (SH-3, SH-4, some SH-4A) can't do page
+ * protection for execute, and considers it the same as a read. Also, write
+ * permission implies read permission. This is the closest we can get..
+ *
+ * SH-X2 (SH7785) and later parts take this to the opposite end of the extreme,
+ * not only supporting separate execute, read, and write bits, but having
+ * completely separate permission bits for user and kernel space.
+ */
+        /*xwr*/
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_COPY
+#define __P011 PAGE_COPY
+#define __P100 PAGE_EXECREAD
+#define __P101 PAGE_EXECREAD
+#define __P110 PAGE_COPY
+#define __P111 PAGE_COPY
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_WRITEONLY
+#define __S011 PAGE_SHARED
+#define __S100 PAGE_EXECREAD
+#define __S101 PAGE_EXECREAD
+#define __S110 PAGE_RWX
+#define __S111 PAGE_RWX
+
+typedef pte_t *pte_addr_t;
+
+#define kern_addr_valid(addr)  (1)
+
+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)                \
+               remap_pfn_range(vma, vaddr, pfn, size, prot)
+
+#define pte_pfn(x)             ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()   do { } while (0)
+
+#if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
+       defined(CONFIG_SH7705_CACHE_32KB))
+struct mm_struct;
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
+#endif
+
+struct vm_area_struct;
+extern void update_mmu_cache(struct vm_area_struct * vma,
+                            unsigned long address, pte_t pte);
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+extern void paging_init(void);
+extern void page_table_range_init(unsigned long start, unsigned long end,
+                                 pgd_t *pgd);
+
+#include <asm-generic/pgtable.h>
+
+#endif /* __ASM_SH_PGTABLE_H */
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h
new file mode 100644 (file)
index 0000000..72ea209
--- /dev/null
@@ -0,0 +1,479 @@
+#ifndef __ASM_SH_PGTABLE_32_H
+#define __ASM_SH_PGTABLE_32_H
+
+/*
+ * Linux PTEL encoding.
+ *
+ * Hardware and software bit definitions for the PTEL value (see below for
+ * notes on SH-X2 MMUs and 64-bit PTEs):
+ *
+ * - Bits 0 and 7 are reserved on SH-3 (_PAGE_WT and _PAGE_SZ1 on SH-4).
+ *
+ * - Bit 1 is the SH-bit, but is unused on SH-3 due to an MMU bug (the
+ *   hardware PTEL value can't have the SH-bit set when MMUCR.IX is set,
+ *   which is the default in cpu-sh3/mmu_context.h:MMU_CONTROL_INIT).
+ *
+ *   In order to keep this relatively clean, do not use these for defining
+ *   SH-3 specific flags until all of the other unused bits have been
+ *   exhausted.
+ *
+ * - Bit 9 is reserved by everyone and used by _PAGE_PROTNONE.
+ *
+ * - Bits 10 and 11 are low bits of the PPN that are reserved on >= 4K pages.
+ *   Bit 10 is used for _PAGE_ACCESSED, bit 11 remains unused.
+ *
+ * - On 29 bit platforms, bits 31 to 29 are used for the space attributes
+ *   and timing control which (together with bit 0) are moved into the
+ *   old-style PTEA on the parts that support it.
+ *
+ * XXX: Leave the _PAGE_FILE and _PAGE_WT overhaul for a rainy day.
+ *
+ * SH-X2 MMUs and extended PTEs
+ *
+ * SH-X2 supports an extended mode TLB with split data arrays due to the
+ * number of bits needed for PR and SZ (now EPR and ESZ) encodings. The PR and
+ * SZ bit placeholders still exist in data array 1, but are implemented as
+ * reserved bits, with the real logic existing in data array 2.
+ *
+ * The downside to this is that we can no longer fit everything in to a 32-bit
+ * PTE encoding, so a 64-bit pte_t is necessary for these parts. On the plus
+ * side, this gives us quite a few spare bits to play with for future usage.
+ */
+/* Legacy and compat mode bits */
+#define        _PAGE_WT        0x001           /* WT-bit on SH-4, 0 on SH-3 */
+#define _PAGE_HW_SHARED        0x002           /* SH-bit  : shared among processes */
+#define _PAGE_DIRTY    0x004           /* D-bit   : page changed */
+#define _PAGE_CACHABLE 0x008           /* C-bit   : cachable */
+#define _PAGE_SZ0      0x010           /* SZ0-bit : Size of page */
+#define _PAGE_RW       0x020           /* PR0-bit : write access allowed */
+#define _PAGE_USER     0x040           /* PR1-bit : user space access allowed*/
+#define _PAGE_SZ1      0x080           /* SZ1-bit : Size of page (on SH-4) */
+#define _PAGE_PRESENT  0x100           /* V-bit   : page is valid */
+#define _PAGE_PROTNONE 0x200           /* software: if not present  */
+#define _PAGE_ACCESSED 0x400           /* software: page referenced */
+#define _PAGE_FILE     _PAGE_WT        /* software: pagecache or swap? */
+
+#define _PAGE_SZ_MASK  (_PAGE_SZ0 | _PAGE_SZ1)
+#define _PAGE_PR_MASK  (_PAGE_RW | _PAGE_USER)
+
+/* Extended mode bits */
+#define _PAGE_EXT_ESZ0         0x0010  /* ESZ0-bit: Size of page */
+#define _PAGE_EXT_ESZ1         0x0020  /* ESZ1-bit: Size of page */
+#define _PAGE_EXT_ESZ2         0x0040  /* ESZ2-bit: Size of page */
+#define _PAGE_EXT_ESZ3         0x0080  /* ESZ3-bit: Size of page */
+
+#define _PAGE_EXT_USER_EXEC    0x0100  /* EPR0-bit: User space executable */
+#define _PAGE_EXT_USER_WRITE   0x0200  /* EPR1-bit: User space writable */
+#define _PAGE_EXT_USER_READ    0x0400  /* EPR2-bit: User space readable */
+
+#define _PAGE_EXT_KERN_EXEC    0x0800  /* EPR3-bit: Kernel space executable */
+#define _PAGE_EXT_KERN_WRITE   0x1000  /* EPR4-bit: Kernel space writable */
+#define _PAGE_EXT_KERN_READ    0x2000  /* EPR5-bit: Kernel space readable */
+
+/* Wrapper for extended mode pgprot twiddling */
+#define _PAGE_EXT(x)           ((unsigned long long)(x) << 32)
+
+/* software: moves to PTEA.TC (Timing Control) */
+#define _PAGE_PCC_AREA5        0x00000000      /* use BSC registers for area5 */
+#define _PAGE_PCC_AREA6        0x80000000      /* use BSC registers for area6 */
+
+/* software: moves to PTEA.SA[2:0] (Space Attributes) */
+#define _PAGE_PCC_IODYN 0x00000001     /* IO space, dynamically sized bus */
+#define _PAGE_PCC_IO8  0x20000000      /* IO space, 8 bit bus */
+#define _PAGE_PCC_IO16 0x20000001      /* IO space, 16 bit bus */
+#define _PAGE_PCC_COM8 0x40000000      /* Common Memory space, 8 bit bus */
+#define _PAGE_PCC_COM16        0x40000001      /* Common Memory space, 16 bit bus */
+#define _PAGE_PCC_ATR8 0x60000000      /* Attribute Memory space, 8 bit bus */
+#define _PAGE_PCC_ATR16        0x60000001      /* Attribute Memory space, 6 bit bus */
+
+/* Mask which drops unused bits from the PTEL value */
+#if defined(CONFIG_CPU_SH3)
+#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED| \
+                                _PAGE_FILE     | _PAGE_SZ1     | \
+                                _PAGE_HW_SHARED)
+#elif defined(CONFIG_X2TLB)
+/* Get rid of the legacy PR/SZ bits when using extended mode */
+#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED | \
+                                _PAGE_FILE | _PAGE_PR_MASK | _PAGE_SZ_MASK)
+#else
+#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)
+#endif
+
+#define _PAGE_FLAGS_HARDWARE_MASK      (PHYS_ADDR_MASK & ~(_PAGE_CLEAR_FLAGS))
+
+/* Hardware flags, page size encoding */
+#if !defined(CONFIG_MMU)
+# define _PAGE_FLAGS_HARD      0ULL
+#elif defined(CONFIG_X2TLB)
+# if defined(CONFIG_PAGE_SIZE_4KB)
+#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ0)
+# elif defined(CONFIG_PAGE_SIZE_8KB)
+#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ1)
+# elif defined(CONFIG_PAGE_SIZE_64KB)
+#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ2)
+# endif
+#else
+# if defined(CONFIG_PAGE_SIZE_4KB)
+#  define _PAGE_FLAGS_HARD     _PAGE_SZ0
+# elif defined(CONFIG_PAGE_SIZE_64KB)
+#  define _PAGE_FLAGS_HARD     _PAGE_SZ1
+# endif
+#endif
+
+#if defined(CONFIG_X2TLB)
+# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
+#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ2)
+# elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
+#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ0 | _PAGE_EXT_ESZ2)
+# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
+#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ0 | _PAGE_EXT_ESZ1 | _PAGE_EXT_ESZ2)
+# elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
+#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ3)
+# elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
+#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3)
+# endif
+#else
+# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
+#  define _PAGE_SZHUGE (_PAGE_SZ1)
+# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
+#  define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1)
+# endif
+#endif
+
+/*
+ * Stub out _PAGE_SZHUGE if we don't have a good definition for it,
+ * to make pte_mkhuge() happy.
+ */
+#ifndef _PAGE_SZHUGE
+# define _PAGE_SZHUGE  (_PAGE_FLAGS_HARD)
+#endif
+
+#define _PAGE_CHG_MASK \
+       (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | _PAGE_DIRTY)
+
+#ifndef __ASSEMBLY__
+
+#if defined(CONFIG_X2TLB) /* SH-X2 TLB */
+#define PAGE_NONE      __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+
+#define PAGE_SHARED    __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
+                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ  | \
+                                          _PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_USER_READ  | \
+                                          _PAGE_EXT_USER_WRITE))
+
+#define PAGE_EXECREAD  __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
+                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_EXEC | \
+                                          _PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_USER_EXEC | \
+                                          _PAGE_EXT_USER_READ))
+
+#define PAGE_COPY      PAGE_EXECREAD
+
+#define PAGE_READONLY  __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
+                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_USER_READ))
+
+#define PAGE_WRITEONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
+                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_USER_WRITE))
+
+#define PAGE_RWX       __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
+                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_KERN_READ  | \
+                                          _PAGE_EXT_KERN_EXEC  | \
+                                          _PAGE_EXT_USER_WRITE | \
+                                          _PAGE_EXT_USER_READ  | \
+                                          _PAGE_EXT_USER_EXEC))
+
+#define PAGE_KERNEL    __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
+                                _PAGE_DIRTY | _PAGE_ACCESSED | \
+                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_KERN_EXEC))
+
+#define PAGE_KERNEL_NOCACHE \
+                       __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | \
+                                _PAGE_ACCESSED | _PAGE_HW_SHARED | \
+                                _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_KERN_EXEC))
+
+#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
+                                _PAGE_DIRTY | _PAGE_ACCESSED | \
+                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_KERN_EXEC))
+
+#define PAGE_KERNEL_PCC(slot, type) \
+                       __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD | \
+                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
+                                          _PAGE_EXT_KERN_WRITE | \
+                                          _PAGE_EXT_KERN_EXEC) \
+                                (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | \
+                                (type))
+
+#elif defined(CONFIG_MMU) /* SH-X TLB */
+#define PAGE_NONE      __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+
+#define PAGE_SHARED    __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
+                                _PAGE_CACHABLE | _PAGE_ACCESSED | \
+                                _PAGE_FLAGS_HARD)
+
+#define PAGE_COPY      __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+
+#define PAGE_READONLY  __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+
+#define PAGE_EXECREAD  PAGE_READONLY
+#define PAGE_RWX       PAGE_SHARED
+#define PAGE_WRITEONLY PAGE_SHARED
+
+#define PAGE_KERNEL    __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | \
+                                _PAGE_DIRTY | _PAGE_ACCESSED | \
+                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
+
+#define PAGE_KERNEL_NOCACHE \
+                       __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
+                                _PAGE_ACCESSED | _PAGE_HW_SHARED | \
+                                _PAGE_FLAGS_HARD)
+
+#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
+                                _PAGE_DIRTY | _PAGE_ACCESSED | \
+                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
+
+#define PAGE_KERNEL_PCC(slot, type) \
+                       __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
+                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD | \
+                                (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | \
+                                (type))
+#else /* no mmu */
+#define PAGE_NONE              __pgprot(0)
+#define PAGE_SHARED            __pgprot(0)
+#define PAGE_COPY              __pgprot(0)
+#define PAGE_EXECREAD          __pgprot(0)
+#define PAGE_RWX               __pgprot(0)
+#define PAGE_READONLY          __pgprot(0)
+#define PAGE_WRITEONLY         __pgprot(0)
+#define PAGE_KERNEL            __pgprot(0)
+#define PAGE_KERNEL_NOCACHE    __pgprot(0)
+#define PAGE_KERNEL_RO         __pgprot(0)
+
+#define PAGE_KERNEL_PCC(slot, type) \
+                               __pgprot(0)
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#ifndef __ASSEMBLY__
+
+/*
+ * Certain architectures need to do special things when PTEs
+ * within a page table are directly modified.  Thus, the following
+ * hook is made available.
+ */
+#ifdef CONFIG_X2TLB
+static inline void set_pte(pte_t *ptep, pte_t pte)
+{
+       ptep->pte_high = pte.pte_high;
+       smp_wmb();
+       ptep->pte_low = pte.pte_low;
+}
+#else
+#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
+#endif
+
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+/*
+ * (pmds are folded into pgds so this doesn't get actually called,
+ * but the define is needed for a generic inline function.)
+ */
+#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
+
+#define pfn_pte(pfn, prot) \
+       __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pmd(pfn, prot) \
+       __pmd(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
+
+#define pte_none(x)            (!pte_val(x))
+#define pte_present(x)         ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
+
+#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
+
+#define pmd_none(x)    (!pmd_val(x))
+#define pmd_present(x) (pmd_val(x))
+#define pmd_clear(xp)  do { set_pmd(xp, __pmd(0)); } while (0)
+#define        pmd_bad(x)      (pmd_val(x) & ~PAGE_MASK)
+
+#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
+#define pte_page(x)    pfn_to_page(pte_pfn(x))
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+#define pte_not_present(pte)   (!((pte).pte_low & _PAGE_PRESENT))
+#define pte_dirty(pte)         ((pte).pte_low & _PAGE_DIRTY)
+#define pte_young(pte)         ((pte).pte_low & _PAGE_ACCESSED)
+#define pte_file(pte)          ((pte).pte_low & _PAGE_FILE)
+#define pte_special(pte)       (0)
+
+#ifdef CONFIG_X2TLB
+#define pte_write(pte)         ((pte).pte_high & _PAGE_EXT_USER_WRITE)
+#else
+#define pte_write(pte)         ((pte).pte_low & _PAGE_RW)
+#endif
+
+#define PTE_BIT_FUNC(h,fn,op) \
+static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; }
+
+#ifdef CONFIG_X2TLB
+/*
+ * We cheat a bit in the SH-X2 TLB case. As the permission bits are
+ * individually toggled (and user permissions are entirely decoupled from
+ * kernel permissions), we attempt to couple them a bit more sanely here.
+ */
+PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE);
+PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE);
+PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE);
+#else
+PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW);
+PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW);
+PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE);
+#endif
+
+PTE_BIT_FUNC(low, mkclean, &= ~_PAGE_DIRTY);
+PTE_BIT_FUNC(low, mkdirty, |= _PAGE_DIRTY);
+PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED);
+PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED);
+
+static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
+
+/*
+ * Macro and implementation to make a page protection as uncachable.
+ */
+#define pgprot_writecombine(prot) \
+       __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
+
+#define pgprot_noncached        pgprot_writecombine
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ *
+ * extern pte_t mk_pte(struct page *page, pgprot_t pgprot)
+ */
+#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
+
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+       pte.pte_low &= _PAGE_CHG_MASK;
+       pte.pte_low |= pgprot_val(newprot);
+
+#ifdef CONFIG_X2TLB
+       pte.pte_high |= pgprot_val(newprot) >> 32;
+#endif
+
+       return pte;
+}
+
+#define pmd_page_vaddr(pmd)    ((unsigned long)pmd_val(pmd))
+#define pmd_page(pmd)          (virt_to_page(pmd_val(pmd)))
+
+/* 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))
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(address)  pgd_offset(&init_mm, address)
+
+/* Find an entry in the third-level page table.. */
+#define pte_index(address)     ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+#define pte_offset_kernel(dir, address) \
+       ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
+#define pte_offset_map(dir, address)           pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address)    pte_offset_kernel(dir, address)
+
+#define pte_unmap(pte)         do { } while (0)
+#define pte_unmap_nested(pte)  do { } while (0)
+
+#ifdef CONFIG_X2TLB
+#define pte_ERROR(e) \
+       printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, \
+              &(e), (e).pte_high, (e).pte_low)
+#define pgd_ERROR(e) \
+       printk("%s:%d: bad pgd %016llx.\n", __FILE__, __LINE__, pgd_val(e))
+#else
+#define pte_ERROR(e) \
+       printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
+#define pgd_ERROR(e) \
+       printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+#endif
+
+/*
+ * Encode and de-code a swap entry
+ *
+ * Constraints:
+ *     _PAGE_FILE at bit 0
+ *     _PAGE_PRESENT at bit 8
+ *     _PAGE_PROTNONE at bit 9
+ *
+ * For the normal case, we encode the swap type into bits 0:7 and the
+ * swap offset into bits 10:30. For the 64-bit PTE case, we keep the
+ * preserved bits in the low 32-bits and use the upper 32 as the swap
+ * offset (along with a 5-bit type), following the same approach as x86
+ * PAE. This keeps the logic quite simple, and allows for a full 32
+ * PTE_FILE_MAX_BITS, as opposed to the 29-bits we're constrained with
+ * in the pte_low case.
+ *
+ * As is evident by the Alpha code, if we ever get a 64-bit unsigned
+ * long (swp_entry_t) to match up with the 64-bit PTEs, this all becomes
+ * much cleaner..
+ *
+ * NOTE: We should set ZEROs at the position of _PAGE_PRESENT
+ *       and _PAGE_PROTNONE bits
+ */
+#ifdef CONFIG_X2TLB
+#define __swp_type(x)                  ((x).val & 0x1f)
+#define __swp_offset(x)                        ((x).val >> 5)
+#define __swp_entry(type, offset)      ((swp_entry_t){ (type) | (offset) << 5})
+#define __pte_to_swp_entry(pte)                ((swp_entry_t){ (pte).pte_high })
+#define __swp_entry_to_pte(x)          ((pte_t){ 0, (x).val })
+
+/*
+ * Encode and decode a nonlinear file mapping entry
+ */
+#define pte_to_pgoff(pte)              ((pte).pte_high)
+#define pgoff_to_pte(off)              ((pte_t) { _PAGE_FILE, (off) })
+
+#define PTE_FILE_MAX_BITS              32
+#else
+#define __swp_type(x)                  ((x).val & 0xff)
+#define __swp_offset(x)                        ((x).val >> 10)
+#define __swp_entry(type, offset)      ((swp_entry_t){(type) | (offset) <<10})
+
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) >> 1 })
+#define __swp_entry_to_pte(x)          ((pte_t) { (x).val << 1 })
+
+/*
+ * Encode and decode a nonlinear file mapping entry
+ */
+#define PTE_FILE_MAX_BITS      29
+#define pte_to_pgoff(pte)      (pte_val(pte) >> 1)
+#define pgoff_to_pte(off)      ((pte_t) { ((off) << 1) | _PAGE_FILE })
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_PGTABLE_32_H */
diff --git a/arch/sh/include/asm/pgtable_64.h b/arch/sh/include/asm/pgtable_64.h
new file mode 100644 (file)
index 0000000..c78990c
--- /dev/null
@@ -0,0 +1,314 @@
+#ifndef __ASM_SH_PGTABLE_64_H
+#define __ASM_SH_PGTABLE_64_H
+
+/*
+ * include/asm-sh/pgtable_64.h
+ *
+ * This file contains the functions and defines necessary to modify and use
+ * the SuperH page table tree.
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003, 2004  Paul Mundt
+ * Copyright (C) 2003, 2004  Richard Curnow
+ *
+ * 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.
+ */
+#include <linux/threads.h>
+#include <asm/processor.h>
+#include <asm/page.h>
+
+/*
+ * Error outputs.
+ */
+#define pte_ERROR(e) \
+       printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
+#define pgd_ERROR(e) \
+       printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+
+/*
+ * Table setting routines. Used within arch/mm only.
+ */
+#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
+
+static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
+{
+       unsigned long long x = ((unsigned long long) pteval.pte_low);
+       unsigned long long *xp = (unsigned long long *) pteptr;
+       /*
+        * Sign-extend based on NPHYS.
+        */
+       *(xp) = (x & NPHYS_SIGN) ? (x | NPHYS_MASK) : x;
+}
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
+{
+       pmd_val(*pmdp) = (unsigned long) ptep;
+}
+
+/*
+ * PGD defines. Top level.
+ */
+
+/* To find an entry in a generic PGD. */
+#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
+#define __pgd_offset(address) pgd_index(address)
+#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
+
+/* To find an entry in a kernel PGD. */
+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+
+/*
+ * PMD level access routines. Same notes as above.
+ */
+#define _PMD_EMPTY             0x0
+/* Either the PMD is empty or present, it's not paged out */
+#define pmd_present(pmd_entry) (pmd_val(pmd_entry) & _PAGE_PRESENT)
+#define pmd_clear(pmd_entry_p) (set_pmd((pmd_entry_p), __pmd(_PMD_EMPTY)))
+#define pmd_none(pmd_entry)    (pmd_val((pmd_entry)) == _PMD_EMPTY)
+#define pmd_bad(pmd_entry)     ((pmd_val(pmd_entry) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
+
+#define pmd_page_vaddr(pmd_entry) \
+       ((unsigned long) __va(pmd_val(pmd_entry) & PAGE_MASK))
+
+#define pmd_page(pmd) \
+       (virt_to_page(pmd_val(pmd)))
+
+/* PMD to PTE dereferencing */
+#define pte_index(address) \
+               ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+
+#define pte_offset_kernel(dir, addr) \
+               ((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr)))
+
+#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)
+
+#ifndef __ASSEMBLY__
+#define IOBASE_VADDR   0xff000000
+#define IOBASE_END     0xffffffff
+
+/*
+ * PTEL coherent flags.
+ * See Chapter 17 ST50 CPU Core Volume 1, Architecture.
+ */
+/* The bits that are required in the SH-5 TLB are placed in the h/w-defined
+   positions, to avoid expensive bit shuffling on every refill.  The remaining
+   bits are used for s/w purposes and masked out on each refill.
+
+   Note, the PTE slots are used to hold data of type swp_entry_t when a page is
+   swapped out.  Only the _PAGE_PRESENT flag is significant when the page is
+   swapped out, and it must be placed so that it doesn't overlap either the
+   type or offset fields of swp_entry_t.  For x86, offset is at [31:8] and type
+   at [6:1], with _PAGE_PRESENT at bit 0 for both pte_t and swp_entry_t.  This
+   scheme doesn't map to SH-5 because bit [0] controls cacheability.  So bit
+   [2] is used for _PAGE_PRESENT and the type field of swp_entry_t is split
+   into 2 pieces.  That is handled by SWP_ENTRY and SWP_TYPE below. */
+#define _PAGE_WT       0x001  /* CB0: if cacheable, 1->write-thru, 0->write-back */
+#define _PAGE_DEVICE   0x001  /* CB0: if uncacheable, 1->device (i.e. no write-combining or reordering at bus level) */
+#define _PAGE_CACHABLE 0x002  /* CB1: uncachable/cachable */
+#define _PAGE_PRESENT  0x004  /* software: page referenced */
+#define _PAGE_FILE     0x004  /* software: only when !present */
+#define _PAGE_SIZE0    0x008  /* SZ0-bit : size of page */
+#define _PAGE_SIZE1    0x010  /* SZ1-bit : size of page */
+#define _PAGE_SHARED   0x020  /* software: reflects PTEH's SH */
+#define _PAGE_READ     0x040  /* PR0-bit : read access allowed */
+#define _PAGE_EXECUTE  0x080  /* PR1-bit : execute access allowed */
+#define _PAGE_WRITE    0x100  /* PR2-bit : write access allowed */
+#define _PAGE_USER     0x200  /* PR3-bit : user space access allowed */
+#define _PAGE_DIRTY    0x400  /* software: page accessed in write */
+#define _PAGE_ACCESSED 0x800  /* software: page referenced */
+
+/* Mask which drops software flags */
+#define _PAGE_FLAGS_HARDWARE_MASK      0xfffffffffffff3dbLL
+
+/*
+ * HugeTLB support
+ */
+#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
+#define _PAGE_SZHUGE   (_PAGE_SIZE0)
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
+#define _PAGE_SZHUGE   (_PAGE_SIZE1)
+#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
+#define _PAGE_SZHUGE   (_PAGE_SIZE0 | _PAGE_SIZE1)
+#endif
+
+/*
+ * Stub out _PAGE_SZHUGE if we don't have a good definition for it,
+ * to make pte_mkhuge() happy.
+ */
+#ifndef _PAGE_SZHUGE
+# define _PAGE_SZHUGE  (0)
+#endif
+
+/*
+ * Default flags for a Kernel page.
+ * This is fundametally also SHARED because the main use of this define
+ * (other than for PGD/PMD entries) is for the VMALLOC pool which is
+ * contextless.
+ *
+ * _PAGE_EXECUTE is required for modules
+ *
+ */
+#define _KERNPG_TABLE  (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
+                        _PAGE_EXECUTE | \
+                        _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_DIRTY | \
+                        _PAGE_SHARED)
+
+/* Default flags for a User page */
+#define _PAGE_TABLE    (_KERNPG_TABLE | _PAGE_USER)
+
+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+
+/*
+ * We have full permissions (Read/Write/Execute/Shared).
+ */
+#define _PAGE_COMMON   (_PAGE_PRESENT | _PAGE_USER | \
+                        _PAGE_CACHABLE | _PAGE_ACCESSED)
+
+#define PAGE_NONE      __pgprot(_PAGE_CACHABLE | _PAGE_ACCESSED)
+#define PAGE_SHARED    __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_WRITE | \
+                                _PAGE_SHARED)
+#define PAGE_EXECREAD  __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_EXECUTE)
+
+/*
+ * We need to include PAGE_EXECUTE in PAGE_COPY because it is the default
+ * protection mode for the stack.
+ */
+#define PAGE_COPY      PAGE_EXECREAD
+
+#define PAGE_READONLY  __pgprot(_PAGE_COMMON | _PAGE_READ)
+#define PAGE_WRITEONLY __pgprot(_PAGE_COMMON | _PAGE_WRITE)
+#define PAGE_RWX       __pgprot(_PAGE_COMMON | _PAGE_READ | \
+                                _PAGE_WRITE | _PAGE_EXECUTE)
+#define PAGE_KERNEL    __pgprot(_KERNPG_TABLE)
+
+#define PAGE_KERNEL_NOCACHE \
+                       __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
+                                _PAGE_EXECUTE | _PAGE_ACCESSED | \
+                                _PAGE_DIRTY | _PAGE_SHARED)
+
+/* Make it a device mapping for maximum safety (e.g. for mapping device
+   registers into user-space via /dev/map).  */
+#define pgprot_noncached(x) __pgprot(((x).pgprot & ~(_PAGE_CACHABLE)) | _PAGE_DEVICE)
+#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
+
+/*
+ * Handling allocation failures during page table setup.
+ */
+extern void __handle_bad_pmd_kernel(pmd_t * pmd);
+#define __handle_bad_pmd(x)    __handle_bad_pmd_kernel(x)
+
+/*
+ * PTE level access routines.
+ *
+ * Note1:
+ * It's the tree walk leaf. This is physical address to be stored.
+ *
+ * Note 2:
+ * Regarding the choice of _PTE_EMPTY:
+
+   We must choose a bit pattern that cannot be valid, whether or not the page
+   is present.  bit[2]==1 => present, bit[2]==0 => swapped out.  If swapped
+   out, bits [31:8], [6:3], [1:0] are under swapper control, so only bit[7] is
+   left for us to select.  If we force bit[7]==0 when swapped out, we could use
+   the combination bit[7,2]=2'b10 to indicate an empty PTE.  Alternatively, if
+   we force bit[7]==1 when swapped out, we can use all zeroes to indicate
+   empty.  This is convenient, because the page tables get cleared to zero
+   when they are allocated.
+
+ */
+#define _PTE_EMPTY     0x0
+#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
+#define pte_clear(mm,addr,xp)  (set_pte_at(mm, addr, xp, __pte(_PTE_EMPTY)))
+#define pte_none(x)    (pte_val(x) == _PTE_EMPTY)
+
+/*
+ * Some definitions to translate between mem_map, PTEs, and page
+ * addresses:
+ */
+
+/*
+ * Given a PTE, return the index of the mem_map[] entry corresponding
+ * to the page frame the PTE. Get the absolute physical address, make
+ * a relative physical address and translate it to an index.
+ */
+#define pte_pagenr(x)          (((unsigned long) (pte_val(x)) - \
+                                __MEMORY_START) >> PAGE_SHIFT)
+
+/*
+ * Given a PTE, return the "struct page *".
+ */
+#define pte_page(x)            (mem_map + pte_pagenr(x))
+
+/*
+ * Return number of (down rounded) MB corresponding to x pages.
+ */
+#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
+
+
+/*
+ * The following have defined behavior only work if pte_present() is true.
+ */
+static inline int pte_dirty(pte_t pte)  { return pte_val(pte) & _PAGE_DIRTY; }
+static inline int pte_young(pte_t pte)  { return pte_val(pte) & _PAGE_ACCESSED; }
+static inline int pte_file(pte_t pte)   { return pte_val(pte) & _PAGE_FILE; }
+static inline int pte_write(pte_t pte)  { return pte_val(pte) & _PAGE_WRITE; }
+static inline int pte_special(pte_t pte){ return 0; }
+
+static inline pte_t pte_wrprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; }
+static inline pte_t pte_mkclean(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
+static inline pte_t pte_mkold(pte_t pte)       { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
+static inline pte_t pte_mkwrite(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; }
+static inline pte_t pte_mkdirty(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
+static inline pte_t pte_mkyoung(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
+static inline pte_t pte_mkhuge(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; }
+static inline pte_t pte_mkspecial(pte_t pte)   { return pte; }
+
+
+/*
+ * Conversion functions: convert a page and protection to a page entry.
+ *
+ * extern pte_t mk_pte(struct page *page, pgprot_t pgprot)
+ */
+#define mk_pte(page,pgprot)                                                    \
+({                                                                             \
+       pte_t __pte;                                                            \
+                                                                               \
+       set_pte(&__pte, __pte((((page)-mem_map) << PAGE_SHIFT) |                \
+               __MEMORY_START | pgprot_val((pgprot))));                        \
+       __pte;                                                                  \
+})
+
+/*
+ * This takes a (absolute) physical page address that is used
+ * by the remapping functions
+ */
+#define mk_pte_phys(physpage, pgprot) \
+({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; })
+
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; }
+
+/* Encode and decode a swap entry */
+#define __swp_type(x)                  (((x).val & 3) + (((x).val >> 1) & 0x3c))
+#define __swp_offset(x)                        ((x).val >> 8)
+#define __swp_entry(type, offset)      ((swp_entry_t) { ((offset << 8) + ((type & 0x3c) << 1) + (type & 3)) })
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
+
+/* Encode and decode a nonlinear file mapping entry */
+#define PTE_FILE_MAX_BITS              29
+#define pte_to_pgoff(pte)              (pte_val(pte))
+#define pgoff_to_pte(off)              ((pte_t) { (off) | _PAGE_FILE })
+
+#endif /* !__ASSEMBLY__ */
+
+#define pfn_pte(pfn, prot)     __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pmd(pfn, prot)     __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+
+#endif /* __ASM_SH_PGTABLE_64_H */
diff --git a/arch/sh/include/asm/pm.h b/arch/sh/include/asm/pm.h
new file mode 100644 (file)
index 0000000..56fdbd6
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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 2006 (c) Andriy Skulysh <askulysh@gmail.com>
+ *
+ */
+#ifndef __ASM_SH_PM_H
+#define __ASM_SH_PM_H
+
+extern u8 wakeup_start;
+extern u8 wakeup_end;
+
+void pm_enter(void);
+
+#endif
diff --git a/arch/sh/include/asm/poll.h b/arch/sh/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/sh/include/asm/posix_types.h b/arch/sh/include/asm/posix_types.h
new file mode 100644 (file)
index 0000000..4eeb723
--- /dev/null
@@ -0,0 +1,13 @@
+#ifdef __KERNEL__
+# ifdef CONFIG_SUPERH32
+#  include "posix_types_32.h"
+# else
+#  include "posix_types_64.h"
+# endif
+#else
+# ifdef __SH5__
+#  include "posix_types_64.h"
+# else
+#  include "posix_types_32.h"
+# endif
+#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/posix_types_32.h b/arch/sh/include/asm/posix_types_32.h
new file mode 100644 (file)
index 0000000..0a3d2f5
--- /dev/null
@@ -0,0 +1,122 @@
+#ifndef __ASM_SH_POSIX_TYPES_H
+#define __ASM_SH_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 long  __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long           __kernel_off_t;
+typedef int            __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int   __kernel_size_t;
+typedef int            __kernel_ssize_t;
+typedef int            __kernel_ptrdiff_t;
+typedef long           __kernel_time_t;
+typedef long           __kernel_suseconds_t;
+typedef long           __kernel_clock_t;
+typedef int            __kernel_timer_t;
+typedef int            __kernel_clockid_t;
+typedef int            __kernel_daddr_t;
+typedef char *         __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int   __kernel_uid32_t;
+typedef unsigned int   __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long      __kernel_loff_t;
+#endif
+
+typedef struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
+       int     val[2];
+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+       int     __val[2];
+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+} __kernel_fsid_t;
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#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 /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+
+#endif /* __ASM_SH_POSIX_TYPES_H */
diff --git a/arch/sh/include/asm/posix_types_64.h b/arch/sh/include/asm/posix_types_64.h
new file mode 100644 (file)
index 0000000..0620317
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef __ASM_SH64_POSIX_TYPES_H
+#define __ASM_SH64_POSIX_TYPES_H
+
+/*
+ * 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.
+ *
+ * include/asm-sh64/posix_types.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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 long  __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long           __kernel_off_t;
+typedef int            __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef long unsigned int      __kernel_size_t;
+typedef int            __kernel_ssize_t;
+typedef int            __kernel_ptrdiff_t;
+typedef long           __kernel_time_t;
+typedef long           __kernel_suseconds_t;
+typedef long           __kernel_clock_t;
+typedef int            __kernel_timer_t;
+typedef int            __kernel_clockid_t;
+typedef int            __kernel_daddr_t;
+typedef char *         __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int   __kernel_uid32_t;
+typedef unsigned int   __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long      __kernel_loff_t;
+#endif
+
+typedef struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
+       int     val[2];
+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+       int     __val[2];
+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+} __kernel_fsid_t;
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#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 /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+
+#endif /* __ASM_SH64_POSIX_TYPES_H */
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
new file mode 100644 (file)
index 0000000..15d9f92
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __ASM_SH_PROCESSOR_H
+#define __ASM_SH_PROCESSOR_H
+
+#include <asm/cpu-features.h>
+#include <asm/segment.h>
+
+#ifndef __ASSEMBLY__
+/*
+ *  CPU type and hardware bug flags. Kept separately for each CPU.
+ *
+ *  Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
+ *  in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
+ *  for parsing the subtype in get_cpu_subtype().
+ */
+enum cpu_type {
+       /* SH-2 types */
+       CPU_SH7619,
+
+       /* SH-2A types */
+       CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
+
+       /* SH-3 types */
+       CPU_SH7705, CPU_SH7706, CPU_SH7707,
+       CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
+       CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
+       CPU_SH7720, CPU_SH7721, CPU_SH7729,
+
+       /* SH-4 types */
+       CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
+       CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
+
+       /* SH-4A types */
+       CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
+       CPU_SH7723, CPU_SHX3,
+
+       /* SH4AL-DSP types */
+       CPU_SH7343, CPU_SH7722, CPU_SH7366,
+
+       /* SH-5 types */
+        CPU_SH5_101, CPU_SH5_103,
+
+       /* Unknown subtype */
+       CPU_SH_NONE
+};
+
+/* Forward decl */
+struct sh_cpuinfo;
+
+/* arch/sh/kernel/setup.c */
+const char *get_cpu_subtype(struct sh_cpuinfo *c);
+
+#ifdef CONFIG_VSYSCALL
+int vsyscall_init(void);
+#else
+#define vsyscall_init() do { } while (0)
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#ifdef CONFIG_SUPERH32
+# include "processor_32.h"
+#else
+# include "processor_64.h"
+#endif
+
+#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
new file mode 100644 (file)
index 0000000..0dadd75
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * include/asm-sh/processor.h
+ *
+ * Copyright (C) 1999, 2000  Niibe Yutaka
+ * Copyright (C) 2002, 2003  Paul Mundt
+ */
+
+#ifndef __ASM_SH_PROCESSOR_32_H
+#define __ASM_SH_PROCESSOR_32_H
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+#include <asm/page.h>
+#include <asm/types.h>
+#include <asm/cache.h>
+#include <asm/ptrace.h>
+
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("mova 1f, %0\n.align 2\n1:":"=z" (pc)); pc; })
+
+/* Core Processor Version Register */
+#define CCN_PVR                0xff000030
+#define CCN_CVR                0xff000040
+#define CCN_PRR                0xff000044
+
+struct sh_cpuinfo {
+       unsigned int type;
+       int cut_major, cut_minor;
+       unsigned long loops_per_jiffy;
+       unsigned long asid_cache;
+
+       struct cache_info icache;       /* Primary I-cache */
+       struct cache_info dcache;       /* Primary D-cache */
+       struct cache_info scache;       /* Secondary cache */
+
+       unsigned long flags;
+} __attribute__ ((aligned(L1_CACHE_BYTES)));
+
+extern struct sh_cpuinfo cpu_data[];
+#define boot_cpu_data cpu_data[0]
+#define current_cpu_data cpu_data[smp_processor_id()]
+#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
+
+/*
+ * User space process size: 2GB.
+ *
+ * Since SH7709 and SH7750 have "area 7", we can't use 0x7c000000--0x7fffffff
+ */
+#define TASK_SIZE      0x7c000000UL
+
+#define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE     (TASK_SIZE / 3)
+
+/*
+ * Bit of SR register
+ *
+ * FD-bit:
+ *     When it's set, it means the processor doesn't have right to use FPU,
+ *     and it results exception when the floating operation is executed.
+ *
+ * IMASK-bit:
+ *     Interrupt level mask
+ */
+#define SR_DSP         0x00001000
+#define SR_IMASK       0x000000f0
+#define SR_FD          0x00008000
+
+/*
+ * FPU structure and data
+ */
+
+struct sh_fpu_hard_struct {
+       unsigned long fp_regs[16];
+       unsigned long xfp_regs[16];
+       unsigned long fpscr;
+       unsigned long fpul;
+
+       long status; /* software status information */
+};
+
+/* Dummy fpu emulator  */
+struct sh_fpu_soft_struct {
+       unsigned long fp_regs[16];
+       unsigned long xfp_regs[16];
+       unsigned long fpscr;
+       unsigned long fpul;
+
+       unsigned char lookahead;
+       unsigned long entry_pc;
+};
+
+union sh_fpu_union {
+       struct sh_fpu_hard_struct hard;
+       struct sh_fpu_soft_struct soft;
+};
+
+struct thread_struct {
+       /* Saved registers when thread is descheduled */
+       unsigned long sp;
+       unsigned long pc;
+
+       /* Hardware debugging registers */
+       unsigned long ubc_pc;
+
+       /* floating point info */
+       union sh_fpu_union fpu;
+};
+
+/* Count of active tasks with UBC settings */
+extern int ubc_usercnt;
+
+#define INIT_THREAD  {                                         \
+       .sp = sizeof(init_stack) + (long) &init_stack,          \
+}
+
+/*
+ * Do necessary setup to start up a newly executed thread.
+ */
+#define start_thread(regs, new_pc, new_sp)      \
+       set_fs(USER_DS);                         \
+       regs->pr = 0;                            \
+       regs->sr = SR_FD;       /* User mode. */ \
+       regs->pc = new_pc;                       \
+       regs->regs[15] = new_sp
+
+/* Forward declaration, a strange C thing */
+struct task_struct;
+struct mm_struct;
+
+/* 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 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+
+/* Copy and release all segment info associated with a VM */
+#define copy_segments(p, mm)   do { } while(0)
+#define release_segments(mm)   do { } while(0)
+
+/*
+ * FPU lazy state save handling.
+ */
+
+static __inline__ void disable_fpu(void)
+{
+       unsigned long __dummy;
+
+       /* Set FD flag in SR */
+       __asm__ __volatile__("stc       sr, %0\n\t"
+                            "or        %1, %0\n\t"
+                            "ldc       %0, sr"
+                            : "=&r" (__dummy)
+                            : "r" (SR_FD));
+}
+
+static __inline__ void enable_fpu(void)
+{
+       unsigned long __dummy;
+
+       /* Clear out FD flag in SR */
+       __asm__ __volatile__("stc       sr, %0\n\t"
+                            "and       %1, %0\n\t"
+                            "ldc       %0, sr"
+                            : "=&r" (__dummy)
+                            : "r" (~SR_FD));
+}
+
+/* Double presision, NANS as NANS, rounding to nearest, no exceptions */
+#define FPSCR_INIT  0x00080000
+
+#define        FPSCR_CAUSE_MASK        0x0001f000      /* Cause bits */
+#define        FPSCR_FLAG_MASK         0x0000007c      /* Flag bits */
+
+/*
+ * Return saved PC of a blocked thread.
+ */
+#define thread_saved_pc(tsk)   (tsk->thread.pc)
+
+void show_trace(struct task_struct *tsk, unsigned long *sp,
+               struct pt_regs *regs);
+extern unsigned long get_wchan(struct task_struct *p);
+
+#define KSTK_EIP(tsk)  (task_pt_regs(tsk)->pc)
+#define KSTK_ESP(tsk)  (task_pt_regs(tsk)->regs[15])
+
+#define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
+#define cpu_relax()    barrier()
+
+#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH3) || \
+    defined(CONFIG_CPU_SH4)
+#define PREFETCH_STRIDE                L1_CACHE_BYTES
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+static inline void prefetch(void *x)
+{
+       __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory");
+}
+
+#define prefetchw(x)   prefetch(x)
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_PROCESSOR_32_H */
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
new file mode 100644 (file)
index 0000000..770d516
--- /dev/null
@@ -0,0 +1,275 @@
+#ifndef __ASM_SH_PROCESSOR_64_H
+#define __ASM_SH_PROCESSOR_64_H
+
+/*
+ * include/asm-sh/processor_64.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2004  Richard Curnow
+ *
+ * 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.
+ */
+#ifndef __ASSEMBLY__
+
+#include <linux/compiler.h>
+#include <asm/page.h>
+#include <asm/types.h>
+#include <asm/cache.h>
+#include <asm/ptrace.h>
+#include <cpu/registers.h>
+
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ \
+void *pc; \
+unsigned long long __dummy = 0; \
+__asm__("gettr tr0, %1\n\t" \
+       "pta    4, tr0\n\t" \
+       "gettr  tr0, %0\n\t" \
+       "ptabs  %1, tr0\n\t"    \
+       :"=r" (pc), "=r" (__dummy) \
+       : "1" (__dummy)); \
+pc; })
+
+/*
+ * TLB information structure
+ *
+ * Defined for both I and D tlb, per-processor.
+ */
+struct tlb_info {
+       unsigned long long next;
+       unsigned long long first;
+       unsigned long long last;
+
+       unsigned int entries;
+       unsigned int step;
+
+       unsigned long flags;
+};
+
+struct sh_cpuinfo {
+       enum cpu_type type;
+       unsigned long loops_per_jiffy;
+       unsigned long asid_cache;
+
+       unsigned int cpu_clock, master_clock, bus_clock, module_clock;
+
+       /* Cache info */
+       struct cache_info icache;
+       struct cache_info dcache;
+       struct cache_info scache;
+
+       /* TLB info */
+       struct tlb_info itlb;
+       struct tlb_info dtlb;
+
+       unsigned long flags;
+};
+
+extern struct sh_cpuinfo cpu_data[];
+#define boot_cpu_data cpu_data[0]
+#define current_cpu_data cpu_data[smp_processor_id()]
+#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
+
+#endif
+
+/*
+ * User space process size: 2GB - 4k.
+ */
+#define TASK_SIZE      0x7ffff000UL
+
+#define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE     (TASK_SIZE / 3)
+
+/*
+ * Bit of SR register
+ *
+ * FD-bit:
+ *     When it's set, it means the processor doesn't have right to use FPU,
+ *     and it results exception when the floating operation is executed.
+ *
+ * IMASK-bit:
+ *     Interrupt level mask
+ *
+ * STEP-bit:
+ *     Single step bit
+ *
+ */
+#if defined(CONFIG_SH64_SR_WATCH)
+#define SR_MMU   0x84000000
+#else
+#define SR_MMU   0x80000000
+#endif
+
+#define SR_IMASK 0x000000f0
+#define SR_FD    0x00008000
+#define SR_SSTEP 0x08000000
+
+#ifndef __ASSEMBLY__
+
+/*
+ * FPU structure and data : require 8-byte alignment as we need to access it
+   with fld.p, fst.p
+ */
+
+struct sh_fpu_hard_struct {
+       unsigned long fp_regs[64];
+       unsigned int fpscr;
+       /* long status; * software status information */
+};
+
+#if 0
+/* Dummy fpu emulator  */
+struct sh_fpu_soft_struct {
+       unsigned long long fp_regs[32];
+       unsigned int fpscr;
+       unsigned char lookahead;
+       unsigned long entry_pc;
+};
+#endif
+
+union sh_fpu_union {
+       struct sh_fpu_hard_struct hard;
+       /* 'hard' itself only produces 32 bit alignment, yet we need
+          to access it using 64 bit load/store as well. */
+       unsigned long long alignment_dummy;
+};
+
+struct thread_struct {
+       unsigned long sp;
+       unsigned long pc;
+       /* This stores the address of the pt_regs built during a context
+          switch, or of the register save area built for a kernel mode
+          exception.  It is used for backtracing the stack of a sleeping task
+          or one that traps in kernel mode. */
+        struct pt_regs *kregs;
+       /* This stores the address of the pt_regs constructed on entry from
+          user mode.  It is a fixed value over the lifetime of a process, or
+          NULL for a kernel thread. */
+       struct pt_regs *uregs;
+
+       unsigned long trap_no, error_code;
+       unsigned long address;
+       /* Hardware debugging registers may come here */
+
+       /* floating point info */
+       union sh_fpu_union fpu;
+};
+
+#define INIT_MMAP \
+{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
+
+extern  struct pt_regs fake_swapper_regs;
+
+#define INIT_THREAD  {                         \
+       .sp             = sizeof(init_stack) +  \
+                         (long) &init_stack,   \
+       .pc             = 0,                    \
+        .kregs         = &fake_swapper_regs,   \
+       .uregs          = NULL,                 \
+       .trap_no        = 0,                    \
+       .error_code     = 0,                    \
+       .address        = 0,                    \
+       .fpu            = { { { 0, } }, }       \
+}
+
+/*
+ * Do necessary setup to start up a newly executed thread.
+ */
+#define SR_USER (SR_MMU | SR_FD)
+
+#define start_thread(regs, new_pc, new_sp)                     \
+       set_fs(USER_DS);                                        \
+       regs->sr = SR_USER;     /* User mode. */                \
+       regs->pc = new_pc - 4;  /* Compensate syscall exit */   \
+       regs->pc |= 1;          /* Set SHmedia ! */             \
+       regs->regs[18] = 0;                                     \
+       regs->regs[15] = new_sp
+
+/* Forward declaration, a strange C thing */
+struct task_struct;
+struct mm_struct;
+
+/* Free all resources held by a thread. */
+extern void release_thread(struct task_struct *);
+/*
+ * create a kernel thread without removing it from tasklists
+ */
+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+
+
+/* Copy and release all segment info associated with a VM */
+#define copy_segments(p, mm)   do { } while (0)
+#define release_segments(mm)   do { } while (0)
+#define forget_segments()      do { } while (0)
+#define prepare_to_copy(tsk)   do { } while (0)
+/*
+ * FPU lazy state save handling.
+ */
+
+static inline void disable_fpu(void)
+{
+       unsigned long long __dummy;
+
+       /* Set FD flag in SR */
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "or        %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy)
+                            : "r" (SR_FD));
+}
+
+static inline void enable_fpu(void)
+{
+       unsigned long long __dummy;
+
+       /* Clear out FD flag in SR */
+       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
+                            "and       %0, %1, %0\n\t"
+                            "putcon    %0, " __SR "\n\t"
+                            : "=&r" (__dummy)
+                            : "r" (~SR_FD));
+}
+
+/* Round to nearest, no exceptions on inexact, overflow, underflow,
+   zero-divide, invalid.  Configure option for whether to flush denorms to
+   zero, or except if a denorm is encountered.  */
+#if defined(CONFIG_SH64_FPU_DENORM_FLUSH)
+#define FPSCR_INIT  0x00040000
+#else
+#define FPSCR_INIT  0x00000000
+#endif
+
+#ifdef CONFIG_SH_FPU
+/* Initialise the FP state of a task */
+void fpinit(struct sh_fpu_hard_struct *fpregs);
+#else
+#define fpinit(fpregs) do { } while (0)
+#endif
+
+extern struct task_struct *last_task_used_math;
+
+/*
+ * Return saved PC of a blocked thread.
+ */
+#define thread_saved_pc(tsk)   (tsk->thread.pc)
+
+extern unsigned long get_wchan(struct task_struct *p);
+
+#define KSTK_EIP(tsk)  ((tsk)->thread.pc)
+#define KSTK_ESP(tsk)  ((tsk)->thread.sp)
+
+#define cpu_relax()    barrier()
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_PROCESSOR_64_H */
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..643ab5a
--- /dev/null
@@ -0,0 +1,130 @@
+#ifndef __ASM_SH_PTRACE_H
+#define __ASM_SH_PTRACE_H
+
+/*
+ * Copyright (C) 1999, 2000  Niibe Yutaka
+ *
+ */
+#if defined(__SH5__)
+struct pt_regs {
+       unsigned long long pc;
+       unsigned long long sr;
+       unsigned long long syscall_nr;
+       unsigned long long regs[63];
+       unsigned long long tregs[8];
+       unsigned long long pad[2];
+};
+#else
+/*
+ * GCC defines register number like this:
+ * -----------------------------
+ *      0 - 15 are integer registers
+ *     17 - 22 are control/special registers
+ *     24 - 39 fp registers
+ *     40 - 47 xd registers
+ *     48 -    fpscr register
+ * -----------------------------
+ *
+ * We follows above, except:
+ *     16 --- program counter (PC)
+ *     22 --- syscall #
+ *     23 --- floating point communication register
+ */
+#define REG_REG0        0
+#define REG_REG15      15
+
+#define REG_PC         16
+
+#define REG_PR         17
+#define REG_SR         18
+#define REG_GBR                19
+#define REG_MACH       20
+#define REG_MACL       21
+
+#define REG_SYSCALL    22
+
+#define REG_FPREG0     23
+#define REG_FPREG15    38
+#define REG_XFREG0     39
+#define REG_XFREG15    54
+
+#define REG_FPSCR      55
+#define REG_FPUL       56
+
+/*
+ * This struct defines the way the registers are stored on the
+ * kernel stack during a system call or other kernel entry.
+ */
+struct pt_regs {
+       unsigned long regs[16];
+       unsigned long pc;
+       unsigned long pr;
+       unsigned long sr;
+       unsigned long gbr;
+       unsigned long mach;
+       unsigned long macl;
+       long tra;
+};
+
+/*
+ * This struct defines the way the DSP registers are stored on the
+ * kernel stack during a system call or other kernel entry.
+ */
+struct pt_dspregs {
+       unsigned long   a1;
+       unsigned long   a0g;
+       unsigned long   a1g;
+       unsigned long   m0;
+       unsigned long   m1;
+       unsigned long   a0;
+       unsigned long   x0;
+       unsigned long   x1;
+       unsigned long   y0;
+       unsigned long   y1;
+       unsigned long   dsr;
+       unsigned long   rs;
+       unsigned long   re;
+       unsigned long   mod;
+};
+
+#define PTRACE_GETFDPIC                31      /* get the ELF fdpic loadmap address */
+
+#define PTRACE_GETFDPIC_EXEC   0       /* [addr] request the executable loadmap */
+#define PTRACE_GETFDPIC_INTERP 1       /* [addr] request the interpreter loadmap */
+
+#define        PTRACE_GETDSPREGS       55
+#define        PTRACE_SETDSPREGS       56
+#endif
+
+#ifdef __KERNEL__
+#include <asm/addrspace.h>
+
+#define user_mode(regs)                        (((regs)->sr & 0x40000000)==0)
+#define instruction_pointer(regs)      ((unsigned long)(regs)->pc)
+
+extern void show_regs(struct pt_regs *);
+
+#ifdef CONFIG_SH_DSP
+#define task_pt_regs(task) \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
+                - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1)
+#else
+#define task_pt_regs(task) \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
+                - sizeof(unsigned long)) - 1)
+#endif
+
+static inline unsigned long profile_pc(struct pt_regs *regs)
+{
+       unsigned long pc = instruction_pointer(regs);
+
+#ifdef P2SEG
+       if (pc >= P2SEG && pc < P3SEG)
+               pc -= 0x20000000;
+#endif
+
+       return pc;
+}
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_PTRACE_H */
diff --git a/arch/sh/include/asm/push-switch.h b/arch/sh/include/asm/push-switch.h
new file mode 100644 (file)
index 0000000..4903f9e
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __ASM_SH_PUSH_SWITCH_H
+#define __ASM_SH_PUSH_SWITCH_H
+
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+
+struct push_switch {
+       /* switch state */
+       unsigned int            state:1;
+       /* debounce timer */
+       struct timer_list       debounce;
+       /* workqueue */
+       struct work_struct      work;
+       /* platform device, for workqueue handler */
+       struct platform_device  *pdev;
+};
+
+struct push_switch_platform_info {
+       /* IRQ handler */
+       irqreturn_t             (*irq_handler)(int irq, void *data);
+       /* Special IRQ flags */
+       unsigned int            irq_flags;
+       /* Bit location of switch */
+       unsigned int            bit;
+       /* Symbolic switch name */
+       const char              *name;
+};
+
+#endif /* __ASM_SH_PUSH_SWITCH_H */
diff --git a/arch/sh/include/asm/r7780rp.h b/arch/sh/include/asm/r7780rp.h
new file mode 100644 (file)
index 0000000..306f735
--- /dev/null
@@ -0,0 +1,198 @@
+#ifndef __ASM_SH_RENESAS_R7780RP_H
+#define __ASM_SH_RENESAS_R7780RP_H
+
+/* Box specific addresses.  */
+#if defined(CONFIG_SH_R7780MP)
+#define PA_BCR          0xa4000000      /* FPGA */
+#define PA_SDPOW       (-1)
+
+#define PA_IRLMSK       (PA_BCR+0x0000) /* Interrupt Mask control */
+#define PA_IRLMON       (PA_BCR+0x0002) /* Interrupt Status control */
+#define PA_IRLPRI1      (PA_BCR+0x0004) /* Interrupt Priorty 1 */
+#define PA_IRLPRI2      (PA_BCR+0x0006) /* Interrupt Priorty 2 */
+#define PA_IRLPRI3      (PA_BCR+0x0008) /* Interrupt Priorty 3 */
+#define PA_IRLPRI4      (PA_BCR+0x000a) /* Interrupt Priorty 4 */
+#define PA_RSTCTL       (PA_BCR+0x000c) /* Reset Control */
+#define PA_PCIBD        (PA_BCR+0x000e) /* PCI Board detect control */
+#define PA_PCICD        (PA_BCR+0x0010) /* PCI Conector detect control */
+#define PA_EXTGIO       (PA_BCR+0x0016) /* Extension GPIO Control */
+#define PA_IVDRMON      (PA_BCR+0x0018) /* iVDR Moniter control */
+#define PA_IVDRCTL      (PA_BCR+0x001a) /* iVDR control */
+#define PA_OBLED        (PA_BCR+0x001c) /* On Board LED control */
+#define PA_OBSW         (PA_BCR+0x001e) /* On Board Switch control */
+#define PA_AUDIOSEL     (PA_BCR+0x0020) /* Sound Interface Select control */
+#define PA_EXTPLR       (PA_BCR+0x001e) /* Extention Pin Polarity control */
+#define PA_TPCTL        (PA_BCR+0x0100) /* Touch Panel Access control */
+#define PA_TPDCKCTL     (PA_BCR+0x0102) /* Touch Panel Access data control */
+#define PA_TPCTLCLR     (PA_BCR+0x0104) /* Touch Panel Access control */
+#define PA_TPXPOS       (PA_BCR+0x0106) /* Touch Panel X position control */
+#define PA_TPYPOS       (PA_BCR+0x0108) /* Touch Panel Y position control */
+#define PA_DBSW         (PA_BCR+0x0200) /* Debug Board Switch control */
+#define PA_CFCTL        (PA_BCR+0x0300) /* CF Timing control */
+#define PA_CFPOW        (PA_BCR+0x0302) /* CF Power control */
+#define PA_CFCDINTCLR   (PA_BCR+0x0304) /* CF Insert Interrupt clear */
+#define PA_SCSMR0       (PA_BCR+0x0400) /* SCIF0 Serial mode control */
+#define PA_SCBRR0       (PA_BCR+0x0404) /* SCIF0 Bit rate control */
+#define PA_SCSCR0       (PA_BCR+0x0408) /* SCIF0 Serial control */
+#define PA_SCFTDR0      (PA_BCR+0x040c) /* SCIF0 Send FIFO control */
+#define PA_SCFSR0       (PA_BCR+0x0410) /* SCIF0 Serial status control */
+#define PA_SCFRDR0      (PA_BCR+0x0414) /* SCIF0 Receive FIFO control */
+#define PA_SCFCR0       (PA_BCR+0x0418) /* SCIF0 FIFO control */
+#define PA_SCTFDR0      (PA_BCR+0x041c) /* SCIF0 Send FIFO data control */
+#define PA_SCRFDR0      (PA_BCR+0x0420) /* SCIF0 Receive FIFO data control */
+#define PA_SCSPTR0      (PA_BCR+0x0424) /* SCIF0 Serial Port control */
+#define PA_SCLSR0       (PA_BCR+0x0428) /* SCIF0 Line Status control */
+#define PA_SCRER0       (PA_BCR+0x042c) /* SCIF0 Serial Error control */
+#define PA_SCSMR1       (PA_BCR+0x0500) /* SCIF1 Serial mode control */
+#define PA_SCBRR1       (PA_BCR+0x0504) /* SCIF1 Bit rate control */
+#define PA_SCSCR1       (PA_BCR+0x0508) /* SCIF1 Serial control */
+#define PA_SCFTDR1      (PA_BCR+0x050c) /* SCIF1 Send FIFO control */
+#define PA_SCFSR1       (PA_BCR+0x0510) /* SCIF1 Serial status control */
+#define PA_SCFRDR1      (PA_BCR+0x0514) /* SCIF1 Receive FIFO control */
+#define PA_SCFCR1       (PA_BCR+0x0518) /* SCIF1 FIFO control */
+#define PA_SCTFDR1      (PA_BCR+0x051c) /* SCIF1 Send FIFO data control */
+#define PA_SCRFDR1      (PA_BCR+0x0520) /* SCIF1 Receive FIFO data control */
+#define PA_SCSPTR1      (PA_BCR+0x0524) /* SCIF1 Serial Port control */
+#define PA_SCLSR1       (PA_BCR+0x0528) /* SCIF1 Line Status control */
+#define PA_SCRER1       (PA_BCR+0x052c) /* SCIF1 Serial Error control */
+#define PA_SMCR         (PA_BCR+0x0600) /* 2-wire Serial control */
+#define PA_SMSMADR      (PA_BCR+0x0602) /* 2-wire Serial Slave control */
+#define PA_SMMR         (PA_BCR+0x0604) /* 2-wire Serial Mode control */
+#define PA_SMSADR1      (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
+#define PA_SMTRDR1      (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
+#define PA_VERREG       (PA_BCR+0x0700) /* FPGA Version Register */
+#define PA_POFF         (PA_BCR+0x0800) /* System Power Off control */
+#define PA_PMR          (PA_BCR+0x0900) /*  */
+
+#define IRLCNTR1        (PA_BCR + 0)    /* Interrupt Control Register1 */
+#define IVDR_CK_ON     8               /* iVDR Clock ON */
+
+#elif defined(CONFIG_SH_R7780RP)
+#define PA_POFF                (-1)
+
+#define PA_BCR         0xa5000000      /* FPGA */
+#define        PA_IRLMSK       (PA_BCR+0x0000) /* Interrupt Mask control */
+#define PA_IRLMON      (PA_BCR+0x0002) /* Interrupt Status control */
+#define        PA_SDPOW        (PA_BCR+0x0004) /* SD Power control */
+#define        PA_RSTCTL       (PA_BCR+0x0006) /* Device Reset control */
+#define        PA_PCIBD        (PA_BCR+0x0008) /* PCI Board detect control */
+#define        PA_PCICD        (PA_BCR+0x000a) /* PCI Conector detect control */
+#define        PA_ZIGIO1       (PA_BCR+0x000c) /* Zigbee IO control 1 */
+#define        PA_ZIGIO2       (PA_BCR+0x000e) /* Zigbee IO control 2 */
+#define        PA_ZIGIO3       (PA_BCR+0x0010) /* Zigbee IO control 3 */
+#define        PA_ZIGIO4       (PA_BCR+0x0012) /* Zigbee IO control 4 */
+#define        PA_IVDRMON      (PA_BCR+0x0014) /* iVDR Moniter control */
+#define        PA_IVDRCTL      (PA_BCR+0x0016) /* iVDR control */
+#define PA_OBLED       (PA_BCR+0x0018) /* On Board LED control */
+#define PA_OBSW                (PA_BCR+0x001a) /* On Board Switch control */
+#define PA_AUDIOSEL    (PA_BCR+0x001c) /* Sound Interface Select control */
+#define PA_EXTPLR      (PA_BCR+0x001e) /* Extention Pin Polarity control */
+#define PA_TPCTL       (PA_BCR+0x0100) /* Touch Panel Access control */
+#define PA_TPDCKCTL    (PA_BCR+0x0102) /* Touch Panel Access data control */
+#define PA_TPCTLCLR    (PA_BCR+0x0104) /* Touch Panel Access control */
+#define PA_TPXPOS      (PA_BCR+0x0106) /* Touch Panel X position control */
+#define PA_TPYPOS      (PA_BCR+0x0108) /* Touch Panel Y position control */
+#define PA_DBDET       (PA_BCR+0x0200) /* Debug Board detect control */
+#define PA_DBDISPCTL   (PA_BCR+0x0202) /* Debug Board Dot timing control */
+#define PA_DBSW                (PA_BCR+0x0204) /* Debug Board Switch control */
+#define PA_CFCTL       (PA_BCR+0x0300) /* CF Timing control */
+#define PA_CFPOW       (PA_BCR+0x0302) /* CF Power control */
+#define PA_CFCDINTCLR  (PA_BCR+0x0304) /* CF Insert Interrupt clear */
+#define PA_SCSMR       (PA_BCR+0x0400) /* SCIF Serial mode control */
+#define PA_SCBRR       (PA_BCR+0x0402) /* SCIF Bit rate control */
+#define PA_SCSCR       (PA_BCR+0x0404) /* SCIF Serial control */
+#define PA_SCFDTR      (PA_BCR+0x0406) /* SCIF Send FIFO control */
+#define PA_SCFSR       (PA_BCR+0x0408) /* SCIF Serial status control */
+#define PA_SCFRDR      (PA_BCR+0x040a) /* SCIF Receive FIFO control */
+#define PA_SCFCR       (PA_BCR+0x040c) /* SCIF FIFO control */
+#define PA_SCFDR       (PA_BCR+0x040e) /* SCIF FIFO data control */
+#define PA_SCLSR       (PA_BCR+0x0412) /* SCIF Line Status control */
+#define PA_SMCR                (PA_BCR+0x0500) /* 2-wire Serial control */
+#define PA_SMSMADR     (PA_BCR+0x0502) /* 2-wire Serial Slave control */
+#define PA_SMMR                (PA_BCR+0x0504) /* 2-wire Serial Mode control */
+#define PA_SMSADR1     (PA_BCR+0x0506) /* 2-wire Serial Address1 control */
+#define PA_SMTRDR1     (PA_BCR+0x0546) /* 2-wire Serial Data1 control */
+#define PA_VERREG      (PA_BCR+0x0600) /* FPGA Version Register */
+
+#define PA_AX88796L    0xa5800400      /* AX88796L Area */
+#define PA_SC1602BSLB  0xa6000000      /* SC1602BSLB Area */
+#define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
+#define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
+
+#define IRLCNTR1       (PA_BCR + 0)    /* Interrupt Control Register1 */
+
+#define IVDR_CK_ON     8               /* iVDR Clock ON */
+
+#elif defined(CONFIG_SH_R7785RP)
+#define PA_BCR         0xa4000000      /* FPGA */
+#define PA_SDPOW       (-1)
+
+#define        PA_PCISCR       (PA_BCR+0x0000)
+#define PA_IRLPRA      (PA_BCR+0x0002)
+#define        PA_IRLPRB       (PA_BCR+0x0004)
+#define        PA_IRLPRC       (PA_BCR+0x0006)
+#define        PA_IRLPRD       (PA_BCR+0x0008)
+#define IRLCNTR1       (PA_BCR+0x0010)
+#define        PA_IRLPRE       (PA_BCR+0x000a)
+#define        PA_IRLPRF       (PA_BCR+0x000c)
+#define        PA_EXIRLCR      (PA_BCR+0x000e)
+#define        PA_IRLMCR1      (PA_BCR+0x0010)
+#define        PA_IRLMCR2      (PA_BCR+0x0012)
+#define        PA_IRLSSR1      (PA_BCR+0x0014)
+#define        PA_IRLSSR2      (PA_BCR+0x0016)
+#define PA_CFTCR       (PA_BCR+0x0100)
+#define PA_CFPCR       (PA_BCR+0x0102)
+#define PA_PCICR       (PA_BCR+0x0110)
+#define PA_IVDRCTL     (PA_BCR+0x0112)
+#define PA_IVDRSR      (PA_BCR+0x0114)
+#define PA_PDRSTCR     (PA_BCR+0x0116)
+#define PA_POFF                (PA_BCR+0x0120)
+#define PA_LCDCR       (PA_BCR+0x0130)
+#define PA_TPCR                (PA_BCR+0x0140)
+#define PA_TPCKCR      (PA_BCR+0x0142)
+#define PA_TPRSTR      (PA_BCR+0x0144)
+#define PA_TPXPDR      (PA_BCR+0x0146)
+#define PA_TPYPDR      (PA_BCR+0x0148)
+#define PA_GPIOPFR     (PA_BCR+0x0150)
+#define PA_GPIODR      (PA_BCR+0x0152)
+#define PA_OBLED       (PA_BCR+0x0154)
+#define PA_SWSR                (PA_BCR+0x0156)
+#define PA_VERREG      (PA_BCR+0x0158)
+#define PA_SMCR                (PA_BCR+0x0200)
+#define PA_SMSMADR     (PA_BCR+0x0202)
+#define PA_SMMR                (PA_BCR+0x0204)
+#define PA_SMSADR1     (PA_BCR+0x0206)
+#define PA_SMSADR32    (PA_BCR+0x0244)
+#define PA_SMTRDR1     (PA_BCR+0x0246)
+#define PA_SMTRDR16    (PA_BCR+0x0264)
+#define PA_CU3MDR      (PA_BCR+0x0300)
+#define PA_CU5MDR      (PA_BCR+0x0302)
+#define PA_MMSR                (PA_BCR+0x0400)
+
+#define IVDR_CK_ON     4               /* iVDR Clock ON */
+#endif
+
+#define HL_FPGA_IRQ_BASE       200
+#define HL_NR_IRL              15
+
+#define IRQ_AX88796            (HL_FPGA_IRQ_BASE + 0)
+#define IRQ_CF                 (HL_FPGA_IRQ_BASE + 1)
+#define IRQ_PSW                        (HL_FPGA_IRQ_BASE + 2)
+#define IRQ_EXT0               (HL_FPGA_IRQ_BASE + 3)
+#define IRQ_EXT1               (HL_FPGA_IRQ_BASE + 4)
+#define IRQ_EXT2               (HL_FPGA_IRQ_BASE + 5)
+#define IRQ_EXT3               (HL_FPGA_IRQ_BASE + 6)
+#define IRQ_EXT4               (HL_FPGA_IRQ_BASE + 7)
+#define IRQ_EXT5               (HL_FPGA_IRQ_BASE + 8)
+#define IRQ_EXT6               (HL_FPGA_IRQ_BASE + 9)
+#define IRQ_EXT7               (HL_FPGA_IRQ_BASE + 10)
+#define IRQ_SMBUS              (HL_FPGA_IRQ_BASE + 11)
+#define IRQ_TP                 (HL_FPGA_IRQ_BASE + 12)
+#define IRQ_RTC                        (HL_FPGA_IRQ_BASE + 13)
+#define IRQ_TH_ALERT           (HL_FPGA_IRQ_BASE + 14)
+#define IRQ_SCIF0              (HL_FPGA_IRQ_BASE + 15)
+#define IRQ_SCIF1              (HL_FPGA_IRQ_BASE + 16)
+
+unsigned char *highlander_plat_irq_setup(void);
+
+#endif  /* __ASM_SH_RENESAS_R7780RP */
diff --git a/arch/sh/include/asm/resource.h b/arch/sh/include/asm/resource.h
new file mode 100644 (file)
index 0000000..9c2499a
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_RESOURCE_H
+#define __ASM_SH_RESOURCE_H
+
+#include <asm-generic/resource.h>
+
+#endif /* __ASM_SH_RESOURCE_H */
diff --git a/arch/sh/include/asm/rtc.h b/arch/sh/include/asm/rtc.h
new file mode 100644 (file)
index 0000000..1813f42
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASM_RTC_H
+#define _ASM_RTC_H
+
+extern void (*board_time_init)(void);
+extern void (*rtc_sh_get_time)(struct timespec *);
+extern int (*rtc_sh_set_time)(const time_t);
+
+#define RTC_CAP_4_DIGIT_YEAR   (1 << 0)
+
+struct sh_rtc_platform_info {
+       unsigned long capabilities;
+};
+
+#include <cpu/rtc.h>
+
+#endif /* _ASM_RTC_H */
diff --git a/arch/sh/include/asm/rts7751r2d.h b/arch/sh/include/asm/rts7751r2d.h
new file mode 100644 (file)
index 0000000..0a80015
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef __ASM_SH_RENESAS_RTS7751R2D_H
+#define __ASM_SH_RENESAS_RTS7751R2D_H
+
+/*
+ * linux/include/asm-sh/renesas_rts7751r2d.h
+ *
+ * Copyright (C) 2000  Atom Create Engineering Co., Ltd.
+ *
+ * Renesas Technology Sales RTS7751R2D support
+ */
+
+/* Board specific addresses.  */
+
+#define PA_BCR         0xa4000000      /* FPGA */
+#define PA_IRLMON      0xa4000002      /* Interrupt Status control */
+#define PA_CFCTL       0xa4000004      /* CF Timing control */
+#define PA_CFPOW       0xa4000006      /* CF Power control */
+#define PA_DISPCTL     0xa4000008      /* Display Timing control */
+#define PA_SDMPOW      0xa400000a      /* SD Power control */
+#define PA_RTCCE       0xa400000c      /* RTC(9701) Enable control */
+#define PA_PCICD       0xa400000e      /* PCI Extention detect control */
+#define PA_VOYAGERRTS  0xa4000020      /* VOYAGER Reset control */
+
+#define PA_R2D1_AXRST          0xa4000022      /* AX_LAN Reset control */
+#define PA_R2D1_CFRST          0xa4000024      /* CF Reset control */
+#define PA_R2D1_ADMRTS         0xa4000026      /* SD Reset control */
+#define PA_R2D1_EXTRST         0xa4000028      /* Extention Reset control */
+#define PA_R2D1_CFCDINTCLR     0xa400002a      /* CF Insert Interrupt clear */
+
+#define PA_R2DPLUS_CFRST       0xa4000022      /* CF Reset control */
+#define PA_R2DPLUS_ADMRTS      0xa4000024      /* SD Reset control */
+#define PA_R2DPLUS_EXTRST      0xa4000026      /* Extention Reset control */
+#define PA_R2DPLUS_CFCDINTCLR  0xa4000028      /* CF Insert Interrupt clear */
+#define PA_R2DPLUS_KEYCTLCLR   0xa400002a      /* Key Interrupt clear */
+
+#define PA_POWOFF      0xa4000030      /* Board Power OFF control */
+#define PA_VERREG      0xa4000032      /* FPGA Version Register */
+#define PA_INPORT      0xa4000034      /* KEY Input Port control */
+#define PA_OUTPORT     0xa4000036      /* LED control */
+#define PA_BVERREG     0xa4000038      /* Board Revision Register */
+
+#define PA_AX88796L    0xaa000400      /* AX88796L Area */
+#define PA_VOYAGER     0xab000000      /* VOYAGER GX Area */
+#define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
+#define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
+
+#define IRLCNTR1       (PA_BCR + 0)    /* Interrupt Control Register1 */
+
+#define R2D_FPGA_IRQ_BASE      100
+
+#define IRQ_VOYAGER            (R2D_FPGA_IRQ_BASE + 0)
+#define IRQ_EXT                        (R2D_FPGA_IRQ_BASE + 1)
+#define IRQ_TP                 (R2D_FPGA_IRQ_BASE + 2)
+#define IRQ_RTC_T              (R2D_FPGA_IRQ_BASE + 3)
+#define IRQ_RTC_A              (R2D_FPGA_IRQ_BASE + 4)
+#define IRQ_SDCARD             (R2D_FPGA_IRQ_BASE + 5)
+#define IRQ_CF_CD              (R2D_FPGA_IRQ_BASE + 6)
+#define IRQ_CF_IDE             (R2D_FPGA_IRQ_BASE + 7)
+#define IRQ_AX88796            (R2D_FPGA_IRQ_BASE + 8)
+#define IRQ_KEY                        (R2D_FPGA_IRQ_BASE + 9)
+#define IRQ_PCI_INTA           (R2D_FPGA_IRQ_BASE + 10)
+#define IRQ_PCI_INTB           (R2D_FPGA_IRQ_BASE + 11)
+#define IRQ_PCI_INTC           (R2D_FPGA_IRQ_BASE + 12)
+#define IRQ_PCI_INTD           (R2D_FPGA_IRQ_BASE + 13)
+
+/* arch/sh/boards/renesas/rts7751r2d/irq.c */
+void init_rts7751r2d_IRQ(void);
+int rts7751r2d_irq_demux(int);
+
+#endif  /* __ASM_SH_RENESAS_RTS7751R2D */
diff --git a/arch/sh/include/asm/rwsem.h b/arch/sh/include/asm/rwsem.h
new file mode 100644 (file)
index 0000000..1987f3e
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * include/asm-sh/rwsem.h: R/W semaphores for SH using the stuff
+ * in lib/rwsem.c.
+ */
+
+#ifndef _ASM_SH_RWSEM_H
+#define _ASM_SH_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/list.h>
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+#include <asm/system.h>
+
+/*
+ * the semaphore definition
+ */
+struct rw_semaphore {
+       long            count;
+#define RWSEM_UNLOCKED_VALUE           0x00000000
+#define RWSEM_ACTIVE_BIAS              0x00000001
+#define RWSEM_ACTIVE_MASK              0x0000ffff
+#define RWSEM_WAITING_BIAS             (-0x00010000)
+#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;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map      dep_map;
+#endif
+};
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
+#else
+# define __RWSEM_DEP_MAP_INIT(lockname)
+#endif
+
+#define __RWSEM_INITIALIZER(name) \
+       { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+         LIST_HEAD_INIT((name).wait_list) \
+         __RWSEM_DEP_MAP_INIT(name) }
+
+#define DECLARE_RWSEM(name)            \
+       struct rw_semaphore name = __RWSEM_INITIALIZER(name)
+
+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 *sem);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
+extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                        struct lock_class_key *key);
+
+#define init_rwsem(sem)                                \
+do {                                           \
+       static struct lock_class_key __key;     \
+                                               \
+       __init_rwsem((sem), #sem, &__key);      \
+} while (0)
+
+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);
+}
+
+/*
+ * lock for reading
+ */
+static inline void __down_read(struct rw_semaphore *sem)
+{
+       if (atomic_inc_return((atomic_t *)(&sem->count)) > 0)
+               smp_wmb();
+       else
+               rwsem_down_read_failed(sem);
+}
+
+static inline int __down_read_trylock(struct rw_semaphore *sem)
+{
+       int tmp;
+
+       while ((tmp = sem->count) >= 0) {
+               if (tmp == cmpxchg(&sem->count, tmp,
+                                  tmp + RWSEM_ACTIVE_READ_BIAS)) {
+                       smp_wmb();
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * lock for writing
+ */
+static inline void __down_write(struct rw_semaphore *sem)
+{
+       int tmp;
+
+       tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS,
+                               (atomic_t *)(&sem->count));
+       if (tmp == RWSEM_ACTIVE_WRITE_BIAS)
+               smp_wmb();
+       else
+               rwsem_down_write_failed(sem);
+}
+
+static inline int __down_write_trylock(struct rw_semaphore *sem)
+{
+       int tmp;
+
+       tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+                     RWSEM_ACTIVE_WRITE_BIAS);
+       smp_wmb();
+       return tmp == RWSEM_UNLOCKED_VALUE;
+}
+
+/*
+ * unlock after reading
+ */
+static inline void __up_read(struct rw_semaphore *sem)
+{
+       int tmp;
+
+       smp_wmb();
+       tmp = atomic_dec_return((atomic_t *)(&sem->count));
+       if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)
+               rwsem_wake(sem);
+}
+
+/*
+ * unlock after writing
+ */
+static inline void __up_write(struct rw_semaphore *sem)
+{
+       smp_wmb();
+       if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
+                             (atomic_t *)(&sem->count)) < 0)
+               rwsem_wake(sem);
+}
+
+/*
+ * implement atomic add functionality
+ */
+static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
+{
+       atomic_add(delta, (atomic_t *)(&sem->count));
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void __downgrade_write(struct rw_semaphore *sem)
+{
+       int tmp;
+
+       smp_wmb();
+       tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count));
+       if (tmp < 0)
+               rwsem_downgrade_wake(sem);
+}
+
+static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
+{
+       __down_write(sem);
+}
+
+/*
+ * implement exchange and add functionality
+ */
+static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
+{
+       smp_mb();
+       return atomic_add_return(delta, (atomic_t *)(&sem->count));
+}
+
+static inline int rwsem_is_locked(struct rw_semaphore *sem)
+{
+       return (sem->count != 0);
+}
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_SH_RWSEM_H */
diff --git a/arch/sh/include/asm/scatterlist.h b/arch/sh/include/asm/scatterlist.h
new file mode 100644 (file)
index 0000000..2084d03
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __ASM_SH_SCATTERLIST_H
+#define __ASM_SH_SCATTERLIST_H
+
+#include <asm/types.h>
+
+struct scatterlist {
+#ifdef CONFIG_DEBUG_SG
+    unsigned long sg_magic;
+#endif
+    unsigned long page_link;
+    unsigned int offset;/* for highmem, page offset */
+    dma_addr_t dma_address;
+    unsigned int length;
+};
+
+#define ISA_DMA_THRESHOLD      PHYS_ADDR_MASK
+
+/* These macros should be used after a pci_map_sg call has been done
+ * to get bus addresses of each of the SG entries and their lengths.
+ * You should only work with the number of sg entries pci_map_sg
+ * returns, or alternatively stop on the first sg_dma_len(sg) which
+ * is 0.
+ */
+#define sg_dma_address(sg)     ((sg)->dma_address)
+#define sg_dma_len(sg)         ((sg)->length)
+
+#endif /* !(__ASM_SH_SCATTERLIST_H) */
diff --git a/arch/sh/include/asm/sdk7780.h b/arch/sh/include/asm/sdk7780.h
new file mode 100644 (file)
index 0000000..697dc86
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef __ASM_SH_RENESAS_SDK7780_H
+#define __ASM_SH_RENESAS_SDK7780_H
+
+/*
+ * linux/include/asm-sh/sdk7780.h
+ *
+ * Renesas Solutions SH7780 SDK Support
+ * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
+ *
+ * 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.
+ */
+#include <asm/addrspace.h>
+
+/* Box specific addresses.  */
+#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
+#define PA_ROM                 0xa0000000      /* EPROM */
+#define PA_ROM_SIZE            0x00400000      /* EPROM size 4M byte */
+#define PA_FROM                        0xa0800000      /* Flash-ROM */
+#define PA_FROM_SIZE   0x00400000      /* Flash-ROM size 4M byte */
+#define PA_EXT1                        0xa4000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_SDRAM               0xa8000000      /* DDR-SDRAM(Area2/3) 128MB */
+#define PA_SDRAM_SIZE  0x08000000
+
+#define PA_EXT4                        0xb0000000
+#define PA_EXT4_SIZE   0x04000000
+#define PA_EXT_USER            PA_EXT4         /* User Expansion Space */
+
+#define PA_PERIPHERAL  PA_AREA5_IO
+
+/* SRAM/Reserved */
+#define PA_RESERVED    (PA_PERIPHERAL + 0)
+/* FPGA base address */
+#define PA_FPGA                (PA_PERIPHERAL + 0x01000000)
+/* SMC LAN91C111 */
+#define PA_LAN         (PA_PERIPHERAL + 0x01800000)
+
+
+#define FPGA_SRSTR      (PA_FPGA + 0x000)      /* System reset */
+#define FPGA_IRQ0SR     (PA_FPGA + 0x010)      /* IRQ0 status */
+#define FPGA_IRQ0MR     (PA_FPGA + 0x020)      /* IRQ0 mask */
+#define FPGA_BDMR       (PA_FPGA + 0x030)      /* Board operating mode */
+#define FPGA_INTT0PRTR  (PA_FPGA + 0x040)      /* Interrupt test mode0 port */
+#define FPGA_INTT0SELR  (PA_FPGA + 0x050)      /* Int. test mode0 select */
+#define FPGA_INTT1POLR  (PA_FPGA + 0x060)      /* Int. test mode0 polarity */
+#define FPGA_NMIR       (PA_FPGA + 0x070)      /* NMI source */
+#define FPGA_NMIMR      (PA_FPGA + 0x080)      /* NMI mask */
+#define FPGA_IRQR       (PA_FPGA + 0x090)      /* IRQX source */
+#define FPGA_IRQMR      (PA_FPGA + 0x0A0)      /* IRQX mask */
+#define FPGA_SLEDR      (PA_FPGA + 0x0B0)      /* LED control */
+#define PA_LED                 FPGA_SLEDR
+#define FPGA_MAPSWR     (PA_FPGA + 0x0C0)      /* Map switch */
+#define FPGA_FPVERR     (PA_FPGA + 0x0D0)      /* FPGA version */
+#define FPGA_FPDATER    (PA_FPGA + 0x0E0)      /* FPGA date */
+#define FPGA_RSE        (PA_FPGA + 0x100)      /* Reset source */
+#define FPGA_EASR       (PA_FPGA + 0x110)      /* External area select */
+#define FPGA_SPER       (PA_FPGA + 0x120)      /* Serial port enable */
+#define FPGA_IMSR       (PA_FPGA + 0x130)      /* Interrupt mode select */
+#define FPGA_PCIMR      (PA_FPGA + 0x140)      /* PCI Mode */
+#define FPGA_DIPSWMR    (PA_FPGA + 0x150)      /* DIPSW monitor */
+#define FPGA_FPODR      (PA_FPGA + 0x160)      /* Output port data */
+#define FPGA_ATAESR     (PA_FPGA + 0x170)      /* ATA extended bus status */
+#define FPGA_IRQPOLR    (PA_FPGA + 0x180)      /* IRQx polarity */
+
+
+#define SDK7780_NR_IRL                 15
+/* IDE/ATA interrupt */
+#define IRQ_CFCARD                             14
+/* SMC interrupt */
+#define IRQ_ETHERNET                   6
+
+
+/* arch/sh/boards/renesas/sdk7780/irq.c */
+void init_sdk7780_IRQ(void);
+
+#define __IO_PREFIX            sdk7780
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_RENESAS_SDK7780_H */
diff --git a/arch/sh/include/asm/sections.h b/arch/sh/include/asm/sections.h
new file mode 100644 (file)
index 0000000..8f8f4ad
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_SH_SECTIONS_H
+#define __ASM_SH_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+extern long __machvec_start, __machvec_end;
+extern char __uncached_start, __uncached_end;
+extern char _ebss[];
+
+#endif /* __ASM_SH_SECTIONS_H */
+
diff --git a/arch/sh/include/asm/segment.h b/arch/sh/include/asm/segment.h
new file mode 100644 (file)
index 0000000..5e2725f
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ASM_SH_SEGMENT_H
+#define __ASM_SH_SEGMENT_H
+
+#ifndef __ASSEMBLY__
+
+typedef struct {
+       unsigned long seg;
+} mm_segment_t;
+
+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
+
+/*
+ * 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.
+ *
+ * For historical reasons, these macros are grossly misnamed.
+ */
+#define KERNEL_DS      MAKE_MM_SEG(0xFFFFFFFFUL)
+#ifdef CONFIG_MMU
+#define USER_DS                MAKE_MM_SEG(PAGE_OFFSET)
+#else
+#define USER_DS                KERNEL_DS
+#endif
+
+#define segment_eq(a,b)        ((a).seg == (b).seg)
+
+#define get_ds()       (KERNEL_DS)
+
+#define get_fs()       (current_thread_info()->addr_limit)
+#define set_fs(x)      (current_thread_info()->addr_limit = (x))
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_SEGMENT_H */
diff --git a/arch/sh/include/asm/sembuf.h b/arch/sh/include/asm/sembuf.h
new file mode 100644 (file)
index 0000000..d79f3bd
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __ASM_SH_SEMBUF_H
+#define __ASM_SH_SEMBUF_H
+
+/* 
+ * The semid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct semid64_ds {
+       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
+       __kernel_time_t sem_otime;              /* last semop time */
+       unsigned long   __unused1;
+       __kernel_time_t sem_ctime;              /* last change time */
+       unsigned long   __unused2;
+       unsigned long   sem_nsems;              /* no. of semaphores in array */
+       unsigned long   __unused3;
+       unsigned long   __unused4;
+};
+
+#endif /* __ASM_SH_SEMBUF_H */
diff --git a/arch/sh/include/asm/serial.h b/arch/sh/include/asm/serial.h
new file mode 100644 (file)
index 0000000..e13cc94
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * include/asm-sh/serial.h
+ *
+ * Configuration details for 8250, 16450, 16550, etc. serial ports
+ */
+
+#ifndef _ASM_SERIAL_H
+#define _ASM_SERIAL_H
+
+#include <linux/kernel.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 )
+
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+#ifdef CONFIG_HD64465
+#include <asm/hd64465/hd64465.h>
+
+#define SERIAL_PORT_DFNS                   \
+        /* UART CLK   PORT IRQ     FLAGS        */                      \
+        { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS }  /* ttyS0 */
+
+#else
+
+#define SERIAL_PORT_DFNS
+
+#endif
+
+#endif /* _ASM_SERIAL_H */
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h
new file mode 100644 (file)
index 0000000..55a2bd3
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _SH_SETUP_H
+#define _SH_SETUP_H
+
+#define COMMAND_LINE_SIZE 256
+
+#ifdef __KERNEL__
+
+/*
+ * This is set up by the setup-routine at boot-time
+ */
+#define PARAM  ((unsigned char *)empty_zero_page)
+
+#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
+#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
+#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
+#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
+#define INITRD_START (*(unsigned long *) (PARAM+0x010))
+#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
+/* ... */
+#define COMMAND_LINE ((char *) (PARAM+0x100))
+
+int setup_early_printk(char *);
+void sh_mv_setup(void);
+
+#endif /* __KERNEL__ */
+
+#endif /* _SH_SETUP_H */
diff --git a/arch/sh/include/asm/sfp-machine.h b/arch/sh/include/asm/sfp-machine.h
new file mode 100644 (file)
index 0000000..d3c5484
--- /dev/null
@@ -0,0 +1,84 @@
+/* Machine-dependent software floating-point definitions.
+   SuperH 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 (jj@ultra.linux.cz),
+                 David S. Miller (davem@redhat.com) and
+                 Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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                32
+#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_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y)                                  \
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)                                  \
+  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y)  _FP_DIV_MEAT_1_udiv(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)  _FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)  _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S          ((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D          ((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q          ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#define _FP_NANSIGN_S          0
+#define _FP_NANSIGN_D          0
+#define _FP_NANSIGN_Q          0
+
+#define _FP_KEEPNANFRACP 1
+
+/*
+ * If one NaN is signaling and the other is not,
+ * we choose that one, otherwise we choose X.
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                      \
+  do {                                                          \
+    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)          \
+        && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))     \
+      {                                                         \
+        R##_s = Y##_s;                                          \
+        _FP_FRAC_COPY_##wc(R,Y);                                \
+      }                                                         \
+    else                                                        \
+      {                                                         \
+        R##_s = X##_s;                                          \
+        _FP_FRAC_COPY_##wc(R,X);                                \
+      }                                                         \
+    R##_c = FP_CLS_NAN;                                         \
+  } while (0)
+
+//#define FP_ROUNDMODE         FPSCR_RM
+#define FP_DENORM_ZERO         1/*FPSCR_DN*/
+
+/* Exception flags. */
+#define FP_EX_INVALID          (1<<4)
+#define FP_EX_DIVZERO          (1<<3)
+#define FP_EX_OVERFLOW         (1<<2)
+#define FP_EX_UNDERFLOW                (1<<1)
+#define FP_EX_INEXACT          (1<<0)
+
+#endif
+
diff --git a/arch/sh/include/asm/sh7760fb.h b/arch/sh/include/asm/sh7760fb.h
new file mode 100644 (file)
index 0000000..8767f61
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * sh7760fb.h -- platform data for SH7760/SH7763 LCDC framebuffer driver.
+ *
+ * (c) 2006-2008 MSC Vertriebsges.m.b.H.,
+ *                     Manuel Lauss <mano@roarinelk.homelinux.net>
+ * (c) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ */
+
+#ifndef _ASM_SH_SH7760FB_H
+#define _ASM_SH_SH7760FB_H
+
+/*
+ * some bits of the colormap registers should be written as zero.
+ * create a mask for that.
+ */
+#define SH7760FB_PALETTE_MASK 0x00f8fcf8
+
+/* The LCDC dma engine always sets bits 27-26 to 1: this is Area3 */
+#define SH7760FB_DMA_MASK 0x0C000000
+
+/* palette */
+#define LDPR(x) (((x) << 2))
+
+/* framebuffer registers and bits */
+#define LDICKR 0x400
+#define LDMTR 0x402
+/* see sh7760fb.h for LDMTR bits */
+#define LDDFR 0x404
+#define LDDFR_PABD (1 << 8)
+#define LDDFR_COLOR_MASK 0x7F
+#define LDSMR 0x406
+#define LDSMR_ROT (1 << 13)
+#define LDSARU 0x408
+#define LDSARL 0x40c
+#define LDLAOR 0x410
+#define LDPALCR 0x412
+#define LDPALCR_PALS (1 << 4)
+#define LDPALCR_PALEN (1 << 0)
+#define LDHCNR 0x414
+#define LDHSYNR 0x416
+#define LDVDLNR 0x418
+#define LDVTLNR 0x41a
+#define LDVSYNR 0x41c
+#define LDACLNR 0x41e
+#define LDINTR 0x420
+#define LDPMMR 0x424
+#define LDPSPR 0x426
+#define LDCNTR 0x428
+#define LDCNTR_DON (1 << 0)
+#define LDCNTR_DON2 (1 << 4)
+
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+# define LDLIRNR       0x440
+/* LDINTR bit */
+# define LDINTR_MINTEN (1 << 15)
+# define LDINTR_FINTEN (1 << 14)
+# define LDINTR_VSINTEN (1 << 13)
+# define LDINTR_VEINTEN (1 << 12)
+# define LDINTR_MINTS (1 << 11)
+# define LDINTR_FINTS (1 << 10)
+# define LDINTR_VSINTS (1 << 9)
+# define LDINTR_VEINTS (1 << 8)
+# define VINT_START (LDINTR_VSINTEN)
+# define VINT_CHECK (LDINTR_VSINTS)
+#else
+/* LDINTR bit */
+# define LDINTR_VINTSEL (1 << 12)
+# define LDINTR_VINTE (1 << 8)
+# define LDINTR_VINTS (1 << 0)
+# define VINT_START (LDINTR_VINTSEL)
+# define VINT_CHECK (LDINTR_VINTS)
+#endif
+
+/* HSYNC polarity inversion */
+#define LDMTR_FLMPOL (1 << 15)
+
+/* VSYNC polarity inversion */
+#define LDMTR_CL1POL (1 << 14)
+
+/* DISPLAY-ENABLE polarity inversion */
+#define LDMTR_DISPEN_LOWACT (1 << 13)
+
+/* DISPLAY DATA BUS polarity inversion */
+#define LDMTR_DPOL_LOWACT (1 << 12)
+
+/* AC modulation signal enable */
+#define LDMTR_MCNT (1 << 10)
+
+/* Disable output of HSYNC during VSYNC period */
+#define LDMTR_CL1CNT (1 << 9)
+
+/* Disable output of VSYNC during VSYNC period */
+#define LDMTR_CL2CNT (1 << 8)
+
+/* Display types supported by the LCDC */
+#define LDMTR_STN_MONO_4       0x00
+#define LDMTR_STN_MONO_8       0x01
+#define LDMTR_STN_COLOR_4      0x08
+#define LDMTR_STN_COLOR_8      0x09
+#define LDMTR_STN_COLOR_12     0x0A
+#define LDMTR_STN_COLOR_16     0x0B
+#define LDMTR_DSTN_MONO_8      0x11
+#define LDMTR_DSTN_MONO_16     0x13
+#define LDMTR_DSTN_COLOR_8     0x19
+#define LDMTR_DSTN_COLOR_12    0x1A
+#define LDMTR_DSTN_COLOR_16    0x1B
+#define LDMTR_TFT_COLOR_16     0x2B
+
+/* framebuffer color layout */
+#define LDDFR_1BPP_MONO 0x00
+#define LDDFR_2BPP_MONO 0x01
+#define LDDFR_4BPP_MONO 0x02
+#define LDDFR_6BPP_MONO 0x04
+#define LDDFR_4BPP 0x0A
+#define LDDFR_8BPP 0x0C
+#define LDDFR_16BPP_RGB555 0x1D
+#define LDDFR_16BPP_RGB565 0x2D
+
+/* LCDC Pixclock sources */
+#define LCDC_CLKSRC_BUSCLOCK 0
+#define LCDC_CLKSRC_PERIPHERAL 1
+#define LCDC_CLKSRC_EXTERNAL 2
+
+#define LDICKR_CLKSRC(x) \
+       (((x) & 3) << 12)
+
+/* LCDC pixclock input divider. Set to 1 at a minimum! */
+#define LDICKR_CLKDIV(x) \
+       ((x) & 0x1f)
+
+struct sh7760fb_platdata {
+
+       /* Set this member to a valid fb_videmode for the display you
+        * wish to use.  The following members must be initialized:
+        * xres, yres, hsync_len, vsync_len, sync,
+        * {left,right,upper,lower}_margin.
+        * The driver uses the above members to calculate register values
+        * and memory requirements. Other members are ignored but may
+        * be used by other framebuffer layer components.
+        */
+       struct fb_videomode *def_mode;
+
+       /* LDMTR includes display type and signal polarity.  The
+        * HSYNC/VSYNC polarities are derived from the fb_var_screeninfo
+        * data above; however the polarities of the following signals
+        * must be encoded in the ldmtr member:
+        * Display Enable signal (default high-active)  DISPEN_LOWACT
+        * Display Data signals (default high-active)   DPOL_LOWACT
+        * AC Modulation signal (default off)           MCNT
+        * Hsync-During-Vsync suppression (default off) CL1CNT
+        * Vsync-during-vsync suppression (default off) CL2CNT
+        * NOTE: also set a display type!
+        * (one of LDMTR_{STN,DSTN,TFT}_{MONO,COLOR}_{4,8,12,16})
+        */
+       u16 ldmtr;
+
+       /* LDDFR controls framebuffer image format (depth, organization)
+        * Use ONE of the LDDFR_?BPP_* macros!
+        */
+       u16 lddfr;
+
+       /* LDPMMR and LDPSPR control the timing of the power signals
+        * for the display. Please read the SH7760 Hardware Manual,
+        * Chapters 30.3.17, 30.3.18 and 30.4.6!
+        */
+       u16 ldpmmr;
+       u16 ldpspr;
+
+       /* LDACLNR contains the line numbers after which the AC modulation
+        * signal is to toggle. Set to ZERO for TFTs or displays which
+        * do not need it. (Chapter 30.3.15 in SH7760 Hardware Manual).
+        */
+       u16 ldaclnr;
+
+       /* LDICKR contains information on pixelclock source and config.
+        * Please use the LDICKR_CLKSRC() and LDICKR_CLKDIV() macros.
+        * minimal value for CLKDIV() must be 1!.
+        */
+       u16 ldickr;
+
+       /* set this member to 1 if you wish to use the LCDC's hardware
+        * rotation function.  This is limited to displays <= 320x200
+        * pixels resolution!
+        */
+       int rotate;             /* set to 1 to rotate 90 CCW */
+
+       /* set this to 1 to suppress vsync irq use. */
+       int novsync;
+
+       /* blanking hook for platform. Set this if your platform can do
+        * more than the LCDC in terms of blanking (e.g. disable clock
+        * generator / backlight power supply / etc.
+        */
+       void (*blank) (int);
+};
+
+#endif /* _ASM_SH_SH7760FB_H */
diff --git a/arch/sh/include/asm/sh7763rdp.h b/arch/sh/include/asm/sh7763rdp.h
new file mode 100644 (file)
index 0000000..8750cc8
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef __ASM_SH_SH7763RDP_H
+#define __ASM_SH_SH7763RDP_H
+
+/*
+ * linux/include/asm-sh/sh7763drp.h
+ *
+ * Copyright (C) 2008 Renesas Solutions
+ * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ *
+ * 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.
+ *
+ */
+#include <asm/addrspace.h>
+
+/* clock control */
+#define MSTPCR1 0xFFC80038
+
+/* PORT */
+#define PORT_PSEL0     0xFFEF0070
+#define PORT_PSEL1     0xFFEF0072
+#define PORT_PSEL2     0xFFEF0074
+#define PORT_PSEL3     0xFFEF0076
+#define PORT_PSEL4     0xFFEF0078
+
+#define PORT_PACR      0xFFEF0000
+#define PORT_PCCR      0xFFEF0004
+#define PORT_PFCR      0xFFEF000A
+#define PORT_PGCR      0xFFEF000C
+#define PORT_PHCR      0xFFEF000E
+#define PORT_PICR      0xFFEF0010
+#define PORT_PJCR      0xFFEF0012
+#define PORT_PKCR      0xFFEF0014
+#define PORT_PLCR      0xFFEF0016
+#define PORT_PMCR      0xFFEF0018
+#define PORT_PNCR      0xFFEF001A
+
+/* FPGA */
+#define CPLD_BOARD_ID_ERV_REG  0xB1000000
+#define CPLD_CPLD_CMD_REG              0xB1000006
+
+/*
+ * USB SH7763RDP board can use Host only.
+ */
+#define USB_USBHSC     0xFFEC80f0
+
+/* arch/sh/boards/renesas/sh7763rdp/irq.c */
+void init_sh7763rdp_IRQ(void);
+int sh7763rdp_irq_demux(int irq);
+#define __IO_PREFIX    sh7763rdp
+#include <asm/io_generic.h>
+
+#endif /* __ASM_SH_SH7763RDP_H */
diff --git a/arch/sh/include/asm/sh7785lcr.h b/arch/sh/include/asm/sh7785lcr.h
new file mode 100644 (file)
index 0000000..1ce27d5
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __ASM_SH_RENESAS_SH7785LCR_H
+#define __ASM_SH_RENESAS_SH7785LCR_H
+
+/*
+ * This board has 2 physical memory maps.
+ * It can be changed with DIP switch(S2-5).
+ *
+ * phys address                        | S2-5 = OFF    | S2-5 = ON
+ * -----------------------------+---------------+---------------
+ * 0x00000000 - 0x03ffffff(CS0)        | NOR Flash     | NOR Flash
+ * 0x04000000 - 0x05ffffff(CS1)        | PLD           | PLD
+ * 0x06000000 - 0x07ffffff(CS1)        | reserved      | I2C
+ * 0x08000000 - 0x0bffffff(CS2)        | USB           | DDR SDRAM
+ * 0x0c000000 - 0x0fffffff(CS3)        | SD            | DDR SDRAM
+ * 0x10000000 - 0x13ffffff(CS4)        | SM107         | SM107
+ * 0x14000000 - 0x17ffffff(CS5)        | I2C           | USB
+ * 0x18000000 - 0x1bffffff(CS6)        | reserved      | SD
+ * 0x40000000 - 0x5fffffff     | DDR SDRAM     | (cannot use)
+ *
+ */
+
+#define NOR_FLASH_ADDR         0x00000000
+#define NOR_FLASH_SIZE         0x04000000
+
+#define PLD_BASE_ADDR          0x04000000
+#define PLD_PCICR              (PLD_BASE_ADDR + 0x00)
+#define PLD_LCD_BK_CONTR       (PLD_BASE_ADDR + 0x02)
+#define PLD_LOCALCR            (PLD_BASE_ADDR + 0x04)
+#define PLD_POFCR              (PLD_BASE_ADDR + 0x06)
+#define PLD_LEDCR              (PLD_BASE_ADDR + 0x08)
+#define PLD_SWSR               (PLD_BASE_ADDR + 0x0a)
+#define PLD_VERSR              (PLD_BASE_ADDR + 0x0c)
+#define PLD_MMSR               (PLD_BASE_ADDR + 0x0e)
+
+#define SM107_MEM_ADDR         0x10000000
+#define SM107_MEM_SIZE         0x00e00000
+#define SM107_REG_ADDR         0x13e00000
+#define SM107_REG_SIZE         0x00200000
+
+#if defined(CONFIG_SH_SH7785LCR_29BIT_PHYSMAPS)
+#define R8A66597_ADDR          0x14000000      /* USB */
+#define CG200_ADDR             0x18000000      /* SD */
+#define PCA9564_ADDR           0x06000000      /* I2C */
+#else
+#define R8A66597_ADDR          0x08000000
+#define CG200_ADDR             0x0c000000
+#define PCA9564_ADDR           0x14000000
+#endif
+
+#define R8A66597_SIZE          0x00000100
+#define CG200_SIZE             0x00010000
+#define PCA9564_SIZE           0x00000100
+
+#endif  /* __ASM_SH_RENESAS_SH7785LCR_H */
+
diff --git a/arch/sh/include/asm/sh_bios.h b/arch/sh/include/asm/sh_bios.h
new file mode 100644 (file)
index 0000000..0ca2619
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ASM_SH_BIOS_H
+#define __ASM_SH_BIOS_H
+
+/*
+ * Copyright (C) 2000 Greg Banks, Mitch Davis
+ * C API to interface to the standard LinuxSH BIOS
+ * usually from within the early stages of kernel boot.
+ */
+
+
+extern void sh_bios_console_write(const char *buf, unsigned int len);
+extern void sh_bios_char_out(char ch);
+extern int sh_bios_in_gdb_mode(void);
+extern void sh_bios_gdb_detach(void);
+
+extern void sh_bios_get_node_addr(unsigned char *node_addr);
+extern void sh_bios_shutdown(unsigned int how);
+
+#endif /* __ASM_SH_BIOS_H */
diff --git a/arch/sh/include/asm/sh_keysc.h b/arch/sh/include/asm/sh_keysc.h
new file mode 100644 (file)
index 0000000..b5a4dd5
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_KEYSC_H__
+#define __ASM_KEYSC_H__
+
+#define SH_KEYSC_MAXKEYS 30
+
+struct sh_keysc_info {
+       enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
+       int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
+       int delay;
+       int keycodes[SH_KEYSC_MAXKEYS];
+};
+
+#endif /* __ASM_KEYSC_H__ */
diff --git a/arch/sh/include/asm/sh_mobile_lcdc.h b/arch/sh/include/asm/sh_mobile_lcdc.h
new file mode 100644 (file)
index 0000000..2767772
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __ASM_SH_MOBILE_LCDC_H__
+#define __ASM_SH_MOBILE_LCDC_H__
+
+#include <linux/fb.h>
+
+enum { RGB8,   /* 24bpp, 8:8:8 */
+       RGB9,   /* 18bpp, 9:9 */
+       RGB12A, /* 24bpp, 12:12 */
+       RGB12B, /* 12bpp */
+       RGB16,  /* 16bpp */
+       RGB18,  /* 18bpp */
+       RGB24,  /* 24bpp */
+       SYS8A,  /* 24bpp, 8:8:8 */
+       SYS8B,  /* 18bpp, 8:8:2 */
+       SYS8C,  /* 18bpp, 2:8:8 */
+       SYS8D,  /* 16bpp, 8:8 */
+       SYS9,   /* 18bpp, 9:9 */
+       SYS12,  /* 24bpp, 12:12 */
+       SYS16A, /* 16bpp */
+       SYS16B, /* 18bpp, 16:2 */
+       SYS16C, /* 18bpp, 2:16 */
+       SYS18,  /* 18bpp */
+       SYS24 };/* 24bpp */
+
+enum { LCDC_CHAN_DISABLED = 0,
+       LCDC_CHAN_MAINLCD,
+       LCDC_CHAN_SUBLCD };
+
+enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
+
+struct sh_mobile_lcdc_sys_bus_cfg {
+       unsigned long ldmt2r;
+       unsigned long ldmt3r;
+};
+
+struct sh_mobile_lcdc_sys_bus_ops {
+       void (*write_index)(void *handle, unsigned long data);
+       void (*write_data)(void *handle, unsigned long data);
+       unsigned long (*read_data)(void *handle);
+};
+
+struct sh_mobile_lcdc_board_cfg {
+       void *board_data;
+       int (*setup_sys)(void *board_data, void *sys_ops_handle,
+                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
+       void (*display_on)(void *board_data);
+       void (*display_off)(void *board_data);
+};
+
+struct sh_mobile_lcdc_chan_cfg {
+       int chan;
+       int bpp;
+       int interface_type; /* selects RGBn or SYSn I/F, see above */
+       int clock_divider;
+       struct fb_videomode lcd_cfg;
+       struct sh_mobile_lcdc_board_cfg board_cfg;
+       struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
+};
+
+struct sh_mobile_lcdc_info {
+       unsigned long lddckr;
+       int clock_source;
+       struct sh_mobile_lcdc_chan_cfg ch[2];
+};
+
+#endif /* __ASM_SH_MOBILE_LCDC_H__ */
diff --git a/arch/sh/include/asm/shmbuf.h b/arch/sh/include/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..b2101f4
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __ASM_SH_SHMBUF_H
+#define __ASM_SH_SHMBUF_H
+
+/* 
+ * The shmid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-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 */
+       unsigned long           __unused1;
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       unsigned long           __unused2;
+       __kernel_time_t         shm_ctime;      /* last change time */
+       unsigned long           __unused3;
+       __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           __unused4;
+       unsigned long           __unused5;
+};
+
+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 /* __ASM_SH_SHMBUF_H */
diff --git a/arch/sh/include/asm/shmin.h b/arch/sh/include/asm/shmin.h
new file mode 100644 (file)
index 0000000..36ba138
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __ASM_SH_SHMIN_H
+#define __ASM_SH_SHMIN_H
+
+#define SHMIN_IO_BASE 0xb0000000UL
+
+#define SHMIN_NE_IRQ IRQ2_IRQ
+#define SHMIN_NE_BASE 0x300
+
+#endif
diff --git a/arch/sh/include/asm/shmparam.h b/arch/sh/include/asm/shmparam.h
new file mode 100644 (file)
index 0000000..ba1758d
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * include/asm-sh/shmparam.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2006 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_SHMPARAM_H
+#define __ASM_SH_SHMPARAM_H
+
+/*
+ * SH-4 and SH-3 7705 have an aliasing dcache. Bump this up to a sensible value
+ * for everyone, and work out the specifics from the probed cache descriptor.
+ */
+#define        SHMLBA  0x4000           /* attach addr a multiple of this */
+
+#define __ARCH_FORCE_SHMLBA
+
+#endif /* __ASM_SH_SHMPARAM_H */
diff --git a/arch/sh/include/asm/sigcontext.h b/arch/sh/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..8ce1435
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef __ASM_SH_SIGCONTEXT_H
+#define __ASM_SH_SIGCONTEXT_H
+
+struct sigcontext {
+       unsigned long   oldmask;
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+       /* CPU registers */
+       unsigned long long sc_regs[63];
+       unsigned long long sc_tregs[8];
+       unsigned long long sc_pc;
+       unsigned long long sc_sr;
+
+       /* FPU registers */
+       unsigned long long sc_fpregs[32];
+       unsigned int sc_fpscr;
+       unsigned int sc_fpvalid;
+#else
+       /* CPU registers */
+       unsigned long sc_regs[16];
+       unsigned long sc_pc;
+       unsigned long sc_pr;
+       unsigned long sc_sr;
+       unsigned long sc_gbr;
+       unsigned long sc_mach;
+       unsigned long sc_macl;
+
+#if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \
+    defined(__SH2A__) || defined(CONFIG_CPU_SH2A)
+       /* FPU registers */
+       unsigned long sc_fpregs[16];
+       unsigned long sc_xfpregs[16];
+       unsigned int sc_fpscr;
+       unsigned int sc_fpul;
+       unsigned int sc_ownedfp;
+#endif
+#endif
+};
+
+#endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/arch/sh/include/asm/siginfo.h b/arch/sh/include/asm/siginfo.h
new file mode 100644 (file)
index 0000000..813040e
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_SIGINFO_H
+#define __ASM_SH_SIGINFO_H
+
+#include <asm-generic/siginfo.h>
+
+#endif /* __ASM_SH_SIGINFO_H */
diff --git a/arch/sh/include/asm/signal.h b/arch/sh/include/asm/signal.h
new file mode 100644 (file)
index 0000000..5c5c1e8
--- /dev/null
@@ -0,0 +1,160 @@
+#ifndef __ASM_SH_SIGNAL_H
+#define __ASM_SH_SIGNAL_H
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct pt_regs;
+struct siginfo;
+
+#ifdef __KERNEL__
+/* 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      32
+#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__ */
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGBUS          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGUSR1                10
+#define SIGSEGV                11
+#define SIGUSR2                12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGSTKFLT      16
+#define SIGCHLD                17
+#define SIGCONT                18
+#define SIGSTOP                19
+#define SIGTSTP                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGURG         23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGIO          29
+#define SIGPOLL                SIGIO
+/*
+#define SIGLOST                29
+*/
+#define SIGPWR         30
+#define SIGSYS         31
+#define        SIGUNUSED       31
+
+/* 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_NOCLDSTOP   0x00000001
+#define SA_NOCLDWAIT   0x00000002
+#define SA_SIGINFO     0x00000004
+#define SA_ONSTACK     0x08000000
+#define SA_RESTART     0x10000000
+#define SA_NODEFER     0x40000000
+#define SA_RESETHAND   0x80000000
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+#define SA_RESTORER    0x04000000
+
+/* 
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+#include <asm-generic/signal.h>
+
+#ifdef __KERNEL__
+struct old_sigaction {
+       __sighandler_t sa_handler;
+       old_sigset_t sa_mask;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+struct sigaction {
+       __sighandler_t sa_handler;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+       sigset_t sa_mask;               /* mask last for extensibility */
+};
+
+struct k_sigaction {
+       struct sigaction sa;
+};
+#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;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+#define sa_handler     _u._sa_handler
+#define sa_sigaction   _u._sa_sigaction
+
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+       void *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+#ifdef __KERNEL__
+#include <asm/sigcontext.h>
+
+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_SIGNAL_H */
diff --git a/arch/sh/include/asm/smc37c93x.h b/arch/sh/include/asm/smc37c93x.h
new file mode 100644 (file)
index 0000000..585da2a
--- /dev/null
@@ -0,0 +1,190 @@
+#ifndef __ASM_SH_SMC37C93X_H
+#define __ASM_SH_SMC37C93X_H
+
+/*
+ * linux/include/asm-sh/smc37c93x.h
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * SMSC 37C93x Super IO Chip support
+ */
+
+/* Default base I/O address */
+#define FDC_PRIMARY_BASE       0x3f0
+#define IDE1_PRIMARY_BASE      0x1f0
+#define IDE1_SECONDARY_BASE    0x170
+#define PARPORT_PRIMARY_BASE   0x378
+#define COM1_PRIMARY_BASE      0x2f8
+#define COM2_PRIMARY_BASE      0x3f8
+#define RTC_PRIMARY_BASE       0x070
+#define KBC_PRIMARY_BASE       0x060
+#define AUXIO_PRIMARY_BASE     0x000   /* XXX */
+
+/* Logical device number */
+#define LDN_FDC                        0
+#define LDN_IDE1               1
+#define LDN_IDE2               2
+#define LDN_PARPORT            3
+#define LDN_COM1               4
+#define LDN_COM2               5
+#define LDN_RTC                        6
+#define LDN_KBC                        7
+#define LDN_AUXIO              8
+
+/* Configuration port and key */
+#define CONFIG_PORT            0x3f0
+#define INDEX_PORT             CONFIG_PORT
+#define DATA_PORT              0x3f1
+#define CONFIG_ENTER           0x55
+#define CONFIG_EXIT            0xaa
+
+/* Configuration index */
+#define CURRENT_LDN_INDEX      0x07
+#define POWER_CONTROL_INDEX    0x22
+#define ACTIVATE_INDEX         0x30
+#define IO_BASE_HI_INDEX       0x60
+#define IO_BASE_LO_INDEX       0x61
+#define IRQ_SELECT_INDEX       0x70
+#define DMA_SELECT_INDEX       0x74
+
+#define GPIO46_INDEX           0xc6
+#define GPIO47_INDEX           0xc7
+
+/* UART stuff. Only for debugging.  */
+/* UART Register */
+
+#define UART_RBR       0x0     /* Receiver Buffer Register (Read Only) */
+#define UART_THR       0x0     /* Transmitter Holding Register (Write Only) */
+#define UART_IER       0x2     /* Interrupt Enable Register */
+#define UART_IIR       0x4     /* Interrupt Ident Register (Read Only) */
+#define UART_FCR       0x4     /* FIFO Control Register (Write Only) */
+#define UART_LCR       0x6     /* Line Control Register */
+#define UART_MCR       0x8     /* MODEM Control Register */
+#define UART_LSR       0xa     /* Line Status Register */
+#define UART_MSR       0xc     /* MODEM Status Register */
+#define UART_SCR       0xe     /* Scratch Register */
+#define UART_DLL       0x0     /* Divisor Latch (LS) */
+#define UART_DLM       0x2     /* Divisor Latch (MS) */
+
+#ifndef __ASSEMBLY__
+typedef struct uart_reg {
+       volatile __u16 rbr;
+       volatile __u16 ier;
+       volatile __u16 iir;
+       volatile __u16 lcr;
+       volatile __u16 mcr;
+       volatile __u16 lsr;
+       volatile __u16 msr;
+       volatile __u16 scr;
+} uart_reg;
+#endif /* ! __ASSEMBLY__ */
+
+/* Alias for Write Only Register */
+
+#define thr    rbr
+#define tcr    iir
+
+/* Alias for Divisor Latch Register */
+
+#define dll    rbr
+#define dlm    ier
+#define fcr    iir
+
+/* Interrupt Enable Register */
+
+#define IER_ERDAI      0x0100  /* Enable Received Data Available Interrupt */
+#define IER_ETHREI     0x0200  /* Enable Transmitter Holding Register Empty Interrupt */
+#define IER_ELSI       0x0400  /* Enable Receiver Line Status Interrupt */
+#define IER_EMSI       0x0800  /* Enable MODEM Status Interrupt */
+
+/* Interrupt Ident Register */
+
+#define IIR_IP         0x0100  /* "0" if Interrupt Pending */
+#define IIR_IIB0       0x0200  /* Interrupt ID Bit 0 */
+#define IIR_IIB1       0x0400  /* Interrupt ID Bit 1 */
+#define IIR_IIB2       0x0800  /* Interrupt ID Bit 2 */
+#define IIR_FIFO       0xc000  /* FIFOs enabled */
+
+/* FIFO Control Register */
+
+#define FCR_FEN                0x0100  /* FIFO enable */
+#define FCR_RFRES      0x0200  /* Receiver FIFO reset */
+#define FCR_TFRES      0x0400  /* Transmitter FIFO reset */
+#define FCR_DMA                0x0800  /* DMA mode select */
+#define FCR_RTL                0x4000  /* Receiver triger (LSB) */
+#define FCR_RTM                0x8000  /* Receiver triger (MSB) */
+
+/* Line Control Register */
+
+#define LCR_WLS0       0x0100  /* Word Length Select Bit 0 */
+#define LCR_WLS1       0x0200  /* Word Length Select Bit 1 */
+#define LCR_STB                0x0400  /* Number of Stop Bits */
+#define LCR_PEN                0x0800  /* Parity Enable */
+#define LCR_EPS                0x1000  /* Even Parity Select */
+#define LCR_SP         0x2000  /* Stick Parity */
+#define LCR_SB         0x4000  /* Set Break */
+#define LCR_DLAB       0x8000  /* Divisor Latch Access Bit */
+
+/* MODEM Control Register */
+
+#define MCR_DTR                0x0100  /* Data Terminal Ready */
+#define MCR_RTS                0x0200  /* Request to Send */
+#define MCR_OUT1       0x0400  /* Out 1 */
+#define MCR_IRQEN      0x0800  /* IRQ Enable */
+#define MCR_LOOP       0x1000  /* Loop */
+
+/* Line Status Register */
+
+#define LSR_DR         0x0100  /* Data Ready */
+#define LSR_OE         0x0200  /* Overrun Error */
+#define LSR_PE         0x0400  /* Parity Error */
+#define LSR_FE         0x0800  /* Framing Error */
+#define LSR_BI         0x1000  /* Break Interrupt */
+#define LSR_THRE       0x2000  /* Transmitter Holding Register Empty */
+#define LSR_TEMT       0x4000  /* Transmitter Empty */
+#define LSR_FIFOE      0x8000  /* Receiver FIFO error */
+
+/* MODEM Status Register */
+
+#define MSR_DCTS       0x0100  /* Delta Clear to Send */
+#define MSR_DDSR       0x0200  /* Delta Data Set Ready */
+#define MSR_TERI       0x0400  /* Trailing Edge Ring Indicator */
+#define MSR_DDCD       0x0800  /* Delta Data Carrier Detect */
+#define MSR_CTS                0x1000  /* Clear to Send */
+#define MSR_DSR                0x2000  /* Data Set Ready */
+#define MSR_RI         0x4000  /* Ring Indicator */
+#define MSR_DCD                0x8000  /* Data Carrier Detect */
+
+/* Baud Rate Divisor */
+
+#define UART_CLK       (1843200)       /* 1.8432 MHz */
+#define UART_BAUD(x)   (UART_CLK / (16 * (x)))
+
+/* RTC register definition */
+#define RTC_SECONDS             0
+#define RTC_SECONDS_ALARM       1
+#define RTC_MINUTES             2
+#define RTC_MINUTES_ALARM       3
+#define RTC_HOURS               4
+#define RTC_HOURS_ALARM         5
+#define RTC_DAY_OF_WEEK         6
+#define RTC_DAY_OF_MONTH        7
+#define RTC_MONTH               8
+#define RTC_YEAR                9
+#define RTC_FREQ_SELECT                10
+# define RTC_UIP 0x80
+# define RTC_DIV_CTL 0x70
+/* This RTC can work under 32.768KHz clock only.  */
+# define RTC_OSC_ENABLE 0x20
+# define RTC_OSC_DISABLE 0x00
+#define RTC_CONTROL            11
+# define RTC_SET 0x80
+# define RTC_PIE 0x40
+# define RTC_AIE 0x20
+# define RTC_UIE 0x10
+# define RTC_SQWE 0x08
+# define RTC_DM_BINARY 0x04
+# define RTC_24H 0x02
+# define RTC_DST_EN 0x01
+
+#endif  /* __ASM_SH_SMC37C93X_H */
diff --git a/arch/sh/include/asm/smp.h b/arch/sh/include/asm/smp.h
new file mode 100644 (file)
index 0000000..593343c
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __ASM_SH_SMP_H
+#define __ASM_SH_SMP_H
+
+#include <linux/bitops.h>
+#include <linux/cpumask.h>
+
+#ifdef CONFIG_SMP
+
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+#include <asm/current.h>
+
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+#define hard_smp_processor_id()        plat_smp_processor_id()
+
+/* Map from cpu id to sequential logical cpu number. */
+extern int __cpu_number_map[NR_CPUS];
+#define cpu_number_map(cpu)  __cpu_number_map[cpu]
+
+/* The reverse map from sequential logical cpu number to cpu id.  */
+extern int __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu)  __cpu_logical_map[cpu]
+
+/* I've no idea what the real meaning of this is */
+#define PROC_CHANGE_PENALTY    20
+
+#define NO_PROC_ID     (-1)
+
+#define SMP_MSG_FUNCTION       0
+#define SMP_MSG_RESCHEDULE     1
+#define SMP_MSG_FUNCTION_SINGLE        2
+#define SMP_MSG_NR             3
+
+void plat_smp_setup(void);
+void plat_prepare_cpus(unsigned int max_cpus);
+int plat_smp_processor_id(void);
+void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
+void plat_send_ipi(unsigned int cpu, unsigned int message);
+int plat_register_ipi_handler(unsigned int message,
+                             void (*handler)(void *), void *arg);
+extern void arch_send_call_function_single_ipi(int cpu);
+extern void arch_send_call_function_ipi(cpumask_t mask);
+
+#else
+
+#define hard_smp_processor_id()        (0)
+
+#endif /* CONFIG_SMP */
+
+#endif /* __ASM_SH_SMP_H */
diff --git a/arch/sh/include/asm/snapgear.h b/arch/sh/include/asm/snapgear.h
new file mode 100644 (file)
index 0000000..042d95f
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * include/asm-sh/snapgear.h
+ *
+ * Modified version of io_se.h for the snapgear-specific functions.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * IO functions for a SnapGear
+ */
+
+#ifndef _ASM_SH_IO_SNAPGEAR_H
+#define _ASM_SH_IO_SNAPGEAR_H
+
+#if defined(CONFIG_CPU_SH4)
+/*
+ * The external interrupt lines, these take up ints 0 - 15 inclusive
+ * depending on the priority for the interrupt.  In fact the priority
+ * is the interrupt :-)
+ */
+
+#define IRL0_IRQ       2
+#define IRL0_PRIORITY  13
+
+#define IRL1_IRQ       5
+#define IRL1_PRIORITY  10
+
+#define IRL2_IRQ       8
+#define IRL2_PRIORITY  7
+
+#define IRL3_IRQ       11
+#define IRL3_PRIORITY  4
+#endif
+
+#define __IO_PREFIX    snapgear
+#include <asm/io_generic.h>
+
+#ifdef CONFIG_SH_SECUREEDGE5410
+/*
+ * We need to remember what was written to the ioport as some bits
+ * are shared with other functions and you cannot read back what was
+ * written :-|
+ *
+ * Bit        Read                   Write
+ * -----------------------------------------------
+ * D0         DCD on ttySC1          power
+ * D1         Reset Switch           heatbeat
+ * D2         ttySC0 CTS (7100)      LAN
+ * D3         -                      WAN
+ * D4         ttySC0 DCD (7100)      CONSOLE
+ * D5         -                      ONLINE
+ * D6         -                      VPN
+ * D7         -                      DTR on ttySC1
+ * D8         -                      ttySC0 RTS (7100)
+ * D9         -                      ttySC0 DTR (7100)
+ * D10        -                      RTC SCLK
+ * D11        RTC DATA               RTC DATA
+ * D12        -                      RTS RESET
+ */
+
+#define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
+extern unsigned short secureedge5410_ioport;
+
+#define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
+        (secureedge5410_ioport = \
+                       ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
+#define SECUREEDGE_READ_IOPORT() \
+        ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
+#endif
+
+#endif /* _ASM_SH_IO_SNAPGEAR_H */
diff --git a/arch/sh/include/asm/socket.h b/arch/sh/include/asm/socket.h
new file mode 100644 (file)
index 0000000..6d4bf65
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __ASM_SH_SOCKET_H
+#define __ASM_SH_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+#define SOL_SOCKET     1
+
+#define SO_DEBUG       1
+#define SO_REUSEADDR   2
+#define SO_TYPE                3
+#define SO_ERROR       4
+#define SO_DONTROUTE   5
+#define SO_BROADCAST   6
+#define SO_SNDBUF      7
+#define SO_RCVBUF      8
+#define SO_RCVBUFFORCE 32
+#define SO_SNDBUFFORCE 33
+#define SO_KEEPALIVE   9
+#define SO_OOBINLINE   10
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_LINGER      13
+#define SO_BSDCOMPAT   14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED    16
+#define SO_PEERCRED    17
+#define SO_RCVLOWAT    18
+#define SO_SNDLOWAT    19
+#define SO_RCVTIMEO    20
+#define SO_SNDTIMEO    21
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
+#define SO_SECURITY_ENCRYPTION_NETWORK         24
+
+#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_ACCEPTCONN          30
+
+#define SO_PEERSEC             31
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+#define SO_MARK                        36
+
+#endif /* __ASM_SH_SOCKET_H */
diff --git a/arch/sh/include/asm/sockios.h b/arch/sh/include/asm/sockios.h
new file mode 100644 (file)
index 0000000..cf8b96b
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __ASM_SH_SOCKIOS_H
+#define __ASM_SH_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     _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
+#endif /* __ASM_SH_SOCKIOS_H */
diff --git a/arch/sh/include/asm/sparsemem.h b/arch/sh/include/asm/sparsemem.h
new file mode 100644 (file)
index 0000000..547a540
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __ASM_SH_SPARSEMEM_H
+#define __ASM_SH_SPARSEMEM_H
+
+#ifdef __KERNEL__
+/*
+ * SECTION_SIZE_BITS           2^N: how big each section will be
+ * MAX_PHYSADDR_BITS           2^N: how much physical address space we have
+ * MAX_PHYSMEM_BITS            2^N: how much memory we can have in that space
+ */
+#define SECTION_SIZE_BITS      26
+#define MAX_PHYSADDR_BITS      32
+#define MAX_PHYSMEM_BITS       32
+
+#endif
+
+#endif /* __ASM_SH_SPARSEMEM_H */
diff --git a/arch/sh/include/asm/spi.h b/arch/sh/include/asm/spi.h
new file mode 100644 (file)
index 0000000..e96f5b0
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_SPI_H__
+#define __ASM_SPI_H__
+
+struct sh_spi_info;
+
+struct sh_spi_info {
+       int                      bus_num;
+       int                      num_chipselect;
+
+       void (*chip_select)(struct sh_spi_info *spi, int cs, int state);
+};
+
+#endif /* __ASM_SPI_H__ */
diff --git a/arch/sh/include/asm/spinlock.h b/arch/sh/include/asm/spinlock.h
new file mode 100644 (file)
index 0000000..e793181
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * include/asm-sh/spinlock.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ * Copyright (C) 2006, 2007 Akio Idehara
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_SPINLOCK_H
+#define __ASM_SH_SPINLOCK_H
+
+/*
+ * The only locking implemented here uses SH-4A opcodes. For others,
+ * split this out as per atomic-*.h.
+ */
+#ifndef CONFIG_CPU_SH4A
+#error "Need movli.l/movco.l for spinlocks"
+#endif
+
+/*
+ * Your basic SMP spinlocks, allowing only a single CPU anywhere
+ */
+
+#define __raw_spin_is_locked(x)                ((x)->lock <= 0)
+#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
+#define __raw_spin_unlock_wait(x) \
+       do { cpu_relax(); } while ((x)->lock)
+
+/*
+ * 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.
+ */
+static inline void __raw_spin_lock(raw_spinlock_t *lock)
+{
+       unsigned long tmp;
+       unsigned long oldval;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%2, %0 ! __raw_spin_lock       \n\t"
+               "mov            %0, %1                          \n\t"
+               "mov            #0, %0                          \n\t"
+               "movco.l        %0, @%2                         \n\t"
+               "bf             1b                              \n\t"
+               "cmp/pl         %1                              \n\t"
+               "bf             1b                              \n\t"
+               : "=&z" (tmp), "=&r" (oldval)
+               : "r" (&lock->lock)
+               : "t", "memory"
+       );
+}
+
+static inline void __raw_spin_unlock(raw_spinlock_t *lock)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+               "mov            #1, %0 ! __raw_spin_unlock      \n\t"
+               "mov.l          %0, @%1                         \n\t"
+               : "=&z" (tmp)
+               : "r" (&lock->lock)
+               : "t", "memory"
+       );
+}
+
+static inline int __raw_spin_trylock(raw_spinlock_t *lock)
+{
+       unsigned long tmp, oldval;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%2, %0 ! __raw_spin_trylock    \n\t"
+               "mov            %0, %1                          \n\t"
+               "mov            #0, %0                          \n\t"
+               "movco.l        %0, @%2                         \n\t"
+               "bf             1b                              \n\t"
+               "synco                                          \n\t"
+               : "=&z" (tmp), "=&r" (oldval)
+               : "r" (&lock->lock)
+               : "t", "memory"
+       );
+
+       return oldval;
+}
+
+/*
+ * Read-write spinlocks, allowing multiple readers but only one writer.
+ *
+ * NOTE! it is quite common to have readers in interrupts but no interrupt
+ * writers. For those circumstances we can "mix" irq-safe locks - any writer
+ * needs to get a irq-safe write-lock, but readers can get non-irqsafe
+ * read-locks.
+ */
+
+/**
+ * read_can_lock - would read_trylock() succeed?
+ * @lock: the rwlock in question.
+ */
+#define __raw_read_can_lock(x) ((x)->lock > 0)
+
+/**
+ * write_can_lock - would write_trylock() succeed?
+ * @lock: the rwlock in question.
+ */
+#define __raw_write_can_lock(x)        ((x)->lock == RW_LOCK_BIAS)
+
+static inline void __raw_read_lock(raw_rwlock_t *rw)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%1, %0 ! __raw_read_lock       \n\t"
+               "cmp/pl         %0                              \n\t"
+               "bf             1b                              \n\t"
+               "add            #-1, %0                         \n\t"
+               "movco.l        %0, @%1                         \n\t"
+               "bf             1b                              \n\t"
+               : "=&z" (tmp)
+               : "r" (&rw->lock)
+               : "t", "memory"
+       );
+}
+
+static inline void __raw_read_unlock(raw_rwlock_t *rw)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%1, %0 ! __raw_read_unlock     \n\t"
+               "add            #1, %0                          \n\t"
+               "movco.l        %0, @%1                         \n\t"
+               "bf             1b                              \n\t"
+               : "=&z" (tmp)
+               : "r" (&rw->lock)
+               : "t", "memory"
+       );
+}
+
+static inline void __raw_write_lock(raw_rwlock_t *rw)
+{
+       unsigned long tmp;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%1, %0 ! __raw_write_lock      \n\t"
+               "cmp/hs         %2, %0                          \n\t"
+               "bf             1b                              \n\t"
+               "sub            %2, %0                          \n\t"
+               "movco.l        %0, @%1                         \n\t"
+               "bf             1b                              \n\t"
+               : "=&z" (tmp)
+               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
+               : "t", "memory"
+       );
+}
+
+static inline void __raw_write_unlock(raw_rwlock_t *rw)
+{
+       __asm__ __volatile__ (
+               "mov.l          %1, @%0 ! __raw_write_unlock    \n\t"
+               :
+               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
+               : "t", "memory"
+       );
+}
+
+static inline int __raw_read_trylock(raw_rwlock_t *rw)
+{
+       unsigned long tmp, oldval;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%2, %0 ! __raw_read_trylock    \n\t"
+               "mov            %0, %1                          \n\t"
+               "cmp/pl         %0                              \n\t"
+               "bf             2f                              \n\t"
+               "add            #-1, %0                         \n\t"
+               "movco.l        %0, @%2                         \n\t"
+               "bf             1b                              \n\t"
+               "2:                                             \n\t"
+               "synco                                          \n\t"
+               : "=&z" (tmp), "=&r" (oldval)
+               : "r" (&rw->lock)
+               : "t", "memory"
+       );
+
+       return (oldval > 0);
+}
+
+static inline int __raw_write_trylock(raw_rwlock_t *rw)
+{
+       unsigned long tmp, oldval;
+
+       __asm__ __volatile__ (
+               "1:                                             \n\t"
+               "movli.l        @%2, %0 ! __raw_write_trylock   \n\t"
+               "mov            %0, %1                          \n\t"
+               "cmp/hs         %3, %0                          \n\t"
+               "bf             2f                              \n\t"
+               "sub            %3, %0                          \n\t"
+               "2:                                             \n\t"
+               "movco.l        %0, @%2                         \n\t"
+               "bf             1b                              \n\t"
+               "synco                                          \n\t"
+               : "=&z" (tmp), "=&r" (oldval)
+               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
+               : "t", "memory"
+       );
+
+       return (oldval > (RW_LOCK_BIAS - 1));
+}
+
+#define _raw_spin_relax(lock)  cpu_relax()
+#define _raw_read_relax(lock)  cpu_relax()
+#define _raw_write_relax(lock) cpu_relax()
+
+#endif /* __ASM_SH_SPINLOCK_H */
diff --git a/arch/sh/include/asm/spinlock_types.h b/arch/sh/include/asm/spinlock_types.h
new file mode 100644 (file)
index 0000000..b4d244e
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __ASM_SH_SPINLOCK_TYPES_H
+#define __ASM_SH_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               { 1 }
+
+typedef struct {
+       volatile unsigned int lock;
+} raw_rwlock_t;
+
+#define RW_LOCK_BIAS                   0x01000000
+#define __RAW_RW_LOCK_UNLOCKED         { RW_LOCK_BIAS }
+
+#endif
diff --git a/arch/sh/include/asm/stat.h b/arch/sh/include/asm/stat.h
new file mode 100644 (file)
index 0000000..e1810cc
--- /dev/null
@@ -0,0 +1,138 @@
+#ifndef __ASM_SH_STAT_H
+#define __ASM_SH_STAT_H
+
+struct __old_kernel_stat {
+       unsigned short st_dev;
+       unsigned short st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned short st_rdev;
+       unsigned long  st_size;
+       unsigned long  st_atime;
+       unsigned long  st_mtime;
+       unsigned long  st_ctime;
+};
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+struct stat {
+       unsigned short st_dev;
+       unsigned short __pad1;
+       unsigned long st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned short st_rdev;
+       unsigned short __pad2;
+       unsigned long  st_size;
+       unsigned long  st_blksize;
+       unsigned long  st_blocks;
+       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;
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat64 {
+       unsigned short  st_dev;
+       unsigned char   __pad0[10];
+
+       unsigned long   st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned short  st_rdev;
+       unsigned char   __pad3[10];
+
+       long long       st_size;
+       unsigned long   st_blksize;
+
+       unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
+       unsigned long   __pad4;         /* future possible st_blocks high bits */
+
+       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;  /* will be high 32 bits of ctime someday */
+
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+};
+#else
+struct stat {
+       unsigned long  st_dev;
+       unsigned long  st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned long  st_rdev;
+       unsigned long  st_size;
+       unsigned long  st_blksize;
+       unsigned long  st_blocks;
+       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;
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat64 {
+       unsigned long long      st_dev;
+       unsigned char   __pad0[4];
+
+#define STAT64_HAS_BROKEN_ST_INO       1
+       unsigned long   __st_ino;
+
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned long long      st_rdev;
+       unsigned char   __pad3[4];
+
+       long long       st_size;
+       unsigned long   st_blksize;
+
+       unsigned long long      st_blocks;      /* Number 512-byte blocks allocated. */
+
+       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;
+
+       unsigned long long      st_ino;
+};
+
+#define STAT_HAVE_NSEC 1
+#endif
+
+#endif /* __ASM_SH_STAT_H */
diff --git a/arch/sh/include/asm/statfs.h b/arch/sh/include/asm/statfs.h
new file mode 100644 (file)
index 0000000..9202a02
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_STATFS_H
+#define __ASM_SH_STATFS_H
+
+#include <asm-generic/statfs.h>
+
+#endif /* __ASM_SH_STATFS_H */
diff --git a/arch/sh/include/asm/string.h b/arch/sh/include/asm/string.h
new file mode 100644 (file)
index 0000000..8c1ea21
--- /dev/null
@@ -0,0 +1,5 @@
+#ifdef CONFIG_SUPERH32
+# include "string_32.h"
+#else
+# include "string_64.h"
+#endif
diff --git a/arch/sh/include/asm/string_32.h b/arch/sh/include/asm/string_32.h
new file mode 100644 (file)
index 0000000..55f8db6
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef __ASM_SH_STRING_H
+#define __ASM_SH_STRING_H
+
+#ifdef __KERNEL__
+
+/*
+ * Copyright (C) 1999 Niibe Yutaka
+ * But consider these trivial functions to be public domain.
+ */
+
+#define __HAVE_ARCH_STRCPY
+static inline char *strcpy(char *__dest, const char *__src)
+{
+       register char *__xdest = __dest;
+       unsigned long __dummy;
+
+       __asm__ __volatile__("1:\n\t"
+                            "mov.b     @%1+, %2\n\t"
+                            "mov.b     %2, @%0\n\t"
+                            "cmp/eq    #0, %2\n\t"
+                            "bf/s      1b\n\t"
+                            " add      #1, %0\n\t"
+                            : "=r" (__dest), "=r" (__src), "=&z" (__dummy)
+                            : "0" (__dest), "1" (__src)
+                            : "memory", "t");
+
+       return __xdest;
+}
+
+#define __HAVE_ARCH_STRNCPY
+static inline char *strncpy(char *__dest, const char *__src, size_t __n)
+{
+       register char *__xdest = __dest;
+       unsigned long __dummy;
+
+       if (__n == 0)
+               return __xdest;
+
+       __asm__ __volatile__(
+               "1:\n"
+               "mov.b  @%1+, %2\n\t"
+               "mov.b  %2, @%0\n\t"
+               "cmp/eq #0, %2\n\t"
+               "bt/s   2f\n\t"
+               " cmp/eq        %5,%1\n\t"
+               "bf/s   1b\n\t"
+               " add   #1, %0\n"
+               "2:"
+               : "=r" (__dest), "=r" (__src), "=&z" (__dummy)
+               : "0" (__dest), "1" (__src), "r" (__src+__n)
+               : "memory", "t");
+
+       return __xdest;
+}
+
+#define __HAVE_ARCH_STRCMP
+static inline int strcmp(const char *__cs, const char *__ct)
+{
+       register int __res;
+       unsigned long __dummy;
+
+       __asm__ __volatile__(
+               "mov.b  @%1+, %3\n"
+               "1:\n\t"
+               "mov.b  @%0+, %2\n\t"
+               "cmp/eq #0, %3\n\t"
+               "bt     2f\n\t"
+               "cmp/eq %2, %3\n\t"
+               "bt/s   1b\n\t"
+               " mov.b @%1+, %3\n\t"
+               "add    #-2, %1\n\t"
+               "mov.b  @%1, %3\n\t"
+               "sub    %3, %2\n"
+               "2:"
+               : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
+               : "0" (__cs), "1" (__ct)
+               : "t");
+
+       return __res;
+}
+
+#define __HAVE_ARCH_STRNCMP
+static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
+{
+       register int __res;
+       unsigned long __dummy;
+
+       if (__n == 0)
+               return 0;
+
+       __asm__ __volatile__(
+               "mov.b  @%1+, %3\n"
+               "1:\n\t"
+               "mov.b  @%0+, %2\n\t"
+               "cmp/eq %6, %0\n\t"
+               "bt/s   2f\n\t"
+               " cmp/eq #0, %3\n\t"
+               "bt/s   3f\n\t"
+               " cmp/eq %3, %2\n\t"
+               "bt/s   1b\n\t"
+               " mov.b @%1+, %3\n\t"
+               "add    #-2, %1\n\t"
+               "mov.b  @%1, %3\n"
+               "2:\n\t"
+               "sub    %3, %2\n"
+               "3:"
+               :"=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
+               : "0" (__cs), "1" (__ct), "r" (__cs+__n)
+               : "t");
+
+       return __res;
+}
+
+#define __HAVE_ARCH_MEMSET
+extern void *memset(void *__s, int __c, size_t __count);
+
+#define __HAVE_ARCH_MEMCPY
+extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
+
+#define __HAVE_ARCH_MEMMOVE
+extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
+
+#define __HAVE_ARCH_MEMCHR
+extern void *memchr(const void *__s, int __c, size_t __n);
+
+#define __HAVE_ARCH_STRLEN
+extern size_t strlen(const char *);
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_STRING_H */
diff --git a/arch/sh/include/asm/string_64.h b/arch/sh/include/asm/string_64.h
new file mode 100644 (file)
index 0000000..aa1fef2
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __ASM_SH_STRING_64_H
+#define __ASM_SH_STRING_64_H
+
+/*
+ * include/asm-sh/string_64.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ *
+ * 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.
+ */
+
+#define __HAVE_ARCH_MEMCPY
+extern void *memcpy(void *dest, const void *src, size_t count);
+
+#endif /* __ASM_SH_STRING_64_H */
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
new file mode 100644 (file)
index 0000000..056d68c
--- /dev/null
@@ -0,0 +1,190 @@
+#ifndef __ASM_SH_SYSTEM_H
+#define __ASM_SH_SYSTEM_H
+
+/*
+ * Copyright (C) 1999, 2000  Niibe Yutaka  &  Kaz Kojima
+ * Copyright (C) 2002 Paul Mundt
+ */
+
+#include <linux/irqflags.h>
+#include <linux/compiler.h>
+#include <linux/linkage.h>
+#include <asm/types.h>
+#include <asm/ptrace.h>
+
+#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
+
+#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
+#define __icbi()                       \
+{                                      \
+       unsigned long __addr;           \
+       __addr = 0xa8000000;            \
+       __asm__ __volatile__(           \
+               "icbi   %0\n\t"         \
+               : /* no output */       \
+               : "m" (__m(__addr)));   \
+}
+#endif
+
+/*
+ * A brief note on ctrl_barrier(), the control register write barrier.
+ *
+ * Legacy SH cores typically require a sequence of 8 nops after
+ * modification of a control register in order for the changes to take
+ * effect. On newer cores (like the sh4a and sh5) this is accomplished
+ * with icbi.
+ *
+ * Also note that on sh4a in the icbi case we can forego a synco for the
+ * write barrier, as it's not necessary for control registers.
+ *
+ * Historically we have only done this type of barrier for the MMUCR, but
+ * it's also necessary for the CCR, so we make it generic here instead.
+ */
+#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
+#define mb()           __asm__ __volatile__ ("synco": : :"memory")
+#define rmb()          mb()
+#define wmb()          __asm__ __volatile__ ("synco": : :"memory")
+#define ctrl_barrier() __icbi()
+#define read_barrier_depends() do { } while(0)
+#else
+#define mb()           __asm__ __volatile__ ("": : :"memory")
+#define rmb()          mb()
+#define wmb()          __asm__ __volatile__ ("": : :"memory")
+#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
+#define read_barrier_depends() do { } while(0)
+#endif
+
+#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 { (void)xchg(&var, value); } while (0)
+
+#ifdef CONFIG_GUSA_RB
+#include <asm/cmpxchg-grb.h>
+#else
+#include <asm/cmpxchg-irq.h>
+#endif
+
+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 4:                                         \
+               __xchg__res = xchg_u32(__xchg_ptr, x);  \
+               break;                                  \
+       case 1:                                         \
+               __xchg__res = xchg_u8(__xchg_ptr, x);   \
+               break;                                  \
+       default:                                        \
+               __xchg_called_with_bad_pointer();       \
+               __xchg__res = x;                        \
+               break;                                  \
+       }                                               \
+                                                       \
+       __xchg__res;                                    \
+})
+
+#define xchg(ptr,x)    \
+       ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
+
+/* 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);
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
+               unsigned long new, int size)
+{
+       switch (size) {
+       case 4:
+               return __cmpxchg_u32(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))); \
+  })
+
+extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
+
+extern void *set_exception_table_vec(unsigned int vec, void *handler);
+
+static inline void *set_exception_table_evt(unsigned int evt, void *handler)
+{
+       return set_exception_table_vec(evt >> 5, handler);
+}
+
+/*
+ * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
+ */
+#ifdef CONFIG_CPU_SH2A
+extern unsigned int instruction_size(unsigned int insn);
+#elif defined(CONFIG_SUPERH32)
+#define instruction_size(insn) (2)
+#else
+#define instruction_size(insn) (4)
+#endif
+
+extern unsigned long cached_to_uncached;
+
+extern struct dentry *sh_debugfs_root;
+
+void per_cpu_trap_init(void);
+
+asmlinkage void break_point_trap(void);
+
+#ifdef CONFIG_SUPERH32
+#define BUILD_TRAP_HANDLER(name)                                       \
+asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5,        \
+                                   unsigned long r6, unsigned long r7, \
+                                   struct pt_regs __regs)
+
+#define TRAP_HANDLER_DECL                              \
+       struct pt_regs *regs = RELOC_HIDE(&__regs, 0);  \
+       unsigned int vec = regs->tra;                   \
+       (void)vec;
+#else
+#define BUILD_TRAP_HANDLER(name)       \
+asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
+#define TRAP_HANDLER_DECL
+#endif
+
+BUILD_TRAP_HANDLER(address_error);
+BUILD_TRAP_HANDLER(debug);
+BUILD_TRAP_HANDLER(bug);
+BUILD_TRAP_HANDLER(fpu_error);
+BUILD_TRAP_HANDLER(fpu_state_restore);
+
+#define arch_align_stack(x) (x)
+
+struct mem_access {
+       unsigned long (*from)(void *dst, const void *src, unsigned long cnt);
+       unsigned long (*to)(void *dst, const void *src, unsigned long cnt);
+};
+
+#ifdef CONFIG_SUPERH32
+# include "system_32.h"
+#else
+# include "system_64.h"
+#endif
+
+#endif
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h
new file mode 100644 (file)
index 0000000..f11bcf0
--- /dev/null
@@ -0,0 +1,102 @@
+#ifndef __ASM_SH_SYSTEM_32_H
+#define __ASM_SH_SYSTEM_32_H
+
+#include <linux/types.h>
+
+struct task_struct *__switch_to(struct task_struct *prev,
+                               struct task_struct *next);
+
+/*
+ *     switch_to() should switch tasks to task nr n, first
+ */
+#define switch_to(prev, next, last)                                    \
+do {                                                                   \
+       register u32 *__ts1 __asm__ ("r1") = (u32 *)&prev->thread.sp;   \
+       register u32 *__ts2 __asm__ ("r2") = (u32 *)&prev->thread.pc;   \
+       register u32 *__ts4 __asm__ ("r4") = (u32 *)prev;               \
+       register u32 *__ts5 __asm__ ("r5") = (u32 *)next;               \
+       register u32 *__ts6 __asm__ ("r6") = (u32 *)&next->thread.sp;   \
+       register u32 __ts7 __asm__ ("r7") = next->thread.pc;            \
+       struct task_struct *__last;                                     \
+                                                                       \
+       __asm__ __volatile__ (                                          \
+               ".balign 4\n\t"                                         \
+               "stc.l  gbr, @-r15\n\t"                                 \
+               "sts.l  pr, @-r15\n\t"                                  \
+               "mov.l  r8, @-r15\n\t"                                  \
+               "mov.l  r9, @-r15\n\t"                                  \
+               "mov.l  r10, @-r15\n\t"                                 \
+               "mov.l  r11, @-r15\n\t"                                 \
+               "mov.l  r12, @-r15\n\t"                                 \
+               "mov.l  r13, @-r15\n\t"                                 \
+               "mov.l  r14, @-r15\n\t"                                 \
+               "mov.l  r15, @r1\t! save SP\n\t"                        \
+               "mov.l  @r6, r15\t! change to new stack\n\t"            \
+               "mova   1f, %0\n\t"                                     \
+               "mov.l  %0, @r2\t! save PC\n\t"                         \
+               "mov.l  2f, %0\n\t"                                     \
+               "jmp    @%0\t! call __switch_to\n\t"                    \
+               " lds   r7, pr\t!  with return to new PC\n\t"           \
+               ".balign        4\n"                                    \
+               "2:\n\t"                                                \
+               ".long  __switch_to\n"                                  \
+               "1:\n\t"                                                \
+               "mov.l  @r15+, r14\n\t"                                 \
+               "mov.l  @r15+, r13\n\t"                                 \
+               "mov.l  @r15+, r12\n\t"                                 \
+               "mov.l  @r15+, r11\n\t"                                 \
+               "mov.l  @r15+, r10\n\t"                                 \
+               "mov.l  @r15+, r9\n\t"                                  \
+               "mov.l  @r15+, r8\n\t"                                  \
+               "lds.l  @r15+, pr\n\t"                                  \
+               "ldc.l  @r15+, gbr\n\t"                                 \
+               : "=z" (__last)                                         \
+               : "r" (__ts1), "r" (__ts2), "r" (__ts4),                \
+                 "r" (__ts5), "r" (__ts6), "r" (__ts7)                 \
+               : "r3", "t");                                           \
+                                                                       \
+       last = __last;                                                  \
+} while (0)
+
+#define __uses_jump_to_uncached __attribute__ ((__section__ (".uncached.text")))
+
+/*
+ * Jump to uncached area.
+ * When handling TLB or caches, we need to do it from an uncached area.
+ */
+#define jump_to_uncached()                     \
+do {                                           \
+       unsigned long __dummy;                  \
+                                               \
+       __asm__ __volatile__(                   \
+               "mova   1f, %0\n\t"             \
+               "add    %1, %0\n\t"             \
+               "jmp    @%0\n\t"                \
+               " nop\n\t"                      \
+               ".balign 4\n"                   \
+               "1:"                            \
+               : "=&z" (__dummy)               \
+               : "r" (cached_to_uncached));    \
+} while (0)
+
+/*
+ * Back to cached area.
+ */
+#define back_to_cached()                               \
+do {                                                   \
+       unsigned long __dummy;                          \
+       ctrl_barrier();                                 \
+       __asm__ __volatile__(                           \
+               "mov.l  1f, %0\n\t"                     \
+               "jmp    @%0\n\t"                        \
+               " nop\n\t"                              \
+               ".balign 4\n"                           \
+               "1:     .long 2f\n"                     \
+               "2:"                                    \
+               : "=&r" (__dummy));                     \
+} while (0)
+
+int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
+                           struct mem_access *ma);
+
+#endif /* __ASM_SH_SYSTEM_32_H */
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h
new file mode 100644 (file)
index 0000000..943acf5
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef __ASM_SH_SYSTEM_64_H
+#define __ASM_SH_SYSTEM_64_H
+
+/*
+ * include/asm-sh/system_64.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2004  Richard Curnow
+ *
+ * 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.
+ */
+#include <asm/processor.h>
+
+/*
+ *     switch_to() should switch tasks to task nr n, first
+ */
+struct task_struct *sh64_switch_to(struct task_struct *prev,
+                                  struct thread_struct *prev_thread,
+                                  struct task_struct *next,
+                                  struct thread_struct *next_thread);
+
+#define switch_to(prev,next,last)                              \
+do {                                                           \
+       if (last_task_used_math != next) {                      \
+               struct pt_regs *regs = next->thread.uregs;      \
+               if (regs) regs->sr |= SR_FD;                    \
+       }                                                       \
+       last = sh64_switch_to(prev, &prev->thread, next,        \
+                             &next->thread);                   \
+} while (0)
+
+#define __uses_jump_to_uncached
+
+#define jump_to_uncached()     do { } while (0)
+#define back_to_cached()       do { } while (0)
+
+#endif /* __ASM_SH_SYSTEM_64_H */
diff --git a/arch/sh/include/asm/systemh7751.h b/arch/sh/include/asm/systemh7751.h
new file mode 100644 (file)
index 0000000..4161122
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef __ASM_SH_SYSTEMH_7751SYSTEMH_H
+#define __ASM_SH_SYSTEMH_7751SYSTEMH_H
+
+/*
+ * linux/include/asm-sh/systemh/7751systemh.h
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SystemH support
+
+ * Modified for 7751 SystemH by
+ * Jonathan Short, 2002.
+ */
+
+/* Box specific addresses.  */
+
+#define PA_ROM         0x00000000      /* EPROM */
+#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
+#define PA_FROM                0x01000000      /* EPROM */
+#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
+#define PA_EXT1                0x04000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_EXT2                0x08000000
+#define PA_EXT2_SIZE   0x04000000
+#define PA_SDRAM       0x0c000000
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0x12000000
+#define PA_EXT4_SIZE   0x02000000
+#define PA_EXT5                0x14000000
+#define PA_EXT5_SIZE   0x04000000
+#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
+
+#define PA_DIPSW0      0xb9000000      /* Dip switch 5,6 */
+#define PA_DIPSW1      0xb9000002      /* Dip switch 7,8 */
+#define PA_LED         0xba000000      /* LED */
+#define        PA_BCR          0xbb000000      /* FPGA on the MS7751SE01 */
+
+#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
+#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
+#define MRSHPC_MODE     (PA_MRSHPC + 4)
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+
+#define BCR_ILCRA      (PA_BCR + 0)
+#define BCR_ILCRB      (PA_BCR + 2)
+#define BCR_ILCRC      (PA_BCR + 4)
+#define BCR_ILCRD      (PA_BCR + 6)
+#define BCR_ILCRE      (PA_BCR + 8)
+#define BCR_ILCRF      (PA_BCR + 10)
+#define BCR_ILCRG      (PA_BCR + 12)
+
+#define IRQ_79C973     13
+
+#define __IO_PREFIX    sh7751systemh
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_SYSTEMH_7751SYSTEMH_H */
diff --git a/arch/sh/include/asm/termbits.h b/arch/sh/include/asm/termbits.h
new file mode 100644 (file)
index 0000000..77db116
--- /dev/null
@@ -0,0 +1,198 @@
+#ifndef __ASM_SH_TERMBITS_H
+#define __ASM_SH_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+};
+
+struct termios2 {
+       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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+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_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* 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 IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0000400
+#define   NL0  0000000
+#define   NL1  0000400
+#define CRDLY  0003000
+#define   CR0  0000000
+#define   CR1  0001000
+#define   CR2  0002000
+#define   CR3  0003000
+#define TABDLY 0014000
+#define   TAB0 0000000
+#define   TAB1 0004000
+#define   TAB2 0010000
+#define   TAB3 0014000
+#define   XTABS        0014000
+#define BSDLY  0020000
+#define   BS0  0000000
+#define   BS1  0020000
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+#define FFDLY  0100000
+#define   FF0  0000000
+#define   FF1  0100000
+
+/* c_cflag bit meaning */
+#define CBAUD  0010017
+#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 CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define           BOTHER 0010000
+#define    B57600 0010001
+#define   B115200 0010002
+#define   B230400 0010003
+#define   B460800 0010004
+#define   B500000 0010005
+#define   B576000 0010006
+#define   B921600 0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define CIBAUD   002003600000          /* input baud rate */
+#define CMSPAR   010000000000          /* mark or space (stick) parity */
+#define CRTSCTS          020000000000          /* flow control */
+
+#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
+
+/* c_lflag bits */
+#define ISIG   0000001
+#define ICANON 0000002
+#define XCASE  0000004
+#define ECHO   0000010
+#define ECHOE  0000020
+#define ECHOK  0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL        0001000
+#define ECHOPRT        0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif /* __ASM_SH_TERMBITS_H */
diff --git a/arch/sh/include/asm/termios.h b/arch/sh/include/asm/termios.h
new file mode 100644 (file)
index 0000000..0a8c793
--- /dev/null
@@ -0,0 +1,90 @@
+#ifndef __ASM_SH_TERMIOS_H
+#define __ASM_SH_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+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 */
+};
+
+/* modem lines */
+#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
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+#ifdef __KERNEL__
+
+/*     intr=^C         quit=^\         erase=del       kill=^U
+       eof=^D          vtime=\0        vmin=\1         sxtc=\0
+       start=^Q        stop=^S         susp=^Z         eol=\0
+       reprint=^R      discard=^U      werase=^W       lnext=^V
+       eol2=\0
+*/
+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
+
+/*
+ * Translate a "termio" structure into a "termios". Ugh.
+ */
+#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
+       unsigned short __tmp; \
+       get_user(__tmp,&(termio)->x); \
+       *(unsigned short *) &(termios)->x = __tmp; \
+}
+
+#define user_termio_to_kernel_termios(termios, termio) \
+({ \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
+       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
+       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
+})
+
+/*
+ * Translate a "termios" structure into a "termio". Ugh.
+ */
+#define kernel_termios_to_user_termio(termio, termios) \
+({ \
+       put_user((termios)->c_iflag, &(termio)->c_iflag); \
+       put_user((termios)->c_oflag, &(termio)->c_oflag); \
+       put_user((termios)->c_cflag, &(termio)->c_cflag); \
+       put_user((termios)->c_lflag, &(termio)->c_lflag); \
+       put_user((termios)->c_line,  &(termio)->c_line); \
+       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
+})
+
+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
+#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_TERMIOS_H */
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..eeb4c74
--- /dev/null
@@ -0,0 +1,141 @@
+#ifndef __ASM_SH_THREAD_INFO_H
+#define __ASM_SH_THREAD_INFO_H
+
+/* SuperH version
+ * Copyright (C) 2002  Niibe Yutaka
+ *
+ * The copyright of original i386 version is:
+ *
+ *  Copyright (C) 2002  David Howells (dhowells@redhat.com)
+ *  - Incorporating suggestions made by Linus Torvalds and Dave Miller
+ */
+#ifdef __KERNEL__
+#include <asm/page.h>
+
+#ifndef __ASSEMBLY__
+#include <asm/processor.h>
+
+struct thread_info {
+       struct task_struct      *task;          /* main task structure */
+       struct exec_domain      *exec_domain;   /* execution domain */
+       unsigned long           flags;          /* low level flags */
+       __u32                   cpu;
+       int                     preempt_count; /* 0 => preemptable, <0 => BUG */
+       mm_segment_t            addr_limit;     /* thread address space */
+       struct restart_block    restart_block;
+       unsigned long           previous_sp;    /* sp of previous stack in case
+                                                  of nested IRQ stacks */
+       __u8                    supervisor_stack[0];
+};
+
+#endif
+
+#define PREEMPT_ACTIVE         0x10000000
+
+#if defined(CONFIG_4KSTACKS)
+#define THREAD_SIZE_ORDER      (0)
+#elif defined(CONFIG_PAGE_SIZE_4KB)
+#define THREAD_SIZE_ORDER      (1)
+#elif defined(CONFIG_PAGE_SIZE_8KB)
+#define THREAD_SIZE_ORDER      (1)
+#elif defined(CONFIG_PAGE_SIZE_16KB)
+#define THREAD_SIZE_ORDER      (0)
+#elif defined(CONFIG_PAGE_SIZE_64KB)
+#define THREAD_SIZE_ORDER      (0)
+#else
+#error "Unknown thread size"
+#endif
+
+#define THREAD_SIZE    (PAGE_SIZE << THREAD_SIZE_ORDER)
+#define STACK_WARN     (THREAD_SIZE >> 3)
+
+/*
+ * macros/functions for gaining access to the thread information structure
+ */
+#ifndef __ASSEMBLY__
+#define INIT_THREAD_INFO(tsk)                  \
+{                                              \
+       .task           = &tsk,                 \
+       .exec_domain    = &default_exec_domain, \
+       .flags          = 0,                    \
+       .cpu            = 0,                    \
+       .preempt_count  = 1,                    \
+       .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 current stack pointer from C */
+register unsigned long current_stack_pointer asm("r15") __used;
+
+/* how to get the thread information struct from C */
+static inline struct thread_info *current_thread_info(void)
+{
+       struct thread_info *ti;
+#if defined(CONFIG_SUPERH64)
+       __asm__ __volatile__ ("getcon   cr17, %0" : "=r" (ti));
+#elif defined(CONFIG_CPU_HAS_SR_RB)
+       __asm__ __volatile__ ("stc      r7_bank, %0" : "=r" (ti));
+#else
+       unsigned long __dummy;
+
+       __asm__ __volatile__ (
+               "mov    r15, %0\n\t"
+               "and    %1, %0\n\t"
+               : "=&r" (ti), "=r" (__dummy)
+               : "1" (~(THREAD_SIZE - 1))
+               : "memory");
+#endif
+
+       return ti;
+}
+
+#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
+
+/* thread information allocation */
+#ifdef CONFIG_DEBUG_STACK_USAGE
+#define alloc_thread_info(ti)  kzalloc(THREAD_SIZE, GFP_KERNEL)
+#else
+#define alloc_thread_info(ti)  kmalloc(THREAD_SIZE, GFP_KERNEL)
+#endif
+#define free_thread_info(ti)   kfree(ti)
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * thread information flags
+ * - these are process state flags that various assembly files may need to access
+ * - pending work-to-be-done flags are in LSW
+ * - other flags in MSW
+ */
+#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
+#define TIF_SIGPENDING         1       /* signal pending */
+#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
+#define TIF_RESTORE_SIGMASK    3       /* restore signal mask in do_signal() */
+#define TIF_SINGLESTEP         4       /* singlestepping active */
+#define TIF_SYSCALL_AUDIT      5
+#define TIF_USEDFPU            16      /* FPU was used by this task this quantum (SMP) */
+#define TIF_POLLING_NRFLAG     17      /* true if poll_idle() is polling TIF_NEED_RESCHED */
+#define TIF_MEMDIE             18
+#define TIF_FREEZE             19
+
+#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
+#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
+#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_SINGLESTEP                (1<<TIF_SINGLESTEP)
+#define _TIF_SYSCALL_AUDIT             (1<<TIF_SYSCALL_AUDIT)
+#define _TIF_USEDFPU           (1<<TIF_USEDFPU)
+#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE            (1<<TIF_FREEZE)
+
+#define _TIF_WORK_MASK         0x000000FE      /* work to do on interrupt/exception return */
+#define _TIF_ALLWORK_MASK      0x000000FF      /* work to do on any return to u-space */
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_THREAD_INFO_H */
diff --git a/arch/sh/include/asm/timer.h b/arch/sh/include/asm/timer.h
new file mode 100644 (file)
index 0000000..a7ca3a1
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __ASM_SH_TIMER_H
+#define __ASM_SH_TIMER_H
+
+#include <linux/sysdev.h>
+#include <linux/clocksource.h>
+#include <cpu/timer.h>
+
+struct sys_timer_ops {
+       int (*init)(void);
+       int (*start)(void);
+       int (*stop)(void);
+       cycle_t (*read)(void);
+#ifndef CONFIG_GENERIC_TIME
+       unsigned long (*get_offset)(void);
+#endif
+};
+
+struct sys_timer {
+       const char              *name;
+
+       struct sys_device       dev;
+       struct sys_timer_ops    *ops;
+};
+
+#define TICK_SIZE (tick_nsec / 1000)
+
+extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;
+extern struct sys_timer *sys_timer;
+
+#ifndef CONFIG_GENERIC_TIME
+static inline unsigned long get_timer_offset(void)
+{
+       return sys_timer->ops->get_offset();
+}
+#endif
+
+/* arch/sh/kernel/timers/timer.c */
+struct sys_timer *get_sys_timer(void);
+
+/* arch/sh/kernel/time.c */
+void handle_timer_tick(void);
+extern unsigned long sh_hpt_frequency;
+
+#endif /* __ASM_SH_TIMER_H */
diff --git a/arch/sh/include/asm/timex.h b/arch/sh/include/asm/timex.h
new file mode 100644 (file)
index 0000000..a873e24
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-sh/timex.h
+ *
+ * sh architecture timex specifications
+ */
+#ifndef __ASM_SH_TIMEX_H
+#define __ASM_SH_TIMEX_H
+
+#define CLOCK_TICK_RATE                (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */
+
+typedef unsigned long long cycles_t;
+
+static __inline__ cycles_t get_cycles (void)
+{
+       return 0;
+}
+
+#endif /* __ASM_SH_TIMEX_H */
diff --git a/arch/sh/include/asm/titan.h b/arch/sh/include/asm/titan.h
new file mode 100644 (file)
index 0000000..03f3583
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Platform defintions for Titan
+ */
+#ifndef _ASM_SH_TITAN_H
+#define _ASM_SH_TITAN_H
+
+#define __IO_PREFIX titan
+#include <asm/io_generic.h>
+
+/* IRQ assignments */
+#define TITAN_IRQ_WAN          2       /* eth0 (WAN) */
+#define TITAN_IRQ_LAN          5       /* eth1 (LAN) */
+#define TITAN_IRQ_MPCIA                8       /* mPCI A */
+#define TITAN_IRQ_MPCIB                11      /* mPCI B */
+#define TITAN_IRQ_USB          11      /* USB */
+
+#endif /* __ASM_SH_TITAN_H */
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..88ff1ae
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __ASM_SH_TLB_H
+#define __ASM_SH_TLB_H
+
+#ifdef CONFIG_SUPERH64
+# include "tlb_64.h"
+#endif
+
+#ifndef __ASSEMBLY__
+
+#define tlb_start_vma(tlb, vma) \
+       flush_cache_range(vma, vma->vm_start, vma->vm_end)
+
+#define tlb_end_vma(tlb, vma)  \
+       flush_tlb_range(vma, vma->vm_start, vma->vm_end)
+
+#define __tlb_remove_tlb_entry(tlb, pte, address)      do { } while (0)
+
+/*
+ * Flush whole TLBs for MM
+ */
+#define tlb_flush(tlb)                         flush_tlb_mm((tlb)->mm)
+
+#include <linux/pagemap.h>
+#include <asm-generic/tlb.h>
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_TLB_H */
diff --git a/arch/sh/include/asm/tlb_64.h b/arch/sh/include/asm/tlb_64.h
new file mode 100644 (file)
index 0000000..0a96f3a
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * include/asm-sh/tlb_64.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_TLB_64_H
+#define __ASM_SH_TLB_64_H
+
+/* ITLB defines */
+#define ITLB_FIXED     0x00000000      /* First fixed ITLB, see head.S */
+#define ITLB_LAST_VAR_UNRESTRICTED     0x000003F0      /* Last ITLB */
+
+/* DTLB defines */
+#define DTLB_FIXED     0x00800000      /* First fixed DTLB, see head.S */
+#define DTLB_LAST_VAR_UNRESTRICTED     0x008003F0      /* Last DTLB */
+
+#ifndef __ASSEMBLY__
+
+/**
+ * for_each_dtlb_entry
+ *
+ * @tlb:       TLB entry
+ *
+ * Iterate over free (non-wired) DTLB entries
+ */
+#define for_each_dtlb_entry(tlb)               \
+       for (tlb  = cpu_data->dtlb.first;       \
+            tlb <= cpu_data->dtlb.last;        \
+            tlb += cpu_data->dtlb.step)
+
+/**
+ * for_each_itlb_entry
+ *
+ * @tlb:       TLB entry
+ *
+ * Iterate over free (non-wired) ITLB entries
+ */
+#define for_each_itlb_entry(tlb)               \
+       for (tlb  = cpu_data->itlb.first;       \
+            tlb <= cpu_data->itlb.last;        \
+            tlb += cpu_data->itlb.step)
+
+/**
+ * __flush_tlb_slot
+ *
+ * @slot:      Address of TLB slot.
+ *
+ * Flushes TLB slot @slot.
+ */
+static inline void __flush_tlb_slot(unsigned long long slot)
+{
+       __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
+}
+
+#ifdef CONFIG_MMU
+/* arch/sh64/mm/tlb.c */
+int sh64_tlb_init(void);
+unsigned long long sh64_next_free_dtlb_entry(void);
+unsigned long long sh64_get_wired_dtlb_entry(void);
+int sh64_put_wired_dtlb_entry(unsigned long long entry);
+void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr,
+                        unsigned long asid, unsigned long paddr);
+void sh64_teardown_tlb_slot(unsigned long long config_addr);
+#else
+#define sh64_tlb_init()                                        do { } while (0)
+#define sh64_next_free_dtlb_entry()                    (0)
+#define sh64_get_wired_dtlb_entry()                    (0)
+#define sh64_put_wired_dtlb_entry(entry)               do { } while (0)
+#define sh64_setup_tlb_slot(conf, virt, asid, phys)    do { } while (0)
+#define sh64_teardown_tlb_slot(addr)                   do { } while (0)
+#endif /* CONFIG_MMU */
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_TLB_64_H */
diff --git a/arch/sh/include/asm/tlbflush.h b/arch/sh/include/asm/tlbflush.h
new file mode 100644 (file)
index 0000000..e0ac972
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef __ASM_SH_TLBFLUSH_H
+#define __ASM_SH_TLBFLUSH_H
+
+/*
+ * TLB flushing:
+ *
+ *  - flush_tlb_all() flushes all processes TLBs
+ *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
+ *  - flush_tlb_page(vma, vmaddr) flushes one page
+ *  - flush_tlb_range(vma, start, end) flushes a range of pages
+ *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
+ */
+extern void local_flush_tlb_all(void);
+extern void local_flush_tlb_mm(struct mm_struct *mm);
+extern void local_flush_tlb_range(struct vm_area_struct *vma,
+                                 unsigned long start,
+                                 unsigned long end);
+extern void local_flush_tlb_page(struct vm_area_struct *vma,
+                                unsigned long page);
+extern void local_flush_tlb_kernel_range(unsigned long start,
+                                        unsigned long end);
+extern void local_flush_tlb_one(unsigned long asid, unsigned long page);
+
+#ifdef CONFIG_SMP
+
+extern void flush_tlb_all(void);
+extern void flush_tlb_mm(struct mm_struct *mm);
+extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
+                           unsigned long end);
+extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
+extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
+extern void flush_tlb_one(unsigned long asid, unsigned long page);
+
+#else
+
+#define flush_tlb_all()                        local_flush_tlb_all()
+#define flush_tlb_mm(mm)               local_flush_tlb_mm(mm)
+#define flush_tlb_page(vma, page)      local_flush_tlb_page(vma, page)
+#define flush_tlb_one(asid, page)      local_flush_tlb_one(asid, page)
+
+#define flush_tlb_range(vma, start, end)       \
+       local_flush_tlb_range(vma, start, end)
+
+#define flush_tlb_kernel_range(start, end)     \
+       local_flush_tlb_kernel_range(start, end)
+
+#endif /* CONFIG_SMP */
+
+#endif /* __ASM_SH_TLBFLUSH_H */
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
new file mode 100644 (file)
index 0000000..95f0085
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _ASM_SH_TOPOLOGY_H
+#define _ASM_SH_TOPOLOGY_H
+
+#ifdef CONFIG_NUMA
+
+/* sched_domains SD_NODE_INIT for sh machines */
+#define SD_NODE_INIT (struct sched_domain) {           \
+       .span                   = CPU_MASK_NONE,        \
+       .parent                 = NULL,                 \
+       .child                  = NULL,                 \
+       .groups                 = NULL,                 \
+       .min_interval           = 8,                    \
+       .max_interval           = 32,                   \
+       .busy_factor            = 32,                   \
+       .imbalance_pct          = 125,                  \
+       .cache_nice_tries       = 2,                    \
+       .busy_idx               = 3,                    \
+       .idle_idx               = 2,                    \
+       .newidle_idx            = 2,                    \
+       .wake_idx               = 1,                    \
+       .forkexec_idx           = 1,                    \
+       .flags                  = SD_LOAD_BALANCE       \
+                               | SD_BALANCE_FORK       \
+                               | SD_BALANCE_EXEC       \
+                               | SD_SERIALIZE          \
+                               | SD_WAKE_BALANCE,      \
+       .last_balance           = jiffies,              \
+       .balance_interval       = 1,                    \
+       .nr_balance_failed      = 0,                    \
+}
+
+#define cpu_to_node(cpu)       ((void)(cpu),0)
+#define parent_node(node)      ((void)(node),0)
+
+#define node_to_cpumask(node)  ((void)node, cpu_online_map)
+#define node_to_first_cpu(node)        ((void)(node),0)
+
+#define pcibus_to_node(bus)    ((void)(bus), -1)
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
+                                       CPU_MASK_ALL : \
+                                       node_to_cpumask(pcibus_to_node(bus)) \
+                               )
+#endif
+
+#include <asm-generic/topology.h>
+
+#endif /* _ASM_SH_TOPOLOGY_H */
diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h
new file mode 100644 (file)
index 0000000..beea4e6
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef __ASM_SH_TYPES_H
+#define __ASM_SH_TYPES_H
+
+#include <asm-generic/int-ll64.h>
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __KERNEL__
+
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
+/* Dma addresses are 32-bits wide.  */
+
+typedef u32 dma_addr_t;
+
+#ifdef CONFIG_SUPERH32
+typedef u16 opcode_t;
+#else
+typedef u32 opcode_t;
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_SH_TYPES_H */
diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..075848f
--- /dev/null
@@ -0,0 +1,258 @@
+#ifndef __ASM_SH_UACCESS_H
+#define __ASM_SH_UACCESS_H
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <asm/segment.h>
+
+#define VERIFY_READ    0
+#define VERIFY_WRITE   1
+
+#define __addr_ok(addr) \
+       ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg)
+
+/*
+ * __access_ok: Check if address with size is OK or not.
+ *
+ * Uhhuh, this needs 33-bit arithmetic. We have a carry..
+ *
+ * sum := addr + size;  carry? --> flag = true;
+ * if (sum >= addr_limit) flag = true;
+ */
+#define __access_ok(addr, size)                \
+       (__addr_ok((addr) + (size)))
+#define access_ok(type, addr, size)    \
+       (__chk_user_ptr(addr),          \
+        __access_ok((unsigned long __force)(addr), (size)))
+
+/*
+ * Uh, these should become the main single-value transfer routines ...
+ * They automatically use the right size if we just have the right
+ * pointer type ...
+ *
+ * As SuperH uses the same address space for kernel and user data, we
+ * can just do these as direct assignments.
+ *
+ * Careful to not
+ * (a) re-use the arguments for side effects (sizeof is ok)
+ * (b) require any knowledge of processes at this stage
+ */
+#define put_user(x,ptr)                __put_user_check((x), (ptr), sizeof(*(ptr)))
+#define get_user(x,ptr)                __get_user_check((x), (ptr), sizeof(*(ptr)))
+
+/*
+ * The "__xxx" versions do not do address space checking, useful when
+ * doing multiple accesses to the same area (the user has to do the
+ * checks by hand with "access_ok()")
+ */
+#define __put_user(x,ptr)      __put_user_nocheck((x), (ptr), sizeof(*(ptr)))
+#define __get_user(x,ptr)      __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
+
+struct __large_struct { unsigned long buf[100]; };
+#define __m(x) (*(struct __large_struct __user *)(x))
+
+#define __get_user_nocheck(x,ptr,size)                         \
+({                                                             \
+       long __gu_err;                                          \
+       unsigned long __gu_val;                                 \
+       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);     \
+       __chk_user_ptr(ptr);                                    \
+       __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
+       (x) = (__typeof__(*(ptr)))__gu_val;                     \
+       __gu_err;                                               \
+})
+
+#define __get_user_check(x,ptr,size)                                   \
+({                                                                     \
+       long __gu_err = -EFAULT;                                        \
+       unsigned long __gu_val = 0;                                     \
+       const __typeof__(*(ptr)) *__gu_addr = (ptr);                    \
+       if (likely(access_ok(VERIFY_READ, __gu_addr, (size))))          \
+               __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
+       (x) = (__typeof__(*(ptr)))__gu_val;                             \
+       __gu_err;                                                       \
+})
+
+#define __put_user_nocheck(x,ptr,size)                         \
+({                                                             \
+       long __pu_err;                                          \
+       __typeof__(*(ptr)) __user *__pu_addr = (ptr);           \
+       __typeof__(*(ptr)) __pu_val = x;                        \
+       __chk_user_ptr(ptr);                                    \
+       __put_user_size(__pu_val, __pu_addr, (size), __pu_err); \
+       __pu_err;                                               \
+})
+
+#define __put_user_check(x,ptr,size)                           \
+({                                                             \
+       long __pu_err = -EFAULT;                                \
+       __typeof__(*(ptr)) __user *__pu_addr = (ptr);           \
+       __typeof__(*(ptr)) __pu_val = x;                        \
+       if (likely(access_ok(VERIFY_WRITE, __pu_addr, size)))   \
+               __put_user_size(__pu_val, __pu_addr, (size),    \
+                               __pu_err);                      \
+       __pu_err;                                               \
+})
+
+#ifdef CONFIG_SUPERH32
+# include "uaccess_32.h"
+#else
+# include "uaccess_64.h"
+#endif
+
+/* Generic arbitrary sized copy.  */
+/* Return the number of bytes NOT copied */
+__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n);
+
+static __always_inline unsigned long
+__copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+       return __copy_user(to, (__force void *)from, n);
+}
+
+static __always_inline unsigned long __must_check
+__copy_to_user(void __user *to, const void *from, unsigned long n)
+{
+       return __copy_user((__force void *)to, from, n);
+}
+
+#define __copy_to_user_inatomic __copy_to_user
+#define __copy_from_user_inatomic __copy_from_user
+
+/*
+ * Clear the area and return remaining number of bytes
+ * (on failure.  Usually it's 0.)
+ */
+__kernel_size_t __clear_user(void *addr, __kernel_size_t size);
+
+#define clear_user(addr,n)                                             \
+({                                                                     \
+       void __user * __cl_addr = (addr);                               \
+       unsigned long __cl_size = (n);                                  \
+                                                                       \
+       if (__cl_size && access_ok(VERIFY_WRITE,                        \
+               ((unsigned long)(__cl_addr)), __cl_size))               \
+               __cl_size = __clear_user(__cl_addr, __cl_size);         \
+                                                                       \
+       __cl_size;                                                      \
+})
+
+/**
+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
+ * @dst:   Destination address, in kernel space.  This buffer must be at
+ *         least @count bytes long.
+ * @src:   Source address, in user space.
+ * @count: Maximum number of bytes to copy, including the trailing NUL.
+ *
+ * Copies a NUL-terminated string from userspace to kernel space.
+ *
+ * On success, returns the length of the string (not including the trailing
+ * NUL).
+ *
+ * If access to userspace fails, returns -EFAULT (some data may have been
+ * copied).
+ *
+ * If @count is smaller than the length of the string, copies @count bytes
+ * and returns @count.
+ */
+#define strncpy_from_user(dest,src,count)                              \
+({                                                                     \
+       unsigned long __sfu_src = (unsigned long)(src);                 \
+       int __sfu_count = (int)(count);                                 \
+       long __sfu_res = -EFAULT;                                       \
+                                                                       \
+       if (__access_ok(__sfu_src, __sfu_count))                        \
+               __sfu_res = __strncpy_from_user((unsigned long)(dest),  \
+                               __sfu_src, __sfu_count);                \
+                                                                       \
+       __sfu_res;                                                      \
+})
+
+static inline unsigned long
+copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+       unsigned long __copy_from = (unsigned long) from;
+       __kernel_size_t __copy_size = (__kernel_size_t) n;
+
+       if (__copy_size && __access_ok(__copy_from, __copy_size))
+               return __copy_user(to, from, __copy_size);
+
+       return __copy_size;
+}
+
+static inline unsigned long
+copy_to_user(void __user *to, const void *from, unsigned long n)
+{
+       unsigned long __copy_to = (unsigned long) to;
+       __kernel_size_t __copy_size = (__kernel_size_t) n;
+
+       if (__copy_size && __access_ok(__copy_to, __copy_size))
+               return __copy_user(to, from, __copy_size);
+
+       return __copy_size;
+}
+
+/**
+ * strnlen_user: - Get the size of a string in user space.
+ * @s: The string to measure.
+ * @n: The maximum valid length
+ *
+ * Context: User context only.  This function may sleep.
+ *
+ * Get the size of a NUL-terminated string in user space.
+ *
+ * Returns the size of the string INCLUDING the terminating NUL.
+ * On exception, returns 0.
+ * If the string is too long, returns a value greater than @n.
+ */
+static inline long strnlen_user(const char __user *s, long n)
+{
+       if (!__addr_ok(s))
+               return 0;
+       else
+               return __strnlen_user(s, n);
+}
+
+/**
+ * strlen_user: - Get the size of a string in user space.
+ * @str: The string to measure.
+ *
+ * Context: User context only.  This function may sleep.
+ *
+ * Get the size of a NUL-terminated string in user space.
+ *
+ * Returns the size of the string INCLUDING the terminating NUL.
+ * On exception, returns 0.
+ *
+ * If there is a limit on the length of a valid string, you may wish to
+ * consider using strnlen_user() instead.
+ */
+#define strlen_user(str)       strnlen_user(str, ~0UL >> 1)
+
+/*
+ * The exception table consists of pairs of addresses: the first is the
+ * address of an instruction that is allowed to fault, and the second is
+ * the address at which the program should continue.  No registers are
+ * modified, so it is entirely up to the continuation code to figure out
+ * what to do.
+ *
+ * All the routines below use bits of fixup code that are out of line
+ * with the main instruction path.  This means when everything is well,
+ * we don't even have to jump over them.  Further, they do not intrude
+ * on our cache or tlb entries.
+ */
+struct exception_table_entry {
+       unsigned long insn, fixup;
+};
+
+#if defined(CONFIG_SUPERH64) && defined(CONFIG_MMU)
+#define ARCH_HAS_SEARCH_EXTABLE
+#endif
+
+int fixup_exception(struct pt_regs *regs);
+/* Returns 0 if exception not found and fixup.unit otherwise.  */
+unsigned long search_exception_table(unsigned long addr);
+const struct exception_table_entry *search_exception_tables(unsigned long addr);
+
+
+#endif /* __ASM_SH_UACCESS_H */
diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
new file mode 100644 (file)
index 0000000..ae0d24f
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ * User space memory access functions
+ *
+ * Copyright (C) 1999, 2002  Niibe Yutaka
+ * Copyright (C) 2003 - 2008  Paul Mundt
+ *
+ *  Based on:
+ *     MIPS implementation version 1.15 by
+ *              Copyright (C) 1996, 1997, 1998 by Ralf Baechle
+ *     and i386 version.
+ */
+#ifndef __ASM_SH_UACCESS_32_H
+#define __ASM_SH_UACCESS_32_H
+
+#define __get_user_size(x,ptr,size,retval)                     \
+do {                                                           \
+       retval = 0;                                             \
+       switch (size) {                                         \
+       case 1:                                                 \
+               __get_user_asm(x, ptr, retval, "b");            \
+               break;                                          \
+       case 2:                                                 \
+               __get_user_asm(x, ptr, retval, "w");            \
+               break;                                          \
+       case 4:                                                 \
+               __get_user_asm(x, ptr, retval, "l");            \
+               break;                                          \
+       default:                                                \
+               __get_user_unknown();                           \
+               break;                                          \
+       }                                                       \
+} while (0)
+
+#ifdef CONFIG_MMU
+#define __get_user_asm(x, addr, err, insn) \
+({ \
+__asm__ __volatile__( \
+       "1:\n\t" \
+       "mov." insn "   %2, %1\n\t" \
+       "2:\n" \
+       ".section       .fixup,\"ax\"\n" \
+       "3:\n\t" \
+       "mov    #0, %1\n\t" \
+       "mov.l  4f, %0\n\t" \
+       "jmp    @%0\n\t" \
+       " mov   %3, %0\n\t" \
+       ".balign        4\n" \
+       "4:     .long   2b\n\t" \
+       ".previous\n" \
+       ".section       __ex_table,\"a\"\n\t" \
+       ".long  1b, 3b\n\t" \
+       ".previous" \
+       :"=&r" (err), "=&r" (x) \
+       :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+#else
+#define __get_user_asm(x, addr, err, insn)             \
+do {                                                   \
+       __asm__ __volatile__ (                          \
+               "mov." insn "   %1, %0\n\t"             \
+               : "=&r" (x)                             \
+               : "m" (__m(addr))                       \
+       );                                              \
+} while (0)
+#endif /* CONFIG_MMU */
+
+extern void __get_user_unknown(void);
+
+#define __put_user_size(x,ptr,size,retval)             \
+do {                                                   \
+       retval = 0;                                     \
+       switch (size) {                                 \
+       case 1:                                         \
+               __put_user_asm(x, ptr, retval, "b");    \
+               break;                                  \
+       case 2:                                         \
+               __put_user_asm(x, ptr, retval, "w");    \
+               break;                                  \
+       case 4:                                         \
+               __put_user_asm(x, ptr, retval, "l");    \
+               break;                                  \
+       case 8:                                         \
+               __put_user_u64(x, ptr, retval);         \
+               break;                                  \
+       default:                                        \
+               __put_user_unknown();                   \
+       }                                               \
+} while (0)
+
+#ifdef CONFIG_MMU
+#define __put_user_asm(x, addr, err, insn)                     \
+do {                                                           \
+       __asm__ __volatile__ (                                  \
+               "1:\n\t"                                        \
+               "mov." insn "   %1, %2\n\t"                     \
+               "2:\n"                                          \
+               ".section       .fixup,\"ax\"\n"                \
+               "3:\n\t"                                        \
+               "mov.l  4f, %0\n\t"                             \
+               "jmp    @%0\n\t"                                \
+               " mov   %3, %0\n\t"                             \
+               ".balign        4\n"                            \
+               "4:     .long   2b\n\t"                         \
+               ".previous\n"                                   \
+               ".section       __ex_table,\"a\"\n\t"           \
+               ".long  1b, 3b\n\t"                             \
+               ".previous"                                     \
+               : "=&r" (err)                                   \
+               : "r" (x), "m" (__m(addr)), "i" (-EFAULT),      \
+                 "0" (err)                                     \
+               : "memory"                                      \
+       );                                                      \
+} while (0)
+#else
+#define __put_user_asm(x, addr, err, insn)             \
+do {                                                   \
+       __asm__ __volatile__ (                          \
+               "mov." insn "   %0, %1\n\t"             \
+               : /* no outputs */                      \
+               : "r" (x), "m" (__m(addr))              \
+               : "memory"                              \
+       );                                              \
+} while (0)
+#endif /* CONFIG_MMU */
+
+#if defined(CONFIG_CPU_LITTLE_ENDIAN)
+#define __put_user_u64(val,addr,retval) \
+({ \
+__asm__ __volatile__( \
+       "1:\n\t" \
+       "mov.l  %R1,%2\n\t" \
+       "mov.l  %S1,%T2\n\t" \
+       "2:\n" \
+       ".section       .fixup,\"ax\"\n" \
+       "3:\n\t" \
+       "mov.l  4f,%0\n\t" \
+       "jmp    @%0\n\t" \
+       " mov   %3,%0\n\t" \
+       ".balign        4\n" \
+       "4:     .long   2b\n\t" \
+       ".previous\n" \
+       ".section       __ex_table,\"a\"\n\t" \
+       ".long  1b, 3b\n\t" \
+       ".previous" \
+       : "=r" (retval) \
+       : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+        : "memory"); })
+#else
+#define __put_user_u64(val,addr,retval) \
+({ \
+__asm__ __volatile__( \
+       "1:\n\t" \
+       "mov.l  %S1,%2\n\t" \
+       "mov.l  %R1,%T2\n\t" \
+       "2:\n" \
+       ".section       .fixup,\"ax\"\n" \
+       "3:\n\t" \
+       "mov.l  4f,%0\n\t" \
+       "jmp    @%0\n\t" \
+       " mov   %3,%0\n\t" \
+       ".balign        4\n" \
+       "4:     .long   2b\n\t" \
+       ".previous\n" \
+       ".section       __ex_table,\"a\"\n\t" \
+       ".long  1b, 3b\n\t" \
+       ".previous" \
+       : "=r" (retval) \
+       : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+        : "memory"); })
+#endif
+
+extern void __put_user_unknown(void);
+
+static inline int
+__strncpy_from_user(unsigned long __dest, unsigned long __user __src, int __count)
+{
+       __kernel_size_t res;
+       unsigned long __dummy, _d, _s, _c;
+
+       __asm__ __volatile__(
+               "9:\n"
+               "mov.b  @%2+, %1\n\t"
+               "cmp/eq #0, %1\n\t"
+               "bt/s   2f\n"
+               "1:\n"
+               "mov.b  %1, @%3\n\t"
+               "dt     %4\n\t"
+               "bf/s   9b\n\t"
+               " add   #1, %3\n\t"
+               "2:\n\t"
+               "sub    %4, %0\n"
+               "3:\n"
+               ".section .fixup,\"ax\"\n"
+               "4:\n\t"
+               "mov.l  5f, %1\n\t"
+               "jmp    @%1\n\t"
+               " mov   %9, %0\n\t"
+               ".balign 4\n"
+               "5:     .long 3b\n"
+               ".previous\n"
+               ".section __ex_table,\"a\"\n"
+               "       .balign 4\n"
+               "       .long 9b,4b\n"
+               ".previous"
+               : "=r" (res), "=&z" (__dummy), "=r" (_s), "=r" (_d), "=r"(_c)
+               : "0" (__count), "2" (__src), "3" (__dest), "4" (__count),
+                 "i" (-EFAULT)
+               : "memory", "t");
+
+       return res;
+}
+
+/*
+ * Return the size of a string (including the ending 0 even when we have
+ * exceeded the maximum string length).
+ */
+static inline long __strnlen_user(const char __user *__s, long __n)
+{
+       unsigned long res;
+       unsigned long __dummy;
+
+       __asm__ __volatile__(
+               "1:\t"
+               "mov.b  @(%0,%3), %1\n\t"
+               "cmp/eq %4, %0\n\t"
+               "bt/s   2f\n\t"
+               " add   #1, %0\n\t"
+               "tst    %1, %1\n\t"
+               "bf     1b\n\t"
+               "2:\n"
+               ".section .fixup,\"ax\"\n"
+               "3:\n\t"
+               "mov.l  4f, %1\n\t"
+               "jmp    @%1\n\t"
+               " mov   #0, %0\n"
+               ".balign 4\n"
+               "4:     .long 2b\n"
+               ".previous\n"
+               ".section __ex_table,\"a\"\n"
+               "       .balign 4\n"
+               "       .long 1b,3b\n"
+               ".previous"
+               : "=z" (res), "=&r" (__dummy)
+               : "0" (0), "r" (__s), "r" (__n)
+               : "t");
+       return res;
+}
+
+#endif /* __ASM_SH_UACCESS_32_H */
diff --git a/arch/sh/include/asm/uaccess_64.h b/arch/sh/include/asm/uaccess_64.h
new file mode 100644 (file)
index 0000000..81b3d51
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef __ASM_SH_UACCESS_64_H
+#define __ASM_SH_UACCESS_64_H
+
+/*
+ * include/asm-sh/uaccess_64.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003, 2004  Paul Mundt
+ *
+ * User space memory access functions
+ *
+ * Copyright (C) 1999  Niibe Yutaka
+ *
+ *  Based on:
+ *     MIPS implementation version 1.15 by
+ *              Copyright (C) 1996, 1997, 1998 by Ralf Baechle
+ *     and i386 version.
+ *
+ * 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.
+ */
+
+#define __get_user_size(x,ptr,size,retval)                     \
+do {                                                           \
+       retval = 0;                                             \
+       switch (size) {                                         \
+       case 1:                                                 \
+               retval = __get_user_asm_b(x, ptr);              \
+               break;                                          \
+       case 2:                                                 \
+               retval = __get_user_asm_w(x, ptr);              \
+               break;                                          \
+       case 4:                                                 \
+               retval = __get_user_asm_l(x, ptr);              \
+               break;                                          \
+       case 8:                                                 \
+               retval = __get_user_asm_q(x, ptr);              \
+               break;                                          \
+       default:                                                \
+               __get_user_unknown();                           \
+               break;                                          \
+       }                                                       \
+} while (0)
+
+extern long __get_user_asm_b(void *, long);
+extern long __get_user_asm_w(void *, long);
+extern long __get_user_asm_l(void *, long);
+extern long __get_user_asm_q(void *, long);
+extern void __get_user_unknown(void);
+
+#define __put_user_size(x,ptr,size,retval)                     \
+do {                                                           \
+       retval = 0;                                             \
+       switch (size) {                                         \
+       case 1:                                                 \
+               retval = __put_user_asm_b(x, ptr);              \
+               break;                                          \
+       case 2:                                                 \
+               retval = __put_user_asm_w(x, ptr);              \
+               break;                                          \
+       case 4:                                                 \
+               retval = __put_user_asm_l(x, ptr);              \
+               break;                                          \
+       case 8:                                                 \
+               retval = __put_user_asm_q(x, ptr);              \
+               break;                                          \
+       default:                                                \
+               __put_user_unknown();                           \
+       }                                                       \
+} while (0)
+
+extern long __put_user_asm_b(void *, long);
+extern long __put_user_asm_w(void *, long);
+extern long __put_user_asm_l(void *, long);
+extern long __put_user_asm_q(void *, long);
+extern void __put_user_unknown(void);
+
+#endif /* __ASM_SH_UACCESS_64_H */
diff --git a/arch/sh/include/asm/ubc.h b/arch/sh/include/asm/ubc.h
new file mode 100644 (file)
index 0000000..a7b9028
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * include/asm-sh/ubc.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_UBC_H
+#define __ASM_SH_UBC_H
+#ifdef __KERNEL__
+
+#include <cpu/ubc.h>
+
+/* User Break Controller */
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#define UBC_TYPE_SH7729        (current_cpu_data.type == CPU_SH7729)
+#else
+#define UBC_TYPE_SH7729        0
+#endif
+
+#define BAMR_ASID              (1 << 2)
+#define BAMR_NONE              0
+#define BAMR_10                        0x1
+#define BAMR_12                        0x2
+#define BAMR_ALL               0x3
+#define BAMR_16                        0x8
+#define BAMR_20                        0x9
+
+#define BBR_INST               (1 << 4)
+#define BBR_DATA               (2 << 4)
+#define BBR_READ               (1 << 2)
+#define BBR_WRITE              (2 << 2)
+#define BBR_BYTE               0x1
+#define BBR_HALF               0x2
+#define BBR_LONG               0x3
+#define BBR_QUAD               (1 << 6)        /* SH7750 */
+#define BBR_CPU                        (1 << 6)        /* SH7709A,SH7729 */
+#define BBR_DMA                        (2 << 6)        /* SH7709A,SH7729 */
+
+#define BRCR_CMFA              (1 << 15)
+#define BRCR_CMFB              (1 << 14)
+#define BRCR_PCTE              (1 << 11)
+#define BRCR_PCBA              (1 << 10)       /* 1: after execution */
+#define BRCR_DBEB              (1 << 7)
+#define BRCR_PCBB              (1 << 6)
+#define BRCR_SEQ               (1 << 3)
+#define BRCR_UBDE              (1 << 0)
+
+#ifndef __ASSEMBLY__
+/* arch/sh/kernel/cpu/ubc.S */
+extern void ubc_sleep(void);
+
+#ifdef CONFIG_UBC_WAKEUP
+extern void ubc_wakeup(void);
+#else
+#define ubc_wakeup()   do { } while (0)
+#endif
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_UBC_H */
diff --git a/arch/sh/include/asm/ucontext.h b/arch/sh/include/asm/ucontext.h
new file mode 100644 (file)
index 0000000..202ef1d
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __ASM_SH_UCONTEXT_H
+#define __ASM_SH_UCONTEXT_H
+
+struct ucontext {
+       unsigned long     uc_flags;
+       struct ucontext  *uc_link;
+       stack_t           uc_stack;
+       struct sigcontext uc_mcontext;
+       sigset_t          uc_sigmask;   /* mask last for extensibility */
+};
+
+#endif /* __ASM_SH_UCONTEXT_H */
diff --git a/arch/sh/include/asm/unaligned.h b/arch/sh/include/asm/unaligned.h
new file mode 100644 (file)
index 0000000..c1641a0
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _ASM_SH_UNALIGNED_H
+#define _ASM_SH_UNALIGNED_H
+
+/* SH can't handle unaligned accesses. */
+#ifdef __LITTLE_ENDIAN__
+# 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
+#else
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+# define get_unaligned __get_unaligned_be
+# define put_unaligned __put_unaligned_be
+#endif
+
+#endif /* _ASM_SH_UNALIGNED_H */
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h
new file mode 100644 (file)
index 0000000..65be656
--- /dev/null
@@ -0,0 +1,13 @@
+#ifdef __KERNEL__
+# ifdef CONFIG_SUPERH32
+#  include "unistd_32.h"
+# else
+#  include "unistd_64.h"
+# endif
+#else
+# ifdef __SH5__
+#  include "unistd_64.h"
+# else
+#  include "unistd_32.h"
+# endif
+#endif
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h
new file mode 100644 (file)
index 0000000..d52c000
--- /dev/null
@@ -0,0 +1,384 @@
+#ifndef __ASM_SH_UNISTD_H
+#define __ASM_SH_UNISTD_H
+
+/*
+ * Copyright (C) 1999  Niibe Yutaka
+ */
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_restart_syscall     0
+#define __NR_exit                1
+#define __NR_fork                2
+#define __NR_read                3
+#define __NR_write               4
+#define __NR_open                5
+#define __NR_close               6
+#define __NR_waitpid             7
+#define __NR_creat               8
+#define __NR_link                9
+#define __NR_unlink             10
+#define __NR_execve             11
+#define __NR_chdir              12
+#define __NR_time               13
+#define __NR_mknod              14
+#define __NR_chmod              15
+#define __NR_lchown             16
+#define __NR_break              17
+#define __NR_oldstat            18
+#define __NR_lseek              19
+#define __NR_getpid             20
+#define __NR_mount              21
+#define __NR_umount             22
+#define __NR_setuid             23
+#define __NR_getuid             24
+#define __NR_stime              25
+#define __NR_ptrace             26
+#define __NR_alarm              27
+#define __NR_oldfstat           28
+#define __NR_pause              29
+#define __NR_utime              30
+#define __NR_stty               31
+#define __NR_gtty               32
+#define __NR_access             33
+#define __NR_nice               34
+#define __NR_ftime              35
+#define __NR_sync               36
+#define __NR_kill               37
+#define __NR_rename             38
+#define __NR_mkdir              39
+#define __NR_rmdir              40
+#define __NR_dup                41
+#define __NR_pipe               42
+#define __NR_times              43
+#define __NR_prof               44
+#define __NR_brk                45
+#define __NR_setgid             46
+#define __NR_getgid             47
+#define __NR_signal             48
+#define __NR_geteuid            49
+#define __NR_getegid            50
+#define __NR_acct               51
+#define __NR_umount2            52
+#define __NR_lock               53
+#define __NR_ioctl              54
+#define __NR_fcntl              55
+#define __NR_mpx                56
+#define __NR_setpgid            57
+#define __NR_ulimit             58
+#define __NR_oldolduname        59
+#define __NR_umask              60
+#define __NR_chroot             61
+#define __NR_ustat              62
+#define __NR_dup2               63
+#define __NR_getppid            64
+#define __NR_getpgrp            65
+#define __NR_setsid             66
+#define __NR_sigaction          67
+#define __NR_sgetmask           68
+#define __NR_ssetmask           69
+#define __NR_setreuid           70
+#define __NR_setregid           71
+#define __NR_sigsuspend                 72
+#define __NR_sigpending                 73
+#define __NR_sethostname        74
+#define __NR_setrlimit          75
+#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage          77
+#define __NR_gettimeofday       78
+#define __NR_settimeofday       79
+#define __NR_getgroups          80
+#define __NR_setgroups          81
+#define __NR_select             82
+#define __NR_symlink            83
+#define __NR_oldlstat           84
+#define __NR_readlink           85
+#define __NR_uselib             86
+#define __NR_swapon             87
+#define __NR_reboot             88
+#define __NR_readdir            89
+#define __NR_mmap               90
+#define __NR_munmap             91
+#define __NR_truncate           92
+#define __NR_ftruncate          93
+#define __NR_fchmod             94
+#define __NR_fchown             95
+#define __NR_getpriority        96
+#define __NR_setpriority        97
+#define __NR_profil             98
+#define __NR_statfs             99
+#define __NR_fstatfs           100
+#define __NR_ioperm            101
+#define __NR_socketcall                102
+#define __NR_syslog            103
+#define __NR_setitimer         104
+#define __NR_getitimer         105
+#define __NR_stat              106
+#define __NR_lstat             107
+#define __NR_fstat             108
+#define __NR_olduname          109
+#define __NR_iopl              110
+#define __NR_vhangup           111
+#define __NR_idle              112
+#define __NR_vm86old           113
+#define __NR_wait4             114
+#define __NR_swapoff           115
+#define __NR_sysinfo           116
+#define __NR_ipc               117
+#define __NR_fsync             118
+#define __NR_sigreturn         119
+#define __NR_clone             120
+#define __NR_setdomainname     121
+#define __NR_uname             122
+#define __NR_modify_ldt                123
+#define __NR_adjtimex          124
+#define __NR_mprotect          125
+#define __NR_sigprocmask       126
+#define __NR_create_module     127
+#define __NR_init_module       128
+#define __NR_delete_module     129
+#define __NR_get_kernel_syms   130
+#define __NR_quotactl          131
+#define __NR_getpgid           132
+#define __NR_fchdir            133
+#define __NR_bdflush           134
+#define __NR_sysfs             135
+#define __NR_personality       136
+#define __NR_afs_syscall       137 /* Syscall for Andrew File System */
+#define __NR_setfsuid          138
+#define __NR_setfsgid          139
+#define __NR__llseek           140
+#define __NR_getdents          141
+#define __NR__newselect                142
+#define __NR_flock             143
+#define __NR_msync             144
+#define __NR_readv             145
+#define __NR_writev            146
+#define __NR_getsid            147
+#define __NR_fdatasync         148
+#define __NR__sysctl           149
+#define __NR_mlock             150
+#define __NR_munlock           151
+#define __NR_mlockall          152
+#define __NR_munlockall                153
+#define __NR_sched_setparam            154
+#define __NR_sched_getparam            155
+#define __NR_sched_setscheduler                156
+#define __NR_sched_getscheduler                157
+#define __NR_sched_yield               158
+#define __NR_sched_get_priority_max    159
+#define __NR_sched_get_priority_min    160
+#define __NR_sched_rr_get_interval     161
+#define __NR_nanosleep         162
+#define __NR_mremap            163
+#define __NR_setresuid         164
+#define __NR_getresuid         165
+#define __NR_vm86              166
+#define __NR_query_module      167
+#define __NR_poll              168
+#define __NR_nfsservctl                169
+#define __NR_setresgid         170
+#define __NR_getresgid         171
+#define __NR_prctl              172
+#define __NR_rt_sigreturn      173
+#define __NR_rt_sigaction      174
+#define __NR_rt_sigprocmask    175
+#define __NR_rt_sigpending     176
+#define __NR_rt_sigtimedwait   177
+#define __NR_rt_sigqueueinfo   178
+#define __NR_rt_sigsuspend     179
+#define __NR_pread64           180
+#define __NR_pwrite64          181
+#define __NR_chown             182
+#define __NR_getcwd            183
+#define __NR_capget            184
+#define __NR_capset            185
+#define __NR_sigaltstack       186
+#define __NR_sendfile          187
+#define __NR_streams1          188     /* some people actually want it */
+#define __NR_streams2          189     /* some people actually want it */
+#define __NR_vfork             190
+#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
+#define __NR_mmap2             192
+#define __NR_truncate64                193
+#define __NR_ftruncate64       194
+#define __NR_stat64            195
+#define __NR_lstat64           196
+#define __NR_fstat64           197
+#define __NR_lchown32          198
+#define __NR_getuid32          199
+#define __NR_getgid32          200
+#define __NR_geteuid32         201
+#define __NR_getegid32         202
+#define __NR_setreuid32                203
+#define __NR_setregid32                204
+#define __NR_getgroups32       205
+#define __NR_setgroups32       206
+#define __NR_fchown32          207
+#define __NR_setresuid32       208
+#define __NR_getresuid32       209
+#define __NR_setresgid32       210
+#define __NR_getresgid32       211
+#define __NR_chown32           212
+#define __NR_setuid32          213
+#define __NR_setgid32          214
+#define __NR_setfsuid32                215
+#define __NR_setfsgid32                216
+#define __NR_pivot_root                217
+#define __NR_mincore           218
+#define __NR_madvise           219
+#define __NR_getdents64                220
+#define __NR_fcntl64           221
+/* 223 is unused */
+#define __NR_gettid            224
+#define __NR_readahead         225
+#define __NR_setxattr          226
+#define __NR_lsetxattr         227
+#define __NR_fsetxattr         228
+#define __NR_getxattr          229
+#define __NR_lgetxattr         230
+#define __NR_fgetxattr         231
+#define __NR_listxattr         232
+#define __NR_llistxattr                233
+#define __NR_flistxattr                234
+#define __NR_removexattr       235
+#define __NR_lremovexattr      236
+#define __NR_fremovexattr      237
+#define __NR_tkill             238
+#define __NR_sendfile64                239
+#define __NR_futex             240
+#define __NR_sched_setaffinity 241
+#define __NR_sched_getaffinity 242
+#define __NR_set_thread_area   243
+#define __NR_get_thread_area   244
+#define __NR_io_setup          245
+#define __NR_io_destroy                246
+#define __NR_io_getevents      247
+#define __NR_io_submit         248
+#define __NR_io_cancel         249
+#define __NR_fadvise64         250
+
+#define __NR_exit_group                252
+#define __NR_lookup_dcookie    253
+#define __NR_epoll_create      254
+#define __NR_epoll_ctl         255
+#define __NR_epoll_wait                256
+#define __NR_remap_file_pages  257
+#define __NR_set_tid_address   258
+#define __NR_timer_create      259
+#define __NR_timer_settime     (__NR_timer_create+1)
+#define __NR_timer_gettime     (__NR_timer_create+2)
+#define __NR_timer_getoverrun  (__NR_timer_create+3)
+#define __NR_timer_delete      (__NR_timer_create+4)
+#define __NR_clock_settime     (__NR_timer_create+5)
+#define __NR_clock_gettime     (__NR_timer_create+6)
+#define __NR_clock_getres      (__NR_timer_create+7)
+#define __NR_clock_nanosleep   (__NR_timer_create+8)
+#define __NR_statfs64          268
+#define __NR_fstatfs64         269
+#define __NR_tgkill            270
+#define __NR_utimes            271
+#define __NR_fadvise64_64      272
+#define __NR_vserver           273
+#define __NR_mbind              274
+#define __NR_get_mempolicy      275
+#define __NR_set_mempolicy      276
+#define __NR_mq_open            277
+#define __NR_mq_unlink          (__NR_mq_open+1)
+#define __NR_mq_timedsend       (__NR_mq_open+2)
+#define __NR_mq_timedreceive    (__NR_mq_open+3)
+#define __NR_mq_notify          (__NR_mq_open+4)
+#define __NR_mq_getsetattr      (__NR_mq_open+5)
+#define __NR_kexec_load                283
+#define __NR_waitid            284
+#define __NR_add_key           285
+#define __NR_request_key       286
+#define __NR_keyctl            287
+#define __NR_ioprio_set                288
+#define __NR_ioprio_get                289
+#define __NR_inotify_init      290
+#define __NR_inotify_add_watch 291
+#define __NR_inotify_rm_watch  292
+/* 293 is unused */
+#define __NR_migrate_pages     294
+#define __NR_openat            295
+#define __NR_mkdirat           296
+#define __NR_mknodat           297
+#define __NR_fchownat          298
+#define __NR_futimesat         299
+#define __NR_fstatat64         300
+#define __NR_unlinkat          301
+#define __NR_renameat          302
+#define __NR_linkat            303
+#define __NR_symlinkat         304
+#define __NR_readlinkat                305
+#define __NR_fchmodat          306
+#define __NR_faccessat         307
+#define __NR_pselect6          308
+#define __NR_ppoll             309
+#define __NR_unshare           310
+#define __NR_set_robust_list   311
+#define __NR_get_robust_list   312
+#define __NR_splice            313
+#define __NR_sync_file_range   314
+#define __NR_tee               315
+#define __NR_vmsplice          316
+#define __NR_move_pages                317
+#define __NR_getcpu            318
+#define __NR_epoll_pwait       319
+#define __NR_utimensat         320
+#define __NR_signalfd          321
+#define __NR_timerfd_create    322
+#define __NR_eventfd           323
+#define __NR_fallocate         324
+#define __NR_timerfd_settime   325
+#define __NR_timerfd_gettime   326
+#define __NR_signalfd4         327
+#define __NR_eventfd2          328
+#define __NR_epoll_create1     329
+#define __NR_dup3              330
+#define __NR_pipe2             331
+#define __NR_inotify_init1     332
+
+#define NR_syscalls 333
+
+#ifdef __KERNEL__
+
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_RT_SIGSUSPEND
+
+/*
+ * "Conditional" syscalls
+ *
+ * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
+ * but it doesn't work on all toolchains, so we just do it by hand
+ */
+#ifndef cond_syscall
+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_UNISTD_H */
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h
new file mode 100644 (file)
index 0000000..7c54e91
--- /dev/null
@@ -0,0 +1,423 @@
+#ifndef __ASM_SH_UNISTD_64_H
+#define __ASM_SH_UNISTD_64_H
+
+/*
+ * include/asm-sh/unistd_64.h
+ *
+ * This file contains the system call numbers.
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003 - 2007 Paul Mundt
+ * Copyright (C) 2004  Sean McGoogan
+ *
+ * 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.
+ */
+#define __NR_restart_syscall     0
+#define __NR_exit                1
+#define __NR_fork                2
+#define __NR_read                3
+#define __NR_write               4
+#define __NR_open                5
+#define __NR_close               6
+#define __NR_waitpid             7
+#define __NR_creat               8
+#define __NR_link                9
+#define __NR_unlink             10
+#define __NR_execve             11
+#define __NR_chdir              12
+#define __NR_time               13
+#define __NR_mknod              14
+#define __NR_chmod              15
+#define __NR_lchown             16
+#define __NR_break              17
+#define __NR_oldstat            18
+#define __NR_lseek              19
+#define __NR_getpid             20
+#define __NR_mount              21
+#define __NR_umount             22
+#define __NR_setuid             23
+#define __NR_getuid             24
+#define __NR_stime              25
+#define __NR_ptrace             26
+#define __NR_alarm              27
+#define __NR_oldfstat           28
+#define __NR_pause              29
+#define __NR_utime              30
+#define __NR_stty               31
+#define __NR_gtty               32
+#define __NR_access             33
+#define __NR_nice               34
+#define __NR_ftime              35
+#define __NR_sync               36
+#define __NR_kill               37
+#define __NR_rename             38
+#define __NR_mkdir              39
+#define __NR_rmdir              40
+#define __NR_dup                41
+#define __NR_pipe               42
+#define __NR_times              43
+#define __NR_prof               44
+#define __NR_brk                45
+#define __NR_setgid             46
+#define __NR_getgid             47
+#define __NR_signal             48
+#define __NR_geteuid            49
+#define __NR_getegid            50
+#define __NR_acct               51
+#define __NR_umount2            52
+#define __NR_lock               53
+#define __NR_ioctl              54
+#define __NR_fcntl              55
+#define __NR_mpx                56
+#define __NR_setpgid            57
+#define __NR_ulimit             58
+#define __NR_oldolduname        59
+#define __NR_umask              60
+#define __NR_chroot             61
+#define __NR_ustat              62
+#define __NR_dup2               63
+#define __NR_getppid            64
+#define __NR_getpgrp            65
+#define __NR_setsid             66
+#define __NR_sigaction          67
+#define __NR_sgetmask           68
+#define __NR_ssetmask           69
+#define __NR_setreuid           70
+#define __NR_setregid           71
+#define __NR_sigsuspend                 72
+#define __NR_sigpending                 73
+#define __NR_sethostname        74
+#define __NR_setrlimit          75
+#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage          77
+#define __NR_gettimeofday       78
+#define __NR_settimeofday       79
+#define __NR_getgroups          80
+#define __NR_setgroups          81
+#define __NR_select             82
+#define __NR_symlink            83
+#define __NR_oldlstat           84
+#define __NR_readlink           85
+#define __NR_uselib             86
+#define __NR_swapon             87
+#define __NR_reboot             88
+#define __NR_readdir            89
+#define __NR_mmap               90
+#define __NR_munmap             91
+#define __NR_truncate           92
+#define __NR_ftruncate          93
+#define __NR_fchmod             94
+#define __NR_fchown             95
+#define __NR_getpriority        96
+#define __NR_setpriority        97
+#define __NR_profil             98
+#define __NR_statfs             99
+#define __NR_fstatfs           100
+#define __NR_ioperm            101
+#define __NR_socketcall                102     /* old implementation of socket systemcall */
+#define __NR_syslog            103
+#define __NR_setitimer         104
+#define __NR_getitimer         105
+#define __NR_stat              106
+#define __NR_lstat             107
+#define __NR_fstat             108
+#define __NR_olduname          109
+#define __NR_iopl              110
+#define __NR_vhangup           111
+#define __NR_idle              112
+#define __NR_vm86old           113
+#define __NR_wait4             114
+#define __NR_swapoff           115
+#define __NR_sysinfo           116
+#define __NR_ipc               117
+#define __NR_fsync             118
+#define __NR_sigreturn         119
+#define __NR_clone             120
+#define __NR_setdomainname     121
+#define __NR_uname             122
+#define __NR_modify_ldt                123
+#define __NR_adjtimex          124
+#define __NR_mprotect          125
+#define __NR_sigprocmask       126
+#define __NR_create_module     127
+#define __NR_init_module       128
+#define __NR_delete_module     129
+#define __NR_get_kernel_syms   130
+#define __NR_quotactl          131
+#define __NR_getpgid           132
+#define __NR_fchdir            133
+#define __NR_bdflush           134
+#define __NR_sysfs             135
+#define __NR_personality       136
+#define __NR_afs_syscall       137 /* Syscall for Andrew File System */
+#define __NR_setfsuid          138
+#define __NR_setfsgid          139
+#define __NR__llseek           140
+#define __NR_getdents          141
+#define __NR__newselect                142
+#define __NR_flock             143
+#define __NR_msync             144
+#define __NR_readv             145
+#define __NR_writev            146
+#define __NR_getsid            147
+#define __NR_fdatasync         148
+#define __NR__sysctl           149
+#define __NR_mlock             150
+#define __NR_munlock           151
+#define __NR_mlockall          152
+#define __NR_munlockall                153
+#define __NR_sched_setparam            154
+#define __NR_sched_getparam            155
+#define __NR_sched_setscheduler                156
+#define __NR_sched_getscheduler                157
+#define __NR_sched_yield               158
+#define __NR_sched_get_priority_max    159
+#define __NR_sched_get_priority_min    160
+#define __NR_sched_rr_get_interval     161
+#define __NR_nanosleep         162
+#define __NR_mremap            163
+#define __NR_setresuid         164
+#define __NR_getresuid         165
+#define __NR_vm86              166
+#define __NR_query_module      167
+#define __NR_poll              168
+#define __NR_nfsservctl                169
+#define __NR_setresgid         170
+#define __NR_getresgid         171
+#define __NR_prctl              172
+#define __NR_rt_sigreturn      173
+#define __NR_rt_sigaction      174
+#define __NR_rt_sigprocmask    175
+#define __NR_rt_sigpending     176
+#define __NR_rt_sigtimedwait   177
+#define __NR_rt_sigqueueinfo   178
+#define __NR_rt_sigsuspend     179
+#define __NR_pread64           180
+#define __NR_pwrite64          181
+#define __NR_chown             182
+#define __NR_getcwd            183
+#define __NR_capget            184
+#define __NR_capset            185
+#define __NR_sigaltstack       186
+#define __NR_sendfile          187
+#define __NR_streams1          188     /* some people actually want it */
+#define __NR_streams2          189     /* some people actually want it */
+#define __NR_vfork             190
+#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
+#define __NR_mmap2             192
+#define __NR_truncate64                193
+#define __NR_ftruncate64       194
+#define __NR_stat64            195
+#define __NR_lstat64           196
+#define __NR_fstat64           197
+#define __NR_lchown32          198
+#define __NR_getuid32          199
+#define __NR_getgid32          200
+#define __NR_geteuid32         201
+#define __NR_getegid32         202
+#define __NR_setreuid32                203
+#define __NR_setregid32                204
+#define __NR_getgroups32       205
+#define __NR_setgroups32       206
+#define __NR_fchown32          207
+#define __NR_setresuid32       208
+#define __NR_getresuid32       209
+#define __NR_setresgid32       210
+#define __NR_getresgid32       211
+#define __NR_chown32           212
+#define __NR_setuid32          213
+#define __NR_setgid32          214
+#define __NR_setfsuid32                215
+#define __NR_setfsgid32                216
+#define __NR_pivot_root                217
+#define __NR_mincore           218
+#define __NR_madvise           219
+
+/* Non-multiplexed socket family */
+#define __NR_socket            220
+#define __NR_bind              221
+#define __NR_connect           222
+#define __NR_listen            223
+#define __NR_accept            224
+#define __NR_getsockname       225
+#define __NR_getpeername       226
+#define __NR_socketpair                227
+#define __NR_send              228
+#define __NR_sendto            229
+#define __NR_recv              230
+#define __NR_recvfrom          231
+#define __NR_shutdown          232
+#define __NR_setsockopt                233
+#define __NR_getsockopt                234
+#define __NR_sendmsg           235
+#define __NR_recvmsg           236
+
+/* Non-multiplexed IPC family */
+#define __NR_semop             237
+#define __NR_semget            238
+#define __NR_semctl            239
+#define __NR_msgsnd            240
+#define __NR_msgrcv            241
+#define __NR_msgget            242
+#define __NR_msgctl            243
+#if 0
+#define __NR_shmatcall         244
+#endif
+#define __NR_shmdt             245
+#define __NR_shmget            246
+#define __NR_shmctl            247
+
+#define __NR_getdents64                248
+#define __NR_fcntl64           249
+/* 223 is unused */
+#define __NR_gettid            252
+#define __NR_readahead         253
+#define __NR_setxattr          254
+#define __NR_lsetxattr         255
+#define __NR_fsetxattr         256
+#define __NR_getxattr          257
+#define __NR_lgetxattr         258
+#define __NR_fgetxattr         269
+#define __NR_listxattr         260
+#define __NR_llistxattr                261
+#define __NR_flistxattr                262
+#define __NR_removexattr       263
+#define __NR_lremovexattr      264
+#define __NR_fremovexattr      265
+#define __NR_tkill             266
+#define __NR_sendfile64                267
+#define __NR_futex             268
+#define __NR_sched_setaffinity 269
+#define __NR_sched_getaffinity 270
+#define __NR_set_thread_area   271
+#define __NR_get_thread_area   272
+#define __NR_io_setup          273
+#define __NR_io_destroy                274
+#define __NR_io_getevents      275
+#define __NR_io_submit         276
+#define __NR_io_cancel         277
+#define __NR_fadvise64         278
+#define __NR_exit_group                280
+
+#define __NR_lookup_dcookie    281
+#define __NR_epoll_create      282
+#define __NR_epoll_ctl         283
+#define __NR_epoll_wait                284
+#define __NR_remap_file_pages  285
+#define __NR_set_tid_address   286
+#define __NR_timer_create      287
+#define __NR_timer_settime     (__NR_timer_create+1)
+#define __NR_timer_gettime     (__NR_timer_create+2)
+#define __NR_timer_getoverrun  (__NR_timer_create+3)
+#define __NR_timer_delete      (__NR_timer_create+4)
+#define __NR_clock_settime     (__NR_timer_create+5)
+#define __NR_clock_gettime     (__NR_timer_create+6)
+#define __NR_clock_getres      (__NR_timer_create+7)
+#define __NR_clock_nanosleep   (__NR_timer_create+8)
+#define __NR_statfs64          296
+#define __NR_fstatfs64         297
+#define __NR_tgkill            298
+#define __NR_utimes            299
+#define __NR_fadvise64_64      300
+#define __NR_vserver           301
+#define __NR_mbind              302
+#define __NR_get_mempolicy      303
+#define __NR_set_mempolicy      304
+#define __NR_mq_open            305
+#define __NR_mq_unlink          (__NR_mq_open+1)
+#define __NR_mq_timedsend       (__NR_mq_open+2)
+#define __NR_mq_timedreceive    (__NR_mq_open+3)
+#define __NR_mq_notify          (__NR_mq_open+4)
+#define __NR_mq_getsetattr      (__NR_mq_open+5)
+#define __NR_kexec_load                311
+#define __NR_waitid            312
+#define __NR_add_key           313
+#define __NR_request_key       314
+#define __NR_keyctl            315
+#define __NR_ioprio_set                316
+#define __NR_ioprio_get                317
+#define __NR_inotify_init      318
+#define __NR_inotify_add_watch 319
+#define __NR_inotify_rm_watch  320
+/* 321 is unused */
+#define __NR_migrate_pages     322
+#define __NR_openat            323
+#define __NR_mkdirat           324
+#define __NR_mknodat           325
+#define __NR_fchownat          326
+#define __NR_futimesat         327
+#define __NR_fstatat64         328
+#define __NR_unlinkat          329
+#define __NR_renameat          330
+#define __NR_linkat            331
+#define __NR_symlinkat         332
+#define __NR_readlinkat                333
+#define __NR_fchmodat          334
+#define __NR_faccessat         335
+#define __NR_pselect6          336
+#define __NR_ppoll             337
+#define __NR_unshare           338
+#define __NR_set_robust_list   339
+#define __NR_get_robust_list   340
+#define __NR_splice            341
+#define __NR_sync_file_range   342
+#define __NR_tee               343
+#define __NR_vmsplice          344
+#define __NR_move_pages                345
+#define __NR_getcpu            346
+#define __NR_epoll_pwait       347
+#define __NR_utimensat         348
+#define __NR_signalfd          349
+#define __NR_timerfd_create    350
+#define __NR_eventfd           351
+#define __NR_fallocate         352
+#define __NR_timerfd_settime   353
+#define __NR_timerfd_gettime   354
+#define __NR_signalfd4         355
+#define __NR_eventfd2          356
+#define __NR_epoll_create1     357
+#define __NR_dup3              358
+#define __NR_pipe2             359
+#define __NR_inotify_init1     360
+
+#ifdef __KERNEL__
+
+#define NR_syscalls 361
+
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+
+/*
+ * "Conditional" syscalls
+ *
+ * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
+ * but it doesn't work on all toolchains, so we just do it by hand
+ */
+#ifndef cond_syscall
+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_UNISTD_64_H */
diff --git a/arch/sh/include/asm/user.h b/arch/sh/include/asm/user.h
new file mode 100644 (file)
index 0000000..8fd3cf6
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef __ASM_SH_USER_H
+#define __ASM_SH_USER_H
+
+#include <asm/ptrace.h>
+#include <asm/page.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).  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.
+ */
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+struct user_fpu_struct {
+       unsigned long fp_regs[32];
+       unsigned int fpscr;
+};
+#else
+struct user_fpu_struct {
+       unsigned long fp_regs[16];
+       unsigned long xfp_regs[16];
+       unsigned long fpscr;
+       unsigned long fpul;
+};
+#endif
+
+struct user {
+       struct pt_regs  regs;                   /* entire machine state */
+       struct user_fpu_struct fpu;     /* Math Co-processor registers  */
+       int u_fpvalid;          /* True if math co-processor being used */
+       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 */
+       struct user_fpu_struct* u_fpstate;      /* Math Co-processor pointer */
+       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 /* __ASM_SH_USER_H */
diff --git a/arch/sh/include/asm/vga.h b/arch/sh/include/asm/vga.h
new file mode 100644 (file)
index 0000000..06a5de8
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_VGA_H
+#define __ASM_SH_VGA_H
+
+/* Stupid drivers. */
+
+#endif /* __ASM_SH_VGA_H */
diff --git a/arch/sh/include/asm/watchdog.h b/arch/sh/include/asm/watchdog.h
new file mode 100644 (file)
index 0000000..f024fed
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * include/asm-sh/watchdog.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_WATCHDOG_H
+#define __ASM_SH_WATCHDOG_H
+#ifdef __KERNEL__
+
+#include <linux/types.h>
+#include <cpu/watchdog.h>
+#include <asm/io.h>
+
+/* 
+ * See cpu-sh2/watchdog.h for explanation of this stupidity..
+ */
+#ifndef WTCNT_R
+#  define WTCNT_R      WTCNT
+#endif
+
+#ifndef WTCSR_R
+#  define WTCSR_R      WTCSR
+#endif
+
+#define WTCNT_HIGH     0x5a
+#define WTCSR_HIGH     0xa5
+
+#define WTCSR_CKS2     0x04
+#define WTCSR_CKS1     0x02
+#define WTCSR_CKS0     0x01
+
+/*
+ * CKS0-2 supports a number of clock division ratios. At the time the watchdog
+ * is enabled, it defaults to a 41 usec overflow period .. we overload this to
+ * something a little more reasonable, and really can't deal with anything
+ * lower than WTCSR_CKS_1024, else we drop back into the usec range.
+ *
+ * Clock Division Ratio         Overflow Period
+ * --------------------------------------------
+ *     1/32 (initial value)       41 usecs
+ *     1/64                       82 usecs
+ *     1/128                     164 usecs
+ *     1/256                     328 usecs
+ *     1/512                     656 usecs
+ *     1/1024                   1.31 msecs
+ *     1/2048                   2.62 msecs
+ *     1/4096                   5.25 msecs
+ */
+#define WTCSR_CKS_32   0x00
+#define WTCSR_CKS_64   0x01
+#define WTCSR_CKS_128  0x02
+#define WTCSR_CKS_256  0x03
+#define WTCSR_CKS_512  0x04
+#define WTCSR_CKS_1024 0x05
+#define WTCSR_CKS_2048 0x06
+#define WTCSR_CKS_4096 0x07
+
+/**
+ *     sh_wdt_read_cnt - Read from Counter
+ *     Reads back the WTCNT value.
+ */
+static inline __u8 sh_wdt_read_cnt(void)
+{
+       return ctrl_inb(WTCNT_R);
+}
+
+/**
+ *     sh_wdt_write_cnt - Write to Counter
+ *     @val: Value to write
+ *
+ *     Writes the given value @val to the lower byte of the timer counter.
+ *     The upper byte is set manually on each write.
+ */
+static inline void sh_wdt_write_cnt(__u8 val)
+{
+       ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, WTCNT);
+}
+
+/**
+ *     sh_wdt_read_csr - Read from Control/Status Register
+ *
+ *     Reads back the WTCSR value.
+ */
+static inline __u8 sh_wdt_read_csr(void)
+{
+       return ctrl_inb(WTCSR_R);
+}
+
+/**
+ *     sh_wdt_write_csr - Write to Control/Status Register
+ *     @val: Value to write
+ *
+ *     Writes the given value @val to the lower byte of the control/status
+ *     register. The upper byte is set manually on each write.
+ */
+static inline void sh_wdt_write_csr(__u8 val)
+{
+       ctrl_outw((WTCSR_HIGH << 8) | (__u16)val, WTCSR);
+}
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_WATCHDOG_H */
diff --git a/arch/sh/include/asm/xor.h b/arch/sh/include/asm/xor.h
new file mode 100644 (file)
index 0000000..c82eb12
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/xor.h>
diff --git a/arch/sh/include/cpu-common/cpu/addrspace.h b/arch/sh/include/cpu-common/cpu/addrspace.h
new file mode 100644 (file)
index 0000000..2b9ab93
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Definitions for the address spaces of the SH-2 CPUs.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_ADDRSPACE_H
+#define __ASM_CPU_SH2_ADDRSPACE_H
+
+#define P0SEG          0x00000000
+#define P1SEG          0x80000000
+#define P2SEG          0xa0000000
+#define P3SEG          0xc0000000
+#define P4SEG          0xe0000000
+
+#endif /* __ASM_CPU_SH2_ADDRSPACE_H */
diff --git a/arch/sh/include/cpu-common/cpu/cacheflush.h b/arch/sh/include/cpu-common/cpu/cacheflush.h
new file mode 100644 (file)
index 0000000..c3db00b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-sh/cpu-sh2/cacheflush.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_CACHEFLUSH_H
+#define __ASM_CPU_SH2_CACHEFLUSH_H
+
+/*
+ * Cache flushing:
+ *
+ *  - flush_cache_all() flushes entire cache
+ *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
+ *  - flush_cache_dup mm(mm) handles cache flushing when forking
+ *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
+ *  - flush_cache_range(vma, start, end) flushes a range of pages
+ *
+ *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
+ *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
+ *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
+ *
+ *  Caches are indexed (effectively) by physical address on SH-2, so
+ *  we don't need them.
+ */
+#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_icache_range(start, end)         do { } while (0)
+#define flush_icache_page(vma,pg)              do { } while (0)
+#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
+#define flush_cache_sigtramp(vaddr)            do { } while (0)
+
+#define p3_cache_init()                                do { } while (0)
+
+#endif /* __ASM_CPU_SH2_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-common/cpu/mmu_context.h b/arch/sh/include/cpu-common/cpu/mmu_context.h
new file mode 100644 (file)
index 0000000..beeb299
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * include/asm-sh/cpu-sh2/mmu_context.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_MMU_CONTEXT_H
+#define __ASM_CPU_SH2_MMU_CONTEXT_H
+
+/* No MMU */
+
+#endif /* __ASM_CPU_SH2_MMU_CONTEXT_H */
+
diff --git a/arch/sh/include/cpu-common/cpu/rtc.h b/arch/sh/include/cpu-common/cpu/rtc.h
new file mode 100644 (file)
index 0000000..39e2d6e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __ASM_SH_CPU_SH2_RTC_H
+#define __ASM_SH_CPU_SH2_RTC_H
+
+#define rtc_reg_size           sizeof(u16)
+#define RTC_BIT_INVERTED       0
+#define RTC_DEF_CAPABILITIES   0UL
+
+#endif /* __ASM_SH_CPU_SH2_RTC_H */
diff --git a/arch/sh/include/cpu-common/cpu/sigcontext.h b/arch/sh/include/cpu-common/cpu/sigcontext.h
new file mode 100644 (file)
index 0000000..fe5c15d
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __ASM_CPU_SH2_SIGCONTEXT_H
+#define __ASM_CPU_SH2_SIGCONTEXT_H
+
+struct sigcontext {
+       unsigned long   oldmask;
+
+       /* CPU registers */
+       unsigned long sc_regs[16];
+       unsigned long sc_pc;
+       unsigned long sc_pr;
+       unsigned long sc_sr;
+       unsigned long sc_gbr;
+       unsigned long sc_mach;
+       unsigned long sc_macl;
+};
+
+#endif /* __ASM_CPU_SH2_SIGCONTEXT_H */
diff --git a/arch/sh/include/cpu-common/cpu/timer.h b/arch/sh/include/cpu-common/cpu/timer.h
new file mode 100644 (file)
index 0000000..a39c241
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_CPU_SH2_TIMER_H
+#define __ASM_CPU_SH2_TIMER_H
+
+/* Nothing needed yet */
+
+#endif /* __ASM_CPU_SH2_TIMER_H */
diff --git a/arch/sh/include/cpu-sh2/cpu/cache.h b/arch/sh/include/cpu-sh2/cpu/cache.h
new file mode 100644 (file)
index 0000000..4e0b165
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * include/asm-sh/cpu-sh2/cache.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_CACHE_H
+#define __ASM_CPU_SH2_CACHE_H
+
+#define L1_CACHE_SHIFT 4
+
+#define SH_CACHE_VALID         1
+#define SH_CACHE_UPDATED       2
+#define SH_CACHE_COMBINED      4
+#define SH_CACHE_ASSOC         8
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7619)
+#define CCR            0xffffffec
+
+#define CCR_CACHE_CE   0x01    /* Cache enable */
+#define CCR_CACHE_WT   0x06    /* CCR[bit1=1,bit2=1] */
+                               /* 0x00000000-0x7fffffff: Write-through  */
+                               /* 0x80000000-0x9fffffff: Write-back     */
+                                /* 0xc0000000-0xdfffffff: Write-through  */
+#define CCR_CACHE_CB   0x00    /* CCR[bit1=0,bit2=0] */
+                               /* 0x00000000-0x7fffffff: Write-back     */
+                               /* 0x80000000-0x9fffffff: Write-through  */
+                                /* 0xc0000000-0xdfffffff: Write-back     */
+#define CCR_CACHE_CF   0x08    /* Cache invalidate */
+
+#define CACHE_OC_ADDRESS_ARRAY 0xf0000000
+#define CACHE_OC_DATA_ARRAY    0xf1000000
+
+#define CCR_CACHE_ENABLE       CCR_CACHE_CE
+#define CCR_CACHE_INVALIDATE   CCR_CACHE_CF
+#endif
+
+#endif /* __ASM_CPU_SH2_CACHE_H */
diff --git a/arch/sh/include/cpu-sh2/cpu/dma.h b/arch/sh/include/cpu-sh2/cpu/dma.h
new file mode 100644 (file)
index 0000000..d66b43c
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Definitions for the SH-2 DMAC.
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_DMA_H
+#define __ASM_CPU_SH2_DMA_H
+
+#define SH_MAX_DMA_CHANNELS    2
+
+#define SAR    ((unsigned long[]){ 0xffffff80, 0xffffff90 })
+#define DAR    ((unsigned long[]){ 0xffffff84, 0xffffff94 })
+#define DMATCR ((unsigned long[]){ 0xffffff88, 0xffffff98 })
+#define CHCR   ((unsigned long[]){ 0xfffffffc, 0xffffff9c })
+
+#define DMAOR  0xffffffb0
+
+#endif /* __ASM_CPU_SH2_DMA_H */
+
diff --git a/arch/sh/include/cpu-sh2/cpu/freq.h b/arch/sh/include/cpu-sh2/cpu/freq.h
new file mode 100644 (file)
index 0000000..31de475
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * include/asm-sh/cpu-sh2/freq.h
+ *
+ * Copyright (C) 2006  Yoshinori Sato
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_FREQ_H
+#define __ASM_CPU_SH2_FREQ_H
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7619)
+#define FREQCR 0xf815ff80
+#endif
+
+#endif /* __ASM_CPU_SH2_FREQ_H */
+
diff --git a/arch/sh/include/cpu-sh2/cpu/ubc.h b/arch/sh/include/cpu-sh2/cpu/ubc.h
new file mode 100644 (file)
index 0000000..ba0e87f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * include/asm-sh/cpu-sh2/ubc.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_UBC_H
+#define __ASM_CPU_SH2_UBC_H
+
+#define UBC_BARA                0xffffff40
+#define UBC_BAMRA               0xffffff44
+#define UBC_BBRA                0xffffff48
+#define UBC_BARB                0xffffff60
+#define UBC_BAMRB               0xffffff64
+#define UBC_BBRB                0xffffff68
+#define UBC_BDRB                0xffffff70
+#define UBC_BDMRB               0xffffff74
+#define UBC_BRCR                0xffffff78
+
+/*
+ * We don't have any ASID changes to make in the UBC on the SH-2.
+ *
+ * Make these purposely invalid to track misuse.
+ */
+#define UBC_BASRA              0x00000000
+#define UBC_BASRB              0x00000000
+
+#endif /* __ASM_CPU_SH2_UBC_H */
+
diff --git a/arch/sh/include/cpu-sh2/cpu/watchdog.h b/arch/sh/include/cpu-sh2/cpu/watchdog.h
new file mode 100644 (file)
index 0000000..393161c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * include/asm-sh/cpu-sh2/watchdog.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2_WATCHDOG_H
+#define __ASM_CPU_SH2_WATCHDOG_H
+
+/*
+ * More SH-2 brilliance .. its not good enough that we can't read
+ * and write the same sizes to WTCNT, now we have to read and write
+ * with different sizes at different addresses for WTCNT _and_ RSTCSR.
+ *
+ * At least on the bright side no one has managed to screw over WTCSR
+ * in this fashion .. yet.
+ */
+/* Register definitions */
+#define WTCNT          0xfffffe80
+#define WTCSR          0xfffffe80
+#define RSTCSR         0xfffffe82
+
+#define WTCNT_R                (WTCNT + 1)
+#define RSTCSR_R       (RSTCSR + 1)
+
+/* Bit definitions */
+#define WTCSR_IOVF     0x80
+#define WTCSR_WT       0x40
+#define WTCSR_TME      0x20
+#define WTCSR_RSTS     0x00
+
+#define RSTCSR_RSTS    0x20
+
+/**
+ *     sh_wdt_read_rstcsr - Read from Reset Control/Status Register
+ *
+ *     Reads back the RSTCSR value.
+ */
+static inline __u8 sh_wdt_read_rstcsr(void)
+{
+       /*
+        * Same read/write brain-damage as for WTCNT here..
+        */
+       return ctrl_inb(RSTCSR_R);
+}
+
+/**
+ *     sh_wdt_write_csr - Write to Reset Control/Status Register
+ *
+ *     @val: Value to write
+ *
+ *     Writes the given value @val to the lower byte of the control/status
+ *     register. The upper byte is set manually on each write.
+ */
+static inline void sh_wdt_write_rstcsr(__u8 val)
+{
+       /*
+        * Note: Due to the brain-damaged nature of this register,
+        * we can't presently touch the WOVF bit, since the upper byte
+        * has to be swapped for this. So just leave it alone..
+        */
+       ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, RSTCSR);
+}
+
+#endif /* __ASM_CPU_SH2_WATCHDOG_H */
+
diff --git a/arch/sh/include/cpu-sh2a/cpu/cache.h b/arch/sh/include/cpu-sh2a/cpu/cache.h
new file mode 100644 (file)
index 0000000..afe228b
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * include/asm-sh/cpu-sh2a/cache.h
+ *
+ * Copyright (C) 2004 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2A_CACHE_H
+#define __ASM_CPU_SH2A_CACHE_H
+
+#define L1_CACHE_SHIFT 4
+
+#define SH_CACHE_VALID         1
+#define SH_CACHE_UPDATED       2
+#define SH_CACHE_COMBINED      4
+#define SH_CACHE_ASSOC         8
+
+#define CCR            0xfffc1000 /* CCR1 */
+#define CCR2           0xfffc1004
+
+/*
+ * Most of the SH-2A CCR1 definitions resemble the SH-4 ones. All others not
+ * listed here are reserved.
+ */
+#define CCR_CACHE_CB   0x0000  /* Hack */
+#define CCR_CACHE_OCE  0x0001
+#define CCR_CACHE_WT   0x0002
+#define CCR_CACHE_OCI  0x0008  /* OCF */
+#define CCR_CACHE_ICE  0x0100
+#define CCR_CACHE_ICI  0x0800  /* ICF */
+
+#define CACHE_IC_ADDRESS_ARRAY 0xf0000000
+#define CACHE_OC_ADDRESS_ARRAY 0xf0800000
+
+#define CCR_CACHE_ENABLE       (CCR_CACHE_OCE | CCR_CACHE_ICE)
+#define CCR_CACHE_INVALIDATE   (CCR_CACHE_OCI | CCR_CACHE_ICI)
+
+#endif /* __ASM_CPU_SH2A_CACHE_H */
diff --git a/arch/sh/include/cpu-sh2a/cpu/dma.h b/arch/sh/include/cpu-sh2a/cpu/dma.h
new file mode 100644 (file)
index 0000000..27a13ef
--- /dev/null
@@ -0,0 +1 @@
+#include <cpu-sh2/cpu/dma.h>
diff --git a/arch/sh/include/cpu-sh2a/cpu/freq.h b/arch/sh/include/cpu-sh2a/cpu/freq.h
new file mode 100644 (file)
index 0000000..830fd43
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * include/asm-sh/cpu-sh2a/freq.h
+ *
+ * Copyright (C) 2006  Yoshinori Sato
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH2A_FREQ_H
+#define __ASM_CPU_SH2A_FREQ_H
+
+#define FREQCR 0xfffe0010
+
+#endif /* __ASM_CPU_SH2A_FREQ_H */
+
diff --git a/arch/sh/include/cpu-sh2a/cpu/rtc.h b/arch/sh/include/cpu-sh2a/cpu/rtc.h
new file mode 100644 (file)
index 0000000..afb511e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __ASM_SH_CPU_SH2A_RTC_H
+#define __ASM_SH_CPU_SH2A_RTC_H
+
+#define rtc_reg_size           sizeof(u16)
+#define RTC_BIT_INVERTED       0
+#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
+
+#endif /* __ASM_SH_CPU_SH2A_RTC_H */
diff --git a/arch/sh/include/cpu-sh2a/cpu/ubc.h b/arch/sh/include/cpu-sh2a/cpu/ubc.h
new file mode 100644 (file)
index 0000000..8ce2fc1
--- /dev/null
@@ -0,0 +1 @@
+#include <cpu-sh2/cpu/ubc.h>
diff --git a/arch/sh/include/cpu-sh2a/cpu/watchdog.h b/arch/sh/include/cpu-sh2a/cpu/watchdog.h
new file mode 100644 (file)
index 0000000..e7e8259
--- /dev/null
@@ -0,0 +1 @@
+#include <cpu-sh2/cpu/watchdog.h>
diff --git a/arch/sh/include/cpu-sh3/cpu/adc.h b/arch/sh/include/cpu-sh3/cpu/adc.h
new file mode 100644 (file)
index 0000000..b289e3c
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef __ASM_CPU_SH3_ADC_H
+#define __ASM_CPU_SH3_ADC_H
+
+/*
+ * Copyright (C) 2004  Andriy Skulysh
+ */
+
+
+#define ADDRAH 0xa4000080
+#define ADDRAL 0xa4000082
+#define ADDRBH 0xa4000084
+#define ADDRBL 0xa4000086
+#define ADDRCH 0xa4000088
+#define ADDRCL 0xa400008a
+#define ADDRDH 0xa400008c
+#define ADDRDL 0xa400008e
+#define ADCSR  0xa4000090
+
+#define ADCSR_ADF      0x80
+#define ADCSR_ADIE     0x40
+#define ADCSR_ADST     0x20
+#define ADCSR_MULTI    0x10
+#define ADCSR_CKS      0x08
+#define ADCSR_CH_MASK  0x07
+
+#define ADCR   0xa4000092
+
+#endif /* __ASM_CPU_SH3_ADC_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/cache.h b/arch/sh/include/cpu-sh3/cpu/cache.h
new file mode 100644 (file)
index 0000000..bee2d81
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * include/asm-sh/cpu-sh3/cache.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_CACHE_H
+#define __ASM_CPU_SH3_CACHE_H
+
+#define L1_CACHE_SHIFT 4
+
+#define SH_CACHE_VALID         1
+#define SH_CACHE_UPDATED       2
+#define SH_CACHE_COMBINED      4
+#define SH_CACHE_ASSOC         8
+
+#define CCR            0xffffffec      /* Address of Cache Control Register */
+
+#define CCR_CACHE_CE   0x01    /* Cache Enable */
+#define CCR_CACHE_WT   0x02    /* Write-Through (for P0,U0,P3) (else writeback) */
+#define CCR_CACHE_CB   0x04    /* Write-Back (for P1) (else writethrough) */
+#define CCR_CACHE_CF   0x08    /* Cache Flush */
+#define CCR_CACHE_ORA  0x20    /* RAM mode */
+
+#define CACHE_OC_ADDRESS_ARRAY 0xf0000000
+#define CACHE_PHYSADDR_MASK    0x1ffffc00
+
+#define CCR_CACHE_ENABLE       CCR_CACHE_CE
+#define CCR_CACHE_INVALIDATE   CCR_CACHE_CF
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7710) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define CCR3_REG       0xa40000b4
+#define CCR_CACHE_16KB  0x00010000
+#define CCR_CACHE_32KB 0x00020000
+#endif
+
+#endif /* __ASM_CPU_SH3_CACHE_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h
new file mode 100644 (file)
index 0000000..abc9098
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * include/asm-sh/cpu-sh3/cacheflush.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_CACHEFLUSH_H
+#define __ASM_CPU_SH3_CACHEFLUSH_H
+
+#if defined(CONFIG_SH7705_CACHE_32KB)
+/* SH7705 is an SH3 processor with 32KB cache. This has alias issues like the
+ * SH4. Unlike the SH4 this is a unified cache so we need to do some work
+ * in mmap when 'exec'ing a new binary
+ */
+ /* 32KB cache, 4kb PAGE sizes need to check bit 12 */
+#define CACHE_ALIAS 0x00001000
+
+#define PG_mapped      PG_arch_1
+
+void flush_cache_all(void);
+void flush_cache_mm(struct mm_struct *mm);
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
+void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
+                              unsigned long end);
+void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);
+void flush_dcache_page(struct page *pg);
+void flush_icache_range(unsigned long start, unsigned long end);
+void flush_icache_page(struct vm_area_struct *vma, struct page *page);
+#else
+#include <cpu-common/cpu/cacheflush.h>
+#endif
+
+#endif /* __ASM_CPU_SH3_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/dac.h b/arch/sh/include/cpu-sh3/cpu/dac.h
new file mode 100644 (file)
index 0000000..05fda83
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef __ASM_CPU_SH3_DAC_H
+#define __ASM_CPU_SH3_DAC_H
+
+/*
+ * Copyright (C) 2003  Andriy Skulysh
+ */
+
+
+#define DADR0  0xa40000a0
+#define DADR1  0xa40000a2
+#define DACR   0xa40000a4
+#define DACR_DAOE1     0x80
+#define DACR_DAOE0     0x40
+#define DACR_DAE       0x20
+
+
+static __inline__ void sh_dac_enable(int channel)
+{
+       unsigned char v;
+       v = ctrl_inb(DACR);
+       if(channel) v |= DACR_DAOE1;
+       else v |= DACR_DAOE0;
+       ctrl_outb(v,DACR);
+}
+
+static __inline__ void sh_dac_disable(int channel)
+{
+       unsigned char v;
+       v = ctrl_inb(DACR);
+       if(channel) v &= ~DACR_DAOE1;
+       else v &= ~DACR_DAOE0;
+       ctrl_outb(v,DACR);
+}
+
+static __inline__ void sh_dac_output(u8 value, int channel)
+{
+       if(channel) ctrl_outb(value,DADR1);
+       else ctrl_outb(value,DADR0);
+}
+
+#endif /* __ASM_CPU_SH3_DAC_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/dma.h b/arch/sh/include/cpu-sh3/cpu/dma.h
new file mode 100644 (file)
index 0000000..6813c32
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef __ASM_CPU_SH3_DMA_H
+#define __ASM_CPU_SH3_DMA_H
+
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define SH_DMAC_BASE   0xa4010020
+#else
+#define SH_DMAC_BASE   0xa4000020
+#endif
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#define DMTE0_IRQ      48
+#define DMTE1_IRQ      49
+#define DMTE2_IRQ      50
+#define DMTE3_IRQ      51
+#define DMTE4_IRQ      76
+#define DMTE5_IRQ      77
+#endif
+
+/* Definitions for the SuperH DMAC */
+#define TM_BURST       0x00000020
+#define TS_8           0x00000000
+#define TS_16          0x00000008
+#define TS_32          0x00000010
+#define TS_128         0x00000018
+
+#define CHCR_TS_MASK   0x18
+#define CHCR_TS_SHIFT  3
+
+#define DMAOR_INIT     DMAOR_DME
+
+/*
+ * The SuperH DMAC supports a number of transmit sizes, we list them here,
+ * with their respective values as they appear in the CHCR registers.
+ */
+enum {
+       XMIT_SZ_8BIT,
+       XMIT_SZ_16BIT,
+       XMIT_SZ_32BIT,
+       XMIT_SZ_128BIT,
+};
+
+static unsigned int ts_shift[] __maybe_unused = {
+       [XMIT_SZ_8BIT]          = 0,
+       [XMIT_SZ_16BIT]         = 1,
+       [XMIT_SZ_32BIT]         = 2,
+       [XMIT_SZ_128BIT]        = 4,
+};
+
+#endif /* __ASM_CPU_SH3_DMA_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/freq.h b/arch/sh/include/cpu-sh3/cpu/freq.h
new file mode 100644 (file)
index 0000000..53c6230
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * include/asm-sh/cpu-sh3/freq.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_FREQ_H
+#define __ASM_CPU_SH3_FREQ_H
+
+#ifdef CONFIG_CPU_SUBTYPE_SH7712
+#define FRQCR                  0xA415FF80
+#else
+#define FRQCR                  0xffffff80
+#endif
+
+#define MIN_DIVISOR_NR         0
+#define MAX_DIVISOR_NR         4
+
+#define FRQCR_CKOEN    0x0100
+#define FRQCR_PLLEN    0x0080
+#define FRQCR_PSTBY    0x0040
+
+#endif /* __ASM_CPU_SH3_FREQ_H */
+
diff --git a/arch/sh/include/cpu-sh3/cpu/gpio.h b/arch/sh/include/cpu-sh3/cpu/gpio.h
new file mode 100644 (file)
index 0000000..4e53eb3
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *  include/asm-sh/cpu-sh3/gpio.h
+ *
+ *  Copyright (C) 2007  Markus Brunner, Mark Jonas
+ *
+ *  Addresses for the Pin Function Controller
+ *
+ * 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.
+ */
+#ifndef _CPU_SH3_GPIO_H
+#define _CPU_SH3_GPIO_H
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+
+/* Control registers */
+#define PORT_PACR      0xA4050100UL
+#define PORT_PBCR      0xA4050102UL
+#define PORT_PCCR      0xA4050104UL
+#define PORT_PDCR      0xA4050106UL
+#define PORT_PECR      0xA4050108UL
+#define PORT_PFCR      0xA405010AUL
+#define PORT_PGCR      0xA405010CUL
+#define PORT_PHCR      0xA405010EUL
+#define PORT_PJCR      0xA4050110UL
+#define PORT_PKCR      0xA4050112UL
+#define PORT_PLCR      0xA4050114UL
+#define PORT_PMCR      0xA4050116UL
+#define PORT_PPCR      0xA4050118UL
+#define PORT_PRCR      0xA405011AUL
+#define PORT_PSCR      0xA405011CUL
+#define PORT_PTCR      0xA405011EUL
+#define PORT_PUCR      0xA4050120UL
+#define PORT_PVCR      0xA4050122UL
+
+/* Data registers */
+#define PORT_PADR      0xA4050140UL
+/* Address of PORT_PBDR is wrong in the datasheet, see errata 2005-09-21 */
+#define PORT_PBDR      0xA4050142UL
+#define PORT_PCDR      0xA4050144UL
+#define PORT_PDDR      0xA4050146UL
+#define PORT_PEDR      0xA4050148UL
+#define PORT_PFDR      0xA405014AUL
+#define PORT_PGDR      0xA405014CUL
+#define PORT_PHDR      0xA405014EUL
+#define PORT_PJDR      0xA4050150UL
+#define PORT_PKDR      0xA4050152UL
+#define PORT_PLDR      0xA4050154UL
+#define PORT_PMDR      0xA4050156UL
+#define PORT_PPDR      0xA4050158UL
+#define PORT_PRDR      0xA405015AUL
+#define PORT_PSDR      0xA405015CUL
+#define PORT_PTDR      0xA405015EUL
+#define PORT_PUDR      0xA4050160UL
+#define PORT_PVDR      0xA4050162UL
+
+/* Pin Select Registers */
+#define PORT_PSELA     0xA4050124UL
+#define PORT_PSELB     0xA4050126UL
+#define PORT_PSELC     0xA4050128UL
+#define PORT_PSELD     0xA405012AUL
+
+#endif
+
+#endif
diff --git a/arch/sh/include/cpu-sh3/cpu/mmu_context.h b/arch/sh/include/cpu-sh3/cpu/mmu_context.h
new file mode 100644 (file)
index 0000000..ab09da7
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-sh/cpu-sh3/mmu_context.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_MMU_CONTEXT_H
+#define __ASM_CPU_SH3_MMU_CONTEXT_H
+
+#define MMU_PTEH       0xFFFFFFF0      /* Page table entry register HIGH */
+#define MMU_PTEL       0xFFFFFFF4      /* Page table entry register LOW */
+#define MMU_TTB                0xFFFFFFF8      /* Translation table base register */
+#define MMU_TEA                0xFFFFFFFC      /* TLB Exception Address */
+
+#define MMUCR          0xFFFFFFE0      /* MMU Control Register */
+
+#define MMU_TLB_ADDRESS_ARRAY  0xF2000000
+#define MMU_PAGE_ASSOC_BIT     0x80
+
+#define MMU_NTLB_ENTRIES       128     /* for 7708 */
+#define MMU_NTLB_WAYS          4
+#define MMU_CONTROL_INIT       0x007   /* SV=0, TF=1, IX=1, AT=1 */
+
+#define TRA    0xffffffd0
+#define EXPEVT 0xffffffd4
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7706) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7707) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7710) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7712) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define INTEVT 0xa4000000      /* INTEVTE2(0xa4000000) */
+#else
+#define INTEVT 0xffffffd8
+#endif
+
+#endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */
+
diff --git a/arch/sh/include/cpu-sh3/cpu/timer.h b/arch/sh/include/cpu-sh3/cpu/timer.h
new file mode 100644 (file)
index 0000000..793acf1
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * include/asm-sh/cpu-sh3/timer.h
+ *
+ * Copyright (C) 2004 Lineo Solutions, Inc.
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_TIMER_H
+#define __ASM_CPU_SH3_TIMER_H
+
+/*
+ * ---------------------------------------------------------------------------
+ * TMU Common definitions for SH3 processors
+ *     SH7706
+ *     SH7709S
+ *     SH7727
+ *     SH7729R
+ *     SH7710
+ *     SH7720
+ *     SH7710
+ * ---------------------------------------------------------------------------
+ */
+
+#if  !defined(CONFIG_CPU_SUBTYPE_SH7720) && !defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define TMU_TOCR       0xfffffe90      /* Byte access */
+#endif
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define TMU_012_TSTR   0xa412fe92      /* Byte access */
+
+#define TMU0_TCOR      0xa412fe94      /* Long access */
+#define TMU0_TCNT      0xa412fe98      /* Long access */
+#define TMU0_TCR       0xa412fe9c      /* Word access */
+
+#define TMU1_TCOR      0xa412fea0      /* Long access */
+#define TMU1_TCNT      0xa412fea4      /* Long access */
+#define TMU1_TCR       0xa412fea8      /* Word access */
+
+#define TMU2_TCOR      0xa412feac      /* Long access */
+#define TMU2_TCNT      0xa412feb0      /* Long access */
+#define TMU2_TCR       0xa412feb4      /* Word access */
+
+#else
+#define TMU_012_TSTR   0xfffffe92      /* Byte access */
+
+#define TMU0_TCOR      0xfffffe94      /* Long access */
+#define TMU0_TCNT      0xfffffe98      /* Long access */
+#define TMU0_TCR       0xfffffe9c      /* Word access */
+
+#define TMU1_TCOR      0xfffffea0      /* Long access */
+#define TMU1_TCNT      0xfffffea4      /* Long access */
+#define TMU1_TCR       0xfffffea8      /* Word access */
+
+#define TMU2_TCOR      0xfffffeac      /* Long access */
+#define TMU2_TCNT      0xfffffeb0      /* Long access */
+#define TMU2_TCR       0xfffffeb4      /* Word access */
+#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && !defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define TMU2_TCPR2     0xfffffeb8      /* Long access */
+#endif
+#endif
+
+#endif /* __ASM_CPU_SH3_TIMER_H */
+
diff --git a/arch/sh/include/cpu-sh3/cpu/ubc.h b/arch/sh/include/cpu-sh3/cpu/ubc.h
new file mode 100644 (file)
index 0000000..4e6381d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * include/asm-sh/cpu-sh3/ubc.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_UBC_H
+#define __ASM_CPU_SH3_UBC_H
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721)
+#define UBC_BARA               0xa4ffffb0
+#define UBC_BAMRA              0xa4ffffb4
+#define UBC_BBRA               0xa4ffffb8
+#define UBC_BASRA              0xffffffe4
+#define UBC_BARB               0xa4ffffa0
+#define UBC_BAMRB              0xa4ffffa4
+#define UBC_BBRB               0xa4ffffa8
+#define UBC_BASRB              0xffffffe8
+#define UBC_BDRB               0xa4ffff90
+#define UBC_BDMRB              0xa4ffff94
+#define UBC_BRCR               0xa4ffff98
+#else
+#define UBC_BARA                0xffffffb0
+#define UBC_BAMRA               0xffffffb4
+#define UBC_BBRA                0xffffffb8
+#define UBC_BASRA               0xffffffe4
+#define UBC_BARB                0xffffffa0
+#define UBC_BAMRB               0xffffffa4
+#define UBC_BBRB                0xffffffa8
+#define UBC_BASRB               0xffffffe8
+#define UBC_BDRB                0xffffff90
+#define UBC_BDMRB               0xffffff94
+#define UBC_BRCR                0xffffff98
+#endif
+
+#endif /* __ASM_CPU_SH3_UBC_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/watchdog.h b/arch/sh/include/cpu-sh3/cpu/watchdog.h
new file mode 100644 (file)
index 0000000..4ee0347
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * include/asm-sh/cpu-sh3/watchdog.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH3_WATCHDOG_H
+#define __ASM_CPU_SH3_WATCHDOG_H
+
+/* Register definitions */
+#define WTCNT          0xffffff84
+#define WTCSR          0xffffff86
+
+/* Bit definitions */
+#define WTCSR_TME      0x80
+#define WTCSR_WT       0x40
+#define WTCSR_RSTS     0x20
+#define WTCSR_WOVF     0x10
+#define WTCSR_IOVF     0x08
+
+#endif /* __ASM_CPU_SH3_WATCHDOG_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/addrspace.h b/arch/sh/include/cpu-sh4/cpu/addrspace.h
new file mode 100644 (file)
index 0000000..a3fa733
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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) 1999 by Kaz Kojima
+ *
+ * Defitions for the address spaces of the SH-4 CPUs.
+ */
+#ifndef __ASM_CPU_SH4_ADDRSPACE_H
+#define __ASM_CPU_SH4_ADDRSPACE_H
+
+#define P0SEG          0x00000000
+#define P1SEG          0x80000000
+#define P2SEG          0xa0000000
+#define P3SEG          0xc0000000
+#define P4SEG          0xe0000000
+
+/* Detailed P4SEG  */
+#define P4SEG_STORE_QUE        (P4SEG)
+#define P4SEG_IC_ADDR  0xf0000000
+#define P4SEG_IC_DATA  0xf1000000
+#define P4SEG_ITLB_ADDR        0xf2000000
+#define P4SEG_ITLB_DATA        0xf3000000
+#define P4SEG_OC_ADDR  0xf4000000
+#define P4SEG_OC_DATA  0xf5000000
+#define P4SEG_TLB_ADDR 0xf6000000
+#define P4SEG_TLB_DATA 0xf7000000
+#define P4SEG_REG_BASE 0xff000000
+
+#define PA_AREA5_IO    0xb4000000      /* Area 5 IO Memory */
+#define PA_AREA6_IO    0xb8000000      /* Area 6 IO Memory */
+
+#endif /* __ASM_CPU_SH4_ADDRSPACE_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/cache.h b/arch/sh/include/cpu-sh4/cpu/cache.h
new file mode 100644 (file)
index 0000000..1c61ebf
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * include/asm-sh/cpu-sh4/cache.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_CACHE_H
+#define __ASM_CPU_SH4_CACHE_H
+
+#define L1_CACHE_SHIFT 5
+
+#define SH_CACHE_VALID         1
+#define SH_CACHE_UPDATED       2
+#define SH_CACHE_COMBINED      4
+#define SH_CACHE_ASSOC         8
+
+#define CCR            0xff00001c      /* Address of Cache Control Register */
+#define CCR_CACHE_OCE  0x0001  /* Operand Cache Enable */
+#define CCR_CACHE_WT   0x0002  /* Write-Through (for P0,U0,P3) (else writeback)*/
+#define CCR_CACHE_CB   0x0004  /* Copy-Back (for P1) (else writethrough) */
+#define CCR_CACHE_OCI  0x0008  /* OC Invalidate */
+#define CCR_CACHE_ORA  0x0020  /* OC RAM Mode */
+#define CCR_CACHE_OIX  0x0080  /* OC Index Enable */
+#define CCR_CACHE_ICE  0x0100  /* Instruction Cache Enable */
+#define CCR_CACHE_ICI  0x0800  /* IC Invalidate */
+#define CCR_CACHE_IIX  0x8000  /* IC Index Enable */
+#ifndef CONFIG_CPU_SH4A
+#define CCR_CACHE_EMODE        0x80000000      /* EMODE Enable */
+#endif
+
+/* Default CCR setup: 8k+16k-byte cache,P1-wb,enable */
+#define CCR_CACHE_ENABLE       (CCR_CACHE_OCE|CCR_CACHE_ICE)
+#define CCR_CACHE_INVALIDATE   (CCR_CACHE_OCI|CCR_CACHE_ICI)
+
+#define CACHE_IC_ADDRESS_ARRAY 0xf0000000
+#define CACHE_OC_ADDRESS_ARRAY 0xf4000000
+
+#endif /* __ASM_CPU_SH4_CACHE_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/cacheflush.h b/arch/sh/include/cpu-sh4/cpu/cacheflush.h
new file mode 100644 (file)
index 0000000..065306d
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * include/asm-sh/cpu-sh4/cacheflush.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_CACHEFLUSH_H
+#define __ASM_CPU_SH4_CACHEFLUSH_H
+
+/*
+ *  Caches are broken on SH-4 (unless we use write-through
+ *  caching; in which case they're only semi-broken),
+ *  so we need them.
+ */
+void flush_cache_all(void);
+void flush_dcache_all(void);
+void flush_cache_mm(struct mm_struct *mm);
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
+void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
+                      unsigned long end);
+void flush_cache_page(struct vm_area_struct *vma, unsigned long addr,
+                     unsigned long pfn);
+void flush_dcache_page(struct page *pg);
+
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+
+void flush_icache_range(unsigned long start, unsigned long end);
+void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
+                            unsigned long addr, int len);
+
+#define flush_icache_page(vma,pg)              do { } while (0)
+
+/* Initialization of P3 area for copy_user_page */
+void p3_cache_init(void);
+
+#define PG_mapped      PG_arch_1
+
+#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh7780.h b/arch/sh/include/cpu-sh4/cpu/dma-sh7780.h
new file mode 100644 (file)
index 0000000..71b426a
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
+#define __ASM_SH_CPU_SH4_DMA_SH7780_H
+
+#define REQ_HE 0x000000C0
+#define REQ_H  0x00000080
+#define REQ_LE 0x00000040
+#define TM_BURST 0x0000020
+#define TS_8   0x00000000
+#define TS_16  0x00000008
+#define TS_32  0x00000010
+#define TS_16BLK       0x00000018
+#define TS_32BLK       0x00100000
+
+/*
+ * The SuperH DMAC supports a number of transmit sizes, we list them here,
+ * with their respective values as they appear in the CHCR registers.
+ *
+ * Defaults to a 64-bit transfer size.
+ */
+enum {
+       XMIT_SZ_8BIT,
+       XMIT_SZ_16BIT,
+       XMIT_SZ_32BIT,
+       XMIT_SZ_128BIT,
+       XMIT_SZ_256BIT,
+};
+
+/*
+ * The DMA count is defined as the number of bytes to transfer.
+ */
+static unsigned int ts_shift[] __maybe_unused = {
+       [XMIT_SZ_8BIT]          = 0,
+       [XMIT_SZ_16BIT]         = 1,
+       [XMIT_SZ_32BIT]         = 2,
+       [XMIT_SZ_128BIT]        = 4,
+       [XMIT_SZ_256BIT]        = 5,
+};
+
+#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma.h b/arch/sh/include/cpu-sh4/cpu/dma.h
new file mode 100644 (file)
index 0000000..235b7cd
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef __ASM_CPU_SH4_DMA_H
+#define __ASM_CPU_SH4_DMA_H
+
+#define DMAOR_INIT     ( 0x8000 | DMAOR_DME )
+
+/* SH7751/7760/7780 DMA IRQ sources */
+#define DMTE0_IRQ      34
+#define DMTE1_IRQ      35
+#define DMTE2_IRQ      36
+#define DMTE3_IRQ      37
+#define DMTE4_IRQ      44
+#define DMTE5_IRQ      45
+#define DMTE6_IRQ      46
+#define DMTE7_IRQ      47
+#define DMAE_IRQ       38
+
+#ifdef CONFIG_CPU_SH4A
+#define SH_DMAC_BASE   0xfc808020
+
+#define CHCR_TS_MASK   0x18
+#define CHCR_TS_SHIFT  3
+
+#include <cpu/dma-sh7780.h>
+#else
+#define SH_DMAC_BASE   0xffa00000
+
+/* Definitions for the SuperH DMAC */
+#define TM_BURST       0x0000080
+#define TS_8           0x00000010
+#define TS_16          0x00000020
+#define TS_32          0x00000030
+#define TS_64          0x00000000
+
+#define CHCR_TS_MASK   0x70
+#define CHCR_TS_SHIFT  4
+
+#define DMAOR_COD      0x00000008
+
+/*
+ * The SuperH DMAC supports a number of transmit sizes, we list them here,
+ * with their respective values as they appear in the CHCR registers.
+ *
+ * Defaults to a 64-bit transfer size.
+ */
+enum {
+       XMIT_SZ_64BIT,
+       XMIT_SZ_8BIT,
+       XMIT_SZ_16BIT,
+       XMIT_SZ_32BIT,
+       XMIT_SZ_256BIT,
+};
+
+/*
+ * The DMA count is defined as the number of bytes to transfer.
+ */
+static unsigned int ts_shift[] __maybe_unused = {
+       [XMIT_SZ_64BIT]         = 3,
+       [XMIT_SZ_8BIT]          = 0,
+       [XMIT_SZ_16BIT]         = 1,
+       [XMIT_SZ_32BIT]         = 2,
+       [XMIT_SZ_256BIT]        = 5,
+};
+#endif
+
+#endif /* __ASM_CPU_SH4_DMA_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/fpu.h b/arch/sh/include/cpu-sh4/cpu/fpu.h
new file mode 100644 (file)
index 0000000..febef73
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * linux/arch/sh/kernel/cpu/sh4/sh4_fpu.h
+ *
+ * Copyright (C) 2006 STMicroelectronics Limited
+ * Author: Carl Shaw <carl.shaw@st.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License Version 2.  See linux/COPYING for more information.
+ *
+ * Definitions for SH4 FPU operations
+ */
+
+#ifndef __CPU_SH4_FPU_H
+#define __CPU_SH4_FPU_H
+
+#define FPSCR_ENABLE_MASK      0x00000f80UL
+
+#define FPSCR_FMOV_DOUBLE      (1<<1)
+
+#define FPSCR_CAUSE_INEXACT    (1<<12)
+#define FPSCR_CAUSE_UNDERFLOW  (1<<13)
+#define FPSCR_CAUSE_OVERFLOW   (1<<14)
+#define FPSCR_CAUSE_DIVZERO    (1<<15)
+#define FPSCR_CAUSE_INVALID    (1<<16)
+#define FPSCR_CAUSE_ERROR      (1<<17)
+
+#define FPSCR_DBL_PRECISION    (1<<19)
+#define FPSCR_ROUNDING_MODE(x) ((x >> 20) & 3)
+#define FPSCR_RM_NEAREST       (0)
+#define FPSCR_RM_ZERO          (1)
+
+#endif
diff --git a/arch/sh/include/cpu-sh4/cpu/freq.h b/arch/sh/include/cpu-sh4/cpu/freq.h
new file mode 100644 (file)
index 0000000..c23af81
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-sh/cpu-sh4/freq.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_FREQ_H
+#define __ASM_CPU_SH4_FREQ_H
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7722) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7723) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7343) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7366)
+#define FRQCR                  0xa4150000
+#define VCLKCR                 0xa4150004
+#define SCLKACR                        0xa4150008
+#define SCLKBCR                        0xa415000c
+#define IrDACLKCR              0xa4150010
+#define MSTPCR0                        0xa4150030
+#define MSTPCR1                        0xa4150034
+#define MSTPCR2                        0xa4150038
+#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7780)
+#define        FRQCR                   0xffc80000
+#elif defined(CONFIG_CPU_SUBTYPE_SH7785)
+#define FRQCR0                 0xffc80000
+#define FRQCR1                 0xffc80004
+#define FRQMR1                 0xffc80014
+#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
+#define FRQCR                  0xffc00014
+#else
+#define FRQCR                  0xffc00000
+#define FRQCR_PSTBY            0x0200
+#define FRQCR_PLLEN            0x0400
+#define FRQCR_CKOEN            0x0800
+#endif
+#define MIN_DIVISOR_NR         0
+#define MAX_DIVISOR_NR         3
+
+#endif /* __ASM_CPU_SH4_FREQ_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/mmu_context.h b/arch/sh/include/cpu-sh4/cpu/mmu_context.h
new file mode 100644 (file)
index 0000000..9ea8eb2
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * include/asm-sh/cpu-sh4/mmu_context.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_MMU_CONTEXT_H
+#define __ASM_CPU_SH4_MMU_CONTEXT_H
+
+#define MMU_PTEH       0xFF000000      /* Page table entry register HIGH */
+#define MMU_PTEL       0xFF000004      /* Page table entry register LOW */
+#define MMU_TTB                0xFF000008      /* Translation table base register */
+#define MMU_TEA                0xFF00000C      /* TLB Exception Address */
+#define MMU_PTEA       0xFF000034      /* Page table entry assistance register */
+
+#define MMUCR          0xFF000010      /* MMU Control Register */
+
+#define MMU_ITLB_ADDRESS_ARRAY 0xF2000000
+#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000
+#define MMU_PAGE_ASSOC_BIT     0x80
+
+#define MMUCR_TI               (1<<2)
+
+#ifdef CONFIG_X2TLB
+#define MMUCR_ME               (1 << 7)
+#else
+#define MMUCR_ME               (0)
+#endif
+
+#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
+#define MMUCR_SE               (1 << 4)
+#else
+#define MMUCR_SE               (0)
+#endif
+
+#ifdef CONFIG_SH_STORE_QUEUES
+#define MMUCR_SQMD             (1 << 9)
+#else
+#define MMUCR_SQMD             (0)
+#endif
+
+#define MMU_NTLB_ENTRIES       64
+#define MMU_CONTROL_INIT       (0x05|MMUCR_SQMD|MMUCR_ME|MMUCR_SE)
+
+#define MMU_ITLB_DATA_ARRAY    0xF3000000
+#define MMU_UTLB_DATA_ARRAY    0xF7000000
+
+#define MMU_UTLB_ENTRIES          64
+#define MMU_U_ENTRY_SHIFT          8
+#define MMU_UTLB_VALID         0x100
+#define MMU_ITLB_ENTRIES           4
+#define MMU_I_ENTRY_SHIFT          8
+#define MMU_ITLB_VALID         0x100
+
+#define TRA    0xff000020
+#define EXPEVT 0xff000024
+#define INTEVT 0xff000028
+
+#endif /* __ASM_CPU_SH4_MMU_CONTEXT_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/rtc.h b/arch/sh/include/cpu-sh4/cpu/rtc.h
new file mode 100644 (file)
index 0000000..25b1e6a
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_SH_CPU_SH4_RTC_H
+#define __ASM_SH_CPU_SH4_RTC_H
+
+#ifdef CONFIG_CPU_SUBTYPE_SH7723
+#define rtc_reg_size           sizeof(u16)
+#else
+#define rtc_reg_size           sizeof(u32)
+#endif
+
+#define RTC_BIT_INVERTED       0x40    /* bug on SH7750, SH7750S */
+#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
+
+#endif /* __ASM_SH_CPU_SH4_RTC_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/sigcontext.h b/arch/sh/include/cpu-sh4/cpu/sigcontext.h
new file mode 100644 (file)
index 0000000..ab392f1
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __ASM_CPU_SH4_SIGCONTEXT_H
+#define __ASM_CPU_SH4_SIGCONTEXT_H
+
+struct sigcontext {
+       unsigned long   oldmask;
+
+       /* CPU registers */
+       unsigned long sc_regs[16];
+       unsigned long sc_pc;
+       unsigned long sc_pr;
+       unsigned long sc_sr;
+       unsigned long sc_gbr;
+       unsigned long sc_mach;
+       unsigned long sc_macl;
+
+       /* FPU registers */
+       unsigned long sc_fpregs[16];
+       unsigned long sc_xfpregs[16];
+       unsigned int sc_fpscr;
+       unsigned int sc_fpul;
+       unsigned int sc_ownedfp;
+};
+
+#endif /* __ASM_CPU_SH4_SIGCONTEXT_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/sq.h b/arch/sh/include/cpu-sh4/cpu/sq.h
new file mode 100644 (file)
index 0000000..586d649
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * include/asm-sh/cpu-sh4/sq.h
+ *
+ * Copyright (C) 2001, 2002, 2003  Paul Mundt
+ * Copyright (C) 2001, 2002  M. R. Brown
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_SQ_H
+#define __ASM_CPU_SH4_SQ_H
+
+#include <asm/addrspace.h>
+
+/*
+ * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be
+ * mapped to any physical address space. Since data is written (and aligned)
+ * to 32-byte boundaries, we need to be sure that all allocations are aligned.
+ */
+#define SQ_SIZE                 32
+#define SQ_ALIGN_MASK           (~(SQ_SIZE - 1))
+#define SQ_ALIGN(addr)          (((addr)+SQ_SIZE-1) & SQ_ALIGN_MASK)
+
+#define SQ_QACR0               (P4SEG_REG_BASE  + 0x38)
+#define SQ_QACR1               (P4SEG_REG_BASE  + 0x3c)
+#define SQ_ADDRMAX              (P4SEG_STORE_QUE + 0x04000000)
+
+/* arch/sh/kernel/cpu/sh4/sq.c */
+unsigned long sq_remap(unsigned long phys, unsigned int size,
+                      const char *name, unsigned long flags);
+void sq_unmap(unsigned long vaddr);
+void sq_flush_range(unsigned long start, unsigned int len);
+
+#endif /* __ASM_CPU_SH4_SQ_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/timer.h b/arch/sh/include/cpu-sh4/cpu/timer.h
new file mode 100644 (file)
index 0000000..d1e796b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * include/asm-sh/cpu-sh4/timer.h
+ *
+ * Copyright (C) 2004 Lineo Solutions, Inc.
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_TIMER_H
+#define __ASM_CPU_SH4_TIMER_H
+
+/*
+ * ---------------------------------------------------------------------------
+ * TMU Common definitions for SH4 processors
+ *     SH7750S/SH7750R
+ *     SH7751/SH7751R
+ *     SH7760
+ *     SH-X3
+ * ---------------------------------------------------------------------------
+ */
+#ifdef CONFIG_CPU_SUBTYPE_SHX3
+#define TMU_012_BASE   0xffc10000
+#define TMU_345_BASE   0xffc20000
+#else
+#define TMU_012_BASE   0xffd80000
+#define TMU_345_BASE   0xfe100000
+#endif
+
+#define TMU_TOCR       TMU_012_BASE    /* Not supported on all CPUs */
+
+#define TMU_012_TSTR   (TMU_012_BASE + 0x04)
+#define TMU_345_TSTR   (TMU_345_BASE + 0x04)
+
+#define TMU0_TCOR      (TMU_012_BASE + 0x08)
+#define TMU0_TCNT      (TMU_012_BASE + 0x0c)
+#define TMU0_TCR       (TMU_012_BASE + 0x10)
+
+#define TMU1_TCOR       (TMU_012_BASE + 0x14)
+#define TMU1_TCNT       (TMU_012_BASE + 0x18)
+#define TMU1_TCR        (TMU_012_BASE + 0x1c)
+
+#define TMU2_TCOR       (TMU_012_BASE + 0x20)
+#define TMU2_TCNT       (TMU_012_BASE + 0x24)
+#define TMU2_TCR       (TMU_012_BASE + 0x28)
+#define TMU2_TCPR      (TMU_012_BASE + 0x2c)
+
+#define TMU3_TCOR      (TMU_345_BASE + 0x08)
+#define TMU3_TCNT      (TMU_345_BASE + 0x0c)
+#define TMU3_TCR       (TMU_345_BASE + 0x10)
+
+#define TMU4_TCOR      (TMU_345_BASE + 0x14)
+#define TMU4_TCNT      (TMU_345_BASE + 0x18)
+#define TMU4_TCR       (TMU_345_BASE + 0x1c)
+
+#define TMU5_TCOR      (TMU_345_BASE + 0x20)
+#define TMU5_TCNT      (TMU_345_BASE + 0x24)
+#define TMU5_TCR       (TMU_345_BASE + 0x28)
+
+#endif /* __ASM_CPU_SH4_TIMER_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/ubc.h b/arch/sh/include/cpu-sh4/cpu/ubc.h
new file mode 100644 (file)
index 0000000..c86e170
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * include/asm-sh/cpu-sh4/ubc.h
+ *
+ * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 2003 Paul Mundt
+ * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_UBC_H
+#define __ASM_CPU_SH4_UBC_H
+
+#if defined(CONFIG_CPU_SH4A)
+#define UBC_CBR0               0xff200000
+#define UBC_CRR0               0xff200004
+#define UBC_CAR0               0xff200008
+#define UBC_CAMR0              0xff20000c
+#define UBC_CBR1               0xff200020
+#define UBC_CRR1               0xff200024
+#define UBC_CAR1               0xff200028
+#define UBC_CAMR1              0xff20002c
+#define UBC_CDR1               0xff200030
+#define UBC_CDMR1              0xff200034
+#define UBC_CETR1              0xff200038
+#define UBC_CCMFR              0xff200600
+#define UBC_CBCR               0xff200620
+
+/* CBR */
+#define UBC_CBR_AIE            (0x01<<30)
+#define UBC_CBR_ID_INST                (0x01<<4)
+#define UBC_CBR_RW_READ                (0x01<<1)
+#define UBC_CBR_CE             (0x01)
+
+#define        UBC_CBR_AIV_MASK        (0x00FF0000)
+#define        UBC_CBR_AIV_SHIFT       (16)
+#define UBC_CBR_AIV_SET(asid)  (((asid)<<UBC_CBR_AIV_SHIFT) & UBC_CBR_AIV_MASK)
+
+#define UBC_CBR_INIT           0x20000000
+
+/* CRR */
+#define UBC_CRR_RES            (0x01<<13)
+#define UBC_CRR_PCB            (0x01<<1)
+#define UBC_CRR_BIE            (0x01)
+
+#define UBC_CRR_INIT           0x00002000
+
+#else  /* CONFIG_CPU_SH4 */
+#define UBC_BARA               0xff200000
+#define UBC_BAMRA              0xff200004
+#define UBC_BBRA               0xff200008
+#define UBC_BASRA              0xff000014
+#define UBC_BARB               0xff20000c
+#define UBC_BAMRB              0xff200010
+#define UBC_BBRB               0xff200014
+#define UBC_BASRB              0xff000018
+#define UBC_BDRB               0xff200018
+#define UBC_BDMRB              0xff20001c
+#define UBC_BRCR               0xff200020
+#endif /* CONFIG_CPU_SH4 */
+
+#endif /* __ASM_CPU_SH4_UBC_H */
+
diff --git a/arch/sh/include/cpu-sh4/cpu/watchdog.h b/arch/sh/include/cpu-sh4/cpu/watchdog.h
new file mode 100644 (file)
index 0000000..259f6a0
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * include/asm-sh/cpu-sh4/watchdog.h
+ *
+ * Copyright (C) 2002, 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_CPU_SH4_WATCHDOG_H
+#define __ASM_CPU_SH4_WATCHDOG_H
+
+/* Register definitions */
+#define WTCNT          0xffc00008
+#define WTCSR          0xffc0000c
+
+/* Bit definitions */
+#define WTCSR_TME      0x80
+#define WTCSR_WT       0x40
+#define WTCSR_RSTS     0x20
+#define WTCSR_WOVF     0x10
+#define WTCSR_IOVF     0x08
+
+#endif /* __ASM_CPU_SH4_WATCHDOG_H */
+
diff --git a/arch/sh/include/cpu-sh5/cpu/addrspace.h b/arch/sh/include/cpu-sh5/cpu/addrspace.h
new file mode 100644 (file)
index 0000000..dc36b9a
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_SH_CPU_SH5_ADDRSPACE_H
+#define __ASM_SH_CPU_SH5_ADDRSPACE_H
+
+#define        PHYS_PERIPHERAL_BLOCK   0x09000000
+#define PHYS_DMAC_BLOCK                0x0e000000
+#define PHYS_PCI_BLOCK         0x60000000
+#define PHYS_EMI_BLOCK         0xff000000
+
+/* No segmentation.. */
+
+#endif /* __ASM_SH_CPU_SH5_ADDRSPACE_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/cache.h b/arch/sh/include/cpu-sh5/cpu/cache.h
new file mode 100644 (file)
index 0000000..ed050ab
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef __ASM_SH_CPU_SH5_CACHE_H
+#define __ASM_SH_CPU_SH5_CACHE_H
+
+/*
+ * include/asm-sh/cpu-sh5/cache.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003, 2004  Paul Mundt
+ *
+ * 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.
+ */
+
+#define L1_CACHE_SHIFT         5
+
+/* Valid and Dirty bits */
+#define SH_CACHE_VALID         (1LL<<0)
+#define SH_CACHE_UPDATED       (1LL<<57)
+
+/* Unimplemented compat bits.. */
+#define SH_CACHE_COMBINED      0
+#define SH_CACHE_ASSOC         0
+
+/* Cache flags */
+#define SH_CACHE_MODE_WT       (1LL<<0)
+#define SH_CACHE_MODE_WB       (1LL<<1)
+
+/*
+ * Control Registers.
+ */
+#define ICCR_BASE      0x01600000      /* Instruction Cache Control Register */
+#define ICCR_REG0      0               /* Register 0 offset */
+#define ICCR_REG1      1               /* Register 1 offset */
+#define ICCR0          ICCR_BASE+ICCR_REG0
+#define ICCR1          ICCR_BASE+ICCR_REG1
+
+#define ICCR0_OFF      0x0             /* Set ICACHE off */
+#define ICCR0_ON       0x1             /* Set ICACHE on */
+#define ICCR0_ICI      0x2             /* Invalidate all in IC */
+
+#define ICCR1_NOLOCK   0x0             /* Set No Locking */
+
+#define OCCR_BASE      0x01E00000      /* Operand Cache Control Register */
+#define OCCR_REG0      0               /* Register 0 offset */
+#define OCCR_REG1      1               /* Register 1 offset */
+#define OCCR0          OCCR_BASE+OCCR_REG0
+#define OCCR1          OCCR_BASE+OCCR_REG1
+
+#define OCCR0_OFF      0x0             /* Set OCACHE off */
+#define OCCR0_ON       0x1             /* Set OCACHE on */
+#define OCCR0_OCI      0x2             /* Invalidate all in OC */
+#define OCCR0_WT       0x4             /* Set OCACHE in WT Mode */
+#define OCCR0_WB       0x0             /* Set OCACHE in WB Mode */
+
+#define OCCR1_NOLOCK   0x0             /* Set No Locking */
+
+/*
+ * SH-5
+ * A bit of description here, for neff=32.
+ *
+ *                               |<--- tag  (19 bits) --->|
+ * +-----------------------------+-----------------+------+----------+------+
+ * |                             |                 | ways |set index |offset|
+ * +-----------------------------+-----------------+------+----------+------+
+ *                                ^                 2 bits   8 bits   5 bits
+ *                                +- Bit 31
+ *
+ * Cacheline size is based on offset: 5 bits = 32 bytes per line
+ * A cache line is identified by a tag + set but OCACHETAG/ICACHETAG
+ * have a broader space for registers. These are outlined by
+ * CACHE_?C_*_STEP below.
+ *
+ */
+
+/* Instruction cache */
+#define CACHE_IC_ADDRESS_ARRAY 0x01000000
+
+/* Operand Cache */
+#define CACHE_OC_ADDRESS_ARRAY 0x01800000
+
+/* These declarations relate to cache 'synonyms' in the operand cache.  A
+   'synonym' occurs where effective address bits overlap between those used for
+   indexing the cache sets and those passed to the MMU for translation.  In the
+   case of SH5-101 & SH5-103, only bit 12 is affected for 4k pages. */
+
+#define CACHE_OC_N_SYNBITS  1               /* Number of synonym bits */
+#define CACHE_OC_SYN_SHIFT  12
+/* Mask to select synonym bit(s) */
+#define CACHE_OC_SYN_MASK   (((1UL<<CACHE_OC_N_SYNBITS)-1)<<CACHE_OC_SYN_SHIFT)
+
+/*
+ * Instruction cache can't be invalidated based on physical addresses.
+ * No Instruction Cache defines required, then.
+ */
+
+#endif /* __ASM_SH_CPU_SH5_CACHE_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/cacheflush.h b/arch/sh/include/cpu-sh5/cpu/cacheflush.h
new file mode 100644 (file)
index 0000000..5a11f0b
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __ASM_SH_CPU_SH5_CACHEFLUSH_H
+#define __ASM_SH_CPU_SH5_CACHEFLUSH_H
+
+#ifndef __ASSEMBLY__
+
+struct vm_area_struct;
+struct page;
+struct mm_struct;
+
+extern void flush_cache_all(void);
+extern void flush_cache_mm(struct mm_struct *mm);
+extern void flush_cache_sigtramp(unsigned long vaddr);
+extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
+                             unsigned long end);
+extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);
+extern void flush_dcache_page(struct page *pg);
+extern void flush_icache_range(unsigned long start, unsigned long end);
+extern void flush_icache_user_range(struct vm_area_struct *vma,
+                                   struct page *page, unsigned long addr,
+                                   int len);
+
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
+
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+
+#define flush_icache_page(vma, page)   do { } while (0)
+void p3_cache_init(void);
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_SH_CPU_SH5_CACHEFLUSH_H */
+
diff --git a/arch/sh/include/cpu-sh5/cpu/dma.h b/arch/sh/include/cpu-sh5/cpu/dma.h
new file mode 100644 (file)
index 0000000..7bf6bb3
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_SH_CPU_SH5_DMA_H
+#define __ASM_SH_CPU_SH5_DMA_H
+
+/* Nothing yet */
+
+#endif /* __ASM_SH_CPU_SH5_DMA_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/irq.h b/arch/sh/include/cpu-sh5/cpu/irq.h
new file mode 100644 (file)
index 0000000..f0f0756
--- /dev/null
@@ -0,0 +1,117 @@
+#ifndef __ASM_SH_CPU_SH5_IRQ_H
+#define __ASM_SH_CPU_SH5_IRQ_H
+
+/*
+ * include/asm-sh/cpu-sh5/irq.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ *
+ * 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.
+ */
+
+
+/*
+ * Encoded IRQs are not considered worth to be supported.
+ * Main reason is that there's no per-encoded-interrupt
+ * enable/disable mechanism (as there was in SH3/4).
+ * An all enabled/all disabled is worth only if there's
+ * a cascaded IC to disable/enable/ack on. Until such
+ * IC is available there's no such support.
+ *
+ * Presumably Encoded IRQs may use extra IRQs beyond 64,
+ * below. Some logic must be added to cope with IRQ_IRL?
+ * in an exclusive way.
+ *
+ * Priorities are set at Platform level, when IRQ_IRL0-3
+ * are set to 0 Encoding is allowed. Otherwise it's not
+ * allowed.
+ */
+
+/* Independent IRQs */
+#define IRQ_IRL0       0
+#define IRQ_IRL1       1
+#define IRQ_IRL2       2
+#define IRQ_IRL3       3
+
+#define IRQ_INTA       4
+#define IRQ_INTB       5
+#define IRQ_INTC       6
+#define IRQ_INTD       7
+
+#define IRQ_SERR       12
+#define IRQ_ERR                13
+#define IRQ_PWR3       14
+#define IRQ_PWR2       15
+#define IRQ_PWR1       16
+#define IRQ_PWR0       17
+
+#define IRQ_DMTE0      18
+#define IRQ_DMTE1      19
+#define IRQ_DMTE2      20
+#define IRQ_DMTE3      21
+#define IRQ_DAERR      22
+
+#define IRQ_TUNI0      32
+#define IRQ_TUNI1      33
+#define IRQ_TUNI2      34
+#define IRQ_TICPI2     35
+
+#define IRQ_ATI                36
+#define IRQ_PRI                37
+#define IRQ_CUI                38
+
+#define IRQ_ERI                39
+#define IRQ_RXI                40
+#define IRQ_BRI                41
+#define IRQ_TXI                42
+
+#define IRQ_ITI                63
+
+#define NR_INTC_IRQS   64
+
+#ifdef CONFIG_SH_CAYMAN
+#define NR_EXT_IRQS     32
+#define START_EXT_IRQS  64
+
+/* PCI bus 2 uses encoded external interrupts on the Cayman board */
+#define IRQ_P2INTA      (START_EXT_IRQS + (3*8) + 0)
+#define IRQ_P2INTB      (START_EXT_IRQS + (3*8) + 1)
+#define IRQ_P2INTC      (START_EXT_IRQS + (3*8) + 2)
+#define IRQ_P2INTD      (START_EXT_IRQS + (3*8) + 3)
+
+#define I8042_KBD_IRQ  (START_EXT_IRQS + 2)
+#define I8042_AUX_IRQ  (START_EXT_IRQS + 6)
+
+#define IRQ_CFCARD     (START_EXT_IRQS + 7)
+#define IRQ_PCMCIA     (0)
+
+#else
+#define NR_EXT_IRQS    0
+#endif
+
+/* Default IRQs, fixed */
+#define TIMER_IRQ      IRQ_TUNI0
+#define RTC_IRQ                IRQ_CUI
+
+/* Default Priorities, Platform may choose differently */
+#define        NO_PRIORITY     0       /* Disabled */
+#define TIMER_PRIORITY 2
+#define RTC_PRIORITY   TIMER_PRIORITY
+#define SCIF_PRIORITY  3
+#define INTD_PRIORITY  3
+#define        IRL3_PRIORITY   4
+#define INTC_PRIORITY  6
+#define        IRL2_PRIORITY   7
+#define INTB_PRIORITY  9
+#define        IRL1_PRIORITY   10
+#define INTA_PRIORITY  12
+#define        IRL0_PRIORITY   13
+#define TOP_PRIORITY   15
+
+extern int intc_evt_to_irq[(0xE20/0x20)+1];
+int intc_irq_describe(char* p, int irq);
+extern int platform_int_priority[NR_INTC_IRQS];
+
+#endif /* __ASM_SH_CPU_SH5_IRQ_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/mmu_context.h b/arch/sh/include/cpu-sh5/cpu/mmu_context.h
new file mode 100644 (file)
index 0000000..68a1d2c
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __ASM_SH_CPU_SH5_MMU_CONTEXT_H
+#define __ASM_SH_CPU_SH5_MMU_CONTEXT_H
+
+/* Common defines */
+#define TLB_STEP       0x00000010
+#define TLB_PTEH       0x00000000
+#define TLB_PTEL       0x00000008
+
+/* PTEH defines */
+#define PTEH_ASID_SHIFT        2
+#define PTEH_VALID     0x0000000000000001
+#define PTEH_SHARED    0x0000000000000002
+#define PTEH_MATCH_ASID        0x00000000000003ff
+
+#ifndef __ASSEMBLY__
+/* This has to be a common function because the next location to fill
+ * information is shared. */
+extern void __do_tlb_refill(unsigned long address, unsigned long long is_text_not_data, pte_t *pte);
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_SH_CPU_SH5_MMU_CONTEXT_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/registers.h b/arch/sh/include/cpu-sh5/cpu/registers.h
new file mode 100644 (file)
index 0000000..6664ea6
--- /dev/null
@@ -0,0 +1,106 @@
+#ifndef __ASM_SH_CPU_SH5_REGISTERS_H
+#define __ASM_SH_CPU_SH5_REGISTERS_H
+
+/*
+ * include/asm-sh/cpu-sh5/registers.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2004  Richard Curnow
+ *
+ * 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.
+ */
+
+#ifdef __ASSEMBLY__
+/* =====================================================================
+**
+** Section 1: acts on assembly sources pre-processed by GPP ( <source.S>).
+**           Assigns symbolic names to control & target registers.
+*/
+
+/*
+ * Define some useful aliases for control registers.
+ */
+#define SR     cr0
+#define SSR    cr1
+#define PSSR   cr2
+                       /* cr3 UNDEFINED */
+#define INTEVT cr4
+#define EXPEVT cr5
+#define PEXPEVT        cr6
+#define TRA    cr7
+#define SPC    cr8
+#define PSPC   cr9
+#define RESVEC cr10
+#define VBR    cr11
+                       /* cr12 UNDEFINED */
+#define TEA    cr13
+                       /* cr14-cr15 UNDEFINED */
+#define DCR    cr16
+#define KCR0   cr17
+#define KCR1   cr18
+                       /* cr19-cr31 UNDEFINED */
+                       /* cr32-cr61 RESERVED */
+#define CTC    cr62
+#define USR    cr63
+
+/*
+ * ABI dependent registers (general purpose set)
+ */
+#define RET    r2
+#define ARG1   r2
+#define ARG2   r3
+#define ARG3   r4
+#define ARG4   r5
+#define ARG5   r6
+#define ARG6   r7
+#define SP     r15
+#define LINK   r18
+#define ZERO   r63
+
+/*
+ * Status register defines: used only by assembly sources (and
+ *                         syntax independednt)
+ */
+#define SR_RESET_VAL   0x0000000050008000
+#define SR_HARMLESS    0x00000000500080f0      /* Write ignores for most */
+#define SR_ENABLE_FPU  0xffffffffffff7fff      /* AND with this */
+
+#if defined (CONFIG_SH64_SR_WATCH)
+#define SR_ENABLE_MMU  0x0000000084000000      /* OR with this */
+#else
+#define SR_ENABLE_MMU  0x0000000080000000      /* OR with this */
+#endif
+
+#define SR_UNBLOCK_EXC 0xffffffffefffffff      /* AND with this */
+#define SR_BLOCK_EXC   0x0000000010000000      /* OR with this */
+
+#else  /* Not __ASSEMBLY__ syntax */
+
+/*
+** Stringify reg. name
+*/
+#define __str(x)  #x
+
+/* Stringify control register names for use in inline assembly */
+#define __SR __str(SR)
+#define __SSR __str(SSR)
+#define __PSSR __str(PSSR)
+#define __INTEVT __str(INTEVT)
+#define __EXPEVT __str(EXPEVT)
+#define __PEXPEVT __str(PEXPEVT)
+#define __TRA __str(TRA)
+#define __SPC __str(SPC)
+#define __PSPC __str(PSPC)
+#define __RESVEC __str(RESVEC)
+#define __VBR __str(VBR)
+#define __TEA __str(TEA)
+#define __DCR __str(DCR)
+#define __KCR0 __str(KCR0)
+#define __KCR1 __str(KCR1)
+#define __CTC __str(CTC)
+#define __USR __str(USR)
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_SH_CPU_SH5_REGISTERS_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/rtc.h b/arch/sh/include/cpu-sh5/cpu/rtc.h
new file mode 100644 (file)
index 0000000..12ea0ed
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __ASM_SH_CPU_SH5_RTC_H
+#define __ASM_SH_CPU_SH5_RTC_H
+
+#define rtc_reg_size           sizeof(u32)
+#define RTC_BIT_INVERTED       0       /* The SH-5 RTC is surprisingly sane! */
+#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
+
+#endif /* __ASM_SH_CPU_SH5_RTC_H */
diff --git a/arch/sh/include/mach-dreamcast/mach/dma.h b/arch/sh/include/mach-dreamcast/mach/dma.h
new file mode 100644 (file)
index 0000000..ddd68e7
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * include/asm-sh/dreamcast/dma.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_DREAMCAST_DMA_H
+#define __ASM_SH_DREAMCAST_DMA_H
+
+/* Number of DMA channels */
+#define ONCHIP_NR_DMA_CHANNELS 4
+#define G2_NR_DMA_CHANNELS     4
+#define PVR2_NR_DMA_CHANNELS   1
+
+/* Channels for cascading */
+#define PVR2_CASCADE_CHAN      2
+#define G2_CASCADE_CHAN                3
+
+/* PVR2 DMA Registers */
+#define PVR2_DMA_BASE          0xa05f6800
+#define PVR2_DMA_ADDR          (PVR2_DMA_BASE + 0)
+#define PVR2_DMA_COUNT         (PVR2_DMA_BASE + 4)
+#define PVR2_DMA_MODE          (PVR2_DMA_BASE + 8)
+#define PVR2_DMA_LMMODE0       (PVR2_DMA_BASE + 132)
+#define PVR2_DMA_LMMODE1       (PVR2_DMA_BASE + 136)
+
+/* G2 DMA Register */
+#define G2_DMA_BASE            0xa05f7800
+
+#endif /* __ASM_SH_DREAMCAST_DMA_H */
+
diff --git a/arch/sh/include/mach-dreamcast/mach/maple.h b/arch/sh/include/mach-dreamcast/mach/maple.h
new file mode 100644 (file)
index 0000000..51f6a87
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __ASM_MAPLE_H
+#define __ASM_MAPLE_H
+
+#define MAPLE_PORTS 4
+#define MAPLE_PNP_INTERVAL HZ
+#define MAPLE_MAXPACKETS 8
+#define MAPLE_DMA_ORDER 14
+#define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER)
+#define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \
+                         MAPLE_DMA_ORDER - PAGE_SHIFT : 0)
+
+/* Maple Bus registers */
+#define MAPLE_BASE     0xa05f6c00
+#define MAPLE_DMAADDR  (MAPLE_BASE+0x04)
+#define MAPLE_TRIGTYPE (MAPLE_BASE+0x10)
+#define MAPLE_ENABLE   (MAPLE_BASE+0x14)
+#define MAPLE_STATE    (MAPLE_BASE+0x18)
+#define MAPLE_SPEED    (MAPLE_BASE+0x80)
+#define MAPLE_RESET    (MAPLE_BASE+0x8c)
+
+#define MAPLE_MAGIC    0x6155404f
+#define MAPLE_2MBPS    0
+#define MAPLE_TIMEOUT(n) ((n)<<15)
+
+/* Function codes */
+#define MAPLE_FUNC_CONTROLLER 0x001
+#define MAPLE_FUNC_MEMCARD    0x002
+#define MAPLE_FUNC_LCD        0x004
+#define MAPLE_FUNC_CLOCK      0x008
+#define MAPLE_FUNC_MICROPHONE 0x010
+#define MAPLE_FUNC_ARGUN      0x020
+#define MAPLE_FUNC_KEYBOARD   0x040
+#define MAPLE_FUNC_LIGHTGUN   0x080
+#define MAPLE_FUNC_PURUPURU   0x100
+#define MAPLE_FUNC_MOUSE      0x200
+
+#endif /* __ASM_MAPLE_H */
diff --git a/arch/sh/include/mach-dreamcast/mach/pci.h b/arch/sh/include/mach-dreamcast/mach/pci.h
new file mode 100644 (file)
index 0000000..75fc900
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * include/asm-sh/dreamcast/pci.h
+ *
+ * Copyright (C) 2001, 2002  M. R. Brown
+ * Copyright (C) 2002, 2003  Paul Mundt
+ *
+ * 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.
+ */
+#ifndef __ASM_SH_DREAMCAST_PCI_H
+#define __ASM_SH_DREAMCAST_PCI_H
+
+#include <mach-dreamcast/mach/sysasic.h>
+
+#define        GAPSPCI_REGS            0x01001400
+#define GAPSPCI_DMA_BASE       0x01840000
+#define GAPSPCI_DMA_SIZE       32768
+#define GAPSPCI_BBA_CONFIG     0x01001600
+#define GAPSPCI_BBA_CONFIG_SIZE        0x2000
+
+#define        GAPSPCI_IRQ             HW_EVENT_EXTERNAL
+
+#endif /* __ASM_SH_DREAMCAST_PCI_H */
+
diff --git a/arch/sh/include/mach-dreamcast/mach/sysasic.h b/arch/sh/include/mach-dreamcast/mach/sysasic.h
new file mode 100644 (file)
index 0000000..f334266
--- /dev/null
@@ -0,0 +1,43 @@
+/* include/asm-sh/dreamcast/sysasic.h
+ *
+ * Definitions for the Dreamcast System ASIC and related peripherals.
+ *
+ * Copyright (c) 2001 M. R. Brown <mrbrown@linuxdc.org>
+ * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
+ *
+ * This file is part of the LinuxDC project (www.linuxdc.org)
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ */
+#ifndef __ASM_SH_DREAMCAST_SYSASIC_H
+#define __ASM_SH_DREAMCAST_SYSASIC_H
+
+#include <asm/irq.h>
+
+/* Hardware events -
+
+   Each of these events correspond to a bit within the Event Mask Registers/
+   Event Status Registers.  Because of the virtual IRQ numbering scheme, a
+   base offset must be used when calculating the virtual IRQ that each event
+   takes.
+*/
+
+#define HW_EVENT_IRQ_BASE  48
+
+/* IRQ 13 */
+#define HW_EVENT_VSYNC     (HW_EVENT_IRQ_BASE +  5) /* VSync */
+#define HW_EVENT_MAPLE_DMA (HW_EVENT_IRQ_BASE + 12) /* Maple DMA complete */
+#define HW_EVENT_GDROM_DMA (HW_EVENT_IRQ_BASE + 14) /* GD-ROM DMA complete */
+#define HW_EVENT_G2_DMA    (HW_EVENT_IRQ_BASE + 15) /* G2 DMA complete */
+#define HW_EVENT_PVR2_DMA  (HW_EVENT_IRQ_BASE + 19) /* PVR2 DMA complete */
+
+/* IRQ 11 */
+#define HW_EVENT_GDROM_CMD (HW_EVENT_IRQ_BASE + 32) /* GD-ROM cmd. complete */
+#define HW_EVENT_AICA_SYS  (HW_EVENT_IRQ_BASE + 33) /* AICA-related */
+#define HW_EVENT_EXTERNAL  (HW_EVENT_IRQ_BASE + 35) /* Ext. (expansion) */
+
+#define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95)
+
+#endif /* __ASM_SH_DREAMCAST_SYSASIC_H */
+
diff --git a/arch/sh/include/mach-landisk/mach/gio.h b/arch/sh/include/mach-landisk/mach/gio.h
new file mode 100644 (file)
index 0000000..35d7368
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __ASM_SH_LANDISK_GIO_H
+#define __ASM_SH_LANDISK_GIO_H
+
+#include <linux/ioctl.h>
+
+/* version */
+#define VERSION_STR    "1.00"
+
+/* Driver name */
+#define GIO_DRIVER_NAME                "/dev/giodrv"
+
+/* Use 'k' as magic number */
+#define GIODRV_IOC_MAGIC  'k'
+
+#define GIODRV_IOCRESET    _IO(GIODRV_IOC_MAGIC, 0)
+/*
+ * S means "Set" through a ptr,
+ * T means "Tell" directly
+ * G means "Get" (to a pointed var)
+ * Q means "Query", response is on the return value
+ * X means "eXchange": G and S atomically
+ * H means "sHift": T and Q atomically
+ */
+#define GIODRV_IOCSGIODATA1   _IOW(GIODRV_IOC_MAGIC,  1, unsigned char *)
+#define GIODRV_IOCGGIODATA1   _IOR(GIODRV_IOC_MAGIC,  2, unsigned char *)
+#define GIODRV_IOCSGIODATA2   _IOW(GIODRV_IOC_MAGIC,  3, unsigned short *)
+#define GIODRV_IOCGGIODATA2   _IOR(GIODRV_IOC_MAGIC,  4, unsigned short *)
+#define GIODRV_IOCSGIODATA4   _IOW(GIODRV_IOC_MAGIC,  5, unsigned long *)
+#define GIODRV_IOCGGIODATA4   _IOR(GIODRV_IOC_MAGIC,  6, unsigned long *)
+#define GIODRV_IOCSGIOSETADDR _IOW(GIODRV_IOC_MAGIC,  7, unsigned long *)
+#define GIODRV_IOCHARDRESET   _IO(GIODRV_IOC_MAGIC, 8) /* debugging tool */
+#define GIODRV_IOC_MAXNR 8
+
+#define GIO_READ 0x00000000
+#define GIO_WRITE 0x00000001
+
+#endif /* __ASM_SH_LANDISK_GIO_H  */
diff --git a/arch/sh/include/mach-landisk/mach/iodata_landisk.h b/arch/sh/include/mach-landisk/mach/iodata_landisk.h
new file mode 100644 (file)
index 0000000..6fb04ab
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __ASM_SH_IODATA_LANDISK_H
+#define __ASM_SH_IODATA_LANDISK_H
+
+/*
+ * linux/include/asm-sh/landisk/iodata_landisk.h
+ *
+ * Copyright (C) 2000  Atom Create Engineering Co., Ltd.
+ *
+ * IO-DATA LANDISK support
+ */
+
+/* Box specific addresses.  */
+
+#define PA_USB         0xa4000000      /* USB Controller M66590 */
+
+#define PA_ATARST      0xb0000000      /* ATA/FATA Access Control Register */
+#define PA_LED         0xb0000001      /* LED Control Register */
+#define PA_STATUS      0xb0000002      /* Switch Status Register */
+#define PA_SHUTDOWN    0xb0000003      /* Shutdown Control Register */
+#define PA_PCIPME      0xb0000004      /* PCI PME Status Register */
+#define PA_IMASK       0xb0000005      /* Interrupt Mask Register */
+/* 2003.10.31 I-O DATA NSD NWG add.    for shutdown port clear */
+#define PA_PWRINT_CLR  0xb0000006      /* Shutdown Interrupt clear Register */
+
+#define PA_PIDE_OFFSET 0x40            /* CF IDE Offset */
+#define PA_SIDE_OFFSET 0x40            /* HDD IDE Offset */
+
+#define IRQ_PCIINTA    5               /* PCI INTA IRQ */
+#define IRQ_PCIINTB    6               /* PCI INTB IRQ */
+#define IRQ_PCIINDC    7               /* PCI INTC IRQ */
+#define IRQ_PCIINTD    8               /* PCI INTD IRQ */
+#define IRQ_ATA                9               /* ATA IRQ */
+#define IRQ_FATA       10              /* FATA IRQ */
+#define IRQ_POWER      11              /* Power Switch IRQ */
+#define IRQ_BUTTON     12              /* USL-5P Button IRQ */
+#define IRQ_FAULT      13              /* USL-5P Fault  IRQ */
+
+#define __IO_PREFIX landisk
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_IODATA_LANDISK_H */
+
diff --git a/arch/sh/include/mach-se/mach/se.h b/arch/sh/include/mach-se/mach/se.h
new file mode 100644 (file)
index 0000000..eb23000
--- /dev/null
@@ -0,0 +1,99 @@
+#ifndef __ASM_SH_HITACHI_SE_H
+#define __ASM_SH_HITACHI_SE_H
+
+/*
+ * linux/include/asm-sh/hitachi_se.h
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine support
+ */
+
+/* Box specific addresses.  */
+
+#define PA_ROM         0x00000000      /* EPROM */
+#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
+#define PA_FROM                0x01000000      /* EPROM */
+#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
+#define PA_EXT1                0x04000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_EXT2                0x08000000
+#define PA_EXT2_SIZE   0x04000000
+#define PA_SDRAM       0x0c000000
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0x12000000
+#define PA_EXT4_SIZE   0x02000000
+#define PA_EXT5                0x14000000
+#define PA_EXT5_SIZE   0x04000000
+#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
+
+#define PA_83902       0xb0000000      /* DP83902A */
+#define PA_83902_IF    0xb0040000      /* DP83902A remote io port */
+#define PA_83902_RST   0xb0080000      /* DP83902A reset port */
+
+#define PA_SUPERIO     0xb0400000      /* SMC37C935A super io chip */
+#define PA_DIPSW0      0xb0800000      /* Dip switch 5,6 */
+#define PA_DIPSW1      0xb0800002      /* Dip switch 7,8 */
+#define PA_LED         0xb0c00000      /* LED */
+#if defined(CONFIG_CPU_SUBTYPE_SH7705)
+#define PA_BCR         0xb0e00000
+#else
+#define PA_BCR         0xb1400000      /* FPGA */
+#endif
+
+#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
+#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+
+#define BCR_ILCRA      (PA_BCR + 0)
+#define BCR_ILCRB      (PA_BCR + 2)
+#define BCR_ILCRC      (PA_BCR + 4)
+#define BCR_ILCRD      (PA_BCR + 6)
+#define BCR_ILCRE      (PA_BCR + 8)
+#define BCR_ILCRF      (PA_BCR + 10)
+#define BCR_ILCRG      (PA_BCR + 12)
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7705)
+#define IRQ_STNIC      12
+#define IRQ_CFCARD     14
+#else
+#define IRQ_STNIC      10
+#define IRQ_CFCARD     7
+#endif
+
+/* SH Ether support (SH7710/SH7712) */
+/* Base address */
+#define SH_ETH0_BASE 0xA7000000
+#define SH_ETH1_BASE 0xA7000400
+/* PHY ID */
+#if defined(CONFIG_CPU_SUBTYPE_SH7710)
+# define PHY_ID 0x00
+#elif defined(CONFIG_CPU_SUBTYPE_SH7712)
+# define PHY_ID 0x01
+#endif
+/* Ether IRQ */
+#define SH_ETH0_IRQ    80
+#define SH_ETH1_IRQ    81
+#define SH_TSU_IRQ     82
+
+void init_se_IRQ(void);
+
+#define __IO_PREFIX    se
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_HITACHI_SE_H */
diff --git a/arch/sh/include/mach-se/mach/se7206.h b/arch/sh/include/mach-se/mach/se7206.h
new file mode 100644 (file)
index 0000000..698eb80
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_SH_SE7206_H
+#define __ASM_SH_SE7206_H
+
+#define PA_SMSC                0x30000000
+#define PA_MRSHPC      0x34000000
+#define PA_LED         0x31400000
+
+void init_se7206_IRQ(void);
+
+#define __IO_PREFIX    se7206
+#include <asm/io_generic.h>
+
+#endif /* __ASM_SH_SE7206_H */
diff --git a/arch/sh/include/mach-se/mach/se7343.h b/arch/sh/include/mach-se/mach/se7343.h
new file mode 100644 (file)
index 0000000..9845846
--- /dev/null
@@ -0,0 +1,149 @@
+#ifndef __ASM_SH_HITACHI_SE7343_H
+#define __ASM_SH_HITACHI_SE7343_H
+
+/*
+ * include/asm-sh/se/se7343.h
+ *
+ * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
+ *
+ * SH-Mobile SolutionEngine 7343 support
+ */
+
+/* Box specific addresses.  */
+
+/* Area 0 */
+#define PA_ROM         0x00000000      /* EPROM */
+#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte(Actually 2MB) */
+#define PA_FROM                0x00400000      /* Flash ROM */
+#define PA_FROM_SIZE   0x00400000      /* Flash size 4M byte */
+#define PA_SRAM                0x00800000      /* SRAM */
+#define PA_FROM_SIZE   0x00400000      /* SRAM size 4M byte */
+/* Area 1 */
+#define PA_EXT1                0x04000000
+#define PA_EXT1_SIZE   0x04000000
+/* Area 2 */
+#define PA_EXT2                0x08000000
+#define PA_EXT2_SIZE   0x04000000
+/* Area 3 */
+#define PA_SDRAM       0x0c000000
+#define PA_SDRAM_SIZE  0x04000000
+/* Area 4 */
+#define PA_PCIC                0x10000000      /* MR-SHPC-01 PCMCIA */
+#define PA_MRSHPC       0xb03fffe0      /* MR-SHPC-01 PCMCIA controller */
+#define PA_MRSHPC_MW1   0xb0400000      /* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2   0xb0500000      /* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO    0xb0600000      /* MR-SHPC-01 I/O window base */
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+#define PA_LED         0xb0C00000      /* LED */
+#define LED_SHIFT       0
+#define PA_DIPSW       0xb0900000      /* Dip switch 31 */
+#define PA_CPLD_MODESET        0xb1400004      /* CPLD Mode set register */
+#define PA_CPLD_ST     0xb1400008      /* CPLD Interrupt status register */
+#define PA_CPLD_IMSK   0xb140000a      /* CPLD Interrupt mask register */
+/* Area 5 */
+#define PA_EXT5                0x14000000
+#define PA_EXT5_SIZE   0x04000000
+/* Area 6 */
+#define PA_LCD1                0xb8000000
+#define PA_LCD2                0xb8800000
+
+#define PORT_PACR      0xA4050100
+#define PORT_PBCR      0xA4050102
+#define PORT_PCCR      0xA4050104
+#define PORT_PDCR      0xA4050106
+#define PORT_PECR      0xA4050108
+#define PORT_PFCR      0xA405010A
+#define PORT_PGCR      0xA405010C
+#define PORT_PHCR      0xA405010E
+#define PORT_PJCR      0xA4050110
+#define PORT_PKCR      0xA4050112
+#define PORT_PLCR      0xA4050114
+#define PORT_PMCR      0xA4050116
+#define PORT_PNCR      0xA4050118
+#define PORT_PQCR      0xA405011A
+#define PORT_PRCR      0xA405011C
+#define PORT_PSCR      0xA405011E
+#define PORT_PTCR      0xA4050140
+#define PORT_PUCR      0xA4050142
+#define PORT_PVCR      0xA4050144
+#define PORT_PWCR      0xA4050146
+#define PORT_PYCR      0xA4050148
+#define PORT_PZCR      0xA405014A
+
+#define PORT_PSELA     0xA405014C
+#define PORT_PSELB     0xA405014E
+#define PORT_PSELC     0xA4050150
+#define PORT_PSELD     0xA4050152
+#define PORT_PSELE     0xA4050154
+
+#define PORT_HIZCRA    0xA4050156
+#define PORT_HIZCRB    0xA4050158
+#define PORT_HIZCRC    0xA405015C
+
+#define PORT_DRVCR     0xA4050180
+
+#define PORT_PADR      0xA4050120
+#define PORT_PBDR      0xA4050122
+#define PORT_PCDR      0xA4050124
+#define PORT_PDDR      0xA4050126
+#define PORT_PEDR      0xA4050128
+#define PORT_PFDR      0xA405012A
+#define PORT_PGDR      0xA405012C
+#define PORT_PHDR      0xA405012E
+#define PORT_PJDR      0xA4050130
+#define PORT_PKDR      0xA4050132
+#define PORT_PLDR      0xA4050134
+#define PORT_PMDR      0xA4050136
+#define PORT_PNDR      0xA4050138
+#define PORT_PQDR      0xA405013A
+#define PORT_PRDR      0xA405013C
+#define PORT_PTDR      0xA4050160
+#define PORT_PUDR      0xA4050162
+#define PORT_PVDR      0xA4050164
+#define PORT_PWDR      0xA4050166
+#define PORT_PYDR      0xA4050168
+
+#define FPGA_IN                0xb1400000
+#define FPGA_OUT       0xb1400002
+
+#define __IO_PREFIX    sh7343se
+#include <asm/io_generic.h>
+
+#define IRQ0_IRQ        32
+#define IRQ1_IRQ        33
+#define IRQ4_IRQ        36
+#define IRQ5_IRQ        37
+
+#define SE7343_FPGA_IRQ_MRSHPC0        0
+#define SE7343_FPGA_IRQ_MRSHPC1        1
+#define SE7343_FPGA_IRQ_MRSHPC2        2
+#define SE7343_FPGA_IRQ_MRSHPC3        3
+#define SE7343_FPGA_IRQ_SMC    6       /* EXT_IRQ2 */
+#define SE7343_FPGA_IRQ_USB    8
+
+#define SE7343_FPGA_IRQ_NR     11
+#define SE7343_FPGA_IRQ_BASE   120
+
+#define MRSHPC_IRQ3            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC3)
+#define MRSHPC_IRQ2            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC2)
+#define MRSHPC_IRQ1            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC1)
+#define MRSHPC_IRQ0            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC0)
+#define SMC_IRQ                (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_SMC)
+#define USB_IRQ                (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_USB)
+
+/* arch/sh/boards/se/7343/irq.c */
+void init_7343se_IRQ(void);
+
+#endif  /* __ASM_SH_HITACHI_SE7343_H */
diff --git a/arch/sh/include/mach-se/mach/se7721.h b/arch/sh/include/mach-se/mach/se7721.h
new file mode 100644 (file)
index 0000000..b957f60
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * Hitachi UL SolutionEngine 7721 Support.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __ASM_SH_SE7721_H
+#define __ASM_SH_SE7721_H
+#include <asm/addrspace.h>
+
+/* Box specific addresses. */
+#define SE_AREA0_WIDTH 2               /* Area0: 32bit */
+#define PA_ROM         0xa0000000      /* EPROM */
+#define PA_ROM_SIZE    0x00200000      /* EPROM size 2M byte */
+#define PA_FROM                0xa1000000      /* Flash-ROM */
+#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
+#define PA_EXT1                0xa4000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_SDRAM       0xaC000000      /* SDRAM(Area3) 64MB */
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0xb0000000
+#define PA_EXT4_SIZE   0x04000000
+
+#define PA_PERIPHERAL  0xB8000000
+
+#define PA_PCIC                PA_PERIPHERAL
+#define PA_MRSHPC      (PA_PERIPHERAL + 0x003fffe0)
+#define PA_MRSHPC_MW1  (PA_PERIPHERAL + 0x00400000)
+#define PA_MRSHPC_MW2  (PA_PERIPHERAL + 0x00500000)
+#define PA_MRSHPC_IO   (PA_PERIPHERAL + 0x00600000)
+#define MRSHPC_OPTION  (PA_MRSHPC + 6)
+#define MRSHPC_CSR     (PA_MRSHPC + 8)
+#define MRSHPC_ISR     (PA_MRSHPC + 10)
+#define MRSHPC_ICR     (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR   (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1  (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1  (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1  (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2  (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2  (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2  (PA_MRSHPC + 26)
+#define MRSHPC_CDCR    (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO       (PA_MRSHPC + 30)
+
+#define PA_LED         0xB6800000      /* 8bit LED */
+#define PA_FPGA                0xB7000000      /* FPGA base address */
+
+#define MRSHPC_IRQ0    10
+
+#define FPGA_ILSR1     (PA_FPGA + 0x02)
+#define FPGA_ILSR2     (PA_FPGA + 0x03)
+#define FPGA_ILSR3     (PA_FPGA + 0x04)
+#define FPGA_ILSR4     (PA_FPGA + 0x05)
+#define FPGA_ILSR5     (PA_FPGA + 0x06)
+#define FPGA_ILSR6     (PA_FPGA + 0x07)
+#define FPGA_ILSR7     (PA_FPGA + 0x08)
+#define FPGA_ILSR8     (PA_FPGA + 0x09)
+
+void init_se7721_IRQ(void);
+
+#define __IO_PREFIX            se7721
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_SE7721_H */
diff --git a/arch/sh/include/mach-se/mach/se7722.h b/arch/sh/include/mach-se/mach/se7722.h
new file mode 100644 (file)
index 0000000..e971d9a
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef __ASM_SH_SE7722_H
+#define __ASM_SH_SE7722_H
+
+/*
+ * linux/include/asm-sh/se7722.h
+ *
+ * Copyright (C) 2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7722 Support.
+ *
+ * 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.
+ *
+ */
+#include <asm/addrspace.h>
+
+/* Box specific addresses.  */
+#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
+#define PA_ROM         0xa0000000      /* EPROM */
+#define PA_ROM_SIZE    0x00200000      /* EPROM size 2M byte */
+#define PA_FROM                0xa1000000      /* Flash-ROM */
+#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
+#define PA_EXT1                0xa4000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_SDRAM       0xaC000000      /* DDR-SDRAM(Area3) 64MB */
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0xb0000000
+#define PA_EXT4_SIZE   0x04000000
+
+#define PA_PERIPHERAL  0xB0000000
+
+#define PA_PCIC         PA_PERIPHERAL                  /* MR-SHPC-01 PCMCIA */
+#define PA_MRSHPC       (PA_PERIPHERAL + 0x003fffe0)    /* MR-SHPC-01 PCMCIA controller */
+#define PA_MRSHPC_MW1   (PA_PERIPHERAL + 0x00400000)    /* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2   (PA_PERIPHERAL + 0x00500000)    /* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO    (PA_PERIPHERAL + 0x00600000)    /* MR-SHPC-01 I/O window base */
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+
+#define PA_LED         (PA_PERIPHERAL + 0x00800000)    /* 8bit LED */
+#define PA_FPGA                (PA_PERIPHERAL + 0x01800000)    /* FPGA base address */
+
+#define PA_LAN         (PA_AREA6_IO + 0)               /* SMC LAN91C111 */
+/* GPIO */
+#define FPGA_IN         0xb1840000UL
+#define FPGA_OUT        0xb1840004UL
+
+#define PORT_PECR       0xA4050108UL
+#define PORT_PJCR       0xA4050110UL
+#define PORT_PSELD      0xA4050154UL
+#define PORT_PSELB      0xA4050150UL
+
+#define PORT_PSELC      0xA4050152UL
+#define PORT_PKCR       0xA4050112UL
+#define PORT_PHCR       0xA405010EUL
+#define PORT_PLCR       0xA4050114UL
+#define PORT_PMCR       0xA4050116UL
+#define PORT_PRCR       0xA405011CUL
+#define PORT_PXCR       0xA4050148UL
+#define PORT_PSELA      0xA405014EUL
+#define PORT_PYCR       0xA405014AUL
+#define PORT_PZCR       0xA405014CUL
+#define PORT_HIZCRA     0xA4050158UL
+#define PORT_HIZCRC     0xA405015CUL
+
+/* IRQ */
+#define IRQ0_IRQ        32
+#define IRQ1_IRQ        33
+
+#define IRQ01_MODE      0xb1800000
+#define IRQ01_STS       0xb1800004
+#define IRQ01_MASK      0xb1800008
+
+/* Bits in IRQ01_* registers */
+
+#define SE7722_FPGA_IRQ_USB    0 /* IRQ0 */
+#define SE7722_FPGA_IRQ_SMC    1 /* IRQ0 */
+#define SE7722_FPGA_IRQ_MRSHPC0        2 /* IRQ1 */
+#define SE7722_FPGA_IRQ_MRSHPC1        3 /* IRQ1 */
+#define SE7722_FPGA_IRQ_MRSHPC2        4 /* IRQ1 */
+#define SE7722_FPGA_IRQ_MRSHPC3        5 /* IRQ1 */
+
+#define SE7722_FPGA_IRQ_NR     6
+#define SE7722_FPGA_IRQ_BASE   110
+
+#define MRSHPC_IRQ3            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC3)
+#define MRSHPC_IRQ2            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC2)
+#define MRSHPC_IRQ1            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC1)
+#define MRSHPC_IRQ0            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC0)
+#define SMC_IRQ                (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_SMC)
+#define USB_IRQ                (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_USB)
+
+/* arch/sh/boards/se/7722/irq.c */
+void init_se7722_IRQ(void);
+
+#define __IO_PREFIX            se7722
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_SE7722_H */
diff --git a/arch/sh/include/mach-se/mach/se7751.h b/arch/sh/include/mach-se/mach/se7751.h
new file mode 100644 (file)
index 0000000..b36792a
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef __ASM_SH_HITACHI_7751SE_H
+#define __ASM_SH_HITACHI_7751SE_H
+
+/*
+ * linux/include/asm-sh/hitachi_7751se.h
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine support
+
+ * Modified for 7751 Solution Engine by
+ * Ian da Silva and Jeremy Siegel, 2001.
+ */
+
+/* Box specific addresses.  */
+
+#define PA_ROM         0x00000000      /* EPROM */
+#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
+#define PA_FROM                0x01000000      /* EPROM */
+#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
+#define PA_EXT1                0x04000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_EXT2                0x08000000
+#define PA_EXT2_SIZE   0x04000000
+#define PA_SDRAM       0x0c000000
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0x12000000
+#define PA_EXT4_SIZE   0x02000000
+#define PA_EXT5                0x14000000
+#define PA_EXT5_SIZE   0x04000000
+#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
+
+#define PA_DIPSW0      0xb9000000      /* Dip switch 5,6 */
+#define PA_DIPSW1      0xb9000002      /* Dip switch 7,8 */
+#define PA_LED         0xba000000      /* LED */
+#define        PA_BCR          0xbb000000      /* FPGA on the MS7751SE01 */
+
+#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
+#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
+#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
+#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
+#define MRSHPC_MODE     (PA_MRSHPC + 4)
+#define MRSHPC_OPTION   (PA_MRSHPC + 6)
+#define MRSHPC_CSR      (PA_MRSHPC + 8)
+#define MRSHPC_ISR      (PA_MRSHPC + 10)
+#define MRSHPC_ICR      (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
+#define MRSHPC_CDCR     (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
+
+#define BCR_ILCRA      (PA_BCR + 0)
+#define BCR_ILCRB      (PA_BCR + 2)
+#define BCR_ILCRC      (PA_BCR + 4)
+#define BCR_ILCRD      (PA_BCR + 6)
+#define BCR_ILCRE      (PA_BCR + 8)
+#define BCR_ILCRF      (PA_BCR + 10)
+#define BCR_ILCRG      (PA_BCR + 12)
+
+#define IRQ_79C973     13
+
+void init_7751se_IRQ(void);
+
+#define __IO_PREFIX    sh7751se
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_HITACHI_7751SE_H */
diff --git a/arch/sh/include/mach-se/mach/se7780.h b/arch/sh/include/mach-se/mach/se7780.h
new file mode 100644 (file)
index 0000000..40e9b41
--- /dev/null
@@ -0,0 +1,108 @@
+#ifndef __ASM_SH_SE7780_H
+#define __ASM_SH_SE7780_H
+
+/*
+ * linux/include/asm-sh/se7780.h
+ *
+ * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7780 Support.
+ *
+ * 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.
+ */
+#include <asm/addrspace.h>
+
+/* Box specific addresses.  */
+#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
+#define PA_ROM         0xa0000000      /* EPROM */
+#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
+#define PA_FROM                0xa1000000      /* Flash-ROM */
+#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
+#define PA_EXT1                0xa4000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_SM501       PA_EXT1         /* Graphic IC (SM501) */
+#define PA_SM501_SIZE  PA_EXT1_SIZE    /* Graphic IC (SM501) */
+#define PA_SDRAM       0xa8000000      /* DDR-SDRAM(Area2/3) 128MB */
+#define PA_SDRAM_SIZE  0x08000000
+
+#define PA_EXT4                0xb0000000
+#define PA_EXT4_SIZE   0x04000000
+#define PA_EXT_FLASH   PA_EXT4         /* Expansion Flash-ROM */
+
+#define PA_PERIPHERAL  PA_AREA6_IO     /* SW6-6=ON */
+
+#define PA_LAN         (PA_PERIPHERAL + 0)             /* SMC LAN91C111 */
+#define PA_LED_DISP    (PA_PERIPHERAL + 0x02000000)    /* 8words LED Display */
+#define DISP_CHAR_RAM  (7 << 3)
+#define DISP_SEL0_ADDR (DISP_CHAR_RAM + 0)
+#define DISP_SEL1_ADDR (DISP_CHAR_RAM + 1)
+#define DISP_SEL2_ADDR (DISP_CHAR_RAM + 2)
+#define DISP_SEL3_ADDR (DISP_CHAR_RAM + 3)
+#define DISP_SEL4_ADDR (DISP_CHAR_RAM + 4)
+#define DISP_SEL5_ADDR (DISP_CHAR_RAM + 5)
+#define DISP_SEL6_ADDR (DISP_CHAR_RAM + 6)
+#define DISP_SEL7_ADDR (DISP_CHAR_RAM + 7)
+
+#define DISP_UDC_RAM   (5 << 3)
+#define PA_FPGA                (PA_PERIPHERAL + 0x03000000) /* FPGA base address */
+
+/* FPGA register address and bit */
+#define FPGA_SFTRST            (PA_FPGA + 0)   /* Soft reset register */
+#define FPGA_INTMSK1           (PA_FPGA + 2)   /* Interrupt Mask register 1 */
+#define FPGA_INTMSK2           (PA_FPGA + 4)   /* Interrupt Mask register 2 */
+#define FPGA_INTSEL1           (PA_FPGA + 6)   /* Interrupt select register 1 */
+#define FPGA_INTSEL2           (PA_FPGA + 8)   /* Interrupt select register 2 */
+#define FPGA_INTSEL3           (PA_FPGA + 10)  /* Interrupt select register 3 */
+#define FPGA_PCI_INTSEL1       (PA_FPGA + 12)  /* PCI Interrupt select register 1 */
+#define FPGA_PCI_INTSEL2       (PA_FPGA + 14)  /* PCI Interrupt select register 2 */
+#define FPGA_INTSET            (PA_FPGA + 16)  /* IRQ/IRL select register */
+#define FPGA_INTSTS1           (PA_FPGA + 18)  /* Interrupt status register 1 */
+#define FPGA_INTSTS2           (PA_FPGA + 20)  /* Interrupt status register 2 */
+#define FPGA_REQSEL            (PA_FPGA + 22)  /* REQ/GNT select register */
+#define FPGA_DBG_LED           (PA_FPGA + 32)  /* Debug LED(D-LED[8:1] */
+#define PA_LED                 FPGA_DBG_LED
+#define FPGA_IVDRID            (PA_FPGA + 36)  /* iVDR ID Register */
+#define FPGA_IVDRPW            (PA_FPGA + 38)  /* iVDR Power ON Register */
+#define FPGA_MMCID             (PA_FPGA + 40)  /* MMC ID Register */
+
+/* FPGA INTSEL position */
+/* INTSEL1 */
+#define IRQPOS_SMC91CX          (0 * 4)
+#define IRQPOS_SM501            (1 * 4)
+/* INTSEL2 */
+#define IRQPOS_EXTINT1          (0 * 4)
+#define IRQPOS_EXTINT2          (1 * 4)
+#define IRQPOS_EXTINT3          (2 * 4)
+#define IRQPOS_EXTINT4          (3 * 4)
+/* INTSEL3 */
+#define IRQPOS_PCCPW            (0 * 4)
+
+/* IDE interrupt */
+#define IRQ_IDE0                67 /* iVDR */
+
+/* SMC interrupt */
+#define SMC_IRQ                 8
+
+/* SM501 interrupt */
+#define SM501_IRQ               0
+
+/* interrupt pin */
+#define IRQPIN_EXTINT1          0 /* IRQ0 pin */
+#define IRQPIN_EXTINT2          1 /* IRQ1 pin */
+#define IRQPIN_EXTINT3          2 /* IRQ2 pin */
+#define IRQPIN_SMC91CX          3 /* IRQ3 pin */
+#define IRQPIN_EXTINT4          4 /* IRQ4 pin */
+#define IRQPIN_PCC0             5 /* IRQ5 pin */
+#define IRQPIN_PCC2             6 /* IRQ6 pin */
+#define IRQPIN_SM501            7 /* IRQ7 pin */
+#define IRQPIN_PCCPW            7 /* IRQ7 pin */
+
+/* arch/sh/boards/se/7780/irq.c */
+void init_se7780_IRQ(void);
+
+#define __IO_PREFIX            se7780
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_SE7780_H */
diff --git a/arch/sh/include/mach-sh03/mach/io.h b/arch/sh/include/mach-sh03/mach/io.h
new file mode 100644 (file)
index 0000000..c39c785
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * include/asm-sh/sh03/io.h
+ *
+ * Copyright 2004 Interface Co.,Ltd. Saito.K
+ *
+ * IO functions for an Interface CTP/PCI-SH03
+ */
+
+#ifndef _ASM_SH_IO_SH03_H
+#define _ASM_SH_IO_SH03_H
+
+#include <linux/time.h>
+
+#define IRL0_IRQ       2
+#define IRL0_PRIORITY  13
+#define IRL1_IRQ       5
+#define IRL1_PRIORITY  10
+#define IRL2_IRQ       8
+#define IRL2_PRIORITY  7
+#define IRL3_IRQ       11
+#define IRL3_PRIORITY  4
+
+void heartbeat_sh03(void);
+
+#endif /* _ASM_SH_IO_SH03_H */
diff --git a/arch/sh/include/mach-sh03/mach/sh03.h b/arch/sh/include/mach-sh03/mach/sh03.h
new file mode 100644 (file)
index 0000000..19c40b8
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __ASM_SH_SH03_H
+#define __ASM_SH_SH03_H
+
+/*
+ * linux/include/asm-sh/sh03/sh03.h
+ *
+ * Copyright (C) 2004  Interface Co., Ltd. Saito.K
+ *
+ * Interface CTP/PCI-SH03 support
+ */
+
+#define PA_PCI_IO       (0xbe240000)    /* PCI I/O space */
+#define PA_PCI_MEM      (0xbd000000)    /* PCI MEM space */
+
+#define PCIPAR          (0xa4000cf8)    /* PCI Config address */
+#define PCIPDR          (0xa4000cfc)    /* PCI Config data    */
+
+#endif  /* __ASM_SH_SH03_H */
diff --git a/arch/sh/kernel/.gitignore b/arch/sh/kernel/.gitignore
new file mode 100644 (file)
index 0000000..c5f676c
--- /dev/null
@@ -0,0 +1 @@
+vmlinux.lds
index d3d9f32042302f42f2788ba1fd9fe58069553fff..bea40339919ba0b3b372024b49fc84b8d3edcf17 100644 (file)
@@ -80,11 +80,11 @@ static int __init cf_init_default(void)
 }
 
 #if defined(CONFIG_SH_SOLUTION_ENGINE)
-#include <asm/se.h>
+#include <mach-se/mach/se.h>
 #elif defined(CONFIG_SH_7722_SOLUTION_ENGINE)
-#include <asm/se7722.h>
+#include <mach-se/mach/se7722.h>
 #elif defined(CONFIG_SH_7721_SOLUTION_ENGINE)
-#include <asm/se7721.h>
+#include <mach-se/mach/se7721.h>
 #endif
 
 /*
index 79baa47af97780ac33c8ca869ecd0338a629d347..726f0335da76b059eaa886d76b49f6ed17f7a2b6 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/bitops.h>
-#include <asm/cpu/irq.h>
+#include <cpu/irq.h>
 #include <asm/page.h>
 
 /*
index ee894e5a45e7914315f498c407e2bad3931a3fc4..becc54c456924077d45053ab4e0a3f22a1300e8e 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/linkage.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
-#include <asm/cpu/mmu_context.h>
+#include <cpu/mmu_context.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/page.h>
index 47096dc3d2067abe70d08a0961007a6e1188d2c0..ab3903eeda5cac2b19e79956a129fb3e3c4bd861 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/linkage.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
-#include <asm/cpu/mmu_context.h>
+#include <cpu/mmu_context.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/page.h>
index 4004073f98cd6568156097816c4623cacb2fa01a..3fe482dd05c164a3b7cce794f17833e115b4af44 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/unistd.h>
-#include <asm/cpu/mmu_context.h>
+#include <cpu/mmu_context.h>
 #include <asm/page.h>
 
 ! NOTE:
index 8020796139f17ef45a7f860cacea8ac24018f6da..2d452f67fb87dcc9535b088d6c101c7069641272 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/io.h>
-#include <asm/cpu/fpu.h>
+#include <cpu/fpu.h>
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/fpu.h>
index 7b2d337ee4121dacf34f6e39648d201b5494bb8e..828cb57cb9591efe1c8a2e3003caa7c15b3cbc8f 100644 (file)
@@ -36,7 +36,7 @@
  * and Kamel Khelifi <kamel.khelifi@st.com>
  */
 #include <linux/kernel.h>
-#include <asm/cpu/fpu.h>
+#include <cpu/fpu.h>
 
 #define LIT64( a ) a##LL
 
index 9561b02ade0ef84e0b1a904c0a89891517ef77b2..dcdf959a3d44199e25d80cc740bbd30feb804251 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/io.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
-#include <asm/cpu/sq.h>
+#include <cpu/sq.h>
 
 struct sq_mapping;
 
index 05372ed6c5686c0dd346853eefb131d9848bbf6a..ca08e7f26a3ab9b474e2253dfa2bfb93100d41fd 100644 (file)
@@ -11,7 +11,7 @@
  */
 #include <linux/errno.h>
 #include <linux/sys.h>
-#include <asm/cpu/registers.h>
+#include <cpu/registers.h>
 #include <asm/processor.h>
 #include <asm/unistd.h>
 #include <asm/thread_info.h>
index f42d4c0feb76d70106ea6b19ceeeeecee587b568..7ccfb995a398d562596e0d4be7ea797bfe9f57b7 100644 (file)
@@ -11,8 +11,8 @@
 #include <asm/page.h>
 #include <asm/cache.h>
 #include <asm/tlb.h>
-#include <asm/cpu/registers.h>
-#include <asm/cpu/mmu_context.h>
+#include <cpu/registers.h>
+#include <cpu/mmu_context.h>
 #include <asm/thread_info.h>
 
 /*
index a2a99e487e33af4c6c1714f0d36e9065556f701a..64b7690c664cb9ac1cabe09c30dfee042451a3b1 100644 (file)
@@ -15,7 +15,7 @@
 #include <asm/machvec.h>
 #include <asm/uaccess.h>
 #include <asm/thread_info.h>
-#include <asm/cpu/mmu_context.h>
+#include <cpu/mmu_context.h>
 
 atomic_t irq_err_count;
 
index 022a55f1c1d46b510c1efa784d1376d342104372..791edabf7d834fe8d52410b508f50bc18f9fe981 100644 (file)
@@ -33,8 +33,8 @@
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
-#include <asm/cpu/registers.h>  /* required by inline __asm__ stmt. */
-#include <asm/cpu/irq.h>
+#include <cpu/registers.h>      /* required by inline __asm__ stmt. */
+#include <cpu/irq.h>
 #include <asm/addrspace.h>
 #include <asm/processor.h>
 #include <asm/uaccess.h>
index ff559e2a96f72ff279535a2ea4aef166744500eb..da32ba7b5fcc0b6e12c91cd270d0d7fb33a8b477 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/kernel.h>
 #include <asm/io.h>
-#include <asm/cpu/registers.h>
+#include <cpu/registers.h>
 
 /* THIS IS A PHYSICAL ADDRESS */
 #define HDSP2534_ADDR (0x04002100)
index 399d53710d2fe406e12ae695274c0c4f12a1f222..bd63b961b2a9b1ba47e302611012e38bf83ca73e 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
-#include <asm/cpu/registers.h>
+#include <cpu/registers.h>
 
 /* Callable from fault.c, so not static */
 inline void __do_tlb_refill(unsigned long address,
index 567516b58acca40ff99ada5fd9bd1bd100b91496..b5d202be82063efa6b0c25f667721001d4619358 100644 (file)
@@ -10,7 +10,7 @@
 # Shamelessly cloned from ARM.
 #
 
-include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
+arch/sh/include/asm/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
        @echo '  Generating $@'
-       $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
+       $(Q)if [ ! -d arch/sh/include/asm ]; then mkdir -p arch/sh/include/asm; fi
        $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
index d8378935ae90918149a3099b46b38e11f5aa7d42..47f95839dc6956e190cd1175cb50b74491dcab00 100644 (file)
@@ -59,7 +59,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
                __futex_cas_op("or\t%2, %4, %1", ret, oldval, uaddr, oparg);
                break;
        case FUTEX_OP_ANDN:
-               __futex_cas_op("and\t%2, %4, %1", ret, oldval, uaddr, oparg);
+               __futex_cas_op("andn\t%2, %4, %1", ret, oldval, uaddr, oparg);
                break;
        case FUTEX_OP_XOR:
                __futex_cas_op("xor\t%2, %4, %1", ret, oldval, uaddr, oparg);
index 0bb9bf531745e8caf587135f3cf3063f31d24a4c..3473e25231d96e3fe63a0227cf3103d409074cf4 100644 (file)
@@ -90,4 +90,7 @@ static inline unsigned long get_softint(void)
        return retval;
 }
 
+void __trigger_all_cpu_backtrace(void);
+#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
+
 #endif
index aa699775ffba8c9dd40b56465d725f6aba224fb1..93a262c44022d25f90561e946dcaba714584d2d0 100644 (file)
@@ -1,8 +1,24 @@
 #ifndef ___ASM_SPARC_OF_PLATFORM_H
 #define ___ASM_SPARC_OF_PLATFORM_H
-#if defined(__sparc__) && defined(__arch64__)
-#include <asm/of_platform_64.h>
-#else
-#include <asm/of_platform_32.h>
-#endif
+/*
+ *    Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
+ *                      <benh@kernel.crashing.org>
+ *    Modified for Sparc by merging parts of asm/of_device.h
+ *             by Stephen Rothwell
+ *
+ *  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 is just here during the transition */
+#include <linux/of_platform.h>
+
+extern struct bus_type ebus_bus_type;
+extern struct bus_type sbus_bus_type;
+
+#define of_bus_type    of_platform_bus_type    /* for compatibility */
+
 #endif
diff --git a/arch/sparc/include/asm/of_platform_32.h b/arch/sparc/include/asm/of_platform_32.h
deleted file mode 100644 (file)
index 723f7c9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASM_SPARC_OF_PLATFORM_H
-#define _ASM_SPARC_OF_PLATFORM_H
-/*
- *    Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
- *                      <benh@kernel.crashing.org>
- *    Modified for Sparc by merging parts of asm/of_device.h
- *             by Stephen Rothwell
- *
- *  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 is just here during the transition */
-#include <linux/of_platform.h>
-
-extern struct bus_type ebus_bus_type;
-extern struct bus_type sbus_bus_type;
-
-#define of_bus_type    of_platform_bus_type    /* for compatibility */
-
-#endif /* _ASM_SPARC_OF_PLATFORM_H */
diff --git a/arch/sparc/include/asm/of_platform_64.h b/arch/sparc/include/asm/of_platform_64.h
deleted file mode 100644 (file)
index 4f66a5f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ASM_SPARC64_OF_PLATFORM_H
-#define _ASM_SPARC64_OF_PLATFORM_H
-/*
- *    Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
- *                      <benh@kernel.crashing.org>
- *    Modified for Sparc by merging parts of asm/of_device.h
- *             by Stephen Rothwell
- *
- *  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 is just here during the transition */
-#include <linux/of_platform.h>
-
-extern struct bus_type isa_bus_type;
-extern struct bus_type ebus_bus_type;
-extern struct bus_type sbus_bus_type;
-
-#define of_bus_type    of_platform_bus_type    /* for compatibility */
-
-#endif /* _ASM_SPARC64_OF_PLATFORM_H */
index d43c88b86834d2fc08986b32e1191b4962bf0f9d..d409c4f21a5cdea420e75fef24a2ceec1cb0e834 100644 (file)
@@ -40,16 +40,6 @@ struct pt_regs {
 #define UREG_FP        UREG_I6
 #define UREG_RETPC     UREG_I7
 
-static inline bool pt_regs_is_syscall(struct pt_regs *regs)
-{
-       return (regs->psr & PSR_SYSCALL);
-}
-
-static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
-{
-       return (regs->psr &= ~PSR_SYSCALL);
-}
-
 /* A register window */
 struct reg_window {
        unsigned long locals[8];
@@ -72,6 +62,16 @@ struct sparc_stackf {
 
 #ifdef __KERNEL__
 
+static inline bool pt_regs_is_syscall(struct pt_regs *regs)
+{
+       return (regs->psr & PSR_SYSCALL);
+}
+
+static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
+{
+       return (regs->psr &= ~PSR_SYSCALL);
+}
+
 #define user_mode(regs) (!((regs)->psr & PSR_PS))
 #define instruction_pointer(regs) ((regs)->pc)
 #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
index ec6d45c84cd0e4a0a0aa12cbc6e229b975d6f38e..06e4914c13f4100182ccd5aa5720d3247e4469fa 100644 (file)
@@ -37,21 +37,6 @@ struct pt_regs {
        unsigned int magic;
 };
 
-static inline int pt_regs_trap_type(struct pt_regs *regs)
-{
-       return regs->magic & 0x1ff;
-}
-
-static inline bool pt_regs_is_syscall(struct pt_regs *regs)
-{
-       return (regs->tstate & TSTATE_SYSCALL);
-}
-
-static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
-{
-       return (regs->tstate &= ~TSTATE_SYSCALL);
-}
-
 struct pt_regs32 {
        unsigned int psr;
        unsigned int pc;
@@ -128,15 +113,30 @@ struct sparc_trapf {
 
 #ifdef __KERNEL__
 
+static inline int pt_regs_trap_type(struct pt_regs *regs)
+{
+       return regs->magic & 0x1ff;
+}
+
+static inline bool pt_regs_is_syscall(struct pt_regs *regs)
+{
+       return (regs->tstate & TSTATE_SYSCALL);
+}
+
+static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
+{
+       return (regs->tstate &= ~TSTATE_SYSCALL);
+}
+
 struct global_reg_snapshot {
        unsigned long           tstate;
        unsigned long           tpc;
        unsigned long           tnpc;
        unsigned long           o7;
        unsigned long           i7;
+       unsigned long           rpc;
        struct thread_info      *thread;
        unsigned long           pad1;
-       unsigned long           pad2;
 };
 
 #define __ARCH_WANT_COMPAT_SYS_PTRACE
@@ -154,7 +154,6 @@ extern unsigned long profile_pc(struct pt_regs *);
 #define profile_pc(regs) instruction_pointer(regs)
 #endif
 extern void show_regs(struct pt_regs *);
-extern void __show_regs(struct pt_regs *);
 #endif
 
 #else /* __ASSEMBLY__ */
@@ -315,9 +314,9 @@ extern void __show_regs(struct pt_regs *);
 #define GR_SNAP_TNPC   0x10
 #define GR_SNAP_O7     0x18
 #define GR_SNAP_I7     0x20
-#define GR_SNAP_THREAD 0x28
-#define GR_SNAP_PAD1   0x30
-#define GR_SNAP_PAD2   0x38
+#define GR_SNAP_RPC    0x28
+#define GR_SNAP_THREAD 0x30
+#define GR_SNAP_PAD1   0x38
 
 #endif  /*  __KERNEL__  */
 
index 4fd48ab7dda40bef2a290e08cb07558122b3be35..f8b50cbf4bf711658ef3ad742270da424cbf4294 100644 (file)
@@ -56,9 +56,6 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 EXPORT_SYMBOL(of_find_device_by_node);
 
 #ifdef CONFIG_PCI
-struct bus_type isa_bus_type;
-EXPORT_SYMBOL(isa_bus_type);
-
 struct bus_type ebus_bus_type;
 EXPORT_SYMBOL(ebus_bus_type);
 #endif
@@ -841,8 +838,6 @@ static int __init of_bus_driver_init(void)
 
        err = of_bus_type_init(&of_platform_bus_type, "of");
 #ifdef CONFIG_PCI
-       if (!err)
-               err = of_bus_type_init(&isa_bus_type, "isa");
        if (!err)
                err = of_bus_type_init(&ebus_bus_type, "ebus");
 #endif
index 8a9cd3e165b9af46818a107b62470554ce8c80a7..7f5debdc5fed6ad2a4ae86b1ff78836efe8dce03 100644 (file)
@@ -52,8 +52,6 @@
 #include <asm/irq_regs.h>
 #include <asm/smp.h>
 
-/* #define VERBOSE_SHOWREGS */
-
 static void sparc64_yield(int cpu)
 {
        if (tlb_type != hypervisor)
@@ -213,22 +211,8 @@ static void show_regwindow(struct pt_regs *regs)
                printk("I7: <%pS>\n", (void *) rwk->ins[7]);
 }
 
-#ifdef CONFIG_SMP
-static DEFINE_SPINLOCK(regdump_lock);
-#endif
-
-void __show_regs(struct pt_regs * regs)
+void show_regs(struct pt_regs *regs)
 {
-#ifdef CONFIG_SMP
-       unsigned long flags;
-
-       /* Protect against xcall ipis which might lead to livelock on the lock */
-       __asm__ __volatile__("rdpr      %%pstate, %0\n\t"
-                            "wrpr      %0, %1, %%pstate"
-                            : "=r" (flags)
-                            : "i" (PSTATE_IE));
-       spin_lock(&regdump_lock);
-#endif
        printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x    %s\n", regs->tstate,
               regs->tpc, regs->tnpc, regs->y, print_tainted());
        printk("TPC: <%pS>\n", (void *) regs->tpc);
@@ -246,64 +230,24 @@ void __show_regs(struct pt_regs * regs)
               regs->u_regs[15]);
        printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
        show_regwindow(regs);
-#ifdef CONFIG_SMP
-       spin_unlock(&regdump_lock);
-       __asm__ __volatile__("wrpr      %0, 0, %%pstate"
-                            : : "r" (flags));
-#endif
 }
 
-#ifdef VERBOSE_SHOWREGS
-static void idump_from_user (unsigned int *pc)
-{
-       int i;
-       int code;
-       
-       if((((unsigned long) pc) & 3))
-               return;
-       
-       pc -= 3;
-       for(i = -3; i < 6; i++) {
-               get_user(code, pc);
-               printk("%c%08x%c",i?' ':'<',code,i?' ':'>');
-               pc++;
-       }
-       printk("\n");
-}
-#endif
+struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
+static DEFINE_SPINLOCK(global_reg_snapshot_lock);
 
-void show_regs(struct pt_regs *regs)
+static bool kstack_valid(struct thread_info *tp, struct reg_window *rw)
 {
-#ifdef VERBOSE_SHOWREGS
-       extern long etrap, etraptl1;
-#endif
-       __show_regs(regs);
-#if 0
-#ifdef CONFIG_SMP
-       {
-               extern void smp_report_regs(void);
+       unsigned long thread_base, fp;
 
-               smp_report_regs();
-       }
-#endif
-#endif
+       thread_base = (unsigned long) tp;
+       fp = (unsigned long) rw;
 
-#ifdef VERBOSE_SHOWREGS        
-       if (regs->tpc >= &etrap && regs->tpc < &etraptl1 &&
-           regs->u_regs[14] >= (long)current - PAGE_SIZE &&
-           regs->u_regs[14] < (long)current + 6 * PAGE_SIZE) {
-               printk ("*********parent**********\n");
-               __show_regs((struct pt_regs *)(regs->u_regs[14] + PTREGS_OFF));
-               idump_from_user(((struct pt_regs *)(regs->u_regs[14] + PTREGS_OFF))->tpc);
-               printk ("*********endpar**********\n");
-       }
-#endif
+       if (fp < (thread_base + sizeof(struct thread_info)) ||
+           fp >= (thread_base + THREAD_SIZE))
+               return false;
+       return true;
 }
 
-#ifdef CONFIG_MAGIC_SYSRQ
-struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
-static DEFINE_SPINLOCK(global_reg_snapshot_lock);
-
 static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs,
                              int this_cpu)
 {
@@ -315,14 +259,22 @@ static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs,
        global_reg_snapshot[this_cpu].o7 = regs->u_regs[UREG_I7];
 
        if (regs->tstate & TSTATE_PRIV) {
+               struct thread_info *tp = current_thread_info();
                struct reg_window *rw;
 
                rw = (struct reg_window *)
                        (regs->u_regs[UREG_FP] + STACK_BIAS);
-               global_reg_snapshot[this_cpu].i7 = rw->ins[6];
-       } else
+               if (kstack_valid(tp, rw)) {
+                       global_reg_snapshot[this_cpu].i7 = rw->ins[7];
+                       rw = (struct reg_window *)
+                               (rw->ins[6] + STACK_BIAS);
+                       if (kstack_valid(tp, rw))
+                               global_reg_snapshot[this_cpu].rpc = rw->ins[7];
+               }
+       } else {
                global_reg_snapshot[this_cpu].i7 = 0;
-
+               global_reg_snapshot[this_cpu].rpc = 0;
+       }
        global_reg_snapshot[this_cpu].thread = tp;
 }
 
@@ -341,7 +293,7 @@ static void __global_reg_poll(struct global_reg_snapshot *gp)
        }
 }
 
-static void sysrq_handle_globreg(int key, struct tty_struct *tty)
+void __trigger_all_cpu_backtrace(void)
 {
        struct thread_info *tp = current_thread_info();
        struct pt_regs *regs = get_irq_regs();
@@ -375,13 +327,14 @@ static void sysrq_handle_globreg(int key, struct tty_struct *tty)
                       ((tp && tp->task) ? tp->task->pid : -1));
 
                if (gp->tstate & TSTATE_PRIV) {
-                       printk("             TPC[%pS] O7[%pS] I7[%pS]\n",
+                       printk("             TPC[%pS] O7[%pS] I7[%pS] RPC[%pS]\n",
                               (void *) gp->tpc,
                               (void *) gp->o7,
-                              (void *) gp->i7);
+                              (void *) gp->i7,
+                              (void *) gp->rpc);
                } else {
-                       printk("             TPC[%lx] O7[%lx] I7[%lx]\n",
-                              gp->tpc, gp->o7, gp->i7);
+                       printk("             TPC[%lx] O7[%lx] I7[%lx] RPC[%lx]\n",
+                              gp->tpc, gp->o7, gp->i7, gp->rpc);
                }
        }
 
@@ -390,6 +343,13 @@ static void sysrq_handle_globreg(int key, struct tty_struct *tty)
        spin_unlock_irqrestore(&global_reg_snapshot_lock, flags);
 }
 
+#ifdef CONFIG_MAGIC_SYSRQ
+
+static void sysrq_handle_globreg(int key, struct tty_struct *tty)
+{
+       __trigger_all_cpu_backtrace();
+}
+
 static struct sysrq_key_op sparc_globalreg_op = {
        .handler        = sysrq_handle_globreg,
        .help_msg       = "Globalregs",
index d1b84456a9eef969d6be3013432ccf1583631971..ca5a6ae3a6e2b37c77bcedb7bb18523cd95d615b 100644 (file)
@@ -2,7 +2,7 @@
  *  arch/sparc64/kernel/signal.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
- *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ *  Copyright (C) 1995, 2008 David S. Miller (davem@davemloft.net)
  *  Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  *  Copyright (C) 1997 Eddie C. Dost   (ecd@skynet.be)
  *  Copyright (C) 1997,1998 Jakub Jelinek   (jj@sunsite.mff.cuni.cz)
@@ -91,7 +91,9 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
        err |= __get_user(regs->u_regs[UREG_G4], (&(*grp)[MC_G4]));
        err |= __get_user(regs->u_regs[UREG_G5], (&(*grp)[MC_G5]));
        err |= __get_user(regs->u_regs[UREG_G6], (&(*grp)[MC_G6]));
-       err |= __get_user(regs->u_regs[UREG_G7], (&(*grp)[MC_G7]));
+
+       /* Skip %g7 as that's the thread register in userspace.  */
+
        err |= __get_user(regs->u_regs[UREG_I0], (&(*grp)[MC_O0]));
        err |= __get_user(regs->u_regs[UREG_I1], (&(*grp)[MC_O1]));
        err |= __get_user(regs->u_regs[UREG_I2], (&(*grp)[MC_O2]));
index 7cf72b4bb1089498348be341ee02a840161a1af3..340842e51ce131d5c3797e89eb376335e92e3374 100644 (file)
@@ -843,7 +843,6 @@ void smp_tsb_sync(struct mm_struct *mm)
 extern unsigned long xcall_flush_tlb_mm;
 extern unsigned long xcall_flush_tlb_pending;
 extern unsigned long xcall_flush_tlb_kernel_range;
-extern unsigned long xcall_report_regs;
 #ifdef CONFIG_MAGIC_SYSRQ
 extern unsigned long xcall_fetch_glob_regs;
 #endif
@@ -1022,11 +1021,6 @@ void kgdb_roundup_cpus(unsigned long flags)
 }
 #endif
 
-void smp_report_regs(void)
-{
-       smp_cross_call(&xcall_report_regs, 0, 0, 0);
-}
-
 #ifdef CONFIG_MAGIC_SYSRQ
 void smp_fetch_global_regs(void)
 {
index 504e678ee128e3998af12688e0678aa4568204a1..0804f71df6cb8422fd09fda447be1a397fbd3c03 100644 (file)
@@ -68,7 +68,6 @@ extern void *__memscan_zero(void *, size_t);
 extern void *__memscan_generic(void *, int, size_t);
 extern int __memcmp(const void *, const void *, __kernel_size_t);
 extern __kernel_size_t strlen(const char *);
-extern void show_regs(struct pt_regs *);
 extern void syscall_trace(struct pt_regs *, int);
 extern void sys_sigsuspend(void);
 extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
index bd30ecba563010bfced1ad54950875e59f160418..404e8561e2d0cec8b6d52a38be95d360624b0be7 100644 (file)
@@ -1777,7 +1777,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
               pfx,
               ent->err_raddr, ent->err_size, ent->err_cpu);
 
-       __show_regs(regs);
+       show_regs(regs);
 
        if ((cnt = atomic_read(ocnt)) != 0) {
                atomic_set(ocnt, 0);
@@ -2177,7 +2177,6 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
 void die_if_kernel(char *str, struct pt_regs *regs)
 {
        static int die_counter;
-       extern void smp_report_regs(void);
        int count = 0;
        
        /* Amuse the user. */
@@ -2190,7 +2189,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
        printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter);
        notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
        __asm__ __volatile__("flushw");
-       __show_regs(regs);
+       show_regs(regs);
        add_taint(TAINT_DIE);
        if (regs->tstate & TSTATE_PRIV) {
                struct reg_window *rw = (struct reg_window *)
@@ -2215,11 +2214,6 @@ void die_if_kernel(char *str, struct pt_regs *regs)
                }
                user_instruction_dump ((unsigned int __user *) regs->tpc);
        }
-#if 0
-#ifdef CONFIG_SMP
-       smp_report_regs();
-#endif
-#endif                                                 
        if (regs->tstate & TSTATE_PRIV)
                do_exit(SIGKILL);
        do_exit(SIGSEGV);
index 4c8ca131ffaf467ec329fc70753f32b076bff392..ff1dc44d363e1cd1349d1b5ad7e26dda18dd394c 100644 (file)
@@ -480,41 +480,6 @@ xcall_sync_tick:
        b               rtrap_xcall
         ldx            [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
 
-       /* NOTE: This is SPECIAL!!  We do etrap/rtrap however
-        *       we choose to deal with the "BH's run with
-        *       %pil==15" problem (described in asm/pil.h)
-        *       by just invoking rtrap directly past where
-        *       BH's are checked for.
-        *
-        *       We do it like this because we do not want %pil==15
-        *       lockups to prevent regs being reported.
-        */
-       .globl          xcall_report_regs
-xcall_report_regs:
-
-661:   rdpr            %pstate, %g2
-       wrpr            %g2, PSTATE_IG | PSTATE_AG, %pstate
-       .section        .sun4v_2insn_patch, "ax"
-       .word           661b
-       nop
-       nop
-       .previous
-
-       rdpr            %pil, %g2
-       wrpr            %g0, 15, %pil
-       sethi           %hi(109f), %g7
-       b,pt            %xcc, etrap_irq
-109:    or             %g7, %lo(109b), %g7
-#ifdef CONFIG_TRACE_IRQFLAGS
-       call            trace_hardirqs_off
-        nop
-#endif
-       call            __show_regs
-        add            %sp, PTREGS_OFF, %o0
-       /* Has to be a non-v9 branch due to the large distance. */
-       b               rtrap_xcall
-        ldx            [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
-
 #ifdef CONFIG_MAGIC_SYSRQ
        .globl          xcall_fetch_glob_regs
 xcall_fetch_glob_regs:
@@ -531,6 +496,13 @@ xcall_fetch_glob_regs:
        stx             %g7, [%g1 + GR_SNAP_TNPC]
        stx             %o7, [%g1 + GR_SNAP_O7]
        stx             %i7, [%g1 + GR_SNAP_I7]
+       /* Don't try this at home kids... */
+       rdpr            %cwp, %g2
+       sub             %g2, 1, %g7
+       wrpr            %g7, %cwp
+       mov             %i7, %g7
+       wrpr            %g2, %cwp
+       stx             %g7, [%g1 + GR_SNAP_RPC]
        sethi           %hi(trap_block), %g7
        or              %g7, %lo(trap_block), %g7
        sllx            %g2, TRAP_BLOCK_SZ_SHIFT, %g2
index 8dbffb846de9b66c5a1aec5cc542dc959acfa924..87d4d6964ec2b9ecb5d83ad01c081589218dc303 100644 (file)
@@ -123,6 +123,14 @@ void __init pci_iommu_alloc(void)
 
        pci_swiotlb_init();
 }
+
+unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
+{
+       unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
+
+       return size >> PAGE_SHIFT;
+}
+EXPORT_SYMBOL(iommu_num_pages);
 #endif
 
 /*
index b520dae02bf4806c6a9f79fd82bf444f24daba0c..2d888586385d2599dce70e99e1b4603714155e9f 100644 (file)
@@ -788,10 +788,6 @@ void __init setup_arch(char **cmdline_p)
 
        initmem_init(0, max_pfn);
 
-#ifdef CONFIG_X86_64
-       dma32_reserve_bootmem();
-#endif
-
 #ifdef CONFIG_ACPI_SLEEP
        /*
         * Reserve low memory region for sleep support.
@@ -806,6 +802,15 @@ void __init setup_arch(char **cmdline_p)
 #endif
        reserve_crashkernel();
 
+#ifdef CONFIG_X86_64
+       /*
+        * dma32_reserve_bootmem() allocates bootmem which may conflict
+        * with the crashkernel command line, so do that after
+        * reserve_crashkernel()
+        */
+       dma32_reserve_bootmem();
+#endif
+
        reserve_ibft_region();
 
 #ifdef CONFIG_KVM_CLOCK
index 2fa231923cf7e90d9e969478f22207ba0040cd57..0bfe2bd305eb286aee2890e2be95b397c462d74c 100644 (file)
@@ -653,6 +653,84 @@ static void rmap_write_protect(struct kvm *kvm, u64 gfn)
        account_shadowed(kvm, gfn);
 }
 
+static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp)
+{
+       u64 *spte;
+       int need_tlb_flush = 0;
+
+       while ((spte = rmap_next(kvm, rmapp, NULL))) {
+               BUG_ON(!(*spte & PT_PRESENT_MASK));
+               rmap_printk("kvm_rmap_unmap_hva: spte %p %llx\n", spte, *spte);
+               rmap_remove(kvm, spte);
+               set_shadow_pte(spte, shadow_trap_nonpresent_pte);
+               need_tlb_flush = 1;
+       }
+       return need_tlb_flush;
+}
+
+static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
+                         int (*handler)(struct kvm *kvm, unsigned long *rmapp))
+{
+       int i;
+       int retval = 0;
+
+       /*
+        * If mmap_sem isn't taken, we can look the memslots with only
+        * the mmu_lock by skipping over the slots with userspace_addr == 0.
+        */
+       for (i = 0; i < kvm->nmemslots; i++) {
+               struct kvm_memory_slot *memslot = &kvm->memslots[i];
+               unsigned long start = memslot->userspace_addr;
+               unsigned long end;
+
+               /* mmu_lock protects userspace_addr */
+               if (!start)
+                       continue;
+
+               end = start + (memslot->npages << PAGE_SHIFT);
+               if (hva >= start && hva < end) {
+                       gfn_t gfn_offset = (hva - start) >> PAGE_SHIFT;
+                       retval |= handler(kvm, &memslot->rmap[gfn_offset]);
+                       retval |= handler(kvm,
+                                         &memslot->lpage_info[
+                                                 gfn_offset /
+                                                 KVM_PAGES_PER_HPAGE].rmap_pde);
+               }
+       }
+
+       return retval;
+}
+
+int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
+{
+       return kvm_handle_hva(kvm, hva, kvm_unmap_rmapp);
+}
+
+static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp)
+{
+       u64 *spte;
+       int young = 0;
+
+       spte = rmap_next(kvm, rmapp, NULL);
+       while (spte) {
+               int _young;
+               u64 _spte = *spte;
+               BUG_ON(!(_spte & PT_PRESENT_MASK));
+               _young = _spte & PT_ACCESSED_MASK;
+               if (_young) {
+                       young = 1;
+                       clear_bit(PT_ACCESSED_SHIFT, (unsigned long *)spte);
+               }
+               spte = rmap_next(kvm, rmapp, spte);
+       }
+       return young;
+}
+
+int kvm_age_hva(struct kvm *kvm, unsigned long hva)
+{
+       return kvm_handle_hva(kvm, hva, kvm_age_rmapp);
+}
+
 #ifdef MMU_DEBUG
 static int is_empty_shadow_page(u64 *spt)
 {
@@ -1203,6 +1281,7 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
        int r;
        int largepage = 0;
        pfn_t pfn;
+       unsigned long mmu_seq;
 
        down_read(&current->mm->mmap_sem);
        if (is_largepage_backed(vcpu, gfn & ~(KVM_PAGES_PER_HPAGE-1))) {
@@ -1210,6 +1289,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
                largepage = 1;
        }
 
+       mmu_seq = vcpu->kvm->mmu_notifier_seq;
+       /* implicit mb(), we'll read before PT lock is unlocked */
        pfn = gfn_to_pfn(vcpu->kvm, gfn);
        up_read(&current->mm->mmap_sem);
 
@@ -1220,6 +1301,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
        }
 
        spin_lock(&vcpu->kvm->mmu_lock);
+       if (mmu_notifier_retry(vcpu, mmu_seq))
+               goto out_unlock;
        kvm_mmu_free_some_pages(vcpu);
        r = __direct_map(vcpu, v, write, largepage, gfn, pfn,
                         PT32E_ROOT_LEVEL);
@@ -1227,6 +1310,11 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
 
 
        return r;
+
+out_unlock:
+       spin_unlock(&vcpu->kvm->mmu_lock);
+       kvm_release_pfn_clean(pfn);
+       return 0;
 }
 
 
@@ -1345,6 +1433,7 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa,
        int r;
        int largepage = 0;
        gfn_t gfn = gpa >> PAGE_SHIFT;
+       unsigned long mmu_seq;
 
        ASSERT(vcpu);
        ASSERT(VALID_PAGE(vcpu->arch.mmu.root_hpa));
@@ -1358,6 +1447,8 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa,
                gfn &= ~(KVM_PAGES_PER_HPAGE-1);
                largepage = 1;
        }
+       mmu_seq = vcpu->kvm->mmu_notifier_seq;
+       /* implicit mb(), we'll read before PT lock is unlocked */
        pfn = gfn_to_pfn(vcpu->kvm, gfn);
        up_read(&current->mm->mmap_sem);
        if (is_error_pfn(pfn)) {
@@ -1365,12 +1456,19 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa,
                return 1;
        }
        spin_lock(&vcpu->kvm->mmu_lock);
+       if (mmu_notifier_retry(vcpu, mmu_seq))
+               goto out_unlock;
        kvm_mmu_free_some_pages(vcpu);
        r = __direct_map(vcpu, gpa, error_code & PFERR_WRITE_MASK,
                         largepage, gfn, pfn, kvm_x86_ops->get_tdp_level());
        spin_unlock(&vcpu->kvm->mmu_lock);
 
        return r;
+
+out_unlock:
+       spin_unlock(&vcpu->kvm->mmu_lock);
+       kvm_release_pfn_clean(pfn);
+       return 0;
 }
 
 static void nonpaging_free(struct kvm_vcpu *vcpu)
@@ -1670,6 +1768,8 @@ static void mmu_guess_page_from_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
                gfn &= ~(KVM_PAGES_PER_HPAGE-1);
                vcpu->arch.update_pte.largepage = 1;
        }
+       vcpu->arch.update_pte.mmu_seq = vcpu->kvm->mmu_notifier_seq;
+       /* implicit mb(), we'll read before PT lock is unlocked */
        pfn = gfn_to_pfn(vcpu->kvm, gfn);
        up_read(&current->mm->mmap_sem);
 
index 4d918220baebf128f3db1d825f2b23895f53c933..f72ac1fa35f0bfe07b74b43f2275c28402518c9e 100644 (file)
@@ -263,6 +263,8 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page,
        pfn = vcpu->arch.update_pte.pfn;
        if (is_error_pfn(pfn))
                return;
+       if (mmu_notifier_retry(vcpu, vcpu->arch.update_pte.mmu_seq))
+               return;
        kvm_get_pfn(pfn);
        mmu_set_spte(vcpu, spte, page->role.access, pte_access, 0, 0,
                     gpte & PT_DIRTY_MASK, NULL, largepage, gpte_to_gfn(gpte),
@@ -380,6 +382,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
        int r;
        pfn_t pfn;
        int largepage = 0;
+       unsigned long mmu_seq;
 
        pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code);
        kvm_mmu_audit(vcpu, "pre page fault");
@@ -413,6 +416,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
                        largepage = 1;
                }
        }
+       mmu_seq = vcpu->kvm->mmu_notifier_seq;
+       /* implicit mb(), we'll read before PT lock is unlocked */
        pfn = gfn_to_pfn(vcpu->kvm, walker.gfn);
        up_read(&current->mm->mmap_sem);
 
@@ -424,6 +429,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
        }
 
        spin_lock(&vcpu->kvm->mmu_lock);
+       if (mmu_notifier_retry(vcpu, mmu_seq))
+               goto out_unlock;
        kvm_mmu_free_some_pages(vcpu);
        shadow_pte = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault,
                                  largepage, &write_pt, pfn);
@@ -439,6 +446,11 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
        spin_unlock(&vcpu->kvm->mmu_lock);
 
        return write_pt;
+
+out_unlock:
+       spin_unlock(&vcpu->kvm->mmu_lock);
+       kvm_release_pfn_clean(pfn);
+       return 0;
 }
 
 static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr)
index 5916191420c714d7e9b43ca9b1bf995672f88eab..0d682fc6aeb333c382e6b9324105e2eb941bc545 100644 (file)
@@ -883,6 +883,7 @@ int kvm_dev_ioctl_check_extension(long ext)
        case KVM_CAP_PIT:
        case KVM_CAP_NOP_IO_DELAY:
        case KVM_CAP_MP_STATE:
+       case KVM_CAP_SYNC_MMU:
                r = 1;
                break;
        case KVM_CAP_COALESCED_MMIO:
@@ -1495,6 +1496,7 @@ static int kvm_vm_ioctl_set_memory_alias(struct kvm *kvm,
                goto out;
 
        down_write(&kvm->slots_lock);
+       spin_lock(&kvm->mmu_lock);
 
        p = &kvm->arch.aliases[alias->slot];
        p->base_gfn = alias->guest_phys_addr >> PAGE_SHIFT;
@@ -1506,6 +1508,7 @@ static int kvm_vm_ioctl_set_memory_alias(struct kvm *kvm,
                        break;
        kvm->arch.naliases = n;
 
+       spin_unlock(&kvm->mmu_lock);
        kvm_mmu_zap_all(kvm);
 
        up_write(&kvm->slots_lock);
@@ -3972,16 +3975,23 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
         */
        if (!user_alloc) {
                if (npages && !old.rmap) {
+                       unsigned long userspace_addr;
+
                        down_write(&current->mm->mmap_sem);
-                       memslot->userspace_addr = do_mmap(NULL, 0,
-                                                    npages * PAGE_SIZE,
-                                                    PROT_READ | PROT_WRITE,
-                                                    MAP_SHARED | MAP_ANONYMOUS,
-                                                    0);
+                       userspace_addr = do_mmap(NULL, 0,
+                                                npages * PAGE_SIZE,
+                                                PROT_READ | PROT_WRITE,
+                                                MAP_SHARED | MAP_ANONYMOUS,
+                                                0);
                        up_write(&current->mm->mmap_sem);
 
-                       if (IS_ERR((void *)memslot->userspace_addr))
-                               return PTR_ERR((void *)memslot->userspace_addr);
+                       if (IS_ERR((void *)userspace_addr))
+                               return PTR_ERR((void *)userspace_addr);
+
+                       /* set userspace_addr atomically for kvm_hva_to_rmapp */
+                       spin_lock(&kvm->mmu_lock);
+                       memslot->userspace_addr = userspace_addr;
+                       spin_unlock(&kvm->mmu_lock);
                } else {
                        if (!old.user_alloc && old.rmap) {
                                int ret;
index fef79ccb2a118da2f6f3144c993c8338c7205351..4889eb86a39e883c040d53627c98e61a96cd0e26 100644 (file)
@@ -212,6 +212,24 @@ void blk_plug_device(struct request_queue *q)
 }
 EXPORT_SYMBOL(blk_plug_device);
 
+/**
+ * blk_plug_device_unlocked - plug a device without queue lock held
+ * @q:    The &struct request_queue to plug
+ *
+ * Description:
+ *   Like @blk_plug_device(), but grabs the queue lock and disables
+ *   interrupts.
+ **/
+void blk_plug_device_unlocked(struct request_queue *q)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(q->queue_lock, flags);
+       blk_plug_device(q);
+       spin_unlock_irqrestore(q->queue_lock, flags);
+}
+EXPORT_SYMBOL(blk_plug_device_unlocked);
+
 /*
  * remove the queue from the plugged list, if present. called with
  * queue lock held and interrupts disabled.
index 54ec5e718c0e32296ea0c78e515930713f05c811..a280ab3d0833fa29e8ae031bbb53bfdba37c4191 100644 (file)
@@ -97,3 +97,4 @@ obj-$(CONFIG_PPC_PS3)         += ps3/
 obj-$(CONFIG_OF)               += of/
 obj-$(CONFIG_SSB)              += ssb/
 obj-$(CONFIG_VIRTIO)           += virtio/
+obj-$(CONFIG_REGULATOR)                += regulator/
index 44ad90c03c2ecaa615f9e6aa6f5366cc994e1399..d3d0886d637f4f6e33e7a0f0ed54fe00560d2615 100644 (file)
@@ -78,9 +78,9 @@ MODULE_LICENSE("GPL");
 static uid_t asus_uid;
 static gid_t asus_gid;
 module_param(asus_uid, uint, 0);
-MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus.\n");
+MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus");
 module_param(asus_gid, uint, 0);
-MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus.\n");
+MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus");
 
 /* For each model, all features implemented, 
  * those marked with R are relative to HOTK, A for absolute */
index a90ae03f56b2e1f09793a8ddc63aca41a281b9f8..c294121fd69e71e68e84a328c8d8ed63f6e7a65e 100644 (file)
@@ -250,6 +250,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
        /* Mobile SATA Controller IDE (ICH8M), Apple */
        { 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata },
        { 0x8086, 0x2828, 0x106b, 0x00a1, 0, 0, ich8m_apple_sata },
+       { 0x8086, 0x2828, 0x106b, 0x00a3, 0, 0, ich8m_apple_sata },
        /* Mobile SATA Controller IDE (ICH8M) */
        { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
        /* SATA Controller IDE (ICH9) */
index 9bef1a84fe3f926832b21986d46d93f3bcef72ed..5ba96c5052c8c737bf8e07d8968affb334636ccd 100644 (file)
@@ -120,7 +120,7 @@ static char ata_force_param_buf[PAGE_SIZE] __initdata;
 module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0);
 MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)");
 
-int atapi_enabled = 1;
+static int atapi_enabled = 1;
 module_param(atapi_enabled, int, 0444);
 MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");
 
@@ -1132,6 +1132,8 @@ void ata_id_string(const u16 *id, unsigned char *s,
 {
        unsigned int c;
 
+       BUG_ON(len & 1);
+
        while (len > 0) {
                c = id[ofs] >> 8;
                *s = c;
@@ -1165,8 +1167,6 @@ void ata_id_c_string(const u16 *id, unsigned char *s,
 {
        unsigned char *p;
 
-       WARN_ON(!(len & 1));
-
        ata_id_string(id, s, ofs, len - 1);
 
        p = s + strnlen(s, len - 1);
@@ -1885,6 +1885,23 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
        return 3 << ATA_SHIFT_PIO;
 }
 
+/**
+ *     ata_do_dev_read_id              -       default ID read method
+ *     @dev: device
+ *     @tf: proposed taskfile
+ *     @id: data buffer
+ *
+ *     Issue the identify taskfile and hand back the buffer containing
+ *     identify data. For some RAID controllers and for pre ATA devices
+ *     this function is wrapped or replaced by the driver
+ */
+unsigned int ata_do_dev_read_id(struct ata_device *dev,
+                                       struct ata_taskfile *tf, u16 *id)
+{
+       return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
+                                    id, sizeof(id[0]) * ATA_ID_WORDS, 0);
+}
+
 /**
  *     ata_dev_read_id - Read ID data from the specified device
  *     @dev: target device
@@ -1920,7 +1937,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
        if (ata_msg_ctl(ap))
                ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__);
 
- retry:
+retry:
        ata_tf_init(dev, &tf);
 
        switch (class) {
@@ -1948,8 +1965,11 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
         */
        tf.flags |= ATA_TFLAG_POLLING;
 
-       err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE,
-                                    id, sizeof(id[0]) * ATA_ID_WORDS, 0);
+       if (ap->ops->read_id)
+               err_mask = ap->ops->read_id(dev, &tf, id);
+       else
+               err_mask = ata_do_dev_read_id(dev, &tf, id);
+
        if (err_mask) {
                if (err_mask & AC_ERR_NODEV_HINT) {
                        ata_dev_printk(dev, KERN_DEBUG,
@@ -2142,6 +2162,16 @@ int ata_dev_configure(struct ata_device *dev)
                return 0;
        }
 
+       if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) &&
+           dev->class == ATA_DEV_ATAPI) {
+               ata_dev_printk(dev, KERN_WARNING,
+                       "WARNING: ATAPI is %s, device ignored.\n",
+                       atapi_enabled ? "not supported with this driver"
+                                     : "disabled");
+               ata_dev_disable(dev);
+               return 0;
+       }
+
        /* let ACPI work its magic */
        rc = ata_acpi_on_devcfg(dev);
        if (rc)
@@ -6088,16 +6118,20 @@ static int __init ata_init(void)
 
        ata_wq = create_workqueue("ata");
        if (!ata_wq)
-               return -ENOMEM;
+               goto free_force_tbl;
 
        ata_aux_wq = create_singlethread_workqueue("ata_aux");
-       if (!ata_aux_wq) {
-               destroy_workqueue(ata_wq);
-               return -ENOMEM;
-       }
+       if (!ata_aux_wq)
+               goto free_wq;
 
        printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
        return 0;
+
+free_wq:
+       destroy_workqueue(ata_wq);
+free_force_tbl:
+       kfree(ata_force_tbl);
+       return -ENOMEM;
 }
 
 static void __exit ata_exit(void)
@@ -6269,6 +6303,7 @@ EXPORT_SYMBOL_GPL(ata_host_resume);
 #endif /* CONFIG_PM */
 EXPORT_SYMBOL_GPL(ata_id_string);
 EXPORT_SYMBOL_GPL(ata_id_c_string);
+EXPORT_SYMBOL_GPL(ata_do_dev_read_id);
 EXPORT_SYMBOL_GPL(ata_scsi_simulate);
 
 EXPORT_SYMBOL_GPL(ata_pio_need_iordy);
index f3b4b15a8dc49509802a7cf06bae5fba2d8f6dfb..b9d3ba423cb2d30eefc17bb349bee2376f624343 100644 (file)
@@ -2550,36 +2550,6 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap,
        return ata_find_dev(ap, devno);
 }
 
-/**
- *     ata_scsi_dev_enabled - determine if device is enabled
- *     @dev: ATA device
- *
- *     Determine if commands should be sent to the specified device.
- *
- *     LOCKING:
- *     spin_lock_irqsave(host lock)
- *
- *     RETURNS:
- *     0 if commands are not allowed / 1 if commands are allowed
- */
-
-static int ata_scsi_dev_enabled(struct ata_device *dev)
-{
-       if (unlikely(!ata_dev_enabled(dev)))
-               return 0;
-
-       if (!atapi_enabled || (dev->link->ap->flags & ATA_FLAG_NO_ATAPI)) {
-               if (unlikely(dev->class == ATA_DEV_ATAPI)) {
-                       ata_dev_printk(dev, KERN_WARNING,
-                                      "WARNING: ATAPI is %s, device ignored.\n",
-                                      atapi_enabled ? "not supported with this driver" : "disabled");
-                       return 0;
-               }
-       }
-
-       return 1;
-}
-
 /**
  *     ata_scsi_find_dev - lookup ata_device from scsi_cmnd
  *     @ap: ATA port to which the device is attached
@@ -2601,7 +2571,7 @@ ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
 {
        struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);
 
-       if (unlikely(!dev || !ata_scsi_dev_enabled(dev)))
+       if (unlikely(!dev || !ata_dev_enabled(dev)))
                return NULL;
 
        return dev;
@@ -3622,7 +3592,7 @@ int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
 
        ata_scsi_dump_cdb(ap, cmd);
 
-       if (likely(ata_scsi_dev_enabled(ap->link.device)))
+       if (likely(ata_dev_enabled(ap->link.device)))
                rc = __ata_scsi_queuecmd(cmd, done, ap->link.device);
        else {
                cmd->result = (DID_BAD_TARGET << 16);
index f6f9c28ec7f834932d16a541004919212bf3a626..ade5c75b61446c75adb4174ea3c967c872c548fa 100644 (file)
@@ -66,7 +66,6 @@ enum {
 
 extern unsigned int ata_print_id;
 extern struct workqueue_struct *ata_aux_wq;
-extern int atapi_enabled;
 extern int atapi_passthru16;
 extern int libata_fua;
 extern int libata_noacpi;
index 0f3e659db99a029a4392f843a2cca441bcac553c..5ca70fa1f587e2d7953655311f5417313185882b 100644 (file)
@@ -550,8 +550,9 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                pci_read_config_byte(isa_bridge, 0x5E, &tmp);
                if ((tmp & 0x1E) == 0x12)
                        ppi[0] = &info_20_udma;
-               pci_dev_put(isa_bridge);
        }
+       pci_dev_put(isa_bridge);
+
        return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL);
 }
 
index e10816931b2fe72b25454e60e0ed7925e7ac50ed..27843c70eb9dc64e8d6292e2dc7fe2ee425bae40 100644 (file)
@@ -80,7 +80,7 @@
 
 
 #define DRV_NAME "pata_it821x"
-#define DRV_VERSION "0.3.8"
+#define DRV_VERSION "0.4.0"
 
 struct it821x_dev
 {
@@ -425,6 +425,8 @@ static unsigned int it821x_smart_qc_issue(struct ata_queued_cmd *qc)
                case ATA_CMD_WRITE_MULTI:
                case ATA_CMD_WRITE_MULTI_EXT:
                case ATA_CMD_ID_ATA:
+               case ATA_CMD_INIT_DEV_PARAMS:
+               case 0xFC:      /* Internal 'report rebuild state' */
                /* Arguably should just no-op this one */
                case ATA_CMD_SET_FEATURES:
                        return ata_sff_qc_issue(qc);
@@ -509,7 +511,7 @@ static void it821x_dev_config(struct ata_device *adev)
 
        if (strstr(model_num, "Integrated Technology Express")) {
                /* RAID mode */
-               printk(KERN_INFO "IT821x %sRAID%d volume",
+               ata_dev_printk(adev, KERN_INFO, "%sRAID%d volume",
                        adev->id[147]?"Bootable ":"",
                        adev->id[129]);
                if (adev->id[129] != 1)
@@ -519,37 +521,51 @@ static void it821x_dev_config(struct ata_device *adev)
        /* This is a controller firmware triggered funny, don't
           report the drive faulty! */
        adev->horkage &= ~ATA_HORKAGE_DIAGNOSTIC;
+       /* No HPA in 'smart' mode */
+       adev->horkage |= ATA_HORKAGE_BROKEN_HPA;
 }
 
 /**
- *     it821x_ident_hack       -       Hack identify data up
- *     @ap: Port
+ *     it821x_read_id  -       Hack identify data up
+ *     @adev: device to read
+ *     @tf: proposed taskfile
+ *     @id: buffer for returned ident data
  *
- *     Walk the devices on this firmware driven port and slightly
+ *     Query the devices on this firmware driven port and slightly
  *     mash the identify data to stop us and common tools trying to
  *     use features not firmware supported. The firmware itself does
  *     some masking (eg SMART) but not enough.
- *
- *     This is a bit of an abuse of the cable method, but it is the
- *     only method called at the right time. We could modify the libata
- *     core specifically for ident hacking but while we have one offender
- *     it seems better to keep the fallout localised.
  */
 
-static int it821x_ident_hack(struct ata_port *ap)
+static unsigned int it821x_read_id(struct ata_device *adev,
+                                       struct ata_taskfile *tf, u16 *id)
 {
-       struct ata_device *adev;
-       ata_link_for_each_dev(adev, &ap->link) {
-               if (ata_dev_enabled(adev)) {
-                       adev->id[84] &= ~(1 << 6);      /* No FUA */
-                       adev->id[85] &= ~(1 << 10);     /* No HPA */
-                       adev->id[76] = 0;               /* No NCQ/AN etc */
-               }
+       unsigned int err_mask;
+       unsigned char model_num[ATA_ID_PROD_LEN + 1];
+
+       err_mask = ata_do_dev_read_id(adev, tf, id);
+       if (err_mask)
+               return err_mask;
+       ata_id_c_string(id, model_num, ATA_ID_PROD, sizeof(model_num));
+
+       id[83] &= ~(1 << 12);   /* Cache flush is firmware handled */
+       id[83] &= ~(1 << 13);   /* Ditto for LBA48 flushes */
+       id[84] &= ~(1 << 6);    /* No FUA */
+       id[85] &= ~(1 << 10);   /* No HPA */
+       id[76] = 0;             /* No NCQ/AN etc */
+
+       if (strstr(model_num, "Integrated Technology Express")) {
+               /* Set feature bits the firmware neglects */
+               id[49] |= 0x0300;       /* LBA, DMA */
+               id[82] |= 0x0400;       /* LBA48 */
+               id[83] &= 0x7FFF;
+               id[83] |= 0x4000;       /* Word 83 is valid */
+               id[86] |= 0x0400;       /* LBA48 on */
+               id[ATA_ID_MAJOR_VER] |= 0x1F;
        }
-       return ata_cable_unknown(ap);
+       return err_mask;
 }
 
-
 /**
  *     it821x_check_atapi_dma  -       ATAPI DMA handler
  *     @qc: Command we are about to issue
@@ -577,6 +593,136 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc)
        return 0;
 }
 
+/**
+ *     it821x_display_disk     -       display disk setup
+ *     @n: Device number
+ *     @buf: Buffer block from firmware
+ *
+ *     Produce a nice informative display of the device setup as provided
+ *     by the firmware.
+ */
+
+static void it821x_display_disk(int n, u8 *buf)
+{
+       unsigned char id[41];
+       int mode = 0;
+       char *mtype;
+       char mbuf[8];
+       char *cbl = "(40 wire cable)";
+
+       static const char *types[5] = {
+               "RAID0", "RAID1" "RAID 0+1", "JBOD", "DISK"
+       };
+
+       if (buf[52] > 4)        /* No Disk */
+               return;
+
+       ata_id_c_string((u16 *)buf, id, 0, 41); 
+
+       if (buf[51]) {
+               mode = ffs(buf[51]);
+               mtype = "UDMA";
+       } else if (buf[49]) {
+               mode = ffs(buf[49]);
+               mtype = "MWDMA";
+       }
+
+       if (buf[76])
+               cbl = "";
+
+       if (mode)
+               snprintf(mbuf, 8, "%5s%d", mtype, mode - 1);
+       else
+               strcpy(mbuf, "PIO");
+       if (buf[52] == 4)
+               printk(KERN_INFO "%d: %-6s %-8s          %s %s\n",
+                               n, mbuf, types[buf[52]], id, cbl);
+       else
+               printk(KERN_INFO "%d: %-6s %-8s Volume: %1d %s %s\n",
+                               n, mbuf, types[buf[52]], buf[53], id, cbl);
+       if (buf[125] < 100)
+               printk(KERN_INFO "%d: Rebuilding: %d%%\n", n, buf[125]);
+}
+
+/**
+ *     it821x_firmware_command         -       issue firmware command
+ *     @ap: IT821x port to interrogate
+ *     @cmd: command
+ *     @len: length
+ *
+ *     Issue firmware commands expecting data back from the controller. We
+ *     use this to issue commands that do not go via the normal paths. Other
+ *     commands such as 0xFC can be issued normally.
+ */
+
+static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len)
+{
+       u8 status;
+       int n = 0;
+       u16 *buf = kmalloc(len, GFP_KERNEL);
+       if (buf == NULL) {
+               printk(KERN_ERR "it821x_firmware_command: Out of memory\n");
+               return NULL;
+       }
+       /* This isn't quite a normal ATA command as we are talking to the
+          firmware not the drives */
+       ap->ctl |= ATA_NIEN;
+       iowrite8(ap->ctl, ap->ioaddr.ctl_addr);
+       ata_wait_idle(ap);
+       iowrite8(ATA_DEVICE_OBS, ap->ioaddr.device_addr);
+       iowrite8(cmd, ap->ioaddr.command_addr);
+       udelay(1);
+       /* This should be almost immediate but a little paranoia goes a long
+          way. */
+       while(n++ < 10) {
+               status = ioread8(ap->ioaddr.status_addr);
+               if (status & ATA_ERR) {
+                       kfree(buf);
+                       printk(KERN_ERR "it821x_firmware_command: rejected\n");
+                       return NULL;
+               }
+               if (status & ATA_DRQ) {
+                       ioread16_rep(ap->ioaddr.data_addr, buf, len/2);
+                       return (u8 *)buf;
+               }
+               mdelay(1);
+       }
+       kfree(buf);
+       printk(KERN_ERR "it821x_firmware_command: timeout\n");
+       return NULL;
+}
+
+/**
+ *     it821x_probe_firmware   -       firmware reporting/setup
+ *     @ap: IT821x port being probed
+ *
+ *     Probe the firmware of the controller by issuing firmware command
+ *     0xFA and analysing the returned data.
+ */
+
+static void it821x_probe_firmware(struct ata_port *ap)
+{
+       u8 *buf;
+       int i;
+
+       /* This is a bit ugly as we can't just issue a task file to a device
+          as this is controller magic */
+
+       buf = it821x_firmware_command(ap, 0xFA, 512);
+
+       if (buf != NULL) {
+               printk(KERN_INFO "pata_it821x: Firmware %02X/%02X/%02X%02X\n",
+                               buf[505],
+                               buf[506],
+                               buf[507],
+                               buf[508]);
+               for (i = 0; i < 4; i++)
+                       it821x_display_disk(i, buf + 128 * i);
+               kfree(buf);
+       }
+}
+
+
 
 /**
  *     it821x_port_start       -       port setup
@@ -610,6 +756,8 @@ static int it821x_port_start(struct ata_port *ap)
                /* Long I/O's although allowed in LBA48 space cause the
                   onboard firmware to enter the twighlight zone */
                /* No ATAPI DMA in this mode either */
+               if (ap->port_no == 0)
+                       it821x_probe_firmware(ap);
        }
        /* Pull the current clocks from 0x50 */
        if (conf & (1 << (1 + ap->port_no)))
@@ -631,6 +779,25 @@ static int it821x_port_start(struct ata_port *ap)
        return 0;
 }
 
+/**
+ *     it821x_rdc_cable        -       Cable detect for RDC1010
+ *     @ap: port we are checking
+ *
+ *     Return the RDC1010 cable type. Unlike the IT821x we know how to do
+ *     this and can do host side cable detect
+ */
+
+static int it821x_rdc_cable(struct ata_port *ap)
+{
+       u16 r40;
+       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+
+       pci_read_config_word(pdev, 0x40, &r40);
+       if (r40 & (1 << (2 + ap->port_no)))
+               return ATA_CBL_PATA40;
+       return ATA_CBL_PATA80;
+}
+
 static struct scsi_host_template it821x_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
@@ -641,9 +808,10 @@ static struct ata_port_operations it821x_smart_port_ops = {
        .check_atapi_dma= it821x_check_atapi_dma,
        .qc_issue       = it821x_smart_qc_issue,
 
-       .cable_detect   = it821x_ident_hack,
+       .cable_detect   = ata_cable_80wire,
        .set_mode       = it821x_smart_set_mode,
        .dev_config     = it821x_dev_config,
+       .read_id        = it821x_read_id,
 
        .port_start     = it821x_port_start,
 };
@@ -664,8 +832,29 @@ static struct ata_port_operations it821x_passthru_port_ops = {
        .port_start     = it821x_port_start,
 };
 
+static struct ata_port_operations it821x_rdc_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+
+       .check_atapi_dma= it821x_check_atapi_dma,
+       .sff_dev_select = it821x_passthru_dev_select,
+       .bmdma_start    = it821x_passthru_bmdma_start,
+       .bmdma_stop     = it821x_passthru_bmdma_stop,
+       .qc_issue       = it821x_passthru_qc_issue,
+
+       .cable_detect   = it821x_rdc_cable,
+       .set_piomode    = it821x_passthru_set_piomode,
+       .set_dmamode    = it821x_passthru_set_dmamode,
+
+       .port_start     = it821x_port_start,
+};
+
 static void it821x_disable_raid(struct pci_dev *pdev)
 {
+       /* Neither the RDC nor the IT8211 */
+       if (pdev->vendor != PCI_VENDOR_ID_ITE ||
+                       pdev->device != PCI_DEVICE_ID_ITE_8212)
+                       return;
+
        /* Reset local CPU, and set BIOS not ready */
        pci_write_config_byte(pdev, 0x5E, 0x01);
 
@@ -690,6 +879,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
+               .udma_mask = ATA_UDMA6,
                .port_ops = &it821x_smart_port_ops
        };
        static const struct ata_port_info info_passthru = {
@@ -699,6 +889,13 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                .udma_mask = ATA_UDMA6,
                .port_ops = &it821x_passthru_port_ops
        };
+       static const struct ata_port_info info_rdc = {
+               .flags = ATA_FLAG_SLAVE_POSS,
+               .pio_mask = 0x1f,
+               .mwdma_mask = 0x07,
+               /* No UDMA */
+               .port_ops = &it821x_rdc_port_ops
+       };
 
        const struct ata_port_info *ppi[] = { NULL, NULL };
        static char *mode[2] = { "pass through", "smart" };
@@ -707,21 +904,25 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        rc = pcim_enable_device(pdev);
        if (rc)
                return rc;
+               
+       if (pdev->vendor == PCI_VENDOR_ID_RDC) {
+               ppi[0] = &info_rdc;
+       } else {
+               /* Force the card into bypass mode if so requested */
+               if (it8212_noraid) {
+                       printk(KERN_INFO DRV_NAME ": forcing bypass mode.\n");
+                       it821x_disable_raid(pdev);
+               }
+               pci_read_config_byte(pdev, 0x50, &conf);
+               conf &= 1;
 
-       /* Force the card into bypass mode if so requested */
-       if (it8212_noraid) {
-               printk(KERN_INFO DRV_NAME ": forcing bypass mode.\n");
-               it821x_disable_raid(pdev);
+               printk(KERN_INFO DRV_NAME": controller in %s mode.\n",
+                                                               mode[conf]);
+               if (conf == 0)
+                       ppi[0] = &info_passthru;
+               else
+                       ppi[0] = &info_smart;
        }
-       pci_read_config_byte(pdev, 0x50, &conf);
-       conf &= 1;
-
-       printk(KERN_INFO DRV_NAME ": controller in %s mode.\n", mode[conf]);
-       if (conf == 0)
-               ppi[0] = &info_passthru;
-       else
-               ppi[0] = &info_smart;
-
        return ata_pci_sff_init_one(pdev, ppi, &it821x_sht, NULL);
 }
 
@@ -745,6 +946,7 @@ static int it821x_reinit_one(struct pci_dev *pdev)
 static const struct pci_device_id it821x[] = {
        { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), },
        { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), },
+       { PCI_VDEVICE(RDC, 0x1010), },
 
        { },
 };
index 708ed144ede9175219a93f6acc499f6cd7421952..57d951b11f2d840c18d92f7ed180ef7a240a386d 100644 (file)
@@ -98,7 +98,8 @@ static const struct via_isa_bridge {
        u8 rev_max;
        u16 flags;
 } via_isa_bridges[] = {
-       { "vx800",      PCI_DEVICE_ID_VIA_VX800,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
+       { "vx800",      PCI_DEVICE_ID_VIA_VX800,    0x00, 0x2f, VIA_UDMA_133 |
+       VIA_BAD_AST | VIA_SATA_PATA },
        { "vt8237s",    PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8251",     PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
@@ -322,6 +323,65 @@ static void via_set_dmamode(struct ata_port *ap, struct ata_device *adev)
        via_do_set_mode(ap, adev, adev->dma_mode, tclock[mode], set_ast, udma[mode]);
 }
 
+/**
+ *     via_ata_sff_tf_load - send taskfile registers to host controller
+ *     @ap: Port to which output is sent
+ *     @tf: ATA taskfile register set
+ *
+ *     Outputs ATA taskfile to standard ATA host controller.
+ *
+ *     Note: This is to fix the internal bug of via chipsets, which
+ *  will reset the device register after changing the IEN bit on
+ *  ctl register
+ */
+static void via_ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
+{
+       struct ata_ioports *ioaddr = &ap->ioaddr;
+       unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
+
+       if (tf->ctl != ap->last_ctl) {
+               iowrite8(tf->ctl, ioaddr->ctl_addr);
+               iowrite8(tf->device, ioaddr->device_addr);
+               ap->last_ctl = tf->ctl;
+               ata_wait_idle(ap);
+       }
+
+       if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
+               iowrite8(tf->hob_feature, ioaddr->feature_addr);
+               iowrite8(tf->hob_nsect, ioaddr->nsect_addr);
+               iowrite8(tf->hob_lbal, ioaddr->lbal_addr);
+               iowrite8(tf->hob_lbam, ioaddr->lbam_addr);
+               iowrite8(tf->hob_lbah, ioaddr->lbah_addr);
+               VPRINTK("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n",
+                       tf->hob_feature,
+                       tf->hob_nsect,
+                       tf->hob_lbal,
+                       tf->hob_lbam,
+                       tf->hob_lbah);
+       }
+
+       if (is_addr) {
+               iowrite8(tf->feature, ioaddr->feature_addr);
+               iowrite8(tf->nsect, ioaddr->nsect_addr);
+               iowrite8(tf->lbal, ioaddr->lbal_addr);
+               iowrite8(tf->lbam, ioaddr->lbam_addr);
+               iowrite8(tf->lbah, ioaddr->lbah_addr);
+               VPRINTK("feat 0x%X nsect 0x%X lba 0x%X 0x%X 0x%X\n",
+                       tf->feature,
+                       tf->nsect,
+                       tf->lbal,
+                       tf->lbam,
+                       tf->lbah);
+       }
+
+       if (tf->flags & ATA_TFLAG_DEVICE) {
+               iowrite8(tf->device, ioaddr->device_addr);
+               VPRINTK("device 0x%X\n", tf->device);
+       }
+
+       ata_wait_idle(ap);
+}
+
 static struct scsi_host_template via_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
@@ -332,11 +392,13 @@ static struct ata_port_operations via_port_ops = {
        .set_piomode    = via_set_piomode,
        .set_dmamode    = via_set_dmamode,
        .prereset       = via_pre_reset,
+       .sff_tf_load = via_ata_tf_load,
 };
 
 static struct ata_port_operations via_port_ops_noirq = {
        .inherits       = &via_port_ops,
        .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_tf_load = via_ata_tf_load,
 };
 
 /**
index 24df73ad326dcf893419e5332f024019b536ed7d..088885ed51b9918ab6cfbd9d5f773552bd2086eb 100644 (file)
@@ -156,8 +156,8 @@ static void ia_hack_tcq(IADEV *dev) {
         }
         iavcc_r->vc_desc_cnt--;
         dev->desc_tbl[desc1 -1].timestamp = 0;
-        IF_EVENT(printk("ia_hack: return_q skb = 0x%x desc = %d\n", 
-                                   (u32)dev->desc_tbl[desc1 -1].txskb, desc1);)
+        IF_EVENT(printk("ia_hack: return_q skb = 0x%p desc = %d\n",
+                                   dev->desc_tbl[desc1 -1].txskb, desc1);)
         if (iavcc_r->pcr < dev->rate_limit) {
            IA_SKB_STATE (dev->desc_tbl[desc1-1].txskb) |= IA_TX_DONE;
            if (ia_enque_rtn_q(&dev->tx_return_q, dev->desc_tbl[desc1 -1]) < 0)
@@ -527,8 +527,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) {
       inc = 0;
       testSlot = idealSlot;
       TstSchedTbl = (u16*)(SchedTbl+testSlot);  //set index and read in value
-      IF_CBR(printk("CBR Testslot 0x%x AT Location 0x%x, NumToAssign=%d\n",
-                                testSlot, (u32)TstSchedTbl,toBeAssigned);) 
+      IF_CBR(printk("CBR Testslot 0x%x AT Location 0x%p, NumToAssign=%d\n",
+                                testSlot, TstSchedTbl,toBeAssigned);)
       memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC));
       while (cbrVC)  // If another VC at this location, we have to keep looking
       {
@@ -536,8 +536,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) {
           testSlot = idealSlot - inc;
           if (testSlot < 0) { // Wrap if necessary
              testSlot += dev->CbrTotEntries;
-             IF_CBR(printk("Testslot Wrap. STable Start=0x%x,Testslot=%d\n",
-                                                       (u32)SchedTbl,testSlot);)
+             IF_CBR(printk("Testslot Wrap. STable Start=0x%p,Testslot=%d\n",
+                                                       SchedTbl,testSlot);)
           }
           TstSchedTbl = (u16 *)(SchedTbl + testSlot);  // set table index
           memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); 
@@ -552,8 +552,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) {
           } 
           // set table index and read in value
           TstSchedTbl = (u16*)(SchedTbl + testSlot);
-          IF_CBR(printk("Reading CBR Tbl from 0x%x, CbrVal=0x%x Iteration %d\n",
-                          (u32)TstSchedTbl,cbrVC,inc);) 
+          IF_CBR(printk("Reading CBR Tbl from 0x%p, CbrVal=0x%x Iteration %d\n",
+                          TstSchedTbl,cbrVC,inc);)
           memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC));
        } /* while */
        // Move this VCI number into this location of the CBR Sched table.
@@ -1427,11 +1427,11 @@ static int rx_init(struct atm_dev *dev)
        /* We know this is 32bit bus addressed so the following is safe */
        writel(iadev->rx_dle_dma & 0xfffff000,
               iadev->dma + IPHASE5575_RX_LIST_ADDR);  
-       IF_INIT(printk("Tx Dle list addr: 0x%08x value: 0x%0x\n", 
-                      (u32)(iadev->dma+IPHASE5575_TX_LIST_ADDR), 
+       IF_INIT(printk("Tx Dle list addr: 0x%p value: 0x%0x\n",
+                      iadev->dma+IPHASE5575_TX_LIST_ADDR,
                       *(u32*)(iadev->dma+IPHASE5575_TX_LIST_ADDR));  
-       printk("Rx Dle list addr: 0x%08x value: 0x%0x\n", 
-                      (u32)(iadev->dma+IPHASE5575_RX_LIST_ADDR), 
+       printk("Rx Dle list addr: 0x%p value: 0x%0x\n",
+                      iadev->dma+IPHASE5575_RX_LIST_ADDR,
                       *(u32*)(iadev->dma+IPHASE5575_RX_LIST_ADDR));)  
   
        writew(0xffff, iadev->reass_reg+REASS_MASK_REG);  
@@ -1470,7 +1470,7 @@ static int rx_init(struct atm_dev *dev)
                buf_desc_ptr++;           
                rx_pkt_start += iadev->rx_buf_sz;  
        }  
-       IF_INIT(printk("Rx Buffer desc ptr: 0x%0x\n", (u32)(buf_desc_ptr));)  
+       IF_INIT(printk("Rx Buffer desc ptr: 0x%p\n", buf_desc_ptr);)
         i = FREE_BUF_DESC_Q*iadev->memSize; 
        writew(i >> 16,  iadev->reass_reg+REASS_QUEUE_BASE); 
         writew(i, iadev->reass_reg+FREEQ_ST_ADR);
@@ -1487,7 +1487,7 @@ static int rx_init(struct atm_dev *dev)
                *freeq_start = (u_short)i;  
                freeq_start++;  
        }  
-       IF_INIT(printk("freeq_start: 0x%0x\n", (u32)freeq_start);)  
+       IF_INIT(printk("freeq_start: 0x%p\n", freeq_start);)
         /* Packet Complete Queue */
         i = (PKT_COMP_Q * iadev->memSize) & 0xffff;
         writew(i, iadev->reass_reg+PCQ_ST_ADR);
@@ -1713,7 +1713,7 @@ static void tx_dle_intr(struct atm_dev *dev)
                IA_SKB_STATE(skb) |= IA_DLED;
                skb_queue_tail(&iavcc->txing_skb, skb);
             }
-            IF_EVENT(printk("tx_dle_intr: enque skb = 0x%x \n", (u32)skb);)
+            IF_EVENT(printk("tx_dle_intr: enque skb = 0x%p \n", skb);)
             if (++dle == iadev->tx_dle_q.end)
                  dle = iadev->tx_dle_q.start;
         }
@@ -2044,8 +2044,8 @@ static int tx_init(struct atm_dev *dev)
         writew(tmp16, iadev->seg_reg+CBR_TAB_END+1); // CBR_PTR;
         tmp16 = (CBR_SCHED_TABLE*iadev->memSize + iadev->num_vc*6 - 2) >> 1;
         writew(tmp16, iadev->seg_reg+CBR_TAB_END);
-        IF_INIT(printk("iadev->seg_reg = 0x%x CBR_PTR_BASE = 0x%x\n",
-               (u32)iadev->seg_reg, readw(iadev->seg_reg+CBR_PTR_BASE));)
+        IF_INIT(printk("iadev->seg_reg = 0x%p CBR_PTR_BASE = 0x%x\n",
+               iadev->seg_reg, readw(iadev->seg_reg+CBR_PTR_BASE));)
         IF_INIT(printk("CBR_TAB_BEG = 0x%x, CBR_TAB_END = 0x%x, CBR_PTR = 0x%x\n",
           readw(iadev->seg_reg+CBR_TAB_BEG), readw(iadev->seg_reg+CBR_TAB_END),
           readw(iadev->seg_reg+CBR_TAB_END+1));)
@@ -2963,8 +2963,8 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
  
        /* Put the packet in a tx buffer */   
        trailer = iadev->tx_buf[desc-1].cpcs;
-        IF_TX(printk("Sent: skb = 0x%x skb->data: 0x%x len: %d, desc: %d\n",
-                  (u32)skb, (u32)skb->data, skb->len, desc);)
+        IF_TX(printk("Sent: skb = 0x%p skb->data: 0x%p len: %d, desc: %d\n",
+                  skb, skb->data, skb->len, desc);)
        trailer->control = 0; 
         /*big endian*/ 
        trailer->length = ((skb->len & 0xff) << 8) | ((skb->len & 0xff00) >> 8);
@@ -3181,7 +3181,7 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
        }
        dev->dev_data = iadev;
        IF_INIT(printk(DEV_LABEL "registered at (itf :%d)\n", dev->number);)
-       IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev,
+       IF_INIT(printk("dev_id = 0x%p iadev->LineRate = %d \n", dev,
                iadev->LineRate);)
 
        pci_set_drvdata(pdev, dev);
index 839d27cecb36c8acb3bf8e9e4880ba720e6fe53b..5667c2f02c51b2249fdac0d69fc7fd0a8fe4dfd0 100644 (file)
@@ -198,6 +198,7 @@ static void class_create_release(struct class *cls)
  * class_create - create a struct class structure
  * @owner: pointer to the module that is to "own" this struct class
  * @name: pointer to a string for the name of this class.
+ * @key: the lock_class_key for this class; used by mutex lock debugging
  *
  * This is used to create a struct class pointer that can then be used
  * in calls to device_create().
index d625169c8e48a99951cbb3f833755f77ee0eca1f..0c81ca7312878a05b1bc96cbc47d2722ee6b8c37 100644 (file)
@@ -30,7 +30,7 @@ enum {
 
 static char aoe_iflist[IFLISTSZ];
 module_param_string(aoe_iflist, aoe_iflist, IFLISTSZ, 0600);
-MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"\n");
+MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"");
 
 #ifndef MODULE
 static int __init aoe_iflist_setup(char *str)
index 192522ebb771926e4fec2cfabc595869f6cd4bed..c33bb59ed1fa6c2aa73dc2ecfe1cde1548f08518 100644 (file)
@@ -134,6 +134,13 @@ static struct usb_device_id blacklist_ids[] = {
 
        /* Dell laptop with Broadcom chip */
        { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+       /* Dell Wireless 370 */
+       { USB_DEVICE(0x413c, 0x8156), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+       /* Dell Wireless 410 */
+       { USB_DEVICE(0x413c, 0x8152), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+
+       /* Broadcom 2046 */
+       { USB_DEVICE(0x0a5c, 0x2151), .driver_info = HCI_RESET },
 
        /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
        { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
index 71ec426ecffc4f17d9c9237b6aebdc4e13cc385f..1e0455bd6df96bfa7669784e71f2e7fcaa7e091b 100644 (file)
@@ -39,8 +39,8 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/delay.h>
-#include <asm/mach/dma.h>
-#include <asm/mach/sysasic.h>
+#include <mach/dma.h>
+#include <mach/sysasic.h>
 
 #define GDROM_DEV_NAME "gdrom"
 #define GD_SESSION_OFFSET 150
index 67fbd7aab5dbfa9b73396808cd6feaa1a7369791..34d15d548236235544d2a31a41ba13cf35fe847f 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/rtc.h>
 #include <linux/proc_fs.h>
 #include <linux/efi.h>
-#include <linux/smp_lock.h>
 #include <linux/uaccess.h>
 
 #include <asm/system.h>
index 241cbdea65abd4b36c2d143b2fa5ac16fb2e5102..f307f135cbfb63f23aebb9edc89eb7c559ed2fce 100644 (file)
@@ -169,7 +169,7 @@ static int tty_ldisc_get(int disc, struct tty_ldisc *ld)
        if (disc < N_TTY || disc >= NR_LDISCS)
                return -EINVAL;
        err = tty_ldisc_try_get(disc, ld);
-       if (err == -EAGAIN) {
+       if (err < 0) {
                request_module("tty-ldisc-%d", disc);
                err = tty_ldisc_try_get(disc, ld);
        }
index 82a51f38a5469cd1a56637c6635b9c16f69f5f89..1bc00c9d860d70f917f2d945162aad3755b31749 100644 (file)
@@ -916,7 +916,6 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                ws.ws_col = vc->vc_cols;
                ws.ws_ypixel = vc->vc_scan_lines;
 
-               mutex_lock(&vc->vc_tty->termios_mutex);
                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);
@@ -926,7 +925,6 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                        put_pid(pgrp);
                }
                *cws = ws;
-               mutex_unlock(&vc->vc_tty->termios_mutex);
        }
 
        if (CON_IS_VISIBLE(vc))
index 349ac3d3b8480c13d91c850f917819774f92edbf..637bd7faf132093764351e938c24198cd50424ee 100644 (file)
@@ -38,7 +38,7 @@
 
 int radeon_no_wb;
 
-MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n");
+MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
 
 static int dri_library_name(struct drm_device *dev, char *buf)
index 00ff53348491be4f12b3174187aacbf8cb9291b7..c882fd05cf2920d464da928eb165b3e7914044f3 100644 (file)
@@ -394,13 +394,24 @@ config SENSORS_LM75
        tristate "National Semiconductor LM75 and compatibles"
        depends on I2C
        help
-         If you say yes here you get support for National Semiconductor LM75
-         sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in
-         9-bit precision mode), and TelCom (now Microchip) TCN75.
-
-         The DS75 and DS1775 in 10- to 12-bit precision modes will require
-         a force module parameter. The driver will not handle the extra
-         precision anyhow.
+         If you say yes here you get support for one common type of
+         temperature sensor chip, with models including:
+
+               - Dallas Semiconductor DS75 and DS1775
+               - Maxim MAX6625 and MAX6626
+               - Microchip MCP980x
+               - National Semiconductor LM75
+               - NXP's LM75A
+               - ST Microelectronics STDS75
+               - TelCom (now Microchip) TCN75
+               - Texas Instruments TMP100, TMP101, TMP75, TMP175, TMP275
+
+         This driver supports driver model based binding through board
+         specific I2C device tables.
+
+         It also supports the "legacy" style of driver binding.  To use
+         that with some chips which don't replicate LM75 quirks exactly,
+         you may need the "force" module parameter.
 
          This driver can also be built as a module.  If so, the module
          will be called lm75.
index ce4a7cb5a116ad59365aa846921926a92bd5fa17..3a0b63136479d7c4c701dc8eb6e3652e033c1831 100644 (file)
@@ -39,32 +39,20 @@ I2C_CLIENT_INSMOD_1(adt7473);
 #define ADT7473_REG_BASE_ADDR                  0x20
 
 #define ADT7473_REG_VOLT_BASE_ADDR             0x21
-#define ADT7473_REG_VOLT_MAX_ADDR              0x22
 #define ADT7473_REG_VOLT_MIN_BASE_ADDR         0x46
-#define ADT7473_REG_VOLT_MIN_MAX_ADDR          0x49
 
 #define ADT7473_REG_TEMP_BASE_ADDR             0x25
-#define ADT7473_REG_TEMP_MAX_ADDR              0x27
 #define ADT7473_REG_TEMP_LIMITS_BASE_ADDR      0x4E
-#define ADT7473_REG_TEMP_LIMITS_MAX_ADDR       0x53
 #define ADT7473_REG_TEMP_TMIN_BASE_ADDR                0x67
-#define ADT7473_REG_TEMP_TMIN_MAX_ADDR         0x69
 #define ADT7473_REG_TEMP_TMAX_BASE_ADDR                0x6A
-#define ADT7473_REG_TEMP_TMAX_MAX_ADDR         0x6C
 
 #define ADT7473_REG_FAN_BASE_ADDR              0x28
-#define ADT7473_REG_FAN_MAX_ADDR               0x2F
 #define ADT7473_REG_FAN_MIN_BASE_ADDR          0x54
-#define ADT7473_REG_FAN_MIN_MAX_ADDR           0x5B
 
 #define ADT7473_REG_PWM_BASE_ADDR              0x30
-#define ADT7473_REG_PWM_MAX_ADDR               0x32
 #define        ADT7473_REG_PWM_MIN_BASE_ADDR           0x64
-#define ADT7473_REG_PWM_MIN_MAX_ADDR           0x66
 #define ADT7473_REG_PWM_MAX_BASE_ADDR          0x38
-#define ADT7473_REG_PWM_MAX_MAX_ADDR           0x3A
 #define ADT7473_REG_PWM_BHVR_BASE_ADDR         0x5C
-#define ADT7473_REG_PWM_BHVR_MAX_ADDR          0x5E
 #define                ADT7473_PWM_BHVR_MASK           0xE0
 #define                ADT7473_PWM_BHVR_SHIFT          5
 
@@ -102,7 +90,6 @@ I2C_CLIENT_INSMOD_1(adt7473);
 #define                ADT7473_FAN4_ALARM              0x20
 #define                ADT7473_R1T_SHORT               0x40
 #define                ADT7473_R2T_SHORT               0x80
-#define ADT7473_REG_MAX_ADDR                   0x80
 
 #define ALARM2(x)      ((x) << 8)
 
@@ -583,10 +570,9 @@ static ssize_t set_max_duty_at_crit(struct device *dev,
        struct i2c_client *client = to_i2c_client(dev);
        struct adt7473_data *data = i2c_get_clientdata(client);
        int temp = simple_strtol(buf, NULL, 10);
-       temp = temp && 0xFF;
 
        mutex_lock(&data->lock);
-       data->max_duty_at_overheat = temp;
+       data->max_duty_at_overheat = !!temp;
        reg = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
        if (temp)
                reg |= ADT7473_CFG4_MAX_DUTY_AT_OVT;
index 7673f65877e11bd3516264a692214356e77dc965..5e2cf0aef480751677a42d9f35bbf9200220f199 100644 (file)
@@ -48,6 +48,11 @@ static unsigned short force_id;
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
+static int probe_all_addr;
+module_param(probe_all_addr, bool, 0);
+MODULE_PARM_DESC(probe_all_addr, "Include probing of non-standard LPC "
+                "addresses");
+
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END};
 
@@ -176,6 +181,7 @@ struct dme1737_data {
        int valid;                      /* !=0 if following fields are valid */
        unsigned long last_update;      /* in jiffies */
        unsigned long last_vbat;        /* in jiffies */
+       enum chips type;
 
        u8 vid;
        u8 pwm_rr_en;
@@ -210,20 +216,27 @@ struct dme1737_data {
 };
 
 /* Nominal voltage values */
-static const int IN_NOMINAL[] = {5000, 2250, 3300, 5000, 12000, 3300, 3300};
+static const int IN_NOMINAL_DME1737[] = {5000, 2250, 3300, 5000, 12000, 3300,
+                                        3300};
+static const int IN_NOMINAL_SCH311x[] = {2500, 1500, 3300, 5000, 12000, 3300,
+                                        3300};
+#define IN_NOMINAL(ix, type)   (((type) == dme1737) ? \
+                               IN_NOMINAL_DME1737[(ix)] : \
+                               IN_NOMINAL_SCH311x[(ix)])
 
 /* Voltage input
  * Voltage inputs have 16 bits resolution, limit values have 8 bits
  * resolution. */
-static inline int IN_FROM_REG(int reg, int ix, int res)
+static inline int IN_FROM_REG(int reg, int ix, int res, int type)
 {
-       return (reg * IN_NOMINAL[ix] + (3 << (res - 3))) / (3 << (res - 2));
+       return (reg * IN_NOMINAL(ix, type) + (3 << (res - 3))) /
+               (3 << (res - 2));
 }
 
-static inline int IN_TO_REG(int val, int ix)
+static inline int IN_TO_REG(int val, int ix, int type)
 {
-       return SENSORS_LIMIT((val * 192 + IN_NOMINAL[ix] / 2) /
-                            IN_NOMINAL[ix], 0, 255);
+       return SENSORS_LIMIT((val * 192 + IN_NOMINAL(ix, type) / 2) /
+                            IN_NOMINAL(ix, type), 0, 255);
 }
 
 /* Temperature input
@@ -722,13 +735,13 @@ static ssize_t show_in(struct device *dev, struct device_attribute *attr,
 
        switch (fn) {
        case SYS_IN_INPUT:
-               res = IN_FROM_REG(data->in[ix], ix, 16);
+               res = IN_FROM_REG(data->in[ix], ix, 16, data->type);
                break;
        case SYS_IN_MIN:
-               res = IN_FROM_REG(data->in_min[ix], ix, 8);
+               res = IN_FROM_REG(data->in_min[ix], ix, 8, data->type);
                break;
        case SYS_IN_MAX:
-               res = IN_FROM_REG(data->in_max[ix], ix, 8);
+               res = IN_FROM_REG(data->in_max[ix], ix, 8, data->type);
                break;
        case SYS_IN_ALARM:
                res = (data->alarms >> DME1737_BIT_ALARM_IN[ix]) & 0x01;
@@ -755,12 +768,12 @@ static ssize_t set_in(struct device *dev, struct device_attribute *attr,
        mutex_lock(&data->update_lock);
        switch (fn) {
        case SYS_IN_MIN:
-               data->in_min[ix] = IN_TO_REG(val, ix);
+               data->in_min[ix] = IN_TO_REG(val, ix, data->type);
                dme1737_write(client, DME1737_REG_IN_MIN(ix),
                              data->in_min[ix]);
                break;
        case SYS_IN_MAX:
-               data->in_max[ix] = IN_TO_REG(val, ix);
+               data->in_max[ix] = IN_TO_REG(val, ix, data->type);
                dme1737_write(client, DME1737_REG_IN_MAX(ix),
                              data->in_max[ix]);
                break;
@@ -1501,9 +1514,9 @@ SENSOR_DEVICE_ATTR_PWM_1TO3(3);
 /* PWMs 5-6 */
 
 #define SENSOR_DEVICE_ATTR_PWM_5TO6(ix) \
-static SENSOR_DEVICE_ATTR_2(pwm##ix, S_IRUGO | S_IWUSR, \
+static SENSOR_DEVICE_ATTR_2(pwm##ix, S_IRUGO, \
        show_pwm, set_pwm, SYS_PWM, ix-1); \
-static SENSOR_DEVICE_ATTR_2(pwm##ix##_freq, S_IRUGO | S_IWUSR, \
+static SENSOR_DEVICE_ATTR_2(pwm##ix##_freq, S_IRUGO, \
        show_pwm, set_pwm, SYS_PWM_FREQ, ix-1); \
 static SENSOR_DEVICE_ATTR_2(pwm##ix##_enable, S_IRUGO, \
        show_pwm, NULL, SYS_PWM_ENABLE, ix-1)
@@ -1517,91 +1530,75 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);   /* for ISA devices */
 
-#define SENSOR_DEV_ATTR_IN(ix) \
-&sensor_dev_attr_in##ix##_input.dev_attr.attr, \
-&sensor_dev_attr_in##ix##_min.dev_attr.attr, \
-&sensor_dev_attr_in##ix##_max.dev_attr.attr, \
-&sensor_dev_attr_in##ix##_alarm.dev_attr.attr
-
-/* These attributes are read-writeable only if the chip is *not* locked */
-#define SENSOR_DEV_ATTR_TEMP_LOCK(ix) \
-&sensor_dev_attr_temp##ix##_offset.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_TEMP(ix) \
-SENSOR_DEV_ATTR_TEMP_LOCK(ix), \
-&sensor_dev_attr_temp##ix##_input.dev_attr.attr, \
-&sensor_dev_attr_temp##ix##_min.dev_attr.attr, \
-&sensor_dev_attr_temp##ix##_max.dev_attr.attr, \
-&sensor_dev_attr_temp##ix##_alarm.dev_attr.attr, \
-&sensor_dev_attr_temp##ix##_fault.dev_attr.attr
-
-/* These attributes are read-writeable only if the chip is *not* locked */
-#define SENSOR_DEV_ATTR_ZONE_LOCK(ix) \
-&sensor_dev_attr_zone##ix##_auto_point1_temp_hyst.dev_attr.attr, \
-&sensor_dev_attr_zone##ix##_auto_point1_temp.dev_attr.attr, \
-&sensor_dev_attr_zone##ix##_auto_point2_temp.dev_attr.attr, \
-&sensor_dev_attr_zone##ix##_auto_point3_temp.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_ZONE(ix) \
-SENSOR_DEV_ATTR_ZONE_LOCK(ix), \
-&sensor_dev_attr_zone##ix##_auto_channels_temp.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_FAN_1TO4(ix) \
-&sensor_dev_attr_fan##ix##_input.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_min.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_alarm.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_type.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_FAN_5TO6(ix) \
-&sensor_dev_attr_fan##ix##_input.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_min.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_alarm.dev_attr.attr, \
-&sensor_dev_attr_fan##ix##_max.dev_attr.attr
-
-/* These attributes are read-writeable only if the chip is *not* locked */
-#define SENSOR_DEV_ATTR_PWM_1TO3_LOCK(ix) \
-&sensor_dev_attr_pwm##ix##_freq.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_enable.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_ramp_rate.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_auto_channels_zone.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_auto_pwm_min.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_auto_point1_pwm.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_PWM_1TO3(ix) \
-SENSOR_DEV_ATTR_PWM_1TO3_LOCK(ix), \
-&sensor_dev_attr_pwm##ix.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_auto_point2_pwm.dev_attr.attr
-
-/* These attributes are read-writeable only if the chip is *not* locked */
-#define SENSOR_DEV_ATTR_PWM_5TO6_LOCK(ix) \
-&sensor_dev_attr_pwm##ix.dev_attr.attr, \
-&sensor_dev_attr_pwm##ix##_freq.dev_attr.attr
-
-#define SENSOR_DEV_ATTR_PWM_5TO6(ix) \
-SENSOR_DEV_ATTR_PWM_5TO6_LOCK(ix), \
-&sensor_dev_attr_pwm##ix##_enable.dev_attr.attr
-
 /* This struct holds all the attributes that are always present and need to be
  * created unconditionally. The attributes that need modification of their
  * permissions are created read-only and write permissions are added or removed
  * on the fly when required */
 static struct attribute *dme1737_attr[] ={
        /* Voltages */
-       SENSOR_DEV_ATTR_IN(0),
-       SENSOR_DEV_ATTR_IN(1),
-       SENSOR_DEV_ATTR_IN(2),
-       SENSOR_DEV_ATTR_IN(3),
-       SENSOR_DEV_ATTR_IN(4),
-       SENSOR_DEV_ATTR_IN(5),
-       SENSOR_DEV_ATTR_IN(6),
+       &sensor_dev_attr_in0_input.dev_attr.attr,
+       &sensor_dev_attr_in0_min.dev_attr.attr,
+       &sensor_dev_attr_in0_max.dev_attr.attr,
+       &sensor_dev_attr_in0_alarm.dev_attr.attr,
+       &sensor_dev_attr_in1_input.dev_attr.attr,
+       &sensor_dev_attr_in1_min.dev_attr.attr,
+       &sensor_dev_attr_in1_max.dev_attr.attr,
+       &sensor_dev_attr_in1_alarm.dev_attr.attr,
+       &sensor_dev_attr_in2_input.dev_attr.attr,
+       &sensor_dev_attr_in2_min.dev_attr.attr,
+       &sensor_dev_attr_in2_max.dev_attr.attr,
+       &sensor_dev_attr_in2_alarm.dev_attr.attr,
+       &sensor_dev_attr_in3_input.dev_attr.attr,
+       &sensor_dev_attr_in3_min.dev_attr.attr,
+       &sensor_dev_attr_in3_max.dev_attr.attr,
+       &sensor_dev_attr_in3_alarm.dev_attr.attr,
+       &sensor_dev_attr_in4_input.dev_attr.attr,
+       &sensor_dev_attr_in4_min.dev_attr.attr,
+       &sensor_dev_attr_in4_max.dev_attr.attr,
+       &sensor_dev_attr_in4_alarm.dev_attr.attr,
+       &sensor_dev_attr_in5_input.dev_attr.attr,
+       &sensor_dev_attr_in5_min.dev_attr.attr,
+       &sensor_dev_attr_in5_max.dev_attr.attr,
+       &sensor_dev_attr_in5_alarm.dev_attr.attr,
+       &sensor_dev_attr_in6_input.dev_attr.attr,
+       &sensor_dev_attr_in6_min.dev_attr.attr,
+       &sensor_dev_attr_in6_max.dev_attr.attr,
+       &sensor_dev_attr_in6_alarm.dev_attr.attr,
        /* Temperatures */
-       SENSOR_DEV_ATTR_TEMP(1),
-       SENSOR_DEV_ATTR_TEMP(2),
-       SENSOR_DEV_ATTR_TEMP(3),
+       &sensor_dev_attr_temp1_input.dev_attr.attr,
+       &sensor_dev_attr_temp1_min.dev_attr.attr,
+       &sensor_dev_attr_temp1_max.dev_attr.attr,
+       &sensor_dev_attr_temp1_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp1_fault.dev_attr.attr,
+       &sensor_dev_attr_temp1_offset.dev_attr.attr,
+       &sensor_dev_attr_temp2_input.dev_attr.attr,
+       &sensor_dev_attr_temp2_min.dev_attr.attr,
+       &sensor_dev_attr_temp2_max.dev_attr.attr,
+       &sensor_dev_attr_temp2_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp2_fault.dev_attr.attr,
+       &sensor_dev_attr_temp2_offset.dev_attr.attr,
+       &sensor_dev_attr_temp3_input.dev_attr.attr,
+       &sensor_dev_attr_temp3_min.dev_attr.attr,
+       &sensor_dev_attr_temp3_max.dev_attr.attr,
+       &sensor_dev_attr_temp3_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp3_fault.dev_attr.attr,
+       &sensor_dev_attr_temp3_offset.dev_attr.attr,
        /* Zones */
-       SENSOR_DEV_ATTR_ZONE(1),
-       SENSOR_DEV_ATTR_ZONE(2),
-       SENSOR_DEV_ATTR_ZONE(3),
+       &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point3_temp.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_channels_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point3_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_channels_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point3_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_channels_temp.dev_attr.attr,
        /* Misc */
        &dev_attr_vrm.attr,
        &dev_attr_cpu0_vid.attr,
@@ -1616,23 +1613,48 @@ static const struct attribute_group dme1737_group = {
  * Their creation depends on the chip configuration which is determined during
  * module load. */
 static struct attribute *dme1737_attr_pwm1[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3(1),
+       &sensor_dev_attr_pwm1.dev_attr.attr,
+       &sensor_dev_attr_pwm1_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm1_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm1_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm2[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3(2),
+       &sensor_dev_attr_pwm2.dev_attr.attr,
+       &sensor_dev_attr_pwm2_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm2_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm2_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm3[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3(3),
+       &sensor_dev_attr_pwm3.dev_attr.attr,
+       &sensor_dev_attr_pwm3_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm3_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm3_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm5[] = {
-       SENSOR_DEV_ATTR_PWM_5TO6(5),
+       &sensor_dev_attr_pwm5.dev_attr.attr,
+       &sensor_dev_attr_pwm5_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm5_enable.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm6[] = {
-       SENSOR_DEV_ATTR_PWM_5TO6(6),
+       &sensor_dev_attr_pwm6.dev_attr.attr,
+       &sensor_dev_attr_pwm6_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm6_enable.dev_attr.attr,
        NULL
 };
 
@@ -1649,27 +1671,45 @@ static const struct attribute_group dme1737_pwm_group[] = {
  * Their creation depends on the chip configuration which is determined during
  * module load. */
 static struct attribute *dme1737_attr_fan1[] = {
-       SENSOR_DEV_ATTR_FAN_1TO4(1),
+       &sensor_dev_attr_fan1_input.dev_attr.attr,
+       &sensor_dev_attr_fan1_min.dev_attr.attr,
+       &sensor_dev_attr_fan1_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan1_type.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_fan2[] = {
-       SENSOR_DEV_ATTR_FAN_1TO4(2),
+       &sensor_dev_attr_fan2_input.dev_attr.attr,
+       &sensor_dev_attr_fan2_min.dev_attr.attr,
+       &sensor_dev_attr_fan2_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan2_type.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_fan3[] = {
-       SENSOR_DEV_ATTR_FAN_1TO4(3),
+       &sensor_dev_attr_fan3_input.dev_attr.attr,
+       &sensor_dev_attr_fan3_min.dev_attr.attr,
+       &sensor_dev_attr_fan3_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan3_type.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_fan4[] = {
-       SENSOR_DEV_ATTR_FAN_1TO4(4),
+       &sensor_dev_attr_fan4_input.dev_attr.attr,
+       &sensor_dev_attr_fan4_min.dev_attr.attr,
+       &sensor_dev_attr_fan4_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan4_type.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_fan5[] = {
-       SENSOR_DEV_ATTR_FAN_5TO6(5),
+       &sensor_dev_attr_fan5_input.dev_attr.attr,
+       &sensor_dev_attr_fan5_min.dev_attr.attr,
+       &sensor_dev_attr_fan5_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan5_max.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_fan6[] = {
-       SENSOR_DEV_ATTR_FAN_5TO6(6),
+       &sensor_dev_attr_fan6_input.dev_attr.attr,
+       &sensor_dev_attr_fan6_min.dev_attr.attr,
+       &sensor_dev_attr_fan6_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan6_max.dev_attr.attr,
        NULL
 };
 
@@ -1686,13 +1726,22 @@ static const struct attribute_group dme1737_fan_group[] = {
  * writeable if the chip is *not* locked. Otherwise they stay read-only. */
 static struct attribute *dme1737_attr_lock[] = {
        /* Temperatures */
-       SENSOR_DEV_ATTR_TEMP_LOCK(1),
-       SENSOR_DEV_ATTR_TEMP_LOCK(2),
-       SENSOR_DEV_ATTR_TEMP_LOCK(3),
+       &sensor_dev_attr_temp1_offset.dev_attr.attr,
+       &sensor_dev_attr_temp2_offset.dev_attr.attr,
+       &sensor_dev_attr_temp3_offset.dev_attr.attr,
        /* Zones */
-       SENSOR_DEV_ATTR_ZONE_LOCK(1),
-       SENSOR_DEV_ATTR_ZONE_LOCK(2),
-       SENSOR_DEV_ATTR_ZONE_LOCK(3),
+       &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone1_auto_point3_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone2_auto_point3_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_zone3_auto_point3_temp.dev_attr.attr,
        NULL
 };
 
@@ -1704,23 +1753,40 @@ static const struct attribute_group dme1737_lock_group = {
  * writeable if the chip is *not* locked and the respective PWM is available.
  * Otherwise they stay read-only. */
 static struct attribute *dme1737_attr_pwm1_lock[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3_LOCK(1),
+       &sensor_dev_attr_pwm1_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm1_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm1_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm2_lock[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3_LOCK(2),
+       &sensor_dev_attr_pwm2_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm2_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm2_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm3_lock[] = {
-       SENSOR_DEV_ATTR_PWM_1TO3_LOCK(3),
+       &sensor_dev_attr_pwm3_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm3_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm3_ramp_rate.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_channels_zone.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_pwm_min.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm5_lock[] = {
-       SENSOR_DEV_ATTR_PWM_5TO6_LOCK(5),
+       &sensor_dev_attr_pwm5.dev_attr.attr,
+       &sensor_dev_attr_pwm5_freq.dev_attr.attr,
        NULL
 };
 static struct attribute *dme1737_attr_pwm6_lock[] = {
-       SENSOR_DEV_ATTR_PWM_5TO6_LOCK(6),
+       &sensor_dev_attr_pwm6.dev_attr.attr,
+       &sensor_dev_attr_pwm6_freq.dev_attr.attr,
        NULL
 };
 
@@ -2109,6 +2175,7 @@ static int dme1737_i2c_detect(struct i2c_adapter *adapter, int address,
 
        kind = dme1737;
        name = "dme1737";
+       data->type = kind;
 
        /* Fill in the remaining client fields and put it into the global
         * list */
@@ -2301,6 +2368,7 @@ static int __devinit dme1737_isa_probe(struct platform_device *pdev)
                err = -ENODEV;
                goto exit_kfree;
        }
+       data->type = -1;
 
        /* Fill in the remaining client fields and initialize the mutex */
        strlcpy(client->name, "sch311x", I2C_NAME_SIZE);
@@ -2377,7 +2445,10 @@ static int __init dme1737_init(void)
        }
 
        if (dme1737_isa_detect(0x2e, &addr) &&
-           dme1737_isa_detect(0x4e, &addr)) {
+           dme1737_isa_detect(0x4e, &addr) &&
+           (!probe_all_addr ||
+            (dme1737_isa_detect(0x162e, &addr) &&
+             dme1737_isa_detect(0x164e, &addr)))) {
                /* Return 0 if we didn't find an ISA device */
                return 0;
        }
index de698dc73020ccdf7edf88d8697fa1740c49c67b..7880c273c2c5a2e5d739d13c92974981856f7f60 100644 (file)
 #include "lm75.h"
 
 
-/* Addresses to scan */
+/*
+ * This driver handles the LM75 and compatible digital temperature sensors.
+ * Only types which are _not_ listed in I2C_CLIENT_INSMOD_*() need to be
+ * listed here.  We start at 9 since I2C_CLIENT_INSMOD_*() currently allow
+ * definition of up to 8 chip types (plus zero).
+ */
+
+enum lm75_type {               /* keep sorted in alphabetical order */
+       ds1775 = 9,
+       ds75,
+       /* lm75 -- in I2C_CLIENT_INSMOD_1() */
+       lm75a,
+       max6625,
+       max6626,
+       mcp980x,
+       stds75,
+       tcn75,
+       tmp100,
+       tmp101,
+       tmp175,
+       tmp275,
+       tmp75,
+};
+
+/* Addresses scanned by legacy style driver binding */
 static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
                                        0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
 
-/* Insmod parameters */
+/* Insmod parameters (only for legacy style driver binding) */
 I2C_CLIENT_INSMOD_1(lm75);
 
-/* Many LM75 constants specified below */
 
 /* The LM75 registers */
 #define LM75_REG_CONF          0x01
@@ -49,10 +72,11 @@ static const u8 LM75_REG_TEMP[3] = {
 
 /* Each client has this additional data */
 struct lm75_data {
-       struct i2c_client       client;
-       struct device *hwmon_dev;
+       struct i2c_client       *client;
+       struct device           *hwmon_dev;
        struct mutex            update_lock;
-       char                    valid;          /* !=0 if following fields are valid */
+       u8                      orig_conf;
+       char                    valid;          /* !=0 if registers are valid */
        unsigned long           last_updated;   /* In jiffies */
        u16                     temp[3];        /* Register values,
                                                   0 = input
@@ -60,23 +84,14 @@ struct lm75_data {
                                                   2 = hyst */
 };
 
-static int lm75_attach_adapter(struct i2c_adapter *adapter);
-static int lm75_detect(struct i2c_adapter *adapter, int address, int kind);
-static void lm75_init_client(struct i2c_client *client);
-static int lm75_detach_client(struct i2c_client *client);
 static int lm75_read_value(struct i2c_client *client, u8 reg);
 static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value);
 static struct lm75_data *lm75_update_device(struct device *dev);
 
 
-/* This is the driver that will be inserted */
-static struct i2c_driver lm75_driver = {
-       .driver = {
-               .name   = "lm75",
-       },
-       .attach_adapter = lm75_attach_adapter,
-       .detach_client  = lm75_detach_client,
-};
+/*-----------------------------------------------------------------------*/
+
+/* sysfs attributes for hwmon */
 
 static ssize_t show_temp(struct device *dev, struct device_attribute *da,
                         char *buf)
@@ -109,13 +124,6 @@ static SENSOR_DEVICE_ATTR(temp1_max_hyst, S_IWUSR | S_IRUGO,
                        show_temp, set_temp, 2);
 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0);
 
-static int lm75_attach_adapter(struct i2c_adapter *adapter)
-{
-       if (!(adapter->class & I2C_CLASS_HWMON))
-               return 0;
-       return i2c_probe(adapter, &addr_data, lm75_detect);
-}
-
 static struct attribute *lm75_attributes[] = {
        &sensor_dev_attr_temp1_input.dev_attr.attr,
        &sensor_dev_attr_temp1_max.dev_attr.attr,
@@ -128,32 +136,144 @@ static const struct attribute_group lm75_group = {
        .attrs = lm75_attributes,
 };
 
+/*-----------------------------------------------------------------------*/
+
+/* "New style" I2C driver binding -- following the driver model */
+
+static int
+lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+       struct lm75_data *data;
+       int status;
+       u8 set_mask, clr_mask;
+       int new;
+
+       if (!i2c_check_functionality(client->adapter,
+                       I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
+               return -EIO;
+
+       data = kzalloc(sizeof(struct lm75_data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       i2c_set_clientdata(client, data);
+
+       data->client = client;
+       mutex_init(&data->update_lock);
+
+       /* Set to LM75 resolution (9 bits, 1/2 degree C) and range.
+        * Then tweak to be more precise when appropriate.
+        */
+       set_mask = 0;
+       clr_mask = (1 << 0)                     /* continuous conversions */
+               | (1 << 6) | (1 << 5);          /* 9-bit mode */
+
+       /* configure as specified */
+       status = lm75_read_value(client, LM75_REG_CONF);
+       if (status < 0) {
+               dev_dbg(&client->dev, "Can't read config? %d\n", status);
+               goto exit_free;
+       }
+       data->orig_conf = status;
+       new = status & ~clr_mask;
+       new |= set_mask;
+       if (status != new)
+               lm75_write_value(client, LM75_REG_CONF, new);
+       dev_dbg(&client->dev, "Config %02x\n", new);
+
+       /* Register sysfs hooks */
+       status = sysfs_create_group(&client->dev.kobj, &lm75_group);
+       if (status)
+               goto exit_free;
+
+       data->hwmon_dev = hwmon_device_register(&client->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               status = PTR_ERR(data->hwmon_dev);
+               goto exit_remove;
+       }
+
+       dev_info(&client->dev, "%s: sensor '%s'\n",
+               data->hwmon_dev->bus_id, client->name);
+
+       return 0;
+
+exit_remove:
+       sysfs_remove_group(&client->dev.kobj, &lm75_group);
+exit_free:
+       i2c_set_clientdata(client, NULL);
+       kfree(data);
+       return status;
+}
+
+static int lm75_remove(struct i2c_client *client)
+{
+       struct lm75_data *data = i2c_get_clientdata(client);
+
+       hwmon_device_unregister(data->hwmon_dev);
+       sysfs_remove_group(&client->dev.kobj, &lm75_group);
+       lm75_write_value(client, LM75_REG_CONF, data->orig_conf);
+       i2c_set_clientdata(client, NULL);
+       kfree(data);
+       return 0;
+}
+
+static const struct i2c_device_id lm75_ids[] = {
+       { "ds1775", ds1775, },
+       { "ds75", ds75, },
+       { "lm75", lm75, },
+       { "lm75a", lm75a, },
+       { "max6625", max6625, },
+       { "max6626", max6626, },
+       { "mcp980x", mcp980x, },
+       { "stds75", stds75, },
+       { "tcn75", tcn75, },
+       { "tmp100", tmp100, },
+       { "tmp101", tmp101, },
+       { "tmp175", tmp175, },
+       { "tmp275", tmp275, },
+       { "tmp75", tmp75, },
+       { /* LIST END */ }
+};
+MODULE_DEVICE_TABLE(i2c, lm75_ids);
+
+static struct i2c_driver lm75_driver = {
+       .driver = {
+               .name   = "lm75",
+       },
+       .probe          = lm75_probe,
+       .remove         = lm75_remove,
+       .id_table       = lm75_ids,
+};
+
+/*-----------------------------------------------------------------------*/
+
+/* "Legacy" I2C driver binding */
+
+static struct i2c_driver lm75_legacy_driver;
+
 /* This function is called by i2c_probe */
 static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
 {
        int i;
        struct i2c_client *new_client;
-       struct lm75_data *data;
        int err = 0;
-       const char *name = "";
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
                                     I2C_FUNC_SMBUS_WORD_DATA))
                goto exit;
 
-       /* OK. For now, we presume we have a valid client. We now create the
-          client structure, even though we cannot fill it completely yet.
-          But it allows us to access lm75_{read,write}_value. */
-       if (!(data = kzalloc(sizeof(struct lm75_data), GFP_KERNEL))) {
+       /* OK. For now, we presume we have a valid address. We create the
+          client structure, even though there may be no sensor present.
+          But it allows us to use i2c_smbus_read_*_data() calls. */
+       new_client = kzalloc(sizeof *new_client, GFP_KERNEL);
+       if (!new_client) {
                err = -ENOMEM;
                goto exit;
        }
 
-       new_client = &data->client;
-       i2c_set_clientdata(new_client, data);
        new_client->addr = address;
        new_client->adapter = adapter;
-       new_client->driver = &lm75_driver;
+       new_client->driver = &lm75_legacy_driver;
        new_client->flags = 0;
 
        /* Now, we do the remaining detection. There is no identification-
@@ -174,17 +294,17 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
                 || i2c_smbus_read_word_data(new_client, 5) != hyst
                 || i2c_smbus_read_word_data(new_client, 6) != hyst
                 || i2c_smbus_read_word_data(new_client, 7) != hyst)
-                       goto exit_free;
+                       goto exit_free;
                os = i2c_smbus_read_word_data(new_client, 3);
                if (i2c_smbus_read_word_data(new_client, 4) != os
                 || i2c_smbus_read_word_data(new_client, 5) != os
                 || i2c_smbus_read_word_data(new_client, 6) != os
                 || i2c_smbus_read_word_data(new_client, 7) != os)
-                       goto exit_free;
+                       goto exit_free;
 
                /* Unused bits */
                if (conf & 0xe0)
-                       goto exit_free;
+                       goto exit_free;
 
                /* Addresses cycling */
                for (i = 8; i < 0xff; i += 8)
@@ -194,58 +314,57 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
                                goto exit_free;
        }
 
-       /* Determine the chip type - only one kind supported! */
-       if (kind <= 0)
-               kind = lm75;
-
-       if (kind == lm75) {
-               name = "lm75";
-       }
-
-       /* Fill in the remaining client fields and put it into the global list */
-       strlcpy(new_client->name, name, I2C_NAME_SIZE);
-       data->valid = 0;
-       mutex_init(&data->update_lock);
+       /* NOTE: we treat "force=..." and "force_lm75=..." the same.
+        * Only new-style driver binding distinguishes chip types.
+        */
+       strlcpy(new_client->name, "lm75", I2C_NAME_SIZE);
 
        /* Tell the I2C layer a new client has arrived */
-       if ((err = i2c_attach_client(new_client)))
+       err = i2c_attach_client(new_client);
+       if (err)
                goto exit_free;
 
-       /* Initialize the LM75 chip */
-       lm75_init_client(new_client);
-       
-       /* Register sysfs hooks */
-       if ((err = sysfs_create_group(&new_client->dev.kobj, &lm75_group)))
+       err = lm75_probe(new_client, NULL);
+       if (err < 0)
                goto exit_detach;
 
-       data->hwmon_dev = hwmon_device_register(&new_client->dev);
-       if (IS_ERR(data->hwmon_dev)) {
-               err = PTR_ERR(data->hwmon_dev);
-               goto exit_remove;
-       }
-
        return 0;
 
-exit_remove:
-       sysfs_remove_group(&new_client->dev.kobj, &lm75_group);
 exit_detach:
        i2c_detach_client(new_client);
 exit_free:
-       kfree(data);
+       kfree(new_client);
 exit:
        return err;
 }
 
+static int lm75_attach_adapter(struct i2c_adapter *adapter)
+{
+       if (!(adapter->class & I2C_CLASS_HWMON))
+               return 0;
+       return i2c_probe(adapter, &addr_data, lm75_detect);
+}
+
 static int lm75_detach_client(struct i2c_client *client)
 {
-       struct lm75_data *data = i2c_get_clientdata(client);
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&client->dev.kobj, &lm75_group);
+       lm75_remove(client);
        i2c_detach_client(client);
-       kfree(data);
+       kfree(client);
        return 0;
 }
 
+static struct i2c_driver lm75_legacy_driver = {
+       .driver = {
+               .name   = "lm75_legacy",
+       },
+       .attach_adapter = lm75_attach_adapter,
+       .detach_client  = lm75_detach_client,
+};
+
+/*-----------------------------------------------------------------------*/
+
+/* register access */
+
 /* All registers are word-sized, except for the configuration register.
    LM75 uses a high-byte first convention, which is exactly opposite to
    the SMBus standard. */
@@ -268,16 +387,6 @@ static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value)
                return i2c_smbus_write_word_data(client, reg, swab16(value));
 }
 
-static void lm75_init_client(struct i2c_client *client)
-{
-       int reg;
-
-       /* Enable if in shutdown mode */
-       reg = lm75_read_value(client, LM75_REG_CONF);
-       if (reg >= 0 && (reg & 0x01))
-               lm75_write_value(client, LM75_REG_CONF, reg & 0xfe);
-}
-
 static struct lm75_data *lm75_update_device(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -309,13 +418,28 @@ static struct lm75_data *lm75_update_device(struct device *dev)
        return data;
 }
 
+/*-----------------------------------------------------------------------*/
+
+/* module glue */
+
 static int __init sensors_lm75_init(void)
 {
-       return i2c_add_driver(&lm75_driver);
+       int status;
+
+       status = i2c_add_driver(&lm75_driver);
+       if (status < 0)
+               return status;
+
+       status = i2c_add_driver(&lm75_legacy_driver);
+       if (status < 0)
+               i2c_del_driver(&lm75_driver);
+
+       return status;
 }
 
 static void __exit sensors_lm75_exit(void)
 {
+       i2c_del_driver(&lm75_legacy_driver);
        i2c_del_driver(&lm75_driver);
 }
 
index ee5eca1c1921d9d1f7ba1d67bd638ed9d6ba2cb2..12d446f54f977e5bd68cc0673631dc924bb2ad21 100644 (file)
@@ -1,7 +1,7 @@
 /*
     lm85.c - Part of lm_sensors, Linux kernel modules for hardware
              monitoring
-    Copyright (c) 1998, 1999  Frodo Looijaard <frodol@dds.nl> 
+    Copyright (c) 1998, 1999  Frodo Looijaard <frodol@dds.nl>
     Copyright (c) 2002, 2003  Philip Pokorny <ppokorny@penguincomputing.com>
     Copyright (c) 2003        Margit Schubert-While <margitsw@t-online.de>
     Copyright (c) 2004        Justin Thiessen <jthiessen@penguincomputing.com>
@@ -51,24 +51,17 @@ I2C_CLIENT_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
 #define        LM85_REG_TEMP_MAX(nr)           (0x4f + (nr) * 2)
 
 /* Fan speeds are LSB, MSB (2 bytes) */
-#define        LM85_REG_FAN(nr)                (0x28 + (nr) *2)
-#define        LM85_REG_FAN_MIN(nr)            (0x54 + (nr) *2)
+#define        LM85_REG_FAN(nr)                (0x28 + (nr) * 2)
+#define        LM85_REG_FAN_MIN(nr)            (0x54 + (nr) * 2)
 
 #define        LM85_REG_PWM(nr)                (0x30 + (nr))
 
-#define        ADT7463_REG_OPPOINT(nr)         (0x33 + (nr))
-
-#define        ADT7463_REG_TMIN_CTL1           0x36
-#define        ADT7463_REG_TMIN_CTL2           0x37
-
-#define        LM85_REG_DEVICE                 0x3d
 #define        LM85_REG_COMPANY                0x3e
 #define        LM85_REG_VERSTEP                0x3f
 /* These are the recognized values for the above regs */
-#define        LM85_DEVICE_ADX                 0x27
 #define        LM85_COMPANY_NATIONAL           0x01
 #define        LM85_COMPANY_ANALOG_DEV         0x41
-#define        LM85_COMPANY_SMSC               0x5c
+#define        LM85_COMPANY_SMSC               0x5c
 #define        LM85_VERSTEP_VMASK              0xf0
 #define        LM85_VERSTEP_GENERIC            0x60
 #define        LM85_VERSTEP_LM85C              0x60
@@ -91,58 +84,45 @@ I2C_CLIENT_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
 #define        LM85_REG_AFAN_CONFIG(nr)        (0x5c + (nr))
 #define        LM85_REG_AFAN_RANGE(nr)         (0x5f + (nr))
 #define        LM85_REG_AFAN_SPIKE1            0x62
-#define        LM85_REG_AFAN_SPIKE2            0x63
 #define        LM85_REG_AFAN_MINPWM(nr)        (0x64 + (nr))
 #define        LM85_REG_AFAN_LIMIT(nr)         (0x67 + (nr))
 #define        LM85_REG_AFAN_CRITICAL(nr)      (0x6a + (nr))
 #define        LM85_REG_AFAN_HYST1             0x6d
 #define        LM85_REG_AFAN_HYST2             0x6e
 
-#define        LM85_REG_TACH_MODE              0x74
-#define        LM85_REG_SPINUP_CTL             0x75
-
-#define        ADM1027_REG_TEMP_OFFSET(nr)     (0x70 + (nr))
-#define        ADM1027_REG_CONFIG2             0x73
-#define        ADM1027_REG_INTMASK1            0x74
-#define        ADM1027_REG_INTMASK2            0x75
 #define        ADM1027_REG_EXTEND_ADC1         0x76
 #define        ADM1027_REG_EXTEND_ADC2         0x77
-#define        ADM1027_REG_CONFIG3             0x78
-#define        ADM1027_REG_FAN_PPR             0x7b
-
-#define        ADT7463_REG_THERM               0x79
-#define        ADT7463_REG_THERM_LIMIT         0x7A
 
 #define EMC6D100_REG_ALARM3             0x7d
 /* IN5, IN6 and IN7 */
-#define        EMC6D100_REG_IN(nr)             (0x70 + ((nr)-5))
-#define        EMC6D100_REG_IN_MIN(nr)         (0x73 + ((nr)-5) * 2)
-#define        EMC6D100_REG_IN_MAX(nr)         (0x74 + ((nr)-5) * 2)
+#define        EMC6D100_REG_IN(nr)             (0x70 + ((nr) - 5))
+#define        EMC6D100_REG_IN_MIN(nr)         (0x73 + ((nr) - 5) * 2)
+#define        EMC6D100_REG_IN_MAX(nr)         (0x74 + ((nr) - 5) * 2)
 #define        EMC6D102_REG_EXTEND_ADC1        0x85
 #define        EMC6D102_REG_EXTEND_ADC2        0x86
 #define        EMC6D102_REG_EXTEND_ADC3        0x87
 #define        EMC6D102_REG_EXTEND_ADC4        0x88
 
 
-/* Conversions. Rounding and limit checking is only done on the TO_REG 
+/* Conversions. Rounding and limit checking is only done on the TO_REG
    variants. Note that you should be a bit careful with which arguments
    these macros are called: arguments may be evaluated more than once.
  */
 
 /* IN are scaled acording to built-in resistors */
-static int lm85_scaling[] = {  /* .001 Volts */
-               2500, 2250, 3300, 5000, 12000,
-               3300, 1500, 1800 /*EMC6D100*/
-       };
-#define SCALE(val,from,to)             (((val)*(to) + ((from)/2))/(from))
+static const int lm85_scaling[] = {  /* .001 Volts */
+       2500, 2250, 3300, 5000, 12000,
+       3300, 1500, 1800 /*EMC6D100*/
+};
+#define SCALE(val, from, to)   (((val) * (to) + ((from) / 2)) / (from))
 
-#define INS_TO_REG(n,val)      \
-               SENSORS_LIMIT(SCALE(val,lm85_scaling[n],192),0,255)
+#define INS_TO_REG(n, val)     \
+               SENSORS_LIMIT(SCALE(val, lm85_scaling[n], 192), 0, 255)
 
-#define INSEXT_FROM_REG(n,val,ext)     \
+#define INSEXT_FROM_REG(n, val, ext)   \
                SCALE(((val) << 4) + (ext), 192 << 4, lm85_scaling[n])
 
-#define INS_FROM_REG(n,val)    SCALE((val), 192, lm85_scaling[n])
+#define INS_FROM_REG(n, val)   SCALE((val), 192, lm85_scaling[n])
 
 /* FAN speed is measured using 90kHz clock */
 static inline u16 FAN_TO_REG(unsigned long val)
@@ -151,16 +131,17 @@ static inline u16 FAN_TO_REG(unsigned long val)
                return 0xffff;
        return SENSORS_LIMIT(5400000 / val, 1, 0xfffe);
 }
-#define FAN_FROM_REG(val)      ((val)==0?-1:(val)==0xffff?0:5400000/(val))
+#define FAN_FROM_REG(val)      ((val) == 0 ? -1 : (val) == 0xffff ? 0 : \
+                                5400000 / (val))
 
 /* Temperature is reported in .001 degC increments */
 #define TEMP_TO_REG(val)       \
-               SENSORS_LIMIT(SCALE(val,1000,1),-127,127)
-#define TEMPEXT_FROM_REG(val,ext)      \
+               SENSORS_LIMIT(SCALE(val, 1000, 1), -127, 127)
+#define TEMPEXT_FROM_REG(val, ext)     \
                SCALE(((val) << 4) + (ext), 16, 1000)
 #define TEMP_FROM_REG(val)     ((val) * 1000)
 
-#define PWM_TO_REG(val)                        (SENSORS_LIMIT(val,0,255))
+#define PWM_TO_REG(val)                        SENSORS_LIMIT(val, 0, 255)
 #define PWM_FROM_REG(val)              (val)
 
 
@@ -183,17 +164,17 @@ static inline u16 FAN_TO_REG(unsigned long val)
  */
 
 /* These are the zone temperature range encodings in .001 degree C */
-static int lm85_range_map[] = {   
-               2000,  2500,  3300,  4000,  5000,  6600,
-               8000, 10000, 13300, 16000, 20000, 26600,
-               32000, 40000, 53300, 80000
-       };
-static int RANGE_TO_REG( int range )
+static const int lm85_range_map[] = {
+       2000, 2500, 3300, 4000, 5000, 6600, 8000, 10000,
+       13300, 16000, 20000, 26600, 32000, 40000, 53300, 80000
+};
+
+static int RANGE_TO_REG(int range)
 {
        int i;
 
        if (range >= lm85_range_map[15])
-               return 15 ;
+               return 15;
 
        /* Find the closest match */
        for (i = 14; i >= 0; --i) {
@@ -207,28 +188,25 @@ static int RANGE_TO_REG( int range )
 
        return 0;
 }
-#define RANGE_FROM_REG(val) (lm85_range_map[(val)&0x0f])
+#define RANGE_FROM_REG(val)    lm85_range_map[(val) & 0x0f]
 
-/* These are the Acoustic Enhancement, or Temperature smoothing encodings
- * NOTE: The enable/disable bit is INCLUDED in these encodings as the
- *       MSB (bit 3, value 8).  If the enable bit is 0, the encoded value
- *       is ignored, or set to 0.
- */
 /* These are the PWM frequency encodings */
-static int lm85_freq_map[] = { /* .1 Hz */
-               100, 150, 230, 300, 380, 470, 620, 940
-       };
-static int FREQ_TO_REG( int freq )
+static const int lm85_freq_map[] = { /* .1 Hz */
+       100, 150, 230, 300, 380, 470, 620, 940
+};
+
+static int FREQ_TO_REG(int freq)
 {
        int i;
 
-       if( freq >= lm85_freq_map[7] ) { return 7 ; }
-       for( i = 0 ; i < 7 ; ++i )
-               if( freq <= lm85_freq_map[i] )
-                       break ;
-       return( i & 0x07 );
+       if (freq >= lm85_freq_map[7])
+               return 7;
+       for (i = 0; i < 7; ++i)
+               if (freq <= lm85_freq_map[i])
+                       break;
+       return i;
 }
-#define FREQ_FROM_REG(val) (lm85_freq_map[(val)&0x07])
+#define FREQ_FROM_REG(val)     lm85_freq_map[(val) & 0x07]
 
 /* Since we can't use strings, I'm abusing these numbers
  *   to stand in for the following meanings:
@@ -242,30 +220,23 @@ static int FREQ_TO_REG( int freq )
  *     -2 -- PWM responds to manual control
  */
 
-static int lm85_zone_map[] = { 1, 2, 3, -1, 0, 23, 123, -2 };
-#define ZONE_FROM_REG(val) (lm85_zone_map[((val)>>5)&0x07])
+static const int lm85_zone_map[] = { 1, 2, 3, -1, 0, 23, 123, -2 };
+#define ZONE_FROM_REG(val)     lm85_zone_map[(val) >> 5]
 
-static int ZONE_TO_REG( int zone )
+static int ZONE_TO_REG(int zone)
 {
        int i;
 
-       for( i = 0 ; i <= 7 ; ++i )
-               if( zone == lm85_zone_map[i] )
-                       break ;
-       if( i > 7 )   /* Not found. */
+       for (i = 0; i <= 7; ++i)
+               if (zone == lm85_zone_map[i])
+                       break;
+       if (i > 7)   /* Not found. */
                i = 3;  /* Always 100% */
-       return( (i & 0x07)<<5 );
+       return i << 5;
 }
 
-#define HYST_TO_REG(val) (SENSORS_LIMIT(((val)+500)/1000,0,15))
-#define HYST_FROM_REG(val) ((val)*1000)
-
-#define OFFSET_TO_REG(val) (SENSORS_LIMIT((val)/25,-127,127))
-#define OFFSET_FROM_REG(val) ((val)*25)
-
-#define PPR_MASK(fan) (0x03<<(fan *2))
-#define PPR_TO_REG(val,fan) (SENSORS_LIMIT((val)-1,0,3)<<(fan *2))
-#define PPR_FROM_REG(val,fan) ((((val)>>(fan * 2))&0x03)+1)
+#define HYST_TO_REG(val)       SENSORS_LIMIT(((val) + 500) / 1000, 0, 15)
+#define HYST_FROM_REG(val)     ((val) * 1000)
 
 /* Chip sampling rates
  *
@@ -292,11 +263,11 @@ struct lm85_zone {
        u8 hyst;        /* Low limit hysteresis. (0-15) */
        u8 range;       /* Temp range, encoded */
        s8 critical;    /* "All fans ON" temp limit */
-       u8 off_desired; /* Actual "off" temperature specified.  Preserved 
+       u8 off_desired; /* Actual "off" temperature specified.  Preserved
                         * to prevent "drift" as other autofan control
                         * values change.
                         */
-       u8 max_desired; /* Actual "max" temperature specified.  Preserved 
+       u8 max_desired; /* Actual "max" temperature specified.  Preserved
                         * to prevent "drift" as other autofan control
                         * values change.
                         */
@@ -327,23 +298,13 @@ struct lm85_data {
        s8 temp[3];             /* Register value */
        s8 temp_min[3];         /* Register value */
        s8 temp_max[3];         /* Register value */
-       s8 temp_offset[3];      /* Register value */
        u16 fan[4];             /* Register value */
        u16 fan_min[4];         /* Register value */
        u8 pwm[3];              /* Register value */
-       u8 spinup_ctl;          /* Register encoding, combined */
-       u8 tach_mode;           /* Register encoding, combined */
        u8 temp_ext[3];         /* Decoded values */
        u8 in_ext[8];           /* Decoded values */
-       u8 fan_ppr;             /* Register value */
-       u8 smooth[3];           /* Register encoding */
        u8 vid;                 /* Register value */
        u8 vrm;                 /* VRM version */
-       u8 syncpwm3;            /* Saved PWM3 for TACH 2,3,4 config */
-       u8 oppoint[3];          /* Register value */
-       u16 tmin_ctl;           /* Register value */
-       unsigned long therm_total; /* Cummulative therm count */
-       u8 therm_limit;         /* Register value */
        u32 alarms;             /* Register encoding, combined */
        struct lm85_autofan autofan[3];
        struct lm85_zone zone[3];
@@ -355,9 +316,8 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
 static int lm85_detach_client(struct i2c_client *client);
 
 static int lm85_read_value(struct i2c_client *client, u8 reg);
-static int lm85_write_value(struct i2c_client *client, u8 reg, int value);
+static void lm85_write_value(struct i2c_client *client, u8 reg, int value);
 static struct lm85_data *lm85_update_device(struct device *dev);
-static void lm85_init_client(struct i2c_client *client);
 
 
 static struct i2c_driver lm85_driver = {
@@ -375,7 +335,7 @@ static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr]) );
+       return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr]));
 }
 
 static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
@@ -383,7 +343,7 @@ static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr]) );
+       return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[nr]));
 }
 
 static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
@@ -414,7 +374,8 @@ show_fan_offset(4);
 
 /* vid, vrm, alarms */
 
-static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr,
+               char *buf)
 {
        struct lm85_data *data = lm85_update_device(dev);
        int vid;
@@ -432,13 +393,15 @@ static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, c
 
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
 
-static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr,
+               char *buf)
 {
        struct lm85_data *data = dev_get_drvdata(dev);
        return sprintf(buf, "%ld\n", (long) data->vrm);
 }
 
-static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
+               const char *buf, size_t count)
 {
        struct lm85_data *data = dev_get_drvdata(dev);
        data->vrm = simple_strtoul(buf, NULL, 10);
@@ -447,7 +410,8 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
 
 static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
 
-static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_alarms_reg(struct device *dev, struct device_attribute
+               *attr, char *buf)
 {
        struct lm85_data *data = lm85_update_device(dev);
        return sprintf(buf, "%u\n", data->alarms);
@@ -488,7 +452,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm[nr]) );
+       return sprintf(buf, "%d\n", PWM_FROM_REG(data->pwm[nr]));
 }
 
 static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
@@ -581,17 +545,16 @@ static ssize_t show_in(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf( buf, "%d\n", INSEXT_FROM_REG(nr,
-                                                    data->in[nr],
-                                                    data->in_ext[nr]));
+       return sprintf(buf, "%d\n", INSEXT_FROM_REG(nr, data->in[nr],
+                                                   data->in_ext[nr]));
 }
 
-static ssize_t show_in_min(struct device *dev,  struct device_attribute *attr,
+static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
                char *buf)
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr]) );
+       return sprintf(buf, "%d\n", INS_FROM_REG(nr, data->in_min[nr]));
 }
 
 static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
@@ -614,7 +577,7 @@ static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr]) );
+       return sprintf(buf, "%d\n", INS_FROM_REG(nr, data->in_max[nr]));
 }
 
 static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
@@ -656,8 +619,8 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMPEXT_FROM_REG(data->temp[nr],
-                                                   data->temp_ext[nr]));
+       return sprintf(buf, "%d\n", TEMPEXT_FROM_REG(data->temp[nr],
+                                                    data->temp_ext[nr]));
 }
 
 static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
@@ -665,7 +628,7 @@ static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr]) );
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[nr]));
 }
 
 static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
@@ -688,7 +651,7 @@ static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr]) );
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[nr]));
 }
 
 static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
@@ -697,7 +660,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
        int nr = to_sensor_dev_attr(attr)->index;
        struct i2c_client *client = to_i2c_client(dev);
        struct lm85_data *data = i2c_get_clientdata(client);
-       long val = simple_strtol(buf, NULL, 10);        
+       long val = simple_strtol(buf, NULL, 10);
 
        mutex_lock(&data->update_lock);
        data->temp_max[nr] = TEMP_TO_REG(val);
@@ -726,7 +689,7 @@ static ssize_t show_pwm_auto_channels(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", ZONE_FROM_REG(data->autofan[nr].config));
+       return sprintf(buf, "%d\n", ZONE_FROM_REG(data->autofan[nr].config));
 }
 
 static ssize_t set_pwm_auto_channels(struct device *dev,
@@ -735,11 +698,11 @@ static ssize_t set_pwm_auto_channels(struct device *dev,
        int nr = to_sensor_dev_attr(attr)->index;
        struct i2c_client *client = to_i2c_client(dev);
        struct lm85_data *data = i2c_get_clientdata(client);
-       long val = simple_strtol(buf, NULL, 10);   
+       long val = simple_strtol(buf, NULL, 10);
 
        mutex_lock(&data->update_lock);
        data->autofan[nr].config = (data->autofan[nr].config & (~0xe0))
-               | ZONE_TO_REG(val) ;
+               | ZONE_TO_REG(val);
        lm85_write_value(client, LM85_REG_AFAN_CONFIG(nr),
                data->autofan[nr].config);
        mutex_unlock(&data->update_lock);
@@ -751,7 +714,7 @@ static ssize_t show_pwm_auto_pwm_min(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", PWM_FROM_REG(data->autofan[nr].min_pwm));
+       return sprintf(buf, "%d\n", PWM_FROM_REG(data->autofan[nr].min_pwm));
 }
 
 static ssize_t set_pwm_auto_pwm_min(struct device *dev,
@@ -775,7 +738,7 @@ static ssize_t show_pwm_auto_pwm_minctl(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", data->autofan[nr].min_off);
+       return sprintf(buf, "%d\n", data->autofan[nr].min_off);
 }
 
 static ssize_t set_pwm_auto_pwm_minctl(struct device *dev,
@@ -785,15 +748,15 @@ static ssize_t set_pwm_auto_pwm_minctl(struct device *dev,
        struct i2c_client *client = to_i2c_client(dev);
        struct lm85_data *data = i2c_get_clientdata(client);
        long val = simple_strtol(buf, NULL, 10);
+       u8 tmp;
 
        mutex_lock(&data->update_lock);
        data->autofan[nr].min_off = val;
-       lm85_write_value(client, LM85_REG_AFAN_SPIKE1, data->smooth[0]
-               | data->syncpwm3
-               | (data->autofan[0].min_off ? 0x20 : 0)
-               | (data->autofan[1].min_off ? 0x40 : 0)
-               | (data->autofan[2].min_off ? 0x80 : 0)
-       );
+       tmp = lm85_read_value(client, LM85_REG_AFAN_SPIKE1);
+       tmp &= ~(0x20 << nr);
+       if (data->autofan[nr].min_off)
+               tmp |= 0x20 << nr;
+       lm85_write_value(client, LM85_REG_AFAN_SPIKE1, tmp);
        mutex_unlock(&data->update_lock);
        return count;
 }
@@ -803,7 +766,7 @@ static ssize_t show_pwm_auto_pwm_freq(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", FREQ_FROM_REG(data->autofan[nr].freq));
+       return sprintf(buf, "%d\n", FREQ_FROM_REG(data->autofan[nr].freq));
 }
 
 static ssize_t set_pwm_auto_pwm_freq(struct device *dev,
@@ -818,8 +781,7 @@ static ssize_t set_pwm_auto_pwm_freq(struct device *dev,
        data->autofan[nr].freq = FREQ_TO_REG(val);
        lm85_write_value(client, LM85_REG_AFAN_RANGE(nr),
                (data->zone[nr].range << 4)
-               | data->autofan[nr].freq
-       ); 
+               | data->autofan[nr].freq);
        mutex_unlock(&data->update_lock);
        return count;
 }
@@ -849,7 +811,7 @@ static ssize_t show_temp_auto_temp_off(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) -
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit) -
                HYST_FROM_REG(data->zone[nr].hyst));
 }
 
@@ -866,15 +828,13 @@ static ssize_t set_temp_auto_temp_off(struct device *dev,
        min = TEMP_FROM_REG(data->zone[nr].limit);
        data->zone[nr].off_desired = TEMP_TO_REG(val);
        data->zone[nr].hyst = HYST_TO_REG(min - val);
-       if ( nr == 0 || nr == 1 ) {
+       if (nr == 0 || nr == 1) {
                lm85_write_value(client, LM85_REG_AFAN_HYST1,
                        (data->zone[0].hyst << 4)
-                       | data->zone[1].hyst
-                       );
+                       | data->zone[1].hyst);
        } else {
                lm85_write_value(client, LM85_REG_AFAN_HYST2,
-                       (data->zone[2].hyst << 4)
-               );
+                       (data->zone[2].hyst << 4));
        }
        mutex_unlock(&data->update_lock);
        return count;
@@ -885,7 +845,7 @@ static ssize_t show_temp_auto_temp_min(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) );
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit));
 }
 
 static ssize_t set_temp_auto_temp_min(struct device *dev,
@@ -913,15 +873,13 @@ static ssize_t set_temp_auto_temp_min(struct device *dev,
        data->zone[nr].hyst = HYST_TO_REG(TEMP_FROM_REG(
                data->zone[nr].limit) - TEMP_FROM_REG(
                data->zone[nr].off_desired));
-       if ( nr == 0 || nr == 1 ) {
+       if (nr == 0 || nr == 1) {
                lm85_write_value(client, LM85_REG_AFAN_HYST1,
                        (data->zone[0].hyst << 4)
-                       | data->zone[1].hyst
-                       );
+                       | data->zone[1].hyst);
        } else {
                lm85_write_value(client, LM85_REG_AFAN_HYST2,
-                       (data->zone[2].hyst << 4)
-               );
+                       (data->zone[2].hyst << 4));
        }
        mutex_unlock(&data->update_lock);
        return count;
@@ -932,7 +890,7 @@ static ssize_t show_temp_auto_temp_max(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) +
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit) +
                RANGE_FROM_REG(data->zone[nr].range));
 }
 
@@ -962,11 +920,11 @@ static ssize_t show_temp_auto_temp_crit(struct device *dev,
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct lm85_data *data = lm85_update_device(dev);
-       return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].critical));
+       return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].critical));
 }
 
 static ssize_t set_temp_auto_temp_crit(struct device *dev,
-               struct device_attribute *attr,const char *buf, size_t count)
+               struct device_attribute *attr, const char *buf, size_t count)
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct i2c_client *client = to_i2c_client(dev);
@@ -1127,20 +1085,37 @@ static const struct attribute_group lm85_group_in567 = {
        .attrs = lm85_attributes_in567,
 };
 
+static void lm85_init_client(struct i2c_client *client)
+{
+       int value;
+
+       /* Start monitoring if needed */
+       value = lm85_read_value(client, LM85_REG_CONFIG);
+       if (!(value & 0x01)) {
+               dev_info(&client->dev, "Starting monitoring\n");
+               lm85_write_value(client, LM85_REG_CONFIG, value | 0x01);
+       }
+
+       /* Warn about unusual configuration bits */
+       if (value & 0x02)
+               dev_warn(&client->dev, "Device configuration is locked\n");
+       if (!(value & 0x04))
+               dev_warn(&client->dev, "Device is not ready\n");
+}
+
 static int lm85_detect(struct i2c_adapter *adapter, int address,
                int kind)
 {
-       int company, verstep ;
-       struct i2c_client *new_client = NULL;
+       int company, verstep;
+       struct i2c_client *client;
        struct lm85_data *data;
        int err = 0;
-       const char *type_name = "";
+       const char *type_name;
 
-       if (!i2c_check_functionality(adapter,
-                                       I2C_FUNC_SMBUS_BYTE_DATA)) {
+       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
                /* We need to be able to do byte I/O */
-               goto ERROR0 ;
-       };
+               goto ERROR0;
+       }
 
        /* OK. For now, we presume we have a valid client. We now create the
           client structure, even though we cannot fill it completely yet.
@@ -1151,138 +1126,145 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
                goto ERROR0;
        }
 
-       new_client = &data->client;
-       i2c_set_clientdata(new_client, data);
-       new_client->addr = address;
-       new_client->adapter = adapter;
-       new_client->driver = &lm85_driver;
-       new_client->flags = 0;
+       client = &data->client;
+       i2c_set_clientdata(client, data);
+       client->addr = address;
+       client->adapter = adapter;
+       client->driver = &lm85_driver;
 
        /* Now, we do the remaining detection. */
 
-       company = lm85_read_value(new_client, LM85_REG_COMPANY);
-       verstep = lm85_read_value(new_client, LM85_REG_VERSTEP);
+       company = lm85_read_value(client, LM85_REG_COMPANY);
+       verstep = lm85_read_value(client, LM85_REG_VERSTEP);
 
        dev_dbg(&adapter->dev, "Detecting device at %d,0x%02x with"
                " COMPANY: 0x%02x and VERSTEP: 0x%02x\n",
-               i2c_adapter_id(new_client->adapter), new_client->addr,
+               i2c_adapter_id(client->adapter), client->addr,
                company, verstep);
 
        /* If auto-detecting, Determine the chip type. */
        if (kind <= 0) {
                dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x ...\n",
-                       i2c_adapter_id(adapter), address );
-               ifcompany == LM85_COMPANY_NATIONAL
-                   && verstep == LM85_VERSTEP_LM85C ) {
-                       kind = lm85c ;
-               } else ifcompany == LM85_COMPANY_NATIONAL
-                   && verstep == LM85_VERSTEP_LM85B ) {
-                       kind = lm85b ;
-               } else ifcompany == LM85_COMPANY_NATIONAL
-                   && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) {
+                       i2c_adapter_id(adapter), address);
+               if (company == LM85_COMPANY_NATIONAL
+                   && verstep == LM85_VERSTEP_LM85C) {
+                       kind = lm85c;
+               } else if (company == LM85_COMPANY_NATIONAL
+                   && verstep == LM85_VERSTEP_LM85B) {
+                       kind = lm85b;
+               } else if (company == LM85_COMPANY_NATIONAL
+                   && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
                        dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
                                " Defaulting to LM85.\n", verstep);
-                       kind = any_chip ;
-               } else ifcompany == LM85_COMPANY_ANALOG_DEV
-                   && verstep == LM85_VERSTEP_ADM1027 ) {
-                       kind = adm1027 ;
-               } else ifcompany == LM85_COMPANY_ANALOG_DEV
+                       kind = any_chip;
+               } else if (company == LM85_COMPANY_ANALOG_DEV
+                   && verstep == LM85_VERSTEP_ADM1027) {
+                       kind = adm1027;
+               } else if (company == LM85_COMPANY_ANALOG_DEV
                    && (verstep == LM85_VERSTEP_ADT7463
-                        || verstep == LM85_VERSTEP_ADT7463C) ) {
-                       kind = adt7463 ;
-               } else ifcompany == LM85_COMPANY_ANALOG_DEV
-                   && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) {
+                        || verstep == LM85_VERSTEP_ADT7463C)) {
+                       kind = adt7463;
+               } else if (company == LM85_COMPANY_ANALOG_DEV
+                   && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
                        dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
-                               " Defaulting to Generic LM85.\n", verstep );
-                       kind = any_chip ;
-               } else ifcompany == LM85_COMPANY_SMSC
+                               " Defaulting to Generic LM85.\n", verstep);
+                       kind = any_chip;
+               } else if (company == LM85_COMPANY_SMSC
                    && (verstep == LM85_VERSTEP_EMC6D100_A0
-                        || verstep == LM85_VERSTEP_EMC6D100_A1) ) {
+                        || verstep == LM85_VERSTEP_EMC6D100_A1)) {
                        /* Unfortunately, we can't tell a '100 from a '101
                         * from the registers.  Since a '101 is a '100
                         * in a package with fewer pins and therefore no
                         * 3.3V, 1.5V or 1.8V inputs, perhaps if those
                         * inputs read 0, then it's a '101.
                         */
-                       kind = emc6d100 ;
-               } else ifcompany == LM85_COMPANY_SMSC
+                       kind = emc6d100;
+               } else if (company == LM85_COMPANY_SMSC
                    && verstep == LM85_VERSTEP_EMC6D102) {
-                       kind = emc6d102 ;
-               } else ifcompany == LM85_COMPANY_SMSC
+                       kind = emc6d102;
+               } else if (company == LM85_COMPANY_SMSC
                    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
                        dev_err(&adapter->dev, "lm85: Detected SMSC chip\n");
                        dev_err(&adapter->dev, "lm85: Unrecognized version/stepping 0x%02x"
-                           " Defaulting to Generic LM85.\n", verstep );
-                       kind = any_chip ;
-               } else ifkind == any_chip
+                           " Defaulting to Generic LM85.\n", verstep);
+                       kind = any_chip;
+               } else if (kind == any_chip
                    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
                        dev_err(&adapter->dev, "Generic LM85 Version 6 detected\n");
                        /* Leave kind as "any_chip" */
                } else {
                        dev_dbg(&adapter->dev, "Autodetection failed\n");
-                       /* Not an LM85 ... */
-                       if( kind == any_chip ) {  /* User used force=x,y */
+                       /* Not an LM85... */
+                       if (kind == any_chip) {  /* User used force=x,y */
                                dev_err(&adapter->dev, "Generic LM85 Version 6 not"
                                        " found at %d,0x%02x. Try force_lm85c.\n",
-                                       i2c_adapter_id(adapter), address );
+                                       i2c_adapter_id(adapter), address);
                        }
-                       err = 0 ;
+                       err = 0;
                        goto ERROR1;
                }
        }
 
        /* Fill in the chip specific driver values */
-       if ( kind == any_chip ) {
-               type_name = "lm85";
-       } else if ( kind == lm85b ) {
+       switch (kind) {
+       case lm85b:
                type_name = "lm85b";
-       } else if ( kind == lm85c ) {
+               break;
+       case lm85c:
                type_name = "lm85c";
-       } else if ( kind == adm1027 ) {
+               break;
+       case adm1027:
                type_name = "adm1027";
-       } else if ( kind == adt7463 ) {
+               break;
+       case adt7463:
                type_name = "adt7463";
-       } else if ( kind == emc6d100){
+               break;
+       case emc6d100:
                type_name = "emc6d100";
-       } else if ( kind == emc6d102 ) {
+               break;
+       case emc6d102:
                type_name = "emc6d102";
+               break;
+       default:
+               type_name = "lm85";
        }
-       strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
+       strlcpy(client->name, type_name, I2C_NAME_SIZE);
 
        /* Fill in the remaining client fields */
        data->type = kind;
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Tell the I2C layer a new client has arrived */
-       if ((err = i2c_attach_client(new_client)))
+       err = i2c_attach_client(client);
+       if (err)
                goto ERROR1;
 
        /* Set the VRM version */
        data->vrm = vid_which_vrm();
 
        /* Initialize the LM85 chip */
-       lm85_init_client(new_client);
+       lm85_init_client(client);
 
        /* Register sysfs hooks */
-       if ((err = sysfs_create_group(&new_client->dev.kobj, &lm85_group)))
+       err = sysfs_create_group(&client->dev.kobj, &lm85_group);
+       if (err)
                goto ERROR2;
 
        /* The ADT7463 has an optional VRM 10 mode where pin 21 is used
           as a sixth digital VID input rather than an analog input. */
-       data->vid = lm85_read_value(new_client, LM85_REG_VID);
+       data->vid = lm85_read_value(client, LM85_REG_VID);
        if (!(kind == adt7463 && (data->vid & 0x80)))
-               if ((err = sysfs_create_group(&new_client->dev.kobj,
+               if ((err = sysfs_create_group(&client->dev.kobj,
                                        &lm85_group_in4)))
                        goto ERROR3;
 
        /* The EMC6D100 has 3 additional voltage inputs */
        if (kind == emc6d100)
-               if ((err = sysfs_create_group(&new_client->dev.kobj,
+               if ((err = sysfs_create_group(&client->dev.kobj,
                                        &lm85_group_in567)))
                        goto ERROR3;
 
-       data->hwmon_dev = hwmon_device_register(&new_client->dev);
+       data->hwmon_dev = hwmon_device_register(&client->dev);
        if (IS_ERR(data->hwmon_dev)) {
                err = PTR_ERR(data->hwmon_dev);
                goto ERROR3;
@@ -1291,16 +1273,16 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
        return 0;
 
        /* Error out and cleanup code */
   ERROR3:
-       sysfs_remove_group(&new_client->dev.kobj, &lm85_group);
-       sysfs_remove_group(&new_client->dev.kobj, &lm85_group_in4);
+ ERROR3:
+       sysfs_remove_group(&client->dev.kobj, &lm85_group);
+       sysfs_remove_group(&client->dev.kobj, &lm85_group_in4);
        if (kind == emc6d100)
-               sysfs_remove_group(&new_client->dev.kobj, &lm85_group_in567);
   ERROR2:
-       i2c_detach_client(new_client);
   ERROR1:
+               sysfs_remove_group(&client->dev.kobj, &lm85_group_in567);
+ ERROR2:
+       i2c_detach_client(client);
+ ERROR1:
        kfree(data);
   ERROR0:
+ ERROR0:
        return err;
 }
 
@@ -1323,100 +1305,46 @@ static int lm85_read_value(struct i2c_client *client, u8 reg)
        int res;
 
        /* What size location is it? */
-       switch( reg ) {
-       case LM85_REG_FAN(0) :  /* Read WORD data */
-       case LM85_REG_FAN(1) :
-       case LM85_REG_FAN(2) :
-       case LM85_REG_FAN(3) :
-       case LM85_REG_FAN_MIN(0) :
-       case LM85_REG_FAN_MIN(1) :
-       case LM85_REG_FAN_MIN(2) :
-       case LM85_REG_FAN_MIN(3) :
-       case LM85_REG_ALARM1 :  /* Read both bytes at once */
-               res = i2c_smbus_read_byte_data(client, reg) & 0xff ;
-               res |= i2c_smbus_read_byte_data(client, reg+1) << 8 ;
-               break ;
-       case ADT7463_REG_TMIN_CTL1 :  /* Read WORD MSB, LSB */
-               res = i2c_smbus_read_byte_data(client, reg) << 8 ;
-               res |= i2c_smbus_read_byte_data(client, reg+1) & 0xff ;
-               break ;
+       switch (reg) {
+       case LM85_REG_FAN(0):  /* Read WORD data */
+       case LM85_REG_FAN(1):
+       case LM85_REG_FAN(2):
+       case LM85_REG_FAN(3):
+       case LM85_REG_FAN_MIN(0):
+       case LM85_REG_FAN_MIN(1):
+       case LM85_REG_FAN_MIN(2):
+       case LM85_REG_FAN_MIN(3):
+       case LM85_REG_ALARM1:   /* Read both bytes at once */
+               res = i2c_smbus_read_byte_data(client, reg) & 0xff;
+               res |= i2c_smbus_read_byte_data(client, reg + 1) << 8;
+               break;
        default:        /* Read BYTE data */
                res = i2c_smbus_read_byte_data(client, reg);
-               break ;
+               break;
        }
 
-       return res ;
+       return res;
 }
 
-static int lm85_write_value(struct i2c_client *client, u8 reg, int value)
+static void lm85_write_value(struct i2c_client *client, u8 reg, int value)
 {
-       int res ;
-
-       switch( reg ) {
-       case LM85_REG_FAN(0) :  /* Write WORD data */
-       case LM85_REG_FAN(1) :
-       case LM85_REG_FAN(2) :
-       case LM85_REG_FAN(3) :
-       case LM85_REG_FAN_MIN(0) :
-       case LM85_REG_FAN_MIN(1) :
-       case LM85_REG_FAN_MIN(2) :
-       case LM85_REG_FAN_MIN(3) :
+       switch (reg) {
+       case LM85_REG_FAN(0):  /* Write WORD data */
+       case LM85_REG_FAN(1):
+       case LM85_REG_FAN(2):
+       case LM85_REG_FAN(3):
+       case LM85_REG_FAN_MIN(0):
+       case LM85_REG_FAN_MIN(1):
+       case LM85_REG_FAN_MIN(2):
+       case LM85_REG_FAN_MIN(3):
        /* NOTE: ALARM is read only, so not included here */
-               res = i2c_smbus_write_byte_data(client, reg, value & 0xff) ;
-               res |= i2c_smbus_write_byte_data(client, reg+1, (value>>8) & 0xff) ;
-               break ;
-       case ADT7463_REG_TMIN_CTL1 :  /* Write WORD MSB, LSB */
-               res = i2c_smbus_write_byte_data(client, reg, (value>>8) & 0xff);
-               res |= i2c_smbus_write_byte_data(client, reg+1, value & 0xff) ;
-               break ;
+               i2c_smbus_write_byte_data(client, reg, value & 0xff);
+               i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
+               break;
        default:        /* Write BYTE data */
-               res = i2c_smbus_write_byte_data(client, reg, value);
-               break ;
+               i2c_smbus_write_byte_data(client, reg, value);
+               break;
        }
-
-       return res ;
-}
-
-static void lm85_init_client(struct i2c_client *client)
-{
-       int value;
-       struct lm85_data *data = i2c_get_clientdata(client);
-
-       dev_dbg(&client->dev, "Initializing device\n");
-
-       /* Warn if part was not "READY" */
-       value = lm85_read_value(client, LM85_REG_CONFIG);
-       dev_dbg(&client->dev, "LM85_REG_CONFIG is: 0x%02x\n", value);
-       if( value & 0x02 ) {
-               dev_err(&client->dev, "Client (%d,0x%02x) config is locked.\n",
-                           i2c_adapter_id(client->adapter), client->addr );
-       };
-       if( ! (value & 0x04) ) {
-               dev_err(&client->dev, "Client (%d,0x%02x) is not ready.\n",
-                           i2c_adapter_id(client->adapter), client->addr );
-       };
-       if( value & 0x10
-           && ( data->type == adm1027
-               || data->type == adt7463 ) ) {
-               dev_err(&client->dev, "Client (%d,0x%02x) VxI mode is set.  "
-                       "Please report this to the lm85 maintainer.\n",
-                           i2c_adapter_id(client->adapter), client->addr );
-       };
-
-       /* WE INTENTIONALLY make no changes to the limits,
-        *   offsets, pwms, fans and zones.  If they were
-        *   configured, we don't want to mess with them.
-        *   If they weren't, the default is 100% PWM, no
-        *   control and will suffice until 'sensors -s'
-        *   can be run by the user.
-        */
-
-       /* Start monitoring */
-       value = lm85_read_value(client, LM85_REG_CONFIG);
-       /* Try to clear LOCK, Set START, save everything else */
-       value = (value & ~ 0x02) | 0x01 ;
-       dev_dbg(&client->dev, "Setting CONFIG to: 0x%02x\n", value);
-       lm85_write_value(client, LM85_REG_CONFIG, value);
 }
 
 static struct lm85_data *lm85_update_device(struct device *dev)
@@ -1427,28 +1355,30 @@ static struct lm85_data *lm85_update_device(struct device *dev)
 
        mutex_lock(&data->update_lock);
 
-       if ( !data->valid ||
-            time_after(jiffies, data->last_reading + LM85_DATA_INTERVAL) ) {
+       if (!data->valid ||
+            time_after(jiffies, data->last_reading + LM85_DATA_INTERVAL)) {
                /* Things that change quickly */
                dev_dbg(&client->dev, "Reading sensor values\n");
-               
+
                /* Have to read extended bits first to "freeze" the
                 * more significant bits that are read later.
                 * There are 2 additional resolution bits per channel and we
                 * have room for 4, so we shift them to the left.
                 */
-               if ( (data->type == adm1027) || (data->type == adt7463) ) {
+               if (data->type == adm1027 || data->type == adt7463) {
                        int ext1 = lm85_read_value(client,
                                                   ADM1027_REG_EXTEND_ADC1);
                        int ext2 =  lm85_read_value(client,
                                                    ADM1027_REG_EXTEND_ADC2);
                        int val = (ext1 << 8) + ext2;
 
-                       for(i = 0; i <= 4; i++)
-                               data->in_ext[i] = ((val>>(i * 2))&0x03) << 2;
+                       for (i = 0; i <= 4; i++)
+                               data->in_ext[i] =
+                                       ((val >> (i * 2)) & 0x03) << 2;
 
-                       for(i = 0; i <= 2; i++)
-                               data->temp_ext[i] = (val>>((i + 4) * 2))&0x0c;
+                       for (i = 0; i <= 2; i++)
+                               data->temp_ext[i] =
+                                       (val >> ((i + 4) * 2)) & 0x0c;
                }
 
                data->vid = lm85_read_value(client, LM85_REG_VID);
@@ -1456,6 +1386,8 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                for (i = 0; i <= 3; ++i) {
                        data->in[i] =
                            lm85_read_value(client, LM85_REG_IN(i));
+                       data->fan[i] =
+                           lm85_read_value(client, LM85_REG_FAN(i));
                }
 
                if (!(data->type == adt7463 && (data->vid & 0x80))) {
@@ -1463,38 +1395,25 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                                      LM85_REG_IN(4));
                }
 
-               for (i = 0; i <= 3; ++i) {
-                       data->fan[i] =
-                           lm85_read_value(client, LM85_REG_FAN(i));
-               }
-
                for (i = 0; i <= 2; ++i) {
                        data->temp[i] =
                            lm85_read_value(client, LM85_REG_TEMP(i));
-               }
-
-               for (i = 0; i <= 2; ++i) {
                        data->pwm[i] =
                            lm85_read_value(client, LM85_REG_PWM(i));
                }
 
                data->alarms = lm85_read_value(client, LM85_REG_ALARM1);
 
-               if ( data->type == adt7463 ) {
-                       if( data->therm_total < ULONG_MAX - 256 ) {
-                           data->therm_total +=
-                               lm85_read_value(client, ADT7463_REG_THERM );
-                       }
-               } else if ( data->type == emc6d100 ) {
+               if (data->type == emc6d100) {
                        /* Three more voltage sensors */
                        for (i = 5; i <= 7; ++i) {
-                               data->in[i] =
-                                       lm85_read_value(client, EMC6D100_REG_IN(i));
+                               data->in[i] = lm85_read_value(client,
+                                                       EMC6D100_REG_IN(i));
                        }
                        /* More alarm bits */
-                       data->alarms |=
-                               lm85_read_value(client, EMC6D100_REG_ALARM3) << 16;
-               } else if (data->type == emc6d102 ) {
+                       data->alarms |= lm85_read_value(client,
+                                               EMC6D100_REG_ALARM3) << 16;
+               } else if (data->type == emc6d102) {
                        /* Have to read LSB bits after the MSB ones because
                           the reading of the MSB bits has frozen the
                           LSBs (backward from the ADM1027).
@@ -1509,20 +1428,20 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                                                   EMC6D102_REG_EXTEND_ADC4);
                        data->in_ext[0] = ext3 & 0x0f;
                        data->in_ext[1] = ext4 & 0x0f;
-                       data->in_ext[2] = (ext4 >> 4) & 0x0f;
-                       data->in_ext[3] = (ext3 >> 4) & 0x0f;
-                       data->in_ext[4] = (ext2 >> 4) & 0x0f;
+                       data->in_ext[2] = ext4 >> 4;
+                       data->in_ext[3] = ext3 >> 4;
+                       data->in_ext[4] = ext2 >> 4;
 
                        data->temp_ext[0] = ext1 & 0x0f;
                        data->temp_ext[1] = ext2 & 0x0f;
-                       data->temp_ext[2] = (ext1 >> 4) & 0x0f;
+                       data->temp_ext[2] = ext1 >> 4;
                }
 
-               data->last_reading = jiffies ;
-       };  /* last_reading */
+               data->last_reading = jiffies;
+       }  /* last_reading */
 
-       if ( !data->valid ||
-            time_after(jiffies, data->last_config + LM85_CONFIG_INTERVAL) ) {
+       if (!data->valid ||
+            time_after(jiffies, data->last_config + LM85_CONFIG_INTERVAL)) {
                /* Things that don't change often */
                dev_dbg(&client->dev, "Reading config values\n");
 
@@ -1531,6 +1450,8 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                            lm85_read_value(client, LM85_REG_IN_MIN(i));
                        data->in_max[i] =
                            lm85_read_value(client, LM85_REG_IN_MAX(i));
+                       data->fan_min[i] =
+                           lm85_read_value(client, LM85_REG_FAN_MIN(i));
                }
 
                if (!(data->type == adt7463 && (data->vid & 0x80))) {
@@ -1540,34 +1461,28 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                                          LM85_REG_IN_MAX(4));
                }
 
-               if ( data->type == emc6d100 ) {
+               if (data->type == emc6d100) {
                        for (i = 5; i <= 7; ++i) {
-                               data->in_min[i] =
-                                       lm85_read_value(client, EMC6D100_REG_IN_MIN(i));
-                               data->in_max[i] =
-                                       lm85_read_value(client, EMC6D100_REG_IN_MAX(i));
+                               data->in_min[i] = lm85_read_value(client,
+                                               EMC6D100_REG_IN_MIN(i));
+                               data->in_max[i] = lm85_read_value(client,
+                                               EMC6D100_REG_IN_MAX(i));
                        }
                }
 
-               for (i = 0; i <= 3; ++i) {
-                       data->fan_min[i] =
-                           lm85_read_value(client, LM85_REG_FAN_MIN(i));
-               }
-
                for (i = 0; i <= 2; ++i) {
+                       int val;
+
                        data->temp_min[i] =
                            lm85_read_value(client, LM85_REG_TEMP_MIN(i));
                        data->temp_max[i] =
                            lm85_read_value(client, LM85_REG_TEMP_MAX(i));
-               }
 
-               for (i = 0; i <= 2; ++i) {
-                       int val ;
                        data->autofan[i].config =
                            lm85_read_value(client, LM85_REG_AFAN_CONFIG(i));
                        val = lm85_read_value(client, LM85_REG_AFAN_RANGE(i));
-                       data->autofan[i].freq = val & 0x07 ;
-                       data->zone[i].range = (val >> 4) & 0x0f ;
+                       data->autofan[i].freq = val & 0x07;
+                       data->zone[i].range = val >> 4;
                        data->autofan[i].min_pwm =
                            lm85_read_value(client, LM85_REG_AFAN_MINPWM(i));
                        data->zone[i].limit =
@@ -1577,50 +1492,19 @@ static struct lm85_data *lm85_update_device(struct device *dev)
                }
 
                i = lm85_read_value(client, LM85_REG_AFAN_SPIKE1);
-               data->smooth[0] = i & 0x0f ;
-               data->syncpwm3 = i & 0x10 ;  /* Save PWM3 config */
-               data->autofan[0].min_off = (i & 0x20) != 0 ;
-               data->autofan[1].min_off = (i & 0x40) != 0 ;
-               data->autofan[2].min_off = (i & 0x80) != 0 ;
-               i = lm85_read_value(client, LM85_REG_AFAN_SPIKE2);
-               data->smooth[1] = (i>>4) & 0x0f ;
-               data->smooth[2] = i & 0x0f ;
+               data->autofan[0].min_off = (i & 0x20) != 0;
+               data->autofan[1].min_off = (i & 0x40) != 0;
+               data->autofan[2].min_off = (i & 0x80) != 0;
 
                i = lm85_read_value(client, LM85_REG_AFAN_HYST1);
-               data->zone[0].hyst = (i>>4) & 0x0f ;
-               data->zone[1].hyst = i & 0x0f ;
+               data->zone[0].hyst = i >> 4;
+               data->zone[1].hyst = i & 0x0f;
 
                i = lm85_read_value(client, LM85_REG_AFAN_HYST2);
-               data->zone[2].hyst = (i>>4) & 0x0f ;
-
-               if ( (data->type == lm85b) || (data->type == lm85c) ) {
-                       data->tach_mode = lm85_read_value(client,
-                               LM85_REG_TACH_MODE );
-                       data->spinup_ctl = lm85_read_value(client,
-                               LM85_REG_SPINUP_CTL );
-               } else if ( (data->type == adt7463) || (data->type == adm1027) ) {
-                       if ( data->type == adt7463 ) {
-                               for (i = 0; i <= 2; ++i) {
-                                   data->oppoint[i] = lm85_read_value(client,
-                                       ADT7463_REG_OPPOINT(i) );
-                               }
-                               data->tmin_ctl = lm85_read_value(client,
-                                       ADT7463_REG_TMIN_CTL1 );
-                               data->therm_limit = lm85_read_value(client,
-                                       ADT7463_REG_THERM_LIMIT );
-                       }
-                       for (i = 0; i <= 2; ++i) {
-                           data->temp_offset[i] = lm85_read_value(client,
-                               ADM1027_REG_TEMP_OFFSET(i) );
-                       }
-                       data->tach_mode = lm85_read_value(client,
-                               ADM1027_REG_CONFIG3 );
-                       data->fan_ppr = lm85_read_value(client,
-                               ADM1027_REG_FAN_PPR );
-               }
-       
+               data->zone[2].hyst = i >> 4;
+
                data->last_config = jiffies;
-       };  /* last_config */
+       }  /* last_config */
 
        data->valid = 1;
 
@@ -1635,17 +1519,15 @@ static int __init sm_lm85_init(void)
        return i2c_add_driver(&lm85_driver);
 }
 
-static void  __exit sm_lm85_exit(void)
+static void __exit sm_lm85_exit(void)
 {
        i2c_del_driver(&lm85_driver);
 }
 
-/* Thanks to Richard Barrington for adding the LM85 to sensors-detect.
- * Thanks to Margit Schubert-While <margitsw@t-online.de> for help with
- *     post 2.7.0 CVS changes.
- */
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, Margit Schubert-While <margitsw@t-online.de>, Justin Thiessen <jthiessen@penguincomputing.com");
+MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, "
+       "Margit Schubert-While <margitsw@t-online.de>, "
+       "Justin Thiessen <jthiessen@penguincomputing.com>");
 MODULE_DESCRIPTION("LM85-B, LM85-C driver");
 
 module_init(sm_lm85_init);
index fb70712ac85c6d261fcf88bc7af63fef8dbfcdc3..fadbfbf55a6aee2199fa124807da51bf8e8940a8 100644 (file)
@@ -528,7 +528,7 @@ static const struct ipath_cregs ipath_7220_cregs = {
 
 static char int_type[16] = "auto";
 module_param_string(interrupt_type, int_type, sizeof(int_type), 0444);
-MODULE_PARM_DESC(int_type, " interrupt_type=auto|force_msi|force_intx\n");
+MODULE_PARM_DESC(int_type, " interrupt_type=auto|force_msi|force_intx");
 
 /* packet rate matching delay; chip has support */
 static u8 rate_to_delay[2][2] = {
index 2b404284c28ae642e110e737f24563531e8613bd..7797ef6e5e64be5a0c19a2dc255445591aedb131 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/init.h>
 #include <linux/timer.h>
 #include <linux/maple.h>
-#include <asm/mach/maple.h>
 
 /* Very simple mutex to ensure proper cleanup */
 static DEFINE_MUTEX(maple_keyb_mutex);
index 8380a4568d11dda17aa5c0b92839a8ab334e5dbf..f1f777570e8e662417aa99a59f3004422ade771c 100644 (file)
@@ -5,7 +5,7 @@
 obj-$(CONFIG_ISDN_I4L)                 += i4l/
 obj-$(CONFIG_ISDN_CAPI)                        += capi/
 obj-$(CONFIG_MISDN)                    += mISDN/
-obj-$(CONFIG_ISDN_CAPI)                        += hardware/
+obj-$(CONFIG_ISDN)                     += hardware/
 obj-$(CONFIG_ISDN_DIVERSION)           += divert/
 obj-$(CONFIG_ISDN_DRV_HISAX)           += hisax/
 obj-$(CONFIG_ISDN_DRV_ICN)             += icn/
index e30a7773f93cefecdf315db52daf65c12948f4be..fbce5222d83cbab8e92826706ebfeba3256f1cec 100644 (file)
@@ -247,7 +247,6 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 #ifdef CONFIG_GIGASET_DEBUG
        unsigned char c;
        static char dbgline[3 * 32 + 1];
-       static const char hexdigit[] = "0123456789abcdef";
        int i = 0;
        while (count-- > 0) {
                if (i > sizeof(dbgline) - 4) {
@@ -258,8 +257,8 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
                c = *bytes++;
                dbgline[i] = (i && !(i % 12)) ? '-' : ' ';
                i++;
-               dbgline[i++] = hexdigit[(c >> 4) & 0x0f];
-               dbgline[i++] = hexdigit[c & 0x0f];
+               dbgline[i++] = hex_asc_hi(c);
+               dbgline[i++] = hex_asc_lo(c);
        }
        dbgline[i] = '\0';
        gig_dbg(level, "%s:%s", tag, dbgline);
index 2649ea55a9e8d8df07ab35ec849a0f8055673901..1eac03f39d0005e0e75b75f3925e1924193e794b 100644 (file)
  * #define HFC_REGISTER_DEBUG
  */
 
-static const char *hfcmulti_revision = "2.00";
+static const char *hfcmulti_revision = "2.02";
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -427,12 +427,12 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               outl(*(u32 *)data, hc->pci_iobase);
+               outl(cpu_to_le32(*(u32 *)data), hc->pci_iobase);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               outw(*(u16 *)data, hc->pci_iobase);
+               outw(cpu_to_le16(*(u16 *)data), hc->pci_iobase);
                data += 2;
                len -= 2;
        }
@@ -447,17 +447,19 @@ void
 write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
-               writel(*(u32 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writel(cpu_to_le32(*(u32 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               writew(*(u16 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writew(cpu_to_le16(*(u16 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 2;
                len -= 2;
        }
        while (len) {
-               writeb(*data, (hc->pci_membase)+A_FIFO_DATA0);
+               writeb(*data, hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -468,12 +470,12 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               *(u32 *)data = inl(hc->pci_iobase);
+               *(u32 *)data = le32_to_cpu(inl(hc->pci_iobase));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               *(u16 *)data = inw(hc->pci_iobase);
+               *(u16 *)data = le16_to_cpu(inw(hc->pci_iobase));
                data += 2;
                len -= 2;
        }
@@ -490,18 +492,18 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
                *(u32 *)data =
-                       readl((hc->pci_membase)+A_FIFO_DATA0);
+                       le32_to_cpu(readl(hc->pci_membase + A_FIFO_DATA0));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
                *(u16 *)data =
-                       readw((hc->pci_membase)+A_FIFO_DATA0);
+                       le16_to_cpu(readw(hc->pci_membase + A_FIFO_DATA0));
                data += 2;
                len -= 2;
        }
        while (len) {
-               *data = readb((hc->pci_membase)+A_FIFO_DATA0);
+               *data = readb(hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -3971,7 +3973,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel, &dch->dev.channelmap[0]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -4587,7 +4589,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[ch].bch = bch;
                hc->chan[ch].port = 0;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set optical line type */
        if (port[Port_cnt] & 0x001) {
@@ -4755,7 +4757,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
                hc->chan[i + ch].port = pt;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set master clock */
        if (port[Port_cnt] & 0x001) {
@@ -5050,12 +5052,12 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
 
 static const struct hm_map hfcm_map[] = {
 /*0*/  {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0},
-/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S},
+/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*2*/  {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*3*/  {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*4*/  {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0},
 /*5*/  {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0},
-/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, 0, 0},
+/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*7*/  {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0},
 /*8*/  {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO},
 /*9*/  {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0},
@@ -5251,9 +5253,6 @@ HFCmulti_init(void)
        if (debug & DEBUG_HFCMULTI_INIT)
                printk(KERN_DEBUG "%s: init entered\n", __func__);
 
-#ifdef __BIG_ENDIAN
-#error "not running on big endian machines now"
-#endif
        hfc_interrupt = symbol_get(ztdummy_extern_interrupt);
        register_interrupt = symbol_get(ztdummy_register_interrupt);
        unregister_interrupt = symbol_get(ztdummy_unregister_interrupt);
index 3231814e7efa0ef5fd335fc51420e9e756acc48e..9cf5edbb1a9b119db51d1b60494b3767886184d8 100644 (file)
@@ -2056,7 +2056,7 @@ setup_card(struct hfc_pci *card)
        card->dch.dev.nrbchan = 2;
        for (i = 0; i < 2; i++) {
                card->bch[i].nr = i + 1;
-               test_and_set_bit(i + 1, &card->dch.dev.channelmap[0]);
+               set_channelmap(i + 1, card->dch.dev.channelmap);
                card->bch[i].debug = debug;
                mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM);
                card->bch[i].hw = card;
index a368d6caca0ef092c09a3a3c42259515fddbf71b..3a72b908900f2e65812b8711a0910a51b7577c70 100644 (file)
@@ -60,7 +60,7 @@ typedef struct PofRecHdr_tag {        /* Pof record header */
 
 typedef struct PofTimeStamp_tag {
 /*00 */ unsigned long UnixTime __attribute__((packed));
-       /*04 */ unsigned char DateTimeText[0x28] __attribute__((packed));
+       /*04 */ unsigned char DateTimeText[0x28];
        /* =40 */
 /*2C */
 } tPofTimeStamp;
index 155b99780c4fe93e934dd9f7e0bb3cfbc2fb7117..e42150a577805a7ad5f8d38971d34e4b5b04020d 100644 (file)
@@ -1006,8 +1006,7 @@ open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq)
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel & 0x1f,
-               &dch->dev.channelmap[rq->adr.channel >> 5]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -1412,8 +1411,7 @@ init_card(struct l1oip *hc, int pri, int bundle)
                bch->ch.nr = i + ch;
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
-               test_and_set_bit(bch->nr & 0x1f,
-                       &dch->dev.channelmap[bch->nr >> 5]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        ret = mISDN_register_device(&dch->dev, hc->name);
        if (ret)
index 4ba4cc364c9e96ffb08c9786a55a4d00431cb7ac..e5a20f9542d1bb4456c602f73b4343879d268bac 100644 (file)
@@ -379,7 +379,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
@@ -637,7 +637,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
index 621a272a2c7495b9cd8866ec6bb6d0454d5d1396..7e65bad522cb26456b4b1909d69b7c72e52efb3d 100644 (file)
@@ -1234,7 +1234,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
                case 0:
                        bitmap_file_set_bit(bitmap, offset);
                        bitmap_count_page(bitmap,offset, 1);
-                       blk_plug_device(bitmap->mddev->queue);
+                       blk_plug_device_unlocked(bitmap->mddev->queue);
                        /* fall through */
                case 1:
                        *bmc = 2;
index 798e468103b879f7986842028709be8852aa3dca..61f441409234e334048460bd6475eee2572d883c 100644 (file)
@@ -316,29 +316,12 @@ static inline int check_space(struct dm_table *t)
  */
 static int lookup_device(const char *path, dev_t *dev)
 {
-       int r;
-       struct nameidata nd;
-       struct inode *inode;
-
-       if ((r = path_lookup(path, LOOKUP_FOLLOW, &nd)))
-               return r;
-
-       inode = nd.path.dentry->d_inode;
-       if (!inode) {
-               r = -ENOENT;
-               goto out;
-       }
-
-       if (!S_ISBLK(inode->i_mode)) {
-               r = -ENOTBLK;
-               goto out;
-       }
-
-       *dev = inode->i_rdev;
-
- out:
-       path_put(&nd.path);
-       return r;
+       struct block_device *bdev = lookup_bdev(path);
+       if (IS_ERR(bdev))
+               return PTR_ERR(bdev);
+       *dev = bdev->bd_dev;
+       bdput(bdev);
+       return 0;
 }
 
 /*
index c2ff77ccec5079ded33ef9e440744fcd2eaff004..c7aae66c6f9bc55386aea5a57db74b78ca27dd30 100644 (file)
@@ -3483,7 +3483,7 @@ static void md_safemode_timeout(unsigned long data)
        if (!atomic_read(&mddev->writes_pending)) {
                mddev->safemode = 1;
                if (mddev->external)
-                       sysfs_notify(&mddev->kobj, NULL, "array_state");
+                       set_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags);
        }
        md_wakeup_thread(mddev->thread);
 }
@@ -5996,7 +5996,8 @@ static int remove_and_add_spares(mddev_t *mddev)
        if (mddev->degraded) {
                rdev_for_each(rdev, rtmp, mddev) {
                        if (rdev->raid_disk >= 0 &&
-                           !test_bit(In_sync, &rdev->flags))
+                           !test_bit(In_sync, &rdev->flags) &&
+                           !test_bit(Blocked, &rdev->flags))
                                spares++;
                        if (rdev->raid_disk < 0
                            && !test_bit(Faulty, &rdev->flags)) {
@@ -6051,6 +6052,9 @@ void md_check_recovery(mddev_t *mddev)
        if (mddev->bitmap)
                bitmap_daemon_work(mddev->bitmap);
 
+       if (test_and_clear_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags))
+               sysfs_notify(&mddev->kobj, NULL, "array_state");
+
        if (mddev->ro)
                return;
 
index 159535d735679ac977e5e428e80b61eb50d18fe2..d41bebb6da0fb719aff854112567249ed597d73e 100644 (file)
@@ -215,6 +215,9 @@ static void reschedule_retry(r10bio_t *r10_bio)
        conf->nr_queued ++;
        spin_unlock_irqrestore(&conf->device_lock, flags);
 
+       /* wake up frozen array... */
+       wake_up(&conf->wait_barrier);
+
        md_wakeup_thread(mddev->thread);
 }
 
index 55e7c56045a0b4e48474f0cf9d507c22a73217b3..40e9396756573c204b50dee7bdd9517f57f9dab0 100644 (file)
@@ -2507,7 +2507,7 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
  *
  */
 
-static void handle_stripe5(struct stripe_head *sh)
+static bool handle_stripe5(struct stripe_head *sh)
 {
        raid5_conf_t *conf = sh->raid_conf;
        int disks = sh->disks, i;
@@ -2717,10 +2717,11 @@ static void handle_stripe5(struct stripe_head *sh)
        if (sh->reconstruct_state == reconstruct_state_result) {
                sh->reconstruct_state = reconstruct_state_idle;
                clear_bit(STRIPE_EXPANDING, &sh->state);
-               for (i = conf->raid_disks; i--; )
+               for (i = conf->raid_disks; i--; ) {
                        set_bit(R5_Wantwrite, &sh->dev[i].flags);
-                       set_bit(R5_LOCKED, &dev->flags);
+                       set_bit(R5_LOCKED, &sh->dev[i].flags);
                        s.locked++;
+               }
        }
 
        if (s.expanded && test_bit(STRIPE_EXPANDING, &sh->state) &&
@@ -2754,9 +2755,11 @@ static void handle_stripe5(struct stripe_head *sh)
        ops_run_io(sh, &s);
 
        return_io(return_bi);
+
+       return blocked_rdev == NULL;
 }
 
-static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
+static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
 {
        raid6_conf_t *conf = sh->raid_conf;
        int disks = sh->disks;
@@ -2967,14 +2970,17 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
        ops_run_io(sh, &s);
 
        return_io(return_bi);
+
+       return blocked_rdev == NULL;
 }
 
-static void handle_stripe(struct stripe_head *sh, struct page *tmp_page)
+/* returns true if the stripe was handled */
+static bool handle_stripe(struct stripe_head *sh, struct page *tmp_page)
 {
        if (sh->raid_conf->level == 6)
-               handle_stripe6(sh, tmp_page);
+               return handle_stripe6(sh, tmp_page);
        else
-               handle_stripe5(sh);
+               return handle_stripe5(sh);
 }
 
 
@@ -3692,7 +3698,9 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski
        clear_bit(STRIPE_INSYNC, &sh->state);
        spin_unlock(&sh->lock);
 
-       handle_stripe(sh, NULL);
+       /* wait for any blocked device to be handled */
+       while(unlikely(!handle_stripe(sh, NULL)))
+               ;
        release_stripe(sh);
 
        return STRIPE_SECTORS;
@@ -3811,10 +3819,8 @@ static void raid5d(mddev_t *mddev)
 
                sh = __get_priority_stripe(conf);
 
-               if (!sh) {
-                       async_tx_issue_pending_all();
+               if (!sh)
                        break;
-               }
                spin_unlock_irq(&conf->device_lock);
                
                handled++;
@@ -3827,6 +3833,7 @@ static void raid5d(mddev_t *mddev)
 
        spin_unlock_irq(&conf->device_lock);
 
+       async_tx_issue_pending_all();
        unplug_slaves(mddev);
 
        pr_debug("--- raid5d inactive\n");
index 61d14d26686fdc05dffa7f1baf8185a861115d27..a662b15d5b90b27db329e446528eb01510a28b97 100644 (file)
@@ -35,7 +35,7 @@ static int debug;
 
 module_param(debug, bool, 0644);
 
-MODULE_PARM_DESC(debug, "Debugging messages\n\t\t\t0=Off (default), 1=On");
+MODULE_PARM_DESC(debug, "Debugging messages0=Off (default), 1=On");
 
 
 /* ----------------------------------------------------------------------- */
index e30a589c0e18187b095e6a23ee418c505b8f31ed..c4444500b330ec711c0365c17cc6a093fdd61d9b 100644 (file)
@@ -39,7 +39,7 @@ static int debug;
 
 module_param(debug, bool, 0644);
 
-MODULE_PARM_DESC(debug, "Debugging messages\n\t\t\t0=Off (default), 1=On");
+MODULE_PARM_DESC(debug, "Debugging messages0=Off (default), 1=On");
 
 static unsigned short normal_i2c[] = { 0x22 >> 1, I2C_CLIENT_END };
 
index b31ba4e093270e6ab3fc3238637638cf85e1ec97..56808cd2f8a96ac1079db1dbb2d33782194feaf9 100644 (file)
@@ -25,7 +25,7 @@
 
 static char *sensor_type;
 module_param(sensor_type, charp, S_IRUGO);
-MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"\n");
+MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"");
 
 /* mt9v022 selected register addresses */
 #define MT9V022_CHIP_VERSION           0x00
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/drivers/media/video/planb.h b/drivers/media/video/planb.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/drivers/media/video/saa7196.h b/drivers/media/video/saa7196.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
deleted file mode 100644 (file)
index e69de29..0000000
index fa50e9ede0e6ca77aa10618a01a53c6209bb0d73..82af385460e4711643e79914cbe16ca1bff7e88e 100644 (file)
@@ -426,9 +426,11 @@ config ENCLOSURE_SERVICES
 
 config SGI_XP
        tristate "Support communication between SGI SSIs"
+       depends on NET
        depends on IA64_GENERIC || IA64_SGI_SN2 || IA64_SGI_UV || (X86_64 && SMP)
        select IA64_UNCACHED_ALLOCATOR if IA64_GENERIC || IA64_SGI_SN2
        select GENERIC_ALLOCATOR if IA64_GENERIC || IA64_SGI_SN2
+       select SGI_GRU if IA64_GENERIC || IA64_SGI_UV || (X86_64 && SMP)
        ---help---
          An SGI machine can be divided into multiple Single System
          Images which act independently of each other and have
index 66e5a5487c20a228c67793e90d2f95b5dc36e53b..86dbb366415a14a76b3961180cd3f14176f911cc 100644 (file)
@@ -213,7 +213,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
        struct mmc_blk_data *md = mq->data;
        struct mmc_card *card = md->queue.card;
        struct mmc_blk_request brq;
-       int ret = 1, sg_pos, data_size;
+       int ret = 1, data_size, i;
+       struct scatterlist *sg;
 
        mmc_claim_host(card->host);
 
@@ -267,18 +268,22 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 
                mmc_queue_bounce_pre(mq);
 
+               /*
+                * Adjust the sg list so it is the same size as the
+                * request.
+                */
                if (brq.data.blocks !=
                    (req->nr_sectors >> (md->block_bits - 9))) {
                        data_size = brq.data.blocks * brq.data.blksz;
-                       for (sg_pos = 0; sg_pos < brq.data.sg_len; sg_pos++) {
-                               data_size -= mq->sg[sg_pos].length;
+                       for_each_sg(brq.data.sg, sg, brq.data.sg_len, i) {
+                               data_size -= sg->length;
                                if (data_size <= 0) {
-                                       mq->sg[sg_pos].length += data_size;
-                                       sg_pos++;
+                                       sg->length += data_size;
+                                       i++;
                                        break;
                                }
                        }
-                       brq.data.sg_len = sg_pos;
+                       brq.data.sg_len = i;
                }
 
                mmc_wait_for_req(card->host, &brq.mrq);
index a067fe436301d2853bcc50be9f8a7d09d79fbfe0..f26b01d811ae9f51560dbb2c3db9418e1a8672b5 100644 (file)
@@ -388,16 +388,14 @@ static int mmc_test_transfer(struct mmc_test_card *test,
        int ret, i;
        unsigned long flags;
 
-       BUG_ON(blocks * blksz > BUFFER_SIZE);
-
        if (write) {
                for (i = 0;i < blocks * blksz;i++)
                        test->scratch[i] = i;
        } else {
-               memset(test->scratch, 0, blocks * blksz);
+               memset(test->scratch, 0, BUFFER_SIZE);
        }
        local_irq_save(flags);
-       sg_copy_from_buffer(sg, sg_len, test->scratch, blocks * blksz);
+       sg_copy_from_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
        local_irq_restore(flags);
 
        ret = mmc_test_set_blksize(test, blksz);
@@ -444,7 +442,7 @@ static int mmc_test_transfer(struct mmc_test_card *test,
                }
        } else {
                local_irq_save(flags);
-               sg_copy_to_buffer(sg, sg_len, test->scratch, blocks * blksz);
+               sg_copy_to_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
                local_irq_restore(flags);
                for (i = 0;i < blocks * blksz;i++) {
                        if (test->scratch[i] != (u8)i)
@@ -805,69 +803,6 @@ static int mmc_test_multi_xfersize_read(struct mmc_test_card *test)
        return 0;
 }
 
-static int mmc_test_bigsg_write(struct mmc_test_card *test)
-{
-       int ret;
-       unsigned int size;
-       struct scatterlist sg;
-
-       if (test->card->host->max_blk_count == 1)
-               return RESULT_UNSUP_HOST;
-
-       size = PAGE_SIZE * 2;
-       size = min(size, test->card->host->max_req_size);
-       size = min(size, test->card->host->max_seg_size);
-       size = min(size, test->card->host->max_blk_count * 512);
-
-       memset(test->buffer, 0, BUFFER_SIZE);
-
-       if (size < 1024)
-               return RESULT_UNSUP_HOST;
-
-       sg_init_table(&sg, 1);
-       sg_init_one(&sg, test->buffer, BUFFER_SIZE);
-
-       ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 1);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-
-static int mmc_test_bigsg_read(struct mmc_test_card *test)
-{
-       int ret, i;
-       unsigned int size;
-       struct scatterlist sg;
-
-       if (test->card->host->max_blk_count == 1)
-               return RESULT_UNSUP_HOST;
-
-       size = PAGE_SIZE * 2;
-       size = min(size, test->card->host->max_req_size);
-       size = min(size, test->card->host->max_seg_size);
-       size = min(size, test->card->host->max_blk_count * 512);
-
-       if (size < 1024)
-               return RESULT_UNSUP_HOST;
-
-       memset(test->buffer, 0xCD, BUFFER_SIZE);
-
-       sg_init_table(&sg, 1);
-       sg_init_one(&sg, test->buffer, BUFFER_SIZE);
-       ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 0);
-       if (ret)
-               return ret;
-
-       /* mmc_test_transfer() doesn't check for read overflows */
-       for (i = size;i < BUFFER_SIZE;i++) {
-               if (test->buffer[i] != 0xCD)
-                       return RESULT_FAIL;
-       }
-
-       return 0;
-}
-
 #ifdef CONFIG_HIGHMEM
 
 static int mmc_test_write_high(struct mmc_test_card *test)
@@ -1071,20 +1006,6 @@ static const struct mmc_test_case mmc_test_cases[] = {
                .run = mmc_test_multi_xfersize_read,
        },
 
-       {
-               .name = "Over-sized SG list write",
-               .prepare = mmc_test_prepare_write,
-               .run = mmc_test_bigsg_write,
-               .cleanup = mmc_test_cleanup,
-       },
-
-       {
-               .name = "Over-sized SG list read",
-               .prepare = mmc_test_prepare_read,
-               .run = mmc_test_bigsg_read,
-               .cleanup = mmc_test_cleanup,
-       },
-
 #ifdef CONFIG_HIGHMEM
 
        {
index 3ee5b8c3b5ce42fa205d3bbc2ee2d5e4f6420794..044d84eeed7c75f2775b27d3cb6b55630c08f688 100644 (file)
@@ -121,6 +121,7 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
 {
 #ifdef CONFIG_MMC_DEBUG
        unsigned int i, sz;
+       struct scatterlist *sg;
 #endif
 
        pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
@@ -156,8 +157,8 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
 
 #ifdef CONFIG_MMC_DEBUG
                sz = 0;
-               for (i = 0;i < mrq->data->sg_len;i++)
-                       sz += mrq->data->sg[i].length;
+               for_each_sg(mrq->data->sg, sg, mrq->data->sg_len, i)
+                       sz += sg->length;
                BUG_ON(sz != mrq->data->blocks * mrq->data->blksz);
 #endif
 
index 99b20917cc0f9a677cfd414d27d70e01e183133d..d3f55615c0990e46176a0afd49ed0c55977833ef 100644 (file)
 
 /* Hardware definitions */
 #define AU1XMMC_DESCRIPTOR_COUNT 1
-#define AU1XMMC_DESCRIPTOR_SIZE  2048
+
+/* max DMA seg size: 64KB on Au1100, 4MB on Au1200 */
+#ifdef CONFIG_SOC_AU1100
+#define AU1XMMC_DESCRIPTOR_SIZE 0x0000ffff
+#else  /* Au1200 */
+#define AU1XMMC_DESCRIPTOR_SIZE 0x003fffff
+#endif
 
 #define AU1XMMC_OCR (MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30 | \
                     MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 | \
index deb607c52c0d8ebbee60751e7a120692a22ddd9f..fcb14c2346ccd186f0aef38b96f6405bb1380dc1 100644 (file)
@@ -143,7 +143,8 @@ static int jmicron_probe(struct sdhci_pci_chip *chip)
                chip->quirks |= SDHCI_QUIRK_32BIT_DMA_ADDR |
                          SDHCI_QUIRK_32BIT_DMA_SIZE |
                          SDHCI_QUIRK_32BIT_ADMA_SIZE |
-                         SDHCI_QUIRK_RESET_AFTER_REQUEST;
+                         SDHCI_QUIRK_RESET_AFTER_REQUEST |
+                         SDHCI_QUIRK_BROKEN_SMALL_PIO;
        }
 
        /*
index 5f95e10229b5f64cf55e79e8930b2c69d4f9181f..e3a8133560a2b41a19f15dd193a83c80d5727e4f 100644 (file)
@@ -278,6 +278,15 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
        else
                mask = SDHCI_SPACE_AVAILABLE;
 
+       /*
+        * Some controllers (JMicron JMB38x) mess up the buffer bits
+        * for transfers < 4 bytes. As long as it is just one block,
+        * we can ignore the bits.
+        */
+       if ((host->quirks & SDHCI_QUIRK_BROKEN_SMALL_PIO) &&
+               (host->data->blocks == 1))
+               mask = ~0;
+
        while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) {
                if (host->data->flags & MMC_DATA_READ)
                        sdhci_read_block_pio(host);
@@ -439,7 +448,7 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
 
        host->adma_addr = dma_map_single(mmc_dev(host->mmc),
                host->adma_desc, (128 * 2 + 1) * 4, DMA_TO_DEVICE);
-       if (dma_mapping_error(mmc_dev(host->mmc), host->align_addr))
+       if (dma_mapping_error(mmc_dev(host->mmc), host->adma_addr))
                goto unmap_entries;
        BUG_ON(host->adma_addr & 0x3);
 
@@ -645,7 +654,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
                                 * us an invalid request.
                                 */
                                WARN_ON(1);
-                               host->flags &= ~SDHCI_USE_DMA;
+                               host->flags &= ~SDHCI_REQ_USE_DMA;
                        } else {
                                writel(host->adma_addr,
                                        host->ioaddr + SDHCI_ADMA_ADDRESS);
@@ -664,7 +673,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
                                 * us an invalid request.
                                 */
                                WARN_ON(1);
-                               host->flags &= ~SDHCI_USE_DMA;
+                               host->flags &= ~SDHCI_REQ_USE_DMA;
                        } else {
                                WARN_ON(sg_cnt != 1);
                                writel(sg_dma_address(data->sg),
index e354faee5df00ad0a0396992e8945ca626fb4e9e..197d4a05f4ae975ecf1fe600adcf9ec2ce79fbb5 100644 (file)
@@ -206,6 +206,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER            (1<<11)
 /* Controller provides an incorrect timeout value for transfers */
 #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL                 (1<<12)
+/* Controller has an issue with buffer bits for small transfers */
+#define SDHCI_QUIRK_BROKEN_SMALL_PIO                   (1<<13)
 
        int                     irq;            /* Device IRQ */
        void __iomem *          ioaddr;         /* Mapped address */
index dbba5abf0db86d809bc325cbe653f5120ffa183f..f84ab6182148a97976262097fa5d0692b6080883 100644 (file)
@@ -41,7 +41,7 @@
 
 
 /* AMD */
-#define AM29DL800BB    0x22C8
+#define AM29DL800BB    0x22CB
 #define AM29DL800BT    0x224A
 
 #define AM29F800BB     0x2258
index 54e36bfc2c3b39caed333e3bbd5209ea704ba08c..8bd0dea6885f4ad91288d8f5313f08cb636fe10e 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/mutex.h>
+#include <linux/err.h>
+
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 
@@ -487,9 +489,8 @@ add_dataflash(struct spi_device *spi, char *name,
        device->write = dataflash_write;
        device->priv = priv;
 
-       dev_info(&spi->dev, "%s (%d KBytes) pagesize %d bytes, "
-               "erasesize %d bytes\n", name, device->size/1024,
-                pagesize, pagesize * 8);       /* 8 pages = 1 block */
+       dev_info(&spi->dev, "%s (%d KBytes) pagesize %d bytes\n",
+                       name, DIV_ROUND_UP(device->size, 1024), pagesize);
        dev_set_drvdata(&spi->dev, priv);
 
        if (mtd_has_partitions()) {
@@ -518,65 +519,57 @@ add_dataflash(struct spi_device *spi, char *name,
        return add_mtd_device(device) == 1 ? -ENODEV : 0;
 }
 
-/*
- * Detect and initialize DataFlash device:
- *
- *   Device      Density         ID code          #Pages PageSize  Offset
- *   AT45DB011B  1Mbit   (128K)  xx0011xx (0x0c)    512    264      9
- *   AT45DB021B  2Mbit   (256K)  xx0101xx (0x14)   1024    264      9
- *   AT45DB041B  4Mbit   (512K)  xx0111xx (0x1c)   2048    264      9
- *   AT45DB081B  8Mbit   (1M)    xx1001xx (0x24)   4096    264      9
- *   AT45DB0161B 16Mbit  (2M)    xx1011xx (0x2c)   4096    528     10
- *   AT45DB0321B 32Mbit  (4M)    xx1101xx (0x34)   8192    528     10
- *   AT45DB0642  64Mbit  (8M)    xx111xxx (0x3c)   8192   1056     11
- *   AT45DB1282  128Mbit (16M)   xx0100xx (0x10)  16384   1056     11
- */
-
 struct flash_info {
        char            *name;
 
-       /* JEDEC id zero means "no ID" (most older chips); otherwise it has
-        * a high byte of zero plus three data bytes: the manufacturer id,
-        * then a two byte device id.
+       /* JEDEC id has a high byte of zero plus three data bytes:
+        * the manufacturer id, then a two byte device id.
         */
        uint32_t        jedec_id;
 
-       /* The size listed here is what works with OPCODE_SE, which isn't
-        * necessarily called a "sector" by the vendor.
-        */
+       /* The size listed here is what works with OP_ERASE_PAGE. */
        unsigned        nr_pages;
        uint16_t        pagesize;
        uint16_t        pageoffset;
 
        uint16_t        flags;
-#define        SUP_POW2PS      0x02
-#define        IS_POW2PS       0x01
+#define SUP_POW2PS     0x0002          /* supports 2^N byte pages */
+#define IS_POW2PS      0x0001          /* uses 2^N byte pages */
 };
 
 static struct flash_info __devinitdata dataflash_data [] = {
 
-       { "at45db011d",  0x1f2200, 512, 264, 9, SUP_POW2PS},
+       /*
+        * NOTE:  chips with SUP_POW2PS (rev D and up) need two entries,
+        * one with IS_POW2PS and the other without.  The entry with the
+        * non-2^N byte page size can't name exact chip revisions without
+        * losing backwards compatibility for cmdlinepart.
+        *
+        * These newer chips also support 128-byte security registers (with
+        * 64 bytes one-time-programmable) and software write-protection.
+        */
+       { "AT45DB011B",  0x1f2200, 512, 264, 9, SUP_POW2PS},
        { "at45db011d",  0x1f2200, 512, 256, 8, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db021d",  0x1f2300, 1024, 264, 9, SUP_POW2PS},
+       { "AT45DB021B",  0x1f2300, 1024, 264, 9, SUP_POW2PS},
        { "at45db021d",  0x1f2300, 1024, 256, 8, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db041d",  0x1f2400, 2048, 264, 9, SUP_POW2PS},
+       { "AT45DB041x",  0x1f2400, 2048, 264, 9, SUP_POW2PS},
        { "at45db041d",  0x1f2400, 2048, 256, 8, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db081d",  0x1f2500, 4096, 264, 9, SUP_POW2PS},
+       { "AT45DB081B",  0x1f2500, 4096, 264, 9, SUP_POW2PS},
        { "at45db081d",  0x1f2500, 4096, 256, 8, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db161d",  0x1f2600, 4096, 528, 10, SUP_POW2PS},
+       { "AT45DB161x",  0x1f2600, 4096, 528, 10, SUP_POW2PS},
        { "at45db161d",  0x1f2600, 4096, 512, 9, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db321c",  0x1f2700, 8192, 528, 10, },
+       { "AT45DB321x",  0x1f2700, 8192, 528, 10, 0},           /* rev C */
 
-       { "at45db321d",  0x1f2701, 8192, 528, 10, SUP_POW2PS},
+       { "AT45DB321x",  0x1f2701, 8192, 528, 10, SUP_POW2PS},
        { "at45db321d",  0x1f2701, 8192, 512, 9, SUP_POW2PS | IS_POW2PS},
 
-       { "at45db641d",  0x1f2800, 8192, 1056, 11, SUP_POW2PS},
-       { "at45db641d",  0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS},
+       { "AT45DB642x",  0x1f2800, 8192, 1056, 11, SUP_POW2PS},
+       { "at45db642d",  0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS},
 };
 
 static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
@@ -588,17 +581,23 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
        struct flash_info       *info;
        int status;
 
-
        /* JEDEC also defines an optional "extended device information"
         * string for after vendor-specific data, after the three bytes
         * we use here.  Supporting some chips might require using it.
+        *
+        * If the vendor ID isn't Atmel's (0x1f), assume this call failed.
+        * That's not an error; only rev C and newer chips handle it, and
+        * only Atmel sells these chips.
         */
        tmp = spi_write_then_read(spi, &code, 1, id, 3);
        if (tmp < 0) {
                DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n",
                        spi->dev.bus_id, tmp);
-               return NULL;
+               return ERR_PTR(tmp);
        }
+       if (id[0] != 0x1f)
+               return NULL;
+
        jedec = id[0];
        jedec = jedec << 8;
        jedec |= id[1];
@@ -609,19 +608,53 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
                        tmp < ARRAY_SIZE(dataflash_data);
                        tmp++, info++) {
                if (info->jedec_id == jedec) {
+                       DEBUG(MTD_DEBUG_LEVEL1, "%s: OTP, sector protect%s\n",
+                               dev_name(&spi->dev),
+                               (info->flags & SUP_POW2PS)
+                                       ? ", binary pagesize" : ""
+                               );
                        if (info->flags & SUP_POW2PS) {
                                status = dataflash_status(spi);
-                               if (status & 0x1)
-                                       /* return power of 2 pagesize */
-                                       return ++info;
-                               else
-                                       return info;
+                               if (status < 0) {
+                                       DEBUG(MTD_DEBUG_LEVEL1,
+                                               "%s: status error %d\n",
+                                               dev_name(&spi->dev), status);
+                                       return ERR_PTR(status);
+                               }
+                               if (status & 0x1) {
+                                       if (info->flags & IS_POW2PS)
+                                               return info;
+                               } else {
+                                       if (!(info->flags & IS_POW2PS))
+                                               return info;
+                               }
                        }
                }
        }
-       return NULL;
+
+       /*
+        * Treat other chips as errors ... we won't know the right page
+        * size (it might be binary) even when we can tell which density
+        * class is involved (legacy chip id scheme).
+        */
+       dev_warn(&spi->dev, "JEDEC id %06x not handled\n", jedec);
+       return ERR_PTR(-ENODEV);
 }
 
+/*
+ * Detect and initialize DataFlash device, using JEDEC IDs on newer chips
+ * or else the ID code embedded in the status bits:
+ *
+ *   Device      Density         ID code          #Pages PageSize  Offset
+ *   AT45DB011B  1Mbit   (128K)  xx0011xx (0x0c)    512    264      9
+ *   AT45DB021B  2Mbit   (256K)  xx0101xx (0x14)   1024    264      9
+ *   AT45DB041B  4Mbit   (512K)  xx0111xx (0x1c)   2048    264      9
+ *   AT45DB081B  8Mbit   (1M)    xx1001xx (0x24)   4096    264      9
+ *   AT45DB0161B 16Mbit  (2M)    xx1011xx (0x2c)   4096    528     10
+ *   AT45DB0321B 32Mbit  (4M)    xx1101xx (0x34)   8192    528     10
+ *   AT45DB0642  64Mbit  (8M)    xx111xxx (0x3c)   8192   1056     11
+ *   AT45DB1282  128Mbit (16M)   xx0100xx (0x10)  16384   1056     11
+ */
 static int __devinit dataflash_probe(struct spi_device *spi)
 {
        int status;
@@ -632,14 +665,17 @@ static int __devinit dataflash_probe(struct spi_device *spi)
         * If it succeeds we know we have either a C or D part.
         * D will support power of 2 pagesize option.
         */
-
        info = jedec_probe(spi);
-
+       if (IS_ERR(info))
+               return PTR_ERR(info);
        if (info != NULL)
                return add_dataflash(spi, info->name, info->nr_pages,
                                 info->pagesize, info->pageoffset);
 
-
+       /*
+        * Older chips support only legacy commands, identifing
+        * capacity using bits in the status byte.
+        */
        status = dataflash_status(spi);
        if (status <= 0 || status == 0xff) {
                DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n",
@@ -661,13 +697,13 @@ static int __devinit dataflash_probe(struct spi_device *spi)
                status = add_dataflash(spi, "AT45DB021B", 1024, 264, 9);
                break;
        case 0x1c:      /* 0 1 1 1 x x */
-               status = add_dataflash(spi, "AT45DB041B", 2048, 264, 9);
+               status = add_dataflash(spi, "AT45DB041x", 2048, 264, 9);
                break;
        case 0x24:      /* 1 0 0 1 x x */
                status = add_dataflash(spi, "AT45DB081B", 4096, 264, 9);
                break;
        case 0x2c:      /* 1 0 1 1 x x */
-               status = add_dataflash(spi, "AT45DB161B", 4096, 528, 10);
+               status = add_dataflash(spi, "AT45DB161x", 4096, 528, 10);
                break;
        case 0x34:      /* 1 1 0 1 x x */
                status = add_dataflash(spi, "AT45DB321x", 8192, 528, 10);
index a806119797e0feeb3fd2969199a334daa6aa9c21..113b1062020d65156312e20239d7f8649bfffd4b 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 
 #include <asm/hardware.h>
-#include <asm/arch-sa1100/h3600.h>
+#include <asm/arch/h3600.h>
 #include <asm/io.h>
 
 
index 28cc6787a800c3ba651a4dd5734718874d117aa4..00d46e137b2ab306ca3775c4f216d6016a44df37 100644 (file)
@@ -125,8 +125,11 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
               int (*fill_super)(struct super_block *, void *, int),
               struct vfsmount *mnt)
 {
-       struct nameidata nd;
-       int mtdnr, ret;
+#ifdef CONFIG_BLOCK
+       struct block_device *bdev;
+       int ret, major;
+#endif
+       int mtdnr;
 
        if (!dev_name)
                return -EINVAL;
@@ -178,45 +181,38 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
                }
        }
 
+#ifdef CONFIG_BLOCK
        /* try the old way - the hack where we allowed users to mount
         * /dev/mtdblock$(n) but didn't actually _use_ the blockdev
         */
-       ret = path_lookup(dev_name, LOOKUP_FOLLOW, &nd);
-
-       DEBUG(1, "MTDSB: path_lookup() returned %d, inode %p\n",
-             ret, nd.path.dentry ? nd.path.dentry->d_inode : NULL);
-
-       if (ret)
+       bdev = lookup_bdev(dev_name);
+       if (IS_ERR(bdev)) {
+               ret = PTR_ERR(bdev);
+               DEBUG(1, "MTDSB: lookup_bdev() returned %d\n", ret);
                return ret;
+       }
+       DEBUG(1, "MTDSB: lookup_bdev() returned 0\n");
 
        ret = -EINVAL;
 
-       if (!S_ISBLK(nd.path.dentry->d_inode->i_mode))
-               goto out;
-
-       if (nd.path.mnt->mnt_flags & MNT_NODEV) {
-               ret = -EACCES;
-               goto out;
-       }
+       major = MAJOR(bdev->bd_dev);
+       mtdnr = MINOR(bdev->bd_dev);
+       bdput(bdev);
 
-       if (imajor(nd.path.dentry->d_inode) != MTD_BLOCK_MAJOR)
+       if (major != MTD_BLOCK_MAJOR)
                goto not_an_MTD_device;
 
-       mtdnr = iminor(nd.path.dentry->d_inode);
-       path_put(&nd.path);
-
        return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super,
                             mnt);
 
 not_an_MTD_device:
+#endif /* CONFIG_BLOCK */
+
        if (!(flags & MS_SILENT))
                printk(KERN_NOTICE
                       "MTD: Attempt to mount non-MTD device \"%s\"\n",
                       dev_name);
-out:
-       path_put(&nd.path);
-       return ret;
-
+       return -EINVAL;
 }
 
 EXPORT_SYMBOL_GPL(get_sb_mtd);
index 71406e517857c456384ddd95ef51633119fe562a..02f9cc30d77b70b5f89c01f5e6194999da4b1ceb 100644 (file)
@@ -104,11 +104,24 @@ config MTD_NAND_BF5XX
 
 config MTD_NAND_BF5XX_HWECC
        bool "BF5XX NAND Hardware ECC"
+       default y
        depends on MTD_NAND_BF5XX
        help
          Enable the use of the BF5XX's internal ECC generator when
          using NAND.
 
+config MTD_NAND_BF5XX_BOOTROM_ECC
+       bool "Use Blackfin BootROM ECC Layout"
+       default n
+       depends on MTD_NAND_BF5XX_HWECC
+       help
+         If you wish to modify NAND pages and allow the Blackfin on-chip
+         BootROM to boot from them, say Y here.  This is only necessary
+         if you are booting U-Boot out of NAND and you wish to update
+         U-Boot from Linux' userspace.  Otherwise, you should say N here.
+
+         If unsure, say N.
+
 config MTD_NAND_RTC_FROM4
        tristate "Renesas Flash ROM 4-slot interface board (FROM_BOARD4)"
        depends on SH_SOLUTION_ENGINE
index e87a57297328c4a72cde3d01c605e94d0299eee3..9af2a2cc1153adf36c51da04ea6b5ce7f765753c 100644 (file)
@@ -91,6 +91,41 @@ static const unsigned short bfin_nfc_pin_req[] =
         P_NAND_ALE,
         0};
 
+#ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC
+static uint8_t bbt_pattern[] = { 0xff };
+
+static struct nand_bbt_descr bootrom_bbt = {
+       .options = 0,
+       .offs = 63,
+       .len = 1,
+       .pattern = bbt_pattern,
+};
+
+static struct nand_ecclayout bootrom_ecclayout = {
+       .eccbytes = 24,
+       .eccpos = {
+               0x8 * 0, 0x8 * 0 + 1, 0x8 * 0 + 2,
+               0x8 * 1, 0x8 * 1 + 1, 0x8 * 1 + 2,
+               0x8 * 2, 0x8 * 2 + 1, 0x8 * 2 + 2,
+               0x8 * 3, 0x8 * 3 + 1, 0x8 * 3 + 2,
+               0x8 * 4, 0x8 * 4 + 1, 0x8 * 4 + 2,
+               0x8 * 5, 0x8 * 5 + 1, 0x8 * 5 + 2,
+               0x8 * 6, 0x8 * 6 + 1, 0x8 * 6 + 2,
+               0x8 * 7, 0x8 * 7 + 1, 0x8 * 7 + 2
+       },
+       .oobfree = {
+               { 0x8 * 0 + 3, 5 },
+               { 0x8 * 1 + 3, 5 },
+               { 0x8 * 2 + 3, 5 },
+               { 0x8 * 3 + 3, 5 },
+               { 0x8 * 4 + 3, 5 },
+               { 0x8 * 5 + 3, 5 },
+               { 0x8 * 6 + 3, 5 },
+               { 0x8 * 7 + 3, 5 },
+       }
+};
+#endif
+
 /*
  * Data structures for bf5xx nand flash controller driver
  */
@@ -273,7 +308,7 @@ static int bf5xx_nand_correct_data(struct mtd_info *mtd, u_char *dat,
                dat += 256;
                read_ecc += 8;
                calc_ecc += 8;
-               ret = bf5xx_nand_correct_data_256(mtd, dat, read_ecc, calc_ecc);
+               ret |= bf5xx_nand_correct_data_256(mtd, dat, read_ecc, calc_ecc);
        }
 
        return ret;
@@ -298,7 +333,7 @@ static int bf5xx_nand_calculate_ecc(struct mtd_info *mtd,
        ecc0 = bfin_read_NFC_ECC0();
        ecc1 = bfin_read_NFC_ECC1();
 
-       code[0] = (ecc0 & 0x3FF) | ((ecc1 & 0x3FF) << 11);
+       code[0] = (ecc0 & 0x7ff) | ((ecc1 & 0x7ff) << 11);
 
        dev_dbg(info->device, "returning ecc 0x%08x\n", code[0]);
 
@@ -310,7 +345,7 @@ static int bf5xx_nand_calculate_ecc(struct mtd_info *mtd,
        if (page_size == 512) {
                ecc0 = bfin_read_NFC_ECC2();
                ecc1 = bfin_read_NFC_ECC3();
-               code[1] = (ecc0 & 0x3FF) | ((ecc1 & 0x3FF) << 11);
+               code[1] = (ecc0 & 0x7ff) | ((ecc1 & 0x7ff) << 11);
 
                /* second 3 bytes in ecc_code for second 256
                 * bytes of 512 page size
@@ -514,7 +549,6 @@ static void bf5xx_nand_dma_write_buf(struct mtd_info *mtd,
 /*
  * System initialization functions
  */
-
 static int bf5xx_nand_dma_init(struct bf5xx_nand_info *info)
 {
        int ret;
@@ -547,6 +581,13 @@ static int bf5xx_nand_dma_init(struct bf5xx_nand_info *info)
        return 0;
 }
 
+static void bf5xx_nand_dma_remove(struct bf5xx_nand_info *info)
+{
+       /* Free NFC DMA channel */
+       if (hardware_ecc)
+               free_dma(CH_NFC);
+}
+
 /*
  * BF5XX NFC hardware initialization
  *  - pin mux setup
@@ -605,7 +646,7 @@ static int bf5xx_nand_add_partition(struct bf5xx_nand_info *info)
 #endif
 }
 
-static int bf5xx_nand_remove(struct platform_device *pdev)
+static int __devexit bf5xx_nand_remove(struct platform_device *pdev)
 {
        struct bf5xx_nand_info *info = to_nand_info(pdev);
        struct mtd_info *mtd = NULL;
@@ -623,6 +664,7 @@ static int bf5xx_nand_remove(struct platform_device *pdev)
        }
 
        peripheral_free_list(bfin_nfc_pin_req);
+       bf5xx_nand_dma_remove(info);
 
        /* free the common resources */
        kfree(info);
@@ -638,7 +680,7 @@ static int bf5xx_nand_remove(struct platform_device *pdev)
  * it can allocate all necessary resources then calls the
  * nand layer to look for devices
  */
-static int bf5xx_nand_probe(struct platform_device *pdev)
+static int __devinit bf5xx_nand_probe(struct platform_device *pdev)
 {
        struct bf5xx_nand_platform *plat = to_nand_plat(pdev);
        struct bf5xx_nand_info *info = NULL;
@@ -648,22 +690,21 @@ static int bf5xx_nand_probe(struct platform_device *pdev)
 
        dev_dbg(&pdev->dev, "(%p)\n", pdev);
 
-       if (peripheral_request_list(bfin_nfc_pin_req, DRV_NAME)) {
-               printk(KERN_ERR DRV_NAME
-               ": Requesting Peripherals failed\n");
-               return -EFAULT;
-       }
-
        if (!plat) {
                dev_err(&pdev->dev, "no platform specific information\n");
-               goto exit_error;
+               return -EINVAL;
+       }
+
+       if (peripheral_request_list(bfin_nfc_pin_req, DRV_NAME)) {
+               dev_err(&pdev->dev, "requesting Peripherals failed\n");
+               return -EFAULT;
        }
 
        info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (info == NULL) {
                dev_err(&pdev->dev, "no memory for flash info\n");
                err = -ENOMEM;
-               goto exit_error;
+               goto out_err_kzalloc;
        }
 
        platform_set_drvdata(pdev, info);
@@ -707,11 +748,16 @@ static int bf5xx_nand_probe(struct platform_device *pdev)
 
        /* initialise the hardware */
        err = bf5xx_nand_hw_init(info);
-       if (err != 0)
-               goto exit_error;
+       if (err)
+               goto out_err_hw_init;
 
        /* setup hardware ECC data struct */
        if (hardware_ecc) {
+#ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC
+               chip->badblock_pattern = &bootrom_bbt;
+               chip->ecc.layout = &bootrom_ecclayout;
+#endif
+
                if (plat->page_size == NFC_PG_SIZE_256) {
                        chip->ecc.bytes = 3;
                        chip->ecc.size = 256;
@@ -733,7 +779,7 @@ static int bf5xx_nand_probe(struct platform_device *pdev)
        /* scan hardware nand chip and setup mtd info data struct */
        if (nand_scan(mtd, 1)) {
                err = -ENXIO;
-               goto exit_error;
+               goto out_err_nand_scan;
        }
 
        /* add NAND partition */
@@ -742,11 +788,14 @@ static int bf5xx_nand_probe(struct platform_device *pdev)
        dev_dbg(&pdev->dev, "initialised ok\n");
        return 0;
 
-exit_error:
-       bf5xx_nand_remove(pdev);
+out_err_nand_scan:
+       bf5xx_nand_dma_remove(info);
+out_err_hw_init:
+       platform_set_drvdata(pdev, NULL);
+       kfree(info);
+out_err_kzalloc:
+       peripheral_free_list(bfin_nfc_pin_req);
 
-       if (err == 0)
-               err = -EINVAL;
        return err;
 }
 
@@ -775,7 +824,7 @@ static int bf5xx_nand_resume(struct platform_device *dev)
 /* driver device registration */
 static struct platform_driver bf5xx_nand_driver = {
        .probe          = bf5xx_nand_probe,
-       .remove         = bf5xx_nand_remove,
+       .remove         = __devexit_p(bf5xx_nand_remove),
        .suspend        = bf5xx_nand_suspend,
        .resume         = bf5xx_nand_resume,
        .driver         = {
index 765d4f0f7c865c1682e94d11ba48fa6986c3d02c..e4226e02d63e752f552fc6f83af941243327dfed 100644 (file)
@@ -1125,9 +1125,9 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
                goto out;
        mh = (struct NFTLMediaHeader *)buf;
 
-       mh->NumEraseUnits = le16_to_cpu(mh->NumEraseUnits);
-       mh->FirstPhysicalEUN = le16_to_cpu(mh->FirstPhysicalEUN);
-       mh->FormattedSize = le32_to_cpu(mh->FormattedSize);
+       le16_to_cpus(&mh->NumEraseUnits);
+       le16_to_cpus(&mh->FirstPhysicalEUN);
+       le32_to_cpus(&mh->FormattedSize);
 
        printk(KERN_INFO "    DataOrgID        = %s\n"
                         "    NumEraseUnits    = %d\n"
@@ -1235,12 +1235,12 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
        doc->mh1_page = doc->mh0_page + (4096 >> this->page_shift);
        mh = (struct INFTLMediaHeader *)buf;
 
-       mh->NoOfBootImageBlocks = le32_to_cpu(mh->NoOfBootImageBlocks);
-       mh->NoOfBinaryPartitions = le32_to_cpu(mh->NoOfBinaryPartitions);
-       mh->NoOfBDTLPartitions = le32_to_cpu(mh->NoOfBDTLPartitions);
-       mh->BlockMultiplierBits = le32_to_cpu(mh->BlockMultiplierBits);
-       mh->FormatFlags = le32_to_cpu(mh->FormatFlags);
-       mh->PercentUsed = le32_to_cpu(mh->PercentUsed);
+       le32_to_cpus(&mh->NoOfBootImageBlocks);
+       le32_to_cpus(&mh->NoOfBinaryPartitions);
+       le32_to_cpus(&mh->NoOfBDTLPartitions);
+       le32_to_cpus(&mh->BlockMultiplierBits);
+       le32_to_cpus(&mh->FormatFlags);
+       le32_to_cpus(&mh->PercentUsed);
 
        printk(KERN_INFO "    bootRecordID          = %s\n"
                         "    NoOfBootImageBlocks   = %d\n"
@@ -1277,12 +1277,12 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
        /* Scan the partitions */
        for (i = 0; (i < 4); i++) {
                ip = &(mh->Partitions[i]);
-               ip->virtualUnits = le32_to_cpu(ip->virtualUnits);
-               ip->firstUnit = le32_to_cpu(ip->firstUnit);
-               ip->lastUnit = le32_to_cpu(ip->lastUnit);
-               ip->flags = le32_to_cpu(ip->flags);
-               ip->spareUnits = le32_to_cpu(ip->spareUnits);
-               ip->Reserved0 = le32_to_cpu(ip->Reserved0);
+               le32_to_cpus(&ip->virtualUnits);
+               le32_to_cpus(&ip->firstUnit);
+               le32_to_cpus(&ip->lastUnit);
+               le32_to_cpus(&ip->flags);
+               le32_to_cpus(&ip->spareUnits);
+               le32_to_cpus(&ip->Reserved0);
 
                printk(KERN_INFO        "    PARTITION[%d] ->\n"
                        "        virtualUnits    = %d\n"
index 9dff51351f4fba32559541ce50c175d48ef52828..98ad3cefcaf47d5678c81b9a4481ff4c6bec5b4e 100644 (file)
@@ -887,7 +887,7 @@ static int __devinit fsl_elbc_chip_probe(struct fsl_elbc_ctrl *ctrl,
                goto err;
        }
 
-       priv->mtd.name = kasprintf(GFP_KERNEL, "%x.flash", res.start);
+       priv->mtd.name = kasprintf(GFP_KERNEL, "%x.flash", (unsigned)res.start);
        if (!priv->mtd.name) {
                ret = -ENOMEM;
                goto err;
index ecd70e2504f6c07eef8f87b824ba1a2d71d02ba6..556e8131ecdcd68c9a685e5f5bea5f036d839222 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/vmalloc.h>
+#include <asm/div64.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/string.h>
@@ -207,13 +208,16 @@ MODULE_PARM_DESC(overridesize,   "Specifies the NAND Flash size overriding the I
 #define STATE_CMD_READID       0x0000000A /* read ID */
 #define STATE_CMD_ERASE2       0x0000000B /* sector erase second command */
 #define STATE_CMD_RESET        0x0000000C /* reset */
+#define STATE_CMD_RNDOUT       0x0000000D /* random output command */
+#define STATE_CMD_RNDOUTSTART  0x0000000E /* random output start command */
 #define STATE_CMD_MASK         0x0000000F /* command states mask */
 
 /* After an address is input, the simulator goes to one of these states */
 #define STATE_ADDR_PAGE        0x00000010 /* full (row, column) address is accepted */
 #define STATE_ADDR_SEC         0x00000020 /* sector address was accepted */
-#define STATE_ADDR_ZERO        0x00000030 /* one byte zero address was accepted */
-#define STATE_ADDR_MASK        0x00000030 /* address states mask */
+#define STATE_ADDR_COLUMN      0x00000030 /* column address was accepted */
+#define STATE_ADDR_ZERO        0x00000040 /* one byte zero address was accepted */
+#define STATE_ADDR_MASK        0x00000070 /* address states mask */
 
 /* Durind data input/output the simulator is in these states */
 #define STATE_DATAIN           0x00000100 /* waiting for data input */
@@ -240,7 +244,7 @@ MODULE_PARM_DESC(overridesize,   "Specifies the NAND Flash size overriding the I
 #define ACTION_OOBOFF    0x00600000 /* add to address OOB offset */
 #define ACTION_MASK      0x00700000 /* action mask */
 
-#define NS_OPER_NUM      12 /* Number of operations supported by the simulator */
+#define NS_OPER_NUM      13 /* Number of operations supported by the simulator */
 #define NS_OPER_STATES   6  /* Maximum number of states in operation */
 
 #define OPT_ANY          0xFFFFFFFF /* any chip supports this operation */
@@ -373,7 +377,10 @@ static struct nandsim_operations {
        {OPT_ANY, {STATE_CMD_READID, STATE_ADDR_ZERO, STATE_DATAOUT_ID, STATE_READY}},
        /* Large page devices read page */
        {OPT_LARGEPAGE, {STATE_CMD_READ0, STATE_ADDR_PAGE, STATE_CMD_READSTART | ACTION_CPY,
-                              STATE_DATAOUT, STATE_READY}}
+                              STATE_DATAOUT, STATE_READY}},
+       /* Large page devices random page read */
+       {OPT_LARGEPAGE, {STATE_CMD_RNDOUT, STATE_ADDR_COLUMN, STATE_CMD_RNDOUTSTART | ACTION_CPY,
+                              STATE_DATAOUT, STATE_READY}},
 };
 
 struct weak_block {
@@ -579,7 +586,8 @@ static int init_nandsim(struct mtd_info *mtd)
        if (ns->busw == 16)
                NS_WARN("16-bit flashes support wasn't tested\n");
 
-       printk("flash size: %llu MiB\n",        ns->geom.totsz >> 20);
+       printk("flash size: %llu MiB\n",
+                       (unsigned long long)ns->geom.totsz >> 20);
        printk("page size: %u bytes\n",         ns->geom.pgsz);
        printk("OOB area size: %u bytes\n",     ns->geom.oobsz);
        printk("sector size: %u KiB\n",         ns->geom.secsz >> 10);
@@ -588,8 +596,9 @@ static int init_nandsim(struct mtd_info *mtd)
        printk("bus width: %u\n",               ns->busw);
        printk("bits in sector size: %u\n",     ns->geom.secshift);
        printk("bits in page size: %u\n",       ns->geom.pgshift);
-       printk("bits in OOB size: %u\n",        ns->geom.oobshift);
-       printk("flash size with OOB: %llu KiB\n", ns->geom.totszoob >> 10);
+       printk("bits in OOB size: %u\n",        ns->geom.oobshift);
+       printk("flash size with OOB: %llu KiB\n",
+                       (unsigned long long)ns->geom.totszoob >> 10);
        printk("page address bytes: %u\n",      ns->geom.pgaddrbytes);
        printk("sector address bytes: %u\n",    ns->geom.secaddrbytes);
        printk("options: %#x\n",                ns->options);
@@ -937,12 +946,18 @@ static char *get_state_name(uint32_t state)
                        return "STATE_CMD_ERASE2";
                case STATE_CMD_RESET:
                        return "STATE_CMD_RESET";
+               case STATE_CMD_RNDOUT:
+                       return "STATE_CMD_RNDOUT";
+               case STATE_CMD_RNDOUTSTART:
+                       return "STATE_CMD_RNDOUTSTART";
                case STATE_ADDR_PAGE:
                        return "STATE_ADDR_PAGE";
                case STATE_ADDR_SEC:
                        return "STATE_ADDR_SEC";
                case STATE_ADDR_ZERO:
                        return "STATE_ADDR_ZERO";
+               case STATE_ADDR_COLUMN:
+                       return "STATE_ADDR_COLUMN";
                case STATE_DATAIN:
                        return "STATE_DATAIN";
                case STATE_DATAOUT:
@@ -973,6 +988,7 @@ static int check_command(int cmd)
        switch (cmd) {
 
        case NAND_CMD_READ0:
+       case NAND_CMD_READ1:
        case NAND_CMD_READSTART:
        case NAND_CMD_PAGEPROG:
        case NAND_CMD_READOOB:
@@ -982,7 +998,8 @@ static int check_command(int cmd)
        case NAND_CMD_READID:
        case NAND_CMD_ERASE2:
        case NAND_CMD_RESET:
-       case NAND_CMD_READ1:
+       case NAND_CMD_RNDOUT:
+       case NAND_CMD_RNDOUTSTART:
                return 0;
 
        case NAND_CMD_STATUS_MULTI:
@@ -1021,6 +1038,10 @@ static uint32_t get_state_by_command(unsigned command)
                        return STATE_CMD_ERASE2;
                case NAND_CMD_RESET:
                        return STATE_CMD_RESET;
+               case NAND_CMD_RNDOUT:
+                       return STATE_CMD_RNDOUT;
+               case NAND_CMD_RNDOUTSTART:
+                       return STATE_CMD_RNDOUTSTART;
        }
 
        NS_ERR("get_state_by_command: unknown command, BUG\n");
@@ -1582,6 +1603,11 @@ static void switch_state(struct nandsim *ns)
                                ns->regs.num = 1;
                                break;
 
+                       case STATE_ADDR_COLUMN:
+                               /* Column address is always 2 bytes */
+                               ns->regs.num = ns->geom.pgaddrbytes - ns->geom.secaddrbytes;
+                               break;
+
                        default:
                                NS_ERR("switch_state: BUG! unknown address state\n");
                }
@@ -1693,15 +1719,21 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
                        return;
                }
 
-               /*
-                * Chip might still be in STATE_DATAOUT
-                * (if OPT_AUTOINCR feature is supported), STATE_DATAOUT_STATUS or
-                * STATE_DATAOUT_STATUS_M state. If so, switch state.
-                */
+               /* Check that the command byte is correct */
+               if (check_command(byte)) {
+                       NS_ERR("write_byte: unknown command %#x\n", (uint)byte);
+                       return;
+               }
+
                if (NS_STATE(ns->state) == STATE_DATAOUT_STATUS
                        || NS_STATE(ns->state) == STATE_DATAOUT_STATUS_M
-                       || ((ns->options & OPT_AUTOINCR) && NS_STATE(ns->state) == STATE_DATAOUT))
+                       || NS_STATE(ns->state) == STATE_DATAOUT) {
+                       int row = ns->regs.row;
+
                        switch_state(ns);
+                       if (byte == NAND_CMD_RNDOUT)
+                               ns->regs.row = row;
+               }
 
                /* Check if chip is expecting command */
                if (NS_STATE(ns->nxstate) != STATE_UNKNOWN && !(ns->nxstate & STATE_CMD_MASK)) {
@@ -1715,12 +1747,6 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
                        switch_to_ready_state(ns, NS_STATUS_FAILED(ns));
                }
 
-               /* Check that the command byte is correct */
-               if (check_command(byte)) {
-                       NS_ERR("write_byte: unknown command %#x\n", (uint)byte);
-                       return;
-               }
-
                NS_DBG("command byte corresponding to %s state accepted\n",
                        get_state_name(get_state_by_command(byte)));
                ns->regs.command = byte;
index fa533c27052a727e757fea2687c1f3bbb93b0346..8a03875ec8779505ca6846f38501eb812c3766c6 100644 (file)
@@ -510,14 +510,14 @@ config STNIC
 config SH_ETH
        tristate "Renesas SuperH Ethernet support"
        depends on SUPERH && \
-               (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712)
+               (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7763)
        select CRC32
        select MII
        select MDIO_BITBANG
        select PHYLIB
        help
          Renesas SuperH Ethernet device driver.
-         This driver support SH7710 and SH7712.
+         This driver support SH7710, SH7712 and SH7763.
 
 config SUNLANCE
        tristate "Sun LANCE support"
index a8ec60e1ed7573224c5c5a5147399dadef142469..3db7db1828e789920ad9108a425918c493c08c38 100644 (file)
@@ -605,36 +605,87 @@ adjust_head:
 static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
                                struct net_device *dev)
 {
-       unsigned int data;
+       u16 *data;
 
        current_tx_ptr->skb = skb;
 
-       /*
-        * Is skb->data always 16-bit aligned?
-        * Do we need to memcpy((char *)(tail->packet + 2), skb->data, len)?
-        */
-       if ((((unsigned int)(skb->data)) & 0x02) == 2) {
-               /* move skb->data to current_tx_ptr payload */
-               data = (unsigned int)(skb->data) - 2;
-               *((unsigned short *)data) = (unsigned short)(skb->len);
-               current_tx_ptr->desc_a.start_addr = (unsigned long)data;
-               /* this is important! */
-               blackfin_dcache_flush_range(data, (data + (skb->len)) + 2);
-
+       if (ANOMALY_05000285) {
+               /*
+                * TXDWA feature is not avaible to older revision < 0.3 silicon
+                * of BF537
+                *
+                * Only if data buffer is ODD WORD alignment, we do not
+                * need to memcpy
+                */
+               u32 data_align = (u32)(skb->data) & 0x3;
+               if (data_align == 0x2) {
+                       /* move skb->data to current_tx_ptr payload */
+                       data = (u16 *)(skb->data) - 1;
+                       *data = (u16)(skb->len);
+                       current_tx_ptr->desc_a.start_addr = (u32)data;
+                       /* this is important! */
+                       blackfin_dcache_flush_range((u32)data,
+                                       (u32)((u8 *)data + skb->len + 4));
+               } else {
+                       *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len);
+                       memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data,
+                               skb->len);
+                       current_tx_ptr->desc_a.start_addr =
+                               (u32)current_tx_ptr->packet;
+                       if (current_tx_ptr->status.status_word != 0)
+                               current_tx_ptr->status.status_word = 0;
+                       blackfin_dcache_flush_range(
+                               (u32)current_tx_ptr->packet,
+                               (u32)(current_tx_ptr->packet + skb->len + 2));
+               }
        } else {
-               *((unsigned short *)(current_tx_ptr->packet)) =
-                   (unsigned short)(skb->len);
-               memcpy((char *)(current_tx_ptr->packet + 2), skb->data,
-                      (skb->len));
-               current_tx_ptr->desc_a.start_addr =
-                   (unsigned long)current_tx_ptr->packet;
-               if (current_tx_ptr->status.status_word != 0)
-                       current_tx_ptr->status.status_word = 0;
-               blackfin_dcache_flush_range((unsigned int)current_tx_ptr->
-                                           packet,
-                                           (unsigned int)(current_tx_ptr->
-                                                          packet + skb->len) +
-                                           2);
+               /*
+                * TXDWA feature is avaible to revision < 0.3 silicon of
+                * BF537 and always avaible to BF52x
+                */
+               u32 data_align = (u32)(skb->data) & 0x3;
+               if (data_align == 0x0) {
+                       u16 sysctl = bfin_read_EMAC_SYSCTL();
+                       sysctl |= TXDWA;
+                       bfin_write_EMAC_SYSCTL(sysctl);
+
+                       /* move skb->data to current_tx_ptr payload */
+                       data = (u16 *)(skb->data) - 2;
+                       *data = (u16)(skb->len);
+                       current_tx_ptr->desc_a.start_addr = (u32)data;
+                       /* this is important! */
+                       blackfin_dcache_flush_range(
+                                       (u32)data,
+                                       (u32)((u8 *)data + skb->len + 4));
+               } else if (data_align == 0x2) {
+                       u16 sysctl = bfin_read_EMAC_SYSCTL();
+                       sysctl &= ~TXDWA;
+                       bfin_write_EMAC_SYSCTL(sysctl);
+
+                       /* move skb->data to current_tx_ptr payload */
+                       data = (u16 *)(skb->data) - 1;
+                       *data = (u16)(skb->len);
+                       current_tx_ptr->desc_a.start_addr = (u32)data;
+                       /* this is important! */
+                       blackfin_dcache_flush_range(
+                                       (u32)data,
+                                       (u32)((u8 *)data + skb->len + 4));
+               } else {
+                       u16 sysctl = bfin_read_EMAC_SYSCTL();
+                       sysctl &= ~TXDWA;
+                       bfin_write_EMAC_SYSCTL(sysctl);
+
+                       *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len);
+                       memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data,
+                               skb->len);
+                       current_tx_ptr->desc_a.start_addr =
+                               (u32)current_tx_ptr->packet;
+                       if (current_tx_ptr->status.status_word != 0)
+                               current_tx_ptr->status.status_word = 0;
+                       blackfin_dcache_flush_range(
+                               (u32)current_tx_ptr->packet,
+                               (u32)(current_tx_ptr->packet + skb->len + 2));
+               }
        }
 
        /* enable this packet's dma */
@@ -691,7 +742,6 @@ static void bfin_mac_rx(struct net_device *dev)
                                         (unsigned long)skb->tail);
 
        dev->last_rx = jiffies;
-       skb->dev = dev;
        skb->protocol = eth_type_trans(skb, dev);
 #if defined(BFIN_MAC_CSUM_OFFLOAD)
        skb->csum = current_rx_ptr->status.ip_payload_csum;
@@ -920,6 +970,7 @@ static int bfin_mac_open(struct net_device *dev)
        phy_start(lp->phydev);
        phy_write(lp->phydev, MII_BMCR, BMCR_RESET);
        setup_system_regs(dev);
+       setup_mac_addr(dev->dev_addr);
        bfin_mac_disable();
        bfin_mac_enable();
        pr_debug("hardware init finished\n");
@@ -955,7 +1006,7 @@ static int bfin_mac_close(struct net_device *dev)
        return 0;
 }
 
-static int __init bfin_mac_probe(struct platform_device *pdev)
+static int __devinit bfin_mac_probe(struct platform_device *pdev)
 {
        struct net_device *ndev;
        struct bfin_mac_local *lp;
@@ -1081,7 +1132,7 @@ out_err_probe_mac:
        return rc;
 }
 
-static int bfin_mac_remove(struct platform_device *pdev)
+static int __devexit bfin_mac_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct bfin_mac_local *lp = netdev_priv(ndev);
@@ -1128,7 +1179,7 @@ static int bfin_mac_resume(struct platform_device *pdev)
 
 static struct platform_driver bfin_mac_driver = {
        .probe = bfin_mac_probe,
-       .remove = bfin_mac_remove,
+       .remove = __devexit_p(bfin_mac_remove),
        .resume = bfin_mac_resume,
        .suspend = bfin_mac_suspend,
        .driver = {
index 47d51788a462b668a70325134551bc43dfbf2b52..04c0e90119afc7e91dfbba908a6b29a5899a7498 100644 (file)
@@ -683,7 +683,7 @@ enum {
        SF_ERASE_SECTOR = 0xd8, /* erase sector */
 
        FW_FLASH_BOOT_ADDR = 0x70000,   /* start address of FW in flash */
-       FW_VERS_ADDR = 0x77ffc,    /* flash address holding FW version */
+       FW_VERS_ADDR = 0x7fffc,    /* flash address holding FW version */
        FW_MIN_SIZE = 8            /* at least version and csum */
 };
 
index 0920b796bd78375b17c679861a30e50338c9c3c7..b70c5314f53733c3e22beb090a4559781f8f6099 100644 (file)
@@ -2937,9 +2937,9 @@ static void ehea_rereg_mrs(struct work_struct *work)
                                }
                        }
                }
-       mutex_unlock(&dlpar_mem_lock);
-       ehea_info("re-initializing driver complete");
+       ehea_info("re-initializing driver complete");
 out:
+       mutex_unlock(&dlpar_mem_lock);
        return;
 }
 
index c05cb159c7726eff1286660aa78716ad49a1aa91..aa0bf6e1c69493933b153b818dc7badc0866b84f 100644 (file)
@@ -1547,8 +1547,10 @@ static int __devinit enc28j60_probe(struct spi_device *spi)
        random_ether_addr(dev->dev_addr);
        enc28j60_set_hw_macaddr(dev);
 
-       ret = request_irq(spi->irq, enc28j60_irq, IRQF_TRIGGER_FALLING,
-                         DRV_NAME, priv);
+       /* Board setup must set the relevant edge trigger type;
+        * level triggers won't currently work.
+        */
+       ret = request_irq(spi->irq, enc28j60_irq, 0, DRV_NAME, priv);
        if (ret < 0) {
                if (netif_msg_probe(priv))
                        dev_err(&spi->dev, DRV_NAME ": request irq %d failed "
index 4ed89fa9ae46fa05e765fcaaa04854b7c4051fe0..01b38b092c76e4e00994ef493ca9d88b3d381e55 100644 (file)
@@ -333,6 +333,7 @@ enum {
        NvRegPowerState2 = 0x600,
 #define NVREG_POWERSTATE2_POWERUP_MASK         0x0F11
 #define NVREG_POWERSTATE2_POWERUP_REV_A3       0x0001
+#define NVREG_POWERSTATE2_PHY_RESET            0x0004
 };
 
 /* Big endian: should work, but is untested */
@@ -529,6 +530,7 @@ union ring_type {
 #define PHY_REALTEK_INIT_REG4  0x14
 #define PHY_REALTEK_INIT_REG5  0x18
 #define PHY_REALTEK_INIT_REG6  0x11
+#define PHY_REALTEK_INIT_REG7  0x01
 #define PHY_REALTEK_INIT1      0x0000
 #define PHY_REALTEK_INIT2      0x8e00
 #define PHY_REALTEK_INIT3      0x0001
@@ -537,6 +539,9 @@ union ring_type {
 #define PHY_REALTEK_INIT6      0xf5c7
 #define PHY_REALTEK_INIT7      0x1000
 #define PHY_REALTEK_INIT8      0x0003
+#define PHY_REALTEK_INIT9      0x0008
+#define PHY_REALTEK_INIT10     0x0005
+#define PHY_REALTEK_INIT11     0x0200
 #define PHY_REALTEK_INIT_MSK1  0x0003
 
 #define PHY_GIGABIT    0x0100
@@ -1149,6 +1154,42 @@ static int phy_init(struct net_device *dev)
                                return PHY_ERROR;
                        }
                }
+               if (np->phy_model == PHY_MODEL_REALTEK_8211 &&
+                   np->phy_rev == PHY_REV_REALTEK_8211C) {
+                       u32 powerstate = readl(base + NvRegPowerState2);
+
+                       /* need to perform hw phy reset */
+                       powerstate |= NVREG_POWERSTATE2_PHY_RESET;
+                       writel(powerstate, base + NvRegPowerState2);
+                       msleep(25);
+
+                       powerstate &= ~NVREG_POWERSTATE2_PHY_RESET;
+                       writel(powerstate, base + NvRegPowerState2);
+                       msleep(25);
+
+                       reg = mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG6, MII_READ);
+                       reg |= PHY_REALTEK_INIT9;
+                       if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG6, reg)) {
+                               printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+                               return PHY_ERROR;
+                       }
+                       if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT10)) {
+                               printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+                               return PHY_ERROR;
+                       }
+                       reg = mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG7, MII_READ);
+                       if (!(reg & PHY_REALTEK_INIT11)) {
+                               reg |= PHY_REALTEK_INIT11;
+                               if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG7, reg)) {
+                                       printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+                                       return PHY_ERROR;
+                               }
+                       }
+                       if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT1)) {
+                               printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+                               return PHY_ERROR;
+                       }
+               }
                if (np->phy_model == PHY_MODEL_REALTEK_8201) {
                        if (np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_32 ||
                            np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_33 ||
@@ -1201,12 +1242,23 @@ static int phy_init(struct net_device *dev)
        mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
        mii_control |= BMCR_ANENABLE;
 
-       /* reset the phy
-        * (certain phys need bmcr to be setup with reset)
-        */
-       if (phy_reset(dev, mii_control)) {
-               printk(KERN_INFO "%s: phy reset failed\n", pci_name(np->pci_dev));
-               return PHY_ERROR;
+       if (np->phy_oui == PHY_OUI_REALTEK &&
+           np->phy_model == PHY_MODEL_REALTEK_8211 &&
+           np->phy_rev == PHY_REV_REALTEK_8211C) {
+               /* start autoneg since we already performed hw reset above */
+               mii_control |= BMCR_ANRESTART;
+               if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
+                       printk(KERN_INFO "%s: phy init failed\n", pci_name(np->pci_dev));
+                       return PHY_ERROR;
+               }
+       } else {
+               /* reset the phy
+                * (certain phys need bmcr to be setup with reset)
+                */
+               if (phy_reset(dev, mii_control)) {
+                       printk(KERN_INFO "%s: phy reset failed\n", pci_name(np->pci_dev));
+                       return PHY_ERROR;
+               }
        }
 
        /* phy vendor specific configuration */
index 0960e69b2da4dc58d2d98d1a87d3953ec17541ca..e4fbefc8c82f80797c5808efcadba2219aafb3c7 100644 (file)
@@ -69,18 +69,20 @@ static void ri_tasklet(unsigned long dev)
        struct net_device *_dev = (struct net_device *)dev;
        struct ifb_private *dp = netdev_priv(_dev);
        struct net_device_stats *stats = &_dev->stats;
+       struct netdev_queue *txq;
        struct sk_buff *skb;
 
+       txq = netdev_get_tx_queue(_dev, 0);
        dp->st_task_enter++;
        if ((skb = skb_peek(&dp->tq)) == NULL) {
                dp->st_txq_refl_try++;
-               if (netif_tx_trylock(_dev)) {
+               if (__netif_tx_trylock(txq)) {
                        dp->st_rxq_enter++;
                        while ((skb = skb_dequeue(&dp->rq)) != NULL) {
                                skb_queue_tail(&dp->tq, skb);
                                dp->st_rx2tx_tran++;
                        }
-                       netif_tx_unlock(_dev);
+                       __netif_tx_unlock(txq);
                } else {
                        /* reschedule */
                        dp->st_rxq_notenter++;
@@ -115,7 +117,7 @@ static void ri_tasklet(unsigned long dev)
                        BUG();
        }
 
-       if (netif_tx_trylock(_dev)) {
+       if (__netif_tx_trylock(txq)) {
                dp->st_rxq_check++;
                if ((skb = skb_peek(&dp->rq)) == NULL) {
                        dp->tasklet_pending = 0;
@@ -123,10 +125,10 @@ static void ri_tasklet(unsigned long dev)
                                netif_wake_queue(_dev);
                } else {
                        dp->st_rxq_rsch++;
-                       netif_tx_unlock(_dev);
+                       __netif_tx_unlock(txq);
                        goto resched;
                }
-               netif_tx_unlock(_dev);
+               __netif_tx_unlock(txq);
        } else {
 resched:
                dp->tasklet_pending = 1;
index d8b89c74aabd863b9d8265e455ee700aad78785b..37ab8c855719e0a3149c40ccc851ef8367e22df7 100644 (file)
@@ -107,7 +107,7 @@ static int act200l_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s()\n", __func__ );
 
        /* Power on the dongle */
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
@@ -124,7 +124,7 @@ static int act200l_open(struct sir_dev *dev)
 
 static int act200l_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s()\n", __func__ );
 
        /* Power off the dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -143,7 +143,7 @@ static int act200l_change_speed(struct sir_dev *dev, unsigned speed)
        u8 control[3];
        int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s()\n", __func__ );
 
        /* Clear DTR and set RTS to enter command mode */
        sirdev_set_dtr_rts(dev, FALSE, TRUE);
@@ -212,7 +212,7 @@ static int act200l_reset(struct sir_dev *dev)
        };
        int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s()\n", __func__ );
 
        switch (state) {
        case SIRDEV_STATE_DONGLE_RESET:
@@ -240,7 +240,7 @@ static int act200l_reset(struct sir_dev *dev)
                dev->speed = 9600;
                break;
        default:
-               IRDA_ERROR("%s(), unknown state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s(), unknown state %d\n", __func__, state);
                ret = -1;
                break;
        }
index 736d2473b7e164c3d16d3b61bf8179eac2321078..50b2141a6103c428c195becaf7f32767081caaa9 100644 (file)
@@ -165,7 +165,7 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed)
        int ret = 0;
        int i = 0;
 
-        IRDA_DEBUG(4, "%s(), speed=%d (was %d)\n", __FUNCTION__,
+        IRDA_DEBUG(4, "%s(), speed=%d (was %d)\n", __func__,
                speed, dev->speed);
 
        /* dongle was already resetted from irda_request state machine,
index 083b0dd70fef1f1431e284b0aa7aa864047711b8..2ff181861d2d05b51ccc9a1c8f8f55a5aa897027 100644 (file)
@@ -152,7 +152,7 @@ static int __init ali_ircc_init(void)
        int reg, revision;
        int i = 0;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
 
        ret = platform_driver_register(&ali_ircc_driver);
         if (ret) {
@@ -166,7 +166,7 @@ static int __init ali_ircc_init(void)
        /* Probe for all the ALi chipsets we know about */
        for (chip= chips; chip->name; chip++, i++) 
        {
-               IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __FUNCTION__, chip->name);
+               IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __func__, chip->name);
                                
                /* Try all config registers for this chip */
                for (cfg=0; cfg<2; cfg++)
@@ -196,11 +196,11 @@ static int __init ali_ircc_init(void)
                                
                        if (reg == chip->cid_value)
                        {
-                               IRDA_DEBUG(2, "%s(), Chip found at 0x%03x\n", __FUNCTION__, cfg_base);
+                               IRDA_DEBUG(2, "%s(), Chip found at 0x%03x\n", __func__, cfg_base);
                                           
                                outb(0x1F, cfg_base);
                                revision = inb(cfg_base+1);
-                               IRDA_DEBUG(2, "%s(), Found %s chip, revision=%d\n", __FUNCTION__,
+                               IRDA_DEBUG(2, "%s(), Found %s chip, revision=%d\n", __func__,
                                           chip->name, revision);                                       
                                
                                /* 
@@ -223,14 +223,14 @@ static int __init ali_ircc_init(void)
                        }
                        else
                        {
-                               IRDA_DEBUG(2, "%s(), No %s chip at 0x%03x\n", __FUNCTION__, chip->name, cfg_base);
+                               IRDA_DEBUG(2, "%s(), No %s chip at 0x%03x\n", __func__, chip->name, cfg_base);
                        }
                        /* Exit configuration */
                        outb(0xbb, cfg_base);
                }
        }               
                
-       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);                                                 
+       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
 
        if (ret)
                platform_driver_unregister(&ali_ircc_driver);
@@ -248,7 +248,7 @@ static void __exit ali_ircc_cleanup(void)
 {
        int i;
 
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); 
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
 
        for (i=0; i < ARRAY_SIZE(dev_self); i++) {
                if (dev_self[i])
@@ -257,7 +257,7 @@ static void __exit ali_ircc_cleanup(void)
        
        platform_driver_unregister(&ali_ircc_driver);
 
-       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
 }
 
 /*
@@ -273,11 +273,11 @@ static int ali_ircc_open(int i, chipio_t *info)
        int dongle_id;
        int err;
                        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); 
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
 
        if (i >= ARRAY_SIZE(dev_self)) {
                IRDA_ERROR("%s(), maximum number of supported chips reached!\n",
-                          __FUNCTION__);
+                          __func__);
                return -ENOMEM;
        }
        
@@ -288,7 +288,7 @@ static int ali_ircc_open(int i, chipio_t *info)
        dev = alloc_irdadev(sizeof(*self));
        if (dev == NULL) {
                IRDA_ERROR("%s(), can't allocate memory for control block!\n",
-                          __FUNCTION__);
+                          __func__);
                return -ENOMEM;
        }
 
@@ -312,7 +312,7 @@ static int ali_ircc_open(int i, chipio_t *info)
        /* Reserve the ioports that we need */
        if (!request_region(self->io.fir_base, self->io.fir_ext,
                            ALI_IRCC_DRIVER_NAME)) {
-               IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __FUNCTION__,
+               IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __func__,
                        self->io.fir_base);
                err = -ENODEV;
                goto err_out1;
@@ -370,19 +370,19 @@ static int ali_ircc_open(int i, chipio_t *info)
 
        err = register_netdev(dev);
        if (err) {
-               IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
                goto err_out4;
        }
        IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);
 
        /* Check dongle id */
        dongle_id = ali_ircc_read_dongle_id(i, info);
-       IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __FUNCTION__,
+       IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __func__,
                     ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]);
                
        self->io.dongle_id = dongle_id;
 
-       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
        
        return 0;
 
@@ -411,7 +411,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
 {
        int iobase;
 
-       IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __func__);
 
        IRDA_ASSERT(self != NULL, return -1;);
 
@@ -421,7 +421,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
        unregister_netdev(self->netdev);
 
        /* Release the PORT that this driver is using */
-       IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __FUNCTION__, self->io.fir_base);
+       IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __func__, self->io.fir_base);
        release_region(self->io.fir_base, self->io.fir_ext);
 
        if (self->tx_buff.head)
@@ -435,7 +435,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
        dev_self[self->index] = NULL;
        free_netdev(self->netdev);
        
-       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
        
        return 0;
 }
@@ -478,7 +478,7 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
        int cfg_base = info->cfg_base;
        int hi, low, reg;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
        
        /* Enter Configuration */
        outb(chip->entr1, cfg_base);
@@ -497,13 +497,13 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
        
        info->sir_base = info->fir_base;
        
-       IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __FUNCTION__, info->fir_base);
+       IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __func__, info->fir_base);
                
        /* Read IRQ control register */
        outb(0x70, cfg_base);
        reg = inb(cfg_base+1);
        info->irq = reg & 0x0f;
-       IRDA_DEBUG(2, "%s(), probing irq=%d\n", __FUNCTION__, info->irq);
+       IRDA_DEBUG(2, "%s(), probing irq=%d\n", __func__, info->irq);
        
        /* Read DMA channel */
        outb(0x74, cfg_base);
@@ -511,26 +511,26 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
        info->dma = reg & 0x07;
        
        if(info->dma == 0x04)
-               IRDA_WARNING("%s(), No DMA channel assigned !\n", __FUNCTION__);
+               IRDA_WARNING("%s(), No DMA channel assigned !\n", __func__);
        else
-               IRDA_DEBUG(2, "%s(), probing dma=%d\n", __FUNCTION__, info->dma);
+               IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma);
        
        /* Read Enabled Status */
        outb(0x30, cfg_base);
        reg = inb(cfg_base+1);
        info->enabled = (reg & 0x80) && (reg & 0x01);
-       IRDA_DEBUG(2, "%s(), probing enabled=%d\n", __FUNCTION__, info->enabled);
+       IRDA_DEBUG(2, "%s(), probing enabled=%d\n", __func__, info->enabled);
        
        /* Read Power Status */
        outb(0x22, cfg_base);
        reg = inb(cfg_base+1);
        info->suspended = (reg & 0x20);
-       IRDA_DEBUG(2, "%s(), probing suspended=%d\n", __FUNCTION__, info->suspended);
+       IRDA_DEBUG(2, "%s(), probing suspended=%d\n", __func__, info->suspended);
        
        /* Exit configuration */
        outb(0xbb, cfg_base);
                
-       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); 
+       IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
        
        return 0;       
 }
@@ -548,7 +548,7 @@ static int ali_ircc_setup(chipio_t *info)
        int version;
        int iobase = info->fir_base;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
        
        /* Locking comments :
         * Most operations here need to be protected. We are called before
@@ -609,7 +609,7 @@ static int ali_ircc_setup(chipio_t *info)
        // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM
        // Turn on the interrupts in ali_ircc_net_open
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);        
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__);
        
        return 0;
 }
@@ -626,7 +626,7 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
        int dongle_id, reg;
        int cfg_base = info->cfg_base;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
                
        /* Enter Configuration */
        outb(chips[i].entr1, cfg_base);
@@ -640,13 +640,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
        outb(0xf0, cfg_base);
        reg = inb(cfg_base+1);  
        dongle_id = ((reg>>6)&0x02) | ((reg>>5)&0x01);
-       IRDA_DEBUG(2, "%s(), probing dongle_id=%d, dongle_types=%s\n", __FUNCTION__, 
+       IRDA_DEBUG(2, "%s(), probing dongle_id=%d, dongle_types=%s\n", __func__,
                dongle_id, dongle_types[dongle_id]);
        
        /* Exit configuration */
        outb(0xbb, cfg_base);
                        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);        
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__);
        
        return dongle_id;
 }
@@ -663,7 +663,7 @@ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
        struct ali_ircc_cb *self;
        int ret;
                
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
                
        self = dev->priv;
        
@@ -677,7 +677,7 @@ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
                
        spin_unlock(&self->lock);
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__);
        return ret;
 }
 /*
@@ -691,7 +691,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
        __u8 eir, OldMessageCount;
        int iobase, tmp;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__);
        
        iobase = self->io.fir_base;
        
@@ -704,10 +704,10 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
        //self->ier = inb(iobase+FIR_IER);              2000/12/1 04:32PM
        eir = self->InterruptID & self->ier; /* Mask out the interesting ones */ 
        
-       IRDA_DEBUG(1, "%s(), self->InterruptID = %x\n", __FUNCTION__,self->InterruptID);
-       IRDA_DEBUG(1, "%s(), self->LineStatus = %x\n", __FUNCTION__,self->LineStatus);
-       IRDA_DEBUG(1, "%s(), self->ier = %x\n", __FUNCTION__,self->ier);
-       IRDA_DEBUG(1, "%s(), eir = %x\n", __FUNCTION__,eir);
+       IRDA_DEBUG(1, "%s(), self->InterruptID = %x\n", __func__,self->InterruptID);
+       IRDA_DEBUG(1, "%s(), self->LineStatus = %x\n", __func__,self->LineStatus);
+       IRDA_DEBUG(1, "%s(), self->ier = %x\n", __func__,self->ier);
+       IRDA_DEBUG(1, "%s(), eir = %x\n", __func__,eir);
        
        /* Disable interrupts */
         SetCOMInterrupts(self, FALSE);
@@ -718,7 +718,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
        {               
                if (self->io.direction == IO_XMIT) /* TX */
                {
-                       IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Tx) *******\n", __FUNCTION__);
+                       IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Tx) *******\n", __func__);
                        
                        if(ali_ircc_dma_xmit_complete(self))
                        {
@@ -737,23 +737,23 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
                }       
                else /* RX */
                {
-                       IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Rx) *******\n", __FUNCTION__);
+                       IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Rx) *******\n", __func__);
                        
                        if(OldMessageCount > ((self->LineStatus+1) & 0x07))
                        {
                                self->rcvFramesOverflow = TRUE; 
-                               IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******** \n", __FUNCTION__);
+                               IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******** \n", __func__);
                        }
                                                
                        if (ali_ircc_dma_receive_complete(self))
                        {
-                               IRDA_DEBUG(1, "%s(), ******* receive complete ******** \n", __FUNCTION__);
+                               IRDA_DEBUG(1, "%s(), ******* receive complete ******** \n", __func__);
                                
                                self->ier = IER_EOM;                            
                        }
                        else
                        {
-                               IRDA_DEBUG(1, "%s(), ******* Not receive complete ******** \n", __FUNCTION__);
+                               IRDA_DEBUG(1, "%s(), ******* Not receive complete ******** \n", __func__);
                                
                                self->ier = IER_EOM | IER_TIMER;                                                                
                        }       
@@ -766,7 +766,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
                if(OldMessageCount > ((self->LineStatus+1) & 0x07))
                {
                        self->rcvFramesOverflow = TRUE; 
-                       IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******* \n", __FUNCTION__);
+                       IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******* \n", __func__);
                }
                /* Disable Timer */
                switch_bank(iobase, BANK1);
@@ -798,7 +798,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self)
        /* Restore Interrupt */ 
        SetCOMInterrupts(self, TRUE);   
                
-       IRDA_DEBUG(1, "%s(), ----------------- End ---------------\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s(), ----------------- End ---------------\n", __func__);
        return IRQ_RETVAL(eir);
 }
 
@@ -813,7 +813,7 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self)
        int iobase;
        int iir, lsr;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
        
        iobase = self->io.sir_base;
 
@@ -822,13 +822,13 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self)
                /* Clear interrupt */
                lsr = inb(iobase+UART_LSR);
 
-               IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", __FUNCTION__, 
+               IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", __func__,
                           iir, lsr, iobase);
 
                switch (iir) 
                {
                        case UART_IIR_RLSI:
-                               IRDA_DEBUG(2, "%s(), RLSI\n", __FUNCTION__);
+                               IRDA_DEBUG(2, "%s(), RLSI\n", __func__);
                                break;
                        case UART_IIR_RDI:
                                /* Receive interrupt */
@@ -842,14 +842,14 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self)
                                }                               
                                break;
                        default:
-                               IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", __FUNCTION__, iir);
+                               IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", __func__, iir);
                                break;
                } 
                
        }
        
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);        
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__);
 
        return IRQ_RETVAL(iir);
 }
@@ -866,7 +866,7 @@ static void ali_ircc_sir_receive(struct ali_ircc_cb *self)
        int boguscount = 0;
        int iobase;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
        IRDA_ASSERT(self != NULL, return;);
 
        iobase = self->io.sir_base;
@@ -881,12 +881,12 @@ static void ali_ircc_sir_receive(struct ali_ircc_cb *self)
 
                /* Make sure we don't stay here too long */
                if (boguscount++ > 32) {
-                       IRDA_DEBUG(2,"%s(), breaking!\n", __FUNCTION__);
+                       IRDA_DEBUG(2,"%s(), breaking!\n", __func__);
                        break;
                }
        } while (inb(iobase+UART_LSR) & UART_LSR_DR);   
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 /*
@@ -903,7 +903,7 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self)
 
        IRDA_ASSERT(self != NULL, return;);
 
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
        
        iobase = self->io.sir_base;
 
@@ -922,16 +922,16 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self)
                {
                        /* We must wait until all data are gone */
                        while(!(inb(iobase+UART_LSR) & UART_LSR_TEMT))
-                               IRDA_DEBUG(1, "%s(), UART_LSR_THRE\n", __FUNCTION__ );
+                               IRDA_DEBUG(1, "%s(), UART_LSR_THRE\n", __func__ );
                        
-                       IRDA_DEBUG(1, "%s(), Changing speed! self->new_speed = %d\n", __FUNCTION__ , self->new_speed);
+                       IRDA_DEBUG(1, "%s(), Changing speed! self->new_speed = %d\n", __func__ , self->new_speed);
                        ali_ircc_change_speed(self, self->new_speed);
                        self->new_speed = 0;                    
                        
                        // benjamin 2000/11/10 06:32PM
                        if (self->io.speed > 115200)
                        {
-                               IRDA_DEBUG(2, "%s(), ali_ircc_change_speed from UART_LSR_TEMT \n", __FUNCTION__ );                              
+                               IRDA_DEBUG(2, "%s(), ali_ircc_change_speed from UART_LSR_TEMT \n", __func__ );
                                        
                                self->ier = IER_EOM;
                                // SetCOMInterrupts(self, TRUE);                                                        
@@ -949,7 +949,7 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self)
                outb(UART_IER_RDI, iobase+UART_IER);
        }
                
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud)
@@ -957,9 +957,9 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud)
        struct net_device *dev = self->netdev;
        int iobase;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
        
-       IRDA_DEBUG(2, "%s(), setting speed = %d \n", __FUNCTION__ , baud);
+       IRDA_DEBUG(2, "%s(), setting speed = %d \n", __func__ , baud);
        
        /* This function *must* be called with irq off and spin-lock.
         * - Jean II */
@@ -998,7 +998,7 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud)
                
        netif_wake_queue(self->netdev); 
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud)
@@ -1008,14 +1008,14 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud)
        struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv;
        struct net_device *dev;
 
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
                
        IRDA_ASSERT(self != NULL, return;);
 
        dev = self->netdev;
        iobase = self->io.fir_base;
        
-       IRDA_DEBUG(1, "%s(), self->io.speed = %d, change to speed = %d\n", __FUNCTION__ ,self->io.speed,baud);
+       IRDA_DEBUG(1, "%s(), self->io.speed = %d, change to speed = %d\n", __func__ ,self->io.speed,baud);
        
        /* Come from SIR speed */
        if(self->io.speed <=115200)
@@ -1029,7 +1029,7 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud)
        // Set Dongle Speed mode
        ali_ircc_change_dongle_speed(self, baud);
                
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 /*
@@ -1047,9 +1047,9 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
        int lcr;    /* Line control reg */
        int divisor;
 
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
        
-       IRDA_DEBUG(1, "%s(), Setting speed to: %d\n", __FUNCTION__ , speed);
+       IRDA_DEBUG(1, "%s(), Setting speed to: %d\n", __func__ , speed);
 
        IRDA_ASSERT(self != NULL, return;);
 
@@ -1103,7 +1103,7 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
        
        spin_unlock_irqrestore(&self->lock, flags);
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed)
@@ -1113,14 +1113,14 @@ static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed)
        int iobase,dongle_id;
        int tmp = 0;
                        
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );        
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
        
        iobase = self->io.fir_base;     /* or iobase = self->io.sir_base; */
        dongle_id = self->io.dongle_id;
        
        /* We are already locked, no need to do it again */
                
-       IRDA_DEBUG(1, "%s(), Set Speed for %s , Speed = %d\n", __FUNCTION__ , dongle_types[dongle_id], speed);          
+       IRDA_DEBUG(1, "%s(), Set Speed for %s , Speed = %d\n", __func__ , dongle_types[dongle_id], speed);
        
        switch_bank(iobase, BANK2);
        tmp = inb(iobase+FIR_IRDA_CR);
@@ -1284,7 +1284,7 @@ static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed)
                        
        switch_bank(iobase, BANK0);
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );               
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 /*
@@ -1297,11 +1297,11 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len)
 {
        int actual = 0;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
                
        /* Tx FIFO should be empty! */
        if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) {
-               IRDA_DEBUG(0, "%s(), failed, fifo not empty!\n", __FUNCTION__ );
+               IRDA_DEBUG(0, "%s(), failed, fifo not empty!\n", __func__ );
                return 0;
        }
         
@@ -1313,7 +1313,7 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len)
                actual++;
        }
        
-        IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );      
+        IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        return actual;
 }
 
@@ -1329,7 +1329,7 @@ static int ali_ircc_net_open(struct net_device *dev)
        int iobase;
        char hwname[32];
                
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
        
        IRDA_ASSERT(dev != NULL, return -1;);
        
@@ -1375,7 +1375,7 @@ static int ali_ircc_net_open(struct net_device *dev)
         */
        self->irlap = irlap_open(dev, &self->qos, hwname);
                
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return 0;
 }
@@ -1392,7 +1392,7 @@ static int ali_ircc_net_close(struct net_device *dev)
        struct ali_ircc_cb *self;
        //int iobase;
                        
-       IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __func__ );
                
        IRDA_ASSERT(dev != NULL, return -1;);
 
@@ -1415,7 +1415,7 @@ static int ali_ircc_net_close(struct net_device *dev)
        free_irq(self->io.irq, dev);
        free_dma(self->io.dma);
 
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return 0;
 }
@@ -1434,7 +1434,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        __u32 speed;
        int mtt, diff;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
        
        self = (struct ali_ircc_cb *) dev->priv;
        iobase = self->io.fir_base;
@@ -1488,7 +1488,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
                        diff = self->now.tv_usec - self->stamp.tv_usec;
                        /* self->stamp is set from ali_ircc_dma_receive_complete() */
                                                        
-                       IRDA_DEBUG(1, "%s(), ******* diff = %d ******* \n", __FUNCTION__ , diff);       
+                       IRDA_DEBUG(1, "%s(), ******* diff = %d ******* \n", __func__ , diff);
                        
                        if (diff < 0) 
                                diff += 1000000;
@@ -1510,7 +1510,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
                                        /* Adjust for timer resolution */
                                        mtt = (mtt+250) / 500;  /* 4 discard, 5 get advanced, Let's round off */
                                        
-                                       IRDA_DEBUG(1, "%s(), ************** mtt = %d ***********\n", __FUNCTION__ , mtt);       
+                                       IRDA_DEBUG(1, "%s(), ************** mtt = %d ***********\n", __func__ , mtt);
                                        
                                        /* Setup timer */
                                        if (mtt == 1) /* 500 us */
@@ -1567,7 +1567,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        spin_unlock_irqrestore(&self->lock, flags);
        dev_kfree_skb(skb);
 
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
        return 0;       
 }
 
@@ -1578,7 +1578,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self)
        unsigned char FIFO_OPTI, Hi, Lo;
        
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
        
        iobase = self->io.fir_base;
        
@@ -1629,7 +1629,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self)
        tmp = inb(iobase+FIR_LCR_B);
        tmp &= ~0x20; // Disable SIP
        outb(((unsigned char)(tmp & 0x3f) | LCR_B_TX_MODE) & ~LCR_B_BW, iobase+FIR_LCR_B);
-       IRDA_DEBUG(1, "%s(), ******* Change to TX mode: FIR_LCR_B = 0x%x ******* \n", __FUNCTION__ , inb(iobase+FIR_LCR_B));
+       IRDA_DEBUG(1, "%s(), ******* Change to TX mode: FIR_LCR_B = 0x%x ******* \n", __func__ , inb(iobase+FIR_LCR_B));
        
        outb(0, iobase+FIR_LSR);
                        
@@ -1639,7 +1639,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self)
        
        switch_bank(iobase, BANK0); 
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static int  ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
@@ -1647,7 +1647,7 @@ static int  ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
        int iobase;
        int ret = TRUE;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
        
        iobase = self->io.fir_base;
        
@@ -1660,7 +1660,7 @@ static int  ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
        if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT)
        
        {
-               IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __FUNCTION__);        
+               IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__);
                self->stats.tx_errors++;
                self->stats.tx_fifo_errors++;           
        }
@@ -1703,7 +1703,7 @@ static int  ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
                
        switch_bank(iobase, BANK0); 
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
        return ret;
 }
 
@@ -1718,7 +1718,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self)
 {
        int iobase, tmp;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
        
        iobase = self->io.fir_base;
        
@@ -1756,7 +1756,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self)
        //switch_bank(iobase, BANK0);
        tmp = inb(iobase+FIR_LCR_B);
        outb((unsigned char)(tmp &0x3f) | LCR_B_RX_MODE | LCR_B_BW , iobase + FIR_LCR_B); // 2000/12/1 05:16PM
-       IRDA_DEBUG(1, "%s(), *** Change To RX mode: FIR_LCR_B = 0x%x *** \n", __FUNCTION__ , inb(iobase+FIR_LCR_B));
+       IRDA_DEBUG(1, "%s(), *** Change To RX mode: FIR_LCR_B = 0x%x *** \n", __func__ , inb(iobase+FIR_LCR_B));
                        
        /* Set Rx Threshold */
        switch_bank(iobase, BANK1);
@@ -1768,7 +1768,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self)
        outb(CR_DMA_EN | CR_DMA_BURST, iobase+FIR_CR);
                                
        switch_bank(iobase, BANK0); 
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
        return 0;
 }
 
@@ -1779,7 +1779,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
        __u8 status, MessageCount;
        int len, i, iobase, val;        
 
-       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
 
        st_fifo = &self->st_fifo;               
        iobase = self->io.fir_base;     
@@ -1788,7 +1788,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
        MessageCount = inb(iobase+ FIR_LSR)&0x07;
        
        if (MessageCount > 0)   
-               IRDA_DEBUG(0, "%s(), Messsage count = %d,\n", __FUNCTION__ , MessageCount);     
+               IRDA_DEBUG(0, "%s(), Messsage count = %d,\n", __func__ , MessageCount);
                
        for (i=0; i<=MessageCount; i++)
        {
@@ -1801,11 +1801,11 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                len = len << 8; 
                len |= inb(iobase+FIR_RX_DSR_LO);
                
-               IRDA_DEBUG(1, "%s(), RX Length = 0x%.2x,\n", __FUNCTION__ , len);       
-               IRDA_DEBUG(1, "%s(), RX Status = 0x%.2x,\n", __FUNCTION__ , status);
+               IRDA_DEBUG(1, "%s(), RX Length = 0x%.2x,\n", __func__ , len);
+               IRDA_DEBUG(1, "%s(), RX Status = 0x%.2x,\n", __func__ , status);
                
                if (st_fifo->tail >= MAX_RX_WINDOW) {
-                       IRDA_DEBUG(0, "%s(), window is full!\n", __FUNCTION__ );
+                       IRDA_DEBUG(0, "%s(), window is full!\n", __func__ );
                        continue;
                }
                        
@@ -1828,7 +1828,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                /* Check for errors */
                if ((status & 0xd8) || self->rcvFramesOverflow || (len==0))             
                {
-                       IRDA_DEBUG(0,"%s(), ************* RX Errors ************ \n", __FUNCTION__ );   
+                       IRDA_DEBUG(0,"%s(), ************* RX Errors ************ \n", __func__ );
                        
                        /* Skip frame */
                        self->stats.rx_errors++;
@@ -1838,29 +1838,29 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                        if (status & LSR_FIFO_UR) 
                        {
                                self->stats.rx_frame_errors++;
-                               IRDA_DEBUG(0,"%s(), ************* FIFO Errors ************ \n", __FUNCTION__ );
+                               IRDA_DEBUG(0,"%s(), ************* FIFO Errors ************ \n", __func__ );
                        }       
                        if (status & LSR_FRAME_ERROR)
                        {
                                self->stats.rx_frame_errors++;
-                               IRDA_DEBUG(0,"%s(), ************* FRAME Errors ************ \n", __FUNCTION__ );
+                               IRDA_DEBUG(0,"%s(), ************* FRAME Errors ************ \n", __func__ );
                        }
                                                        
                        if (status & LSR_CRC_ERROR) 
                        {
                                self->stats.rx_crc_errors++;
-                               IRDA_DEBUG(0,"%s(), ************* CRC Errors ************ \n", __FUNCTION__ );
+                               IRDA_DEBUG(0,"%s(), ************* CRC Errors ************ \n", __func__ );
                        }
                        
                        if(self->rcvFramesOverflow)
                        {
                                self->stats.rx_frame_errors++;
-                               IRDA_DEBUG(0,"%s(), ************* Overran DMA buffer ************ \n", __FUNCTION__ );                                                          
+                               IRDA_DEBUG(0,"%s(), ************* Overran DMA buffer ************ \n", __func__ );
                        }
                        if(len == 0)
                        {
                                self->stats.rx_frame_errors++;
-                               IRDA_DEBUG(0,"%s(), ********** Receive Frame Size = 0 ********* \n", __FUNCTION__ );
+                               IRDA_DEBUG(0,"%s(), ********** Receive Frame Size = 0 ********* \n", __func__ );
                        }
                }        
                else 
@@ -1872,7 +1872,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                                val = inb(iobase+FIR_BSR);      
                                if ((val& BSR_FIFO_NOT_EMPTY)== 0x80) 
                                {
-                                       IRDA_DEBUG(0, "%s(), ************* BSR_FIFO_NOT_EMPTY ************ \n", __FUNCTION__ );
+                                       IRDA_DEBUG(0, "%s(), ************* BSR_FIFO_NOT_EMPTY ************ \n", __func__ );
                                        
                                        /* Put this entry back in fifo */
                                        st_fifo->head--;
@@ -1909,7 +1909,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                        {
                                IRDA_WARNING("%s(), memory squeeze, "
                                             "dropping frame.\n",
-                                            __FUNCTION__);
+                                            __func__);
                                self->stats.rx_dropped++;
 
                                return FALSE;
@@ -1937,7 +1937,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
        
        switch_bank(iobase, BANK0);     
                
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
        return TRUE;
 }
 
@@ -1956,7 +1956,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        int iobase;
        __u32 speed;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
        
        IRDA_ASSERT(dev != NULL, return 0;);
        
@@ -2005,7 +2005,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
 
        dev_kfree_skb(skb);
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return 0;       
 }
@@ -2024,7 +2024,7 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        unsigned long flags;
        int ret = 0;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
        
        IRDA_ASSERT(dev != NULL, return -1;);
 
@@ -2032,11 +2032,11 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__ , dev->name, cmd);
+       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__ , dev->name, cmd);
        
        switch (cmd) {
        case SIOCSBANDWIDTH: /* Set bandwidth */
-               IRDA_DEBUG(1, "%s(), SIOCSBANDWIDTH\n", __FUNCTION__ );
+               IRDA_DEBUG(1, "%s(), SIOCSBANDWIDTH\n", __func__ );
                /*
                 * This function will also be used by IrLAP to change the
                 * speed, so we still must allow for speed change within
@@ -2050,13 +2050,13 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                spin_unlock_irqrestore(&self->lock, flags);
                break;
        case SIOCSMEDIABUSY: /* Set media busy */
-               IRDA_DEBUG(1, "%s(), SIOCSMEDIABUSY\n", __FUNCTION__ );
+               IRDA_DEBUG(1, "%s(), SIOCSMEDIABUSY\n", __func__ );
                if (!capable(CAP_NET_ADMIN))
                        return -EPERM;
                irda_device_set_media_busy(self->netdev, TRUE);
                break;
        case SIOCGRECEIVING: /* Check if we are receiving right now */
-               IRDA_DEBUG(2, "%s(), SIOCGRECEIVING\n", __FUNCTION__ );
+               IRDA_DEBUG(2, "%s(), SIOCGRECEIVING\n", __func__ );
                /* This is protected */
                irq->ifr_receiving = ali_ircc_is_receiving(self);
                break;
@@ -2064,7 +2064,7 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                ret = -EOPNOTSUPP;
        }
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return ret;
 }
@@ -2081,7 +2081,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
        int status = FALSE;
        int iobase;             
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start -----------------\n", __func__ );
        
        IRDA_ASSERT(self != NULL, return FALSE;);
 
@@ -2095,7 +2095,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
                if((inb(iobase+FIR_FIFO_FR) & 0x3f) != 0)               
                {
                        /* We are receiving something */
-                       IRDA_DEBUG(1, "%s(), We are receiving something\n", __FUNCTION__ );
+                       IRDA_DEBUG(1, "%s(), We are receiving something\n", __func__ );
                        status = TRUE;
                }
                switch_bank(iobase, BANK0);             
@@ -2107,7 +2107,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
        
        spin_unlock_irqrestore(&self->lock, flags);
        
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return status;
 }
@@ -2116,9 +2116,9 @@ static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev)
 {
        struct ali_ircc_cb *self = (struct ali_ircc_cb *) dev->priv;
        
-       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
                
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
        
        return &self->stats;
 }
@@ -2164,7 +2164,7 @@ static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable)
        
        int iobase = self->io.fir_base; /* or sir_base */
 
-       IRDA_DEBUG(2, "%s(), -------- Start -------- ( Enable = %d )\n", __FUNCTION__ , enable);        
+       IRDA_DEBUG(2, "%s(), -------- Start -------- ( Enable = %d )\n", __func__ , enable);
        
        /* Enable the interrupt which we wish to */
        if (enable){
@@ -2205,14 +2205,14 @@ static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable)
        else
                outb(newMask, iobase+UART_IER);
                
-       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static void SIR2FIR(int iobase)
 {
        //unsigned char tmp;
                
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
        
        /* Already protected (change_speed() or setup()), no need to lock.
         * Jean II */
@@ -2228,14 +2228,14 @@ static void SIR2FIR(int iobase)
        //tmp |= 0x20;
        //outb(tmp, iobase+FIR_LCR_B);  
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );       
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 static void FIR2SIR(int iobase)
 {
        unsigned char val;
        
-       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
        
        /* Already protected (change_speed() or setup()), no need to lock.
         * Jean II */
@@ -2251,7 +2251,7 @@ static void FIR2SIR(int iobase)
        val = inb(iobase+UART_LSR);
        val = inb(iobase+UART_MSR);
        
-       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
+       IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ );
 }
 
 MODULE_AUTHOR("Benjamin Kong <benjamin_kong@ali.com.tw>");
index 34ad189fff67b092ed48fbd8ca6b33897cca9710..69d16b30323b8fca6ecb974c2e66967e115f15bc 100644 (file)
@@ -245,7 +245,7 @@ toshoboe_dumpregs (struct toshoboe_cb *self)
 {
   __u32 ringbase;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   ringbase = INB (OBOE_RING_BASE0) << 10;
   ringbase |= INB (OBOE_RING_BASE1) << 18;
@@ -293,7 +293,7 @@ static void
 toshoboe_disablebm (struct toshoboe_cb *self)
 {
   __u8 command;
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   pci_read_config_byte (self->pdev, PCI_COMMAND, &command);
   command &= ~PCI_COMMAND_MASTER;
@@ -305,7 +305,7 @@ toshoboe_disablebm (struct toshoboe_cb *self)
 static void
 toshoboe_stopchip (struct toshoboe_cb *self)
 {
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   /*Disable interrupts */
   OUTB (0x0, OBOE_IER);
@@ -350,7 +350,7 @@ toshoboe_setbaud (struct toshoboe_cb *self)
   __u16 pconfig = 0;
   __u8 config0l = 0;
 
-  IRDA_DEBUG (2, "%s(%d/%d)\n", __FUNCTION__, self->speed, self->io.speed);
+  IRDA_DEBUG (2, "%s(%d/%d)\n", __func__, self->speed, self->io.speed);
 
   switch (self->speed)
     {
@@ -482,7 +482,7 @@ toshoboe_setbaud (struct toshoboe_cb *self)
 static void
 toshoboe_enablebm (struct toshoboe_cb *self)
 {
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
   pci_set_master (self->pdev);
 }
 
@@ -492,7 +492,7 @@ toshoboe_initring (struct toshoboe_cb *self)
 {
   int i;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   for (i = 0; i < TX_SLOTS; ++i)
     {
@@ -550,7 +550,7 @@ toshoboe_startchip (struct toshoboe_cb *self)
 {
   __u32 physaddr;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   toshoboe_initring (self);
   toshoboe_enablebm (self);
@@ -824,7 +824,7 @@ toshoboe_probe (struct toshoboe_cb *self)
 #endif
   unsigned long flags;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   if (request_irq (self->io.irq, toshoboe_probeinterrupt,
                    self->io.irqflags, "toshoboe", (void *) self))
@@ -983,10 +983,10 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
 
   IRDA_ASSERT (self != NULL, return 0; );
 
-  IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __FUNCTION__
+  IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __func__
       ,skb->len,self->txpending,INB (OBOE_ENABLEH));
   if (!cb->magic) {
-      IRDA_DEBUG (2, "%s.Not IrLAP:%x\n", __FUNCTION__, cb->magic);
+      IRDA_DEBUG (2, "%s.Not IrLAP:%x\n", __func__, cb->magic);
 #ifdef DUMP_PACKETS
       _dumpbufs(skb->data,skb->len,'>');
 #endif
@@ -1015,7 +1015,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
         {
           self->new_speed = speed;
           IRDA_DEBUG (1, "%s: Queued TxDone scheduled speed change %d\n" ,
-                     __FUNCTION__, speed);
+                     __func__, speed);
           /* if no data, that's all! */
           if (!skb->len)
             {
@@ -1057,7 +1057,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
       /* which we will add a wrong checksum to */
 
       mtt = toshoboe_makemttpacket (self, self->tx_bufs[self->txs], mtt);
-      IRDA_DEBUG (1, "%s.mtt:%x(%x)%d\n", __FUNCTION__
+      IRDA_DEBUG (1, "%s.mtt:%x(%x)%d\n", __func__
           ,skb->len,mtt,self->txpending);
       if (mtt)
         {
@@ -1101,7 +1101,7 @@ dumpbufs(skb->data,skb->len,'>');
 
   if (self->ring->tx[self->txs].control & OBOE_CTL_TX_HW_OWNS)
     {
-      IRDA_DEBUG (0, "%s.ful:%x(%x)%x\n", __FUNCTION__
+      IRDA_DEBUG (0, "%s.ful:%x(%x)%x\n", __func__
           ,skb->len, self->ring->tx[self->txs].control, self->txpending);
       toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX);
       spin_unlock_irqrestore(&self->spinlock, flags);
@@ -1179,7 +1179,7 @@ toshoboe_interrupt (int irq, void *dev_id)
           if (self->ring->tx[i].control & OBOE_CTL_TX_HW_OWNS)
               self->txpending++;
         }
-      IRDA_DEBUG (1, "%s.txd(%x)%x/%x\n", __FUNCTION__
+      IRDA_DEBUG (1, "%s.txd(%x)%x/%x\n", __func__
           ,irqstat,txp,self->txpending);
 
       txp = INB (OBOE_TXSLOT) & OBOE_SLOT_MASK;
@@ -1209,7 +1209,7 @@ toshoboe_interrupt (int irq, void *dev_id)
         {
           self->speed = self->new_speed;
           IRDA_DEBUG (1, "%s: Executed TxDone scheduled speed change %d\n",
-                     __FUNCTION__, self->speed);
+                     __func__, self->speed);
           toshoboe_setbaud (self);
         }
 
@@ -1224,7 +1224,7 @@ toshoboe_interrupt (int irq, void *dev_id)
         {
           int len = self->ring->rx[self->rxs].len;
           skb = NULL;
-          IRDA_DEBUG (3, "%s.rcv:%x(%x)\n", __FUNCTION__
+          IRDA_DEBUG (3, "%s.rcv:%x(%x)\n", __func__
                      ,len,self->ring->rx[self->rxs].control);
 
 #ifdef DUMP_PACKETS
@@ -1246,7 +1246,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
                       len -= 2;
                   else
                       len = 0;
-                  IRDA_DEBUG (1, "%s.SIR:%x(%x)\n", __FUNCTION__, len,enable);
+                  IRDA_DEBUG (1, "%s.SIR:%x(%x)\n", __func__, len,enable);
                 }
 
 #ifdef USE_MIR
@@ -1256,7 +1256,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
                       len -= 2;
                   else
                       len = 0;
-                  IRDA_DEBUG (2, "%s.MIR:%x(%x)\n", __FUNCTION__, len,enable);
+                  IRDA_DEBUG (2, "%s.MIR:%x(%x)\n", __func__, len,enable);
                 }
 #endif
               else if (enable & OBOE_ENABLEH_FIRON)
@@ -1265,10 +1265,10 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
                       len -= 4;   /*FIXME: check this */
                   else
                       len = 0;
-                  IRDA_DEBUG (1, "%s.FIR:%x(%x)\n", __FUNCTION__, len,enable);
+                  IRDA_DEBUG (1, "%s.FIR:%x(%x)\n", __func__, len,enable);
                 }
               else
-                  IRDA_DEBUG (0, "%s.?IR:%x(%x)\n", __FUNCTION__, len,enable);
+                  IRDA_DEBUG (0, "%s.?IR:%x(%x)\n", __func__, len,enable);
 
               if (len)
                 {
@@ -1289,7 +1289,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
                     {
                       printk (KERN_INFO
                               "%s(), memory squeeze, dropping frame.\n",
-                             __FUNCTION__);
+                             __func__);
                     }
                 }
             }
@@ -1301,7 +1301,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
             /* (SIR) data is splitted in several slots. */
             /* we have to join all the received buffers received */
             /*in a large buffer before checking CRC. */
-            IRDA_DEBUG (0, "%s.err:%x(%x)\n", __FUNCTION__
+            IRDA_DEBUG (0, "%s.err:%x(%x)\n", __func__
                 ,len,self->ring->rx[self->rxs].control);
             }
 
@@ -1329,7 +1329,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
   if (irqstat & OBOE_INT_SIP)
     {
       self->int_sip++;
-      IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __FUNCTION__
+      IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __func__
              ,self->int_sip,irqstat,self->txpending);
     }
   return IRQ_HANDLED;
@@ -1343,7 +1343,7 @@ toshoboe_net_open (struct net_device *dev)
   unsigned long flags;
   int rc;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   self = netdev_priv(dev);
 
@@ -1381,7 +1381,7 @@ toshoboe_net_close (struct net_device *dev)
 {
   struct toshoboe_cb *self;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   IRDA_ASSERT (dev != NULL, return -1; );
   self = (struct toshoboe_cb *) dev->priv;
@@ -1426,7 +1426,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 
   IRDA_ASSERT (self != NULL, return -1; );
 
-  IRDA_DEBUG (5, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
+  IRDA_DEBUG (5, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
 
   /* Disable interrupts & save flags */
   spin_lock_irqsave(&self->spinlock, flags);
@@ -1438,7 +1438,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
        * speed, so we still must allow for speed change within
        * interrupt context.
        */
-      IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __FUNCTION__
+      IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __func__
           ,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate );
       if (!in_interrupt () && !capable (CAP_NET_ADMIN)) {
        ret = -EPERM;
@@ -1451,7 +1451,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
       self->new_speed = irq->ifr_baudrate;
       break;
     case SIOCSMEDIABUSY:       /* Set media busy */
-      IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __FUNCTION__
+      IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __func__
           ,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) );
       if (!capable (CAP_NET_ADMIN)) {
        ret = -EPERM;
@@ -1461,11 +1461,11 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
       break;
     case SIOCGRECEIVING:       /* Check if we are receiving right now */
       irq->ifr_receiving = (INB (OBOE_STATUS) & OBOE_STATUS_RXBUSY) ? 1 : 0;
-      IRDA_DEBUG (3, "%s(RECEIVING), %s, (%X/%x)\n", __FUNCTION__
+      IRDA_DEBUG (3, "%s(RECEIVING), %s, (%X/%x)\n", __func__
           ,dev->name, INB (OBOE_STATUS), irq->ifr_receiving );
       break;
     default:
-      IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
+      IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
       ret = -EOPNOTSUPP;
     }
 out:
@@ -1492,7 +1492,7 @@ toshoboe_close (struct pci_dev *pci_dev)
   int i;
   struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   IRDA_ASSERT (self != NULL, return; );
 
@@ -1533,7 +1533,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
   int ok = 0;
   int err;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   if ((err=pci_enable_device(pci_dev)))
     return err;
@@ -1700,7 +1700,7 @@ toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
   unsigned long flags;
   int i = 10;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   if (!self || self->stopped)
     return 0;
@@ -1728,7 +1728,7 @@ toshoboe_wakeup (struct pci_dev *pci_dev)
   struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
   unsigned long flags;
 
-  IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+  IRDA_DEBUG (4, "%s()\n", __func__);
 
   if (!self || !self->stopped)
     return 0;
index 738531b16bd327c72df5d0bde0a3458e6443b46d..a31b8fa8aaa991e3aa70e7d74223036600af84c6 100644 (file)
@@ -86,7 +86,7 @@ static int girbil_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power on dongle */
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
@@ -102,7 +102,7 @@ static int girbil_open(struct sir_dev *dev)
 
 static int girbil_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -126,7 +126,7 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
        u8 control[2];
        static int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* dongle alread reset - port and dongle at default speed */
 
@@ -179,7 +179,7 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
                break;
 
        default:
-               IRDA_ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s - undefined state %d\n", __func__, state);
                ret = -EINVAL;
                break;
        }
@@ -209,7 +209,7 @@ static int girbil_reset(struct sir_dev *dev)
        u8 control = GIRBIL_TXEN | GIRBIL_RXEN;
        int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        switch (state) {
        case SIRDEV_STATE_DONGLE_RESET:
@@ -241,7 +241,7 @@ static int girbil_reset(struct sir_dev *dev)
                break;
 
        default:
-               IRDA_ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s(), undefined state %d\n", __func__, state);
                ret = -1;
                break;
        }
index 18b471cd14471b4264eb33a6a53b340439e72a09..b5d6b9ac162ae813ca4f74955c32187f31fa6053 100644 (file)
@@ -177,12 +177,12 @@ static void irda_usb_build_header(struct irda_usb_cb *self,
                    (!force) && (self->speed != -1)) {
                        /* No speed and xbofs change here
                         * (we'll do it later in the write callback) */
-                       IRDA_DEBUG(2, "%s(), not changing speed yet\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), not changing speed yet\n", __func__);
                        *header = 0;
                        return;
                }
 
-               IRDA_DEBUG(2, "%s(), changing speed to %d\n", __FUNCTION__, self->new_speed);
+               IRDA_DEBUG(2, "%s(), changing speed to %d\n", __func__, self->new_speed);
                self->speed = self->new_speed;
                /* We will do ` self->new_speed = -1; ' in the completion
                 * handler just in case the current URB fail - Jean II */
@@ -228,7 +228,7 @@ static void irda_usb_build_header(struct irda_usb_cb *self,
        
        /* Set the negotiated additional XBOFS */
        if (self->new_xbofs != -1) {
-               IRDA_DEBUG(2, "%s(), changing xbofs to %d\n", __FUNCTION__, self->new_xbofs);
+               IRDA_DEBUG(2, "%s(), changing xbofs to %d\n", __func__, self->new_xbofs);
                self->xbofs = self->new_xbofs;
                /* We will do ` self->new_xbofs = -1; ' in the completion
                 * handler just in case the current URB fail - Jean II */
@@ -302,13 +302,13 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
        struct urb *urb;
        int ret;
 
-       IRDA_DEBUG(2, "%s(), speed=%d, xbofs=%d\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), speed=%d, xbofs=%d\n", __func__,
                   self->new_speed, self->new_xbofs);
 
        /* Grab the speed URB */
        urb = self->speed_urb;
        if (urb->status != 0) {
-               IRDA_WARNING("%s(), URB still in use!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), URB still in use!\n", __func__);
                return;
        }
 
@@ -334,7 +334,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
 
        /* Irq disabled -> GFP_ATOMIC */
        if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
-               IRDA_WARNING("%s(), failed Speed URB\n", __FUNCTION__);
+               IRDA_WARNING("%s(), failed Speed URB\n", __func__);
        }
 }
 
@@ -347,7 +347,7 @@ static void speed_bulk_callback(struct urb *urb)
 {
        struct irda_usb_cb *self = urb->context;
        
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* We should always have a context */
        IRDA_ASSERT(self != NULL, return;);
@@ -357,7 +357,7 @@ static void speed_bulk_callback(struct urb *urb)
        /* Check for timeout and other USB nasties */
        if (urb->status != 0) {
                /* I get a lot of -ECONNABORTED = -103 here - Jean II */
-               IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __FUNCTION__, urb->status, urb->transfer_flags);
+               IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags);
 
                /* Don't do anything here, that might confuse the USB layer.
                 * Instead, we will wait for irda_usb_net_timeout(), the
@@ -392,7 +392,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
        int res, mtt;
        int     err = 1;        /* Failed */
 
-       IRDA_DEBUG(4, "%s() on %s\n", __FUNCTION__, netdev->name);
+       IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name);
 
        netif_stop_queue(netdev);
 
@@ -403,7 +403,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
         * We need to check self->present under the spinlock because
         * of irda_usb_disconnect() is synchronous - Jean II */
        if (!self->present) {
-               IRDA_DEBUG(0, "%s(), Device is gone...\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), Device is gone...\n", __func__);
                goto drop;
        }
 
@@ -437,7 +437,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
        }
 
        if (urb->status != 0) {
-               IRDA_WARNING("%s(), URB still in use!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), URB still in use!\n", __func__);
                goto drop;
        }
 
@@ -524,7 +524,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
        
        /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */
        if ((res = usb_submit_urb(urb, GFP_ATOMIC))) {
-               IRDA_WARNING("%s(), failed Tx URB\n", __FUNCTION__);
+               IRDA_WARNING("%s(), failed Tx URB\n", __func__);
                self->stats.tx_errors++;
                /* Let USB recover : We will catch that in the watchdog */
                /*netif_start_queue(netdev);*/
@@ -556,7 +556,7 @@ static void write_bulk_callback(struct urb *urb)
        struct sk_buff *skb = urb->context;
        struct irda_usb_cb *self = ((struct irda_skb_cb *) skb->cb)->context;
        
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* We should always have a context */
        IRDA_ASSERT(self != NULL, return;);
@@ -570,7 +570,7 @@ static void write_bulk_callback(struct urb *urb)
        /* Check for timeout and other USB nasties */
        if (urb->status != 0) {
                /* I get a lot of -ECONNABORTED = -103 here - Jean II */
-               IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __FUNCTION__, urb->status, urb->transfer_flags);
+               IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags);
 
                /* Don't do anything here, that might confuse the USB layer,
                 * and we could go in recursion and blow the kernel stack...
@@ -589,7 +589,7 @@ static void write_bulk_callback(struct urb *urb)
 
        /* If the network is closed, stop everything */
        if ((!self->netopen) || (!self->present)) {
-               IRDA_DEBUG(0, "%s(), Network is gone...\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), Network is gone...\n", __func__);
                spin_unlock_irqrestore(&self->lock, flags);
                return;
        }
@@ -600,7 +600,7 @@ static void write_bulk_callback(struct urb *urb)
                    (self->new_xbofs != self->xbofs)) {
                        /* We haven't changed speed yet (because of
                         * IUC_SPEED_BUG), so do it now - Jean II */
-                       IRDA_DEBUG(1, "%s(), Changing speed now...\n", __FUNCTION__);
+                       IRDA_DEBUG(1, "%s(), Changing speed now...\n", __func__);
                        irda_usb_change_speed_xbofs(self);
                } else {
                        /* New speed and xbof is now commited in hardware */
@@ -632,7 +632,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
        struct urb *urb;
        int     done = 0;       /* If we have made any progress */
 
-       IRDA_DEBUG(0, "%s(), Network layer thinks we timed out!\n", __FUNCTION__);
+       IRDA_DEBUG(0, "%s(), Network layer thinks we timed out!\n", __func__);
        IRDA_ASSERT(self != NULL, return;);
 
        /* Protect us from USB callbacks, net Tx and else. */
@@ -640,7 +640,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
 
        /* self->present *MUST* be read under spinlock */
        if (!self->present) {
-               IRDA_WARNING("%s(), device not present!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), device not present!\n", __func__);
                netif_stop_queue(netdev);
                spin_unlock_irqrestore(&self->lock, flags);
                return;
@@ -763,7 +763,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
        struct irda_skb_cb *cb;
        int ret;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* This should never happen */
        IRDA_ASSERT(skb != NULL, return;);
@@ -786,7 +786,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
                /* If this ever happen, we are in deep s***.
                 * Basically, the Rx path will stop... */
                IRDA_WARNING("%s(), Failed to submit Rx URB %d\n",
-                            __FUNCTION__, ret);
+                            __func__, ret);
        }
 }
 
@@ -807,7 +807,7 @@ static void irda_usb_receive(struct urb *urb)
        struct urb *next_urb;
        unsigned int len, docopy;
 
-       IRDA_DEBUG(2, "%s(), len=%d\n", __FUNCTION__, urb->actual_length);
+       IRDA_DEBUG(2, "%s(), len=%d\n", __func__, urb->actual_length);
        
        /* Find ourselves */
        cb = (struct irda_skb_cb *) skb->cb;
@@ -817,7 +817,7 @@ static void irda_usb_receive(struct urb *urb)
 
        /* If the network is closed or the device gone, stop everything */
        if ((!self->netopen) || (!self->present)) {
-               IRDA_DEBUG(0, "%s(), Network is gone!\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), Network is gone!\n", __func__);
                /* Don't re-submit the URB : will stall the Rx path */
                return;
        }
@@ -840,7 +840,7 @@ static void irda_usb_receive(struct urb *urb)
                        /* Usually precursor to a hot-unplug on OHCI. */
                default:
                        self->stats.rx_errors++;
-                       IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __FUNCTION__, urb->status, urb->transfer_flags);
+                       IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __func__, urb->status, urb->transfer_flags);
                        break;
                }
                /* If we received an error, we don't want to resubmit the
@@ -861,7 +861,7 @@ static void irda_usb_receive(struct urb *urb)
        
        /* Check for empty frames */
        if (urb->actual_length <= self->header_length) {
-               IRDA_WARNING("%s(), empty frame!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), empty frame!\n", __func__);
                goto done;
        }
 
@@ -967,7 +967,7 @@ static void irda_usb_rx_defer_expired(unsigned long data)
        struct irda_skb_cb *cb;
        struct urb *next_urb;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Find ourselves */
        cb = (struct irda_skb_cb *) skb->cb;
@@ -1053,7 +1053,7 @@ static int stir421x_fw_upload(struct irda_usb_cb *self,
                                   patch_block, block_size,
                                   &actual_len, msecs_to_jiffies(500));
                IRDA_DEBUG(3,"%s(): Bulk send %u bytes, ret=%d\n",
-                          __FUNCTION__, actual_len, ret);
+                          __func__, actual_len, ret);
 
                if (ret < 0)
                        break;
@@ -1092,7 +1092,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
 
         /* We get a patch from userspace */
         IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n",
-                     __FUNCTION__, stir421x_fw_name, fw->size);
+                     __func__, stir421x_fw_name, fw->size);
 
         ret = -EINVAL;
 
@@ -1116,7 +1116,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
                                + (build % 10);
 
                        IRDA_DEBUG(3, "%s(): Firmware Product version %ld\n",
-                                   __FUNCTION__, fw_version);
+                                   __func__, fw_version);
                 }
         }
 
@@ -1172,7 +1172,7 @@ static int irda_usb_net_open(struct net_device *netdev)
        char    hwname[16];
        int i;
        
-       IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s()\n", __func__);
 
        IRDA_ASSERT(netdev != NULL, return -1;);
        self = (struct irda_usb_cb *) netdev->priv;
@@ -1182,13 +1182,13 @@ static int irda_usb_net_open(struct net_device *netdev)
        /* Can only open the device if it's there */
        if(!self->present) {
                spin_unlock_irqrestore(&self->lock, flags);
-               IRDA_WARNING("%s(), device not present!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), device not present!\n", __func__);
                return -1;
        }
 
        if(self->needspatch) {
                spin_unlock_irqrestore(&self->lock, flags);
-               IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ;
+               IRDA_WARNING("%s(), device needs patch\n", __func__) ;
                return -EIO ;
        }
 
@@ -1231,7 +1231,7 @@ static int irda_usb_net_open(struct net_device *netdev)
                        /* If this ever happen, we are in deep s***.
                         * Basically, we can't start the Rx path... */
                        IRDA_WARNING("%s(), Failed to allocate Rx skb\n",
-                                    __FUNCTION__);
+                                    __func__);
                        return -1;
                }
                //skb_reserve(newskb, USB_IRDA_HEADER - 1);
@@ -1254,7 +1254,7 @@ static int irda_usb_net_close(struct net_device *netdev)
        struct irda_usb_cb *self;
        int     i;
 
-       IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s()\n", __func__);
 
        IRDA_ASSERT(netdev != NULL, return -1;);
        self = (struct irda_usb_cb *) netdev->priv;
@@ -1309,7 +1309,7 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        self = dev->priv;
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
+       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
 
        switch (cmd) {
        case SIOCSBANDWIDTH: /* Set bandwidth */
@@ -1367,7 +1367,7 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self)
 {
        struct irda_class_desc *desc;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
        
        desc = self->irda_desc;
        
@@ -1384,7 +1384,7 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self)
        self->qos.data_size.bits       = desc->bmDataSize;
 
        IRDA_DEBUG(0, "%s(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n", 
-               __FUNCTION__, self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits);
+               __func__, self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits);
 
        /* Don't always trust what the dongle tell us */
        if(self->capability & IUC_SIR_ONLY)
@@ -1419,7 +1419,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
 {
        struct net_device *netdev = self->netdev;
 
-       IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s()\n", __func__);
 
        irda_usb_init_qos(self);
 
@@ -1442,7 +1442,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
  */
 static inline void irda_usb_close(struct irda_usb_cb *self)
 {
-       IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s()\n", __func__);
 
        /* Remove netdevice */
        unregister_netdev(self->netdev);
@@ -1515,13 +1515,13 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_
                                /* This is our interrupt endpoint */
                                self->bulk_int_ep = ep;
                        } else {
-                               IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __FUNCTION__, ep);
+                               IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep);
                        }
                }
        }
 
        IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n",
-               __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep);
+               __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep);
 
        return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0));
 }
@@ -1583,7 +1583,7 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
                0, intf->altsetting->desc.bInterfaceNumber, desc,
                sizeof(*desc), 500);
        
-       IRDA_DEBUG(1, "%s(), ret=%d\n", __FUNCTION__, ret);
+       IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret);
        if (ret < sizeof(*desc)) {
                IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n",
                             (ret<0) ? "failed" : "too short", ret);
@@ -1696,10 +1696,10 @@ static int irda_usb_probe(struct usb_interface *intf,
                        /* Martin Diehl says if we get a -EPIPE we should
                         * be fine and we don't need to do a usb_clear_halt().
                         * - Jean II */
-                       IRDA_DEBUG(0, "%s(), Received -EPIPE, ignoring...\n", __FUNCTION__);
+                       IRDA_DEBUG(0, "%s(), Received -EPIPE, ignoring...\n", __func__);
                        break;
                default:
-                       IRDA_DEBUG(0, "%s(), Unknown error %d\n", __FUNCTION__, ret);
+                       IRDA_DEBUG(0, "%s(), Unknown error %d\n", __func__, ret);
                        ret = -EIO;
                        goto err_out_3;
        }
@@ -1708,7 +1708,7 @@ static int irda_usb_probe(struct usb_interface *intf,
        interface = intf->cur_altsetting;
        if(!irda_usb_parse_endpoints(self, interface->endpoint,
                                     interface->desc.bNumEndpoints)) {
-               IRDA_ERROR("%s(), Bogus endpoints...\n", __FUNCTION__);
+               IRDA_ERROR("%s(), Bogus endpoints...\n", __func__);
                ret = -EIO;
                goto err_out_3;
        }
@@ -1815,7 +1815,7 @@ static void irda_usb_disconnect(struct usb_interface *intf)
        struct irda_usb_cb *self = usb_get_intfdata(intf);
        int i;
 
-       IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s()\n", __func__);
 
        usb_set_intfdata(intf, NULL);
        if (!self)
@@ -1865,7 +1865,7 @@ static void irda_usb_disconnect(struct usb_interface *intf)
 
        /* Free self and network device */
        free_netdev(self->netdev);
-       IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __FUNCTION__);
+       IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __func__);
 }
 
 /*------------------------------------------------------------------*/
index 9e33196f945975cfd75d2372940119da46ebb612..6bcee01c684cd4bb3aea00abb6e2dd00ff0e8d3b 100644 (file)
@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
 
        dev = priv->dev;
        if (!dev) {
-               IRDA_WARNING("%s(), not ready yet!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), not ready yet!\n", __func__);
                return;
        }
 
@@ -388,7 +388,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
        IRDA_ASSERT(priv != NULL, return -ENODEV;);
        IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EBADR;);
 
-       IRDA_DEBUG(3, "%s(cmd=0x%X)\n", __FUNCTION__, cmd);
+       IRDA_DEBUG(3, "%s(cmd=0x%X)\n", __func__, cmd);
 
        dev = priv->dev;
        IRDA_ASSERT(dev != NULL, return -1;);
@@ -476,7 +476,7 @@ static int irtty_open(struct tty_struct *tty)
 
        mutex_unlock(&irtty_mutex);
 
-       IRDA_DEBUG(0, "%s - %s: irda line discipline opened\n", __FUNCTION__, tty->name);
+       IRDA_DEBUG(0, "%s - %s: irda line discipline opened\n", __func__, tty->name);
 
        return 0;
 
@@ -528,7 +528,7 @@ static void irtty_close(struct tty_struct *tty)
 
        kfree(priv);
 
-       IRDA_DEBUG(0, "%s - %s: irda line discipline closed\n", __FUNCTION__, tty->name);
+       IRDA_DEBUG(0, "%s - %s: irda line discipline closed\n", __func__, tty->name);
 }
 
 /* ------------------------------------------------------- */
@@ -566,7 +566,7 @@ static void __exit irtty_sir_cleanup(void)
 
        if ((err = tty_unregister_ldisc(N_IRDA))) {
                IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n",
-                          __FUNCTION__, err);
+                          __func__, err);
        }
 }
 
index 648e54b3f00e97411fb04e2d46e1574e80602270..73fe83be34feac9da3b409bdad73076b8bbb0f3c 100644 (file)
@@ -243,7 +243,7 @@ static void kingsun_rcv_irq(struct urb *urb)
                }
        } else if (urb->actual_length > 0) {
                err("%s(): Unexpected response length, expected %d got %d",
-                   __FUNCTION__, kingsun->max_rx, urb->actual_length);
+                   __func__, kingsun->max_rx, urb->actual_length);
        }
        /* This urb has already been filled in kingsun_net_open */
        ret = usb_submit_urb(urb, GFP_ATOMIC);
index 73261c54bbfd31522ccfb6df5bf17dc6d6acb457..d6d9d2e5ad492306eb695692e8b40fe78010331d 100644 (file)
@@ -78,7 +78,7 @@ static int litelink_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power up dongle */
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
@@ -95,7 +95,7 @@ static int litelink_open(struct sir_dev *dev)
 
 static int litelink_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -113,7 +113,7 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed)
 {
         int i;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* dongle already reset by irda-thread - current speed (dongle and
         * port) is the default speed (115200 for litelink!)
@@ -156,7 +156,7 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed)
  */
 static int litelink_reset(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* probably the power-up can be dropped here, but with only
         * 15 usec delay it's not worth the risk unless somebody with
index 809906d94762ba2d11c1e0e855768cab1a515901..1ceed9cfb7c4fc5ba7af1ad41a847e71f24a44f3 100644 (file)
@@ -67,13 +67,13 @@ static struct dongle_driver ma600 = {
 
 static int __init ma600_sir_init(void)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
        return irda_register_dongle(&ma600);
 }
 
 static void __exit ma600_sir_cleanup(void)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
        irda_unregister_dongle(&ma600);
 }
 
@@ -88,7 +88,7 @@ static int ma600_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
 
@@ -106,7 +106,7 @@ static int ma600_open(struct sir_dev *dev)
 
 static int ma600_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -176,7 +176,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
 {
        u8      byte;
        
-       IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __func__,
                speed, dev->speed);
 
        /* dongle already reset, dongle and port at default speed (9600) */
@@ -201,12 +201,12 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
        sirdev_raw_read(dev, &byte, sizeof(byte));
        if (byte != get_control_byte(speed))  {
                IRDA_WARNING("%s(): bad control byte read-back %02x != %02x\n",
-                            __FUNCTION__, (unsigned) byte,
+                            __func__, (unsigned) byte,
                             (unsigned) get_control_byte(speed));
                return -1;
        }
        else
-               IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
+               IRDA_DEBUG(2, "%s() control byte write read OK\n", __func__);
 #endif
 
        /* Set DTR, Set RTS */
@@ -238,7 +238,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
 
 int ma600_reset(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Reset the dongle : set DTR low for 10 ms */
        sirdev_set_dtr_rts(dev, FALSE, TRUE);
index 67bd016e4df89ebb4b040c71e045323c5527c0a2..5e2f4859cee77f3febdefc03bad41dd9e70c57f4 100644 (file)
@@ -63,7 +63,7 @@ static int mcp2120_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* seems no explicit power-on required here and reset switching it on anyway */
 
@@ -76,7 +76,7 @@ static int mcp2120_open(struct sir_dev *dev)
 
 static int mcp2120_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
         /* reset and inhibit mcp2120 */
@@ -102,7 +102,7 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)
        u8 control[2];
        static int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        switch (state) {
        case SIRDEV_STATE_DONGLE_SPEED:
@@ -155,7 +155,7 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)
                break;
 
        default:
-               IRDA_ERROR("%s(), undefine state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s(), undefine state %d\n", __func__, state);
                ret = -EINVAL;
                break;
        }
@@ -187,7 +187,7 @@ static int mcp2120_reset(struct sir_dev *dev)
        unsigned delay = 0;
        int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        switch (state) {
        case SIRDEV_STATE_DONGLE_RESET:
@@ -213,7 +213,7 @@ static int mcp2120_reset(struct sir_dev *dev)
                break;
 
        default:
-               IRDA_ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s(), undefined state %d\n", __func__, state);
                ret = -EINVAL;
                break;
        }
index effc1ce8179a9feed4f1fa42da4a90f4b6a1a244..8583d951a6ad15529fb4c8ec2169865582e5aa6f 100644 (file)
@@ -151,8 +151,8 @@ static char *dongle_types[] = {
 static chipio_t pnp_info;
 static const struct pnp_device_id nsc_ircc_pnp_table[] = {
        { .id = "NSC6001", .driver_data = 0 },
-       { .id = "IBM0071", .driver_data = 0 },
        { .id = "HWPC224", .driver_data = 0 },
+       { .id = "IBM0071", .driver_data = NSC_FORCE_DONGLE_TYPE9 },
        { }
 };
 
@@ -223,7 +223,7 @@ static int __init nsc_ircc_init(void)
 
        /* Probe for all the NSC chipsets we know about */
        for (chip = chips; chip->name ; chip++) {
-               IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __FUNCTION__,
+               IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __func__,
                           chip->name);
                
                /* Try all config registers for this chip */
@@ -235,7 +235,7 @@ static int __init nsc_ircc_init(void)
                        /* Read index register */
                        reg = inb(cfg_base);
                        if (reg == 0xff) {
-                               IRDA_DEBUG(2, "%s() no chip at 0x%03x\n", __FUNCTION__, cfg_base);
+                               IRDA_DEBUG(2, "%s() no chip at 0x%03x\n", __func__, cfg_base);
                                continue;
                        }
                        
@@ -244,7 +244,7 @@ static int __init nsc_ircc_init(void)
                        id = inb(cfg_base+1);
                        if ((id & chip->cid_mask) == chip->cid_value) {
                                IRDA_DEBUG(2, "%s() Found %s chip, revision=%d\n",
-                                          __FUNCTION__, chip->name, id & ~chip->cid_mask);
+                                          __func__, chip->name, id & ~chip->cid_mask);
 
                                /*
                                 * If we found a correct PnP setting,
@@ -295,7 +295,7 @@ static int __init nsc_ircc_init(void)
                                }
                                i++;
                        } else {
-                               IRDA_DEBUG(2, "%s(), Wrong chip id=0x%02x\n", __FUNCTION__, id);
+                               IRDA_DEBUG(2, "%s(), Wrong chip id=0x%02x\n", __func__, id);
                        }
                } 
        }
@@ -345,7 +345,7 @@ static int __init nsc_ircc_open(chipio_t *info)
        void *ret;
        int err, chip_index;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
 
        for (chip_index = 0; chip_index < ARRAY_SIZE(dev_self); chip_index++) {
@@ -354,7 +354,7 @@ static int __init nsc_ircc_open(chipio_t *info)
        }
 
        if (chip_index == ARRAY_SIZE(dev_self)) {
-               IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __func__);
                return -ENOMEM;
        }
 
@@ -369,7 +369,7 @@ static int __init nsc_ircc_open(chipio_t *info)
        dev = alloc_irdadev(sizeof(struct nsc_ircc_cb));
        if (dev == NULL) {
                IRDA_ERROR("%s(), can't allocate memory for "
-                          "control block!\n", __FUNCTION__);
+                          "control block!\n", __func__);
                return -ENOMEM;
        }
 
@@ -393,7 +393,7 @@ static int __init nsc_ircc_open(chipio_t *info)
        ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name);
        if (!ret) {
                IRDA_WARNING("%s(), can't get iobase of 0x%03x\n",
-                            __FUNCTION__, self->io.fir_base);
+                            __func__, self->io.fir_base);
                err = -ENODEV;
                goto out1;
        }
@@ -450,7 +450,7 @@ static int __init nsc_ircc_open(chipio_t *info)
 
        err = register_netdev(dev);
        if (err) {
-               IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
                goto out4;
        }
        IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);
@@ -506,7 +506,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
 {
        int iobase;
 
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s()\n", __func__);
 
        IRDA_ASSERT(self != NULL, return -1;);
 
@@ -519,7 +519,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
 
        /* Release the PORT that this driver is using */
        IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", 
-                  __FUNCTION__, self->io.fir_base);
+                  __func__, self->io.fir_base);
        release_region(self->io.fir_base, self->io.fir_ext);
 
        if (self->tx_buff.head)
@@ -557,7 +557,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
        case 0x2e8: outb(0x15, cfg_base+1); break;
        case 0x3f8: outb(0x16, cfg_base+1); break;
        case 0x2f8: outb(0x17, cfg_base+1); break;
-       default: IRDA_ERROR("%s(), invalid base_address", __FUNCTION__);
+       default: IRDA_ERROR("%s(), invalid base_address", __func__);
        }
        
        /* Control Signal Routing Register (CSRT) */
@@ -569,7 +569,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
        case 9:  temp = 0x05; break;
        case 11: temp = 0x06; break;
        case 15: temp = 0x07; break;
-       default: IRDA_ERROR("%s(), invalid irq", __FUNCTION__);
+       default: IRDA_ERROR("%s(), invalid irq", __func__);
        }
        outb(CFG_108_CSRT, cfg_base);
        
@@ -577,7 +577,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
        case 0: outb(0x08+temp, cfg_base+1); break;
        case 1: outb(0x10+temp, cfg_base+1); break;
        case 3: outb(0x18+temp, cfg_base+1); break;
-       default: IRDA_ERROR("%s(), invalid dma", __FUNCTION__);
+       default: IRDA_ERROR("%s(), invalid dma", __func__);
        }
        
        outb(CFG_108_MCTL, cfg_base);      /* Mode Control Register (MCTL) */
@@ -616,7 +616,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info)
                break;
        }
        info->sir_base = info->fir_base;
-       IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __func__,
                   info->fir_base);
 
        /* Read control signals routing register (CSRT) */
@@ -649,7 +649,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info)
                info->irq = 15;
                break;
        }
-       IRDA_DEBUG(2, "%s(), probing irq=%d\n", __FUNCTION__, info->irq);
+       IRDA_DEBUG(2, "%s(), probing irq=%d\n", __func__, info->irq);
 
        /* Currently we only read Rx DMA but it will also be used for Tx */
        switch ((reg >> 3) & 0x03) {
@@ -666,7 +666,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info)
                info->dma = 3;
                break;
        }
-       IRDA_DEBUG(2, "%s(), probing dma=%d\n", __FUNCTION__, info->dma);
+       IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma);
 
        /* Read mode control register (MCTL) */
        outb(CFG_108_MCTL, cfg_base);
@@ -823,7 +823,7 @@ static int nsc_ircc_init_39x(nsc_chip_t *chip, chipio_t *info)
        /* User is sure about his config... accept it. */
        IRDA_DEBUG(2, "%s(): nsc_ircc_init_39x (user settings): "
                   "io=0x%04x, irq=%d, dma=%d\n", 
-                  __FUNCTION__, info->fir_base, info->irq, info->dma);
+                  __func__, info->fir_base, info->irq, info->dma);
 
        /* Access bank for SP2 */
        outb(CFG_39X_LDN, cfg_base);
@@ -864,7 +864,7 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info)
        int enabled, susp;
 
        IRDA_DEBUG(2, "%s(), nsc_ircc_probe_39x, base=%d\n",
-                  __FUNCTION__, cfg_base);
+                  __func__, cfg_base);
 
        /* This function should be executed with irq off to avoid
         * another driver messing with the Super I/O bank - Jean II */
@@ -898,7 +898,7 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info)
        outb(CFG_39X_SPC, cfg_base);
        susp = 1 - ((inb(cfg_base+1) & 0x02) >> 1);
 
-       IRDA_DEBUG(2, "%s(): io=0x%02x%02x, irq=%d (type %d), rxdma=%d, txdma=%d, enabled=%d (suspended=%d)\n", __FUNCTION__, reg1,reg2,irq,irqt,dma1,dma2,enabled,susp);
+       IRDA_DEBUG(2, "%s(): io=0x%02x%02x, irq=%d (type %d), rxdma=%d, txdma=%d, enabled=%d (suspended=%d)\n", __func__, reg1,reg2,irq,irqt,dma1,dma2,enabled,susp);
 
        /* Configure SP2 */
 
@@ -930,7 +930,10 @@ static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *i
        pnp_info.dma = -1;
        pnp_succeeded = 1;
 
-       /* There don't seem to be any way to get the cfg_base.
+       if (id->driver_data & NSC_FORCE_DONGLE_TYPE9)
+               dongle_id = 0x9;
+
+       /* There doesn't seem to be any way of getting the cfg_base.
         * On my box, cfg_base is in the PnP descriptor of the
         * motherboard. Oh well... Jean II */
 
@@ -947,7 +950,7 @@ static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *i
                pnp_info.dma = pnp_dma(dev, 0);
 
        IRDA_DEBUG(0, "%s() : From PnP, found firbase 0x%03X ; irq %d ; dma %d.\n",
-                  __FUNCTION__, pnp_info.fir_base, pnp_info.irq, pnp_info.dma);
+                  __func__, pnp_info.fir_base, pnp_info.irq, pnp_info.dma);
 
        if((pnp_info.fir_base == 0) ||
           (pnp_info.irq == -1) || (pnp_info.dma == -1)) {
@@ -976,7 +979,7 @@ static int nsc_ircc_setup(chipio_t *info)
        version = inb(iobase+MID);
 
        IRDA_DEBUG(2, "%s() Driver %s Found chip version %02x\n",
-                  __FUNCTION__, driver_name, version);
+                  __func__, driver_name, version);
 
        /* Should be 0x2? */
        if (0x20 != (version & 0xf0)) {
@@ -1080,30 +1083,30 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id)
        case 0x00: /* same as */
        case 0x01: /* Differential serial interface */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x02: /* same as */
        case 0x03: /* Reserved */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x04: /* Sharp RY5HD01 */
                break;
        case 0x05: /* Reserved, but this is what the Thinkpad reports */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x06: /* Single-ended serial interface */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x07: /* Consumer-IR only */
                IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */
                IRDA_DEBUG(0, "%s(), %s\n",
-                          __FUNCTION__, dongle_types[dongle_id]);
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x09: /* IBM31T1100 or Temic TFDS6000/TFDS6500 */
                outb(0x28, iobase+7); /* Set irsl[0-2] as output */
@@ -1111,7 +1114,7 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id)
        case 0x0A: /* same as */
        case 0x0B: /* Reserved */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x0C: /* same as */
        case 0x0D: /* HP HSDL-1100/HSDL-2100 */
@@ -1126,14 +1129,14 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id)
                break;
        case 0x0F: /* No dongle connected */
                IRDA_DEBUG(0, "%s(), %s\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
 
                switch_bank(iobase, BANK0);
                outb(0x62, iobase+MCR);
                break;
        default: 
                IRDA_DEBUG(0, "%s(), invalid dongle_id %#x", 
-                          __FUNCTION__, dongle_id);
+                          __func__, dongle_id);
        }
        
        /* IRCFG1: IRSL1 and 2 are set to IrDA mode */
@@ -1165,30 +1168,30 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
        case 0x00: /* same as */
        case 0x01: /* Differential serial interface */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x02: /* same as */
        case 0x03: /* Reserved */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x04: /* Sharp RY5HD01 */
                break;
        case 0x05: /* Reserved */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x06: /* Single-ended serial interface */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x07: /* Consumer-IR only */
                IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */
                IRDA_DEBUG(0, "%s(), %s\n", 
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                outb(0x00, iobase+4);
                if (speed > 115200)
                        outb(0x01, iobase+4);
@@ -1207,7 +1210,7 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
        case 0x0A: /* same as */
        case 0x0B: /* Reserved */
                IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n",
-                          __FUNCTION__, dongle_types[dongle_id]); 
+                          __func__, dongle_types[dongle_id]);
                break;
        case 0x0C: /* same as */
        case 0x0D: /* HP HSDL-1100/HSDL-2100 */
@@ -1216,13 +1219,13 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
                break;
        case 0x0F: /* No dongle connected */
                IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n",
-                          __FUNCTION__, dongle_types[dongle_id]);
+                          __func__, dongle_types[dongle_id]);
 
                switch_bank(iobase, BANK0); 
                outb(0x62, iobase+MCR);
                break;
        default: 
-               IRDA_DEBUG(0, "%s(), invalid data_rate\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), invalid data_rate\n", __func__);
        }
        /* Restore bank register */
        outb(bank, iobase+BSR);
@@ -1243,7 +1246,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
        __u8 bank;
        __u8 ier;                  /* Interrupt enable register */
 
-       IRDA_DEBUG(2, "%s(), speed=%d\n", __FUNCTION__, speed);
+       IRDA_DEBUG(2, "%s(), speed=%d\n", __func__, speed);
 
        IRDA_ASSERT(self != NULL, return 0;);
 
@@ -1276,20 +1279,20 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
                outb(inb(iobase+4) | 0x04, iobase+4);
               
                mcr = MCR_MIR;
-               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__);
                break;
        case 1152000:
                mcr = MCR_MIR;
-               IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __func__);
                break;
        case 4000000:
                mcr = MCR_FIR;
-               IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __func__);
                break;
        default:
                mcr = MCR_FIR;
                IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", 
-                          __FUNCTION__, speed);
+                          __func__, speed);
                break;
        }
 
@@ -1594,7 +1597,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        int actual = 0;
        __u8 bank;
        
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s()\n", __func__);
 
        /* Save current bank */
        bank = inb(iobase+BSR);
@@ -1602,7 +1605,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        switch_bank(iobase, BANK0);
        if (!(inb_p(iobase+LSR) & LSR_TXEMP)) {
                IRDA_DEBUG(4, "%s(), warning, FIFO not empty yet!\n",
-                          __FUNCTION__);
+                          __func__);
 
                /* FIFO may still be filled to the Tx interrupt threshold */
                fifo_size -= 17;
@@ -1615,7 +1618,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        }
         
        IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", 
-                  __FUNCTION__, fifo_size, actual, len);
+                  __func__, fifo_size, actual, len);
        
        /* Restore bank */
        outb(bank, iobase+BSR);
@@ -1636,7 +1639,7 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self)
        __u8 bank;
        int ret = TRUE;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        iobase = self->io.fir_base;
 
@@ -1767,7 +1770,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
                len = inb(iobase+RFLFL) | ((inb(iobase+RFLFH) & 0x1f) << 8);
 
                if (st_fifo->tail >= MAX_RX_WINDOW) {
-                       IRDA_DEBUG(0, "%s(), window is full!\n", __FUNCTION__);
+                       IRDA_DEBUG(0, "%s(), window is full!\n", __func__);
                        continue;
                }
                        
@@ -1859,7 +1862,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
                        if (skb == NULL)  {
                                IRDA_WARNING("%s(), memory squeeze, "
                                             "dropping frame.\n",
-                                            __FUNCTION__);
+                                            __func__);
                                self->stats.rx_dropped++;
 
                                /* Restore bank register */
@@ -1965,7 +1968,7 @@ static void nsc_ircc_sir_interrupt(struct nsc_ircc_cb *self, int eir)
                 * Need to be after self->io.direction to avoid race with
                 * nsc_ircc_hard_xmit_sir() - Jean II */
                if (self->new_speed) {
-                       IRDA_DEBUG(2, "%s(), Changing speed!\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), Changing speed!\n", __func__);
                        self->ier = nsc_ircc_change_speed(self,
                                                          self->new_speed);
                        self->new_speed = 0;
@@ -2051,7 +2054,7 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
                                } else
                                        IRDA_WARNING("%s(), potential "
                                                     "Tx queue lockup !\n",
-                                                    __FUNCTION__);
+                                                    __func__);
                        }
                } else {
                        /*  Not finished yet, so interrupt on DMA again */
@@ -2160,7 +2163,7 @@ static int nsc_ircc_net_open(struct net_device *dev)
        char hwname[32];
        __u8 bank;
        
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s()\n", __func__);
        
        IRDA_ASSERT(dev != NULL, return -1;);
        self = (struct nsc_ircc_cb *) dev->priv;
@@ -2222,7 +2225,7 @@ static int nsc_ircc_net_close(struct net_device *dev)
        int iobase;
        __u8 bank;
 
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s()\n", __func__);
        
        IRDA_ASSERT(dev != NULL, return -1;);
 
@@ -2276,7 +2279,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
+       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
        
        switch (cmd) {
        case SIOCSBANDWIDTH: /* Set bandwidth */
index 29398a4f73fd2cd004005846076f4bef1137470d..71cd3c5a0762d0665428229db3b72a10dd72fd3a 100644 (file)
@@ -35,6 +35,9 @@
 #include <linux/types.h>
 #include <asm/io.h>
 
+/* Features for chips (set in driver_data) */
+#define NSC_FORCE_DONGLE_TYPE9 0x00000001
+
 /* DMA modes needed */
 #define DMA_TX_MODE     0x08    /* Mem to I/O, ++, demand. */
 #define DMA_RX_MODE     0x04    /* I/O to mem, ++, demand. */
index 8c22c7374a234e2076e86eebd75ab0bdfa6a8d8a..75714bc7103065501bc5bfc938584a06b77cebae 100644 (file)
@@ -92,7 +92,7 @@ static int old_belkin_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power on dongle */
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
@@ -110,7 +110,7 @@ static int old_belkin_open(struct sir_dev *dev)
 
 static int old_belkin_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -125,7 +125,7 @@ static int old_belkin_close(struct sir_dev *dev)
  */
 static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        dev->speed = 9600;
        return (speed==dev->speed) ? 0 : -EINVAL;
@@ -139,7 +139,7 @@ static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed)
  */
 static int old_belkin_reset(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* This dongles speed "defaults" to 9600 bps ;-) */
        dev->speed = 9600;
index 6078e03de9a83d256368cf61a4c7be4710b7e612..3f32909c24c81ff61307bd7cb37f03937221aa33 100644 (file)
@@ -80,7 +80,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev)
                        return 0;
 
                default:
-                       IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
+                       IRDA_ERROR("%s - undefined state\n", __func__);
                        return -EINVAL;
                }
                fsm->substate = next_state;
@@ -107,11 +107,11 @@ static void sirdev_config_fsm(struct work_struct *work)
        int ret = -1;
        unsigned delay;
 
-       IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies);
+       IRDA_DEBUG(2, "%s(), <%ld>\n", __func__, jiffies);
 
        do {
                IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n",
-                       __FUNCTION__, fsm->state, fsm->substate);
+                       __func__, fsm->state, fsm->substate);
 
                next_state = fsm->state;
                delay = 0;
@@ -249,12 +249,12 @@ static void sirdev_config_fsm(struct work_struct *work)
                        break;
 
                default:
-                       IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
+                       IRDA_ERROR("%s - undefined state\n", __func__);
                        fsm->result = -EINVAL;
                        /* fall thru */
 
                case SIRDEV_STATE_ERROR:
-                       IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result);
+                       IRDA_ERROR("%s - error: %d\n", __func__, fsm->result);
 
 #if 0  /* don't enable this before we have netdev->tx_timeout to recover */
                        netif_stop_queue(dev->netdev);
@@ -284,11 +284,12 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par
 {
        struct sir_fsm *fsm = &dev->fsm;
 
-       IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
+       IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __func__,
+                       initial_state, param);
 
        if (down_trylock(&fsm->sem)) {
                if (in_interrupt()  ||  in_atomic()  ||  irqs_disabled()) {
-                       IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__);
+                       IRDA_DEBUG(1, "%s(), state machine busy!\n", __func__);
                        return -EWOULDBLOCK;
                } else
                        down(&fsm->sem);
@@ -296,7 +297,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par
 
        if (fsm->state == SIRDEV_STATE_DEAD) {
                /* race with sirdev_close should never happen */
-               IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), instance staled!\n", __func__);
                up(&fsm->sem);
                return -ESTALE;         /* or better EPIPE? */
        }
@@ -341,7 +342,7 @@ int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type)
 {
        int err;
 
-       IRDA_DEBUG(3, "%s : requesting dongle %d.\n", __FUNCTION__, type);
+       IRDA_DEBUG(3, "%s : requesting dongle %d.\n", __func__, type);
 
        err = sirdev_schedule_dongle_open(dev, type);
        if (unlikely(err))
@@ -376,7 +377,7 @@ int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len)
 
        ret = dev->drv->do_write(dev, dev->tx_buff.data, dev->tx_buff.len);
        if (ret > 0) {
-               IRDA_DEBUG(3, "%s(), raw-tx started\n", __FUNCTION__);
+               IRDA_DEBUG(3, "%s(), raw-tx started\n", __func__);
 
                dev->tx_buff.data += ret;
                dev->tx_buff.len -= ret;
@@ -437,7 +438,7 @@ void sirdev_write_complete(struct sir_dev *dev)
        spin_lock_irqsave(&dev->tx_lock, flags);
 
        IRDA_DEBUG(3, "%s() - dev->tx_buff.len = %d\n",
-                  __FUNCTION__, dev->tx_buff.len);
+                  __func__, dev->tx_buff.len);
 
        if (likely(dev->tx_buff.len > 0))  {
                /* Write data left in transmit buffer */
@@ -450,7 +451,7 @@ void sirdev_write_complete(struct sir_dev *dev)
                else if (unlikely(actual<0)) {
                        /* could be dropped later when we have tx_timeout to recover */
                        IRDA_ERROR("%s: drv->do_write failed (%d)\n",
-                                  __FUNCTION__, actual);
+                                  __func__, actual);
                        if ((skb=dev->tx_skb) != NULL) {
                                dev->tx_skb = NULL;
                                dev_kfree_skb_any(skb);
@@ -471,7 +472,7 @@ void sirdev_write_complete(struct sir_dev *dev)
                 * restarted when the irda-thread has completed the request.
                 */
 
-               IRDA_DEBUG(3, "%s(), raw-tx done\n", __FUNCTION__);
+               IRDA_DEBUG(3, "%s(), raw-tx done\n", __func__);
                dev->raw_tx = 0;
                goto done;      /* no post-frame handling in raw mode */
        }
@@ -488,7 +489,7 @@ void sirdev_write_complete(struct sir_dev *dev)
         * re-activated.
         */
 
-       IRDA_DEBUG(5, "%s(), finished with frame!\n", __FUNCTION__);
+       IRDA_DEBUG(5, "%s(), finished with frame!\n", __func__);
                
        if ((skb=dev->tx_skb) != NULL) {
                dev->tx_skb = NULL;
@@ -498,14 +499,14 @@ void sirdev_write_complete(struct sir_dev *dev)
        }
 
        if (unlikely(dev->new_speed > 0)) {
-               IRDA_DEBUG(5, "%s(), Changing speed!\n", __FUNCTION__);
+               IRDA_DEBUG(5, "%s(), Changing speed!\n", __func__);
                err = sirdev_schedule_speed(dev, dev->new_speed);
                if (unlikely(err)) {
                        /* should never happen
                         * forget the speed change and hope the stack recovers
                         */
                        IRDA_ERROR("%s - schedule speed change failed: %d\n",
-                                  __FUNCTION__, err);
+                                  __func__, err);
                        netif_wake_queue(dev->netdev);
                }
                /* else: success
@@ -532,13 +533,13 @@ EXPORT_SYMBOL(sirdev_write_complete);
 int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) 
 {
        if (!dev || !dev->netdev) {
-               IRDA_WARNING("%s(), not ready yet!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), not ready yet!\n", __func__);
                return -1;
        }
 
        if (!dev->irlap) {
                IRDA_WARNING("%s - too early: %p / %zd!\n",
-                            __FUNCTION__, cp, count);
+                            __func__, cp, count);
                return -1;
        }
 
@@ -548,7 +549,7 @@ int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
                 */
                irda_device_set_media_busy(dev->netdev, TRUE);
                dev->stats.rx_dropped++;
-               IRDA_DEBUG(0, "%s; rx-drop: %zd\n", __FUNCTION__, count);
+               IRDA_DEBUG(0, "%s; rx-drop: %zd\n", __func__, count);
                return 0;
        }
 
@@ -600,7 +601,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        netif_stop_queue(ndev);
 
-       IRDA_DEBUG(3, "%s(), skb->len = %d\n", __FUNCTION__, skb->len);
+       IRDA_DEBUG(3, "%s(), skb->len = %d\n", __func__, skb->len);
 
        speed = irda_get_next_speed(skb);
        if ((speed != dev->speed) && (speed != -1)) {
@@ -637,7 +638,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        /* Check problems */
        if(spin_is_locked(&dev->tx_lock)) {
-               IRDA_DEBUG(3, "%s(), write not completed\n", __FUNCTION__);
+               IRDA_DEBUG(3, "%s(), write not completed\n", __func__);
        }
 
        /* serialize with write completion */
@@ -666,7 +667,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
        else if (unlikely(actual < 0)) {
                /* could be dropped later when we have tx_timeout to recover */
                IRDA_ERROR("%s: drv->do_write failed (%d)\n",
-                          __FUNCTION__, actual);
+                          __func__, actual);
                dev_kfree_skb_any(skb);
                dev->stats.tx_errors++;               
                dev->stats.tx_dropped++;                      
@@ -687,7 +688,7 @@ static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
 
        IRDA_ASSERT(dev != NULL, return -1;);
 
-       IRDA_DEBUG(3, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, ndev->name, cmd);
+       IRDA_DEBUG(3, "%s(), %s, (cmd=0x%X)\n", __func__, ndev->name, cmd);
        
        switch (cmd) {
        case SIOCSBANDWIDTH: /* Set bandwidth */
@@ -804,7 +805,7 @@ static int sirdev_open(struct net_device *ndev)
        if (!try_module_get(drv->owner))
                return -ESTALE;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        if (sirdev_alloc_buffers(dev))
                goto errout_dec;
@@ -822,7 +823,7 @@ static int sirdev_open(struct net_device *ndev)
 
        netif_wake_queue(ndev);
 
-       IRDA_DEBUG(2, "%s - done, speed = %d\n", __FUNCTION__, dev->speed);
+       IRDA_DEBUG(2, "%s - done, speed = %d\n", __func__, dev->speed);
 
        return 0;
 
@@ -842,7 +843,7 @@ static int sirdev_close(struct net_device *ndev)
        struct sir_dev *dev = ndev->priv;
        const struct sir_driver *drv;
 
-//     IRDA_DEBUG(0, "%s\n", __FUNCTION__);
+//     IRDA_DEBUG(0, "%s\n", __func__);
 
        netif_stop_queue(ndev);
 
@@ -878,7 +879,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
        struct net_device *ndev;
        struct sir_dev *dev;
 
-       IRDA_DEBUG(0, "%s - %s\n", __FUNCTION__, name);
+       IRDA_DEBUG(0, "%s - %s\n", __func__, name);
 
        /* instead of adding tests to protect against drv->do_write==NULL
         * at several places we refuse to create a sir_dev instance for
@@ -892,7 +893,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
         */
        ndev = alloc_irdadev(sizeof(*dev));
        if (ndev == NULL) {
-               IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __FUNCTION__);
+               IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__);
                goto out;
        }
        dev = ndev->priv;
@@ -921,7 +922,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
        ndev->do_ioctl = sirdev_ioctl;
 
        if (register_netdev(ndev)) {
-               IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
                goto out_freenetdev;
        }
 
@@ -938,7 +939,7 @@ int sirdev_put_instance(struct sir_dev *dev)
 {
        int err = 0;
 
-       IRDA_DEBUG(0, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(0, "%s\n", __func__);
 
        atomic_set(&dev->enable_rx, 0);
 
@@ -948,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev)
        if (dev->dongle_drv)
                err = sirdev_schedule_dongle_close(dev);
        if (err)
-               IRDA_ERROR("%s - error %d\n", __FUNCTION__, err);
+               IRDA_ERROR("%s - error %d\n", __func__, err);
 
        sirdev_close(dev->netdev);
 
index 25d5b8a96bdcbdbd54c2afc0694d51c4fc52280a..36030241f7a9cf72102f09a019cae9ca54f0e169 100644 (file)
@@ -36,7 +36,7 @@ int irda_register_dongle(struct dongle_driver *new)
        struct dongle_driver *drv;
 
        IRDA_DEBUG(0, "%s : registering dongle \"%s\" (%d).\n",
-                  __FUNCTION__, new->driver_name, new->type);
+                  __func__, new->driver_name, new->type);
 
        mutex_lock(&dongle_list_lock);
        list_for_each(entry, &dongle_list) {
index 78dc8e7837f09cd2662f0c90bbcf5cf70976f851..b5360fe99d3a5669b89180f96462dc8340d065f5 100644 (file)
@@ -460,7 +460,7 @@ static int __init smsc_ircc_init(void)
 {
        int ret;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        ret = platform_driver_register(&smsc_ircc_driver);
        if (ret) {
@@ -500,7 +500,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
        struct net_device *dev;
        int err;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        err = smsc_ircc_present(fir_base, sir_base);
        if (err)
@@ -508,7 +508,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
 
        err = -ENOMEM;
        if (dev_count >= ARRAY_SIZE(dev_self)) {
-               IRDA_WARNING("%s(), too many devices!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), too many devices!\n", __func__);
                goto err_out1;
        }
 
@@ -517,7 +517,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
         */
        dev = alloc_irdadev(sizeof(struct smsc_ircc_cb));
        if (!dev) {
-               IRDA_WARNING("%s() can't allocate net device\n", __FUNCTION__);
+               IRDA_WARNING("%s() can't allocate net device\n", __func__);
                goto err_out1;
        }
 
@@ -633,14 +633,14 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base)
        if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT,
                            driver_name)) {
                IRDA_WARNING("%s: can't get fir_base of 0x%03x\n",
-                            __FUNCTION__, fir_base);
+                            __func__, fir_base);
                goto out1;
        }
 
        if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT,
                            driver_name)) {
                IRDA_WARNING("%s: can't get sir_base of 0x%03x\n",
-                            __FUNCTION__, sir_base);
+                            __func__, sir_base);
                goto out2;
        }
 
@@ -656,7 +656,7 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base)
 
        if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) {
                IRDA_WARNING("%s(), addr 0x%04x - no device found!\n",
-                            __FUNCTION__, fir_base);
+                            __func__, fir_base);
                goto out3;
        }
        IRDA_MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, "
@@ -793,7 +793,7 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd
 
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
+       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
 
        switch (cmd) {
        case SIOCSBANDWIDTH: /* Set bandwidth */
@@ -878,7 +878,7 @@ int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
        unsigned long flags;
        s32 speed;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(dev != NULL, return 0;);
 
@@ -953,21 +953,21 @@ static void smsc_ircc_set_fir_speed(struct smsc_ircc_cb *self, u32 speed)
                ir_mode = IRCC_CFGA_IRDA_HDLC;
                ctrl = IRCC_CRC;
                fast = 0;
-               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__);
                break;
        case 1152000:
                ir_mode = IRCC_CFGA_IRDA_HDLC;
                ctrl = IRCC_1152 | IRCC_CRC;
                fast = IRCC_LCR_A_FAST | IRCC_LCR_A_GP_DATA;
                IRDA_DEBUG(0, "%s(), handling baud of 1152000\n",
-                          __FUNCTION__);
+                          __func__);
                break;
        case 4000000:
                ir_mode = IRCC_CFGA_IRDA_4PPM;
                ctrl = IRCC_CRC;
                fast = IRCC_LCR_A_FAST;
                IRDA_DEBUG(0, "%s(), handling baud of 4000000\n",
-                          __FUNCTION__);
+                          __func__);
                break;
        }
        #if 0
@@ -995,7 +995,7 @@ static void smsc_ircc_fir_start(struct smsc_ircc_cb *self)
        struct net_device *dev;
        int fir_base;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(self != NULL, return;);
        dev = self->netdev;
@@ -1043,7 +1043,7 @@ static void smsc_ircc_fir_stop(struct smsc_ircc_cb *self)
 {
        int fir_base;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(self != NULL, return;);
 
@@ -1067,7 +1067,7 @@ static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed)
        struct net_device *dev;
        int last_speed_was_sir;
 
-       IRDA_DEBUG(0, "%s() changing speed to: %d\n", __FUNCTION__, speed);
+       IRDA_DEBUG(0, "%s() changing speed to: %d\n", __func__, speed);
 
        IRDA_ASSERT(self != NULL, return;);
        dev = self->netdev;
@@ -1135,7 +1135,7 @@ void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed)
        int lcr;    /* Line control reg */
        int divisor;
 
-       IRDA_DEBUG(0, "%s(), Setting speed to: %d\n", __FUNCTION__, speed);
+       IRDA_DEBUG(0, "%s(), Setting speed to: %d\n", __func__, speed);
 
        IRDA_ASSERT(self != NULL, return;);
        iobase = self->io.sir_base;
@@ -1170,7 +1170,7 @@ void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed)
        /* Turn on interrups */
        outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
 
-       IRDA_DEBUG(2, "%s() speed changed to: %d\n", __FUNCTION__, speed);
+       IRDA_DEBUG(2, "%s() speed changed to: %d\n", __func__, speed);
 }
 
 
@@ -1253,7 +1253,7 @@ static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs)
        int iobase = self->io.fir_base;
        u8 ctrl;
 
-       IRDA_DEBUG(3, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s\n", __func__);
 #if 1
        /* Disable Rx */
        register_bank(iobase, 0);
@@ -1307,7 +1307,7 @@ static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self)
 {
        int iobase = self->io.fir_base;
 
-       IRDA_DEBUG(3, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s\n", __func__);
 #if 0
        /* Disable Tx */
        register_bank(iobase, 0);
@@ -1411,7 +1411,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
 
        register_bank(iobase, 0);
 
-       IRDA_DEBUG(3, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s\n", __func__);
 #if 0
        /* Disable Rx */
        register_bank(iobase, 0);
@@ -1422,7 +1422,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
        lsr= inb(iobase + IRCC_LSR);
        msgcnt = inb(iobase + IRCC_LCR_B) & 0x08;
 
-       IRDA_DEBUG(2, "%s: dma count = %d\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s: dma count = %d\n", __func__,
                   get_dma_residue(self->io.dma));
 
        len = self->rx_buff.truesize - get_dma_residue(self->io.dma);
@@ -1445,15 +1445,15 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
        len -= self->io.speed < 4000000 ? 2 : 4;
 
        if (len < 2 || len > 2050) {
-               IRDA_WARNING("%s(), bogus len=%d\n", __FUNCTION__, len);
+               IRDA_WARNING("%s(), bogus len=%d\n", __func__, len);
                return;
        }
-       IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __FUNCTION__, msgcnt, len);
+       IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __func__, msgcnt, len);
 
        skb = dev_alloc_skb(len + 1);
        if (!skb) {
                IRDA_WARNING("%s(), memory squeeze, dropping frame.\n",
-                            __FUNCTION__);
+                            __func__);
                return;
        }
        /* Make sure IP header gets aligned */
@@ -1494,7 +1494,7 @@ static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self)
 
                /* Make sure we don't stay here to long */
                if (boguscount++ > 32) {
-                       IRDA_DEBUG(2, "%s(), breaking!\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), breaking!\n", __func__);
                        break;
                }
        } while (inb(iobase + UART_LSR) & UART_LSR_DR);
@@ -1536,7 +1536,7 @@ static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id)
        lcra = inb(iobase + IRCC_LCR_A);
        lsr = inb(iobase + IRCC_LSR);
 
-       IRDA_DEBUG(2, "%s(), iir = 0x%02x\n", __FUNCTION__, iir);
+       IRDA_DEBUG(2, "%s(), iir = 0x%02x\n", __func__, iir);
 
        if (iir & IRCC_IIR_EOM) {
                if (self->io.direction == IO_RECV)
@@ -1548,7 +1548,7 @@ static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id)
        }
 
        if (iir & IRCC_IIR_ACTIVE_FRAME) {
-               /*printk(KERN_WARNING "%s(): Active Frame\n", __FUNCTION__);*/
+               /*printk(KERN_WARNING "%s(): Active Frame\n", __func__);*/
        }
 
        /* Enable interrupts again */
@@ -1587,11 +1587,11 @@ static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev)
                lsr = inb(iobase + UART_LSR);
 
                IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n",
-                           __FUNCTION__, iir, lsr, iobase);
+                           __func__, iir, lsr, iobase);
 
                switch (iir) {
                case UART_IIR_RLSI:
-                       IRDA_DEBUG(2, "%s(), RLSI\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), RLSI\n", __func__);
                        break;
                case UART_IIR_RDI:
                        /* Receive interrupt */
@@ -1604,7 +1604,7 @@ static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev)
                        break;
                default:
                        IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n",
-                                  __FUNCTION__, iir);
+                                  __func__, iir);
                        break;
                }
 
@@ -1631,11 +1631,11 @@ static int ircc_is_receiving(struct smsc_ircc_cb *self)
        int status = FALSE;
        /* int iobase; */
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(self != NULL, return FALSE;);
 
-       IRDA_DEBUG(0, "%s: dma count = %d\n", __FUNCTION__,
+       IRDA_DEBUG(0, "%s: dma count = %d\n", __func__,
                   get_dma_residue(self->io.dma));
 
        status = (self->rx_buff.state != OUTSIDE_FRAME);
@@ -1652,7 +1652,7 @@ static int smsc_ircc_request_irq(struct smsc_ircc_cb *self)
                            self->netdev->name, self->netdev);
        if (error)
                IRDA_DEBUG(0, "%s(), unable to allocate irq=%d, err=%d\n",
-                          __FUNCTION__, self->io.irq, error);
+                          __func__, self->io.irq, error);
 
        return error;
 }
@@ -1696,21 +1696,21 @@ static int smsc_ircc_net_open(struct net_device *dev)
        struct smsc_ircc_cb *self;
        char hwname[16];
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(dev != NULL, return -1;);
        self = netdev_priv(dev);
        IRDA_ASSERT(self != NULL, return 0;);
 
        if (self->io.suspended) {
-               IRDA_DEBUG(0, "%s(), device is suspended\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), device is suspended\n", __func__);
                return -EAGAIN;
        }
 
        if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name,
                        (void *) dev)) {
                IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n",
-                          __FUNCTION__, self->io.irq);
+                          __func__, self->io.irq);
                return -EAGAIN;
        }
 
@@ -1734,7 +1734,7 @@ static int smsc_ircc_net_open(struct net_device *dev)
                smsc_ircc_net_close(dev);
 
                IRDA_WARNING("%s(), unable to allocate DMA=%d\n",
-                            __FUNCTION__, self->io.dma);
+                            __func__, self->io.dma);
                return -EAGAIN;
        }
 
@@ -1753,7 +1753,7 @@ static int smsc_ircc_net_close(struct net_device *dev)
 {
        struct smsc_ircc_cb *self;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(dev != NULL, return -1;);
        self = netdev_priv(dev);
@@ -1836,7 +1836,7 @@ static int smsc_ircc_resume(struct platform_device *dev)
  */
 static int __exit smsc_ircc_close(struct smsc_ircc_cb *self)
 {
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        IRDA_ASSERT(self != NULL, return -1;);
 
@@ -1848,12 +1848,12 @@ static int __exit smsc_ircc_close(struct smsc_ircc_cb *self)
        smsc_ircc_stop_interrupts(self);
 
        /* Release the PORTS that this driver is using */
-       IRDA_DEBUG(0, "%s(), releasing 0x%03x\n",  __FUNCTION__,
+       IRDA_DEBUG(0, "%s(), releasing 0x%03x\n",  __func__,
                   self->io.fir_base);
 
        release_region(self->io.fir_base, self->io.fir_ext);
 
-       IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__,
+       IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __func__,
                   self->io.sir_base);
 
        release_region(self->io.sir_base, self->io.sir_ext);
@@ -1875,7 +1875,7 @@ static void __exit smsc_ircc_cleanup(void)
 {
        int i;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        for (i = 0; i < 2; i++) {
                if (dev_self[i])
@@ -1899,7 +1899,7 @@ void smsc_ircc_sir_start(struct smsc_ircc_cb *self)
        struct net_device *dev;
        int fir_base, sir_base;
 
-       IRDA_DEBUG(3, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s\n", __func__);
 
        IRDA_ASSERT(self != NULL, return;);
        dev = self->netdev;
@@ -1926,7 +1926,7 @@ void smsc_ircc_sir_start(struct smsc_ircc_cb *self)
        /* Turn on interrups */
        outb(UART_IER_RLSI | UART_IER_RDI |UART_IER_THRI, sir_base + UART_IER);
 
-       IRDA_DEBUG(3, "%s() - exit\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s() - exit\n", __func__);
 
        outb(0x00, fir_base + IRCC_MASTER);
 }
@@ -1936,7 +1936,7 @@ void smsc_ircc_sir_stop(struct smsc_ircc_cb *self)
 {
        int iobase;
 
-       IRDA_DEBUG(3, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s\n", __func__);
        iobase = self->io.sir_base;
 
        /* Reset UART */
@@ -1962,7 +1962,7 @@ static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self)
 
        IRDA_ASSERT(self != NULL, return;);
 
-       IRDA_DEBUG(4, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s\n", __func__);
 
        iobase = self->io.sir_base;
 
@@ -1984,7 +1984,7 @@ static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self)
                 */
                if (self->new_speed) {
                        IRDA_DEBUG(5, "%s(), Changing speed to %d.\n",
-                                  __FUNCTION__, self->new_speed);
+                                  __func__, self->new_speed);
                        smsc_ircc_sir_wait_hw_transmitter_finish(self);
                        smsc_ircc_change_speed(self, self->new_speed);
                        self->new_speed = 0;
@@ -2023,7 +2023,7 @@ static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len)
 
        /* Tx FIFO should be empty! */
        if (!(inb(iobase + UART_LSR) & UART_LSR_THRE)) {
-               IRDA_WARNING("%s(), failed, fifo not empty!\n", __FUNCTION__);
+               IRDA_WARNING("%s(), failed, fifo not empty!\n", __func__);
                return 0;
        }
 
@@ -2123,7 +2123,7 @@ static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self)
                udelay(1);
 
        if (count == 0)
-               IRDA_DEBUG(0, "%s(): stuck transmitter\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(): stuck transmitter\n", __func__);
 }
 
 
@@ -2145,7 +2145,7 @@ static int __init smsc_ircc_look_for_chips(void)
        while (address->cfg_base) {
                cfg_base = address->cfg_base;
 
-               /*printk(KERN_WARNING "%s(): probing: 0x%02x for: 0x%02x\n", __FUNCTION__, cfg_base, address->type);*/
+               /*printk(KERN_WARNING "%s(): probing: 0x%02x for: 0x%02x\n", __func__, cfg_base, address->type);*/
 
                if (address->type & SMSCSIO_TYPE_FDC) {
                        type = "FDC";
@@ -2184,7 +2184,7 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor
        u8 mode, dma, irq;
        int ret = -ENODEV;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        if (smsc_ircc_probe(cfgbase, SMSCSIOFLAT_DEVICEID_REG, chips, type) == NULL)
                return ret;
@@ -2192,10 +2192,10 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor
        outb(SMSCSIOFLAT_UARTMODE0C_REG, cfgbase);
        mode = inb(cfgbase + 1);
 
-       /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __FUNCTION__, mode);*/
+       /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __func__, mode);*/
 
        if (!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA))
-               IRDA_WARNING("%s(): IrDA not enabled\n", __FUNCTION__);
+               IRDA_WARNING("%s(): IrDA not enabled\n", __func__);
 
        outb(SMSCSIOFLAT_UART2BASEADDR_REG, cfgbase);
        sirbase = inb(cfgbase + 1) << 2;
@@ -2212,7 +2212,7 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor
        outb(SMSCSIOFLAT_UARTIRQSELECT_REG, cfgbase);
        irq = inb(cfgbase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK;
 
-       IRDA_MESSAGE("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", __FUNCTION__, firbase, sirbase, dma, irq, mode);
+       IRDA_MESSAGE("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", __func__, firbase, sirbase, dma, irq, mode);
 
        if (firbase && smsc_ircc_open(firbase, sirbase, dma, irq) == 0)
                ret = 0;
@@ -2234,7 +2234,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho
        unsigned short fir_io, sir_io;
        int ret = -ENODEV;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        if (smsc_ircc_probe(cfg_base, 0x20, chips, type) == NULL)
                return ret;
@@ -2268,7 +2268,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho
 
 static int __init smsc_access(unsigned short cfg_base, unsigned char reg)
 {
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        outb(reg, cfg_base);
        return inb(cfg_base) != reg ? -1 : 0;
@@ -2278,7 +2278,7 @@ static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base,
 {
        u8 devid, xdevid, rev;
 
-       IRDA_DEBUG(1, "%s\n", __FUNCTION__);
+       IRDA_DEBUG(1, "%s\n", __func__);
 
        /* Leave configuration */
 
@@ -2353,7 +2353,7 @@ static int __init smsc_superio_fdc(unsigned short cfg_base)
 
        if (!request_region(cfg_base, 2, driver_name)) {
                IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n",
-                            __FUNCTION__, cfg_base);
+                            __func__, cfg_base);
        } else {
                if (!smsc_superio_flat(fdc_chips_flat, cfg_base, "FDC") ||
                    !smsc_superio_paged(fdc_chips_paged, cfg_base, "FDC"))
@@ -2371,7 +2371,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base)
 
        if (!request_region(cfg_base, 2, driver_name)) {
                IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n",
-                            __FUNCTION__, cfg_base);
+                            __func__, cfg_base);
        } else {
                if (!smsc_superio_flat(lpc_chips_flat, cfg_base, "LPC") ||
                    !smsc_superio_paged(lpc_chips_paged, cfg_base, "LPC"))
@@ -2932,7 +2932,7 @@ static void smsc_ircc_set_transceiver_smsc_ircc_atc(int fir_base, u32 speed)
                /* empty */;
 
        if (val)
-               IRDA_WARNING("%s(): ATC: 0x%02x\n", __FUNCTION__,
+               IRDA_WARNING("%s(): ATC: 0x%02x\n", __func__,
                             inb(fir_base + IRCC_ATC));
 }
 
index d1ce5ae6a17243d37ed61ff6cfa675c1929bec02..048a15422844dbf2462429d7e65501b93249922d 100644 (file)
@@ -77,7 +77,7 @@ static int tekram_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
 
@@ -92,7 +92,7 @@ static int tekram_open(struct sir_dev *dev)
 
 static int tekram_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -130,7 +130,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
        u8 byte;
        static int ret = 0;
        
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        switch(state) {
        case SIRDEV_STATE_DONGLE_SPEED:
@@ -179,7 +179,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
                break;
 
        default:
-               IRDA_ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+               IRDA_ERROR("%s - undefined state %d\n", __func__, state);
                ret = -EINVAL;
                break;
        }
@@ -204,7 +204,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
 
 static int tekram_reset(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Clear DTR, Set RTS */
        sirdev_set_dtr_rts(dev, FALSE, TRUE); 
index aa1a9b0ed83e7feab4390e3ecaeb078b23f60ee1..fcf287b749db5a9e8885941cdd9d6bacfeb7b49a 100644 (file)
@@ -181,7 +181,7 @@ static int toim3232_open(struct sir_dev *dev)
 {
        struct qos_info *qos = &dev->qos;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Pull the lines high to start with.
         *
@@ -209,7 +209,7 @@ static int toim3232_open(struct sir_dev *dev)
 
 static int toim3232_close(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Power off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
@@ -241,7 +241,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed)
        u8 byte;
        static int ret = 0;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        switch(state) {
        case SIRDEV_STATE_DONGLE_SPEED:
@@ -299,7 +299,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed)
                break;
 
        default:
-               printk(KERN_ERR "%s - undefined state %d\n", __FUNCTION__, state);
+               printk(KERN_ERR "%s - undefined state %d\n", __func__, state);
                ret = -EINVAL;
                break;
        }
@@ -344,7 +344,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed)
 
 static int toim3232_reset(struct sir_dev *dev)
 {
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        /* Switch off both DTR and RTS to switch off dongle */
        sirdev_set_dtr_rts(dev, FALSE, FALSE);
index 04ad3573b15993e3ae8bc1f7521ad6ac3dbae5de..84e609ea5fbbc1a5e1a25d72a60b9aa369ea9a73 100644 (file)
@@ -152,12 +152,12 @@ static int __init via_ircc_init(void)
 {
        int rc;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        rc = pci_register_driver(&via_driver);
        if (rc < 0) {
                IRDA_DEBUG(0, "%s(): error rc = %d, returning  -ENODEV...\n",
-                          __FUNCTION__, rc);
+                          __func__, rc);
                return -ENODEV;
        }
        return 0;
@@ -170,11 +170,11 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
        u16 Chipset,FirDRQ1,FirDRQ0,FirIRQ,FirIOBase;
        chipio_t info;
 
-       IRDA_DEBUG(2, "%s(): Device ID=(0X%X)\n", __FUNCTION__, id->device);
+       IRDA_DEBUG(2, "%s(): Device ID=(0X%X)\n", __func__, id->device);
 
        rc = pci_enable_device (pcidev);
        if (rc) {
-               IRDA_DEBUG(0, "%s(): error rc = %d\n", __FUNCTION__, rc);
+               IRDA_DEBUG(0, "%s(): error rc = %d\n", __func__, rc);
                return -ENODEV;
        }
 
@@ -185,7 +185,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
                Chipset=0x3076;
 
        if (Chipset==0x3076) {
-               IRDA_DEBUG(2, "%s(): Chipset = 3076\n", __FUNCTION__);
+               IRDA_DEBUG(2, "%s(): Chipset = 3076\n", __func__);
 
                WriteLPCReg(7,0x0c );
                temp=ReadLPCReg(0x30);//check if BIOS Enable Fir
@@ -222,7 +222,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
                } else
                        rc = -ENODEV; //IR not turn on   
        } else { //Not VT1211
-               IRDA_DEBUG(2, "%s(): Chipset = 3096\n", __FUNCTION__);
+               IRDA_DEBUG(2, "%s(): Chipset = 3096\n", __func__);
 
                pci_read_config_byte(pcidev,0x67,&bTmp);//check if BIOS Enable Fir
                if((bTmp&0x01)==1) {  // BIOS enable FIR
@@ -262,7 +262,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
                        rc = -ENODEV; //IR not turn on !!!!!
        }//Not VT1211
 
-       IRDA_DEBUG(2, "%s(): End - rc = %d\n", __FUNCTION__, rc);
+       IRDA_DEBUG(2, "%s(): End - rc = %d\n", __func__, rc);
        return rc;
 }
 
@@ -276,7 +276,7 @@ static void via_ircc_clean(void)
 {
        int i;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        for (i=0; i < ARRAY_SIZE(dev_self); i++) {
                if (dev_self[i])
@@ -286,7 +286,7 @@ static void via_ircc_clean(void)
 
 static void __devexit via_remove_one (struct pci_dev *pdev)
 {
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        /* FIXME : This is ugly. We should use pci_get_drvdata(pdev);
         * to get our driver instance and call directly via_ircc_close().
@@ -301,7 +301,7 @@ static void __devexit via_remove_one (struct pci_dev *pdev)
 
 static void __exit via_ircc_cleanup(void)
 {
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        /* FIXME : This should be redundant, as pci_unregister_driver()
         * should call via_remove_one() on each device.
@@ -324,7 +324,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
        struct via_ircc_cb *self;
        int err;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        if (i >= ARRAY_SIZE(dev_self))
                return -ENOMEM;
@@ -360,7 +360,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
        /* Reserve the ioports that we need */
        if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) {
                IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n",
-                          __FUNCTION__, self->io.fir_base);
+                          __func__, self->io.fir_base);
                err = -ENODEV;
                goto err_out1;
        }
@@ -471,7 +471,7 @@ static int via_ircc_close(struct via_ircc_cb *self)
 {
        int iobase;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        IRDA_ASSERT(self != NULL, return -1;);
 
@@ -483,7 +483,7 @@ static int via_ircc_close(struct via_ircc_cb *self)
 
        /* Release the PORT that this driver is using */
        IRDA_DEBUG(2, "%s(), Releasing Region %03x\n",
-                  __FUNCTION__, self->io.fir_base);
+                  __func__, self->io.fir_base);
        release_region(self->io.fir_base, self->io.fir_ext);
        if (self->tx_buff.head)
                dma_free_coherent(NULL, self->tx_buff.truesize,
@@ -509,7 +509,7 @@ static void via_hw_init(struct via_ircc_cb *self)
 {
        int iobase = self->io.fir_base;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        SetMaxRxPacketSize(iobase, 0x0fff);     //set to max:4095
        // FIFO Init
@@ -582,7 +582,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,
        speed = speed;
 
        IRDA_DEBUG(1, "%s(): change_dongle_speed to %d for 0x%x, %d\n",
-                  __FUNCTION__, speed, iobase, dongle_id);
+                  __func__, speed, iobase, dongle_id);
 
        switch (dongle_id) {
 
@@ -671,7 +671,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,
 
        case 0x11:              /* Temic TFDS4500 */
 
-               IRDA_DEBUG(2, "%s: Temic TFDS4500: One RX pin, TX normal, RX inverted.\n", __FUNCTION__);
+               IRDA_DEBUG(2, "%s: Temic TFDS4500: One RX pin, TX normal, RX inverted.\n", __func__);
 
                UseOneRX(iobase, ON);   //use ONE RX....RX1
                InvertTX(iobase, OFF);
@@ -689,7 +689,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,
                        SlowIRRXLowActive(iobase, OFF);
 
                } else{
-                       IRDA_DEBUG(0, "%s: Warning: TFDS4500 not running in SIR mode !\n", __FUNCTION__);
+                       IRDA_DEBUG(0, "%s: Warning: TFDS4500 not running in SIR mode !\n", __func__);
                }
                break;
 
@@ -707,7 +707,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,
 
        default:
                IRDA_ERROR("%s: Error: dongle_id %d unsupported !\n",
-                          __FUNCTION__, dongle_id);
+                          __func__, dongle_id);
        }
 }
 
@@ -726,7 +726,7 @@ static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 speed)
        iobase = self->io.fir_base;
        /* Update accounting for new speed */
        self->io.speed = speed;
-       IRDA_DEBUG(1, "%s: change_speed to %d bps.\n", __FUNCTION__, speed);
+       IRDA_DEBUG(1, "%s: change_speed to %d bps.\n", __func__, speed);
 
        WriteReg(iobase, I_ST_CT_0, 0x0);
 
@@ -957,7 +957,7 @@ static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase)
                        self->tx_buff.head) + self->tx_buff_dma,
                       self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE);
        IRDA_DEBUG(1, "%s: tx_fifo.ptr=%x,len=%x,tx_fifo.len=%x..\n",
-                  __FUNCTION__, self->tx_fifo.ptr,
+                  __func__, self->tx_fifo.ptr,
                   self->tx_fifo.queue[self->tx_fifo.ptr].len,
                   self->tx_fifo.len);
 
@@ -981,7 +981,7 @@ static int via_ircc_dma_xmit_complete(struct via_ircc_cb *self)
        int ret = TRUE;
        u8 Tx_status;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        iobase = self->io.fir_base;
        /* Disable DMA */
@@ -1014,7 +1014,7 @@ static int via_ircc_dma_xmit_complete(struct via_ircc_cb *self)
        }
        IRDA_DEBUG(1,
                   "%s: tx_fifo.len=%x ,tx_fifo.ptr=%x,tx_fifo.free=%x...\n",
-                  __FUNCTION__,
+                  __func__,
                   self->tx_fifo.len, self->tx_fifo.ptr, self->tx_fifo.free);
 /* F01_S
        // Any frames to be sent back-to-back? 
@@ -1050,7 +1050,7 @@ static int via_ircc_dma_receive(struct via_ircc_cb *self)
 
        iobase = self->io.fir_base;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0;
        self->tx_fifo.tail = self->tx_buff.head;
@@ -1134,13 +1134,13 @@ static int via_ircc_dma_receive_complete(struct via_ircc_cb *self,
                        return TRUE;    //interrupt only, data maybe move by RxT  
                if (((len - 4) < 2) || ((len - 4) > 2048)) {
                        IRDA_DEBUG(1, "%s(): Trouble:len=%x,CurCount=%x,LastCount=%x..\n",
-                                  __FUNCTION__, len, RxCurCount(iobase, self),
+                                  __func__, len, RxCurCount(iobase, self),
                                   self->RxLastCount);
                        hwreset(self);
                        return FALSE;
                }
                IRDA_DEBUG(2, "%s(): fifo.len=%x,len=%x,CurCount=%x..\n",
-                          __FUNCTION__,
+                          __func__,
                           st_fifo->len, len - 4, RxCurCount(iobase, self));
 
                st_fifo->entries[st_fifo->tail].status = status;
@@ -1187,7 +1187,7 @@ F01_E */
                skb_put(skb, len - 4);
 
                skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4);
-               IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __FUNCTION__,
+               IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __func__,
                           len - 4, self->rx_buff.data);
 
                // Move to next frame 
@@ -1217,7 +1217,7 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
 
        len = GetRecvByte(iobase, self);
 
-       IRDA_DEBUG(2, "%s(): len=%x\n", __FUNCTION__, len);
+       IRDA_DEBUG(2, "%s(): len=%x\n", __func__, len);
 
        if ((len - 4) < 2) {
                self->stats.rx_dropped++;
@@ -1302,7 +1302,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
                        skb_put(skb, len - 4);
                        skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4);
 
-                       IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __FUNCTION__,
+                       IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __func__,
                                   len - 4, st_fifo->head);
 
                        // Move to next frame 
@@ -1318,7 +1318,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
 
                IRDA_DEBUG(2,
                           "%s(): End of upload HostStatus=%x,RxStatus=%x\n",
-                          __FUNCTION__,
+                          __func__,
                           GetHostStatus(iobase), GetRXStatus(iobase));
 
                /*
@@ -1358,7 +1358,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
        iHostIntType = GetHostStatus(iobase);
 
        IRDA_DEBUG(4, "%s(): iHostIntType %02x:  %s %s %s  %02x\n",
-                  __FUNCTION__, iHostIntType,
+                  __func__, iHostIntType,
                   (iHostIntType & 0x40) ? "Timer" : "",
                   (iHostIntType & 0x20) ? "Tx" : "",
                   (iHostIntType & 0x10) ? "Rx" : "",
@@ -1388,7 +1388,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
                iTxIntType = GetTXStatus(iobase);
 
                IRDA_DEBUG(4, "%s(): iTxIntType %02x:  %s %s %s %s\n",
-                          __FUNCTION__, iTxIntType,
+                          __func__, iTxIntType,
                           (iTxIntType & 0x08) ? "FIFO underr." : "",
                           (iTxIntType & 0x04) ? "EOM" : "",
                           (iTxIntType & 0x02) ? "FIFO ready" : "",
@@ -1412,7 +1412,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
                iRxIntType = GetRXStatus(iobase);
 
                IRDA_DEBUG(4, "%s(): iRxIntType %02x:  %s %s %s %s %s %s %s\n",
-                          __FUNCTION__, iRxIntType,
+                          __func__, iRxIntType,
                           (iRxIntType & 0x80) ? "PHY err."     : "",
                           (iRxIntType & 0x40) ? "CRC err"      : "",
                           (iRxIntType & 0x20) ? "FIFO overr."  : "",
@@ -1421,7 +1421,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
                           (iRxIntType & 0x02) ? "RxMaxLen"     : "",
                           (iRxIntType & 0x01) ? "SIR bad"      : "");
                if (!iRxIntType)
-                       IRDA_DEBUG(3, "%s(): RxIRQ =0\n", __FUNCTION__);
+                       IRDA_DEBUG(3, "%s(): RxIRQ =0\n", __func__);
 
                if (iRxIntType & 0x10) {
                        if (via_ircc_dma_receive_complete(self, iobase)) {
@@ -1431,7 +1431,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
                }               // No ERR     
                else {          //ERR
                        IRDA_DEBUG(4, "%s(): RxIRQ ERR:iRxIntType=%x,HostIntType=%x,CurCount=%x,RxLastCount=%x_____\n",
-                                  __FUNCTION__, iRxIntType, iHostIntType,
+                                  __func__, iRxIntType, iHostIntType,
                                   RxCurCount(iobase, self),
                                   self->RxLastCount);
 
@@ -1456,7 +1456,7 @@ static void hwreset(struct via_ircc_cb *self)
        int iobase;
        iobase = self->io.fir_base;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        ResetChip(iobase, 5);
        EnableDMA(iobase, OFF);
@@ -1501,7 +1501,7 @@ static int via_ircc_is_receiving(struct via_ircc_cb *self)
        if (CkRxRecv(iobase, self))
                status = TRUE;
 
-       IRDA_DEBUG(2, "%s(): status=%x....\n", __FUNCTION__, status);
+       IRDA_DEBUG(2, "%s(): status=%x....\n", __func__, status);
 
        return status;
 }
@@ -1519,7 +1519,7 @@ static int via_ircc_net_open(struct net_device *dev)
        int iobase;
        char hwname[32];
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        IRDA_ASSERT(dev != NULL, return -1;);
        self = (struct via_ircc_cb *) dev->priv;
@@ -1586,7 +1586,7 @@ static int via_ircc_net_close(struct net_device *dev)
        struct via_ircc_cb *self;
        int iobase;
 
-       IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(3, "%s()\n", __func__);
 
        IRDA_ASSERT(dev != NULL, return -1;);
        self = (struct via_ircc_cb *) dev->priv;
@@ -1630,7 +1630,7 @@ static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
        IRDA_ASSERT(dev != NULL, return -1;);
        self = dev->priv;
        IRDA_ASSERT(self != NULL, return -1;);
-       IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name,
+       IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name,
                   cmd);
        /* Disable interrupts & save flags */
        spin_lock_irqsave(&self->lock, flags);
index d15e00b8591e173aeb55a08623a773ced53b6d8f..18f4b3a96aedd1590eae4d3f13ba802011f9418e 100644 (file)
@@ -140,15 +140,15 @@ static void vlsi_ring_debug(struct vlsi_ring *r)
        unsigned i;
 
        printk(KERN_DEBUG "%s - ring %p / size %u / mask 0x%04x / len %u / dir %d / hw %p\n",
-               __FUNCTION__, r, r->size, r->mask, r->len, r->dir, r->rd[0].hw);
-       printk(KERN_DEBUG "%s - head = %d / tail = %d\n", __FUNCTION__,
+               __func__, r, r->size, r->mask, r->len, r->dir, r->rd[0].hw);
+       printk(KERN_DEBUG "%s - head = %d / tail = %d\n", __func__,
                atomic_read(&r->head) & r->mask, atomic_read(&r->tail) & r->mask);
        for (i = 0; i < r->size; i++) {
                rd = &r->rd[i];
-               printk(KERN_DEBUG "%s - ring descr %u: ", __FUNCTION__, i);
+               printk(KERN_DEBUG "%s - ring descr %u: ", __func__, i);
                printk("skb=%p data=%p hw=%p\n", rd->skb, rd->buf, rd->hw);
                printk(KERN_DEBUG "%s - hw: status=%02x count=%u addr=0x%08x\n",
-                       __FUNCTION__, (unsigned) rd_get_status(rd),
+                       __func__, (unsigned) rd_get_status(rd),
                        (unsigned) rd_get_count(rd), (unsigned) rd_get_addr(rd));
        }
 }
@@ -435,7 +435,7 @@ static struct vlsi_ring *vlsi_alloc_ring(struct pci_dev *pdev, struct ring_descr
                    ||  !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) {
                        if (rd->buf) {
                                IRDA_ERROR("%s: failed to create PCI-MAP for %p",
-                                          __FUNCTION__, rd->buf);
+                                          __func__, rd->buf);
                                kfree(rd->buf);
                                rd->buf = NULL;
                        }
@@ -489,7 +489,7 @@ static int vlsi_create_hwif(vlsi_irda_dev_t *idev)
        ringarea = pci_alloc_consistent(idev->pdev, HW_RING_AREA_SIZE, &idev->busaddr);
        if (!ringarea) {
                IRDA_ERROR("%s: insufficient memory for descriptor rings\n",
-                          __FUNCTION__);
+                          __func__);
                goto out;
        }
        memset(ringarea, 0, HW_RING_AREA_SIZE);
@@ -564,7 +564,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
        crclen = (idev->mode==IFF_FIR) ? sizeof(u32) : sizeof(u16);
        len -= crclen;          /* remove trailing CRC */
        if (len <= 0) {
-               IRDA_DEBUG(0, "%s: strange frame (len=%d)\n", __FUNCTION__, len);
+               IRDA_DEBUG(0, "%s: strange frame (len=%d)\n", __func__, len);
                ret |= VLSI_RX_DROP;
                goto done;
        }
@@ -579,14 +579,14 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
                 */
                le16_to_cpus(rd->buf+len);
                if (irda_calc_crc16(INIT_FCS,rd->buf,len+crclen) != GOOD_FCS) {
-                       IRDA_DEBUG(0, "%s: crc error\n", __FUNCTION__);
+                       IRDA_DEBUG(0, "%s: crc error\n", __func__);
                        ret |= VLSI_RX_CRC;
                        goto done;
                }
        }
 
        if (!rd->skb) {
-               IRDA_WARNING("%s: rx packet lost\n", __FUNCTION__);
+               IRDA_WARNING("%s: rx packet lost\n", __func__);
                ret |= VLSI_RX_DROP;
                goto done;
        }
@@ -617,7 +617,7 @@ static void vlsi_fill_rx(struct vlsi_ring *r)
        for (rd = ring_last(r); rd != NULL; rd = ring_put(r)) {
                if (rd_is_active(rd)) {
                        IRDA_WARNING("%s: driver bug: rx descr race with hw\n",
-                                    __FUNCTION__);
+                                    __func__);
                        vlsi_ring_debug(r);
                        break;
                }
@@ -676,7 +676,7 @@ static void vlsi_rx_interrupt(struct net_device *ndev)
 
        if (ring_first(r) == NULL) {
                /* we are in big trouble, if this should ever happen */
-               IRDA_ERROR("%s: rx ring exhausted!\n", __FUNCTION__);
+               IRDA_ERROR("%s: rx ring exhausted!\n", __func__);
                vlsi_ring_debug(r);
        }
        else
@@ -697,7 +697,7 @@ static void vlsi_unarm_rx(vlsi_irda_dev_t *idev)
                if (rd_is_active(rd)) {
                        rd_set_status(rd, 0);
                        if (rd_get_count(rd)) {
-                               IRDA_DEBUG(0, "%s - dropping rx packet\n", __FUNCTION__);
+                               IRDA_DEBUG(0, "%s - dropping rx packet\n", __func__);
                                ret = -VLSI_RX_DROP;
                        }
                        rd_set_count(rd, 0);
@@ -772,7 +772,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
        int     fifocnt;
 
        baudrate = idev->new_baud;
-       IRDA_DEBUG(2, "%s: %d -> %d\n", __FUNCTION__, idev->baud, idev->new_baud);
+       IRDA_DEBUG(2, "%s: %d -> %d\n", __func__, idev->baud, idev->new_baud);
        if (baudrate == 4000000) {
                mode = IFF_FIR;
                config = IRCFG_FIR;
@@ -789,7 +789,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
                switch(baudrate) {
                        default:
                                IRDA_WARNING("%s: undefined baudrate %d - fallback to 9600!\n",
-                                            __FUNCTION__, baudrate);
+                                            __func__, baudrate);
                                baudrate = 9600;
                                /* fallthru */
                        case 2400:
@@ -806,7 +806,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
 
        fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK;
        if (fifocnt != 0) {
-               IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __FUNCTION__, fifocnt);
+               IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __func__, fifocnt);
        }
 
        outw(0, iobase+VLSI_PIO_IRENABLE);
@@ -830,14 +830,14 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
                config ^= IRENABLE_SIR_ON;
 
        if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) {
-               IRDA_WARNING("%s: failed to set %s mode!\n", __FUNCTION__,
+               IRDA_WARNING("%s: failed to set %s mode!\n", __func__,
                        (mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR"));
                ret = -1;
        }
        else {
                if (inw(iobase+VLSI_PIO_PHYCTL) != nphyctl) {
                        IRDA_WARNING("%s: failed to apply baudrate %d\n",
-                                    __FUNCTION__, baudrate);
+                                    __func__, baudrate);
                        ret = -1;
                }
                else {
@@ -849,7 +849,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
        }
 
        if (ret)
-               vlsi_reg_debug(iobase,__FUNCTION__);
+               vlsi_reg_debug(iobase,__func__);
 
        return ret;
 }
@@ -982,7 +982,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
                if (len >= r->len-5)
                         IRDA_WARNING("%s: possible buffer overflow with SIR wrapping!\n",
-                                     __FUNCTION__);
+                                     __func__);
        }
        else {
                /* hw deals with MIR/FIR mode wrapping */
@@ -1027,7 +1027,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
                fifocnt = inw(ndev->base_addr+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK;
                if (fifocnt != 0) {
-                       IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __FUNCTION__, fifocnt);
+                       IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __func__, fifocnt);
                }
 
                config = inw(iobase+VLSI_PIO_IRCFG);
@@ -1040,7 +1040,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        if (ring_put(r) == NULL) {
                netif_stop_queue(ndev);
-               IRDA_DEBUG(3, "%s: tx ring full - queue stopped\n", __FUNCTION__);
+               IRDA_DEBUG(3, "%s: tx ring full - queue stopped\n", __func__);
        }
        spin_unlock_irqrestore(&idev->lock, flags);
 
@@ -1049,7 +1049,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 drop_unlock:
        spin_unlock_irqrestore(&idev->lock, flags);
 drop:
-       IRDA_WARNING("%s: dropping packet - %s\n", __FUNCTION__, msg);
+       IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg);
        dev_kfree_skb_any(skb);
        idev->stats.tx_errors++;
        idev->stats.tx_dropped++;
@@ -1106,7 +1106,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
                fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK;
                if (fifocnt != 0) {
                        IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n",
-                               __FUNCTION__, fifocnt);
+                               __func__, fifocnt);
                }
                outw(config | IRCFG_ENTX, iobase+VLSI_PIO_IRCFG);
        }
@@ -1115,7 +1115,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
 
        if (netif_queue_stopped(ndev)  &&  !idev->new_baud) {
                netif_wake_queue(ndev);
-               IRDA_DEBUG(3, "%s: queue awoken\n", __FUNCTION__);
+               IRDA_DEBUG(3, "%s: queue awoken\n", __func__);
        }
 }
 
@@ -1138,7 +1138,7 @@ static void vlsi_unarm_tx(vlsi_irda_dev_t *idev)
                                dev_kfree_skb_any(rd->skb);
                                rd->skb = NULL;
                        }
-                       IRDA_DEBUG(0, "%s - dropping tx packet\n", __FUNCTION__);
+                       IRDA_DEBUG(0, "%s - dropping tx packet\n", __func__);
                        ret = -VLSI_TX_DROP;
                }
                else
@@ -1188,7 +1188,7 @@ static int vlsi_start_clock(struct pci_dev *pdev)
                if (count < 3) {
                        if (clksrc == 1) { /* explicitly asked for PLL hence bail out */
                                IRDA_ERROR("%s: no PLL or failed to lock!\n",
-                                          __FUNCTION__);
+                                          __func__);
                                clkctl = CLKCTL_CLKSTP;
                                pci_write_config_byte(pdev, VLSI_PCI_CLKCTL, clkctl);
                                return -1;
@@ -1197,7 +1197,7 @@ static int vlsi_start_clock(struct pci_dev *pdev)
                                clksrc = 3;     /* fallback to 40MHz XCLK (OB800) */
 
                        IRDA_DEBUG(0, "%s: PLL not locked, fallback to clksrc=%d\n",
-                               __FUNCTION__, clksrc);
+                               __func__, clksrc);
                }
                else
                        clksrc = 1;     /* got successful PLL lock */
@@ -1269,7 +1269,7 @@ static int vlsi_init_chip(struct pci_dev *pdev)
        /* start the clock and clean the registers */
 
        if (vlsi_start_clock(pdev)) {
-               IRDA_ERROR("%s: no valid clock source\n", __FUNCTION__);
+               IRDA_ERROR("%s: no valid clock source\n", __func__);
                return -1;
        }
        iobase = ndev->base_addr;
@@ -1386,7 +1386,7 @@ static void vlsi_tx_timeout(struct net_device *ndev)
        vlsi_irda_dev_t *idev = ndev->priv;
 
 
-       vlsi_reg_debug(ndev->base_addr, __FUNCTION__);
+       vlsi_reg_debug(ndev->base_addr, __func__);
        vlsi_ring_debug(idev->tx_ring);
 
        if (netif_running(ndev))
@@ -1401,7 +1401,7 @@ static void vlsi_tx_timeout(struct net_device *ndev)
 
        if (vlsi_start_hw(idev))
                IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n",
-                          __FUNCTION__, pci_name(idev->pdev), ndev->name);
+                          __func__, pci_name(idev->pdev), ndev->name);
        else
                netif_start_queue(ndev);
 }
@@ -1446,7 +1446,7 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
                        break;
                default:
                        IRDA_WARNING("%s: notsupp - cmd=%04x\n",
-                                    __FUNCTION__, cmd);
+                                    __func__, cmd);
                        ret = -EOPNOTSUPP;
        }       
        
@@ -1491,7 +1491,7 @@ static irqreturn_t vlsi_interrupt(int irq, void *dev_instance)
 
        if (boguscount <= 0)
                IRDA_MESSAGE("%s: too much work in interrupt!\n",
-                            __FUNCTION__);
+                            __func__);
        return IRQ_RETVAL(handled);
 }
 
@@ -1504,7 +1504,7 @@ static int vlsi_open(struct net_device *ndev)
        char    hwname[32];
 
        if (pci_request_regions(idev->pdev, drivername)) {
-               IRDA_WARNING("%s: io resource busy\n", __FUNCTION__);
+               IRDA_WARNING("%s: io resource busy\n", __func__);
                goto errout;
        }
        ndev->base_addr = pci_resource_start(idev->pdev,0);
@@ -1519,7 +1519,7 @@ static int vlsi_open(struct net_device *ndev)
        if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED,
                        drivername, ndev)) {
                IRDA_WARNING("%s: couldn't get IRQ: %d\n",
-                            __FUNCTION__, ndev->irq);
+                            __func__, ndev->irq);
                goto errout_io;
        }
 
@@ -1540,7 +1540,7 @@ static int vlsi_open(struct net_device *ndev)
 
        netif_start_queue(ndev);
 
-       IRDA_MESSAGE("%s: device %s operational\n", __FUNCTION__, ndev->name);
+       IRDA_MESSAGE("%s: device %s operational\n", __func__, ndev->name);
 
        return 0;
 
@@ -1574,7 +1574,7 @@ static int vlsi_close(struct net_device *ndev)
 
        pci_release_regions(idev->pdev);
 
-       IRDA_MESSAGE("%s: device %s stopped\n", __FUNCTION__, ndev->name);
+       IRDA_MESSAGE("%s: device %s stopped\n", __func__, ndev->name);
 
        return 0;
 }
@@ -1593,7 +1593,7 @@ static int vlsi_irda_init(struct net_device *ndev)
 
        if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW)
            || pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) {
-               IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __FUNCTION__);
+               IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__);
                return -1;
        }
 
@@ -1645,14 +1645,14 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        if ( !pci_resource_start(pdev,0)
             || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) {
-               IRDA_ERROR("%s: bar 0 invalid", __FUNCTION__);
+               IRDA_ERROR("%s: bar 0 invalid", __func__);
                goto out_disable;
        }
 
        ndev = alloc_irdadev(sizeof(*idev));
        if (ndev==NULL) {
                IRDA_ERROR("%s: Unable to allocate device memory.\n",
-                          __FUNCTION__);
+                          __func__);
                goto out_disable;
        }
 
@@ -1667,7 +1667,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto out_freedev;
 
        if (register_netdev(ndev) < 0) {
-               IRDA_ERROR("%s: register_netdev failed\n", __FUNCTION__);
+               IRDA_ERROR("%s: register_netdev failed\n", __func__);
                goto out_freedev;
        }
 
@@ -1678,7 +1678,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                                       vlsi_proc_root, VLSI_PROC_FOPS, ndev);
                if (!ent) {
                        IRDA_WARNING("%s: failed to create proc entry\n",
-                                    __FUNCTION__);
+                                    __func__);
                } else {
                        ent->size = 0;
                }
@@ -1745,7 +1745,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
 
        if (!ndev) {
                IRDA_ERROR("%s - %s: no netdevice \n",
-                          __FUNCTION__, pci_name(pdev));
+                          __func__, pci_name(pdev));
                return 0;
        }
        idev = ndev->priv;      
@@ -1756,7 +1756,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
                        pdev->current_state = state.event;
                }
                else
-                       IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, pci_name(pdev), pdev->current_state, state.event);
+                       IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __func__, pci_name(pdev), pdev->current_state, state.event);
                mutex_unlock(&idev->mtx);
                return 0;
        }
@@ -1784,7 +1784,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
 
        if (!ndev) {
                IRDA_ERROR("%s - %s: no netdevice \n",
-                          __FUNCTION__, pci_name(pdev));
+                          __func__, pci_name(pdev));
                return 0;
        }
        idev = ndev->priv;      
@@ -1792,7 +1792,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
        if (pdev->current_state == 0) {
                mutex_unlock(&idev->mtx);
                IRDA_WARNING("%s - %s: already resumed\n",
-                            __FUNCTION__, pci_name(pdev));
+                            __func__, pci_name(pdev));
                return 0;
        }
        
@@ -1811,7 +1811,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
                 * now we explicitly set pdev->current_state = 0 after enabling the
                 * device and independently resume_ok should catch any garbage config.
                 */
-               IRDA_WARNING("%s - hm, nothing to resume?\n", __FUNCTION__);
+               IRDA_WARNING("%s - hm, nothing to resume?\n", __func__);
                mutex_unlock(&idev->mtx);
                return 0;
        }
index c8b9c74eea524249c443a1e1faa28865ccd5e81d..9b1884329fba39cf1001f63488b0ff17b5fbaee0 100644 (file)
@@ -617,7 +617,7 @@ static inline void rd_set_addr_status(struct ring_descr *rd, dma_addr_t a, u8 s)
         */
 
        if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) {
-               IRDA_ERROR("%s: pci busaddr inconsistency!\n", __FUNCTION__);
+               IRDA_ERROR("%s: pci busaddr inconsistency!\n", __func__);
                dump_stack();
                return;
        }
index 9fd2451b0fb256d584b9dca09c3f12914b8124e8..002a6d769f21f244912b6584c33e9e6a4cc92615 100644 (file)
@@ -114,7 +114,7 @@ static int __init w83977af_init(void)
 {
         int i;
 
-       IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(0, "%s()\n", __func__ );
 
        for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) {
                if (w83977af_open(i, io[i], irq[i], dma[i]) == 0)
@@ -133,7 +133,7 @@ static void __exit w83977af_cleanup(void)
 {
        int i;
 
-        IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
+        IRDA_DEBUG(4, "%s()\n", __func__ );
 
        for (i=0; i < ARRAY_SIZE(dev_self); i++) {
                if (dev_self[i])
@@ -154,12 +154,12 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
         struct w83977af_ir *self;
        int err;
 
-       IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(0, "%s()\n", __func__ );
 
        /* Lock the port that we need */
        if (!request_region(iobase, CHIP_IO_EXTENT, driver_name)) {
                IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n",
-                     __FUNCTION__ , iobase);
+                     __func__ , iobase);
                return -ENODEV;
        }
 
@@ -241,7 +241,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
 
        err = register_netdev(dev);
        if (err) {
-               IRDA_ERROR("%s(), register_netdevice() failed!\n", __FUNCTION__);
+               IRDA_ERROR("%s(), register_netdevice() failed!\n", __func__);
                goto err_out3;
        }
        IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);
@@ -273,7 +273,7 @@ static int w83977af_close(struct w83977af_ir *self)
 {
        int iobase;
 
-       IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(0, "%s()\n", __func__ );
 
         iobase = self->io.fir_base;
 
@@ -294,7 +294,7 @@ static int w83977af_close(struct w83977af_ir *self)
 
        /* Release the PORT that this driver is using */
        IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", 
-             __FUNCTION__ , self->io.fir_base);
+             __func__ , self->io.fir_base);
        release_region(self->io.fir_base, self->io.fir_ext);
 
        if (self->tx_buff.head)
@@ -316,7 +316,7 @@ int w83977af_probe( int iobase, int irq, int dma)
        int i;
        
        for (i=0; i < 2; i++) {
-               IRDA_DEBUG( 0, "%s()\n", __FUNCTION__ );
+               IRDA_DEBUG( 0, "%s()\n", __func__ );
 #ifdef CONFIG_USE_W977_PNP
                /* Enter PnP configuration mode */
                w977_efm_enter(efbase[i]);
@@ -403,7 +403,7 @@ int w83977af_probe( int iobase, int irq, int dma)
                        return 0;
                } else {
                        /* Try next extented function register address */
-                       IRDA_DEBUG( 0, "%s(), Wrong chip version", __FUNCTION__ );
+                       IRDA_DEBUG( 0, "%s(), Wrong chip version", __func__ );
                }
        }       
        return -1;
@@ -439,19 +439,19 @@ void w83977af_change_speed(struct w83977af_ir *self, __u32 speed)
        case 115200: outb(0x01, iobase+ABLL); break;
        case 576000:
                ir_mode = HCR_MIR_576;
-               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__ );
+               IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__ );
                break;
        case 1152000:
                ir_mode = HCR_MIR_1152;
-               IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__ );
+               IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __func__ );
                break;
        case 4000000:
                ir_mode = HCR_FIR;
-               IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__ );
+               IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __func__ );
                break;
        default:
                ir_mode = HCR_FIR;
-               IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", __FUNCTION__ , speed);
+               IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", __func__ , speed);
                break;
        }
 
@@ -501,7 +501,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
 
        iobase = self->io.fir_base;
 
-       IRDA_DEBUG(4, "%s(%ld), skb->len=%d\n", __FUNCTION__ , jiffies, 
+       IRDA_DEBUG(4, "%s(%ld), skb->len=%d\n", __func__ , jiffies,
                   (int) skb->len);
        
        /* Lock transmit buffer */
@@ -549,7 +549,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
                        outb(ICR_ETMRI, iobase+ICR);
                } else {
 #endif
-                       IRDA_DEBUG(4, "%s(%ld), mtt=%d\n", __FUNCTION__ , jiffies, mtt);
+                       IRDA_DEBUG(4, "%s(%ld), mtt=%d\n", __func__ , jiffies, mtt);
                        if (mtt)
                                udelay(mtt);
 
@@ -591,7 +591,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase)
        unsigned long flags;
        __u8 hcr;
 #endif
-        IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__ , self->tx_buff.len);
+        IRDA_DEBUG(4, "%s(), len=%d\n", __func__ , self->tx_buff.len);
 
        /* Save current set */
        set = inb(iobase+SSR);
@@ -643,7 +643,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        int actual = 0;
        __u8 set;
        
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(4, "%s()\n", __func__ );
 
        /* Save current bank */
        set = inb(iobase+SSR);
@@ -651,11 +651,11 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        switch_bank(iobase, SET0);
        if (!(inb_p(iobase+USR) & USR_TSRE)) {
                IRDA_DEBUG(4,
-                          "%s(), warning, FIFO not empty yet!\n", __FUNCTION__  );
+                          "%s(), warning, FIFO not empty yet!\n", __func__  );
 
                fifo_size -= 17;
                IRDA_DEBUG(4, "%s(), %d bytes left in tx fifo\n", 
-                          __FUNCTION__ , fifo_size);
+                          __func__ , fifo_size);
        }
 
        /* Fill FIFO with current frame */
@@ -665,7 +665,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
        }
         
        IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", 
-                  __FUNCTION__ , fifo_size, actual, len);
+                  __func__ , fifo_size, actual, len);
 
        /* Restore bank */
        outb(set, iobase+SSR);
@@ -685,7 +685,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
        int iobase;
        __u8 set;
 
-       IRDA_DEBUG(4, "%s(%ld)\n", __FUNCTION__ , jiffies);
+       IRDA_DEBUG(4, "%s(%ld)\n", __func__ , jiffies);
 
        IRDA_ASSERT(self != NULL, return;);
 
@@ -700,7 +700,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
        
        /* Check for underrrun! */
        if (inb(iobase+AUDR) & AUDR_UNDR) {
-               IRDA_DEBUG(0, "%s(), Transmit underrun!\n", __FUNCTION__ );
+               IRDA_DEBUG(0, "%s(), Transmit underrun!\n", __func__ );
                
                self->stats.tx_errors++;
                self->stats.tx_fifo_errors++;
@@ -741,7 +741,7 @@ int w83977af_dma_receive(struct w83977af_ir *self)
 #endif
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(4, "%s\n", __FUNCTION__ );
+       IRDA_DEBUG(4, "%s\n", __func__ );
 
        iobase= self->io.fir_base;
 
@@ -812,7 +812,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self)
        __u8 set;
        __u8 status;
 
-       IRDA_DEBUG(4, "%s\n", __FUNCTION__ );
+       IRDA_DEBUG(4, "%s\n", __func__ );
 
        st_fifo = &self->st_fifo;
 
@@ -892,7 +892,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self)
                        skb = dev_alloc_skb(len+1);
                        if (skb == NULL)  {
                                printk(KERN_INFO
-                                      "%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
+                                      "%s(), memory squeeze, dropping frame.\n", __func__);
                                /* Restore set register */
                                outb(set, iobase+SSR);
 
@@ -943,7 +943,7 @@ static void w83977af_pio_receive(struct w83977af_ir *self)
        __u8 byte = 0x00;
        int iobase;
 
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(4, "%s()\n", __func__ );
 
        IRDA_ASSERT(self != NULL, return;);
        
@@ -970,7 +970,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr)
        __u8 set;
        int iobase;
 
-       IRDA_DEBUG(4, "%s(), isr=%#x\n", __FUNCTION__ , isr);
+       IRDA_DEBUG(4, "%s(), isr=%#x\n", __func__ , isr);
        
        iobase = self->io.fir_base;
        /* Transmit FIFO low on data */
@@ -1007,7 +1007,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr)
                /* Check if we need to change the speed? */
                if (self->new_speed) {
                        IRDA_DEBUG(2,
-                                  "%s(), Changing speed!\n", __FUNCTION__ );
+                                  "%s(), Changing speed!\n", __func__ );
                        w83977af_change_speed(self, self->new_speed);
                        self->new_speed = 0;
                }
@@ -1189,7 +1189,7 @@ static int w83977af_net_open(struct net_device *dev)
        char hwname[32];
        __u8 set;
        
-       IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(0, "%s()\n", __func__ );
        
        IRDA_ASSERT(dev != NULL, return -1;);
        self = (struct w83977af_ir *) dev->priv;
@@ -1252,7 +1252,7 @@ static int w83977af_net_close(struct net_device *dev)
        int iobase;
        __u8 set;
 
-       IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+       IRDA_DEBUG(0, "%s()\n", __func__ );
 
        IRDA_ASSERT(dev != NULL, return -1;);
        
@@ -1307,7 +1307,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
        IRDA_ASSERT(self != NULL, return -1;);
 
-       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__ , dev->name, cmd);
+       IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__ , dev->name, cmd);
        
        spin_lock_irqsave(&self->lock, flags);
 
index 8a97a0066a886d5bae454fb7c703900c13dc2326..46819af3b0627aec89649245ded32ccf53c7e028 100644 (file)
@@ -55,7 +55,7 @@
 #include <asm/system.h>
 
 static char mv643xx_eth_driver_name[] = "mv643xx_eth";
-static char mv643xx_eth_driver_version[] = "1.1";
+static char mv643xx_eth_driver_version[] = "1.2";
 
 #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX
 #define MV643XX_ETH_NAPI
@@ -90,12 +90,21 @@ static char mv643xx_eth_driver_version[] = "1.1";
 #define PORT_SERIAL_CONTROL(p)         (0x043c + ((p) << 10))
 #define PORT_STATUS(p)                 (0x0444 + ((p) << 10))
 #define  TX_FIFO_EMPTY                 0x00000400
+#define  TX_IN_PROGRESS                        0x00000080
+#define  PORT_SPEED_MASK               0x00000030
+#define  PORT_SPEED_1000               0x00000010
+#define  PORT_SPEED_100                        0x00000020
+#define  PORT_SPEED_10                 0x00000000
+#define  FLOW_CONTROL_ENABLED          0x00000008
+#define  FULL_DUPLEX                   0x00000004
+#define  LINK_UP                       0x00000002
 #define TXQ_COMMAND(p)                 (0x0448 + ((p) << 10))
 #define TXQ_FIX_PRIO_CONF(p)           (0x044c + ((p) << 10))
 #define TX_BW_RATE(p)                  (0x0450 + ((p) << 10))
 #define TX_BW_MTU(p)                   (0x0458 + ((p) << 10))
 #define TX_BW_BURST(p)                 (0x045c + ((p) << 10))
 #define INT_CAUSE(p)                   (0x0460 + ((p) << 10))
+#define  INT_TX_END_0                  0x00080000
 #define  INT_TX_END                    0x07f80000
 #define  INT_RX                                0x0007fbfc
 #define  INT_EXT                       0x00000002
@@ -127,21 +136,21 @@ static char mv643xx_eth_driver_version[] = "1.1";
 /*
  * SDMA configuration register.
  */
-#define RX_BURST_SIZE_4_64BIT          (2 << 1)
+#define RX_BURST_SIZE_16_64BIT         (4 << 1)
 #define BLM_RX_NO_SWAP                 (1 << 4)
 #define BLM_TX_NO_SWAP                 (1 << 5)
-#define TX_BURST_SIZE_4_64BIT          (2 << 22)
+#define TX_BURST_SIZE_16_64BIT         (4 << 22)
 
 #if defined(__BIG_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE         \
-               RX_BURST_SIZE_4_64BIT   |       \
-               TX_BURST_SIZE_4_64BIT
+               RX_BURST_SIZE_16_64BIT  |       \
+               TX_BURST_SIZE_16_64BIT
 #elif defined(__LITTLE_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE         \
-               RX_BURST_SIZE_4_64BIT   |       \
+               RX_BURST_SIZE_16_64BIT  |       \
                BLM_RX_NO_SWAP          |       \
                BLM_TX_NO_SWAP          |       \
-               TX_BURST_SIZE_4_64BIT
+               TX_BURST_SIZE_16_64BIT
 #else
 #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined
 #endif
@@ -153,9 +162,7 @@ static char mv643xx_eth_driver_version[] = "1.1";
 #define SET_MII_SPEED_TO_100                   (1 << 24)
 #define SET_GMII_SPEED_TO_1000                 (1 << 23)
 #define SET_FULL_DUPLEX_MODE                   (1 << 21)
-#define MAX_RX_PACKET_1522BYTE                 (1 << 17)
 #define MAX_RX_PACKET_9700BYTE                 (5 << 17)
-#define MAX_RX_PACKET_MASK                     (7 << 17)
 #define DISABLE_AUTO_NEG_SPEED_GMII            (1 << 13)
 #define DO_NOT_FORCE_LINK_FAIL                 (1 << 10)
 #define SERIAL_PORT_CONTROL_RESERVED           (1 << 9)
@@ -228,6 +235,8 @@ struct tx_desc {
 #define GEN_IP_V4_CHECKSUM             0x00040000
 #define GEN_TCP_UDP_CHECKSUM           0x00020000
 #define UDP_FRAME                      0x00010000
+#define MAC_HDR_EXTRA_4_BYTES          0x00008000
+#define MAC_HDR_EXTRA_8_BYTES          0x00000200
 
 #define TX_IHL_SHIFT                   11
 
@@ -404,6 +413,17 @@ static void rxq_disable(struct rx_queue *rxq)
                udelay(10);
 }
 
+static void txq_reset_hw_ptr(struct tx_queue *txq)
+{
+       struct mv643xx_eth_private *mp = txq_to_mp(txq);
+       int off = TXQ_CURRENT_DESC_PTR(mp->port_num, txq->index);
+       u32 addr;
+
+       addr = (u32)txq->tx_desc_dma;
+       addr += txq->tx_curr_desc * sizeof(struct tx_desc);
+       wrl(mp, off, addr);
+}
+
 static void txq_enable(struct tx_queue *txq)
 {
        struct mv643xx_eth_private *mp = txq_to_mp(txq);
@@ -614,6 +634,12 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
                for (i = 0; i < 8; i++)
                        if (mp->txq_mask & (1 << i))
                                txq_reclaim(mp->txq + i, 0);
+
+               if (netif_carrier_ok(mp->dev)) {
+                       spin_lock(&mp->lock);
+                       __txq_maybe_wake(mp->txq + mp->txq_primary);
+                       spin_unlock(&mp->lock);
+               }
        }
 #endif
 
@@ -706,6 +732,7 @@ static inline __be16 sum16_as_be(__sum16 sum)
 
 static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb)
 {
+       struct mv643xx_eth_private *mp = txq_to_mp(txq);
        int nr_frags = skb_shinfo(skb)->nr_frags;
        int tx_index;
        struct tx_desc *desc;
@@ -732,12 +759,36 @@ static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb)
        desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
-               BUG_ON(skb->protocol != htons(ETH_P_IP));
+               int mac_hdr_len;
+
+               BUG_ON(skb->protocol != htons(ETH_P_IP) &&
+                      skb->protocol != htons(ETH_P_8021Q));
 
                cmd_sts |= GEN_TCP_UDP_CHECKSUM |
                           GEN_IP_V4_CHECKSUM   |
                           ip_hdr(skb)->ihl << TX_IHL_SHIFT;
 
+               mac_hdr_len = (void *)ip_hdr(skb) - (void *)skb->data;
+               switch (mac_hdr_len - ETH_HLEN) {
+               case 0:
+                       break;
+               case 4:
+                       cmd_sts |= MAC_HDR_EXTRA_4_BYTES;
+                       break;
+               case 8:
+                       cmd_sts |= MAC_HDR_EXTRA_8_BYTES;
+                       break;
+               case 12:
+                       cmd_sts |= MAC_HDR_EXTRA_4_BYTES;
+                       cmd_sts |= MAC_HDR_EXTRA_8_BYTES;
+                       break;
+               default:
+                       if (net_ratelimit())
+                               dev_printk(KERN_ERR, &txq_to_mp(txq)->dev->dev,
+                                  "mac header length is %d?!\n", mac_hdr_len);
+                       break;
+               }
+
                switch (ip_hdr(skb)->protocol) {
                case IPPROTO_UDP:
                        cmd_sts |= UDP_FRAME;
@@ -759,6 +810,10 @@ static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb)
        wmb();
        desc->cmd_sts = cmd_sts;
 
+       /* clear TX_END interrupt status */
+       wrl(mp, INT_CAUSE(mp->port_num), ~(INT_TX_END_0 << txq->index));
+       rdl(mp, INT_CAUSE(mp->port_num));
+
        /* ensure all descriptors are written before poking hardware */
        wmb();
        txq_enable(txq);
@@ -1112,10 +1167,28 @@ static int mv643xx_eth_get_settings(struct net_device *dev, struct ethtool_cmd *
 
 static int mv643xx_eth_get_settings_phyless(struct net_device *dev, struct ethtool_cmd *cmd)
 {
+       struct mv643xx_eth_private *mp = netdev_priv(dev);
+       u32 port_status;
+
+       port_status = rdl(mp, PORT_STATUS(mp->port_num));
+
        cmd->supported = SUPPORTED_MII;
        cmd->advertising = ADVERTISED_MII;
-       cmd->speed = SPEED_1000;
-       cmd->duplex = DUPLEX_FULL;
+       switch (port_status & PORT_SPEED_MASK) {
+       case PORT_SPEED_10:
+               cmd->speed = SPEED_10;
+               break;
+       case PORT_SPEED_100:
+               cmd->speed = SPEED_100;
+               break;
+       case PORT_SPEED_1000:
+               cmd->speed = SPEED_1000;
+               break;
+       default:
+               cmd->speed = -1;
+               break;
+       }
+       cmd->duplex = (port_status & FULL_DUPLEX) ? DUPLEX_FULL : DUPLEX_HALF;
        cmd->port = PORT_MII;
        cmd->phy_address = 0;
        cmd->transceiver = XCVR_INTERNAL;
@@ -1539,8 +1612,11 @@ static int txq_init(struct mv643xx_eth_private *mp, int index)
 
        tx_desc = (struct tx_desc *)txq->tx_desc_area;
        for (i = 0; i < txq->tx_ring_size; i++) {
+               struct tx_desc *txd = tx_desc + i;
                int nexti = (i + 1) % txq->tx_ring_size;
-               tx_desc[i].next_desc_ptr = txq->tx_desc_dma +
+
+               txd->cmd_sts = 0;
+               txd->next_desc_ptr = txq->tx_desc_dma +
                                        nexti * sizeof(struct tx_desc);
        }
 
@@ -1577,8 +1653,11 @@ static void txq_reclaim(struct tx_queue *txq, int force)
                desc = &txq->tx_desc_area[tx_index];
                cmd_sts = desc->cmd_sts;
 
-               if (!force && (cmd_sts & BUFFER_OWNED_BY_DMA))
-                       break;
+               if (cmd_sts & BUFFER_OWNED_BY_DMA) {
+                       if (!force)
+                               break;
+                       desc->cmd_sts = cmd_sts & ~BUFFER_OWNED_BY_DMA;
+               }
 
                txq->tx_used_desc = (tx_index + 1) % txq->tx_ring_size;
                txq->tx_desc_count--;
@@ -1632,49 +1711,61 @@ static void txq_deinit(struct tx_queue *txq)
 
 
 /* netdev ops and related ***************************************************/
-static void update_pscr(struct mv643xx_eth_private *mp, int speed, int duplex)
+static void handle_link_event(struct mv643xx_eth_private *mp)
 {
-       u32 pscr_o;
-       u32 pscr_n;
-
-       pscr_o = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num));
+       struct net_device *dev = mp->dev;
+       u32 port_status;
+       int speed;
+       int duplex;
+       int fc;
+
+       port_status = rdl(mp, PORT_STATUS(mp->port_num));
+       if (!(port_status & LINK_UP)) {
+               if (netif_carrier_ok(dev)) {
+                       int i;
 
-       /* clear speed, duplex and rx buffer size fields */
-       pscr_n = pscr_o & ~(SET_MII_SPEED_TO_100   |
-                           SET_GMII_SPEED_TO_1000 |
-                           SET_FULL_DUPLEX_MODE   |
-                           MAX_RX_PACKET_MASK);
+                       printk(KERN_INFO "%s: link down\n", dev->name);
 
-       if (speed == SPEED_1000) {
-               pscr_n |= SET_GMII_SPEED_TO_1000 | MAX_RX_PACKET_9700BYTE;
-       } else {
-               if (speed == SPEED_100)
-                       pscr_n |= SET_MII_SPEED_TO_100;
-               pscr_n |= MAX_RX_PACKET_1522BYTE;
-       }
+                       netif_carrier_off(dev);
+                       netif_stop_queue(dev);
 
-       if (duplex == DUPLEX_FULL)
-               pscr_n |= SET_FULL_DUPLEX_MODE;
+                       for (i = 0; i < 8; i++) {
+                               struct tx_queue *txq = mp->txq + i;
 
-       if (pscr_n != pscr_o) {
-               if ((pscr_o & SERIAL_PORT_ENABLE) == 0)
-                       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n);
-               else {
-                       int i;
+                               if (mp->txq_mask & (1 << i)) {
+                                       txq_reclaim(txq, 1);
+                                       txq_reset_hw_ptr(txq);
+                               }
+                       }
+               }
+               return;
+       }
 
-                       for (i = 0; i < 8; i++)
-                               if (mp->txq_mask & (1 << i))
-                                       txq_disable(mp->txq + i);
+       switch (port_status & PORT_SPEED_MASK) {
+       case PORT_SPEED_10:
+               speed = 10;
+               break;
+       case PORT_SPEED_100:
+               speed = 100;
+               break;
+       case PORT_SPEED_1000:
+               speed = 1000;
+               break;
+       default:
+               speed = -1;
+               break;
+       }
+       duplex = (port_status & FULL_DUPLEX) ? 1 : 0;
+       fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0;
 
-                       pscr_o &= ~SERIAL_PORT_ENABLE;
-                       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_o);
-                       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n);
-                       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n);
+       printk(KERN_INFO "%s: link up, %d Mb/s, %s duplex, "
+                        "flow control %sabled\n", dev->name,
+                        speed, duplex ? "full" : "half",
+                        fc ? "en" : "dis");
 
-                       for (i = 0; i < 8; i++)
-                               if (mp->txq_mask & (1 << i))
-                                       txq_enable(mp->txq + i);
-               }
+       if (!netif_carrier_ok(dev)) {
+               netif_carrier_on(dev);
+               netif_wake_queue(dev);
        }
 }
 
@@ -1684,7 +1775,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
        struct mv643xx_eth_private *mp = netdev_priv(dev);
        u32 int_cause;
        u32 int_cause_ext;
-       u32 txq_active;
 
        int_cause = rdl(mp, INT_CAUSE(mp->port_num)) &
                        (INT_TX_END | INT_RX | INT_EXT);
@@ -1698,30 +1788,8 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
                wrl(mp, INT_CAUSE_EXT(mp->port_num), ~int_cause_ext);
        }
 
-       if (int_cause_ext & (INT_EXT_PHY | INT_EXT_LINK)) {
-               if (mp->phy_addr == -1 || mii_link_ok(&mp->mii)) {
-                       int i;
-
-                       if (mp->phy_addr != -1) {
-                               struct ethtool_cmd cmd;
-
-                               mii_ethtool_gset(&mp->mii, &cmd);
-                               update_pscr(mp, cmd.speed, cmd.duplex);
-                       }
-
-                       for (i = 0; i < 8; i++)
-                               if (mp->txq_mask & (1 << i))
-                                       txq_enable(mp->txq + i);
-
-                       if (!netif_carrier_ok(dev)) {
-                               netif_carrier_on(dev);
-                               __txq_maybe_wake(mp->txq + mp->txq_primary);
-                       }
-               } else if (netif_carrier_ok(dev)) {
-                       netif_stop_queue(dev);
-                       netif_carrier_off(dev);
-               }
-       }
+       if (int_cause_ext & (INT_EXT_PHY | INT_EXT_LINK))
+               handle_link_event(mp);
 
        /*
         * RxBuffer or RxError set for any of the 8 queues?
@@ -1743,8 +1811,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
        }
 #endif
 
-       txq_active = rdl(mp, TXQ_COMMAND(mp->port_num));
-
        /*
         * TxBuffer or TxError set for any of the 8 queues?
         */
@@ -1754,6 +1820,16 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
                for (i = 0; i < 8; i++)
                        if (mp->txq_mask & (1 << i))
                                txq_reclaim(mp->txq + i, 0);
+
+               /*
+                * Enough space again in the primary TX queue for a
+                * full packet?
+                */
+               if (netif_carrier_ok(dev)) {
+                       spin_lock(&mp->lock);
+                       __txq_maybe_wake(mp->txq + mp->txq_primary);
+                       spin_unlock(&mp->lock);
+               }
        }
 
        /*
@@ -1763,19 +1839,25 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
                int i;
 
                wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_TX_END));
+
+               spin_lock(&mp->lock);
                for (i = 0; i < 8; i++) {
                        struct tx_queue *txq = mp->txq + i;
-                       if (txq->tx_desc_count && !((txq_active >> i) & 1))
+                       u32 hw_desc_ptr;
+                       u32 expected_ptr;
+
+                       if ((int_cause & (INT_TX_END_0 << i)) == 0)
+                               continue;
+
+                       hw_desc_ptr =
+                               rdl(mp, TXQ_CURRENT_DESC_PTR(mp->port_num, i));
+                       expected_ptr = (u32)txq->tx_desc_dma +
+                               txq->tx_curr_desc * sizeof(struct tx_desc);
+
+                       if (hw_desc_ptr != expected_ptr)
                                txq_enable(txq);
                }
-       }
-
-       /*
-        * Enough space again in the primary TX queue for a full packet?
-        */
-       if (int_cause_ext & INT_EXT_TX) {
-               struct tx_queue *txq = mp->txq + mp->txq_primary;
-               __txq_maybe_wake(txq);
+               spin_unlock(&mp->lock);
        }
 
        return IRQ_HANDLED;
@@ -1785,14 +1867,14 @@ static void phy_reset(struct mv643xx_eth_private *mp)
 {
        unsigned int data;
 
-       smi_reg_read(mp, mp->phy_addr, 0, &data);
-       data |= 0x8000;
-       smi_reg_write(mp, mp->phy_addr, 0, data);
+       smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
+       data |= BMCR_RESET;
+       smi_reg_write(mp, mp->phy_addr, MII_BMCR, data);
 
        do {
                udelay(1);
-               smi_reg_read(mp, mp->phy_addr, 0, &data);
-       } while (data & 0x8000);
+               smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
+       } while (data & BMCR_RESET);
 }
 
 static void port_start(struct mv643xx_eth_private *mp)
@@ -1800,23 +1882,6 @@ static void port_start(struct mv643xx_eth_private *mp)
        u32 pscr;
        int i;
 
-       /*
-        * Configure basic link parameters.
-        */
-       pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num));
-       pscr &= ~(SERIAL_PORT_ENABLE | FORCE_LINK_PASS);
-       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
-       pscr |= DISABLE_AUTO_NEG_FOR_FLOW_CTRL |
-               DISABLE_AUTO_NEG_SPEED_GMII    |
-               DISABLE_AUTO_NEG_FOR_DUPLEX    |
-               DO_NOT_FORCE_LINK_FAIL         |
-               SERIAL_PORT_CONTROL_RESERVED;
-       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
-       pscr |= SERIAL_PORT_ENABLE;
-       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
-
-       wrl(mp, SDMA_CONFIG(mp->port_num), PORT_SDMA_CONFIG_DEFAULT_VALUE);
-
        /*
         * Perform PHY reset, if there is a PHY.
         */
@@ -1828,22 +1893,32 @@ static void port_start(struct mv643xx_eth_private *mp)
                mv643xx_eth_set_settings(mp->dev, &cmd);
        }
 
+       /*
+        * Configure basic link parameters.
+        */
+       pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num));
+
+       pscr |= SERIAL_PORT_ENABLE;
+       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
+
+       pscr |= DO_NOT_FORCE_LINK_FAIL;
+       if (mp->phy_addr == -1)
+               pscr |= FORCE_LINK_PASS;
+       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
+
+       wrl(mp, SDMA_CONFIG(mp->port_num), PORT_SDMA_CONFIG_DEFAULT_VALUE);
+
        /*
         * Configure TX path and queues.
         */
        tx_set_rate(mp, 1000000000, 16777216);
        for (i = 0; i < 8; i++) {
                struct tx_queue *txq = mp->txq + i;
-               int off = TXQ_CURRENT_DESC_PTR(mp->port_num, i);
-               u32 addr;
 
                if ((mp->txq_mask & (1 << i)) == 0)
                        continue;
 
-               addr = (u32)txq->tx_desc_dma;
-               addr += txq->tx_curr_desc * sizeof(struct tx_desc);
-               wrl(mp, off, addr);
-
+               txq_reset_hw_ptr(txq);
                txq_set_rate(txq, 1000000000, 16777216);
                txq_set_fixed_prio_mode(txq);
        }
@@ -1965,6 +2040,9 @@ static int mv643xx_eth_open(struct net_device *dev)
        napi_enable(&mp->napi);
 #endif
 
+       netif_carrier_off(dev);
+       netif_stop_queue(dev);
+
        port_start(mp);
 
        set_rx_coal(mp, 0);
@@ -1999,8 +2077,14 @@ static void port_reset(struct mv643xx_eth_private *mp)
                if (mp->txq_mask & (1 << i))
                        txq_disable(mp->txq + i);
        }
-       while (!(rdl(mp, PORT_STATUS(mp->port_num)) & TX_FIFO_EMPTY))
+
+       while (1) {
+               u32 ps = rdl(mp, PORT_STATUS(mp->port_num));
+
+               if ((ps & (TX_IN_PROGRESS | TX_FIFO_EMPTY)) == TX_FIFO_EMPTY)
+                       break;
                udelay(10);
+       }
 
        /* Reset the Enable bit in the Configuration Register */
        data = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num));
@@ -2202,7 +2286,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
        int ret;
 
        if (!mv643xx_eth_version_printed++)
-               printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n");
+               printk(KERN_NOTICE "MV-643xx 10/100/1000 ethernet "
+                       "driver version %s\n", mv643xx_eth_driver_version);
 
        ret = -EINVAL;
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -2338,14 +2423,14 @@ static int phy_detect(struct mv643xx_eth_private *mp)
        unsigned int data;
        unsigned int data2;
 
-       smi_reg_read(mp, mp->phy_addr, 0, &data);
-       smi_reg_write(mp, mp->phy_addr, 0, data ^ 0x1000);
+       smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
+       smi_reg_write(mp, mp->phy_addr, MII_BMCR, data ^ BMCR_ANENABLE);
 
-       smi_reg_read(mp, mp->phy_addr, 0, &data2);
-       if (((data ^ data2) & 0x1000) == 0)
+       smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data2);
+       if (((data ^ data2) & BMCR_ANENABLE) == 0)
                return -ENODEV;
 
-       smi_reg_write(mp, mp->phy_addr, 0, data);
+       smi_reg_write(mp, mp->phy_addr, MII_BMCR, data);
 
        return 0;
 }
@@ -2393,12 +2478,39 @@ static int phy_init(struct mv643xx_eth_private *mp,
                cmd.duplex = pd->duplex;
        }
 
-       update_pscr(mp, cmd.speed, cmd.duplex);
        mv643xx_eth_set_settings(mp->dev, &cmd);
 
        return 0;
 }
 
+static void init_pscr(struct mv643xx_eth_private *mp, int speed, int duplex)
+{
+       u32 pscr;
+
+       pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num));
+       if (pscr & SERIAL_PORT_ENABLE) {
+               pscr &= ~SERIAL_PORT_ENABLE;
+               wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
+       }
+
+       pscr = MAX_RX_PACKET_9700BYTE | SERIAL_PORT_CONTROL_RESERVED;
+       if (mp->phy_addr == -1) {
+               pscr |= DISABLE_AUTO_NEG_SPEED_GMII;
+               if (speed == SPEED_1000)
+                       pscr |= SET_GMII_SPEED_TO_1000;
+               else if (speed == SPEED_100)
+                       pscr |= SET_MII_SPEED_TO_100;
+
+               pscr |= DISABLE_AUTO_NEG_FOR_FLOW_CTRL;
+
+               pscr |= DISABLE_AUTO_NEG_FOR_DUPLEX;
+               if (duplex == DUPLEX_FULL)
+                       pscr |= SET_FULL_DUPLEX_MODE;
+       }
+
+       wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr);
+}
+
 static int mv643xx_eth_probe(struct platform_device *pdev)
 {
        struct mv643xx_eth_platform_data *pd;
@@ -2452,6 +2564,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
        } else {
                SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops_phyless);
        }
+       init_pscr(mp, pd->speed, pd->duplex);
 
 
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
@@ -2478,6 +2591,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
         * have to map the buffers to ISA memory which is only 16 MB
         */
        dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
+       dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM;
 #endif
 
        SET_NETDEV_DEV(dev, &pdev->dev);
index 2fec6122c7fa09aa1e6192933c4949c3048eee26..42443d697423d72fef98e52958d514a1ef3c4779 100644 (file)
@@ -536,7 +536,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
 #ifdef CONFIG_NET_POLL_CONTROLLER
        dev->poll_controller = eip_poll;
 #endif
-       NS8390_init(dev, 0);
+       NS8390p_init(dev, 0);
 
        ret = register_netdev(dev);
        if (ret)
@@ -794,7 +794,7 @@ retry:
                if (time_after(jiffies, dma_start + 2*HZ/100)) {                /* 20ms */
                        printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
                        ne_reset_8390(dev);
-                       NS8390_init(dev,1);
+                       NS8390p_init(dev, 1);
                        break;
                }
 
@@ -855,7 +855,7 @@ static int ne_drv_resume(struct platform_device *pdev)
 
        if (netif_running(dev)) {
                ne_reset_8390(dev);
-               NS8390_init(dev, 1);
+               NS8390p_init(dev, 1);
                netif_device_attach(dev);
        }
        return 0;
index e13966bb5f7749d8462e76fb3d9aa802b80eab46..9681618c32321912c522e9953cd71eac4db06443 100644 (file)
@@ -53,7 +53,7 @@ MODULE_LICENSE("GPL");
 
 static char config[MAX_PARAM_LENGTH];
 module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0);
-MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]\n");
+MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]");
 
 #ifndef        MODULE
 static int __init option_setup(char *opt)
index 86d77d05190aca1a89f038b5a1e90dae584d5345..a2b073097e5ce3fcf3645ca8a93a0a0f7cb1da5e 100644 (file)
@@ -3143,7 +3143,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
                pkt_cnt++;
 
                /* Updating the statistics block */
-               nic->stats.tx_bytes += skb->len;
+               nic->dev->stats.tx_bytes += skb->len;
                nic->mac_control.stats_info->sw_stat.mem_freed += skb->truesize;
                dev_kfree_skb_irq(skb);
 
@@ -4896,25 +4896,42 @@ static struct net_device_stats *s2io_get_stats(struct net_device *dev)
        /* Configure Stats for immediate updt */
        s2io_updt_stats(sp);
 
+       /* Using sp->stats as a staging area, because reset (due to mtu
+          change, for example) will clear some hardware counters */
+       dev->stats.tx_packets +=
+               le32_to_cpu(mac_control->stats_info->tmac_frms) - 
+               sp->stats.tx_packets;
        sp->stats.tx_packets =
                le32_to_cpu(mac_control->stats_info->tmac_frms);
+       dev->stats.tx_errors +=
+               le32_to_cpu(mac_control->stats_info->tmac_any_err_frms) -
+               sp->stats.tx_errors;
        sp->stats.tx_errors =
                le32_to_cpu(mac_control->stats_info->tmac_any_err_frms);
+       dev->stats.rx_errors +=
+               le64_to_cpu(mac_control->stats_info->rmac_drop_frms) -
+               sp->stats.rx_errors;
        sp->stats.rx_errors =
                le64_to_cpu(mac_control->stats_info->rmac_drop_frms);
+       dev->stats.multicast =
+               le32_to_cpu(mac_control->stats_info->rmac_vld_mcst_frms) - 
+               sp->stats.multicast;
        sp->stats.multicast =
                le32_to_cpu(mac_control->stats_info->rmac_vld_mcst_frms);
+       dev->stats.rx_length_errors =
+               le64_to_cpu(mac_control->stats_info->rmac_long_frms) - 
+               sp->stats.rx_length_errors;
        sp->stats.rx_length_errors =
                le64_to_cpu(mac_control->stats_info->rmac_long_frms);
 
        /* collect per-ring rx_packets and rx_bytes */
-       sp->stats.rx_packets = sp->stats.rx_bytes = 0;
+       dev->stats.rx_packets = dev->stats.rx_bytes = 0;
        for (i = 0; i < config->rx_ring_num; i++) {
-               sp->stats.rx_packets += mac_control->rings[i].rx_packets;
-               sp->stats.rx_bytes += mac_control->rings[i].rx_bytes;
+               dev->stats.rx_packets += mac_control->rings[i].rx_packets;
+               dev->stats.rx_bytes += mac_control->rings[i].rx_bytes;
        }
 
-       return (&sp->stats);
+       return (&dev->stats);
 }
 
 /**
@@ -7419,7 +7436,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
                if (err_mask != 0x5) {
                        DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%x\n",
                                dev->name, err_mask);
-                       sp->stats.rx_crc_errors++;
+                       dev->stats.rx_crc_errors++;
                        sp->mac_control.stats_info->sw_stat.mem_freed
                                += skb->truesize;
                        dev_kfree_skb(skb);
index c69ba1395fa9d54b0ddcf2044209b202c32343ef..6a06b9503e4fcddd397ff4db1919b5252468f4af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  SuperH Ethernet device driver
  *
- *  Copyright (C) 2006,2007 Nobuhiro Iwamatsu
+ *  Copyright (C) 2006-2008 Nobuhiro Iwamatsu
  *  Copyright (C) 2008 Renesas Solutions Corp.
  *
  *  This program is free software; you can redistribute it and/or modify it
@@ -143,13 +143,39 @@ static struct mdiobb_ops bb_ops = {
        .get_mdio_data = sh_get_mdio,
 };
 
+/* Chip Reset */
 static void sh_eth_reset(struct net_device *ndev)
 {
        u32 ioaddr = ndev->base_addr;
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       int cnt = 100;
+
+       ctrl_outl(EDSR_ENALL, ioaddr + EDSR);
+       ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
+       while (cnt > 0) {
+               if (!(ctrl_inl(ioaddr + EDMR) & 0x3))
+                       break;
+               mdelay(1);
+               cnt--;
+       }
+       if (cnt < 0)
+               printk(KERN_ERR "Device reset fail\n");
+
+       /* Table Init */
+       ctrl_outl(0x0, ioaddr + TDLAR);
+       ctrl_outl(0x0, ioaddr + TDFAR);
+       ctrl_outl(0x0, ioaddr + TDFXR);
+       ctrl_outl(0x0, ioaddr + TDFFR);
+       ctrl_outl(0x0, ioaddr + RDLAR);
+       ctrl_outl(0x0, ioaddr + RDFAR);
+       ctrl_outl(0x0, ioaddr + RDFXR);
+       ctrl_outl(0x0, ioaddr + RDFFR);
+#else
        ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
        mdelay(3);
        ctrl_outl(ctrl_inl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR);
+#endif
 }
 
 /* free skb and descriptor buffer */
@@ -180,6 +206,7 @@ static void sh_eth_ring_free(struct net_device *ndev)
 /* format skb and descriptor buffer */
 static void sh_eth_ring_format(struct net_device *ndev)
 {
+       u32 ioaddr = ndev->base_addr, reserve = 0;
        struct sh_eth_private *mdp = netdev_priv(ndev);
        int i;
        struct sk_buff *skb;
@@ -201,9 +228,15 @@ static void sh_eth_ring_format(struct net_device *ndev)
                mdp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-               skb->dev = ndev;        /* Mark as being used by this device. */
+               skb->dev = ndev; /* Mark as being used by this device. */
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+               reserve = SH7763_SKB_ALIGN
+                       - ((uint32_t)skb->data & (SH7763_SKB_ALIGN-1));
+               if (reserve)
+                       skb_reserve(skb, reserve);
+#else
                skb_reserve(skb, RX_OFFSET);
-
+#endif
                /* RX descriptor */
                rxdesc = &mdp->rx_ring[i];
                rxdesc->addr = (u32)skb->data & ~0x3UL;
@@ -211,12 +244,25 @@ static void sh_eth_ring_format(struct net_device *ndev)
 
                /* The size of the buffer is 16 byte boundary. */
                rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F;
+               /* Rx descriptor address set */
+               if (i == 0) {
+                       ctrl_outl((u32)rxdesc, ioaddr + RDLAR);
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       ctrl_outl((u32)rxdesc, ioaddr + RDFAR);
+#endif
+               }
        }
 
+       /* Rx descriptor address set */
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       ctrl_outl((u32)rxdesc, ioaddr + RDFXR);
+       ctrl_outl(0x1, ioaddr + RDFFR);
+#endif
+
        mdp->dirty_rx = (u32) (i - RX_RING_SIZE);
 
        /* Mark the last entry as wrapping the ring. */
-       rxdesc->status |= cpu_to_le32(RC_RDEL);
+       rxdesc->status |= cpu_to_le32(RD_RDEL);
 
        memset(mdp->tx_ring, 0, tx_ringsize);
 
@@ -226,8 +272,21 @@ static void sh_eth_ring_format(struct net_device *ndev)
                txdesc = &mdp->tx_ring[i];
                txdesc->status = cpu_to_le32(TD_TFP);
                txdesc->buffer_length = 0;
+               if (i == 0) {
+                       /* Rx descriptor address set */
+                       ctrl_outl((u32)txdesc, ioaddr + TDLAR);
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       ctrl_outl((u32)txdesc, ioaddr + TDFAR);
+#endif
+               }
        }
 
+       /* Rx descriptor address set */
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       ctrl_outl((u32)txdesc, ioaddr + TDFXR);
+       ctrl_outl(0x1, ioaddr + TDFFR);
+#endif
+
        txdesc->status |= cpu_to_le32(TD_TDLE);
 }
 
@@ -311,31 +370,43 @@ static int sh_eth_dev_init(struct net_device *ndev)
        /* Soft Reset */
        sh_eth_reset(ndev);
 
-       ctrl_outl(RPADIR_PADS1, ioaddr + RPADIR);       /* SH7712-DMA-RX-PAD2 */
+       /* Descriptor format */
+       sh_eth_ring_format(ndev);
+       ctrl_outl(RPADIR_INIT, ioaddr + RPADIR);
 
        /* all sh_eth int mask */
        ctrl_outl(0, ioaddr + EESIPR);
 
-       /* FIFO size set */
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       ctrl_outl(EDMR_EL, ioaddr + EDMR);
+#else
        ctrl_outl(0, ioaddr + EDMR);    /* Endian change */
+#endif
 
+       /* FIFO size set */
        ctrl_outl((FIFO_SIZE_T | FIFO_SIZE_R), ioaddr + FDR);
        ctrl_outl(0, ioaddr + TFTR);
 
+       /* Frame recv control */
        ctrl_outl(0, ioaddr + RMCR);
 
        rx_int_var = mdp->rx_int_var = DESC_I_RINT8 | DESC_I_RINT5;
        tx_int_var = mdp->tx_int_var = DESC_I_TINT2;
        ctrl_outl(rx_int_var | tx_int_var, ioaddr + TRSCER);
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       /* Burst sycle set */
+       ctrl_outl(0x800, ioaddr + BCULR);
+#endif
+
        ctrl_outl((FIFO_F_D_RFF | FIFO_F_D_RFD), ioaddr + FCFTR);
-       ctrl_outl(0, ioaddr + TRIMD);
 
-       /* Descriptor format */
-       sh_eth_ring_format(ndev);
+#if !defined(CONFIG_CPU_SUBTYPE_SH7763)
+       ctrl_outl(0, ioaddr + TRIMD);
+#endif
 
-       ctrl_outl((u32)mdp->rx_ring, ioaddr + RDLAR);
-       ctrl_outl((u32)mdp->tx_ring, ioaddr + TDLAR);
+       /* Recv frame limit set register */
+       ctrl_outl(RFLR_VALUE, ioaddr + RFLR);
 
        ctrl_outl(ctrl_inl(ioaddr + EESR), ioaddr + EESR);
        ctrl_outl((DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff), ioaddr + EESIPR);
@@ -345,21 +416,26 @@ static int sh_eth_dev_init(struct net_device *ndev)
                ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
 
        ctrl_outl(val, ioaddr + ECMR);
-       ctrl_outl(ECSR_BRCRX | ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD |
-                 ECSIPR_MPDIP, ioaddr + ECSR);
-       ctrl_outl(ECSIPR_BRCRXIP | ECSIPR_PSRTOIP | ECSIPR_LCHNGIP |
-                 ECSIPR_ICDIP | ECSIPR_MPDIP, ioaddr + ECSIPR);
+
+       /* E-MAC Status Register clear */
+       ctrl_outl(ECSR_INIT, ioaddr + ECSR);
+
+       /* E-MAC Interrupt Enable register */
+       ctrl_outl(ECSIPR_INIT, ioaddr + ECSIPR);
 
        /* Set MAC address */
        update_mac_address(ndev);
 
        /* mask reset */
-#if defined(CONFIG_CPU_SUBTYPE_SH7710)
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7763)
        ctrl_outl(APR_AP, ioaddr + APR);
        ctrl_outl(MPR_MP, ioaddr + MPR);
        ctrl_outl(TPAUSER_UNLIMITED, ioaddr + TPAUSER);
+#endif
+#if defined(CONFIG_CPU_SUBTYPE_SH7710)
        ctrl_outl(BCFR_UNLIMITED, ioaddr + BCFR);
 #endif
+
        /* Setting the Rx mode will start the Rx process. */
        ctrl_outl(EDRRR_R, ioaddr + EDRRR);
 
@@ -407,7 +483,7 @@ static int sh_eth_rx(struct net_device *ndev)
        int boguscnt = (mdp->dirty_rx + RX_RING_SIZE) - mdp->cur_rx;
        struct sk_buff *skb;
        u16 pkt_len = 0;
-       u32 desc_status;
+       u32 desc_status, reserve = 0;
 
        rxdesc = &mdp->rx_ring[entry];
        while (!(rxdesc->status & cpu_to_le32(RD_RACT))) {
@@ -454,28 +530,38 @@ static int sh_eth_rx(struct net_device *ndev)
        for (; mdp->cur_rx - mdp->dirty_rx > 0; mdp->dirty_rx++) {
                entry = mdp->dirty_rx % RX_RING_SIZE;
                rxdesc = &mdp->rx_ring[entry];
+               /* The size of the buffer is 16 byte boundary. */
+               rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F;
+
                if (mdp->rx_skbuff[entry] == NULL) {
                        skb = dev_alloc_skb(mdp->rx_buf_sz);
                        mdp->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;  /* Better luck next round. */
                        skb->dev = ndev;
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       reserve = SH7763_SKB_ALIGN
+                               - ((uint32_t)skb->data & (SH7763_SKB_ALIGN-1));
+                       if (reserve)
+                               skb_reserve(skb, reserve);
+#else
                        skb_reserve(skb, RX_OFFSET);
+#endif
+                       skb->ip_summed = CHECKSUM_NONE;
                        rxdesc->addr = (u32)skb->data & ~0x3UL;
                }
-               /* The size of the buffer is 16 byte boundary. */
-               rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F;
                if (entry >= RX_RING_SIZE - 1)
                        rxdesc->status |=
-                       cpu_to_le32(RD_RACT | RD_RFP | RC_RDEL);
+                               cpu_to_le32(RD_RACT | RD_RFP | RD_RDEL);
                else
                        rxdesc->status |=
-                       cpu_to_le32(RD_RACT | RD_RFP);
+                               cpu_to_le32(RD_RACT | RD_RFP);
        }
 
        /* Restart Rx engine if stopped. */
        /* If we don't need to check status, don't. -KDU */
-       ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR);
+       if (!(ctrl_inl(ndev->base_addr + EDRRR) & EDRRR_R))
+               ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR);
 
        return 0;
 }
@@ -529,13 +615,14 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
                        printk(KERN_ERR "Receive Frame Overflow\n");
                }
        }
-
+#if !defined(CONFIG_CPU_SUBTYPE_SH7763)
        if (intr_status & EESR_ADE) {
                if (intr_status & EESR_TDE) {
                        if (intr_status & EESR_TFE)
                                mdp->stats.tx_fifo_errors++;
                }
        }
+#endif
 
        if (intr_status & EESR_RDE) {
                /* Receive Descriptor Empty int */
@@ -550,8 +637,11 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
                mdp->stats.rx_fifo_errors++;
                printk(KERN_ERR "Receive FIFO Overflow\n");
        }
-       if (intr_status &
-           (EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE)) {
+       if (intr_status & (EESR_TWB | EESR_TABT |
+#if !defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       EESR_ADE |
+#endif
+                       EESR_TDE | EESR_TFE)) {
                /* Tx error */
                u32 edtrr = ctrl_inl(ndev->base_addr + EDTRR);
                /* dmesg */
@@ -582,17 +672,23 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
        ioaddr = ndev->base_addr;
        spin_lock(&mdp->lock);
 
+       /* Get interrpt stat */
        intr_status = ctrl_inl(ioaddr + EESR);
        /* Clear interrupt */
        ctrl_outl(intr_status, ioaddr + EESR);
 
-       if (intr_status & (EESR_FRC | EESR_RINT8 |
-                          EESR_RINT5 | EESR_RINT4 | EESR_RINT3 | EESR_RINT2 |
-                          EESR_RINT1))
+       if (intr_status & (EESR_FRC | /* Frame recv*/
+                       EESR_RMAF | /* Multi cast address recv*/
+                       EESR_RRF  | /* Bit frame recv */
+                       EESR_RTLF | /* Long frame recv*/
+                       EESR_RTSF | /* short frame recv */
+                       EESR_PRE  | /* PHY-LSI recv error */
+                       EESR_CERF)){ /* recv frame CRC error */
                sh_eth_rx(ndev);
-       if (intr_status & (EESR_FTC |
-                          EESR_TINT4 | EESR_TINT3 | EESR_TINT2 | EESR_TINT1)) {
+       }
 
+       /* Tx Check */
+       if (intr_status & TX_CHECK) {
                sh_eth_txfree(ndev);
                netif_wake_queue(ndev);
        }
@@ -631,11 +727,32 @@ static void sh_eth_adjust_link(struct net_device *ndev)
                if (phydev->duplex != mdp->duplex) {
                        new_state = 1;
                        mdp->duplex = phydev->duplex;
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       if (mdp->duplex) { /*  FULL */
+                               ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM,
+                                               ioaddr + ECMR);
+                       } else {        /* Half */
+                               ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM,
+                                               ioaddr + ECMR);
+                       }
+#endif
                }
 
                if (phydev->speed != mdp->speed) {
                        new_state = 1;
                        mdp->speed = phydev->speed;
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+                       switch (mdp->speed) {
+                       case 10: /* 10BASE */
+                               ctrl_outl(GECMR_10, ioaddr + GECMR); break;
+                       case 100:/* 100BASE */
+                               ctrl_outl(GECMR_100, ioaddr + GECMR); break;
+                       case 1000: /* 1000BASE */
+                               ctrl_outl(GECMR_1000, ioaddr + GECMR); break;
+                       default:
+                               break;
+                       }
+#endif
                }
                if (mdp->link == PHY_DOWN) {
                        ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_TXF)
@@ -730,7 +847,7 @@ static int sh_eth_open(struct net_device *ndev)
        /* Set the timer to check for link beat. */
        init_timer(&mdp->timer);
        mdp->timer.expires = (jiffies + (24 * HZ)) / 10;/* 2.4 sec. */
-       setup_timer(&mdp->timer, sh_eth_timer, ndev);
+       setup_timer(&mdp->timer, sh_eth_timer, (unsigned long)ndev);
 
        return ret;
 
@@ -820,7 +937,9 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        mdp->cur_tx++;
 
-       ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+       if (!(ctrl_inl(ndev->base_addr + EDTRR) & EDTRR_TRNS))
+               ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+
        ndev->trans_start = jiffies;
 
        return 0;
@@ -877,9 +996,15 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
        ctrl_outl(0, ioaddr + CDCR);    /* (write clear) */
        mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + LCCR);
        ctrl_outl(0, ioaddr + LCCR);    /* (write clear) */
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CERCR);/* CERCR */
+       ctrl_outl(0, ioaddr + CERCR);   /* (write clear) */
+       mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CEECR);/* CEECR */
+       ctrl_outl(0, ioaddr + CEECR);   /* (write clear) */
+#else
        mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CNDCR);
        ctrl_outl(0, ioaddr + CNDCR);   /* (write clear) */
-
+#endif
        return &mdp->stats;
 }
 
@@ -929,8 +1054,13 @@ static void sh_eth_tsu_init(u32 ioaddr)
        ctrl_outl(0, ioaddr + TSU_FWSL0);
        ctrl_outl(0, ioaddr + TSU_FWSL1);
        ctrl_outl(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC);
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+       ctrl_outl(0, ioaddr + TSU_QTAG0);       /* Disable QTAG(0->1) */
+       ctrl_outl(0, ioaddr + TSU_QTAG1);       /* Disable QTAG(1->0) */
+#else
        ctrl_outl(0, ioaddr + TSU_QTAGM0);      /* Disable QTAG(0->1) */
        ctrl_outl(0, ioaddr + TSU_QTAGM1);      /* Disable QTAG(1->0) */
+#endif
        ctrl_outl(0, ioaddr + TSU_FWSR);        /* all interrupt status clear */
        ctrl_outl(0, ioaddr + TSU_FWINMK);      /* Disable all interrupt */
        ctrl_outl(0, ioaddr + TSU_TEN); /* Disable all CAM entry */
@@ -1088,7 +1218,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
        /* First device only init */
        if (!devno) {
                /* reset device */
-               ctrl_outl(ARSTR_ARSTR, ndev->base_addr + ARSTR);
+               ctrl_outl(ARSTR_ARSTR, ARSTR);
                mdelay(1);
 
                /* TSU init (Init only)*/
@@ -1110,8 +1240,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
               ndev->name, CARDNAME, (u32) ndev->base_addr);
 
        for (i = 0; i < 5; i++)
-               printk(KERN_INFO "%2.2x:", ndev->dev_addr[i]);
-       printk(KERN_INFO "%2.2x, IRQ %d.\n", ndev->dev_addr[i], ndev->irq);
+               printk(KERN_INFO "%02X:", ndev->dev_addr[i]);
+       printk(KERN_INFO "%02X, IRQ %d.\n", ndev->dev_addr[i], ndev->irq);
 
        platform_set_drvdata(pdev, ndev);
 
index e01e1c3477156612f3563977fc5efb9eb04bfbd0..45ad1b09ca5a1fa94ee1a80489e736592f8df5bd 100644 (file)
 
 #define CARDNAME       "sh-eth"
 #define TX_TIMEOUT     (5*HZ)
-
-#define TX_RING_SIZE   128     /* Tx ring size */
-#define RX_RING_SIZE   128     /* Rx ring size */
-#define RX_OFFSET              2       /* skb offset */
+#define TX_RING_SIZE   64      /* Tx ring size */
+#define RX_RING_SIZE   64      /* Rx ring size */
 #define ETHERSMALL             60
 #define PKT_BUF_SZ             1538
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+
+#define SH7763_SKB_ALIGN 32
 /* Chip Base Address */
-#define SH_TSU_ADDR 0xA7000804
+# define SH_TSU_ADDR  0xFFE01800
+# define ARSTR                   0xFFE01800
+
+/* Chip Registers */
+/* E-DMAC */
+# define EDSR    0x000
+# define EDMR    0x400
+# define EDTRR   0x408
+# define EDRRR   0x410
+# define EESR    0x428
+# define EESIPR  0x430
+# define TDLAR   0x010
+# define TDFAR   0x014
+# define TDFXR   0x018
+# define TDFFR   0x01C
+# define RDLAR   0x030
+# define RDFAR   0x034
+# define RDFXR   0x038
+# define RDFFR   0x03C
+# define TRSCER  0x438
+# define RMFCR   0x440
+# define TFTR    0x448
+# define FDR     0x450
+# define RMCR    0x458
+# define RPADIR  0x460
+# define FCFTR   0x468
+
+/* Ether Register */
+# define ECMR    0x500
+# define ECSR    0x510
+# define ECSIPR  0x518
+# define PIR     0x520
+# define PSR     0x528
+# define PIPR    0x52C
+# define RFLR    0x508
+# define APR     0x554
+# define MPR     0x558
+# define PFTCR  0x55C
+# define PFRCR  0x560
+# define TPAUSER 0x564
+# define GECMR   0x5B0
+# define BCULR   0x5B4
+# define MAHR    0x5C0
+# define MALR    0x5C8
+# define TROCR   0x700
+# define CDCR    0x708
+# define LCCR    0x710
+# define CEFCR   0x740
+# define FRECR   0x748
+# define TSFRCR  0x750
+# define TLFRCR  0x758
+# define RFCR    0x760
+# define CERCR   0x768
+# define CEECR   0x770
+# define MAFCR   0x778
+
+/* TSU Absolute Address */
+# define TSU_CTRST       0x004
+# define TSU_FWEN0       0x010
+# define TSU_FWEN1       0x014
+# define TSU_FCM         0x18
+# define TSU_BSYSL0      0x20
+# define TSU_BSYSL1      0x24
+# define TSU_PRISL0      0x28
+# define TSU_PRISL1      0x2C
+# define TSU_FWSL0       0x30
+# define TSU_FWSL1       0x34
+# define TSU_FWSLC       0x38
+# define TSU_QTAG0       0x40
+# define TSU_QTAG1       0x44
+# define TSU_FWSR        0x50
+# define TSU_FWINMK      0x54
+# define TSU_ADQT0       0x48
+# define TSU_ADQT1       0x4C
+# define TSU_VTAG0       0x58
+# define TSU_VTAG1       0x5C
+# define TSU_ADSBSY      0x60
+# define TSU_TEN         0x64
+# define TSU_POST1       0x70
+# define TSU_POST2       0x74
+# define TSU_POST3       0x78
+# define TSU_POST4       0x7C
+# define TSU_ADRH0       0x100
+# define TSU_ADRL0       0x104
+# define TSU_ADRH31      0x1F8
+# define TSU_ADRL31      0x1FC
+
+# define TXNLCR0         0x80
+# define TXALCR0         0x84
+# define RXNLCR0         0x88
+# define RXALCR0         0x8C
+# define FWNLCR0         0x90
+# define FWALCR0         0x94
+# define TXNLCR1         0xA0
+# define TXALCR1         0xA4
+# define RXNLCR1         0xA8
+# define RXALCR1         0xAC
+# define FWNLCR1         0xB0
+# define FWALCR1         0x40
+
+#else /* CONFIG_CPU_SUBTYPE_SH7763 */
+# define RX_OFFSET 2   /* skb offset */
+/* Chip base address */
+# define SH_TSU_ADDR  0xA7000804
+# define ARSTR           0xA7000800
 
 /* Chip Registers */
 /* E-DMAC */
-#define EDMR   0x0000
-#define EDTRR  0x0004
-#define EDRRR  0x0008
-#define TDLAR  0x000C
-#define RDLAR  0x0010
-#define EESR   0x0014
-#define EESIPR 0x0018
-#define TRSCER 0x001C
-#define RMFCR  0x0020
-#define TFTR   0x0024
-#define FDR            0x0028
-#define RMCR   0x002C
-#define EDOCR  0x0030
-#define FCFTR  0x0034
-#define RPADIR 0x0038
-#define TRIMD  0x003C
-#define RBWAR  0x0040
-#define RDFAR  0x0044
-#define TBRAR  0x004C
-#define TDFAR  0x0050
+# define EDMR  0x0000
+# define EDTRR 0x0004
+# define EDRRR 0x0008
+# define TDLAR 0x000C
+# define RDLAR 0x0010
+# define EESR  0x0014
+# define EESIPR        0x0018
+# define TRSCER        0x001C
+# define RMFCR 0x0020
+# define TFTR  0x0024
+# define FDR   0x0028
+# define RMCR  0x002C
+# define EDOCR 0x0030
+# define FCFTR 0x0034
+# define RPADIR        0x0038
+# define TRIMD 0x003C
+# define RBWAR 0x0040
+# define RDFAR 0x0044
+# define TBRAR 0x004C
+# define TDFAR 0x0050
+
 /* Ether Register */
-#define ECMR   0x0160
-#define ECSR   0x0164
-#define ECSIPR 0x0168
-#define PIR            0x016C
-#define MAHR   0x0170
-#define MALR   0x0174
-#define RFLR   0x0178
-#define PSR            0x017C
-#define TROCR  0x0180
-#define CDCR   0x0184
-#define LCCR   0x0188
-#define CNDCR  0x018C
-#define CEFCR  0x0194
-#define FRECR  0x0198
-#define TSFRCR 0x019C
-#define TLFRCR 0x01A0
-#define RFCR   0x01A4
-#define MAFCR  0x01A8
-#define IPGR   0x01B4
-#if defined(CONFIG_CPU_SUBTYPE_SH7710)
-#define APR            0x01B8
-#define MPR    0x01BC
-#define TPAUSER 0x1C4
-#define BCFR   0x1CC
-#endif /* CONFIG_CPU_SH7710 */
-
-#define ARSTR  0x0800
+# define ECMR  0x0160
+# define ECSR  0x0164
+# define ECSIPR        0x0168
+# define PIR   0x016C
+# define MAHR  0x0170
+# define MALR  0x0174
+# define RFLR  0x0178
+# define PSR   0x017C
+# define TROCR 0x0180
+# define CDCR  0x0184
+# define LCCR  0x0188
+# define CNDCR 0x018C
+# define CEFCR 0x0194
+# define FRECR 0x0198
+# define TSFRCR        0x019C
+# define TLFRCR        0x01A0
+# define RFCR  0x01A4
+# define MAFCR 0x01A8
+# define IPGR  0x01B4
+# if defined(CONFIG_CPU_SUBTYPE_SH7710)
+# define APR   0x01B8
+# define MPR   0x01BC
+# define TPAUSER 0x1C4
+# define BCFR  0x1CC
+# endif /* CONFIG_CPU_SH7710 */
 
 /* TSU */
-#define TSU_CTRST      0x004
-#define TSU_FWEN0      0x010
-#define TSU_FWEN1      0x014
-#define TSU_FCM                0x018
-#define TSU_BSYSL0     0x020
-#define TSU_BSYSL1     0x024
-#define TSU_PRISL0     0x028
-#define TSU_PRISL1     0x02C
-#define TSU_FWSL0      0x030
-#define TSU_FWSL1      0x034
-#define TSU_FWSLC      0x038
-#define TSU_QTAGM0     0x040
-#define TSU_QTAGM1     0x044
-#define TSU_ADQT0      0x048
-#define TSU_ADQT1      0x04C
-#define TSU_FWSR       0x050
-#define TSU_FWINMK     0x054
-#define TSU_ADSBSY     0x060
-#define TSU_TEN                0x064
-#define TSU_POST1      0x070
-#define TSU_POST2      0x074
-#define TSU_POST3      0x078
-#define TSU_POST4      0x07C
-#define TXNLCR0                0x080
-#define TXALCR0                0x084
-#define RXNLCR0                0x088
-#define RXALCR0                0x08C
-#define FWNLCR0                0x090
-#define FWALCR0                0x094
-#define TXNLCR1                0x0A0
-#define TXALCR1                0x0A4
-#define RXNLCR1                0x0A8
-#define RXALCR1                0x0AC
-#define FWNLCR1                0x0B0
-#define FWALCR1                0x0B4
+# define TSU_CTRST     0x004
+# define TSU_FWEN0     0x010
+# define TSU_FWEN1     0x014
+# define TSU_FCM       0x018
+# define TSU_BSYSL0    0x020
+# define TSU_BSYSL1    0x024
+# define TSU_PRISL0    0x028
+# define TSU_PRISL1    0x02C
+# define TSU_FWSL0     0x030
+# define TSU_FWSL1     0x034
+# define TSU_FWSLC     0x038
+# define TSU_QTAGM0    0x040
+# define TSU_QTAGM1    0x044
+# define TSU_ADQT0     0x048
+# define TSU_ADQT1     0x04C
+# define TSU_FWSR      0x050
+# define TSU_FWINMK    0x054
+# define TSU_ADSBSY    0x060
+# define TSU_TEN       0x064
+# define TSU_POST1     0x070
+# define TSU_POST2     0x074
+# define TSU_POST3     0x078
+# define TSU_POST4     0x07C
+# define TXNLCR0       0x080
+# define TXALCR0       0x084
+# define RXNLCR0       0x088
+# define RXALCR0       0x08C
+# define FWNLCR0       0x090
+# define FWALCR0       0x094
+# define TXNLCR1       0x0A0
+# define TXALCR1       0x0A4
+# define RXNLCR1       0x0A8
+# define RXALCR1       0x0AC
+# define FWNLCR1       0x0B0
+# define FWALCR1       0x0B4
 
 #define TSU_ADRH0      0x0100
 #define TSU_ADRL0      0x0104
 #define TSU_ADRL31     0x01FC
 
-/* Register's bits */
+#endif /* CONFIG_CPU_SUBTYPE_SH7763 */
+
+/*
+ * Register's bits
+ */
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+/* EDSR */
+enum EDSR_BIT {
+       EDSR_ENT = 0x01, EDSR_ENR = 0x02,
+};
+#define EDSR_ENALL (EDSR_ENT|EDSR_ENR)
+
+/* GECMR */
+enum GECMR_BIT {
+       GECMR_10 = 0x0, GECMR_100 = 0x04, GECMR_1000 = 0x01,
+};
+#endif
 
 /* EDMR */
 enum DMAC_M_BIT {
-       EDMR_DL1 = 0x20, EDMR_DL0 = 0x10, EDMR_SRST = 0x01,
+       EDMR_DL1 = 0x20, EDMR_DL0 = 0x10,
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+       EDMR_SRST       = 0x03,
+       EMDR_DESC_R     = 0x30, /* Descriptor reserve size */
+       EDMR_EL         = 0x40, /* Litte endian */
+#else /* CONFIG_CPU_SUBTYPE_SH7763 */
+       EDMR_SRST = 0x01,
+#endif
 };
 
 /* EDTRR */
 enum DMAC_T_BIT {
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+       EDTRR_TRNS = 0x03,
+#else
        EDTRR_TRNS = 0x01,
+#endif
 };
 
 /* EDRRR*/
@@ -173,21 +304,47 @@ enum PHY_STATUS_BIT { PHY_ST_LINK = 0x01, };
 
 /* EESR */
 enum EESR_BIT {
-       EESR_TWB = 0x40000000, EESR_TABT = 0x04000000,
+#ifndef CONFIG_CPU_SUBTYPE_SH7763
+       EESR_TWB  = 0x40000000,
+#else
+       EESR_TWB  = 0xC0000000,
+       EESR_TC1  = 0x20000000,
+       EESR_TUC  = 0x10000000,
+       EESR_ROC  = 0x80000000,
+#endif
+       EESR_TABT = 0x04000000,
        EESR_RABT = 0x02000000, EESR_RFRMER = 0x01000000,
-       EESR_ADE = 0x00800000, EESR_ECI = 0x00400000,
-       EESR_FTC = 0x00200000, EESR_TDE = 0x00100000,
-       EESR_TFE = 0x00080000, EESR_FRC = 0x00040000,
-       EESR_RDE = 0x00020000, EESR_RFE = 0x00010000,
-       EESR_TINT4 = 0x00000800, EESR_TINT3 = 0x00000400,
-       EESR_TINT2 = 0x00000200, EESR_TINT1 = 0x00000100,
-       EESR_RINT8 = 0x00000080, EESR_RINT5 = 0x00000010,
-       EESR_RINT4 = 0x00000008, EESR_RINT3 = 0x00000004,
-       EESR_RINT2 = 0x00000002, EESR_RINT1 = 0x00000001,
-};
-
-#define EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \
+#ifndef CONFIG_CPU_SUBTYPE_SH7763
+       EESR_ADE  = 0x00800000,
+#endif
+       EESR_ECI  = 0x00400000,
+       EESR_FTC  = 0x00200000, EESR_TDE  = 0x00100000,
+       EESR_TFE  = 0x00080000, EESR_FRC  = 0x00040000,
+       EESR_RDE  = 0x00020000, EESR_RFE  = 0x00010000,
+#ifndef CONFIG_CPU_SUBTYPE_SH7763
+       EESR_CND  = 0x00000800,
+#endif
+       EESR_DLC  = 0x00000400,
+       EESR_CD   = 0x00000200, EESR_RTO  = 0x00000100,
+       EESR_RMAF = 0x00000080, EESR_CEEF = 0x00000040,
+       EESR_CELF = 0x00000020, EESR_RRF  = 0x00000010,
+       EESR_RTLF = 0x00000008, EESR_RTSF = 0x00000004,
+       EESR_PRE  = 0x00000002, EESR_CERF = 0x00000001,
+};
+
+
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+# define TX_CHECK (EESR_TC1 | EESR_FTC)
+# define EESR_ERR_CHECK        (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \
+               | EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI)
+# define TX_ERROR_CEHCK (EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE)
+
+#else
+# define TX_CHECK (EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO)
+# define EESR_ERR_CHECK        (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \
                | EESR_RFRMER | EESR_ADE | EESR_TFE | EESR_TDE | EESR_ECI)
+# define TX_ERROR_CEHCK (EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE)
+#endif
 
 /* EESIPR */
 enum DMAC_IM_BIT {
@@ -207,8 +364,8 @@ enum DMAC_IM_BIT {
 
 /* Receive descriptor bit */
 enum RD_STS_BIT {
-       RD_RACT = 0x80000000, RC_RDEL = 0x40000000,
-       RC_RFP1 = 0x20000000, RC_RFP0 = 0x10000000,
+       RD_RACT = 0x80000000, RD_RDEL = 0x40000000,
+       RD_RFP1 = 0x20000000, RD_RFP0 = 0x10000000,
        RD_RFE = 0x08000000, RD_RFS10 = 0x00000200,
        RD_RFS9 = 0x00000100, RD_RFS8 = 0x00000080,
        RD_RFS7 = 0x00000040, RD_RFS6 = 0x00000020,
@@ -216,9 +373,9 @@ enum RD_STS_BIT {
        RD_RFS3 = 0x00000004, RD_RFS2 = 0x00000002,
        RD_RFS1 = 0x00000001,
 };
-#define RDF1ST RC_RFP1
-#define RDFEND RC_RFP0
-#define RD_RFP (RC_RFP1|RC_RFP0)
+#define RDF1ST RD_RFP1
+#define RDFEND RD_RFP0
+#define RD_RFP (RD_RFP1|RD_RFP0)
 
 /* FCFTR */
 enum FCFTR_BIT {
@@ -231,7 +388,8 @@ enum FCFTR_BIT {
 
 /* Transfer descriptor bit */
 enum TD_STS_BIT {
-       TD_TACT = 0x80000000, TD_TDLE = 0x40000000, TD_TFP1 = 0x20000000,
+       TD_TACT = 0x80000000,
+       TD_TDLE = 0x40000000, TD_TFP1 = 0x20000000,
        TD_TFP0 = 0x10000000,
 };
 #define TDF1ST TD_TFP1
@@ -242,6 +400,10 @@ enum TD_STS_BIT {
 enum RECV_RST_BIT { RMCR_RST = 0x01, };
 /* ECMR */
 enum FELIC_MODE_BIT {
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+       ECMR_TRCCM = 0x04000000, ECMR_RCSC = 0x00800000,
+       ECMR_DPAD = 0x00200000, ECMR_RZPF = 0x00100000,
+#endif
        ECMR_ZPF = 0x00080000, ECMR_PFR = 0x00040000, ECMR_RXF = 0x00020000,
        ECMR_TXF = 0x00010000, ECMR_MCT = 0x00002000, ECMR_PRCEF = 0x00001000,
        ECMR_PMDE = 0x00000200, ECMR_RE = 0x00000040, ECMR_TE = 0x00000020,
@@ -249,18 +411,45 @@ enum FELIC_MODE_BIT {
        ECMR_PRM = 0x00000001,
 };
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+#define ECMR_CHG_DM    (ECMR_TRCCM | ECMR_RZPF | ECMR_ZPF |\
+                       ECMR_PFR | ECMR_RXF | ECMR_TXF | ECMR_MCT)
+#else
+#define ECMR_CHG_DM    (ECMR_ZPF | ECMR_PFR ECMR_RXF | ECMR_TXF | ECMR_MCT)
+#endif
+
 /* ECSR */
 enum ECSR_STATUS_BIT {
-       ECSR_BRCRX = 0x20, ECSR_PSRTO = 0x10, ECSR_LCHNG = 0x04,
+#ifndef CONFIG_CPU_SUBTYPE_SH7763
+       ECSR_BRCRX = 0x20, ECSR_PSRTO = 0x10,
+#endif
+       ECSR_LCHNG = 0x04,
        ECSR_MPD = 0x02, ECSR_ICD = 0x01,
 };
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+# define ECSR_INIT (ECSR_ICD | ECSIPR_MPDIP)
+#else
+# define ECSR_INIT (ECSR_BRCRX | ECSR_PSRTO | \
+                       ECSR_LCHNG | ECSR_ICD | ECSIPR_MPDIP)
+#endif
+
 /* ECSIPR */
 enum ECSIPR_STATUS_MASK_BIT {
-       ECSIPR_BRCRXIP = 0x20, ECSIPR_PSRTOIP = 0x10, ECSIPR_LCHNGIP = 0x04,
+#ifndef CONFIG_CPU_SUBTYPE_SH7763
+       ECSIPR_BRCRXIP = 0x20, ECSIPR_PSRTOIP = 0x10,
+#endif
+       ECSIPR_LCHNGIP = 0x04,
        ECSIPR_MPDIP = 0x02, ECSIPR_ICDIP = 0x01,
 };
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+# define ECSIPR_INIT (ECSIPR_LCHNGIP | ECSIPR_ICDIP | ECSIPR_MPDIP)
+#else
+# define ECSIPR_INIT (ECSIPR_BRCRXIP | ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | \
+                               ECSIPR_ICDIP | ECSIPR_MPDIP)
+#endif
+
 /* APR */
 enum APR_BIT {
        APR_AP = 0x00000001,
@@ -285,6 +474,15 @@ enum RPADIR_BIT {
        RPADIR_PADR = 0x0003f,
 };
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7763)
+# define RPADIR_INIT (0x00)
+#else
+# define RPADIR_INIT (RPADIR_PADS1)
+#endif
+
+/* RFLR */
+#define RFLR_VALUE 0x1000
+
 /* FDR */
 enum FIFO_SIZE_BIT {
        FIFO_SIZE_T = 0x00000700, FIFO_SIZE_R = 0x00000007,
@@ -316,7 +514,7 @@ enum PHY_ANA_BIT {
        PHY_A_NP = 0x8000, PHY_A_ACK = 0x4000, PHY_A_RF = 0x2000,
        PHY_A_FCS = 0x0400, PHY_A_T4 = 0x0200, PHY_A_FDX = 0x0100,
        PHY_A_HDX = 0x0080, PHY_A_10FDX = 0x0040, PHY_A_10HDX = 0x0020,
-       PHY_A_SEL = 0x001f,
+       PHY_A_SEL = 0x001e,
 };
 /* PHY_ANL */
 enum PHY_ANL_BIT {
@@ -449,6 +647,10 @@ struct sh_eth_private {
        struct net_device_stats tsu_stats;      /* TSU forward status */
 };
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7763
+/* SH7763 has endian control register */
+#define swaps(x, y)
+#else
 static void swaps(char *src, int len)
 {
 #ifdef __LITTLE_ENDIAN__
@@ -460,5 +662,5 @@ static void swaps(char *src, int len)
                *p = swab32(*p);
 #endif
 }
-
+#endif /* CONFIG_CPU_SUBTYPE_SH7763 */
 #endif
index ffbfb1b79f97360975cd8da31d198591fde55037..805383b33d3ccf358d185c8bb5f26598b7c89d8d 100644 (file)
@@ -19,6 +19,7 @@
 #include "h/smc.h"
 #include "h/smt_p.h"
 #include <linux/bitrev.h>
+#include <linux/kernel.h>
 
 #define KERNEL
 #include "h/smtstate.h"
@@ -1730,20 +1731,18 @@ void fddi_send_antc(struct s_smc *smc, struct fddi_addr *dest)
 #endif
 
 #ifdef DEBUG
-#define hextoasc(x)    "0123456789abcdef"[x]
-
 char *addr_to_string(struct fddi_addr *addr)
 {
        int     i ;
        static char     string[6*3] = "****" ;
 
        for (i = 0 ; i < 6 ; i++) {
-               string[i*3] = hextoasc((addr->a[i]>>4)&0xf) ;
-               string[i*3+1] = hextoasc((addr->a[i])&0xf) ;
-               string[i*3+2] = ':' ;
+               string[i * 3] = hex_asc_hi(addr->a[i]);
+               string[i * 3 + 1] = hex_asc_lo(addr->a[i]);
+               string[i * 3 + 2] = ':';
        }
-       string[5*3+2] = 0 ;
-       return(string) ;
+       string[5 * 3 + 2] = 0;
+       return(string);
 }
 #endif
 
index 633c128a622868ac91b9cde33b41baf6c4e8e219..26aa37aa531f9d851716074f64cf0976e9f3f590 100644 (file)
@@ -1982,8 +1982,6 @@ static void tg3_power_down_phy(struct tg3 *tp)
 static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
 {
        u32 misc_host_ctrl;
-       u16 power_control, power_caps;
-       int pm = tp->pm_cap;
 
        /* Make sure register accesses (indirect or otherwise)
         * will function correctly.
@@ -1992,18 +1990,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
                               TG3PCI_MISC_HOST_CTRL,
                               tp->misc_host_ctrl);
 
-       pci_read_config_word(tp->pdev,
-                            pm + PCI_PM_CTRL,
-                            &power_control);
-       power_control |= PCI_PM_CTRL_PME_STATUS;
-       power_control &= ~(PCI_PM_CTRL_STATE_MASK);
        switch (state) {
        case PCI_D0:
-               power_control |= 0;
-               pci_write_config_word(tp->pdev,
-                                     pm + PCI_PM_CTRL,
-                                     power_control);
-               udelay(100);    /* Delay after power state change */
+               pci_enable_wake(tp->pdev, state, false);
+               pci_set_power_state(tp->pdev, PCI_D0);
 
                /* Switch out of Vaux if it is a NIC */
                if (tp->tg3_flags2 & TG3_FLG2_IS_NIC)
@@ -2012,26 +2002,15 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
                return 0;
 
        case PCI_D1:
-               power_control |= 1;
-               break;
-
        case PCI_D2:
-               power_control |= 2;
-               break;
-
        case PCI_D3hot:
-               power_control |= 3;
                break;
 
        default:
-               printk(KERN_WARNING PFX "%s: Invalid power state (%d) "
-                      "requested.\n",
-                      tp->dev->name, state);
+               printk(KERN_ERR PFX "%s: Invalid power state (D%d) requested\n",
+                       tp->dev->name, state);
                return -EINVAL;
        }
-
-       power_control |= PCI_PM_CTRL_PME_ENABLE;
-
        misc_host_ctrl = tr32(TG3PCI_MISC_HOST_CTRL);
        tw32(TG3PCI_MISC_HOST_CTRL,
             misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT);
@@ -2109,8 +2088,6 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
                                                     WOL_DRV_WOL |
                                                     WOL_SET_MAGIC_PKT);
 
-       pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps);
-
        if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) {
                u32 mac_mode;
 
@@ -2143,8 +2120,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
                if (!(tp->tg3_flags2 & TG3_FLG2_5750_PLUS))
                        tw32(MAC_LED_CTRL, tp->led_ctrl);
 
-               if (((power_caps & PCI_PM_CAP_PME_D3cold) &&
-                    (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)))
+               if (pci_pme_capable(tp->pdev, state) &&
+                    (tp->tg3_flags & TG3_FLAG_WOL_ENABLE))
                        mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE;
 
                tw32_f(MAC_MODE, mac_mode);
@@ -2236,9 +2213,11 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
 
        tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
 
+       if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)
+               pci_enable_wake(tp->pdev, state, true);
+
        /* Finally, set the new power state. */
-       pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
-       udelay(100);    /* Delay after power state change */
+       pci_set_power_state(tp->pdev, state);
 
        return 0;
 }
@@ -9065,7 +9044,8 @@ static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
        struct tg3 *tp = netdev_priv(dev);
 
-       if (tp->tg3_flags & TG3_FLAG_WOL_CAP)
+       if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
+           device_can_wakeup(&tp->pdev->dev))
                wol->supported = WAKE_MAGIC;
        else
                wol->supported = 0;
@@ -9078,18 +9058,22 @@ static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
        struct tg3 *tp = netdev_priv(dev);
+       struct device *dp = &tp->pdev->dev;
 
        if (wol->wolopts & ~WAKE_MAGIC)
                return -EINVAL;
        if ((wol->wolopts & WAKE_MAGIC) &&
-           !(tp->tg3_flags & TG3_FLAG_WOL_CAP))
+           !((tp->tg3_flags & TG3_FLAG_WOL_CAP) && device_can_wakeup(dp)))
                return -EINVAL;
 
        spin_lock_bh(&tp->lock);
-       if (wol->wolopts & WAKE_MAGIC)
+       if (wol->wolopts & WAKE_MAGIC) {
                tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
-       else
+               device_set_wakeup_enable(dp, true);
+       } else {
                tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE;
+               device_set_wakeup_enable(dp, false);
+       }
        spin_unlock_bh(&tp->lock);
 
        return 0;
@@ -11296,7 +11280,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
                if (val & VCPU_CFGSHDW_ASPM_DBNC)
                        tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
                if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
-                   (val & VCPU_CFGSHDW_WOL_MAGPKT))
+                   (val & VCPU_CFGSHDW_WOL_MAGPKT) &&
+                   device_may_wakeup(&tp->pdev->dev))
                        tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
                return;
        }
@@ -11426,8 +11411,9 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
                    !(nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL))
                        tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
 
-               if (tp->tg3_flags & TG3_FLAG_WOL_CAP &&
-                   nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)
+               if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
+                   (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE) &&
+                   device_may_wakeup(&tp->pdev->dev))
                        tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
 
                if (cfg2 & (1 << 17))
@@ -13613,6 +13599,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct tg3 *tp = netdev_priv(dev);
+       pci_power_t target_state;
        int err;
 
        /* PCI register 4 needs to be saved whether netif_running() or not.
@@ -13641,7 +13628,9 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
        tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
        tg3_full_unlock(tp);
 
-       err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
+       target_state = pdev->pm_cap ? pci_target_state(pdev) : PCI_D3hot;
+
+       err = tg3_set_power_state(tp, target_state);
        if (err) {
                int err2;
 
index 7766cde0d63d99edb91da8b13e5dee6633efd6f5..bf621328b6019e3a89bc21406ecaf4f8370218d9 100644 (file)
@@ -95,20 +95,20 @@ MODULE_DESCRIPTION("3Com 3C359 Velocity XL Token Ring Adapter Driver \n") ;
 static int ringspeed[XL_MAX_ADAPTERS] = {0,} ;
 
 module_param_array(ringspeed, int, NULL, 0);
-MODULE_PARM_DESC(ringspeed,"3c359: Ringspeed selection - 4,16 or 0") ; 
+MODULE_PARM_DESC(ringspeed,"3c359: Ringspeed selection - 4,16 or 0") ;
 
 /* Packet buffer size */
 
 static int pkt_buf_sz[XL_MAX_ADAPTERS] = {0,} ;
  
 module_param_array(pkt_buf_sz, int, NULL, 0) ;
-MODULE_PARM_DESC(pkt_buf_sz,"3c359: Initial buffer size") ; 
+MODULE_PARM_DESC(pkt_buf_sz,"3c359: Initial buffer size") ;
 /* Message Level */
 
-static int message_level[XL_MAX_ADAPTERS] = {0,} ; 
+static int message_level[XL_MAX_ADAPTERS] = {0,} ;
 
 module_param_array(message_level, int, NULL, 0) ;
-MODULE_PARM_DESC(message_level, "3c359: Level of reported messages \n") ; 
+MODULE_PARM_DESC(message_level, "3c359: Level of reported messages") ;
 /* 
  *     This is a real nasty way of doing this, but otherwise you
  *     will be stuck with 1555 lines of hex #'s in the code.
index f7319d326912ffc91330fe722ee4e77eddf661a1..78df2be8a728761cbefe1086ef59e6c7f1f59caf 100644 (file)
 
 static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
 {
+       void *buf;
+       int err = -ENOMEM;
+
        devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length);
-       return usb_control_msg(dev->udev,
-                              usb_rcvctrlpipe(dev->udev, 0),
-                              DM_READ_REGS,
-                              USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                              0, reg, data, length, USB_CTRL_SET_TIMEOUT);
+
+       buf = kmalloc(length, GFP_KERNEL);
+       if (!buf)
+               goto out;
+
+       err = usb_control_msg(dev->udev,
+                             usb_rcvctrlpipe(dev->udev, 0),
+                             DM_READ_REGS,
+                             USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+                             0, reg, buf, length, USB_CTRL_SET_TIMEOUT);
+       if (err == length)
+               memcpy(data, buf, length);
+       else if (err >= 0)
+               err = -EINVAL;
+       kfree(buf);
+
+ out:
+       return err;
 }
 
 static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value)
@@ -70,12 +86,28 @@ static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value)
 
 static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
 {
+       void *buf = NULL;
+       int err = -ENOMEM;
+
        devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length);
-       return usb_control_msg(dev->udev,
-                              usb_sndctrlpipe(dev->udev, 0),
-                              DM_WRITE_REGS,
-                              USB_DIR_OUT | USB_TYPE_VENDOR |USB_RECIP_DEVICE,
-                              0, reg, data, length, USB_CTRL_SET_TIMEOUT);
+
+       if (data) {
+               buf = kmalloc(length, GFP_KERNEL);
+               if (!buf)
+                       goto out;
+               memcpy(buf, data, length);
+       }
+
+       err = usb_control_msg(dev->udev,
+                             usb_sndctrlpipe(dev->udev, 0),
+                             DM_WRITE_REGS,
+                             USB_DIR_OUT | USB_TYPE_VENDOR |USB_RECIP_DEVICE,
+                             0, reg, buf, length, USB_CTRL_SET_TIMEOUT);
+       kfree(buf);
+       if (err >= 0 && err < length)
+               err = -EINVAL;
+ out:
+       return err;
 }
 
 static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
index fa14255282afe96770d5b44cc887fbaba22814df..6f9aa1643743ebca435def239abd16c13f86ffde 100644 (file)
@@ -337,7 +337,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
 #ifdef CONFIG_NET_POLL_CONTROLLER
        dev->poll_controller = ei_poll;
 #endif
-       NS8390_init(dev, 0);
+       NS8390p_init(dev, 0);
 
 #if 1
        /* Enable interrupt generation on softconfig cards -- M.U */
index 1acfbcd3703c229da68be2ee1f58fc97afcc566e..846a7d05185133ac67dfd6f900c614b9c9172b77 100644 (file)
@@ -11946,7 +11946,7 @@ module_param(auto_create, int, 0444);
 MODULE_PARM_DESC(auto_create, "auto create adhoc network (default on)");
 
 module_param(led, int, 0444);
-MODULE_PARM_DESC(led, "enable led control on some systems (default 0 off)\n");
+MODULE_PARM_DESC(led, "enable led control on some systems (default 0 off)");
 
 module_param(debug, int, 0444);
 MODULE_PARM_DESC(debug, "debug output mask");
index 9afecb813716d90817bf180bef80008253dcf7d9..ba2df1ba32d28833681f4f06e1aa644375cad445 100644 (file)
@@ -2469,7 +2469,7 @@ MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
 module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
 MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
 module_param_named(swcrypto, iwl4965_mod_params.sw_crypto, int, 0444);
-MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])\n");
+MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
 module_param_named(debug, iwl4965_mod_params.debug, int, 0444);
 MODULE_PARM_DESC(debug, "debug output mask");
 module_param_named(
index d0c1d63d1891bbe7a87587d79e120cfce4aef813..203e579ebbd22e77e5413f86995bce689cc87508 100644 (file)
@@ -275,7 +275,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res,
                destroy_cis_cache(s);
        }
        s->cis_mem.res = NULL;
-       if ((ret != 0) || (count == 0))
+       if ((ret != 0) || (*count == 0))
                return 0;
        return 1;
 }
index bbf78ef4ba024932af837e18f16503daf8c9ce4a..b42df1620718556a21345c7646abbe902ecd6399 100644 (file)
@@ -77,7 +77,7 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
 {
 #ifdef DEBUG
        char buf[128];
-       int len = 0;
+       int len;
        struct pnp_resource *pnp_res;
        struct resource *res;
 
@@ -89,9 +89,10 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
        dev_dbg(&dev->dev, "%s: current resources:\n", desc);
        list_for_each_entry(pnp_res, &dev->resources, list) {
                res = &pnp_res->res;
+               len = 0;
 
-               len += snprintf(buf + len, sizeof(buf) - len, "  %-3s ",
-                               pnp_resource_type_name(res));
+               len += scnprintf(buf + len, sizeof(buf) - len, "  %-3s ",
+                                pnp_resource_type_name(res));
 
                if (res->flags & IORESOURCE_DISABLED) {
                        dev_dbg(&dev->dev, "%sdisabled\n", buf);
@@ -101,18 +102,18 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
                switch (pnp_resource_type(res)) {
                case IORESOURCE_IO:
                case IORESOURCE_MEM:
-                       len += snprintf(buf + len, sizeof(buf) - len,
-                                       "%#llx-%#llx flags %#lx",
-                                       (unsigned long long) res->start,
-                                       (unsigned long long) res->end,
-                                       res->flags);
+                       len += scnprintf(buf + len, sizeof(buf) - len,
+                                        "%#llx-%#llx flags %#lx",
+                                        (unsigned long long) res->start,
+                                        (unsigned long long) res->end,
+                                        res->flags);
                        break;
                case IORESOURCE_IRQ:
                case IORESOURCE_DMA:
-                       len += snprintf(buf + len, sizeof(buf) - len,
-                                       "%lld flags %#lx",
-                                       (unsigned long long) res->start,
-                                       res->flags);
+                       len += scnprintf(buf + len, sizeof(buf) - len,
+                                        "%lld flags %#lx",
+                                        (unsigned long long) res->start,
+                                        res->flags);
                        break;
                }
                dev_dbg(&dev->dev, "%s\n", buf);
@@ -144,66 +145,67 @@ void dbg_pnp_show_option(struct pnp_dev *dev, struct pnp_option *option)
        struct pnp_dma *dma;
 
        if (pnp_option_is_dependent(option))
-               len += snprintf(buf + len, sizeof(buf) - len,
-                               "  dependent set %d (%s) ",
-                               pnp_option_set(option),
-                               pnp_option_priority_name(option));
+               len += scnprintf(buf + len, sizeof(buf) - len,
+                                "  dependent set %d (%s) ",
+                                pnp_option_set(option),
+                                pnp_option_priority_name(option));
        else
-               len += snprintf(buf + len, sizeof(buf) - len, "  independent ");
+               len += scnprintf(buf + len, sizeof(buf) - len,
+                                "  independent ");
 
        switch (option->type) {
        case IORESOURCE_IO:
                port = &option->u.port;
-               len += snprintf(buf + len, sizeof(buf) - len, "io  min %#llx "
-                               "max %#llx align %lld size %lld flags %#x",
-                               (unsigned long long) port->min,
-                               (unsigned long long) port->max,
-                               (unsigned long long) port->align,
-                               (unsigned long long) port->size, port->flags);
+               len += scnprintf(buf + len, sizeof(buf) - len, "io  min %#llx "
+                                "max %#llx align %lld size %lld flags %#x",
+                                (unsigned long long) port->min,
+                                (unsigned long long) port->max,
+                                (unsigned long long) port->align,
+                                (unsigned long long) port->size, port->flags);
                break;
        case IORESOURCE_MEM:
                mem = &option->u.mem;
-               len += snprintf(buf + len, sizeof(buf) - len, "mem min %#llx "
-                               "max %#llx align %lld size %lld flags %#x",
-                               (unsigned long long) mem->min,
-                               (unsigned long long) mem->max,
-                               (unsigned long long) mem->align,
-                               (unsigned long long) mem->size, mem->flags);
+               len += scnprintf(buf + len, sizeof(buf) - len, "mem min %#llx "
+                                "max %#llx align %lld size %lld flags %#x",
+                                (unsigned long long) mem->min,
+                                (unsigned long long) mem->max,
+                                (unsigned long long) mem->align,
+                                (unsigned long long) mem->size, mem->flags);
                break;
        case IORESOURCE_IRQ:
                irq = &option->u.irq;
-               len += snprintf(buf + len, sizeof(buf) - len, "irq");
+               len += scnprintf(buf + len, sizeof(buf) - len, "irq");
                if (bitmap_empty(irq->map.bits, PNP_IRQ_NR))
-                       len += snprintf(buf + len, sizeof(buf) - len,
-                                       " <none>");
+                       len += scnprintf(buf + len, sizeof(buf) - len,
+                                        " <none>");
                else {
                        for (i = 0; i < PNP_IRQ_NR; i++)
                                if (test_bit(i, irq->map.bits))
-                                       len += snprintf(buf + len,
-                                                       sizeof(buf) - len,
-                                                       " %d", i);
+                                       len += scnprintf(buf + len,
+                                                        sizeof(buf) - len,
+                                                        " %d", i);
                }
-               len += snprintf(buf + len, sizeof(buf) - len, " flags %#x",
-                               irq->flags);
+               len += scnprintf(buf + len, sizeof(buf) - len, " flags %#x",
+                                irq->flags);
                if (irq->flags & IORESOURCE_IRQ_OPTIONAL)
-                       len += snprintf(buf + len, sizeof(buf) - len,
-                                       " (optional)");
+                       len += scnprintf(buf + len, sizeof(buf) - len,
+                                        " (optional)");
                break;
        case IORESOURCE_DMA:
                dma = &option->u.dma;
-               len += snprintf(buf + len, sizeof(buf) - len, "dma");
+               len += scnprintf(buf + len, sizeof(buf) - len, "dma");
                if (!dma->map)
-                       len += snprintf(buf + len, sizeof(buf) - len,
-                                       " <none>");
+                       len += scnprintf(buf + len, sizeof(buf) - len,
+                                        " <none>");
                else {
                        for (i = 0; i < 8; i++)
                                if (dma->map & (1 << i))
-                                       len += snprintf(buf + len,
-                                                       sizeof(buf) - len,
-                                                       " %d", i);
+                                       len += scnprintf(buf + len,
+                                                        sizeof(buf) - len,
+                                                        " %d", i);
                }
-               len += snprintf(buf + len, sizeof(buf) - len, " (bitmask %#x) "
-                               "flags %#x", dma->map, dma->flags);
+               len += scnprintf(buf + len, sizeof(buf) - len, " (bitmask %#x) "
+                                "flags %#x", dma->map, dma->flags);
                break;
        }
        dev_dbg(&dev->dev, "%s\n", buf);
index 4d17d384578d7214ccbd08cac71d5b9c8a1809b1..9ce55850271a17c21365dee317f43219756eff53 100644 (file)
@@ -49,6 +49,13 @@ config BATTERY_OLPC
        help
          Say Y to enable support for the battery on the OLPC laptop.
 
+config BATTERY_TOSA
+       tristate "Sharp SL-6000 (tosa) battery"
+       depends on MACH_TOSA && MFD_TC6393XB
+       help
+         Say Y to enable support for the battery on the Sharp Zaurus
+         SL-6000 (tosa) models.
+
 config BATTERY_PALMTX
        tristate "Palm T|X battery"
        depends on MACH_PALMTX
index 6f43a54ee420228dad366db38c71e0777d9f37cf..4706bf8ff4595814565ebac8ee4cbb764ab91f63 100644 (file)
@@ -20,4 +20,5 @@ obj-$(CONFIG_APM_POWER)               += apm_power.o
 obj-$(CONFIG_BATTERY_DS2760)   += ds2760_battery.o
 obj-$(CONFIG_BATTERY_PMU)      += pmu_battery.o
 obj-$(CONFIG_BATTERY_OLPC)     += olpc_battery.o
+obj-$(CONFIG_BATTERY_TOSA)     += tosa_battery.o
 obj-$(CONFIG_BATTERY_PALMTX)   += palmtx_battery.o
index ab1e8289f07f4a23ca08899635e2f3e4dc02330d..32570af3c5c904fa86cffe26efbcc7650757d474 100644 (file)
@@ -19,7 +19,7 @@
 
 #define EC_BAT_VOLTAGE 0x10    /* uint16_t,    *9.76/32,    mV   */
 #define EC_BAT_CURRENT 0x11    /* int16_t,     *15.625/120, mA   */
-#define EC_BAT_ACR     0x12
+#define EC_BAT_ACR     0x12    /* int16_t,     *6250/15,    ÂµAh  */
 #define EC_BAT_TEMP    0x13    /* uint16_t,    *100/256,   Â°C  */
 #define EC_AMB_TEMP    0x14    /* uint16_t,    *100/256,   Â°C  */
 #define EC_BAT_STATUS  0x15    /* uint8_t,     bitmask */
@@ -84,6 +84,119 @@ static struct power_supply olpc_ac = {
        .get_property = olpc_ac_get_prop,
 };
 
+static char bat_serial[17]; /* Ick */
+
+static int olpc_bat_get_status(union power_supply_propval *val, uint8_t ec_byte)
+{
+       if (olpc_platform_info.ecver > 0x44) {
+               if (ec_byte & BAT_STAT_CHARGING)
+                       val->intval = POWER_SUPPLY_STATUS_CHARGING;
+               else if (ec_byte & BAT_STAT_DISCHARGING)
+                       val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
+               else if (ec_byte & BAT_STAT_FULL)
+                       val->intval = POWER_SUPPLY_STATUS_FULL;
+               else /* er,... */
+                       val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
+       } else {
+               /* Older EC didn't report charge/discharge bits */
+               if (!(ec_byte & BAT_STAT_AC)) /* No AC means discharging */
+                       val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
+               else if (ec_byte & BAT_STAT_FULL)
+                       val->intval = POWER_SUPPLY_STATUS_FULL;
+               else /* Not _necessarily_ true but EC doesn't tell all yet */
+                       val->intval = POWER_SUPPLY_STATUS_CHARGING;
+       }
+
+       return 0;
+}
+
+static int olpc_bat_get_health(union power_supply_propval *val)
+{
+       uint8_t ec_byte;
+       int ret;
+
+       ret = olpc_ec_cmd(EC_BAT_ERRCODE, NULL, 0, &ec_byte, 1);
+       if (ret)
+               return ret;
+
+       switch (ec_byte) {
+       case 0:
+               val->intval = POWER_SUPPLY_HEALTH_GOOD;
+               break;
+
+       case BAT_ERR_OVERTEMP:
+               val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
+               break;
+
+       case BAT_ERR_OVERVOLTAGE:
+               val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
+               break;
+
+       case BAT_ERR_INFOFAIL:
+       case BAT_ERR_OUT_OF_CONTROL:
+       case BAT_ERR_ID_FAIL:
+       case BAT_ERR_ACR_FAIL:
+               val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE;
+               break;
+
+       default:
+               /* Eep. We don't know this failure code */
+               ret = -EIO;
+       }
+
+       return ret;
+}
+
+static int olpc_bat_get_mfr(union power_supply_propval *val)
+{
+       uint8_t ec_byte;
+       int ret;
+
+       ec_byte = BAT_ADDR_MFR_TYPE;
+       ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1);
+       if (ret)
+               return ret;
+
+       switch (ec_byte >> 4) {
+       case 1:
+               val->strval = "Gold Peak";
+               break;
+       case 2:
+               val->strval = "BYD";
+               break;
+       default:
+               val->strval = "Unknown";
+               break;
+       }
+
+       return ret;
+}
+
+static int olpc_bat_get_tech(union power_supply_propval *val)
+{
+       uint8_t ec_byte;
+       int ret;
+
+       ec_byte = BAT_ADDR_MFR_TYPE;
+       ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1);
+       if (ret)
+               return ret;
+
+       switch (ec_byte & 0xf) {
+       case 1:
+               val->intval = POWER_SUPPLY_TECHNOLOGY_NiMH;
+               break;
+       case 2:
+               val->intval = POWER_SUPPLY_TECHNOLOGY_LiFe;
+               break;
+       default:
+               val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
+               break;
+       }
+
+       return ret;
+}
+
 /*********************************************************************
  *             Battery properties
  *********************************************************************/
@@ -94,6 +207,7 @@ static int olpc_bat_get_property(struct power_supply *psy,
        int ret = 0;
        int16_t ec_word;
        uint8_t ec_byte;
+       uint64_t ser_buf;
 
        ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &ec_byte, 1);
        if (ret)
@@ -110,25 +224,10 @@ static int olpc_bat_get_property(struct power_supply *psy,
 
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
-               if (olpc_platform_info.ecver > 0x44) {
-                       if (ec_byte & BAT_STAT_CHARGING)
-                               val->intval = POWER_SUPPLY_STATUS_CHARGING;
-                       else if (ec_byte & BAT_STAT_DISCHARGING)
-                               val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
-                       else if (ec_byte & BAT_STAT_FULL)
-                               val->intval = POWER_SUPPLY_STATUS_FULL;
-                       else /* er,... */
-                               val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
-               } else {
-                       /* Older EC didn't report charge/discharge bits */
-                       if (!(ec_byte & BAT_STAT_AC)) /* No AC means discharging */
-                               val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
-                       else if (ec_byte & BAT_STAT_FULL)
-                               val->intval = POWER_SUPPLY_STATUS_FULL;
-                       else /* Not _necessarily_ true but EC doesn't tell all yet */
-                               val->intval = POWER_SUPPLY_STATUS_CHARGING;
-                       break;
-               }
+               ret = olpc_bat_get_status(val, ec_byte);
+               if (ret)
+                       return ret;
+               break;
        case POWER_SUPPLY_PROP_PRESENT:
                val->intval = !!(ec_byte & BAT_STAT_PRESENT);
                break;
@@ -137,72 +236,21 @@ static int olpc_bat_get_property(struct power_supply *psy,
                if (ec_byte & BAT_STAT_DESTROY)
                        val->intval = POWER_SUPPLY_HEALTH_DEAD;
                else {
-                       ret = olpc_ec_cmd(EC_BAT_ERRCODE, NULL, 0, &ec_byte, 1);
+                       ret = olpc_bat_get_health(val);
                        if (ret)
                                return ret;
-
-                       switch (ec_byte) {
-                       case 0:
-                               val->intval = POWER_SUPPLY_HEALTH_GOOD;
-                               break;
-
-                       case BAT_ERR_OVERTEMP:
-                               val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
-                               break;
-
-                       case BAT_ERR_OVERVOLTAGE:
-                               val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
-                               break;
-
-                       case BAT_ERR_INFOFAIL:
-                       case BAT_ERR_OUT_OF_CONTROL:
-                       case BAT_ERR_ID_FAIL:
-                       case BAT_ERR_ACR_FAIL:
-                               val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE;
-                               break;
-
-                       default:
-                               /* Eep. We don't know this failure code */
-                               return -EIO;
-                       }
                }
                break;
 
        case POWER_SUPPLY_PROP_MANUFACTURER:
-               ec_byte = BAT_ADDR_MFR_TYPE;
-               ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1);
+               ret = olpc_bat_get_mfr(val);
                if (ret)
                        return ret;
-
-               switch (ec_byte >> 4) {
-               case 1:
-                       val->strval = "Gold Peak";
-                       break;
-               case 2:
-                       val->strval = "BYD";
-                       break;
-               default:
-                       val->strval = "Unknown";
-                       break;
-               }
                break;
        case POWER_SUPPLY_PROP_TECHNOLOGY:
-               ec_byte = BAT_ADDR_MFR_TYPE;
-               ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1);
+               ret = olpc_bat_get_tech(val);
                if (ret)
                        return ret;
-
-               switch (ec_byte & 0xf) {
-               case 1:
-                       val->intval = POWER_SUPPLY_TECHNOLOGY_NiMH;
-                       break;
-               case 2:
-                       val->intval = POWER_SUPPLY_TECHNOLOGY_LiFe;
-                       break;
-               default:
-                       val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
-                       break;
-               }
                break;
        case POWER_SUPPLY_PROP_VOLTAGE_AVG:
                ret = olpc_ec_cmd(EC_BAT_VOLTAGE, NULL, 0, (void *)&ec_word, 2);
@@ -241,6 +289,22 @@ static int olpc_bat_get_property(struct power_supply *psy,
                ec_word = be16_to_cpu(ec_word);
                val->intval = ec_word * 100 / 256;
                break;
+       case POWER_SUPPLY_PROP_CHARGE_COUNTER:
+               ret = olpc_ec_cmd(EC_BAT_ACR, NULL, 0, (void *)&ec_word, 2);
+               if (ret)
+                       return ret;
+
+               ec_word = be16_to_cpu(ec_word);
+               val->intval = ec_word * 6250 / 15;
+               break;
+       case POWER_SUPPLY_PROP_SERIAL_NUMBER:
+               ret = olpc_ec_cmd(EC_BAT_SERIAL, NULL, 0, (void *)&ser_buf, 8);
+               if (ret)
+                       return ret;
+
+               sprintf(bat_serial, "%016llx", (long long)be64_to_cpu(ser_buf));
+               val->strval = bat_serial;
+               break;
        default:
                ret = -EINVAL;
                break;
@@ -260,6 +324,50 @@ static enum power_supply_property olpc_bat_props[] = {
        POWER_SUPPLY_PROP_TEMP,
        POWER_SUPPLY_PROP_TEMP_AMBIENT,
        POWER_SUPPLY_PROP_MANUFACTURER,
+       POWER_SUPPLY_PROP_SERIAL_NUMBER,
+       POWER_SUPPLY_PROP_CHARGE_COUNTER,
+};
+
+/* EEPROM reading goes completely around the power_supply API, sadly */
+
+#define EEPROM_START   0x20
+#define EEPROM_END     0x80
+#define EEPROM_SIZE    (EEPROM_END - EEPROM_START)
+
+static ssize_t olpc_bat_eeprom_read(struct kobject *kobj,
+               struct bin_attribute *attr, char *buf, loff_t off, size_t count)
+{
+       uint8_t ec_byte;
+       int ret, end;
+
+       if (off >= EEPROM_SIZE)
+               return 0;
+       if (off + count > EEPROM_SIZE)
+               count = EEPROM_SIZE - off;
+
+       end = EEPROM_START + off + count;
+       for (ec_byte = EEPROM_START + off; ec_byte < end; ec_byte++) {
+               ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1,
+                               &buf[ec_byte - EEPROM_START], 1);
+               if (ret) {
+                       printk(KERN_ERR "olpc-battery:  EC command "
+                                       "EC_BAT_EEPROM @ 0x%x failed -"
+                                       " %d!\n", ec_byte, ret);
+                       return -EIO;
+               }
+       }
+
+       return count;
+}
+
+static struct bin_attribute olpc_bat_eeprom = {
+       .attr = {
+               .name = "eeprom",
+               .mode = S_IRUGO,
+               .owner = THIS_MODULE,
+       },
+       .size = 0,
+       .read = olpc_bat_eeprom_read,
 };
 
 /*********************************************************************
@@ -290,8 +398,14 @@ static int __init olpc_bat_init(void)
 
        if (!olpc_platform_info.ecver)
                return -ENXIO;
-       if (olpc_platform_info.ecver < 0x43) {
-               printk(KERN_NOTICE "OLPC EC version 0x%02x too old for battery driver.\n", olpc_platform_info.ecver);
+
+       /*
+        * We've seen a number of EC protocol changes; this driver requires
+        * the latest EC protocol, supported by 0x44 and above.
+        */
+       if (olpc_platform_info.ecver < 0x44) {
+               printk(KERN_NOTICE "OLPC EC version 0x%02x too old for "
+                       "battery driver.\n", olpc_platform_info.ecver);
                return -ENXIO;
        }
 
@@ -315,8 +429,14 @@ static int __init olpc_bat_init(void)
        if (ret)
                goto battery_failed;
 
+       ret = device_create_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
+       if (ret)
+               goto eeprom_failed;
+
        goto success;
 
+eeprom_failed:
+       power_supply_unregister(&olpc_bat);
 battery_failed:
        power_supply_unregister(&olpc_ac);
 ac_failed:
@@ -327,6 +447,7 @@ success:
 
 static void __exit olpc_bat_exit(void)
 {
+       device_remove_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
        power_supply_unregister(&olpc_bat);
        power_supply_unregister(&olpc_ac);
        platform_device_unregister(bat_pdev);
index 49215da5249b1b96d540574d580f3322dc35e0b4..fe2aeb11939b3d9a327167e3d162043a6c0f9914 100644 (file)
@@ -99,6 +99,7 @@ static struct device_attribute power_supply_attrs[] = {
        POWER_SUPPLY_ATTR(charge_empty),
        POWER_SUPPLY_ATTR(charge_now),
        POWER_SUPPLY_ATTR(charge_avg),
+       POWER_SUPPLY_ATTR(charge_counter),
        POWER_SUPPLY_ATTR(energy_full_design),
        POWER_SUPPLY_ATTR(energy_empty_design),
        POWER_SUPPLY_ATTR(energy_full),
diff --git a/drivers/power/tosa_battery.c b/drivers/power/tosa_battery.c
new file mode 100644 (file)
index 0000000..bf664fb
--- /dev/null
@@ -0,0 +1,486 @@
+/*
+ * Battery and Power Management code for the Sharp SL-6000x
+ *
+ * Copyright (c) 2005 Dirk Opfer
+ * Copyright (c) 2008 Dmitry Baryshkov
+ *
+ * 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.
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/power_supply.h>
+#include <linux/wm97xx.h>
+#include <linux/delay.h>
+#include <linux/spinlock.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+
+#include <asm/mach-types.h>
+#include <asm/arch/tosa.h>
+
+static DEFINE_MUTEX(bat_lock); /* protects gpio pins */
+static struct work_struct bat_work;
+
+struct tosa_bat {
+       int status;
+       struct power_supply psy;
+       int full_chrg;
+
+       struct mutex work_lock; /* protects data */
+
+       bool (*is_present)(struct tosa_bat *bat);
+       int gpio_full;
+       int gpio_charge_off;
+
+       int technology;
+
+       int gpio_bat;
+       int adc_bat;
+       int adc_bat_divider;
+       int bat_max;
+       int bat_min;
+
+       int gpio_temp;
+       int adc_temp;
+       int adc_temp_divider;
+};
+
+static struct tosa_bat tosa_bat_main;
+static struct tosa_bat tosa_bat_jacket;
+
+static unsigned long tosa_read_bat(struct tosa_bat *bat)
+{
+       unsigned long value = 0;
+
+       if (bat->gpio_bat < 0 || bat->adc_bat < 0)
+               return 0;
+
+       mutex_lock(&bat_lock);
+       gpio_set_value(bat->gpio_bat, 1);
+       msleep(5);
+       value = wm97xx_read_aux_adc(bat->psy.dev->parent->driver_data,
+                       bat->adc_bat);
+       gpio_set_value(bat->gpio_bat, 0);
+       mutex_unlock(&bat_lock);
+
+       value = value * 1000000 / bat->adc_bat_divider;
+
+       return value;
+}
+
+static unsigned long tosa_read_temp(struct tosa_bat *bat)
+{
+       unsigned long value = 0;
+
+       if (bat->gpio_temp < 0 || bat->adc_temp < 0)
+               return 0;
+
+       mutex_lock(&bat_lock);
+       gpio_set_value(bat->gpio_temp, 1);
+       msleep(5);
+       value = wm97xx_read_aux_adc(bat->psy.dev->parent->driver_data,
+                       bat->adc_temp);
+       gpio_set_value(bat->gpio_temp, 0);
+       mutex_unlock(&bat_lock);
+
+       value = value * 10000 / bat->adc_temp_divider;
+
+       return value;
+}
+
+static int tosa_bat_get_property(struct power_supply *psy,
+                           enum power_supply_property psp,
+                           union power_supply_propval *val)
+{
+       int ret = 0;
+       struct tosa_bat *bat = container_of(psy, struct tosa_bat, psy);
+
+       if (bat->is_present && !bat->is_present(bat)
+                       && psp != POWER_SUPPLY_PROP_PRESENT) {
+               return -ENODEV;
+       }
+
+       switch (psp) {
+       case POWER_SUPPLY_PROP_STATUS:
+               val->intval = bat->status;
+               break;
+       case POWER_SUPPLY_PROP_TECHNOLOGY:
+               val->intval = bat->technology;
+               break;
+       case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+               val->intval = tosa_read_bat(bat);
+               break;
+       case POWER_SUPPLY_PROP_VOLTAGE_MAX:
+               if (bat->full_chrg == -1)
+                       val->intval = bat->bat_max;
+               else
+                       val->intval = bat->full_chrg;
+               break;
+       case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
+               val->intval = bat->bat_max;
+               break;
+       case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
+               val->intval = bat->bat_min;
+               break;
+       case POWER_SUPPLY_PROP_TEMP:
+               val->intval = tosa_read_temp(bat);
+               break;
+       case POWER_SUPPLY_PROP_PRESENT:
+               val->intval = bat->is_present ? bat->is_present(bat) : 1;
+               break;
+       default:
+               ret = -EINVAL;
+               break;
+       }
+       return ret;
+}
+
+static bool tosa_jacket_bat_is_present(struct tosa_bat *bat)
+{
+       return gpio_get_value(TOSA_GPIO_JACKET_DETECT) == 0;
+}
+
+static void tosa_bat_external_power_changed(struct power_supply *psy)
+{
+       schedule_work(&bat_work);
+}
+
+static irqreturn_t tosa_bat_gpio_isr(int irq, void *data)
+{
+       pr_info("tosa_bat_gpio irq: %d\n", gpio_get_value(irq_to_gpio(irq)));
+       schedule_work(&bat_work);
+       return IRQ_HANDLED;
+}
+
+static void tosa_bat_update(struct tosa_bat *bat)
+{
+       int old;
+       struct power_supply *psy = &bat->psy;
+
+       mutex_lock(&bat->work_lock);
+
+       old = bat->status;
+
+       if (bat->is_present && !bat->is_present(bat)) {
+               printk(KERN_NOTICE "%s not present\n", psy->name);
+               bat->status = POWER_SUPPLY_STATUS_UNKNOWN;
+               bat->full_chrg = -1;
+       } else if (power_supply_am_i_supplied(psy)) {
+               if (bat->status == POWER_SUPPLY_STATUS_DISCHARGING) {
+                       gpio_set_value(bat->gpio_charge_off, 0);
+                       mdelay(15);
+               }
+
+               if (gpio_get_value(bat->gpio_full)) {
+                       if (old == POWER_SUPPLY_STATUS_CHARGING ||
+                                       bat->full_chrg == -1)
+                               bat->full_chrg = tosa_read_bat(bat);
+
+                       gpio_set_value(bat->gpio_charge_off, 1);
+                       bat->status = POWER_SUPPLY_STATUS_FULL;
+               } else {
+                       gpio_set_value(bat->gpio_charge_off, 0);
+                       bat->status = POWER_SUPPLY_STATUS_CHARGING;
+               }
+       } else {
+               gpio_set_value(bat->gpio_charge_off, 1);
+               bat->status = POWER_SUPPLY_STATUS_DISCHARGING;
+       }
+
+       if (old != bat->status)
+               power_supply_changed(psy);
+
+       mutex_unlock(&bat->work_lock);
+}
+
+static void tosa_bat_work(struct work_struct *work)
+{
+       tosa_bat_update(&tosa_bat_main);
+       tosa_bat_update(&tosa_bat_jacket);
+}
+
+
+static enum power_supply_property tosa_bat_main_props[] = {
+       POWER_SUPPLY_PROP_STATUS,
+       POWER_SUPPLY_PROP_TECHNOLOGY,
+       POWER_SUPPLY_PROP_VOLTAGE_NOW,
+       POWER_SUPPLY_PROP_VOLTAGE_MAX,
+       POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
+       POWER_SUPPLY_PROP_TEMP,
+       POWER_SUPPLY_PROP_PRESENT,
+};
+
+static enum power_supply_property tosa_bat_bu_props[] = {
+       POWER_SUPPLY_PROP_STATUS,
+       POWER_SUPPLY_PROP_TECHNOLOGY,
+       POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
+       POWER_SUPPLY_PROP_VOLTAGE_NOW,
+       POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
+       POWER_SUPPLY_PROP_PRESENT,
+};
+
+static struct tosa_bat tosa_bat_main = {
+       .status = POWER_SUPPLY_STATUS_DISCHARGING,
+       .full_chrg = -1,
+       .psy = {
+               .name           = "main-battery",
+               .type           = POWER_SUPPLY_TYPE_BATTERY,
+               .properties     = tosa_bat_main_props,
+               .num_properties = ARRAY_SIZE(tosa_bat_main_props),
+               .get_property   = tosa_bat_get_property,
+               .external_power_changed = tosa_bat_external_power_changed,
+               .use_for_apm    = 1,
+       },
+
+       .gpio_full = TOSA_GPIO_BAT0_CRG,
+       .gpio_charge_off = TOSA_GPIO_CHARGE_OFF,
+
+       .technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
+
+       .gpio_bat = TOSA_GPIO_BAT0_V_ON,
+       .adc_bat = WM97XX_AUX_ID3,
+       .adc_bat_divider = 414,
+       .bat_max = 4310000,
+       .bat_min = 1551 * 1000000 / 414,
+
+       .gpio_temp = TOSA_GPIO_BAT1_TH_ON,
+       .adc_temp = WM97XX_AUX_ID2,
+       .adc_temp_divider = 10000,
+};
+
+static struct tosa_bat tosa_bat_jacket = {
+       .status = POWER_SUPPLY_STATUS_DISCHARGING,
+       .full_chrg = -1,
+       .psy = {
+               .name           = "jacket-battery",
+               .type           = POWER_SUPPLY_TYPE_BATTERY,
+               .properties     = tosa_bat_main_props,
+               .num_properties = ARRAY_SIZE(tosa_bat_main_props),
+               .get_property   = tosa_bat_get_property,
+               .external_power_changed = tosa_bat_external_power_changed,
+       },
+
+       .is_present = tosa_jacket_bat_is_present,
+       .gpio_full = TOSA_GPIO_BAT1_CRG,
+       .gpio_charge_off = TOSA_GPIO_CHARGE_OFF_JC,
+
+       .technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
+
+       .gpio_bat = TOSA_GPIO_BAT1_V_ON,
+       .adc_bat = WM97XX_AUX_ID3,
+       .adc_bat_divider = 414,
+       .bat_max = 4310000,
+       .bat_min = 1551 * 1000000 / 414,
+
+       .gpio_temp = TOSA_GPIO_BAT0_TH_ON,
+       .adc_temp = WM97XX_AUX_ID2,
+       .adc_temp_divider = 10000,
+};
+
+static struct tosa_bat tosa_bat_bu = {
+       .status = POWER_SUPPLY_STATUS_UNKNOWN,
+       .full_chrg = -1,
+
+       .psy = {
+               .name           = "backup-battery",
+               .type           = POWER_SUPPLY_TYPE_BATTERY,
+               .properties     = tosa_bat_bu_props,
+               .num_properties = ARRAY_SIZE(tosa_bat_bu_props),
+               .get_property   = tosa_bat_get_property,
+               .external_power_changed = tosa_bat_external_power_changed,
+       },
+
+       .gpio_full = -1,
+       .gpio_charge_off = -1,
+
+       .technology = POWER_SUPPLY_TECHNOLOGY_LiMn,
+
+       .gpio_bat = TOSA_GPIO_BU_CHRG_ON,
+       .adc_bat = WM97XX_AUX_ID4,
+       .adc_bat_divider = 1266,
+
+       .gpio_temp = -1,
+       .adc_temp = -1,
+       .adc_temp_divider = -1,
+};
+
+static struct {
+       int gpio;
+       char *name;
+       bool output;
+       int value;
+} gpios[] = {
+       { TOSA_GPIO_CHARGE_OFF,         "main charge off",      1, 1 },
+       { TOSA_GPIO_CHARGE_OFF_JC,      "jacket charge off",    1, 1 },
+       { TOSA_GPIO_BAT_SW_ON,          "battery switch",       1, 0 },
+       { TOSA_GPIO_BAT0_V_ON,          "main battery",         1, 0 },
+       { TOSA_GPIO_BAT1_V_ON,          "jacket battery",       1, 0 },
+       { TOSA_GPIO_BAT1_TH_ON,         "main battery temp",    1, 0 },
+       { TOSA_GPIO_BAT0_TH_ON,         "jacket battery temp",  1, 0 },
+       { TOSA_GPIO_BU_CHRG_ON,         "backup battery",       1, 0 },
+       { TOSA_GPIO_BAT0_CRG,           "main battery full",    0, 0 },
+       { TOSA_GPIO_BAT1_CRG,           "jacket battery full",  0, 0 },
+       { TOSA_GPIO_BAT0_LOW,           "main battery low",     0, 0 },
+       { TOSA_GPIO_BAT1_LOW,           "jacket battery low",   0, 0 },
+       { TOSA_GPIO_JACKET_DETECT,      "jacket detect",        0, 0 },
+};
+
+#ifdef CONFIG_PM
+static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state)
+{
+       /* flush all pending status updates */
+       flush_scheduled_work();
+       return 0;
+}
+
+static int tosa_bat_resume(struct platform_device *dev)
+{
+       /* things may have changed while we were away */
+       schedule_work(&bat_work);
+       return 0;
+}
+#else
+#define tosa_bat_suspend NULL
+#define tosa_bat_resume NULL
+#endif
+
+static int __devinit tosa_bat_probe(struct platform_device *dev)
+{
+       int ret;
+       int i;
+
+       if (!machine_is_tosa())
+               return -ENODEV;
+
+       for (i = 0; i < ARRAY_SIZE(gpios); i++) {
+               ret = gpio_request(gpios[i].gpio, gpios[i].name);
+               if (ret) {
+                       i--;
+                       goto err_gpio;
+               }
+
+               if (gpios[i].output)
+                       ret = gpio_direction_output(gpios[i].gpio,
+                                       gpios[i].value);
+               else
+                       ret = gpio_direction_input(gpios[i].gpio);
+
+               if (ret)
+                       goto err_gpio;
+       }
+
+       mutex_init(&tosa_bat_main.work_lock);
+       mutex_init(&tosa_bat_jacket.work_lock);
+
+       INIT_WORK(&bat_work, tosa_bat_work);
+
+       ret = power_supply_register(&dev->dev, &tosa_bat_main.psy);
+       if (ret)
+               goto err_psy_reg_main;
+       ret = power_supply_register(&dev->dev, &tosa_bat_jacket.psy);
+       if (ret)
+               goto err_psy_reg_jacket;
+       ret = power_supply_register(&dev->dev, &tosa_bat_bu.psy);
+       if (ret)
+               goto err_psy_reg_bu;
+
+       ret = request_irq(gpio_to_irq(TOSA_GPIO_BAT0_CRG),
+                               tosa_bat_gpio_isr,
+                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                               "main full", &tosa_bat_main);
+       if (ret)
+               goto err_req_main;
+
+       ret = request_irq(gpio_to_irq(TOSA_GPIO_BAT1_CRG),
+                               tosa_bat_gpio_isr,
+                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                               "jacket full", &tosa_bat_jacket);
+       if (ret)
+               goto err_req_jacket;
+
+       ret = request_irq(gpio_to_irq(TOSA_GPIO_JACKET_DETECT),
+                               tosa_bat_gpio_isr,
+                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                               "jacket detect", &tosa_bat_jacket);
+       if (!ret) {
+               schedule_work(&bat_work);
+               return 0;
+       }
+
+       free_irq(gpio_to_irq(TOSA_GPIO_BAT1_CRG), &tosa_bat_jacket);
+err_req_jacket:
+       free_irq(gpio_to_irq(TOSA_GPIO_BAT0_CRG), &tosa_bat_main);
+err_req_main:
+       power_supply_unregister(&tosa_bat_bu.psy);
+err_psy_reg_bu:
+       power_supply_unregister(&tosa_bat_jacket.psy);
+err_psy_reg_jacket:
+       power_supply_unregister(&tosa_bat_main.psy);
+err_psy_reg_main:
+
+       /* see comment in tosa_bat_remove */
+       flush_scheduled_work();
+
+       i--;
+err_gpio:
+       for (; i >= 0; i--)
+               gpio_free(gpios[i].gpio);
+
+       return ret;
+}
+
+static int __devexit tosa_bat_remove(struct platform_device *dev)
+{
+       int i;
+
+       free_irq(gpio_to_irq(TOSA_GPIO_JACKET_DETECT), &tosa_bat_jacket);
+       free_irq(gpio_to_irq(TOSA_GPIO_BAT1_CRG), &tosa_bat_jacket);
+       free_irq(gpio_to_irq(TOSA_GPIO_BAT0_CRG), &tosa_bat_main);
+
+       power_supply_unregister(&tosa_bat_bu.psy);
+       power_supply_unregister(&tosa_bat_jacket.psy);
+       power_supply_unregister(&tosa_bat_main.psy);
+
+       /*
+        * now flush all pending work.
+        * we won't get any more schedules, since all
+        * sources (isr and external_power_changed)
+        * are unregistered now.
+        */
+       flush_scheduled_work();
+
+       for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--)
+               gpio_free(gpios[i].gpio);
+
+       return 0;
+}
+
+static struct platform_driver tosa_bat_driver = {
+       .driver.name    = "wm97xx-battery",
+       .driver.owner   = THIS_MODULE,
+       .probe          = tosa_bat_probe,
+       .remove         = __devexit_p(tosa_bat_remove),
+       .suspend        = tosa_bat_suspend,
+       .resume         = tosa_bat_resume,
+};
+
+static int __init tosa_bat_init(void)
+{
+       return platform_driver_register(&tosa_bat_driver);
+}
+
+static void __exit tosa_bat_exit(void)
+{
+       platform_driver_unregister(&tosa_bat_driver);
+}
+
+module_init(tosa_bat_init);
+module_exit(tosa_bat_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Dmitry Baryshkov");
+MODULE_DESCRIPTION("Tosa battery driver");
+MODULE_ALIAS("platform:wm97xx-battery");
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
new file mode 100644 (file)
index 0000000..a656128
--- /dev/null
@@ -0,0 +1,59 @@
+menu "Voltage and Current regulators"
+
+config REGULATOR
+       bool "Voltage and Current Regulator Support"
+       default n
+       help
+         Generic Voltage and Current Regulator support.
+
+         This framework is designed to provide a generic interface to voltage
+         and current regulators within the Linux kernel. It's intended to
+         provide voltage and current control to client or consumer drivers and
+         also provide status information to user space applications through a
+         sysfs interface.
+
+         The intention is to allow systems to dynamically control regulator
+         output in order to save power and prolong battery life. This applies
+         to both voltage regulators (where voltage output is controllable) and
+         current sinks (where current output is controllable).
+
+         This framework safely compiles out if not selected so that client
+         drivers can still be used in systems with no software controllable
+         regulators.
+
+         If unsure, say no.
+
+config REGULATOR_DEBUG
+       bool "Regulator debug support"
+       depends on REGULATOR
+       help
+         Say yes here to enable debugging support.
+
+config REGULATOR_FIXED_VOLTAGE
+       tristate
+       default n
+       select REGULATOR
+
+config REGULATOR_VIRTUAL_CONSUMER
+       tristate "Virtual regulator consumer support"
+       default n
+       select REGULATOR
+       help
+         This driver provides a virtual consumer for the voltage and
+          current regulator API which provides sysfs controls for
+          configuring the supplies requested.  This is mainly useful
+          for test purposes.
+
+          If unsure, say no.
+
+config REGULATOR_BQ24022
+       tristate "TI bq24022 Dual Input 1-Cell Li-Ion Charger IC"
+       default n
+       select REGULATOR
+       help
+         This driver controls a TI bq24022 Charger attached via
+         GPIOs. The provided current regulator can enable/disable
+         charging select between 100 mA and 500 mA charging current
+         limit.
+
+endmenu
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
new file mode 100644 (file)
index 0000000..ac2c64e
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for regulator drivers.
+#
+
+
+obj-$(CONFIG_REGULATOR) += core.o
+obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
+obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
+
+obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
+
+ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/bq24022.c b/drivers/regulator/bq24022.c
new file mode 100644 (file)
index 0000000..263699d
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater)
+ * 1-Cell Li-Ion Charger connected via GPIOs.
+ *
+ * Copyright (c) 2008 Philipp Zabel
+ *
+ * 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <linux/gpio.h>
+#include <linux/regulator/bq24022.h>
+#include <linux/regulator/driver.h>
+
+static int bq24022_set_current_limit(struct regulator_dev *rdev,
+                                       int min_uA, int max_uA)
+{
+       struct platform_device *pdev = rdev_get_drvdata(rdev);
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+
+       dev_dbg(&pdev->dev, "setting current limit to %s mA\n",
+               max_uA >= 500000 ? "500" : "100");
+
+       /* REVISIT: maybe return error if min_uA != 0 ? */
+       gpio_set_value(pdata->gpio_iset2, max_uA >= 500000);
+       return 0;
+}
+
+static int bq24022_get_current_limit(struct regulator_dev *rdev)
+{
+       struct platform_device *pdev = rdev_get_drvdata(rdev);
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+
+       return gpio_get_value(pdata->gpio_iset2) ? 500000 : 100000;
+}
+
+static int bq24022_enable(struct regulator_dev *rdev)
+{
+       struct platform_device *pdev = rdev_get_drvdata(rdev);
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+
+       dev_dbg(&pdev->dev, "enabling charger\n");
+
+       gpio_set_value(pdata->gpio_nce, 0);
+       return 0;
+}
+
+static int bq24022_disable(struct regulator_dev *rdev)
+{
+       struct platform_device *pdev = rdev_get_drvdata(rdev);
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+
+       dev_dbg(&pdev->dev, "disabling charger\n");
+
+       gpio_set_value(pdata->gpio_nce, 1);
+       return 0;
+}
+
+static int bq24022_is_enabled(struct regulator_dev *rdev)
+{
+       struct platform_device *pdev = rdev_get_drvdata(rdev);
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+
+       return !gpio_get_value(pdata->gpio_nce);
+}
+
+static struct regulator_ops bq24022_ops = {
+       .set_current_limit = bq24022_set_current_limit,
+       .get_current_limit = bq24022_get_current_limit,
+       .enable            = bq24022_enable,
+       .disable           = bq24022_disable,
+       .is_enabled        = bq24022_is_enabled,
+};
+
+static struct regulator_desc bq24022_desc = {
+       .name  = "bq24022",
+       .ops   = &bq24022_ops,
+       .type  = REGULATOR_CURRENT,
+};
+
+static int __init bq24022_probe(struct platform_device *pdev)
+{
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+       struct regulator_dev *bq24022;
+       int ret;
+
+       if (!pdata || !pdata->gpio_nce || !pdata->gpio_iset2)
+               return -EINVAL;
+
+       ret = gpio_request(pdata->gpio_nce, "ncharge_en");
+       if (ret) {
+               dev_dbg(&pdev->dev, "couldn't request nCE GPIO: %d\n",
+                       pdata->gpio_nce);
+               goto err_ce;
+       }
+       ret = gpio_request(pdata->gpio_iset2, "charge_mode");
+       if (ret) {
+               dev_dbg(&pdev->dev, "couldn't request ISET2 GPIO: %d\n",
+                       pdata->gpio_iset2);
+               goto err_iset2;
+       }
+       ret = gpio_direction_output(pdata->gpio_iset2, 0);
+       ret = gpio_direction_output(pdata->gpio_nce, 1);
+
+       bq24022 = regulator_register(&bq24022_desc, pdev);
+       if (IS_ERR(bq24022)) {
+               dev_dbg(&pdev->dev, "couldn't register regulator\n");
+               ret = PTR_ERR(bq24022);
+               goto err_reg;
+       }
+       platform_set_drvdata(pdev, bq24022);
+       dev_dbg(&pdev->dev, "registered regulator\n");
+
+       return 0;
+err_reg:
+       gpio_free(pdata->gpio_iset2);
+err_iset2:
+       gpio_free(pdata->gpio_nce);
+err_ce:
+       return ret;
+}
+
+static int __devexit bq24022_remove(struct platform_device *pdev)
+{
+       struct bq24022_mach_info *pdata = pdev->dev.platform_data;
+       struct regulator_dev *bq24022 = platform_get_drvdata(pdev);
+
+       regulator_unregister(bq24022);
+       gpio_free(pdata->gpio_iset2);
+       gpio_free(pdata->gpio_nce);
+
+       return 0;
+}
+
+static struct platform_driver bq24022_driver = {
+       .driver = {
+               .name = "bq24022",
+       },
+       .remove = __devexit_p(bq24022_remove),
+};
+
+static int __init bq24022_init(void)
+{
+       return platform_driver_probe(&bq24022_driver, bq24022_probe);
+}
+
+static void __exit bq24022_exit(void)
+{
+       platform_driver_unregister(&bq24022_driver);
+}
+
+/*
+ * make sure this is probed before gpio_vbus and pda_power,
+ * but after asic3 or other GPIO expander drivers.
+ */
+subsys_initcall(bq24022_init);
+module_exit(bq24022_exit);
+
+MODULE_AUTHOR("Philipp Zabel");
+MODULE_DESCRIPTION("TI bq24022 Li-Ion Charger driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
new file mode 100644 (file)
index 0000000..9c79862
--- /dev/null
@@ -0,0 +1,1903 @@
+/*
+ * core.c  --  Voltage/Current Regulator framework.
+ *
+ * Copyright 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <liam.girdwood@wolfsonmicro.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 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/suspend.h>
+#include <linux/regulator/consumer.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+
+#define REGULATOR_VERSION "0.5"
+
+static DEFINE_MUTEX(regulator_list_mutex);
+static LIST_HEAD(regulator_list);
+static LIST_HEAD(regulator_map_list);
+
+/**
+ * struct regulator_dev
+ *
+ * Voltage / Current regulator class device. One for each regulator.
+ */
+struct regulator_dev {
+       struct regulator_desc *desc;
+       int use_count;
+
+       /* lists we belong to */
+       struct list_head list; /* list of all regulators */
+       struct list_head slist; /* list of supplied regulators */
+
+       /* lists we own */
+       struct list_head consumer_list; /* consumers we supply */
+       struct list_head supply_list; /* regulators we supply */
+
+       struct blocking_notifier_head notifier;
+       struct mutex mutex; /* consumer lock */
+       struct module *owner;
+       struct device dev;
+       struct regulation_constraints *constraints;
+       struct regulator_dev *supply;   /* for tree */
+
+       void *reg_data;         /* regulator_dev data */
+};
+
+/**
+ * struct regulator_map
+ *
+ * Used to provide symbolic supply names to devices.
+ */
+struct regulator_map {
+       struct list_head list;
+       struct device *dev;
+       const char *supply;
+       const char *regulator;
+};
+
+static inline struct regulator_dev *to_rdev(struct device *d)
+{
+       return container_of(d, struct regulator_dev, dev);
+}
+
+/*
+ * struct regulator
+ *
+ * One for each consumer device.
+ */
+struct regulator {
+       struct device *dev;
+       struct list_head list;
+       int uA_load;
+       int min_uV;
+       int max_uV;
+       int enabled; /* client has called enabled */
+       char *supply_name;
+       struct device_attribute dev_attr;
+       struct regulator_dev *rdev;
+};
+
+static int _regulator_is_enabled(struct regulator_dev *rdev);
+static int _regulator_disable(struct regulator_dev *rdev);
+static int _regulator_get_voltage(struct regulator_dev *rdev);
+static int _regulator_get_current_limit(struct regulator_dev *rdev);
+static unsigned int _regulator_get_mode(struct regulator_dev *rdev);
+static void _notifier_call_chain(struct regulator_dev *rdev,
+                                 unsigned long event, void *data);
+
+/* gets the regulator for a given consumer device */
+static struct regulator *get_device_regulator(struct device *dev)
+{
+       struct regulator *regulator = NULL;
+       struct regulator_dev *rdev;
+
+       mutex_lock(&regulator_list_mutex);
+       list_for_each_entry(rdev, &regulator_list, list) {
+               mutex_lock(&rdev->mutex);
+               list_for_each_entry(regulator, &rdev->consumer_list, list) {
+                       if (regulator->dev == dev) {
+                               mutex_unlock(&rdev->mutex);
+                               mutex_unlock(&regulator_list_mutex);
+                               return regulator;
+                       }
+               }
+               mutex_unlock(&rdev->mutex);
+       }
+       mutex_unlock(&regulator_list_mutex);
+       return NULL;
+}
+
+/* Platform voltage constraint check */
+static int regulator_check_voltage(struct regulator_dev *rdev,
+                                  int *min_uV, int *max_uV)
+{
+       BUG_ON(*min_uV > *max_uV);
+
+       if (!rdev->constraints) {
+               printk(KERN_ERR "%s: no constraints for %s\n", __func__,
+                      rdev->desc->name);
+               return -ENODEV;
+       }
+       if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
+               printk(KERN_ERR "%s: operation not allowed for %s\n",
+                      __func__, rdev->desc->name);
+               return -EPERM;
+       }
+
+       if (*max_uV > rdev->constraints->max_uV)
+               *max_uV = rdev->constraints->max_uV;
+       if (*min_uV < rdev->constraints->min_uV)
+               *min_uV = rdev->constraints->min_uV;
+
+       if (*min_uV > *max_uV)
+               return -EINVAL;
+
+       return 0;
+}
+
+/* current constraint check */
+static int regulator_check_current_limit(struct regulator_dev *rdev,
+                                       int *min_uA, int *max_uA)
+{
+       BUG_ON(*min_uA > *max_uA);
+
+       if (!rdev->constraints) {
+               printk(KERN_ERR "%s: no constraints for %s\n", __func__,
+                      rdev->desc->name);
+               return -ENODEV;
+       }
+       if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_CURRENT)) {
+               printk(KERN_ERR "%s: operation not allowed for %s\n",
+                      __func__, rdev->desc->name);
+               return -EPERM;
+       }
+
+       if (*max_uA > rdev->constraints->max_uA)
+               *max_uA = rdev->constraints->max_uA;
+       if (*min_uA < rdev->constraints->min_uA)
+               *min_uA = rdev->constraints->min_uA;
+
+       if (*min_uA > *max_uA)
+               return -EINVAL;
+
+       return 0;
+}
+
+/* operating mode constraint check */
+static int regulator_check_mode(struct regulator_dev *rdev, int mode)
+{
+       if (!rdev->constraints) {
+               printk(KERN_ERR "%s: no constraints for %s\n", __func__,
+                      rdev->desc->name);
+               return -ENODEV;
+       }
+       if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_MODE)) {
+               printk(KERN_ERR "%s: operation not allowed for %s\n",
+                      __func__, rdev->desc->name);
+               return -EPERM;
+       }
+       if (!(rdev->constraints->valid_modes_mask & mode)) {
+               printk(KERN_ERR "%s: invalid mode %x for %s\n",
+                      __func__, mode, rdev->desc->name);
+               return -EINVAL;
+       }
+       return 0;
+}
+
+/* dynamic regulator mode switching constraint check */
+static int regulator_check_drms(struct regulator_dev *rdev)
+{
+       if (!rdev->constraints) {
+               printk(KERN_ERR "%s: no constraints for %s\n", __func__,
+                      rdev->desc->name);
+               return -ENODEV;
+       }
+       if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) {
+               printk(KERN_ERR "%s: operation not allowed for %s\n",
+                      __func__, rdev->desc->name);
+               return -EPERM;
+       }
+       return 0;
+}
+
+static ssize_t device_requested_uA_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
+{
+       struct regulator *regulator;
+
+       regulator = get_device_regulator(dev);
+       if (regulator == NULL)
+               return 0;
+
+       return sprintf(buf, "%d\n", regulator->uA_load);
+}
+
+static ssize_t regulator_uV_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       ssize_t ret;
+
+       mutex_lock(&rdev->mutex);
+       ret = sprintf(buf, "%d\n", _regulator_get_voltage(rdev));
+       mutex_unlock(&rdev->mutex);
+
+       return ret;
+}
+
+static ssize_t regulator_uA_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       return sprintf(buf, "%d\n", _regulator_get_current_limit(rdev));
+}
+
+static ssize_t regulator_opmode_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       int mode = _regulator_get_mode(rdev);
+
+       switch (mode) {
+       case REGULATOR_MODE_FAST:
+               return sprintf(buf, "fast\n");
+       case REGULATOR_MODE_NORMAL:
+               return sprintf(buf, "normal\n");
+       case REGULATOR_MODE_IDLE:
+               return sprintf(buf, "idle\n");
+       case REGULATOR_MODE_STANDBY:
+               return sprintf(buf, "standby\n");
+       }
+       return sprintf(buf, "unknown\n");
+}
+
+static ssize_t regulator_state_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       int state = _regulator_is_enabled(rdev);
+
+       if (state > 0)
+               return sprintf(buf, "enabled\n");
+       else if (state == 0)
+               return sprintf(buf, "disabled\n");
+       else
+               return sprintf(buf, "unknown\n");
+}
+
+static ssize_t regulator_min_uA_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "constraint not defined\n");
+
+       return sprintf(buf, "%d\n", rdev->constraints->min_uA);
+}
+
+static ssize_t regulator_max_uA_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "constraint not defined\n");
+
+       return sprintf(buf, "%d\n", rdev->constraints->max_uA);
+}
+
+static ssize_t regulator_min_uV_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "constraint not defined\n");
+
+       return sprintf(buf, "%d\n", rdev->constraints->min_uV);
+}
+
+static ssize_t regulator_max_uV_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "constraint not defined\n");
+
+       return sprintf(buf, "%d\n", rdev->constraints->max_uV);
+}
+
+static ssize_t regulator_total_uA_show(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       struct regulator *regulator;
+       int uA = 0;
+
+       mutex_lock(&rdev->mutex);
+       list_for_each_entry(regulator, &rdev->consumer_list, list)
+           uA += regulator->uA_load;
+       mutex_unlock(&rdev->mutex);
+       return sprintf(buf, "%d\n", uA);
+}
+
+static ssize_t regulator_num_users_show(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       return sprintf(buf, "%d\n", rdev->use_count);
+}
+
+static ssize_t regulator_type_show(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       switch (rdev->desc->type) {
+       case REGULATOR_VOLTAGE:
+               return sprintf(buf, "voltage\n");
+       case REGULATOR_CURRENT:
+               return sprintf(buf, "current\n");
+       }
+       return sprintf(buf, "unknown\n");
+}
+
+static ssize_t regulator_suspend_mem_uV_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return sprintf(buf, "%d\n", rdev->constraints->state_mem.uV);
+}
+
+static ssize_t regulator_suspend_disk_uV_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return sprintf(buf, "%d\n", rdev->constraints->state_disk.uV);
+}
+
+static ssize_t regulator_suspend_standby_uV_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return sprintf(buf, "%d\n", rdev->constraints->state_standby.uV);
+}
+
+static ssize_t suspend_opmode_show(struct regulator_dev *rdev,
+       unsigned int mode, char *buf)
+{
+       switch (mode) {
+       case REGULATOR_MODE_FAST:
+               return sprintf(buf, "fast\n");
+       case REGULATOR_MODE_NORMAL:
+               return sprintf(buf, "normal\n");
+       case REGULATOR_MODE_IDLE:
+               return sprintf(buf, "idle\n");
+       case REGULATOR_MODE_STANDBY:
+               return sprintf(buf, "standby\n");
+       }
+       return sprintf(buf, "unknown\n");
+}
+
+static ssize_t regulator_suspend_mem_mode_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return suspend_opmode_show(rdev,
+               rdev->constraints->state_mem.mode, buf);
+}
+
+static ssize_t regulator_suspend_disk_mode_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return suspend_opmode_show(rdev,
+               rdev->constraints->state_disk.mode, buf);
+}
+
+static ssize_t regulator_suspend_standby_mode_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+       return suspend_opmode_show(rdev,
+               rdev->constraints->state_standby.mode, buf);
+}
+
+static ssize_t regulator_suspend_mem_state_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+
+       if (rdev->constraints->state_mem.enabled)
+               return sprintf(buf, "enabled\n");
+       else
+               return sprintf(buf, "disabled\n");
+}
+
+static ssize_t regulator_suspend_disk_state_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+
+       if (rdev->constraints->state_disk.enabled)
+               return sprintf(buf, "enabled\n");
+       else
+               return sprintf(buf, "disabled\n");
+}
+
+static ssize_t regulator_suspend_standby_state_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+
+       if (!rdev->constraints)
+               return sprintf(buf, "not defined\n");
+
+       if (rdev->constraints->state_standby.enabled)
+               return sprintf(buf, "enabled\n");
+       else
+               return sprintf(buf, "disabled\n");
+}
+static struct device_attribute regulator_dev_attrs[] = {
+       __ATTR(microvolts, 0444, regulator_uV_show, NULL),
+       __ATTR(microamps, 0444, regulator_uA_show, NULL),
+       __ATTR(opmode, 0444, regulator_opmode_show, NULL),
+       __ATTR(state, 0444, regulator_state_show, NULL),
+       __ATTR(min_microvolts, 0444, regulator_min_uV_show, NULL),
+       __ATTR(min_microamps, 0444, regulator_min_uA_show, NULL),
+       __ATTR(max_microvolts, 0444, regulator_max_uV_show, NULL),
+       __ATTR(max_microamps, 0444, regulator_max_uA_show, NULL),
+       __ATTR(requested_microamps, 0444, regulator_total_uA_show, NULL),
+       __ATTR(num_users, 0444, regulator_num_users_show, NULL),
+       __ATTR(type, 0444, regulator_type_show, NULL),
+       __ATTR(suspend_mem_microvolts, 0444,
+               regulator_suspend_mem_uV_show, NULL),
+       __ATTR(suspend_disk_microvolts, 0444,
+               regulator_suspend_disk_uV_show, NULL),
+       __ATTR(suspend_standby_microvolts, 0444,
+               regulator_suspend_standby_uV_show, NULL),
+       __ATTR(suspend_mem_mode, 0444,
+               regulator_suspend_mem_mode_show, NULL),
+       __ATTR(suspend_disk_mode, 0444,
+               regulator_suspend_disk_mode_show, NULL),
+       __ATTR(suspend_standby_mode, 0444,
+               regulator_suspend_standby_mode_show, NULL),
+       __ATTR(suspend_mem_state, 0444,
+               regulator_suspend_mem_state_show, NULL),
+       __ATTR(suspend_disk_state, 0444,
+               regulator_suspend_disk_state_show, NULL),
+       __ATTR(suspend_standby_state, 0444,
+               regulator_suspend_standby_state_show, NULL),
+       __ATTR_NULL,
+};
+
+static void regulator_dev_release(struct device *dev)
+{
+       struct regulator_dev *rdev = to_rdev(dev);
+       kfree(rdev);
+}
+
+static struct class regulator_class = {
+       .name = "regulator",
+       .dev_release = regulator_dev_release,
+       .dev_attrs = regulator_dev_attrs,
+};
+
+/* Calculate the new optimum regulator operating mode based on the new total
+ * consumer load. All locks held by caller */
+static void drms_uA_update(struct regulator_dev *rdev)
+{
+       struct regulator *sibling;
+       int current_uA = 0, output_uV, input_uV, err;
+       unsigned int mode;
+
+       err = regulator_check_drms(rdev);
+       if (err < 0 || !rdev->desc->ops->get_optimum_mode ||
+           !rdev->desc->ops->get_voltage || !rdev->desc->ops->set_mode);
+       return;
+
+       /* get output voltage */
+       output_uV = rdev->desc->ops->get_voltage(rdev);
+       if (output_uV <= 0)
+               return;
+
+       /* get input voltage */
+       if (rdev->supply && rdev->supply->desc->ops->get_voltage)
+               input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply);
+       else
+               input_uV = rdev->constraints->input_uV;
+       if (input_uV <= 0)
+               return;
+
+       /* calc total requested load */
+       list_for_each_entry(sibling, &rdev->consumer_list, list)
+           current_uA += sibling->uA_load;
+
+       /* now get the optimum mode for our new total regulator load */
+       mode = rdev->desc->ops->get_optimum_mode(rdev, input_uV,
+                                                 output_uV, current_uA);
+
+       /* check the new mode is allowed */
+       err = regulator_check_mode(rdev, mode);
+       if (err == 0)
+               rdev->desc->ops->set_mode(rdev, mode);
+}
+
+static int suspend_set_state(struct regulator_dev *rdev,
+       struct regulator_state *rstate)
+{
+       int ret = 0;
+
+       /* enable & disable are mandatory for suspend control */
+       if (!rdev->desc->ops->set_suspend_enable ||
+               !rdev->desc->ops->set_suspend_disable)
+               return -EINVAL;
+
+       if (rstate->enabled)
+               ret = rdev->desc->ops->set_suspend_enable(rdev);
+       else
+               ret = rdev->desc->ops->set_suspend_disable(rdev);
+       if (ret < 0) {
+               printk(KERN_ERR "%s: failed to enabled/disable\n", __func__);
+               return ret;
+       }
+
+       if (rdev->desc->ops->set_suspend_voltage && rstate->uV > 0) {
+               ret = rdev->desc->ops->set_suspend_voltage(rdev, rstate->uV);
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to set voltage\n",
+                               __func__);
+                       return ret;
+               }
+       }
+
+       if (rdev->desc->ops->set_suspend_mode && rstate->mode > 0) {
+               ret = rdev->desc->ops->set_suspend_mode(rdev, rstate->mode);
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to set mode\n", __func__);
+                       return ret;
+               }
+       }
+       return ret;
+}
+
+/* locks held by caller */
+static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
+{
+       if (!rdev->constraints)
+               return -EINVAL;
+
+       switch (state) {
+       case PM_SUSPEND_STANDBY:
+               return suspend_set_state(rdev,
+                       &rdev->constraints->state_standby);
+       case PM_SUSPEND_MEM:
+               return suspend_set_state(rdev,
+                       &rdev->constraints->state_mem);
+       case PM_SUSPEND_MAX:
+               return suspend_set_state(rdev,
+                       &rdev->constraints->state_disk);
+       default:
+               return -EINVAL;
+       }
+}
+
+static void print_constraints(struct regulator_dev *rdev)
+{
+       struct regulation_constraints *constraints = rdev->constraints;
+       char buf[80];
+       int count;
+
+       if (rdev->desc->type == REGULATOR_VOLTAGE) {
+               if (constraints->min_uV == constraints->max_uV)
+                       count = sprintf(buf, "%d mV ",
+                                       constraints->min_uV / 1000);
+               else
+                       count = sprintf(buf, "%d <--> %d mV ",
+                                       constraints->min_uV / 1000,
+                                       constraints->max_uV / 1000);
+       } else {
+               if (constraints->min_uA == constraints->max_uA)
+                       count = sprintf(buf, "%d mA ",
+                                       constraints->min_uA / 1000);
+               else
+                       count = sprintf(buf, "%d <--> %d mA ",
+                                       constraints->min_uA / 1000,
+                                       constraints->max_uA / 1000);
+       }
+       if (constraints->valid_modes_mask & REGULATOR_MODE_FAST)
+               count += sprintf(buf + count, "fast ");
+       if (constraints->valid_modes_mask & REGULATOR_MODE_NORMAL)
+               count += sprintf(buf + count, "normal ");
+       if (constraints->valid_modes_mask & REGULATOR_MODE_IDLE)
+               count += sprintf(buf + count, "idle ");
+       if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY)
+               count += sprintf(buf + count, "standby");
+
+       printk(KERN_INFO "regulator: %s: %s\n", rdev->desc->name, buf);
+}
+
+#define REG_STR_SIZE   32
+
+static struct regulator *create_regulator(struct regulator_dev *rdev,
+                                         struct device *dev,
+                                         const char *supply_name)
+{
+       struct regulator *regulator;
+       char buf[REG_STR_SIZE];
+       int err, size;
+
+       regulator = kzalloc(sizeof(*regulator), GFP_KERNEL);
+       if (regulator == NULL)
+               return NULL;
+
+       mutex_lock(&rdev->mutex);
+       regulator->rdev = rdev;
+       list_add(&regulator->list, &rdev->consumer_list);
+
+       if (dev) {
+               /* create a 'requested_microamps_name' sysfs entry */
+               size = scnprintf(buf, REG_STR_SIZE, "microamps_requested_%s",
+                       supply_name);
+               if (size >= REG_STR_SIZE)
+                       goto overflow_err;
+
+               regulator->dev = dev;
+               regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL);
+               if (regulator->dev_attr.attr.name == NULL)
+                       goto attr_name_err;
+
+               regulator->dev_attr.attr.owner = THIS_MODULE;
+               regulator->dev_attr.attr.mode = 0444;
+               regulator->dev_attr.show = device_requested_uA_show;
+               err = device_create_file(dev, &regulator->dev_attr);
+               if (err < 0) {
+                       printk(KERN_WARNING "%s: could not add regulator_dev"
+                               " load sysfs\n", __func__);
+                       goto attr_name_err;
+               }
+
+               /* also add a link to the device sysfs entry */
+               size = scnprintf(buf, REG_STR_SIZE, "%s-%s",
+                                dev->kobj.name, supply_name);
+               if (size >= REG_STR_SIZE)
+                       goto attr_err;
+
+               regulator->supply_name = kstrdup(buf, GFP_KERNEL);
+               if (regulator->supply_name == NULL)
+                       goto attr_err;
+
+               err = sysfs_create_link(&rdev->dev.kobj, &dev->kobj,
+                                       buf);
+               if (err) {
+                       printk(KERN_WARNING
+                              "%s: could not add device link %s err %d\n",
+                              __func__, dev->kobj.name, err);
+                       device_remove_file(dev, &regulator->dev_attr);
+                       goto link_name_err;
+               }
+       }
+       mutex_unlock(&rdev->mutex);
+       return regulator;
+link_name_err:
+       kfree(regulator->supply_name);
+attr_err:
+       device_remove_file(regulator->dev, &regulator->dev_attr);
+attr_name_err:
+       kfree(regulator->dev_attr.attr.name);
+overflow_err:
+       list_del(&regulator->list);
+       kfree(regulator);
+       mutex_unlock(&rdev->mutex);
+       return NULL;
+}
+
+/**
+ * regulator_get - lookup and obtain a reference to a regulator.
+ * @dev: device for regulator "consumer"
+ * @id: Supply name or regulator ID.
+ *
+ * Returns a struct regulator corresponding to the regulator producer,
+ * or IS_ERR() condition containing errno.  Use of supply names
+ * configured via regulator_set_device_supply() is strongly
+ * encouraged.
+ */
+struct regulator *regulator_get(struct device *dev, const char *id)
+{
+       struct regulator_dev *rdev;
+       struct regulator_map *map;
+       struct regulator *regulator = ERR_PTR(-ENODEV);
+       const char *supply = id;
+
+       if (id == NULL) {
+               printk(KERN_ERR "regulator: get() with no identifier\n");
+               return regulator;
+       }
+
+       mutex_lock(&regulator_list_mutex);
+
+       list_for_each_entry(map, &regulator_map_list, list) {
+               if (dev == map->dev &&
+                   strcmp(map->supply, id) == 0) {
+                       supply = map->regulator;
+                       break;
+               }
+       }
+
+       list_for_each_entry(rdev, &regulator_list, list) {
+               if (strcmp(supply, rdev->desc->name) == 0 &&
+                   try_module_get(rdev->owner))
+                       goto found;
+       }
+       printk(KERN_ERR "regulator: Unable to get requested regulator: %s\n",
+              id);
+       mutex_unlock(&regulator_list_mutex);
+       return regulator;
+
+found:
+       regulator = create_regulator(rdev, dev, id);
+       if (regulator == NULL) {
+               regulator = ERR_PTR(-ENOMEM);
+               module_put(rdev->owner);
+       }
+
+       mutex_unlock(&regulator_list_mutex);
+       return regulator;
+}
+EXPORT_SYMBOL_GPL(regulator_get);
+
+/**
+ * regulator_put - "free" the regulator source
+ * @regulator: regulator source
+ *
+ * Note: drivers must ensure that all regulator_enable calls made on this
+ * regulator source are balanced by regulator_disable calls prior to calling
+ * this function.
+ */
+void regulator_put(struct regulator *regulator)
+{
+       struct regulator_dev *rdev;
+
+       if (regulator == NULL || IS_ERR(regulator))
+               return;
+
+       if (regulator->enabled) {
+               printk(KERN_WARNING "Releasing supply %s while enabled\n",
+                      regulator->supply_name);
+               WARN_ON(regulator->enabled);
+               regulator_disable(regulator);
+       }
+
+       mutex_lock(&regulator_list_mutex);
+       rdev = regulator->rdev;
+
+       /* remove any sysfs entries */
+       if (regulator->dev) {
+               sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name);
+               kfree(regulator->supply_name);
+               device_remove_file(regulator->dev, &regulator->dev_attr);
+               kfree(regulator->dev_attr.attr.name);
+       }
+       list_del(&regulator->list);
+       kfree(regulator);
+
+       module_put(rdev->owner);
+       mutex_unlock(&regulator_list_mutex);
+}
+EXPORT_SYMBOL_GPL(regulator_put);
+
+/* locks held by regulator_enable() */
+static int _regulator_enable(struct regulator_dev *rdev)
+{
+       int ret = -EINVAL;
+
+       if (!rdev->constraints) {
+               printk(KERN_ERR "%s: %s has no constraints\n",
+                      __func__, rdev->desc->name);
+               return ret;
+       }
+
+       /* do we need to enable the supply regulator first */
+       if (rdev->supply) {
+               ret = _regulator_enable(rdev->supply);
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to enable %s: %d\n",
+                              __func__, rdev->desc->name, ret);
+                       return ret;
+               }
+       }
+
+       /* check voltage and requested load before enabling */
+       if (rdev->desc->ops->enable) {
+
+               if (rdev->constraints &&
+                       (rdev->constraints->valid_ops_mask &
+                       REGULATOR_CHANGE_DRMS))
+                       drms_uA_update(rdev);
+
+               ret = rdev->desc->ops->enable(rdev);
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to enable %s: %d\n",
+                              __func__, rdev->desc->name, ret);
+                       return ret;
+               }
+               rdev->use_count++;
+               return ret;
+       }
+
+       return ret;
+}
+
+/**
+ * regulator_enable - enable regulator output
+ * @regulator: regulator source
+ *
+ * Enable the regulator output at the predefined voltage or current value.
+ * NOTE: the output value can be set by other drivers, boot loader or may be
+ * hardwired in the regulator.
+ * NOTE: calls to regulator_enable() must be balanced with calls to
+ * regulator_disable().
+ */
+int regulator_enable(struct regulator *regulator)
+{
+       int ret;
+
+       if (regulator->enabled) {
+               printk(KERN_CRIT "Regulator %s already enabled\n",
+                      regulator->supply_name);
+               WARN_ON(regulator->enabled);
+               return 0;
+       }
+
+       mutex_lock(&regulator->rdev->mutex);
+       regulator->enabled = 1;
+       ret = _regulator_enable(regulator->rdev);
+       if (ret != 0)
+               regulator->enabled = 0;
+       mutex_unlock(&regulator->rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_enable);
+
+/* locks held by regulator_disable() */
+static int _regulator_disable(struct regulator_dev *rdev)
+{
+       int ret = 0;
+
+       /* are we the last user and permitted to disable ? */
+       if (rdev->use_count == 1 && !rdev->constraints->always_on) {
+
+               /* we are last user */
+               if (rdev->desc->ops->disable) {
+                       ret = rdev->desc->ops->disable(rdev);
+                       if (ret < 0) {
+                               printk(KERN_ERR "%s: failed to disable %s\n",
+                                      __func__, rdev->desc->name);
+                               return ret;
+                       }
+               }
+
+               /* decrease our supplies ref count and disable if required */
+               if (rdev->supply)
+                       _regulator_disable(rdev->supply);
+
+               rdev->use_count = 0;
+       } else if (rdev->use_count > 1) {
+
+               if (rdev->constraints &&
+                       (rdev->constraints->valid_ops_mask &
+                       REGULATOR_CHANGE_DRMS))
+                       drms_uA_update(rdev);
+
+               rdev->use_count--;
+       }
+       return ret;
+}
+
+/**
+ * regulator_disable - disable regulator output
+ * @regulator: regulator source
+ *
+ * Disable the regulator output voltage or current.
+ * NOTE: this will only disable the regulator output if no other consumer
+ * devices have it enabled.
+ * NOTE: calls to regulator_enable() must be balanced with calls to
+ * regulator_disable().
+ */
+int regulator_disable(struct regulator *regulator)
+{
+       int ret;
+
+       if (!regulator->enabled) {
+               printk(KERN_ERR "%s: not in use by this consumer\n",
+                       __func__);
+               return 0;
+       }
+
+       mutex_lock(&regulator->rdev->mutex);
+       regulator->enabled = 0;
+       regulator->uA_load = 0;
+       ret = _regulator_disable(regulator->rdev);
+       mutex_unlock(&regulator->rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_disable);
+
+/* locks held by regulator_force_disable() */
+static int _regulator_force_disable(struct regulator_dev *rdev)
+{
+       int ret = 0;
+
+       /* force disable */
+       if (rdev->desc->ops->disable) {
+               /* ah well, who wants to live forever... */
+               ret = rdev->desc->ops->disable(rdev);
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to force disable %s\n",
+                              __func__, rdev->desc->name);
+                       return ret;
+               }
+               /* notify other consumers that power has been forced off */
+               _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE,
+                       NULL);
+       }
+
+       /* decrease our supplies ref count and disable if required */
+       if (rdev->supply)
+               _regulator_disable(rdev->supply);
+
+       rdev->use_count = 0;
+       return ret;
+}
+
+/**
+ * regulator_force_disable - force disable regulator output
+ * @regulator: regulator source
+ *
+ * Forcibly disable the regulator output voltage or current.
+ * NOTE: this *will* disable the regulator output even if other consumer
+ * devices have it enabled. This should be used for situations when device
+ * damage will likely occur if the regulator is not disabled (e.g. over temp).
+ */
+int regulator_force_disable(struct regulator *regulator)
+{
+       int ret;
+
+       mutex_lock(&regulator->rdev->mutex);
+       regulator->enabled = 0;
+       regulator->uA_load = 0;
+       ret = _regulator_force_disable(regulator->rdev);
+       mutex_unlock(&regulator->rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_force_disable);
+
+static int _regulator_is_enabled(struct regulator_dev *rdev)
+{
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->is_enabled) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       ret = rdev->desc->ops->is_enabled(rdev);
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+
+/**
+ * regulator_is_enabled - is the regulator output enabled
+ * @regulator: regulator source
+ *
+ * Returns zero for disabled otherwise return number of enable requests.
+ */
+int regulator_is_enabled(struct regulator *regulator)
+{
+       return _regulator_is_enabled(regulator->rdev);
+}
+EXPORT_SYMBOL_GPL(regulator_is_enabled);
+
+/**
+ * regulator_set_voltage - set regulator output voltage
+ * @regulator: regulator source
+ * @min_uV: Minimum required voltage in uV
+ * @max_uV: Maximum acceptable voltage in uV
+ *
+ * Sets a voltage regulator to the desired output voltage. This can be set
+ * during any regulator state. IOW, regulator can be disabled or enabled.
+ *
+ * If the regulator is enabled then the voltage will change to the new value
+ * immediately otherwise if the regulator is disabled the regulator will
+ * output at the new voltage when enabled.
+ *
+ * NOTE: If the regulator is shared between several devices then the lowest
+ * request voltage that meets the system constraints will be used.
+ * NOTE: Regulator system constraints must be set for this regulator before
+ * calling this function otherwise this call will fail.
+ */
+int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
+{
+       struct regulator_dev *rdev = regulator->rdev;
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->set_voltage) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* constraints check */
+       ret = regulator_check_voltage(rdev, &min_uV, &max_uV);
+       if (ret < 0)
+               goto out;
+       regulator->min_uV = min_uV;
+       regulator->max_uV = max_uV;
+       ret = rdev->desc->ops->set_voltage(rdev, min_uV, max_uV);
+
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_voltage);
+
+static int _regulator_get_voltage(struct regulator_dev *rdev)
+{
+       /* sanity check */
+       if (rdev->desc->ops->get_voltage)
+               return rdev->desc->ops->get_voltage(rdev);
+       else
+               return -EINVAL;
+}
+
+/**
+ * regulator_get_voltage - get regulator output voltage
+ * @regulator: regulator source
+ *
+ * This returns the current regulator voltage in uV.
+ *
+ * NOTE: If the regulator is disabled it will return the voltage value. This
+ * function should not be used to determine regulator state.
+ */
+int regulator_get_voltage(struct regulator *regulator)
+{
+       int ret;
+
+       mutex_lock(&regulator->rdev->mutex);
+
+       ret = _regulator_get_voltage(regulator->rdev);
+
+       mutex_unlock(&regulator->rdev->mutex);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_get_voltage);
+
+/**
+ * regulator_set_current_limit - set regulator output current limit
+ * @regulator: regulator source
+ * @min_uA: Minimuum supported current in uA
+ * @max_uA: Maximum supported current in uA
+ *
+ * Sets current sink to the desired output current. This can be set during
+ * any regulator state. IOW, regulator can be disabled or enabled.
+ *
+ * If the regulator is enabled then the current will change to the new value
+ * immediately otherwise if the regulator is disabled the regulator will
+ * output at the new current when enabled.
+ *
+ * NOTE: Regulator system constraints must be set for this regulator before
+ * calling this function otherwise this call will fail.
+ */
+int regulator_set_current_limit(struct regulator *regulator,
+                              int min_uA, int max_uA)
+{
+       struct regulator_dev *rdev = regulator->rdev;
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->set_current_limit) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* constraints check */
+       ret = regulator_check_current_limit(rdev, &min_uA, &max_uA);
+       if (ret < 0)
+               goto out;
+
+       ret = rdev->desc->ops->set_current_limit(rdev, min_uA, max_uA);
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_current_limit);
+
+static int _regulator_get_current_limit(struct regulator_dev *rdev)
+{
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->get_current_limit) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       ret = rdev->desc->ops->get_current_limit(rdev);
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+
+/**
+ * regulator_get_current_limit - get regulator output current
+ * @regulator: regulator source
+ *
+ * This returns the current supplied by the specified current sink in uA.
+ *
+ * NOTE: If the regulator is disabled it will return the current value. This
+ * function should not be used to determine regulator state.
+ */
+int regulator_get_current_limit(struct regulator *regulator)
+{
+       return _regulator_get_current_limit(regulator->rdev);
+}
+EXPORT_SYMBOL_GPL(regulator_get_current_limit);
+
+/**
+ * regulator_set_mode - set regulator operating mode
+ * @regulator: regulator source
+ * @mode: operating mode - one of the REGULATOR_MODE constants
+ *
+ * Set regulator operating mode to increase regulator efficiency or improve
+ * regulation performance.
+ *
+ * NOTE: Regulator system constraints must be set for this regulator before
+ * calling this function otherwise this call will fail.
+ */
+int regulator_set_mode(struct regulator *regulator, unsigned int mode)
+{
+       struct regulator_dev *rdev = regulator->rdev;
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->set_mode) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* constraints check */
+       ret = regulator_check_mode(rdev, mode);
+       if (ret < 0)
+               goto out;
+
+       ret = rdev->desc->ops->set_mode(rdev, mode);
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_mode);
+
+static unsigned int _regulator_get_mode(struct regulator_dev *rdev)
+{
+       int ret;
+
+       mutex_lock(&rdev->mutex);
+
+       /* sanity check */
+       if (!rdev->desc->ops->get_mode) {
+               ret = -EINVAL;
+               goto out;
+       }
+
+       ret = rdev->desc->ops->get_mode(rdev);
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+
+/**
+ * regulator_get_mode - get regulator operating mode
+ * @regulator: regulator source
+ *
+ * Get the current regulator operating mode.
+ */
+unsigned int regulator_get_mode(struct regulator *regulator)
+{
+       return _regulator_get_mode(regulator->rdev);
+}
+EXPORT_SYMBOL_GPL(regulator_get_mode);
+
+/**
+ * regulator_set_optimum_mode - set regulator optimum operating mode
+ * @regulator: regulator source
+ * @uA_load: load current
+ *
+ * Notifies the regulator core of a new device load. This is then used by
+ * DRMS (if enabled by constraints) to set the most efficient regulator
+ * operating mode for the new regulator loading.
+ *
+ * Consumer devices notify their supply regulator of the maximum power
+ * they will require (can be taken from device datasheet in the power
+ * consumption tables) when they change operational status and hence power
+ * state. Examples of operational state changes that can affect power
+ * consumption are :-
+ *
+ *    o Device is opened / closed.
+ *    o Device I/O is about to begin or has just finished.
+ *    o Device is idling in between work.
+ *
+ * This information is also exported via sysfs to userspace.
+ *
+ * DRMS will sum the total requested load on the regulator and change
+ * to the most efficient operating mode if platform constraints allow.
+ *
+ * Returns the new regulator mode or error.
+ */
+int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
+{
+       struct regulator_dev *rdev = regulator->rdev;
+       struct regulator *consumer;
+       int ret, output_uV, input_uV, total_uA_load = 0;
+       unsigned int mode;
+
+       mutex_lock(&rdev->mutex);
+
+       regulator->uA_load = uA_load;
+       ret = regulator_check_drms(rdev);
+       if (ret < 0)
+               goto out;
+       ret = -EINVAL;
+
+       /* sanity check */
+       if (!rdev->desc->ops->get_optimum_mode)
+               goto out;
+
+       /* get output voltage */
+       output_uV = rdev->desc->ops->get_voltage(rdev);
+       if (output_uV <= 0) {
+               printk(KERN_ERR "%s: invalid output voltage found for %s\n",
+                       __func__, rdev->desc->name);
+               goto out;
+       }
+
+       /* get input voltage */
+       if (rdev->supply && rdev->supply->desc->ops->get_voltage)
+               input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply);
+       else
+               input_uV = rdev->constraints->input_uV;
+       if (input_uV <= 0) {
+               printk(KERN_ERR "%s: invalid input voltage found for %s\n",
+                       __func__, rdev->desc->name);
+               goto out;
+       }
+
+       /* calc total requested load for this regulator */
+       list_for_each_entry(consumer, &rdev->consumer_list, list)
+           total_uA_load += consumer->uA_load;
+
+       mode = rdev->desc->ops->get_optimum_mode(rdev,
+                                                input_uV, output_uV,
+                                                total_uA_load);
+       if (ret <= 0) {
+               printk(KERN_ERR "%s: failed to get optimum mode for %s @"
+                       " %d uA %d -> %d uV\n", __func__, rdev->desc->name,
+                       total_uA_load, input_uV, output_uV);
+               goto out;
+       }
+
+       ret = rdev->desc->ops->set_mode(rdev, mode);
+       if (ret <= 0) {
+               printk(KERN_ERR "%s: failed to set optimum mode %x for %s\n",
+                       __func__, mode, rdev->desc->name);
+               goto out;
+       }
+       ret = mode;
+out:
+       mutex_unlock(&rdev->mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_optimum_mode);
+
+/**
+ * regulator_register_notifier - register regulator event notifier
+ * @regulator: regulator source
+ * @notifier_block: notifier block
+ *
+ * Register notifier block to receive regulator events.
+ */
+int regulator_register_notifier(struct regulator *regulator,
+                             struct notifier_block *nb)
+{
+       return blocking_notifier_chain_register(&regulator->rdev->notifier,
+                                               nb);
+}
+EXPORT_SYMBOL_GPL(regulator_register_notifier);
+
+/**
+ * regulator_unregister_notifier - unregister regulator event notifier
+ * @regulator: regulator source
+ * @notifier_block: notifier block
+ *
+ * Unregister regulator event notifier block.
+ */
+int regulator_unregister_notifier(struct regulator *regulator,
+                               struct notifier_block *nb)
+{
+       return blocking_notifier_chain_unregister(&regulator->rdev->notifier,
+                                                 nb);
+}
+EXPORT_SYMBOL_GPL(regulator_unregister_notifier);
+
+/* notify regulator consumers and downstream regulator consumers */
+static void _notifier_call_chain(struct regulator_dev *rdev,
+                                 unsigned long event, void *data)
+{
+       struct regulator_dev *_rdev;
+
+       /* call rdev chain first */
+       mutex_lock(&rdev->mutex);
+       blocking_notifier_call_chain(&rdev->notifier, event, NULL);
+       mutex_unlock(&rdev->mutex);
+
+       /* now notify regulator we supply */
+       list_for_each_entry(_rdev, &rdev->supply_list, slist)
+               _notifier_call_chain(_rdev, event, data);
+}
+
+/**
+ * regulator_bulk_get - get multiple regulator consumers
+ *
+ * @dev:           Device to supply
+ * @num_consumers: Number of consumers to register
+ * @consumers:     Configuration of consumers; clients are stored here.
+ *
+ * @return 0 on success, an errno on failure.
+ *
+ * This helper function allows drivers to get several regulator
+ * consumers in one operation.  If any of the regulators cannot be
+ * acquired then any regulators that were allocated will be freed
+ * before returning to the caller.
+ */
+int regulator_bulk_get(struct device *dev, int num_consumers,
+                      struct regulator_bulk_data *consumers)
+{
+       int i;
+       int ret;
+
+       for (i = 0; i < num_consumers; i++)
+               consumers[i].consumer = NULL;
+
+       for (i = 0; i < num_consumers; i++) {
+               consumers[i].consumer = regulator_get(dev,
+                                                     consumers[i].supply);
+               if (IS_ERR(consumers[i].consumer)) {
+                       dev_err(dev, "Failed to get supply '%s'\n",
+                               consumers[i].supply);
+                       ret = PTR_ERR(consumers[i].consumer);
+                       consumers[i].consumer = NULL;
+                       goto err;
+               }
+       }
+
+       return 0;
+
+err:
+       for (i = 0; i < num_consumers && consumers[i].consumer; i++)
+               regulator_put(consumers[i].consumer);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_bulk_get);
+
+/**
+ * regulator_bulk_enable - enable multiple regulator consumers
+ *
+ * @num_consumers: Number of consumers
+ * @consumers:     Consumer data; clients are stored here.
+ * @return         0 on success, an errno on failure
+ *
+ * This convenience API allows consumers to enable multiple regulator
+ * clients in a single API call.  If any consumers cannot be enabled
+ * then any others that were enabled will be disabled again prior to
+ * return.
+ */
+int regulator_bulk_enable(int num_consumers,
+                         struct regulator_bulk_data *consumers)
+{
+       int i;
+       int ret;
+
+       for (i = 0; i < num_consumers; i++) {
+               ret = regulator_enable(consumers[i].consumer);
+               if (ret != 0)
+                       goto err;
+       }
+
+       return 0;
+
+err:
+       printk(KERN_ERR "Failed to enable %s\n", consumers[i].supply);
+       for (i = 0; i < num_consumers; i++)
+               regulator_disable(consumers[i].consumer);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_bulk_enable);
+
+/**
+ * regulator_bulk_disable - disable multiple regulator consumers
+ *
+ * @num_consumers: Number of consumers
+ * @consumers:     Consumer data; clients are stored here.
+ * @return         0 on success, an errno on failure
+ *
+ * This convenience API allows consumers to disable multiple regulator
+ * clients in a single API call.  If any consumers cannot be enabled
+ * then any others that were disabled will be disabled again prior to
+ * return.
+ */
+int regulator_bulk_disable(int num_consumers,
+                          struct regulator_bulk_data *consumers)
+{
+       int i;
+       int ret;
+
+       for (i = 0; i < num_consumers; i++) {
+               ret = regulator_disable(consumers[i].consumer);
+               if (ret != 0)
+                       goto err;
+       }
+
+       return 0;
+
+err:
+       printk(KERN_ERR "Failed to disable %s\n", consumers[i].supply);
+       for (i = 0; i < num_consumers; i++)
+               regulator_enable(consumers[i].consumer);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_bulk_disable);
+
+/**
+ * regulator_bulk_free - free multiple regulator consumers
+ *
+ * @num_consumers: Number of consumers
+ * @consumers:     Consumer data; clients are stored here.
+ *
+ * This convenience API allows consumers to free multiple regulator
+ * clients in a single API call.
+ */
+void regulator_bulk_free(int num_consumers,
+                        struct regulator_bulk_data *consumers)
+{
+       int i;
+
+       for (i = 0; i < num_consumers; i++) {
+               regulator_put(consumers[i].consumer);
+               consumers[i].consumer = NULL;
+       }
+}
+EXPORT_SYMBOL_GPL(regulator_bulk_free);
+
+/**
+ * regulator_notifier_call_chain - call regulator event notifier
+ * @regulator: regulator source
+ * @event: notifier block
+ * @data:
+ *
+ * Called by regulator drivers to notify clients a regulator event has
+ * occurred. We also notify regulator clients downstream.
+ */
+int regulator_notifier_call_chain(struct regulator_dev *rdev,
+                                 unsigned long event, void *data)
+{
+       _notifier_call_chain(rdev, event, data);
+       return NOTIFY_DONE;
+
+}
+EXPORT_SYMBOL_GPL(regulator_notifier_call_chain);
+
+/**
+ * regulator_register - register regulator
+ * @regulator: regulator source
+ * @reg_data: private regulator data
+ *
+ * Called by regulator drivers to register a regulator.
+ * Returns 0 on success.
+ */
+struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+                                         void *reg_data)
+{
+       static atomic_t regulator_no = ATOMIC_INIT(0);
+       struct regulator_dev *rdev;
+       int ret;
+
+       if (regulator_desc == NULL)
+               return ERR_PTR(-EINVAL);
+
+       if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
+               return ERR_PTR(-EINVAL);
+
+       if (!regulator_desc->type == REGULATOR_VOLTAGE &&
+           !regulator_desc->type == REGULATOR_CURRENT)
+               return ERR_PTR(-EINVAL);
+
+       rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
+       if (rdev == NULL)
+               return ERR_PTR(-ENOMEM);
+
+       mutex_lock(&regulator_list_mutex);
+
+       mutex_init(&rdev->mutex);
+       rdev->reg_data = reg_data;
+       rdev->owner = regulator_desc->owner;
+       rdev->desc = regulator_desc;
+       INIT_LIST_HEAD(&rdev->consumer_list);
+       INIT_LIST_HEAD(&rdev->supply_list);
+       INIT_LIST_HEAD(&rdev->list);
+       INIT_LIST_HEAD(&rdev->slist);
+       BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier);
+
+       rdev->dev.class = &regulator_class;
+       device_initialize(&rdev->dev);
+       snprintf(rdev->dev.bus_id, sizeof(rdev->dev.bus_id),
+                "regulator_%ld_%s",
+                (unsigned long)atomic_inc_return(&regulator_no) - 1,
+                regulator_desc->name);
+
+       ret = device_add(&rdev->dev);
+       if (ret == 0)
+               list_add(&rdev->list, &regulator_list);
+       else {
+               kfree(rdev);
+               rdev = ERR_PTR(ret);
+       }
+       mutex_unlock(&regulator_list_mutex);
+       return rdev;
+}
+EXPORT_SYMBOL_GPL(regulator_register);
+
+/**
+ * regulator_unregister - unregister regulator
+ * @regulator: regulator source
+ *
+ * Called by regulator drivers to unregister a regulator.
+ */
+void regulator_unregister(struct regulator_dev *rdev)
+{
+       if (rdev == NULL)
+               return;
+
+       mutex_lock(&regulator_list_mutex);
+       list_del(&rdev->list);
+       if (rdev->supply)
+               sysfs_remove_link(&rdev->dev.kobj, "supply");
+       device_unregister(&rdev->dev);
+       mutex_unlock(&regulator_list_mutex);
+}
+EXPORT_SYMBOL_GPL(regulator_unregister);
+
+/**
+ * regulator_set_supply - set regulator supply regulator
+ * @regulator: regulator name
+ * @supply: supply regulator name
+ *
+ * Called by platform initialisation code to set the supply regulator for this
+ * regulator. This ensures that a regulators supply will also be enabled by the
+ * core if it's child is enabled.
+ */
+int regulator_set_supply(const char *regulator, const char *supply)
+{
+       struct regulator_dev *rdev, *supply_rdev;
+       int err;
+
+       if (regulator == NULL || supply == NULL)
+               return -EINVAL;
+
+       mutex_lock(&regulator_list_mutex);
+
+       list_for_each_entry(rdev, &regulator_list, list) {
+               if (!strcmp(rdev->desc->name, regulator))
+                       goto found_regulator;
+       }
+       mutex_unlock(&regulator_list_mutex);
+       return -ENODEV;
+
+found_regulator:
+       list_for_each_entry(supply_rdev, &regulator_list, list) {
+               if (!strcmp(supply_rdev->desc->name, supply))
+                       goto found_supply;
+       }
+       mutex_unlock(&regulator_list_mutex);
+       return -ENODEV;
+
+found_supply:
+       err = sysfs_create_link(&rdev->dev.kobj, &supply_rdev->dev.kobj,
+                               "supply");
+       if (err) {
+               printk(KERN_ERR
+                      "%s: could not add device link %s err %d\n",
+                      __func__, supply_rdev->dev.kobj.name, err);
+                      goto out;
+       }
+       rdev->supply = supply_rdev;
+       list_add(&rdev->slist, &supply_rdev->supply_list);
+out:
+       mutex_unlock(&regulator_list_mutex);
+       return err;
+}
+EXPORT_SYMBOL_GPL(regulator_set_supply);
+
+/**
+ * regulator_get_supply - get regulator supply regulator
+ * @regulator: regulator name
+ *
+ * Returns the supply supply regulator name or NULL if no supply regulator
+ * exists (i.e the regulator is supplied directly from USB, Line, Battery, etc)
+ */
+const char *regulator_get_supply(const char *regulator)
+{
+       struct regulator_dev *rdev;
+
+       if (regulator == NULL)
+               return NULL;
+
+       mutex_lock(&regulator_list_mutex);
+       list_for_each_entry(rdev, &regulator_list, list) {
+               if (!strcmp(rdev->desc->name, regulator))
+                       goto found;
+       }
+       mutex_unlock(&regulator_list_mutex);
+       return NULL;
+
+found:
+       mutex_unlock(&regulator_list_mutex);
+       if (rdev->supply)
+               return rdev->supply->desc->name;
+       else
+               return NULL;
+}
+EXPORT_SYMBOL_GPL(regulator_get_supply);
+
+/**
+ * regulator_set_machine_constraints - sets regulator constraints
+ * @regulator: regulator source
+ *
+ * Allows platform initialisation code to define and constrain
+ * regulator circuits e.g. valid voltage/current ranges, etc.  NOTE:
+ * Constraints *must* be set by platform code in order for some
+ * regulator operations to proceed i.e. set_voltage, set_current_limit,
+ * set_mode.
+ */
+int regulator_set_machine_constraints(const char *regulator_name,
+       struct regulation_constraints *constraints)
+{
+       struct regulator_dev *rdev;
+       int ret = 0;
+
+       if (regulator_name == NULL)
+               return -EINVAL;
+
+       mutex_lock(&regulator_list_mutex);
+
+       list_for_each_entry(rdev, &regulator_list, list) {
+               if (!strcmp(regulator_name, rdev->desc->name))
+                       goto found;
+       }
+       ret = -ENODEV;
+       goto out;
+
+found:
+       mutex_lock(&rdev->mutex);
+       rdev->constraints = constraints;
+
+       /* do we need to apply the constraint voltage */
+       if (rdev->constraints->apply_uV &&
+               rdev->constraints->min_uV == rdev->constraints->max_uV &&
+               rdev->desc->ops->set_voltage) {
+               ret = rdev->desc->ops->set_voltage(rdev,
+                       rdev->constraints->min_uV, rdev->constraints->max_uV);
+                       if (ret < 0) {
+                               printk(KERN_ERR "%s: failed to apply %duV"
+                                       " constraint\n", __func__,
+                                       rdev->constraints->min_uV);
+                               rdev->constraints = NULL;
+                               goto out;
+                       }
+       }
+
+       /* are we enabled at boot time by firmware / bootloader */
+       if (rdev->constraints->boot_on)
+               rdev->use_count = 1;
+
+       /* do we need to setup our suspend state */
+       if (constraints->initial_state)
+               ret = suspend_prepare(rdev, constraints->initial_state);
+
+       print_constraints(rdev);
+       mutex_unlock(&rdev->mutex);
+
+out:
+       mutex_unlock(&regulator_list_mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_machine_constraints);
+
+
+/**
+ * regulator_set_device_supply: Bind a regulator to a symbolic supply
+ * @regulator: regulator source
+ * @dev:       device the supply applies to
+ * @supply:    symbolic name for supply
+ *
+ * Allows platform initialisation code to map physical regulator
+ * sources to symbolic names for supplies for use by devices.  Devices
+ * should use these symbolic names to request regulators, avoiding the
+ * need to provide board-specific regulator names as platform data.
+ */
+int regulator_set_device_supply(const char *regulator, struct device *dev,
+                               const char *supply)
+{
+       struct regulator_map *node;
+
+       if (regulator == NULL || supply == NULL)
+               return -EINVAL;
+
+       node = kmalloc(sizeof(struct regulator_map), GFP_KERNEL);
+       if (node == NULL)
+               return -ENOMEM;
+
+       node->regulator = regulator;
+       node->dev = dev;
+       node->supply = supply;
+
+       mutex_lock(&regulator_list_mutex);
+       list_add(&node->list, &regulator_map_list);
+       mutex_unlock(&regulator_list_mutex);
+       return 0;
+}
+EXPORT_SYMBOL_GPL(regulator_set_device_supply);
+
+/**
+ * regulator_suspend_prepare: prepare regulators for system wide suspend
+ * @state: system suspend state
+ *
+ * Configure each regulator with it's suspend operating parameters for state.
+ * This will usually be called by machine suspend code prior to supending.
+ */
+int regulator_suspend_prepare(suspend_state_t state)
+{
+       struct regulator_dev *rdev;
+       int ret = 0;
+
+       /* ON is handled by regulator active state */
+       if (state == PM_SUSPEND_ON)
+               return -EINVAL;
+
+       mutex_lock(&regulator_list_mutex);
+       list_for_each_entry(rdev, &regulator_list, list) {
+
+               mutex_lock(&rdev->mutex);
+               ret = suspend_prepare(rdev, state);
+               mutex_unlock(&rdev->mutex);
+
+               if (ret < 0) {
+                       printk(KERN_ERR "%s: failed to prepare %s\n",
+                               __func__, rdev->desc->name);
+                       goto out;
+               }
+       }
+out:
+       mutex_unlock(&regulator_list_mutex);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_suspend_prepare);
+
+/**
+ * rdev_get_drvdata - get rdev regulator driver data
+ * @regulator: regulator
+ *
+ * Get rdev regulator driver private data. This call can be used in the
+ * regulator driver context.
+ */
+void *rdev_get_drvdata(struct regulator_dev *rdev)
+{
+       return rdev->reg_data;
+}
+EXPORT_SYMBOL_GPL(rdev_get_drvdata);
+
+/**
+ * regulator_get_drvdata - get regulator driver data
+ * @regulator: regulator
+ *
+ * Get regulator driver private data. This call can be used in the consumer
+ * driver context when non API regulator specific functions need to be called.
+ */
+void *regulator_get_drvdata(struct regulator *regulator)
+{
+       return regulator->rdev->reg_data;
+}
+EXPORT_SYMBOL_GPL(regulator_get_drvdata);
+
+/**
+ * regulator_set_drvdata - set regulator driver data
+ * @regulator: regulator
+ * @data: data
+ */
+void regulator_set_drvdata(struct regulator *regulator, void *data)
+{
+       regulator->rdev->reg_data = data;
+}
+EXPORT_SYMBOL_GPL(regulator_set_drvdata);
+
+/**
+ * regulator_get_id - get regulator ID
+ * @regulator: regulator
+ */
+int rdev_get_id(struct regulator_dev *rdev)
+{
+       return rdev->desc->id;
+}
+EXPORT_SYMBOL_GPL(rdev_get_id);
+
+static int __init regulator_init(void)
+{
+       printk(KERN_INFO "regulator: core version %s\n", REGULATOR_VERSION);
+       return class_register(&regulator_class);
+}
+
+/* init early to allow our consumers to complete system booting */
+core_initcall(regulator_init);
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
new file mode 100644 (file)
index 0000000..d31db3e
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * fixed.c
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.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 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This is useful for systems with mixed controllable and
+ * non-controllable regulators, as well as for allowing testing on
+ * systems with no controllable regulators.
+ */
+
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/fixed.h>
+
+struct fixed_voltage_data {
+       struct regulator_desc desc;
+       struct regulator_dev *dev;
+       int microvolts;
+};
+
+static int fixed_voltage_is_enabled(struct regulator_dev *dev)
+{
+       return 1;
+}
+
+static int fixed_voltage_enable(struct regulator_dev *dev)
+{
+       return 0;
+}
+
+static int fixed_voltage_get_voltage(struct regulator_dev *dev)
+{
+       struct fixed_voltage_data *data = rdev_get_drvdata(dev);
+
+       return data->microvolts;
+}
+
+static struct regulator_ops fixed_voltage_ops = {
+       .is_enabled = fixed_voltage_is_enabled,
+       .enable = fixed_voltage_enable,
+       .get_voltage = fixed_voltage_get_voltage,
+};
+
+static int regulator_fixed_voltage_probe(struct platform_device *pdev)
+{
+       struct fixed_voltage_config *config = pdev->dev.platform_data;
+       struct fixed_voltage_data *drvdata;
+       int ret;
+
+       drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL);
+       if (drvdata == NULL) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);
+       if (drvdata->desc.name == NULL) {
+               ret = -ENOMEM;
+               goto err;
+       }
+       drvdata->desc.type = REGULATOR_VOLTAGE;
+       drvdata->desc.owner = THIS_MODULE;
+       drvdata->desc.ops = &fixed_voltage_ops,
+
+       drvdata->microvolts = config->microvolts;
+
+       drvdata->dev = regulator_register(&drvdata->desc, drvdata);
+       if (IS_ERR(drvdata->dev)) {
+               ret = PTR_ERR(drvdata->dev);
+               goto err_name;
+       }
+
+       platform_set_drvdata(pdev, drvdata);
+
+       dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
+               drvdata->microvolts);
+
+       return 0;
+
+err_name:
+       kfree(drvdata->desc.name);
+err:
+       kfree(drvdata);
+       return ret;
+}
+
+static int regulator_fixed_voltage_remove(struct platform_device *pdev)
+{
+       struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
+
+       regulator_unregister(drvdata->dev);
+       kfree(drvdata->desc.name);
+       kfree(drvdata);
+
+       return 0;
+}
+
+static struct platform_driver regulator_fixed_voltage_driver = {
+       .probe          = regulator_fixed_voltage_probe,
+       .remove         = regulator_fixed_voltage_remove,
+       .driver         = {
+               .name           = "reg-fixed-voltage",
+       },
+};
+
+static int __init regulator_fixed_voltage_init(void)
+{
+       return platform_driver_register(&regulator_fixed_voltage_driver);
+}
+module_init(regulator_fixed_voltage_init);
+
+static void __exit regulator_fixed_voltage_exit(void)
+{
+       platform_driver_unregister(&regulator_fixed_voltage_driver);
+}
+module_exit(regulator_fixed_voltage_exit);
+
+MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+MODULE_DESCRIPTION("Fixed voltage regulator");
+MODULE_LICENSE("GPL");
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
new file mode 100644 (file)
index 0000000..5ddb464
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * reg-virtual-consumer.c
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.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 2 of the
+ * License, or (at your option) any later version.
+ */
+
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
+
+struct virtual_consumer_data {
+       struct mutex lock;
+       struct regulator *regulator;
+       int enabled;
+       int min_uV;
+       int max_uV;
+       int min_uA;
+       int max_uA;
+       unsigned int mode;
+};
+
+static void update_voltage_constraints(struct virtual_consumer_data *data)
+{
+       int ret;
+
+       if (data->min_uV && data->max_uV
+           && data->min_uV <= data->max_uV) {
+               ret = regulator_set_voltage(data->regulator,
+                                           data->min_uV, data->max_uV);
+               if (ret != 0) {
+                       printk(KERN_ERR "regulator_set_voltage() failed: %d\n",
+                              ret);
+                       return;
+               }
+       }
+
+       if (data->min_uV && data->max_uV && !data->enabled) {
+               ret = regulator_enable(data->regulator);
+               if (ret == 0)
+                       data->enabled = 1;
+               else
+                       printk(KERN_ERR "regulator_enable() failed: %d\n",
+                               ret);
+       }
+
+       if (!(data->min_uV && data->max_uV) && data->enabled) {
+               ret = regulator_disable(data->regulator);
+               if (ret == 0)
+                       data->enabled = 0;
+               else
+                       printk(KERN_ERR "regulator_disable() failed: %d\n",
+                               ret);
+       }
+}
+
+static void update_current_limit_constraints(struct virtual_consumer_data
+                                               *data)
+{
+       int ret;
+
+       if (data->max_uA
+           && data->min_uA <= data->max_uA) {
+               ret = regulator_set_current_limit(data->regulator,
+                                       data->min_uA, data->max_uA);
+               if (ret != 0) {
+                       pr_err("regulator_set_current_limit() failed: %d\n",
+                              ret);
+                       return;
+               }
+       }
+
+       if (data->max_uA && !data->enabled) {
+               ret = regulator_enable(data->regulator);
+               if (ret == 0)
+                       data->enabled = 1;
+               else
+                       printk(KERN_ERR "regulator_enable() failed: %d\n",
+                               ret);
+       }
+
+       if (!(data->min_uA && data->max_uA) && data->enabled) {
+               ret = regulator_disable(data->regulator);
+               if (ret == 0)
+                       data->enabled = 0;
+               else
+                       printk(KERN_ERR "regulator_disable() failed: %d\n",
+                               ret);
+       }
+}
+
+static ssize_t show_min_uV(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", data->min_uV);
+}
+
+static ssize_t set_min_uV(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       long val;
+
+       if (strict_strtol(buf, 10, &val) != 0)
+               return count;
+
+       mutex_lock(&data->lock);
+
+       data->min_uV = val;
+       update_voltage_constraints(data);
+
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t show_max_uV(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", data->max_uV);
+}
+
+static ssize_t set_max_uV(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       long val;
+
+       if (strict_strtol(buf, 10, &val) != 0)
+               return count;
+
+       mutex_lock(&data->lock);
+
+       data->max_uV = val;
+       update_voltage_constraints(data);
+
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t show_min_uA(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", data->min_uA);
+}
+
+static ssize_t set_min_uA(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       long val;
+
+       if (strict_strtol(buf, 10, &val) != 0)
+               return count;
+
+       mutex_lock(&data->lock);
+
+       data->min_uA = val;
+       update_current_limit_constraints(data);
+
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t show_max_uA(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       return sprintf(buf, "%d\n", data->max_uA);
+}
+
+static ssize_t set_max_uA(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       long val;
+
+       if (strict_strtol(buf, 10, &val) != 0)
+               return count;
+
+       mutex_lock(&data->lock);
+
+       data->max_uA = val;
+       update_current_limit_constraints(data);
+
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t show_mode(struct device *dev,
+                        struct device_attribute *attr, char *buf)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+
+       switch (data->mode) {
+       case REGULATOR_MODE_FAST:
+               return sprintf(buf, "fast\n");
+       case REGULATOR_MODE_NORMAL:
+               return sprintf(buf, "normal\n");
+       case REGULATOR_MODE_IDLE:
+               return sprintf(buf, "idle\n");
+       case REGULATOR_MODE_STANDBY:
+               return sprintf(buf, "standby\n");
+       default:
+               return sprintf(buf, "unknown\n");
+       }
+}
+
+static ssize_t set_mode(struct device *dev, struct device_attribute *attr,
+                       const char *buf, size_t count)
+{
+       struct virtual_consumer_data *data = dev_get_drvdata(dev);
+       unsigned int mode;
+       int ret;
+
+       if (strncmp(buf, "fast", strlen("fast")) == 0)
+               mode = REGULATOR_MODE_FAST;
+       else if (strncmp(buf, "normal", strlen("normal")) == 0)
+               mode = REGULATOR_MODE_NORMAL;
+       else if (strncmp(buf, "idle", strlen("idle")) == 0)
+               mode = REGULATOR_MODE_IDLE;
+       else if (strncmp(buf, "standby", strlen("standby")) == 0)
+               mode = REGULATOR_MODE_STANDBY;
+       else {
+               dev_err(dev, "Configuring invalid mode\n");
+               return count;
+       }
+
+       mutex_lock(&data->lock);
+       ret = regulator_set_mode(data->regulator, mode);
+       if (ret == 0)
+               data->mode = mode;
+       else
+               dev_err(dev, "Failed to configure mode: %d\n", ret);
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static DEVICE_ATTR(min_microvolts, 0666, show_min_uV, set_min_uV);
+static DEVICE_ATTR(max_microvolts, 0666, show_max_uV, set_max_uV);
+static DEVICE_ATTR(min_microamps, 0666, show_min_uA, set_min_uA);
+static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA);
+static DEVICE_ATTR(mode, 0666, show_mode, set_mode);
+
+struct device_attribute *attributes[] = {
+       &dev_attr_min_microvolts,
+       &dev_attr_max_microvolts,
+       &dev_attr_min_microamps,
+       &dev_attr_max_microamps,
+       &dev_attr_mode,
+};
+
+static int regulator_virtual_consumer_probe(struct platform_device *pdev)
+{
+       char *reg_id = pdev->dev.platform_data;
+       struct virtual_consumer_data *drvdata;
+       int ret, i;
+
+       drvdata = kzalloc(sizeof(struct virtual_consumer_data), GFP_KERNEL);
+       if (drvdata == NULL) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       mutex_init(&drvdata->lock);
+
+       drvdata->regulator = regulator_get(&pdev->dev, reg_id);
+       if (IS_ERR(drvdata->regulator)) {
+               ret = PTR_ERR(drvdata->regulator);
+               goto err;
+       }
+
+       for (i = 0; i < ARRAY_SIZE(attributes); i++) {
+               ret = device_create_file(&pdev->dev, attributes[i]);
+               if (ret != 0)
+                       goto err;
+       }
+
+       drvdata->mode = regulator_get_mode(drvdata->regulator);
+
+       platform_set_drvdata(pdev, drvdata);
+
+       return 0;
+
+err:
+       for (i = 0; i < ARRAY_SIZE(attributes); i++)
+               device_remove_file(&pdev->dev, attributes[i]);
+       kfree(drvdata);
+       return ret;
+}
+
+static int regulator_virtual_consumer_remove(struct platform_device *pdev)
+{
+       struct virtual_consumer_data *drvdata = platform_get_drvdata(pdev);
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(attributes); i++)
+               device_remove_file(&pdev->dev, attributes[i]);
+       if (drvdata->enabled)
+               regulator_disable(drvdata->regulator);
+       regulator_put(drvdata->regulator);
+
+       kfree(drvdata);
+
+       return 0;
+}
+
+static struct platform_driver regulator_virtual_consumer_driver = {
+       .probe          = regulator_virtual_consumer_probe,
+       .remove         = regulator_virtual_consumer_remove,
+       .driver         = {
+               .name           = "reg-virt-consumer",
+       },
+};
+
+
+static int __init regulator_virtual_consumer_init(void)
+{
+       return platform_driver_register(&regulator_virtual_consumer_driver);
+}
+module_init(regulator_virtual_consumer_init);
+
+static void __exit regulator_virtual_consumer_exit(void)
+{
+       platform_driver_unregister(&regulator_virtual_consumer_driver);
+}
+module_exit(regulator_virtual_consumer_exit);
+
+MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+MODULE_DESCRIPTION("Virtual regulator consumer");
+MODULE_LICENSE("GPL");
index e5e7d78564545543925fc6136c6e7c7fc994c028..8e08d51a0f0531d8bf661dc0d3bf8f822d35c357 100644 (file)
@@ -375,7 +375,6 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
        struct gendisk *disk = rq->rq_disk;
        struct scsi_disk *sdkp;
        sector_t block = rq->sector;
-       sector_t threshold;
        unsigned int this_count = rq->nr_sectors;
        unsigned int timeout = sdp->timeout;
        int ret;
@@ -423,21 +422,13 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
        }
 
        /*
-        * Some SD card readers can't handle multi-sector accesses which touch
-        * the last one or two hardware sectors.  Split accesses as needed.
+        * Some devices (some sdcards for one) don't like it if the
+        * last sector gets read in a larger then 1 sector read.
         */
-       threshold = get_capacity(disk) - SD_LAST_BUGGY_SECTORS *
-               (sdp->sector_size / 512);
-
-       if (unlikely(sdp->last_sector_bug && block + this_count > threshold)) {
-               if (block < threshold) {
-                       /* Access up to the threshold but not beyond */
-                       this_count = threshold - block;
-               } else {
-                       /* Access only a single hardware sector */
-                       this_count = sdp->sector_size / 512;
-               }
-       }
+       if (unlikely(sdp->last_sector_bug &&
+           rq->nr_sectors > sdp->sector_size / 512 &&
+           block + this_count == get_capacity(disk)))
+               this_count -= sdp->sector_size / 512;
 
        SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n",
                                        (unsigned long long)block));
index 95b9f06534d579bf72797c20ecd5546970f4b190..550b2f70a1f8330f93fea284c19f13554297ef86 100644 (file)
  */
 #define SD_BUF_SIZE            512
 
-/*
- * Number of sectors at the end of the device to avoid multi-sector
- * accesses to in the case of last_sector_bug
- */
-#define SD_LAST_BUGGY_SECTORS  8
-
 struct scsi_disk {
        struct scsi_driver *driver;     /* always &sd_template */
        struct scsi_device *device;
index 9d8543762a30fa858ee282d404dee0dd5934718e..efcd44344fb1e011e9b6b926a67dfd5d0d2d6443 100644 (file)
@@ -817,7 +817,7 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
        if (line >= port->info->port.tty->driver->num)
                return;
 
-       switch (port->info->port.tty->ldisc.num) {
+       switch (port->info->port.tty->termios->c_line) {
        case N_IRDA:
                val = UART_GET_GCTL(&bfin_serial_ports[line]);
                val |= (IREN | RPOLC);
index 8249ac490559162fdb05f8e58743c8d05035d2bd..bf94a770bb445d4b2d13ed71865f18fb982bfb0e 100644 (file)
@@ -234,7 +234,7 @@ unsigned long r_alt_ser_baudrate_shadow = 0;
 
 static struct e100_serial rs_table[] = {
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL0_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL0_CTRL,
          .irq         = 1U << 12, /* uses DMA 6 and 7 */
          .oclrintradr = R_DMA_CH6_CLR_INTR,
          .ofirstadr   = R_DMA_CH6_FIRST,
@@ -288,7 +288,7 @@ static struct e100_serial rs_table[] = {
 },  /* ttyS0 */
 #ifndef CONFIG_SVINTO_SIM
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL1_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL1_CTRL,
          .irq         = 1U << 16, /* uses DMA 8 and 9 */
          .oclrintradr = R_DMA_CH8_CLR_INTR,
          .ofirstadr   = R_DMA_CH8_FIRST,
@@ -344,7 +344,7 @@ static struct e100_serial rs_table[] = {
 },  /* ttyS1 */
 
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL2_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL2_CTRL,
          .irq         = 1U << 4,  /* uses DMA 2 and 3 */
          .oclrintradr = R_DMA_CH2_CLR_INTR,
          .ofirstadr   = R_DMA_CH2_FIRST,
@@ -398,7 +398,7 @@ static struct e100_serial rs_table[] = {
  },  /* ttyS2 */
 
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL3_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL3_CTRL,
          .irq         = 1U << 8,  /* uses DMA 4 and 5 */
          .oclrintradr = R_DMA_CH4_CLR_INTR,
          .ofirstadr   = R_DMA_CH4_FIRST,
@@ -939,7 +939,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =
 /* Output */
 #define E100_RTS_GET(info) ((info)->rx_ctrl & E100_RTS_MASK)
 /* Input */
-#define E100_CTS_GET(info) ((info)->port[REG_STATUS] & E100_CTS_MASK)
+#define E100_CTS_GET(info) ((info)->ioport[REG_STATUS] & E100_CTS_MASK)
 
 /* These are typically PA or PB and 0 means 0V, 1 means 3.3V */
 /* Is an output */
@@ -1092,7 +1092,7 @@ e100_rts(struct e100_serial *info, int set)
        local_irq_save(flags);
        info->rx_ctrl &= ~E100_RTS_MASK;
        info->rx_ctrl |= (set ? 0 : E100_RTS_MASK);  /* RTS is active low */
-       info->port[REG_REC_CTRL] = info->rx_ctrl;
+       info->ioport[REG_REC_CTRL] = info->rx_ctrl;
        local_irq_restore(flags);
 #ifdef SERIAL_DEBUG_IO
        printk("ser%i rts %i\n", info->line, set);
@@ -1142,7 +1142,7 @@ e100_disable_rx(struct e100_serial *info)
 {
 #ifndef CONFIG_SVINTO_SIM
        /* disable the receiver */
-       info->port[REG_REC_CTRL] =
+       info->ioport[REG_REC_CTRL] =
                (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
 #endif
 }
@@ -1152,7 +1152,7 @@ e100_enable_rx(struct e100_serial *info)
 {
 #ifndef CONFIG_SVINTO_SIM
        /* enable the receiver */
-       info->port[REG_REC_CTRL] =
+       info->ioport[REG_REC_CTRL] =
                (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
 #endif
 }
@@ -1490,7 +1490,7 @@ rs_stop(struct tty_struct *tty)
                        xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
                }
 
-               *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+               *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
                local_irq_restore(flags);
        }
 }
@@ -1513,7 +1513,7 @@ rs_start(struct tty_struct *tty)
                        xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
                }
 
-               *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+               *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
                if (!info->uses_dma_out &&
                    info->xmit.head != info->xmit.tail && info->xmit.buf)
                        e100_enable_serial_tx_ready_irq(info);
@@ -1888,7 +1888,7 @@ static void receive_chars_dma(struct e100_serial *info)
        handle_all_descr_data(info);
 
        /* Read the status register to detect errors */
-       rstat = info->port[REG_STATUS];
+       rstat = info->ioport[REG_STATUS];
        if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect stat %x\n", rstat));
        }
@@ -1897,7 +1897,7 @@ static void receive_chars_dma(struct e100_serial *info)
                /* If we got an error, we must reset it by reading the
                 * data_in field
                 */
-               unsigned char data = info->port[REG_DATA];
+               unsigned char data = info->ioport[REG_DATA];
 
                PROCSTAT(ser_stat[info->line].errors_cnt++);
                DEBUG_LOG(info->line, "#dERR: s d 0x%04X\n",
@@ -2077,7 +2077,7 @@ static int force_eop_if_needed(struct e100_serial *info)
        /* We check data_avail bit to determine if data has
         * arrived since last time
         */
-       unsigned char rstat = info->port[REG_STATUS];
+       unsigned char rstat = info->ioport[REG_STATUS];
 
        /* error or datavail? */
        if (rstat & SER_ERROR_MASK) {
@@ -2096,7 +2096,7 @@ static int force_eop_if_needed(struct e100_serial *info)
                TIMERD(DEBUG_LOG(info->line, "timeout: rstat 0x%03X\n",
                          rstat | (info->line << 8)));
                /* Read data to clear status flags */
-               (void)info->port[REG_DATA];
+               (void)info->ioport[REG_DATA];
 
                info->forced_eop = 0;
                START_FLUSH_FAST_TIMER(info, "magic");
@@ -2296,7 +2296,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
        }
 
        /* Read data and status at the same time */
-       data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+       data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]);
 more_data:
        if (data_read & IO_MASK(R_SERIAL0_READ, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
@@ -2391,7 +2391,7 @@ more_data:
 
 
        info->icount.rx++;
-       data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+       data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]);
        if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) {
                DEBUG_LOG(info->line, "ser_rx   %c in loop\n", IO_EXTRACT(R_SERIAL0_READ, data_in, data_read));
                goto more_data;
@@ -2413,7 +2413,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info)
                return handle_ser_rx_interrupt_no_dma(info);
        }
        /* DMA is used */
-       rstat = info->port[REG_STATUS];
+       rstat = info->ioport[REG_STATUS];
        if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
        }
@@ -2426,7 +2426,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info)
                /* If we got an error, we must reset it by reading the
                 * data_in field
                 */
-               data = info->port[REG_DATA];
+               data = info->ioport[REG_DATA];
                DINTR1(DEBUG_LOG(info->line, "ser_rx!  %c\n", data));
                DINTR1(DEBUG_LOG(info->line, "ser_rx err stat %02X\n", rstat));
                if (!data && (rstat & SER_FRAMING_ERR_MASK)) {
@@ -2528,10 +2528,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                unsigned char rstat;
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar 0x%02X\n", info->x_char));
                local_irq_save(flags);
-               rstat = info->port[REG_STATUS];
+               rstat = info->ioport[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
 
-               info->port[REG_TR_DATA] = info->x_char;
+               info->ioport[REG_TR_DATA] = info->x_char;
                info->icount.tx++;
                info->x_char = 0;
                /* We must enable since it is disabled in ser_interrupt */
@@ -2545,7 +2545,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                /* We only use normal tx interrupt when sending x_char */
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar sent\n", 0));
                local_irq_save(flags);
-               rstat = info->port[REG_STATUS];
+               rstat = info->ioport[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
                e100_disable_serial_tx_ready_irq(info);
                if (info->port.tty->stopped)
@@ -2573,7 +2573,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
        DINTR2(DEBUG_LOG(info->line, "tx_int %c\n", info->xmit.buf[info->xmit.tail]));
        /* Send a byte, rs485 timing is critical so turn of ints */
        local_irq_save(flags);
-       info->port[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
+       info->ioport[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
        info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
        info->icount.tx++;
        if (info->xmit.head == info->xmit.tail) {
@@ -2848,7 +2848,7 @@ startup(struct e100_serial * info)
 
        /* dummy read to reset any serial errors */
 
-       (void)info->port[REG_DATA];
+       (void)info->ioport[REG_DATA];
 
        /* enable the interrupts */
        if (info->uses_dma_out)
@@ -2897,7 +2897,7 @@ shutdown(struct e100_serial * info)
        /* shut down the transmitter and receiver */
        DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line));
        e100_disable_rx(info);
-       info->port[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);
+       info->ioport[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);
 
        /* disable interrupts, reset dma channels */
        if (info->uses_dma_in) {
@@ -2968,7 +2968,7 @@ change_speed(struct e100_serial *info)
 
        if (!info->port.tty || !info->port.tty->termios)
                return;
-       if (!info->port)
+       if (!info->ioport)
                return;
 
        cflag = info->port.tty->termios->c_cflag;
@@ -3037,7 +3037,7 @@ change_speed(struct e100_serial *info)
 
                info->baud = cflag_to_baud(cflag);
 #ifndef CONFIG_SVINTO_SIM
-               info->port[REG_BAUD] = cflag_to_etrax_baud(cflag);
+               info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag);
 #endif /* CONFIG_SVINTO_SIM */
        }
 
@@ -3097,8 +3097,8 @@ change_speed(struct e100_serial *info)
 
        /* actually write the control regs to the hardware */
 
-       info->port[REG_TR_CTRL] = info->tx_ctrl;
-       info->port[REG_REC_CTRL] = info->rx_ctrl;
+       info->ioport[REG_TR_CTRL] = info->tx_ctrl;
+       info->ioport[REG_REC_CTRL] = info->rx_ctrl;
        xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty));
        xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
        if (info->port.tty->termios->c_iflag & IXON ) {
@@ -3107,7 +3107,7 @@ change_speed(struct e100_serial *info)
                xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
        }
 
-       *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+       *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
        local_irq_restore(flags);
 #endif /* !CONFIG_SVINTO_SIM */
 
@@ -3156,7 +3156,7 @@ static int rs_raw_write(struct tty_struct *tty,
 #ifdef SERIAL_DEBUG_DATA
        if (info->line == SERIAL_DEBUG_LINE)
                printk("rs_raw_write (%d), status %d\n",
-                      count, info->port[REG_STATUS]);
+                      count, info->ioport[REG_STATUS]);
 #endif
 
 #ifdef CONFIG_SVINTO_SIM
@@ -3427,7 +3427,7 @@ get_serial_info(struct e100_serial * info,
        memset(&tmp, 0, sizeof(tmp));
        tmp.type = info->type;
        tmp.line = info->line;
-       tmp.port = (int)info->port;
+       tmp.port = (int)info->ioport;
        tmp.irq = info->irq;
        tmp.flags = info->flags;
        tmp.baud_base = info->baud_base;
@@ -3557,14 +3557,14 @@ char *get_control_state_str(int MLines, char *s)
 }
 #endif
 
-static void
+static int
 rs_break(struct tty_struct *tty, int break_state)
 {
        struct e100_serial *info = (struct e100_serial *)tty->driver_data;
        unsigned long flags;
 
-       if (!info->port)
-               return;
+       if (!info->ioport)
+               return -EIO;
 
        local_irq_save(flags);
        if (break_state == -1) {
@@ -3575,8 +3575,9 @@ rs_break(struct tty_struct *tty, int break_state)
                /* Set bit 7 (txd) and 6 (tr_enable) */
                info->tx_ctrl |= (0x80 | 0x40);
        }
-       info->port[REG_TR_CTRL] = info->tx_ctrl;
+       info->ioport[REG_TR_CTRL] = info->tx_ctrl;
        local_irq_restore(flags);
+       return 0;
 }
 
 static int
@@ -4231,9 +4232,9 @@ static int line_info(char *buf, struct e100_serial *info)
        unsigned long tmp;
 
        ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d",
-                     info->line, (unsigned long)info->port, info->irq);
+                     info->line, (unsigned long)info->ioport, info->irq);
 
-       if (!info->port || (info->type == PORT_UNKNOWN)) {
+       if (!info->ioport || (info->type == PORT_UNKNOWN)) {
                ret += sprintf(buf+ret, "\n");
                return ret;
        }
@@ -4281,7 +4282,7 @@ static int line_info(char *buf, struct e100_serial *info)
        }
 
        {
-               unsigned char rstat = info->port[REG_STATUS];
+               unsigned char rstat = info->ioport[REG_STATUS];
                if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) )
                        ret += sprintf(buf+ret, " xoff_detect:1");
        }
@@ -4502,7 +4503,7 @@ rs_init(void)
 
                if (info->enabled) {
                        printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n",
-                              serial_driver->name, info->line, (unsigned int)info->port);
+                              serial_driver->name, info->line, (unsigned int)info->ioport);
                }
        }
 #ifdef CONFIG_ETRAX_FAST_TIMER
index ccd0f32b73726cabe67f436d25f678ec98578e92..e3c5c8c3c09b5b42057da735e48faaad5beb00e9 100644 (file)
@@ -36,8 +36,9 @@ struct etrax_recv_buffer {
 };
 
 struct e100_serial {
+       struct tty_port port;
        int baud;
-       volatile u8     *port;  /* R_SERIALx_CTRL */
+       volatile u8     *ioport;        /* R_SERIALx_CTRL */
        u32             irq;    /* bitnr in R_IRQ_MASK2 for dmaX_descr */
 
        /* Output registers */
index cd728df6a01a4122c73f4c7fff3c082afdc8204c..8a0749e34ca3fe4e1646bc359777f97dae1bca2c 100644 (file)
@@ -451,19 +451,21 @@ SCIx_FNS(SCxSR,  0x08,  8, 0x10,  8, 0x08, 16, 0x10, 16, 0x04,  8)
 SCIx_FNS(SCxRDR, 0x0a,  8, 0x14,  8, 0x0A,  8, 0x14,  8, 0x05,  8)
 SCIF_FNS(SCFCR,                      0x0c,  8, 0x18, 16)
 #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7763) || \
     defined(CONFIG_CPU_SUBTYPE_SH7780) || \
     defined(CONFIG_CPU_SUBTYPE_SH7785)
+SCIF_FNS(SCFDR,                             0x0e, 16, 0x1C, 16)
 SCIF_FNS(SCTFDR,                    0x0e, 16, 0x1C, 16)
 SCIF_FNS(SCRFDR,                    0x0e, 16, 0x20, 16)
 SCIF_FNS(SCSPTR,                       0,  0, 0x24, 16)
 SCIF_FNS(SCLSR,                                0,  0, 0x28, 16)
-#if defined(CONFIG_CPU_SUBTYPE_SH7763)
-/* SH7763 SCIF2 */
+#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
 SCIF_FNS(SCFDR,                                0,  0, 0x1C, 16)
 SCIF_FNS(SCSPTR2,                      0,  0, 0x20, 16)
-SCIF_FNS(SCLSR2,                       0,  0, 0x24, 16)
-#endif /* CONFIG_CPU_SUBTYPE_SH7763 */
+SCIF_FNS(SCLSR2,                       0,  0, 0x24, 16)
+SCIF_FNS(SCTFDR,                    0x0e, 16, 0x1C, 16)
+SCIF_FNS(SCRFDR,                    0x0e, 16, 0x20, 16)
+SCIF_FNS(SCSPTR,                       0,  0, 0x24, 16)
+SCIF_FNS(SCLSR,                                0,  0, 0x28, 16)
 #else
 SCIF_FNS(SCFDR,                      0x0e, 16, 0x1C, 16)
 #if defined(CONFIG_CPU_SUBTYPE_SH7722)
index 617efb1640b10375c9dc2362cff085beef85f596..be97789fa5fdb267eb5931d5b2dfb39f135314af 100644 (file)
 #include <linux/slab.h>
 #include <linux/maple.h>
 #include <linux/dma-mapping.h>
+#include <linux/delay.h>
 #include <asm/cacheflush.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/mach/dma.h>
-#include <asm/mach/sysasic.h>
-#include <asm/mach/maple.h>
-#include <linux/delay.h>
+#include <mach/dma.h>
+#include <mach/sysasic.h>
 
 MODULE_AUTHOR("Yaegshi Takeshi, Paul Mundt, M.R. Brown, Adrian McMenamin");
 MODULE_DESCRIPTION("Maple bus driver for Dreamcast");
@@ -46,14 +45,15 @@ static DECLARE_WORK(maple_vblank_process, maple_vblank_handler);
 static LIST_HEAD(maple_waitq);
 static LIST_HEAD(maple_sentq);
 
-static DEFINE_MUTEX(maple_list_lock);
+/* mutex to protect queue of waiting packets */
+static DEFINE_MUTEX(maple_wlist_lock);
 
 static struct maple_driver maple_dummy_driver;
 static struct device maple_bus;
 static int subdevice_map[MAPLE_PORTS];
 static unsigned long *maple_sendbuf, *maple_sendptr, *maple_lastptr;
 static unsigned long maple_pnp_time;
-static int started, scanning, liststatus, fullscan;
+static int started, scanning, fullscan;
 static struct kmem_cache *maple_queue_cache;
 
 struct maple_device_specify {
@@ -129,35 +129,124 @@ static void maple_release_device(struct device *dev)
        kfree(mdev);
 }
 
-/**
+/*
  * maple_add_packet - add a single instruction to the queue
- * @mq: instruction to add to waiting queue
+ * @mdev - maple device
+ * @function - function on device being queried
+ * @command - maple command to add
+ * @length - length of command string (in 32 bit words)
+ * @data - remainder of command string
  */
-void maple_add_packet(struct mapleq *mq)
+int maple_add_packet(struct maple_device *mdev, u32 function, u32 command,
+       size_t length, void *data)
 {
-       mutex_lock(&maple_list_lock);
-       list_add(&mq->list, &maple_waitq);
-       mutex_unlock(&maple_list_lock);
+       int locking, ret = 0;
+       void *sendbuf = NULL;
+
+       mutex_lock(&maple_wlist_lock);
+       /* bounce if device already locked */
+       locking = mutex_is_locked(&mdev->mq->mutex);
+       if (locking) {
+               ret = -EBUSY;
+               goto out;
+       }
+
+       mutex_lock(&mdev->mq->mutex);
+
+       if (length) {
+               sendbuf = kmalloc(length * 4, GFP_KERNEL);
+               if (!sendbuf) {
+                       mutex_unlock(&mdev->mq->mutex);
+                       ret = -ENOMEM;
+                       goto out;
+               }
+               ((__be32 *)sendbuf)[0] = cpu_to_be32(function);
+       }
+
+       mdev->mq->command = command;
+       mdev->mq->length = length;
+       if (length > 1)
+               memcpy(sendbuf + 4, data, (length - 1) * 4);
+       mdev->mq->sendbuf = sendbuf;
+
+       list_add(&mdev->mq->list, &maple_waitq);
+out:
+       mutex_unlock(&maple_wlist_lock);
+       return ret;
 }
 EXPORT_SYMBOL_GPL(maple_add_packet);
 
+/*
+ * maple_add_packet_sleeps - add a single instruction to the queue
+ *  - waits for lock to be free
+ * @mdev - maple device
+ * @function - function on device being queried
+ * @command - maple command to add
+ * @length - length of command string (in 32 bit words)
+ * @data - remainder of command string
+ */
+int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
+       u32 command, size_t length, void *data)
+{
+       int locking, ret = 0;
+       void *sendbuf = NULL;
+
+       locking = mutex_lock_interruptible(&mdev->mq->mutex);
+       if (locking) {
+               ret = -EIO;
+               goto out;
+       }
+
+       if (length) {
+               sendbuf = kmalloc(length * 4, GFP_KERNEL);
+               if (!sendbuf) {
+                       mutex_unlock(&mdev->mq->mutex);
+                       ret = -ENOMEM;
+                       goto out;
+               }
+               ((__be32 *)sendbuf)[0] = cpu_to_be32(function);
+       }
+
+       mdev->mq->command = command;
+       mdev->mq->length = length;
+       if (length > 1)
+               memcpy(sendbuf + 4, data, (length - 1) * 4);
+       mdev->mq->sendbuf = sendbuf;
+
+       mutex_lock(&maple_wlist_lock);
+       list_add(&mdev->mq->list, &maple_waitq);
+       mutex_unlock(&maple_wlist_lock);
+out:
+       return ret;
+}
+EXPORT_SYMBOL_GPL(maple_add_packet_sleeps);
+
 static struct mapleq *maple_allocq(struct maple_device *mdev)
 {
        struct mapleq *mq;
 
        mq = kmalloc(sizeof(*mq), GFP_KERNEL);
        if (!mq)
-               return NULL;
+               goto failed_nomem;
 
        mq->dev = mdev;
        mq->recvbufdcsp = kmem_cache_zalloc(maple_queue_cache, GFP_KERNEL);
        mq->recvbuf = (void *) P2SEGADDR(mq->recvbufdcsp);
-       if (!mq->recvbuf) {
-               kfree(mq);
-               return NULL;
-       }
+       if (!mq->recvbuf)
+               goto failed_p2;
+       /*
+        * most devices do not need the mutex - but
+        * anything that injects block reads or writes
+        * will rely on it
+        */
+       mutex_init(&mq->mutex);
 
        return mq;
+
+failed_p2:
+       kfree(mq);
+failed_nomem:
+       return NULL;
 }
 
 static struct maple_device *maple_alloc_dev(int port, int unit)
@@ -178,7 +267,6 @@ static struct maple_device *maple_alloc_dev(int port, int unit)
        }
        mdev->dev.bus = &maple_bus_type;
        mdev->dev.parent = &maple_bus;
-       mdev->function = 0;
        return mdev;
 }
 
@@ -216,7 +304,6 @@ static void maple_build_block(struct mapleq *mq)
        *maple_sendptr++ = PHYSADDR(mq->recvbuf);
        *maple_sendptr++ =
            mq->command | (to << 8) | (from << 16) | (len << 24);
-
        while (len-- > 0)
                *maple_sendptr++ = *lsendbuf++;
 }
@@ -224,22 +311,27 @@ static void maple_build_block(struct mapleq *mq)
 /* build up command queue */
 static void maple_send(void)
 {
-       int i;
-       int maple_packets;
+       int i, maple_packets = 0;
        struct mapleq *mq, *nmq;
 
        if (!list_empty(&maple_sentq))
                return;
-       if (list_empty(&maple_waitq) || !maple_dma_done())
+       mutex_lock(&maple_wlist_lock);
+       if (list_empty(&maple_waitq) || !maple_dma_done()) {
+               mutex_unlock(&maple_wlist_lock);
                return;
-       maple_packets = 0;
-       maple_sendptr = maple_lastptr = maple_sendbuf;
+       }
+       mutex_unlock(&maple_wlist_lock);
+       maple_lastptr = maple_sendbuf;
+       maple_sendptr = maple_sendbuf;
+       mutex_lock(&maple_wlist_lock);
        list_for_each_entry_safe(mq, nmq, &maple_waitq, list) {
                maple_build_block(mq);
                list_move(&mq->list, &maple_sentq);
                if (maple_packets++ > MAPLE_MAXPACKETS)
                        break;
        }
+       mutex_unlock(&maple_wlist_lock);
        if (maple_packets > 0) {
                for (i = 0; i < (1 << MAPLE_DMA_PAGES); i++)
                        dma_cache_sync(0, maple_sendbuf + i * PAGE_SIZE,
@@ -247,7 +339,8 @@ static void maple_send(void)
        }
 }
 
-static int attach_matching_maple_driver(struct device_driver *driver,
+/* check if there is a driver registered likely to match this device */
+static int check_matching_maple_driver(struct device_driver *driver,
                                        void *devptr)
 {
        struct maple_driver *maple_drv;
@@ -255,12 +348,8 @@ static int attach_matching_maple_driver(struct device_driver *driver,
 
        mdev = devptr;
        maple_drv = to_maple_driver(driver);
-       if (mdev->devinfo.function & be32_to_cpu(maple_drv->function)) {
-               if (maple_drv->connect(mdev) == 0) {
-                       mdev->driver = maple_drv;
-                       return 1;
-               }
-       }
+       if (mdev->devinfo.function & cpu_to_be32(maple_drv->function))
+               return 1;
        return 0;
 }
 
@@ -268,11 +357,6 @@ static void maple_detach_driver(struct maple_device *mdev)
 {
        if (!mdev)
                return;
-       if (mdev->driver) {
-               if (mdev->driver->disconnect)
-                       mdev->driver->disconnect(mdev);
-       }
-       mdev->driver = NULL;
        device_unregister(&mdev->dev);
        mdev = NULL;
 }
@@ -328,8 +412,8 @@ static void maple_attach_driver(struct maple_device *mdev)
                        mdev->port, mdev->unit, function);
 
                matched =
-                   bus_for_each_drv(&maple_bus_type, NULL, mdev,
-                                    attach_matching_maple_driver);
+                       bus_for_each_drv(&maple_bus_type, NULL, mdev,
+                               check_matching_maple_driver);
 
                if (matched == 0) {
                        /* Driver does not exist yet */
@@ -373,45 +457,48 @@ static int detach_maple_device(struct device *device, void *portptr)
 
 static int setup_maple_commands(struct device *device, void *ignored)
 {
+       int add;
        struct maple_device *maple_dev = to_maple_dev(device);
 
        if ((maple_dev->interval > 0)
            && time_after(jiffies, maple_dev->when)) {
-               maple_dev->when = jiffies + maple_dev->interval;
-               maple_dev->mq->command = MAPLE_COMMAND_GETCOND;
-               maple_dev->mq->sendbuf = &maple_dev->function;
-               maple_dev->mq->length = 1;
-               maple_add_packet(maple_dev->mq);
-               liststatus++;
+               /* bounce if we cannot lock */
+               add = maple_add_packet(maple_dev,
+                       be32_to_cpu(maple_dev->devinfo.function),
+                       MAPLE_COMMAND_GETCOND, 1, NULL);
+               if (!add)
+                       maple_dev->when = jiffies + maple_dev->interval;
        } else {
-               if (time_after(jiffies, maple_pnp_time)) {
-                       maple_dev->mq->command = MAPLE_COMMAND_DEVINFO;
-                       maple_dev->mq->length = 0;
-                       maple_add_packet(maple_dev->mq);
-                       liststatus++;
-               }
+               if (time_after(jiffies, maple_pnp_time))
+                       /* This will also bounce */
+                       maple_add_packet(maple_dev, 0,
+                               MAPLE_COMMAND_DEVINFO, 0, NULL);
        }
-
        return 0;
 }
 
 /* VBLANK bottom half - implemented via workqueue */
 static void maple_vblank_handler(struct work_struct *work)
 {
-       if (!maple_dma_done())
-               return;
-       if (!list_empty(&maple_sentq))
+       if (!list_empty(&maple_sentq) || !maple_dma_done())
                return;
+
        ctrl_outl(0, MAPLE_ENABLE);
-       liststatus = 0;
+
        bus_for_each_dev(&maple_bus_type, NULL, NULL,
                         setup_maple_commands);
+
        if (time_after(jiffies, maple_pnp_time))
                maple_pnp_time = jiffies + MAPLE_PNP_INTERVAL;
-       if (liststatus && list_empty(&maple_sentq)) {
-               INIT_LIST_HEAD(&maple_sentq);
+
+       mutex_lock(&maple_wlist_lock);
+       if (!list_empty(&maple_waitq) && list_empty(&maple_sentq)) {
+               mutex_unlock(&maple_wlist_lock);
                maple_send();
+       } else {
+               mutex_unlock(&maple_wlist_lock);
        }
+
        maplebus_dma_reset();
 }
 
@@ -422,8 +509,8 @@ static void maple_map_subunits(struct maple_device *mdev, int submask)
        struct maple_device *mdev_add;
        struct maple_device_specify ds;
 
+       ds.port = mdev->port;
        for (k = 0; k < 5; k++) {
-               ds.port = mdev->port;
                ds.unit = k + 1;
                retval =
                    bus_for_each_dev(&maple_bus_type, NULL, &ds,
@@ -437,9 +524,9 @@ static void maple_map_subunits(struct maple_device *mdev, int submask)
                        mdev_add = maple_alloc_dev(mdev->port, k + 1);
                        if (!mdev_add)
                                return;
-                       mdev_add->mq->command = MAPLE_COMMAND_DEVINFO;
-                       mdev_add->mq->length = 0;
-                       maple_add_packet(mdev_add->mq);
+                       maple_add_packet(mdev_add, 0, MAPLE_COMMAND_DEVINFO,
+                               0, NULL);
+                       /* mark that we are checking sub devices */
                        scanning = 1;
                }
                submask = submask >> 1;
@@ -505,6 +592,28 @@ static void maple_response_devinfo(struct maple_device *mdev,
        }
 }
 
+static void maple_port_rescan(void)
+{
+       int i;
+       struct maple_device *mdev;
+
+       fullscan = 1;
+       for (i = 0; i < MAPLE_PORTS; i++) {
+               if (checked[i] == false) {
+                       fullscan = 0;
+                       mdev = baseunits[i];
+                       /*
+                        *  test lock in case scan has failed
+                        *  but device is still locked
+                        */
+                       if (mutex_is_locked(&mdev->mq->mutex))
+                               mutex_unlock(&mdev->mq->mutex);
+                       maple_add_packet(mdev, 0, MAPLE_COMMAND_DEVINFO,
+                               0, NULL);
+               }
+       }
+}
+
 /* maple dma end bottom half - implemented via workqueue */
 static void maple_dma_handler(struct work_struct *work)
 {
@@ -512,7 +621,6 @@ static void maple_dma_handler(struct work_struct *work)
        struct maple_device *dev;
        char *recvbuf;
        enum maple_code code;
-       int i;
 
        if (!maple_dma_done())
                return;
@@ -522,6 +630,10 @@ static void maple_dma_handler(struct work_struct *work)
                        recvbuf = mq->recvbuf;
                        code = recvbuf[0];
                        dev = mq->dev;
+                       kfree(mq->sendbuf);
+                       mutex_unlock(&mq->mutex);
+                       list_del_init(&mq->list);
+
                        switch (code) {
                        case MAPLE_RESPONSE_NONE:
                                maple_response_none(dev, mq);
@@ -558,26 +670,16 @@ static void maple_dma_handler(struct work_struct *work)
                                break;
                        }
                }
-               INIT_LIST_HEAD(&maple_sentq);
+               /* if scanning is 1 then we have subdevices to check */
                if (scanning == 1) {
                        maple_send();
                        scanning = 2;
                } else
                        scanning = 0;
-
-               if (!fullscan) {
-                       fullscan = 1;
-                       for (i = 0; i < MAPLE_PORTS; i++) {
-                               if (checked[i] == false) {
-                                       fullscan = 0;
-                                       dev = baseunits[i];
-                                       dev->mq->command =
-                                               MAPLE_COMMAND_DEVINFO;
-                                       dev->mq->length = 0;
-                                       maple_add_packet(dev->mq);
-                               }
-                       }
-               }
+               /*check if we have actually tested all ports yet */
+               if (!fullscan)
+                       maple_port_rescan();
+               /* mark that we have been through the first scan */
                if (started == 0)
                        started = 1;
        }
@@ -631,7 +733,7 @@ static int match_maple_bus_driver(struct device *devptr,
        if (maple_dev->devinfo.function == 0xFFFFFFFF)
                return 0;
        else if (maple_dev->devinfo.function &
-                be32_to_cpu(maple_drv->function))
+                cpu_to_be32(maple_drv->function))
                return 1;
        return 0;
 }
@@ -713,6 +815,9 @@ static int __init maple_bus_init(void)
        if (!maple_queue_cache)
                goto cleanup_bothirqs;
 
+       INIT_LIST_HEAD(&maple_waitq);
+       INIT_LIST_HEAD(&maple_sentq);
+
        /* setup maple ports */
        for (i = 0; i < MAPLE_PORTS; i++) {
                checked[i] = false;
@@ -723,9 +828,7 @@ static int __init maple_bus_init(void)
                                maple_free_dev(mdev[i]);
                        goto cleanup_cache;
                }
-               mdev[i]->mq->command = MAPLE_COMMAND_DEVINFO;
-               mdev[i]->mq->length = 0;
-               maple_add_packet(mdev[i]->mq);
+               maple_add_packet(mdev[i], 0, MAPLE_COMMAND_DEVINFO, 0, NULL);
                subdevice_map[i] = 0;
        }
 
index 0c7165660853a7194b16f8b2ed3cbf4849d78eb2..95190c619c101240eb9dc43125e05a162b1db379 100644 (file)
@@ -184,7 +184,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
 {
        struct atmel_spi        *as = spi_master_get_devdata(master);
        struct spi_transfer     *xfer;
-       u32                     len, remaining, total;
+       u32                     len, remaining;
+       u32                     ieval;
        dma_addr_t              tx_dma, rx_dma;
 
        if (!as->current_transfer)
@@ -197,6 +198,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
                xfer = NULL;
 
        if (xfer) {
+               spi_writel(as, PTCR, SPI_BIT(RXTDIS) | SPI_BIT(TXTDIS));
+
                len = xfer->len;
                atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len);
                remaining = xfer->len - len;
@@ -234,6 +237,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
        as->next_transfer = xfer;
 
        if (xfer) {
+               u32     total;
+
                total = len;
                atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len);
                as->next_remaining_bytes = total - len;
@@ -250,9 +255,11 @@ static void atmel_spi_next_xfer(struct spi_master *master,
                        "  next xfer %p: len %u tx %p/%08x rx %p/%08x\n",
                        xfer, xfer->len, xfer->tx_buf, xfer->tx_dma,
                        xfer->rx_buf, xfer->rx_dma);
+               ieval = SPI_BIT(ENDRX) | SPI_BIT(OVRES);
        } else {
                spi_writel(as, RNCR, 0);
                spi_writel(as, TNCR, 0);
+               ieval = SPI_BIT(RXBUFF) | SPI_BIT(ENDRX) | SPI_BIT(OVRES);
        }
 
        /* REVISIT: We're waiting for ENDRX before we start the next
@@ -265,7 +272,7 @@ static void atmel_spi_next_xfer(struct spi_master *master,
         *
         * It should be doable, though. Just not now...
         */
-       spi_writel(as, IER, SPI_BIT(ENDRX) | SPI_BIT(OVRES));
+       spi_writel(as, IER, ieval);
        spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN));
 }
 
@@ -396,7 +403,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
 
                ret = IRQ_HANDLED;
 
-               spi_writel(as, IDR, (SPI_BIT(ENDTX) | SPI_BIT(ENDRX)
+               spi_writel(as, IDR, (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX)
                                     | SPI_BIT(OVRES)));
 
                /*
@@ -418,7 +425,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
                if (xfer->delay_usecs)
                        udelay(xfer->delay_usecs);
 
-               dev_warn(master->dev.parent, "fifo overrun (%u/%u remaining)\n",
+               dev_warn(master->dev.parent, "overrun (%u/%u remaining)\n",
                         spi_readl(as, TCR), spi_readl(as, RCR));
 
                /*
@@ -442,7 +449,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
                spi_readl(as, SR);
 
                atmel_spi_msg_done(master, as, msg, -EIO, 0);
-       } else if (pending & SPI_BIT(ENDRX)) {
+       } else if (pending & (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX))) {
                ret = IRQ_HANDLED;
 
                spi_writel(as, IDR, pending);
index 1c643c9e1f15ff793e5d7c140e9f93ee96320544..21661c7959c87cab171323d8dc1821046ee77604 100644 (file)
@@ -236,6 +236,19 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
        return IRQ_HANDLED;
 }
 
+static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
+{
+       /* for the moment, permanently enable the clock */
+
+       clk_enable(hw->clk);
+
+       /* program defaults into the registers */
+
+       writeb(0xff, hw->regs + S3C2410_SPPRE);
+       writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
+       writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
+}
+
 static int __init s3c24xx_spi_probe(struct platform_device *pdev)
 {
        struct s3c2410_spi_info *pdata;
@@ -327,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
                goto err_no_clk;
        }
 
-       /* for the moment, permanently enable the clock */
-
-       clk_enable(hw->clk);
-
-       /* program defaults into the registers */
-
-       writeb(0xff, hw->regs + S3C2410_SPPRE);
-       writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
-       writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
+       s3c24xx_spi_initialsetup(hw);
 
        /* setup any gpio we can */
 
@@ -415,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
 {
        struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
 
-       clk_enable(hw->clk);
+       s3c24xx_spi_initialsetup(hw);
        return 0;
 }
 
index 0ebc1bfd251491ad8f48fac32b0450bd50e28240..a6b55297a7fb5269662354e32a512d4b7c54589c 100644 (file)
@@ -118,7 +118,6 @@ obj-$(CONFIG_FB_PS3)                  += ps3fb.o
 obj-$(CONFIG_FB_SM501)            += sm501fb.o
 obj-$(CONFIG_FB_XILINX)           += xilinxfb.o
 obj-$(CONFIG_FB_SH_MOBILE_LCDC)          += sh_mobile_lcdcfb.o
-obj-$(CONFIG_FB_SH7343VOU)       += sh7343_voufb.o
 obj-$(CONFIG_FB_OMAP)             += omap/
 obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
 obj-$(CONFIG_FB_CARMINE)          += carminefb.o
index fbea2bd129c73d5eb5f49eacf39f5d5795ef9a3b..6fa0b9d5559ac712c033eb0508fd21ca9a4dc08e 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/fb.h>
 #include <linux/backlight.h>
 
-#include <asm/cpu/dac.h>
+#include <cpu/dac.h>
 #include <asm/hp6xx.h>
 #include <asm/hd64461.h>
 
diff --git a/drivers/video/console/.gitignore b/drivers/video/console/.gitignore
new file mode 100644 (file)
index 0000000..0c258b4
--- /dev/null
@@ -0,0 +1,2 @@
+# conmakehash generated file
+promcon_tbl.c
index 392a8be6aa76b873cd87b6d3f72ae2f3aef3b4ce..e6467cf9f19f17ff4269168755d2ee5bd9ea5ec3 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/hd64461.h>
-#include <asm/cpu/dac.h>
+#include <cpu/dac.h>
 
 #define        WIDTH 640
 
index 54e82f35353dec0e843e56dfed47c163a410b9dd..c02136202792fab1b97c8d9a6d3938db69c241cb 100644 (file)
@@ -2536,7 +2536,7 @@ module_param(fh, int, 0);
 MODULE_PARM_DESC(fh, "Startup horizontal frequency, 0-999kHz, 1000-INF Hz");
 module_param(fv, int, 0);
 MODULE_PARM_DESC(fv, "Startup vertical frequency, 0-INF Hz\n"
-"You should specify \"fv:max_monitor_vsync,fh:max_monitor_hsync,maxclk:max_monitor_dotclock\"\n");
+"You should specify \"fv:max_monitor_vsync,fh:max_monitor_hsync,maxclk:max_monitor_dotclock\"");
 module_param(grayscale, int, 0);
 MODULE_PARM_DESC(grayscale, "Sets display into grayscale. Works perfectly with paletized videomode (4, 8bpp), some limitations apply to 16, 24 and 32bpp videomodes (default=nograyscale)");
 module_param(cross4MB, int, 0);
index 8c863a7f654bba9ce667c7942415e4fc09d9417a..0a0fd48a856696eee0e84a6b37b4368b56ba7c89 100644 (file)
 
 #ifdef CONFIG_SH_DREAMCAST
 #include <asm/machvec.h>
-#include <asm/mach/sysasic.h>
+#include <mach-dreamcast/mach/sysasic.h>
 #endif
 
 #ifdef CONFIG_SH_DMA
 #include <linux/pagemap.h>
-#include <asm/mach/dma.h>
+#include <mach/dma.h>
 #include <asm/dma.h>
 #endif
 
 #ifdef CONFIG_SH_STORE_QUEUES
 #include <linux/uaccess.h>
-#include <asm/cpu/sq.h>
+#include <cpu/sq.h>
 #endif
 
 #ifndef PCI_DEVICE_ID_NEC_NEON250
index 2eb48c0df32c9889fa93e0d4123912f735f6f1c7..ef7b0d67095ea8ee053731eb6e66cb9835e6ce19 100644 (file)
@@ -69,7 +69,8 @@ struct ar7_wdt {
        u32 prescale;
 };
 
-static struct semaphore open_semaphore;
+static unsigned long wdt_is_open;
+static spinlock_t wdt_lock;
 static unsigned expect_close;
 
 /* XXX currently fixed, allows max margin ~68.72 secs */
@@ -154,8 +155,10 @@ static void ar7_wdt_update_margin(int new_margin)
        u32 change;
 
        change = new_margin * (ar7_vbus_freq() / prescale_value);
-       if (change < 1) change = 1;
-       if (change > 0xffff) change = 0xffff;
+       if (change < 1)
+               change = 1;
+       if (change > 0xffff)
+               change = 0xffff;
        ar7_wdt_change(change);
        margin = change * prescale_value / ar7_vbus_freq();
        printk(KERN_INFO DRVNAME
@@ -179,7 +182,7 @@ static void ar7_wdt_disable_wdt(void)
 static int ar7_wdt_open(struct inode *inode, struct file *file)
 {
        /* only allow one at a time */
-       if (down_trylock(&open_semaphore))
+       if (test_and_set_bit(0, &wdt_is_open))
                return -EBUSY;
        ar7_wdt_enable_wdt();
        expect_close = 0;
@@ -195,9 +198,7 @@ static int ar7_wdt_release(struct inode *inode, struct file *file)
                "will not disable the watchdog timer\n");
        else if (!nowayout)
                ar7_wdt_disable_wdt();
-
-       up(&open_semaphore);
-
+       clear_bit(0, &wdt_is_open);
        return 0;
 }
 
@@ -222,7 +223,9 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data,
        if (len) {
                size_t i;
 
+               spin_lock(&wdt_lock);
                ar7_wdt_kick(1);
+               spin_unlock(&wdt_lock);
 
                expect_close = 0;
                for (i = 0; i < len; ++i) {
@@ -237,8 +240,8 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data,
        return len;
 }
 
-static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
-                        unsigned int cmd, unsigned long arg)
+static long ar7_wdt_ioctl(struct file *file,
+                                       unsigned int cmd, unsigned long arg)
 {
        static struct watchdog_info ident = {
                .identity = LONGNAME,
@@ -269,8 +272,10 @@ static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
                if (new_margin < 1)
                        return -EINVAL;
 
+               spin_lock(&wdt_lock);
                ar7_wdt_update_margin(new_margin);
                ar7_wdt_kick(1);
+               spin_unlock(&wdt_lock);
 
        case WDIOC_GETTIMEOUT:
                if (put_user(margin, (int *)arg))
@@ -282,7 +287,7 @@ static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
 static const struct file_operations ar7_wdt_fops = {
        .owner          = THIS_MODULE,
        .write          = ar7_wdt_write,
-       .ioctl          = ar7_wdt_ioctl,
+       .unlocked_ioctl = ar7_wdt_ioctl,
        .open           = ar7_wdt_open,
        .release        = ar7_wdt_release,
 };
@@ -297,6 +302,8 @@ static int __init ar7_wdt_init(void)
 {
        int rc;
 
+       spin_lock_init(&wdt_lock);
+
        ar7_wdt_get_regs();
 
        if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt),
@@ -312,8 +319,6 @@ static int __init ar7_wdt_init(void)
        ar7_wdt_prescale(prescale_value);
        ar7_wdt_update_margin(margin);
 
-       sema_init(&open_semaphore, 1);
-
        rc = register_reboot_notifier(&ar7_wdt_notifier);
        if (rc) {
                printk(KERN_ERR DRVNAME
index 445b7e812112572ba82925576b6129ebafe8aed5..51bfd572183300430f6df7b6580b72bcb9c0e75f 100644 (file)
@@ -30,9 +30,8 @@
 #include <linux/fs.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
 
 #define NAME "it8712f_wdt"
 
@@ -50,7 +49,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
 
-static struct semaphore it8712f_wdt_sem;
+static unsigned long wdt_open;
 static unsigned expect_close;
 static spinlock_t io_lock;
 static unsigned char revision;
@@ -86,22 +85,19 @@ static unsigned short address;
 #define WDT_OUT_PWROK  0x10
 #define WDT_OUT_KRST   0x40
 
-static int
-superio_inb(int reg)
+static int superio_inb(int reg)
 {
        outb(reg, REG);
        return inb(VAL);
 }
 
-static void
-superio_outb(int val, int reg)
+static void superio_outb(int val, int reg)
 {
        outb(reg, REG);
        outb(val, VAL);
 }
 
-static int
-superio_inw(int reg)
+static int superio_inw(int reg)
 {
        int val;
        outb(reg++, REG);
@@ -111,15 +107,13 @@ superio_inw(int reg)
        return val;
 }
 
-static inline void
-superio_select(int ldn)
+static inline void superio_select(int ldn)
 {
        outb(LDN, REG);
        outb(ldn, VAL);
 }
 
-static inline void
-superio_enter(void)
+static inline void superio_enter(void)
 {
        spin_lock(&io_lock);
        outb(0x87, REG);
@@ -128,22 +122,19 @@ superio_enter(void)
        outb(0x55, REG);
 }
 
-static inline void
-superio_exit(void)
+static inline void superio_exit(void)
 {
        outb(0x02, REG);
        outb(0x02, VAL);
        spin_unlock(&io_lock);
 }
 
-static inline void
-it8712f_wdt_ping(void)
+static inline void it8712f_wdt_ping(void)
 {
        inb(address);
 }
 
-static void
-it8712f_wdt_update_margin(void)
+static void it8712f_wdt_update_margin(void)
 {
        int config = WDT_OUT_KRST | WDT_OUT_PWROK;
        int units = margin;
@@ -165,8 +156,7 @@ it8712f_wdt_update_margin(void)
        superio_outb(units, WDT_TIMEOUT);
 }
 
-static int
-it8712f_wdt_get_status(void)
+static int it8712f_wdt_get_status(void)
 {
        if (superio_inb(WDT_CONTROL) & 0x01)
                return WDIOF_CARDRESET;
@@ -174,8 +164,7 @@ it8712f_wdt_get_status(void)
                return 0;
 }
 
-static void
-it8712f_wdt_enable(void)
+static void it8712f_wdt_enable(void)
 {
        printk(KERN_DEBUG NAME ": enabling watchdog timer\n");
        superio_enter();
@@ -190,8 +179,7 @@ it8712f_wdt_enable(void)
        it8712f_wdt_ping();
 }
 
-static void
-it8712f_wdt_disable(void)
+static void it8712f_wdt_disable(void)
 {
        printk(KERN_DEBUG NAME ": disabling watchdog timer\n");
 
@@ -207,8 +195,7 @@ it8712f_wdt_disable(void)
        superio_exit();
 }
 
-static int
-it8712f_wdt_notify(struct notifier_block *this,
+static int it8712f_wdt_notify(struct notifier_block *this,
                    unsigned long code, void *unused)
 {
        if (code == SYS_HALT || code == SYS_POWER_OFF)
@@ -222,9 +209,8 @@ static struct notifier_block it8712f_wdt_notifier = {
        .notifier_call = it8712f_wdt_notify,
 };
 
-static ssize_t
-it8712f_wdt_write(struct file *file, const char __user *data,
-       size_t len, loff_t *ppos)
+static ssize_t it8712f_wdt_write(struct file *file, const char __user *data,
+                                       size_t len, loff_t *ppos)
 {
        /* check for a magic close character */
        if (len) {
@@ -245,9 +231,8 @@ it8712f_wdt_write(struct file *file, const char __user *data,
        return len;
 }
 
-static int
-it8712f_wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
+static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
@@ -302,19 +287,16 @@ it8712f_wdt_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-static int
-it8712f_wdt_open(struct inode *inode, struct file *file)
+static int it8712f_wdt_open(struct inode *inode, struct file *file)
 {
        /* only allow one at a time */
-       if (down_trylock(&it8712f_wdt_sem))
+       if (test_and_set_bit(0, &wdt_open))
                return -EBUSY;
        it8712f_wdt_enable();
-
        return nonseekable_open(inode, file);
 }
 
-static int
-it8712f_wdt_release(struct inode *inode, struct file *file)
+static int it8712f_wdt_release(struct inode *inode, struct file *file)
 {
        if (expect_close != 42) {
                printk(KERN_WARNING NAME
@@ -324,7 +306,7 @@ it8712f_wdt_release(struct inode *inode, struct file *file)
                it8712f_wdt_disable();
        }
        expect_close = 0;
-       up(&it8712f_wdt_sem);
+       clear_bit(0, &wdt_open);
 
        return 0;
 }
@@ -333,7 +315,7 @@ static const struct file_operations it8712f_wdt_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = it8712f_wdt_write,
-       .ioctl = it8712f_wdt_ioctl,
+       .unlocked_ioctl = it8712f_wdt_ioctl,
        .open = it8712f_wdt_open,
        .release = it8712f_wdt_release,
 };
@@ -344,8 +326,7 @@ static struct miscdevice it8712f_wdt_miscdev = {
        .fops = &it8712f_wdt_fops,
 };
 
-static int __init
-it8712f_wdt_find(unsigned short *address)
+static int __init it8712f_wdt_find(unsigned short *address)
 {
        int err = -ENODEV;
        int chip_type;
@@ -387,8 +368,7 @@ exit:
        return err;
 }
 
-static int __init
-it8712f_wdt_init(void)
+static int __init it8712f_wdt_init(void)
 {
        int err = 0;
 
@@ -404,8 +384,6 @@ it8712f_wdt_init(void)
 
        it8712f_wdt_disable();
 
-       sema_init(&it8712f_wdt_sem, 1);
-
        err = register_reboot_notifier(&it8712f_wdt_notifier);
        if (err) {
                printk(KERN_ERR NAME ": unable to register reboot notifier\n");
@@ -430,8 +408,7 @@ out:
        return err;
 }
 
-static void __exit
-it8712f_wdt_exit(void)
+static void __exit it8712f_wdt_exit(void)
 {
        misc_deregister(&it8712f_wdt_miscdev);
        unregister_reboot_notifier(&it8712f_wdt_notifier);
index 98532c0e0689c93726976cb3507385321849f828..97b4a2e8eb09a62db3e5fa0eae184952be4e76b3 100644 (file)
@@ -46,9 +46,8 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/clk.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
 
 #include <asm/arch/map.h>
 
@@ -65,8 +64,8 @@
 static int nowayout    = WATCHDOG_NOWAYOUT;
 static int tmr_margin  = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME;
 static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
-static int soft_noboot = 0;
-static int debug       = 0;
+static int soft_noboot;
+static int debug;
 
 module_param(tmr_margin,  int, 0);
 module_param(tmr_atboot,  int, 0);
@@ -74,24 +73,23 @@ module_param(nowayout,    int, 0);
 module_param(soft_noboot, int, 0);
 module_param(debug,      int, 0);
 
-MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
-
-MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
-
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
+MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default="
+               __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
+MODULE_PARM_DESC(tmr_atboot,
+               "Watchdog is started at boot time if set to 1, default="
+                       __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
-
 MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)");
 
 
 typedef enum close_state {
        CLOSE_STATE_NOT,
-       CLOSE_STATE_ALLOW=0x4021
+       CLOSE_STATE_ALLOW = 0x4021
 } close_state_t;
 
-static DECLARE_MUTEX(open_lock);
-
+static unsigned long open_lock;
 static struct device    *wdt_dev;      /* platform device attached to */
 static struct resource *wdt_mem;
 static struct resource *wdt_irq;
@@ -99,38 +97,58 @@ static struct clk   *wdt_clock;
 static void __iomem    *wdt_base;
 static unsigned int     wdt_count;
 static close_state_t    allow_close;
+static DEFINE_SPINLOCK(wdt_lock);
 
 /* watchdog control routines */
 
 #define DBG(msg...) do { \
        if (debug) \
                printk(KERN_INFO msg); \
-       } while(0)
+       } while (0)
 
 /* functions */
 
-static int s3c2410wdt_keepalive(void)
+static void s3c2410wdt_keepalive(void)
 {
+       spin_lock(&wdt_lock);
        writel(wdt_count, wdt_base + S3C2410_WTCNT);
-       return 0;
+       spin_unlock(&wdt_lock);
 }
 
-static int s3c2410wdt_stop(void)
+static void __s3c2410wdt_stop(void)
 {
        unsigned long wtcon;
 
+       spin_lock(&wdt_lock);
        wtcon = readl(wdt_base + S3C2410_WTCON);
        wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
        writel(wtcon, wdt_base + S3C2410_WTCON);
+       spin_unlock(&wdt_lock);
+}
 
-       return 0;
+static void __s3c2410wdt_stop(void)
+{
+       unsigned long wtcon;
+
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+       wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
+       writel(wtcon, wdt_base + S3C2410_WTCON);
+}
+
+static void s3c2410wdt_stop(void)
+{
+       spin_lock(&wdt_lock);
+       __s3c2410wdt_stop();
+       spin_unlock(&wdt_lock);
 }
 
-static int s3c2410wdt_start(void)
+static void s3c2410wdt_start(void)
 {
        unsigned long wtcon;
 
-       s3c2410wdt_stop();
+       spin_lock(&wdt_lock);
+
+       __s3c2410wdt_stop();
 
        wtcon = readl(wdt_base + S3C2410_WTCON);
        wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128;
@@ -149,6 +167,7 @@ static int s3c2410wdt_start(void)
        writel(wdt_count, wdt_base + S3C2410_WTDAT);
        writel(wdt_count, wdt_base + S3C2410_WTCNT);
        writel(wtcon, wdt_base + S3C2410_WTCON);
+       spin_unlock(&wdt_lock);
 
        return 0;
 }
@@ -211,7 +230,7 @@ static int s3c2410wdt_set_heartbeat(int timeout)
 
 static int s3c2410wdt_open(struct inode *inode, struct file *file)
 {
-       if(down_trylock(&open_lock))
+       if (test_and_set_bit(0, &open_lock))
                return -EBUSY;
 
        if (nowayout)
@@ -231,15 +250,14 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file)
         *      Lock it in if it's a module and we set nowayout
         */
 
-       if (allow_close == CLOSE_STATE_ALLOW) {
+       if (allow_close == CLOSE_STATE_ALLOW)
                s3c2410wdt_stop();
-       else {
+       else {
                dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n");
                s3c2410wdt_keepalive();
        }
-
        allow_close = CLOSE_STATE_NOT;
-       up(&open_lock);
+       clear_bit(0, &open_lock);
        return 0;
 }
 
@@ -249,7 +267,7 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
        /*
         *      Refresh the timer.
         */
-       if(len) {
+       if (len) {
                if (!nowayout) {
                        size_t i;
 
@@ -265,7 +283,6 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
                                        allow_close = CLOSE_STATE_ALLOW;
                        }
                }
-
                s3c2410wdt_keepalive();
        }
        return len;
@@ -273,48 +290,41 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
 
 #define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
 
-static struct watchdog_info s3c2410_wdt_ident = {
+static const struct watchdog_info s3c2410_wdt_ident = {
        .options          =     OPTIONS,
        .firmware_version =     0,
        .identity         =     "S3C2410 Watchdog",
 };
 
 
-static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
+static long s3c2410wdt_ioctl(struct file *file,        unsigned int cmd,
+                                                       unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
        int new_margin;
 
        switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &s3c2410_wdt_ident,
-                               sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       s3c2410wdt_keepalive();
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_margin, p))
-                               return -EFAULT;
-
-                       if (s3c2410wdt_set_heartbeat(new_margin))
-                               return -EINVAL;
-
-                       s3c2410wdt_keepalive();
-                       return put_user(tmr_margin, p);
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(tmr_margin, p);
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &s3c2410_wdt_ident,
+                       sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               s3c2410wdt_keepalive();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_margin, p))
+                       return -EFAULT;
+               if (s3c2410wdt_set_heartbeat(new_margin))
+                       return -EINVAL;
+               s3c2410wdt_keepalive();
+               return put_user(tmr_margin, p);
+       case WDIOC_GETTIMEOUT:
+               return put_user(tmr_margin, p);
        }
 }
 
@@ -324,7 +334,7 @@ static const struct file_operations s3c2410wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = s3c2410wdt_write,
-       .ioctl          = s3c2410wdt_ioctl,
+       .unlocked_ioctl = s3c2410wdt_ioctl,
        .open           = s3c2410wdt_open,
        .release        = s3c2410wdt_release,
 };
@@ -411,14 +421,15 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
         * not, try the default value */
 
        if (s3c2410wdt_set_heartbeat(tmr_margin)) {
-               started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
+               started = s3c2410wdt_set_heartbeat(
+                                       CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
 
-               if (started == 0) {
-                       dev_info(dev,"tmr_margin value out of range, default %d used\n",
+               if (started == 0)
+                       dev_info(dev,
+                          "tmr_margin value out of range, default %d used\n",
                               CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
-               } else {
+               else
                        dev_info(dev, "default timer value is out of range, cannot start\n");
-               }
        }
 
        ret = misc_register(&s3c2410wdt_miscdev);
@@ -447,7 +458,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
                 (wtcon & S3C2410_WTCON_ENABLE) ?  "" : "in",
                 (wtcon & S3C2410_WTCON_RSTEN) ? "" : "dis",
                 (wtcon & S3C2410_WTCON_INTEN) ? "" : "en");
-       
+
        return 0;
 
  err_clk:
@@ -487,7 +498,7 @@ static int s3c2410wdt_remove(struct platform_device *dev)
 
 static void s3c2410wdt_shutdown(struct platform_device *dev)
 {
-       s3c2410wdt_stop();      
+       s3c2410wdt_stop();
 }
 
 #ifdef CONFIG_PM
@@ -540,7 +551,8 @@ static struct platform_driver s3c2410wdt_driver = {
 };
 
 
-static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
+static char banner[] __initdata =
+       KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
 
 static int __init watchdog_init(void)
 {
index 35cddff7020fe081c6401253a76b1a21cf94797d..621ebad56d86cdf798b22edf7a316c80eaa81e46 100644 (file)
  *
  *     Changelog:
  *     20020220 Zwane Mwaikambo        Code based on datasheet, no hardware.
- *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik and Alan Cox.
+ *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik
+ *                                     and Alan Cox.
  *     20020222 Zwane Mwaikambo        Added probing.
  *     20020225 Zwane Mwaikambo        Added ISAPNP support.
  *     20020412 Rob Radez              Broke out start/stop functions
- *              <rob@osinvestor.com>   Return proper status instead of temperature warning
- *                                     Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
+ *              <rob@osinvestor.com>   Return proper status instead of
+ *                                     temperature warning
+ *                                     Add WDIOC_GETBOOTSTATUS and
+ *                                     WDIOC_SETOPTIONS ioctls
  *                                     Fix CONFIG_WATCHDOG_NOWAYOUT
- *     20020530 Joel Becker            Add Matt Domsch's nowayout module option
+ *     20020530 Joel Becker            Add Matt Domsch's nowayout module
+ *                                     option
  *     20030116 Adam Belay             Updated to the latest pnp code
  *
  */
@@ -39,9 +43,8 @@
 #include <linux/pnp.h>
 #include <linux/fs.h>
 #include <linux/semaphore.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
 #define SC1200_MODULE_VER      "build 20020303"
 #define SC1200_MODULE_NAME     "sc1200wdt"
@@ -72,7 +75,7 @@ static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER;
 static int timeout = 1;
 static int io = -1;
 static int io_len = 2;         /* for non plug and play */
-static struct semaphore open_sem;
+static unsigned long open_flag;
 static char expect_close;
 static DEFINE_SPINLOCK(sc1200wdt_lock);        /* io port access serialisation */
 
@@ -81,7 +84,8 @@ static int isapnp = 1;
 static struct pnp_dev *wdt_dev;
 
 module_param(isapnp, int, 0);
-MODULE_PARM_DESC(isapnp, "When set to 0 driver ISA PnP support will be disabled");
+MODULE_PARM_DESC(isapnp,
+       "When set to 0 driver ISA PnP support will be disabled");
 #endif
 
 module_param(io, int, 0);
@@ -91,26 +95,40 @@ MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+       "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 
 
 /* Read from Data Register */
-static inline void sc1200wdt_read_data(unsigned char index, unsigned char *data)
+static inline void __sc1200wdt_read_data(unsigned char index,
+                                               unsigned char *data)
 {
-       spin_lock(&sc1200wdt_lock);
        outb_p(index, PMIR);
        *data = inb(PMDR);
-       spin_unlock(&sc1200wdt_lock);
 }
 
+static void sc1200wdt_read_data(unsigned char index, unsigned char *data)
+{
+       spin_lock(&sc1200wdt_lock);
+       __sc1200wdt_read_data(index, data);
+       spin_unlock(&sc1200wdt_lock);
+}
 
 /* Write to Data Register */
-static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
+static inline void __sc1200wdt_write_data(unsigned char index,
+                                               unsigned char data)
 {
-       spin_lock(&sc1200wdt_lock);
        outb_p(index, PMIR);
        outb(data, PMDR);
+}
+
+static inline void sc1200wdt_write_data(unsigned char index,
+                                               unsigned char data)
+{
+       spin_lock(&sc1200wdt_lock);
+       __sc1200wdt_write_data(index, data);
        spin_unlock(&sc1200wdt_lock);
 }
 
@@ -118,22 +136,23 @@ static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
 static void sc1200wdt_start(void)
 {
        unsigned char reg;
+       spin_lock(&sc1200wdt_lock);
 
-       sc1200wdt_read_data(WDCF, &reg);
+       __sc1200wdt_read_data(WDCF, &reg);
        /* assert WDO when any of the following interrupts are triggered too */
        reg |= (KBC_IRQ | MSE_IRQ | UART1_IRQ | UART2_IRQ);
-       sc1200wdt_write_data(WDCF, reg);
+       __sc1200wdt_write_data(WDCF, reg);
        /* set the timeout and get the ball rolling */
-       sc1200wdt_write_data(WDTO, timeout);
-}
+       __sc1200wdt_write_data(WDTO, timeout);
 
+       spin_unlock(&sc1200wdt_lock);
+}
 
 static void sc1200wdt_stop(void)
 {
        sc1200wdt_write_data(WDTO, 0);
 }
 
-
 /* This returns the status of the WDO signal, inactive high. */
 static inline int sc1200wdt_status(void)
 {
@@ -144,14 +163,13 @@ static inline int sc1200wdt_status(void)
         * KEEPALIVEPING which is a bit of a kludge because there's nothing
         * else for enabled/disabled status
         */
-       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;  /* bits 1 - 7 are undefined */
+       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;
 }
 
-
 static int sc1200wdt_open(struct inode *inode, struct file *file)
 {
        /* allow one at a time */
-       if (down_trylock(&open_sem))
+       if (test_and_set_bit(0, &open_flag))
                return -EBUSY;
 
        if (timeout > MAX_TIMEOUT)
@@ -164,71 +182,71 @@ static int sc1200wdt_open(struct inode *inode, struct file *file)
 }
 
 
-static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
+                                               unsigned long arg)
 {
        int new_timeout;
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+       static const struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
+                                                       WDIOF_MAGICCLOSE,
                .firmware_version = 0,
                .identity = "PC87307/PC97307",
        };
 
        switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &ident, sizeof ident))
-                               return -EFAULT;
-                       return 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user(sc1200wdt_status(), p);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       sc1200wdt_write_data(WDTO, timeout);
-                       return 0;
 
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_timeout, p))
-                               return -EFAULT;
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof ident))
+                       return -EFAULT;
+               return 0;
 
-                       /* the API states this is given in secs */
-                       new_timeout /= 60;
-                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                               return -EINVAL;
+       case WDIOC_GETSTATUS:
+               return put_user(sc1200wdt_status(), p);
 
-                       timeout = new_timeout;
-                       sc1200wdt_write_data(WDTO, timeout);
-                       /* fall through and return the new timeout */
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
 
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout * 60, p);
+       case WDIOC_KEEPALIVE:
+               sc1200wdt_write_data(WDTO, timeout);
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               /* the API states this is given in secs */
+               new_timeout /= 60;
+               if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                       return -EINVAL;
+               timeout = new_timeout;
+               sc1200wdt_write_data(WDTO, timeout);
+               /* fall through and return the new timeout */
 
-               case WDIOC_SETOPTIONS:
-               {
-                       int options, retval = -EINVAL;
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout * 60, p);
 
-                       if (get_user(options, p))
-                               return -EFAULT;
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
 
-                       if (options & WDIOS_DISABLECARD) {
-                               sc1200wdt_stop();
-                               retval = 0;
-                       }
+               if (get_user(options, p))
+                       return -EFAULT;
 
-                       if (options & WDIOS_ENABLECARD) {
-                               sc1200wdt_start();
-                               retval = 0;
-                       }
+               if (options & WDIOS_DISABLECARD) {
+                       sc1200wdt_stop();
+                       retval = 0;
+               }
 
-                       return retval;
+               if (options & WDIOS_ENABLECARD) {
+                       sc1200wdt_start();
+                       retval = 0;
                }
+
+               return retval;
+       }
+       default:
+               return -ENOTTY;
        }
 }
 
@@ -240,16 +258,18 @@ static int sc1200wdt_release(struct inode *inode, struct file *file)
                printk(KERN_INFO PFX "Watchdog disabled\n");
        } else {
                sc1200wdt_write_data(WDTO, timeout);
-               printk(KERN_CRIT PFX "Unexpected close!, timeout = %d min(s)\n", timeout);
+               printk(KERN_CRIT PFX
+                       "Unexpected close!, timeout = %d min(s)\n", timeout);
        }
-       up(&open_sem);
+       clear_bit(0, &open_flag);
        expect_close = 0;
 
        return 0;
 }
 
 
-static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+static ssize_t sc1200wdt_write(struct file *file, const char __user *data,
+                                               size_t len, loff_t *ppos)
 {
        if (len) {
                if (!nowayout) {
@@ -275,7 +295,8 @@ static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_
 }
 
 
-static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+static int sc1200wdt_notify_sys(struct notifier_block *this,
+                                       unsigned long code, void *unused)
 {
        if (code == SYS_DOWN || code == SYS_HALT)
                sc1200wdt_stop();
@@ -284,23 +305,20 @@ static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code,
 }
 
 
-static struct notifier_block sc1200wdt_notifier =
-{
+static struct notifier_block sc1200wdt_notifier = {
        .notifier_call =        sc1200wdt_notify_sys,
 };
 
-static const struct file_operations sc1200wdt_fops =
-{
+static const struct file_operations sc1200wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = sc1200wdt_write,
-       .ioctl          = sc1200wdt_ioctl,
+       .unlocked_ioctl = sc1200wdt_ioctl,
        .open           = sc1200wdt_open,
        .release        = sc1200wdt_release,
 };
 
-static struct miscdevice sc1200wdt_miscdev =
-{
+static struct miscdevice sc1200wdt_miscdev = {
        .minor          = WATCHDOG_MINOR,
        .name           = "watchdog",
        .fops           = &sc1200wdt_fops,
@@ -312,14 +330,14 @@ static int __init sc1200wdt_probe(void)
        /* The probe works by reading the PMC3 register's default value of 0x0e
         * there is one caveat, if the device disables the parallel port or any
         * of the UARTs we won't be able to detect it.
-        * Nb. This could be done with accuracy by reading the SID registers, but
-        * we don't have access to those io regions.
+        * NB. This could be done with accuracy by reading the SID registers,
+        * but we don't have access to those io regions.
         */
 
        unsigned char reg;
 
        sc1200wdt_read_data(PMC3, &reg);
-       reg &= 0x0f;                            /* we don't want the UART busy bits */
+       reg &= 0x0f;            /* we don't want the UART busy bits */
        return (reg == 0x0e) ? 0 : -ENODEV;
 }
 
@@ -332,7 +350,8 @@ static struct pnp_device_id scl200wdt_pnp_devices[] = {
        {.id = ""},
 };
 
-static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
+static int scl200wdt_pnp_probe(struct pnp_dev *dev,
+                                       const struct pnp_device_id *dev_id)
 {
        /* this driver only supports one card at a time */
        if (wdt_dev || !isapnp)
@@ -347,13 +366,14 @@ static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id
                return -EBUSY;
        }
 
-       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", io, io_len);
+       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n",
+                                                               io, io_len);
        return 0;
 }
 
-static void scl200wdt_pnp_remove(struct pnp_dev * dev)
+static void scl200wdt_pnp_remove(struct pnp_dev *dev)
 {
-       if (wdt_dev){
+       if (wdt_dev) {
                release_region(io, io_len);
                wdt_dev = NULL;
        }
@@ -375,8 +395,6 @@ static int __init sc1200wdt_init(void)
 
        printk("%s\n", banner);
 
-       sema_init(&open_sem, 1);
-
 #if defined CONFIG_PNP
        if (isapnp) {
                ret = pnp_register_driver(&scl200wdt_pnp_driver);
@@ -410,13 +428,16 @@ static int __init sc1200wdt_init(void)
 
        ret = register_reboot_notifier(&sc1200wdt_notifier);
        if (ret) {
-               printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret);
+               printk(KERN_ERR PFX
+                       "Unable to register reboot notifier err = %d\n", ret);
                goto out_io;
        }
 
        ret = misc_register(&sc1200wdt_miscdev);
        if (ret) {
-               printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
+               printk(KERN_ERR PFX
+                       "Unable to register miscdev on minor %d\n",
+                                                       WATCHDOG_MINOR);
                goto out_rbt;
        }
 
@@ -446,7 +467,7 @@ static void __exit sc1200wdt_exit(void)
        unregister_reboot_notifier(&sc1200wdt_notifier);
 
 #if defined CONFIG_PNP
-       if(isapnp)
+       if (isapnp)
                pnp_unregister_driver(&scl200wdt_pnp_driver);
        else
 #endif
index 756fb15fdce7aa97c1bfebbf0e8fcbf42fb5ee14..53a6b18bcb9ad8275f43454ce1cdde856e9bb6b8 100644 (file)
  *                                     Matt Crocker).
  *             Alan Cox        :       Added wdt= boot option
  *             Alan Cox        :       Cleaned up copy/user stuff
- *             Tim Hockin      :       Added insmod parameters, comment cleanup
- *                                     Parameterized timeout
- *             Tigran Aivazian :       Restructured wdt_init() to handle failures
+ *             Tim Hockin      :       Added insmod parameters, comment
+ *                                     cleanup, parameterized timeout
+ *             Tigran Aivazian :       Restructured wdt_init() to handle
+ *                                     failures
  *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
  *             Matt Domsch     :       Added nowayout module option
  */
@@ -42,9 +43,9 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #include <asm/system.h>
 #include "wd501p.h"
 
@@ -60,15 +61,19 @@ static char expect_close;
 static int heartbeat = WD_TIMO;
 static int wd_heartbeat;
 module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+MODULE_PARM_DESC(heartbeat,
+       "Watchdog heartbeat in seconds. (0 < heartbeat < 65536, default="
+                               __MODULE_STRING(WD_TIMO) ")");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+       "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 /* You must set these - there is no sane way to probe for this board. */
-static int io=0x240;
-static int irq=11;
+static int io = 0x240;
+static int irq = 11;
 
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -82,7 +87,8 @@ MODULE_PARM_DESC(irq, "WDT irq (default=11)");
 static int tachometer;
 
 module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, default=0)");
+MODULE_PARM_DESC(tachometer,
+               "WDT501-P Fan Tachometer support (0=disable, default=0)");
 #endif /* CONFIG_WDT_501 */
 
 /*
@@ -91,9 +97,9 @@ MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, defaul
 
 static void wdt_ctr_mode(int ctr, int mode)
 {
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
+       ctr <<= 6;
+       ctr |= 0x30;
+       ctr |= (mode << 1);
        outb_p(ctr, WDT_CR);
 }
 
@@ -114,12 +120,15 @@ static int wdt_start(void)
        unsigned long flags;
        spin_lock_irqsave(&wdt_lock, flags);
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(0,3);              /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdt_ctr_mode(1,2);              /* Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_mode(2,0);              /* Program CTR2 for Mode 0: Pulse on Terminal Count */
+       wdt_ctr_mode(0, 3);             /* Program CTR0 for Mode 3:
+                                               Square Wave Generator */
+       wdt_ctr_mode(1, 2);             /* Program CTR1 for Mode 2:
+                                               Rate Generator */
+       wdt_ctr_mode(2, 0);             /* Program CTR2 for Mode 0:
+                                               Pulse on Terminal Count */
        wdt_ctr_load(0, 8948);          /* Count at 100Hz */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
-       wdt_ctr_load(2,65535);          /* Length of reset pulse */
+       wdt_ctr_load(1, wd_heartbeat);  /* Heartbeat */
+       wdt_ctr_load(2, 65535);         /* Length of reset pulse */
        outb_p(0, WDT_DC);              /* Enable watchdog */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
@@ -131,13 +140,13 @@ static int wdt_start(void)
  *     Stop the watchdog driver.
  */
 
-static int wdt_stop (void)
+static int wdt_stop(void)
 {
        unsigned long flags;
        spin_lock_irqsave(&wdt_lock, flags);
        /* Turn the card off */
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_load(2,0);              /* 0 length reset pulses now */
+       wdt_ctr_load(2, 0);             /* 0 length reset pulses now */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
 }
@@ -145,8 +154,8 @@ static int wdt_stop (void)
 /**
  *     wdt_ping:
  *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
+ *     Reload counter one with the watchdog heartbeat. We don't bother
+ *     reloading the cascade counter.
  */
 
 static int wdt_ping(void)
@@ -155,8 +164,9 @@ static int wdt_ping(void)
        spin_lock_irqsave(&wdt_lock, flags);
        /* Write a watchdog value */
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(1,2);              /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
+       wdt_ctr_mode(1, 2);             /* Re-Program CTR1 for Mode 2:
+                                                       Rate Generator */
+       wdt_ctr_load(1, wd_heartbeat);  /* Heartbeat */
        outb_p(0, WDT_DC);              /* Enable watchdog */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
@@ -166,13 +176,14 @@ static int wdt_ping(void)
  *     wdt_set_heartbeat:
  *     @t:             the new heartbeat value that needs to be set.
  *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat
+ *     value is incorrect we keep the old value and return -EINVAL. If
+ *     successful we return 0.
  */
+
 static int wdt_set_heartbeat(int t)
 {
-       if ((t < 1) || (t > 65535))
+       if (t < 1 || t > 65535)
                return -EINVAL;
 
        heartbeat = t;
@@ -200,7 +211,7 @@ static int wdt_get_status(int *status)
        new_status = inb_p(WDT_SR);
        spin_unlock_irqrestore(&wdt_lock, flags);
 
-       *status=0;
+       *status = 0;
        if (new_status & WDC_SR_ISOI0)
                *status |= WDIOF_EXTERN1;
        if (new_status & WDC_SR_ISII1)
@@ -266,7 +277,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
 
 #ifdef CONFIG_WDT_501
        if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+               printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT));
        if (!(status & WDC_SR_PSUOVER))
                printk(KERN_CRIT "PSU over voltage.\n");
        if (!(status & WDC_SR_PSUUNDR))
@@ -304,9 +315,10 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
  *     write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+static ssize_t wdt_write(struct file *file, const char __user *buf,
+                                               size_t count, loff_t *ppos)
 {
-       if(count) {
+       if (count) {
                if (!nowayout) {
                        size_t i;
 
@@ -328,7 +340,6 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count
 
 /**
  *     wdt_ioctl:
- *     @inode: inode of the device
  *     @file: file handle to the device
  *     @cmd: watchdog command
  *     @arg: argument pointer
@@ -338,8 +349,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count
  *     querying capabilities and current status.
  */
 
-static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
@@ -362,32 +372,28 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                ident.options |= WDIOF_FANFAULT;
 #endif /* CONFIG_WDT_501 */
 
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdt_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdt_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdt_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+               wdt_get_status(&status);
+               return put_user(status, p);
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
        }
 }
 
@@ -405,7 +411,7 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 static int wdt_open(struct inode *inode, struct file *file)
 {
-       if(test_and_set_bit(0, &wdt_is_open))
+       if (test_and_set_bit(0, &wdt_is_open))
                return -EBUSY;
        /*
         *      Activate
@@ -432,7 +438,8 @@ static int wdt_release(struct inode *inode, struct file *file)
                wdt_stop();
                clear_bit(0, &wdt_is_open);
        } else {
-               printk(KERN_CRIT "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
+               printk(KERN_CRIT
+                "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
                wdt_ping();
        }
        expect_close = 0;
@@ -451,14 +458,15 @@ static int wdt_release(struct inode *inode, struct file *file)
  *     farenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+static ssize_t wdt_temp_read(struct file *file, char __user *buf,
+                                               size_t count, loff_t *ptr)
 {
        int temperature;
 
        if (wdt_get_temperature(&temperature))
                return -EFAULT;
 
-       if (copy_to_user (buf, &temperature, 1))
+       if (copy_to_user(buf, &temperature, 1))
                return -EFAULT;
 
        return 1;
@@ -506,10 +514,8 @@ static int wdt_temp_release(struct inode *inode, struct file *file)
 static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
        void *unused)
 {
-       if(code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
+       if (code == SYS_DOWN || code == SYS_HALT)
                wdt_stop();
-       }
        return NOTIFY_DONE;
 }
 
@@ -522,7 +528,7 @@ static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
+       .unlocked_ioctl = wdt_ioctl,
        .open           = wdt_open,
        .release        = wdt_release,
 };
@@ -576,7 +582,7 @@ static void __exit wdt_exit(void)
 #endif /* CONFIG_WDT_501 */
        unregister_reboot_notifier(&wdt_notifier);
        free_irq(irq, NULL);
-       release_region(io,8);
+       release_region(io, 8);
 }
 
 /**
@@ -591,44 +597,49 @@ static int __init wdt_init(void)
 {
        int ret;
 
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       /* Check that the heartbeat value is within it's range;
+          if not reset to the default */
        if (wdt_set_heartbeat(heartbeat)) {
                wdt_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO "wdt: heartbeat value must be 0<heartbeat<65536, using %d\n",
+               printk(KERN_INFO "wdt: heartbeat value must be 0 < heartbeat < 65536, using %d\n",
                        WD_TIMO);
        }
 
        if (!request_region(io, 8, "wdt501p")) {
-               printk(KERN_ERR "wdt: I/O address 0x%04x already in use\n", io);
+               printk(KERN_ERR
+                       "wdt: I/O address 0x%04x already in use\n", io);
                ret = -EBUSY;
                goto out;
        }
 
        ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
-       if(ret) {
+       if (ret) {
                printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
                goto outreg;
        }
 
        ret = register_reboot_notifier(&wdt_notifier);
-       if(ret) {
-               printk(KERN_ERR "wdt: cannot register reboot notifier (err=%d)\n", ret);
+       if (ret) {
+               printk(KERN_ERR
+                     "wdt: cannot register reboot notifier (err=%d)\n", ret);
                goto outirq;
        }
 
 #ifdef CONFIG_WDT_501
        ret = misc_register(&temp_miscdev);
        if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
+               printk(KERN_ERR
+                       "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                                                       TEMP_MINOR, ret);
                goto outrbt;
        }
 #endif /* CONFIG_WDT_501 */
 
        ret = misc_register(&wdt_miscdev);
        if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
+               printk(KERN_ERR
+                       "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                                                       WATCHDOG_MINOR, ret);
                goto outmisc;
        }
 
@@ -636,7 +647,8 @@ static int __init wdt_init(void)
        printk(KERN_INFO "WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n",
                io, irq, heartbeat, nowayout);
 #ifdef CONFIG_WDT_501
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n",
+                               (tachometer ? "Enabled" : "Disabled"));
 #endif /* CONFIG_WDT_501 */
 
 out:
@@ -651,7 +663,7 @@ outrbt:
 outirq:
        free_irq(irq, NULL);
 outreg:
-       release_region(io,8);
+       release_region(io, 8);
        goto out;
 }
 
index 1355608683e40e8c124c140981d66727a0fb4300..5d922fd6eafcddb60eb44ab948f56e86e28be82d 100644 (file)
  *             JP Nollmann     :       Added support for PCI wdt501p
  *             Alan Cox        :       Split ISA and PCI cards into two drivers
  *             Jeff Garzik     :       PCI cleanups
- *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle failures
+ *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle
+ *                                     failures
  *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
- *             Zwane Mwaikambo :       Magic char closing, locking changes, cleanups
+ *             Zwane Mwaikambo :       Magic char closing, locking changes,
+ *                                     cleanups
  *             Matt Domsch     :       nowayout module option
  */
 
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/ioport.h>
+#include <linux/delay.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/pci.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #include <asm/system.h>
 
 #define WDT_IS_PCI
@@ -73,7 +76,7 @@
 /* We can only use 1 card due to the /dev/watchdog restriction */
 static int dev_count;
 
-static struct semaphore open_sem;
+static unsigned long open_lock;
 static DEFINE_SPINLOCK(wdtpci_lock);
 static char expect_close;
 
@@ -86,18 +89,23 @@ static int irq;
 static int heartbeat = WD_TIMO;
 static int wd_heartbeat;
 module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+MODULE_PARM_DESC(heartbeat,
+               "Watchdog heartbeat in seconds. (0<heartbeat<65536, default="
+                               __MODULE_STRING(WD_TIMO) ")");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+               "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 #ifdef CONFIG_WDT_501_PCI
 /* Support for the Fan Tachometer on the PCI-WDT501 */
 static int tachometer;
 
 module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
+MODULE_PARM_DESC(tachometer,
+       "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
 #endif /* CONFIG_WDT_501_PCI */
 
 /*
@@ -106,16 +114,19 @@ MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, defa
 
 static void wdtpci_ctr_mode(int ctr, int mode)
 {
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
-       outb_p(ctr, WDT_CR);
+       ctr <<= 6;
+       ctr |= 0x30;
+       ctr |= (mode << 1);
+       outb(ctr, WDT_CR);
+       udelay(8);
 }
 
 static void wdtpci_ctr_load(int ctr, int val)
 {
-       outb_p(val&0xFF, WDT_COUNT0+ctr);
-       outb_p(val>>8, WDT_COUNT0+ctr);
+       outb(val & 0xFF, WDT_COUNT0 + ctr);
+       udelay(8);
+       outb(val >> 8, WDT_COUNT0 + ctr);
+       udelay(8);
 }
 
 /**
@@ -134,23 +145,35 @@ static int wdtpci_start(void)
         * "pet" the watchdog, as Access says.
         * This resets the clock outputs.
         */
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(2,0);           /* Program CTR2 for Mode 0: Pulse on Terminal Count */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       outb_p(0, WDT_CLOCK);           /* 2.0833MHz clock */
-       inb_p(WDT_BUZZER);              /* disable */
-       inb_p(WDT_OPTONOTRST);          /* disable */
-       inb_p(WDT_OPTORST);             /* disable */
-       inb_p(WDT_PROGOUT);             /* disable */
-       wdtpci_ctr_mode(0,3);           /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdtpci_ctr_mode(1,2);           /* Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_mode(2,1);           /* Program CTR2 for Mode 1: Retriggerable One-Shot */
-       wdtpci_ctr_load(0,20833);       /* count at 100Hz */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_mode(2, 0);          /* Program CTR2 for Mode 0:
+                                               Pulse on Terminal Count */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       outb(0, WDT_CLOCK);             /* 2.0833MHz clock */
+       udelay(8);
+       inb(WDT_BUZZER);                /* disable */
+       udelay(8);
+       inb(WDT_OPTONOTRST);            /* disable */
+       udelay(8);
+       inb(WDT_OPTORST);               /* disable */
+       udelay(8);
+       inb(WDT_PROGOUT);               /* disable */
+       udelay(8);
+       wdtpci_ctr_mode(0, 3);          /* Program CTR0 for Mode 3:
+                                               Square Wave Generator */
+       wdtpci_ctr_mode(1, 2);          /* Program CTR1 for Mode 2:
+                                               Rate Generator */
+       wdtpci_ctr_mode(2, 1);          /* Program CTR2 for Mode 1:
+                                               Retriggerable One-Shot */
+       wdtpci_ctr_load(0, 20833);      /* count at 100Hz */
+       wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */
        /* DO NOT LOAD CTR2 on PCI card! -- JPN */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
 
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
@@ -162,14 +185,15 @@ static int wdtpci_start(void)
  *     Stop the watchdog driver.
  */
 
-static int wdtpci_stop (void)
+static int wdtpci_stop(void)
 {
        unsigned long flags;
 
        /* Turn the card off */
        spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_load(2,0);           /* 0 length reset pulses now */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_load(2, 0);          /* 0 length reset pulses now */
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
 }
@@ -177,20 +201,23 @@ static int wdtpci_stop (void)
 /**
  *     wdtpci_ping:
  *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
+ *     Reload counter one with the watchdog heartbeat. We don't bother
+ *     reloading the cascade counter.
  */
 
 static int wdtpci_ping(void)
 {
        unsigned long flags;
 
-       /* Write a watchdog value */
        spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(1,2);           /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
+       /* Write a watchdog value */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_mode(1, 2);          /* Re-Program CTR1 for Mode 2:
+                                                       Rate Generator */
+       wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
 }
@@ -199,14 +226,14 @@ static int wdtpci_ping(void)
  *     wdtpci_set_heartbeat:
  *     @t:             the new heartbeat value that needs to be set.
  *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat
+ *     value is incorrect we keep the old value and return -EINVAL.
+ *     If successful we return 0.
  */
 static int wdtpci_set_heartbeat(int t)
 {
        /* Arbitrary, can't find the card's limits */
-       if ((t < 1) || (t > 65535))
+       if (t < 1 || t > 65535)
                return -EINVAL;
 
        heartbeat = t;
@@ -227,9 +254,14 @@ static int wdtpci_set_heartbeat(int t)
 
 static int wdtpci_get_status(int *status)
 {
-       unsigned char new_status=inb_p(WDT_SR);
+       unsigned char new_status;
+       unsigned long flags;
+
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       new_status = inb(WDT_SR);
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
 
-       *status=0;
+       *status = 0;
        if (new_status & WDC_SR_ISOI0)
                *status |= WDIOF_EXTERN1;
        if (new_status & WDC_SR_ISII1)
@@ -259,8 +291,12 @@ static int wdtpci_get_status(int *status)
 
 static int wdtpci_get_temperature(int *temperature)
 {
-       unsigned short c=inb_p(WDT_RT);
-
+       unsigned short c;
+       unsigned long flags;
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       c = inb(WDT_RT);
+       udelay(8);
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
        *temperature = (c * 11 / 15) + 7;
        return 0;
 }
@@ -282,17 +318,25 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
         *      Read the status register see what is up and
         *      then printk it.
         */
-       unsigned char status=inb_p(WDT_SR);
+       unsigned char status;
+
+       spin_lock(&wdtpci_lock);
+
+       status = inb(WDT_SR);
+       udelay(8);
 
        printk(KERN_CRIT PFX "status %d\n", status);
 
 #ifdef CONFIG_WDT_501_PCI
-       if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+       if (!(status & WDC_SR_TGOOD)) {
+               u8 alarm = inb(WDT_RT);
+               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n", alarm);
+               udelay(8);
+       }
        if (!(status & WDC_SR_PSUOVER))
-               printk(KERN_CRIT PFX "PSU over voltage.\n");
+               printk(KERN_CRIT PFX "PSU over voltage.\n");
        if (!(status & WDC_SR_PSUUNDR))
-               printk(KERN_CRIT PFX "PSU under voltage.\n");
+               printk(KERN_CRIT PFX "PSU under voltage.\n");
        if (tachometer) {
                if (!(status & WDC_SR_FANGOOD))
                        printk(KERN_CRIT PFX "Possible fan fault.\n");
@@ -310,6 +354,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
                printk(KERN_CRIT PFX "Reset in 5ms.\n");
 #endif
        }
+       spin_unlock(&wdtpci_lock);
        return IRQ_HANDLED;
 }
 
@@ -325,7 +370,8 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
  *     write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+static ssize_t wdtpci_write(struct file *file, const char __user *buf,
+                                       size_t count, loff_t *ppos)
 {
        if (count) {
                if (!nowayout) {
@@ -335,7 +381,7 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
 
                        for (i = 0; i != count; i++) {
                                char c;
-                               if(get_user(c, buf+i))
+                               if (get_user(c, buf+i))
                                        return -EFAULT;
                                if (c == 'V')
                                        expect_close = 42;
@@ -343,13 +389,11 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
                }
                wdtpci_ping();
        }
-
        return count;
 }
 
 /**
  *     wdtpci_ioctl:
- *     @inode: inode of the device
  *     @file: file handle to the device
  *     @cmd: watchdog command
  *     @arg: argument pointer
@@ -359,8 +403,8 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
  *     querying capabilities and current status.
  */
 
-static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
+static long wdtpci_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg)
 {
        int new_heartbeat;
        int status;
@@ -383,33 +427,29 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                ident.options |= WDIOF_FANFAULT;
 #endif /* CONFIG_WDT_501_PCI */
 
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdtpci_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdtpci_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdtpci_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdtpci_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-       }
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+               wdtpci_get_status(&status);
+               return put_user(status, p);
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               wdtpci_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
+               if (wdtpci_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+               wdtpci_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
+               }
 }
 
 /**
@@ -426,12 +466,11 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 static int wdtpci_open(struct inode *inode, struct file *file)
 {
-       if (down_trylock(&open_sem))
+       if (test_and_set_bit(0, &open_lock))
                return -EBUSY;
 
-       if (nowayout) {
+       if (nowayout)
                __module_get(THIS_MODULE);
-       }
        /*
         *      Activate
         */
@@ -460,7 +499,7 @@ static int wdtpci_release(struct inode *inode, struct file *file)
                wdtpci_ping();
        }
        expect_close = 0;
-       up(&open_sem);
+       clear_bit(0, &open_lock);
        return 0;
 }
 
@@ -476,14 +515,15 @@ static int wdtpci_release(struct inode *inode, struct file *file)
  *     fahrenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+static ssize_t wdtpci_temp_read(struct file *file, char __user *buf,
+                                               size_t count, loff_t *ptr)
 {
        int temperature;
 
        if (wdtpci_get_temperature(&temperature))
                return -EFAULT;
 
-       if (copy_to_user (buf, &temperature, 1))
+       if (copy_to_user(buf, &temperature, 1))
                return -EFAULT;
 
        return 1;
@@ -529,12 +569,10 @@ static int wdtpci_temp_release(struct inode *inode, struct file *file)
  */
 
 static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
+                                                       void *unused)
 {
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
+       if (code == SYS_DOWN || code == SYS_HALT)
                wdtpci_stop();
-       }
        return NOTIFY_DONE;
 }
 
@@ -547,7 +585,7 @@ static const struct file_operations wdtpci_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdtpci_write,
-       .ioctl          = wdtpci_ioctl,
+       .unlocked_ioctl = wdtpci_ioctl,
        .open           = wdtpci_open,
        .release        = wdtpci_release,
 };
@@ -584,80 +622,85 @@ static struct notifier_block wdtpci_notifier = {
 };
 
 
-static int __devinit wdtpci_init_one (struct pci_dev *dev,
-                                  const struct pci_device_id *ent)
+static int __devinit wdtpci_init_one(struct pci_dev *dev,
+                                       const struct pci_device_id *ent)
 {
        int ret = -EIO;
 
        dev_count++;
        if (dev_count > 1) {
-               printk (KERN_ERR PFX "this driver only supports 1 device\n");
+               printk(KERN_ERR PFX "This driver only supports one device\n");
                return -ENODEV;
        }
 
-       if (pci_enable_device (dev)) {
-               printk (KERN_ERR PFX "Not possible to enable PCI Device\n");
+       if (pci_enable_device(dev)) {
+               printk(KERN_ERR PFX "Not possible to enable PCI Device\n");
                return -ENODEV;
        }
 
-       if (pci_resource_start (dev, 2) == 0x0000) {
-               printk (KERN_ERR PFX "No I/O-Address for card detected\n");
+       if (pci_resource_start(dev, 2) == 0x0000) {
+               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
                ret = -ENODEV;
                goto out_pci;
        }
 
-       sema_init(&open_sem, 1);
-
        irq = dev->irq;
-       io = pci_resource_start (dev, 2);
+       io = pci_resource_start(dev, 2);
 
-       if (request_region (io, 16, "wdt_pci") == NULL) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
+       if (request_region(io, 16, "wdt_pci") == NULL) {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
                goto out_pci;
        }
 
-       if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
+       if (request_irq(irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
                         "wdt_pci", &wdtpci_miscdev)) {
-               printk (KERN_ERR PFX "IRQ %d is not free\n", irq);
+               printk(KERN_ERR PFX "IRQ %d is not free\n", irq);
                goto out_reg;
        }
 
-       printk ("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
-               io, irq);
+       printk(KERN_INFO
+        "PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
+                                                               io, irq);
 
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       /* Check that the heartbeat value is within its range;
+          if not reset to the default */
        if (wdtpci_set_heartbeat(heartbeat)) {
                wdtpci_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WD_TIMO);
+               printk(KERN_INFO PFX
+                 "heartbeat value must be 0 < heartbeat < 65536, using %d\n",
+                                                               WD_TIMO);
        }
 
-       ret = register_reboot_notifier (&wdtpci_notifier);
+       ret = register_reboot_notifier(&wdtpci_notifier);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               printk(KERN_ERR PFX
+                       "cannot register reboot notifier (err=%d)\n", ret);
                goto out_irq;
        }
 
 #ifdef CONFIG_WDT_501_PCI
-       ret = misc_register (&temp_miscdev);
+       ret = misc_register(&temp_miscdev);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
+               printk(KERN_ERR PFX
+                       "cannot register miscdev on minor=%d (err=%d)\n",
+                                       TEMP_MINOR, ret);
                goto out_rbt;
        }
 #endif /* CONFIG_WDT_501_PCI */
 
-       ret = misc_register (&wdtpci_miscdev);
+       ret = misc_register(&wdtpci_miscdev);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
+               printk(KERN_ERR PFX
+                       "cannot register miscdev on minor=%d (err=%d)\n",
+                                               WATCHDOG_MINOR, ret);
                goto out_misc;
        }
 
        printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
                heartbeat, nowayout);
 #ifdef CONFIG_WDT_501_PCI
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n",
+                               (tachometer ? "Enabled" : "Disabled"));
 #endif /* CONFIG_WDT_501_PCI */
 
        ret = 0;
@@ -673,14 +716,14 @@ out_rbt:
 out_irq:
        free_irq(irq, &wdtpci_miscdev);
 out_reg:
-       release_region (io, 16);
+       release_region(io, 16);
 out_pci:
        pci_disable_device(dev);
        goto out;
 }
 
 
-static void __devexit wdtpci_remove_one (struct pci_dev *pdev)
+static void __devexit wdtpci_remove_one(struct pci_dev *pdev)
 {
        /* here we assume only one device will ever have
         * been picked up and registered by probe function */
@@ -728,7 +771,7 @@ static struct pci_driver wdtpci_driver = {
 
 static void __exit wdtpci_cleanup(void)
 {
-       pci_unregister_driver (&wdtpci_driver);
+       pci_unregister_driver(&wdtpci_driver);
 }
 
 
@@ -742,7 +785,7 @@ static void __exit wdtpci_cleanup(void)
 
 static int __init wdtpci_init(void)
 {
-       return pci_register_driver (&wdtpci_driver);
+       return pci_register_driver(&wdtpci_driver);
 }
 
 
index 660b191ed75efe5415007927162224f408c24654..8f7fdaa9e010b39157eee6121b6e1b5e0f265295 100644 (file)
@@ -250,19 +250,19 @@ static void file_record(struct ihex_binrec *record)
 
 static int output_records(int outfd)
 {
-       unsigned char zeroes[5] = {0, 0, 0, 0, 0};
+       unsigned char zeroes[6] = {0, 0, 0, 0, 0, 0};
        struct ihex_binrec *p = records;
 
        while (p) {
                uint16_t writelen = (p->len + 9) & ~3;
 
                p->addr = htonl(p->addr);
-               p->len = htonl(p->len);
+               p->len = htons(p->len);
                write(outfd, &p->addr, writelen);
                p = p->next;
        }
        /* EOF record is zero length, since we don't bother to represent
           the type field in the binary version */
-       write(outfd, zeroes, 5);
+       write(outfd, zeroes, 6);
        return 0;
 }
index 2f5503902c3757d469e594bd4d72400b35444939..78db4953a80047847b2d6098ca0c8bf4b30a76ef 100644 (file)
@@ -232,7 +232,7 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
        }
 
        mntget(newmnt);
-       err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts);
+       err = do_add_mount(newmnt, &nd->path, MNT_SHRINKABLE, &afs_vfsmounts);
        switch (err) {
        case 0:
                path_put(&nd->path);
index dcf37cada3697d898c2d0c70c875450826845440..aff54219e04953386162690941d7e412f3a29c64 100644 (file)
@@ -941,8 +941,10 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
         * hooks: /n/, see "layering violations".
         */
        ret = devcgroup_inode_permission(bdev->bd_inode, perm);
-       if (ret != 0)
+       if (ret != 0) {
+               bdput(bdev);
                return ret;
+       }
 
        ret = -ENXIO;
        file->f_mapping = bdev->bd_inode->i_mapping;
@@ -1234,6 +1236,7 @@ fail:
        bdev = ERR_PTR(error);
        goto out;
 }
+EXPORT_SYMBOL(lookup_bdev);
 
 /**
  * open_bdev_excl  -  open a block device by name and set it up for use
index d82374c9e3296d737a0aba07ea2c08d1acd0ee20..d2c8eef84f3c7c805d8a484115ae090bc56e8920 100644 (file)
@@ -226,7 +226,7 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd,
        int err;
 
        mntget(newmnt);
-       err = do_add_mount(newmnt, nd, nd->path.mnt->mnt_flags, mntlist);
+       err = do_add_mount(newmnt, &nd->path, nd->path.mnt->mnt_flags, mntlist);
        switch (err) {
        case 0:
                path_put(&nd->path);
index da015c12e3ea929dd718d2e71c96dfe3626a82e1..762d287123ca992456b8bef7c16848dde753fb13 100644 (file)
@@ -49,8 +49,10 @@ struct configfs_dirent {
 #define CONFIGFS_USET_DEFAULT  0x0080
 #define CONFIGFS_USET_DROPPING 0x0100
 #define CONFIGFS_USET_IN_MKDIR 0x0200
+#define CONFIGFS_USET_CREATING 0x0400
 #define CONFIGFS_NOT_PINNED    (CONFIGFS_ITEM_ATTR)
 
+extern struct mutex configfs_symlink_mutex;
 extern spinlock_t configfs_dirent_lock;
 
 extern struct vfsmount * configfs_mount;
@@ -66,6 +68,7 @@ extern void configfs_inode_exit(void);
 extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
 extern int configfs_make_dirent(struct configfs_dirent *,
                                struct dentry *, void *, umode_t, int);
+extern int configfs_dirent_is_ready(struct configfs_dirent *);
 
 extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
 extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
index 179589be063abe97ba0d10a1982bdea244488d36..7a8db78a91d22949fbd1b0df6fb116a392033426 100644 (file)
@@ -185,7 +185,7 @@ static int create_dir(struct config_item * k, struct dentry * p,
        error = configfs_dirent_exists(p->d_fsdata, d->d_name.name);
        if (!error)
                error = configfs_make_dirent(p->d_fsdata, d, k, mode,
-                                            CONFIGFS_DIR);
+                                            CONFIGFS_DIR | CONFIGFS_USET_CREATING);
        if (!error) {
                error = configfs_create(d, mode, init_dir);
                if (!error) {
@@ -209,6 +209,9 @@ static int create_dir(struct config_item * k, struct dentry * p,
  *     configfs_create_dir - create a directory for an config_item.
  *     @item:          config_itemwe're creating directory for.
  *     @dentry:        config_item's dentry.
+ *
+ *     Note: user-created entries won't be allowed under this new directory
+ *     until it is validated by configfs_dir_set_ready()
  */
 
 static int configfs_create_dir(struct config_item * item, struct dentry *dentry)
@@ -231,6 +234,44 @@ static int configfs_create_dir(struct config_item * item, struct dentry *dentry)
        return error;
 }
 
+/*
+ * Allow userspace to create new entries under a new directory created with
+ * configfs_create_dir(), and under all of its chidlren directories recursively.
+ * @sd         configfs_dirent of the new directory to validate
+ *
+ * Caller must hold configfs_dirent_lock.
+ */
+static void configfs_dir_set_ready(struct configfs_dirent *sd)
+{
+       struct configfs_dirent *child_sd;
+
+       sd->s_type &= ~CONFIGFS_USET_CREATING;
+       list_for_each_entry(child_sd, &sd->s_children, s_sibling)
+               if (child_sd->s_type & CONFIGFS_USET_CREATING)
+                       configfs_dir_set_ready(child_sd);
+}
+
+/*
+ * Check that a directory does not belong to a directory hierarchy being
+ * attached and not validated yet.
+ * @sd         configfs_dirent of the directory to check
+ *
+ * @return     non-zero iff the directory was validated
+ *
+ * Note: takes configfs_dirent_lock, so the result may change from false to true
+ * in two consecutive calls, but never from true to false.
+ */
+int configfs_dirent_is_ready(struct configfs_dirent *sd)
+{
+       int ret;
+
+       spin_lock(&configfs_dirent_lock);
+       ret = !(sd->s_type & CONFIGFS_USET_CREATING);
+       spin_unlock(&configfs_dirent_lock);
+
+       return ret;
+}
+
 int configfs_create_link(struct configfs_symlink *sl,
                         struct dentry *parent,
                         struct dentry *dentry)
@@ -283,6 +324,8 @@ static void remove_dir(struct dentry * d)
  * The only thing special about this is that we remove any files in
  * the directory before we remove the directory, and we've inlined
  * what used to be configfs_rmdir() below, instead of calling separately.
+ *
+ * Caller holds the mutex of the item's inode
  */
 
 static void configfs_remove_dir(struct config_item * item)
@@ -330,7 +373,19 @@ static struct dentry * configfs_lookup(struct inode *dir,
        struct configfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
        struct configfs_dirent * sd;
        int found = 0;
-       int err = 0;
+       int err;
+
+       /*
+        * Fake invisibility if dir belongs to a group/default groups hierarchy
+        * being attached
+        *
+        * This forbids userspace to read/write attributes of items which may
+        * not complete their initialization, since the dentries of the
+        * attributes won't be instantiated.
+        */
+       err = -ENOENT;
+       if (!configfs_dirent_is_ready(parent_sd))
+               goto out;
 
        list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
                if (sd->s_type & CONFIGFS_NOT_PINNED) {
@@ -353,6 +408,7 @@ static struct dentry * configfs_lookup(struct inode *dir,
                return simple_lookup(dir, dentry, nd);
        }
 
+out:
        return ERR_PTR(err);
 }
 
@@ -370,13 +426,17 @@ static int configfs_detach_prep(struct dentry *dentry, struct mutex **wait_mutex
        struct configfs_dirent *sd;
        int ret;
 
+       /* Mark that we're trying to drop the group */
+       parent_sd->s_type |= CONFIGFS_USET_DROPPING;
+
        ret = -EBUSY;
        if (!list_empty(&parent_sd->s_links))
                goto out;
 
        ret = 0;
        list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
-               if (sd->s_type & CONFIGFS_NOT_PINNED)
+               if (!sd->s_element ||
+                   (sd->s_type & CONFIGFS_NOT_PINNED))
                        continue;
                if (sd->s_type & CONFIGFS_USET_DEFAULT) {
                        /* Abort if racing with mkdir() */
@@ -385,8 +445,6 @@ static int configfs_detach_prep(struct dentry *dentry, struct mutex **wait_mutex
                                        *wait_mutex = &sd->s_dentry->d_inode->i_mutex;
                                return -EAGAIN;
                        }
-                       /* Mark that we're trying to drop the group */
-                       sd->s_type |= CONFIGFS_USET_DROPPING;
 
                        /*
                         * Yup, recursive.  If there's a problem, blame
@@ -414,12 +472,11 @@ static void configfs_detach_rollback(struct dentry *dentry)
        struct configfs_dirent *parent_sd = dentry->d_fsdata;
        struct configfs_dirent *sd;
 
-       list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
-               if (sd->s_type & CONFIGFS_USET_DEFAULT) {
+       parent_sd->s_type &= ~CONFIGFS_USET_DROPPING;
+
+       list_for_each_entry(sd, &parent_sd->s_children, s_sibling)
+               if (sd->s_type & CONFIGFS_USET_DEFAULT)
                        configfs_detach_rollback(sd->s_dentry);
-                       sd->s_type &= ~CONFIGFS_USET_DROPPING;
-               }
-       }
 }
 
 static void detach_attrs(struct config_item * item)
@@ -558,36 +615,21 @@ static int create_default_group(struct config_group *parent_group,
 static int populate_groups(struct config_group *group)
 {
        struct config_group *new_group;
-       struct dentry *dentry = group->cg_item.ci_dentry;
        int ret = 0;
        int i;
 
        if (group->default_groups) {
-               /*
-                * FYI, we're faking mkdir here
-                * I'm not sure we need this semaphore, as we're called
-                * from our parent's mkdir.  That holds our parent's
-                * i_mutex, so afaik lookup cannot continue through our
-                * parent to find us, let alone mess with our tree.
-                * That said, taking our i_mutex is closer to mkdir
-                * emulation, and shouldn't hurt.
-                */
-               mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
-
                for (i = 0; group->default_groups[i]; i++) {
                        new_group = group->default_groups[i];
 
                        ret = create_default_group(group, new_group);
-                       if (ret)
+                       if (ret) {
+                               detach_groups(group);
                                break;
+                       }
                }
-
-               mutex_unlock(&dentry->d_inode->i_mutex);
        }
 
-       if (ret)
-               detach_groups(group);
-
        return ret;
 }
 
@@ -702,7 +744,15 @@ static int configfs_attach_item(struct config_item *parent_item,
        if (!ret) {
                ret = populate_attrs(item);
                if (ret) {
+                       /*
+                        * We are going to remove an inode and its dentry but
+                        * the VFS may already have hit and used them. Thus,
+                        * we must lock them as rmdir() would.
+                        */
+                       mutex_lock(&dentry->d_inode->i_mutex);
                        configfs_remove_dir(item);
+                       dentry->d_inode->i_flags |= S_DEAD;
+                       mutex_unlock(&dentry->d_inode->i_mutex);
                        d_delete(dentry);
                }
        }
@@ -710,6 +760,7 @@ static int configfs_attach_item(struct config_item *parent_item,
        return ret;
 }
 
+/* Caller holds the mutex of the item's inode */
 static void configfs_detach_item(struct config_item *item)
 {
        detach_attrs(item);
@@ -728,16 +779,30 @@ static int configfs_attach_group(struct config_item *parent_item,
                sd = dentry->d_fsdata;
                sd->s_type |= CONFIGFS_USET_DIR;
 
+               /*
+                * FYI, we're faking mkdir in populate_groups()
+                * We must lock the group's inode to avoid races with the VFS
+                * which can already hit the inode and try to add/remove entries
+                * under it.
+                *
+                * We must also lock the inode to remove it safely in case of
+                * error, as rmdir() would.
+                */
+               mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
                ret = populate_groups(to_config_group(item));
                if (ret) {
                        configfs_detach_item(item);
-                       d_delete(dentry);
+                       dentry->d_inode->i_flags |= S_DEAD;
                }
+               mutex_unlock(&dentry->d_inode->i_mutex);
+               if (ret)
+                       d_delete(dentry);
        }
 
        return ret;
 }
 
+/* Caller holds the mutex of the group's inode */
 static void configfs_detach_group(struct config_item *item)
 {
        detach_groups(to_config_group(item));
@@ -1035,7 +1100,7 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        struct configfs_subsystem *subsys;
        struct configfs_dirent *sd;
        struct config_item_type *type;
-       struct module *owner = NULL;
+       struct module *subsys_owner = NULL, *new_item_owner = NULL;
        char *name;
 
        if (dentry->d_parent == configfs_sb->s_root) {
@@ -1044,6 +1109,16 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        }
 
        sd = dentry->d_parent->d_fsdata;
+
+       /*
+        * Fake invisibility if dir belongs to a group/default groups hierarchy
+        * being attached
+        */
+       if (!configfs_dirent_is_ready(sd)) {
+               ret = -ENOENT;
+               goto out;
+       }
+
        if (!(sd->s_type & CONFIGFS_USET_DIR)) {
                ret = -EPERM;
                goto out;
@@ -1062,10 +1137,25 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
                goto out_put;
        }
 
+       /*
+        * The subsystem may belong to a different module than the item
+        * being created.  We don't want to safely pin the new item but
+        * fail to pin the subsystem it sits under.
+        */
+       if (!subsys->su_group.cg_item.ci_type) {
+               ret = -EINVAL;
+               goto out_put;
+       }
+       subsys_owner = subsys->su_group.cg_item.ci_type->ct_owner;
+       if (!try_module_get(subsys_owner)) {
+               ret = -EINVAL;
+               goto out_put;
+       }
+
        name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL);
        if (!name) {
                ret = -ENOMEM;
-               goto out_put;
+               goto out_subsys_put;
        }
 
        snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name);
@@ -1094,10 +1184,10 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        kfree(name);
        if (ret) {
                /*
-                * If item == NULL, then link_obj() was never called.
+                * If ret != 0, then link_obj() was never called.
                 * There are no extra references to clean up.
                 */
-               goto out_put;
+               goto out_subsys_put;
        }
 
        /*
@@ -1111,8 +1201,8 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
                goto out_unlink;
        }
 
-       owner = type->ct_owner;
-       if (!try_module_get(owner)) {
+       new_item_owner = type->ct_owner;
+       if (!try_module_get(new_item_owner)) {
                ret = -EINVAL;
                goto out_unlink;
        }
@@ -1142,6 +1232,8 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
        spin_lock(&configfs_dirent_lock);
        sd->s_type &= ~CONFIGFS_USET_IN_MKDIR;
+       if (!ret)
+               configfs_dir_set_ready(dentry->d_fsdata);
        spin_unlock(&configfs_dirent_lock);
 
 out_unlink:
@@ -1159,9 +1251,13 @@ out_unlink:
                mutex_unlock(&subsys->su_mutex);
 
                if (module_got)
-                       module_put(owner);
+                       module_put(new_item_owner);
        }
 
+out_subsys_put:
+       if (ret)
+               module_put(subsys_owner);
+
 out_put:
        /*
         * link_obj()/link_group() took a reference from child->parent,
@@ -1180,7 +1276,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
        struct config_item *item;
        struct configfs_subsystem *subsys;
        struct configfs_dirent *sd;
-       struct module *owner = NULL;
+       struct module *subsys_owner = NULL, *dead_item_owner = NULL;
        int ret;
 
        if (dentry->d_parent == configfs_sb->s_root)
@@ -1207,6 +1303,15 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
                return -EINVAL;
        }
 
+       /* configfs_mkdir() shouldn't have allowed this */
+       BUG_ON(!subsys->su_group.cg_item.ci_type);
+       subsys_owner = subsys->su_group.cg_item.ci_type->ct_owner;
+
+       /*
+        * Ensure that no racing symlink() will make detach_prep() fail while
+        * the new link is temporarily attached
+        */
+       mutex_lock(&configfs_symlink_mutex);
        spin_lock(&configfs_dirent_lock);
        do {
                struct mutex *wait_mutex;
@@ -1215,6 +1320,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
                if (ret) {
                        configfs_detach_rollback(dentry);
                        spin_unlock(&configfs_dirent_lock);
+                       mutex_unlock(&configfs_symlink_mutex);
                        if (ret != -EAGAIN) {
                                config_item_put(parent_item);
                                return ret;
@@ -1224,10 +1330,12 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
                        mutex_lock(wait_mutex);
                        mutex_unlock(wait_mutex);
 
+                       mutex_lock(&configfs_symlink_mutex);
                        spin_lock(&configfs_dirent_lock);
                }
        } while (ret == -EAGAIN);
        spin_unlock(&configfs_dirent_lock);
+       mutex_unlock(&configfs_symlink_mutex);
 
        /* Get a working ref for the duration of this function */
        item = configfs_get_config_item(dentry);
@@ -1236,7 +1344,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
        config_item_put(parent_item);
 
        if (item->ci_type)
-               owner = item->ci_type->ct_owner;
+               dead_item_owner = item->ci_type->ct_owner;
 
        if (sd->s_type & CONFIGFS_USET_DIR) {
                configfs_detach_group(item);
@@ -1258,7 +1366,8 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
        /* Drop our reference from above */
        config_item_put(item);
 
-       module_put(owner);
+       module_put(dead_item_owner);
+       module_put(subsys_owner);
 
        return 0;
 }
@@ -1314,13 +1423,24 @@ static int configfs_dir_open(struct inode *inode, struct file *file)
 {
        struct dentry * dentry = file->f_path.dentry;
        struct configfs_dirent * parent_sd = dentry->d_fsdata;
+       int err;
 
        mutex_lock(&dentry->d_inode->i_mutex);
-       file->private_data = configfs_new_dirent(parent_sd, NULL);
+       /*
+        * Fake invisibility if dir belongs to a group/default groups hierarchy
+        * being attached
+        */
+       err = -ENOENT;
+       if (configfs_dirent_is_ready(parent_sd)) {
+               file->private_data = configfs_new_dirent(parent_sd, NULL);
+               if (IS_ERR(file->private_data))
+                       err = PTR_ERR(file->private_data);
+               else
+                       err = 0;
+       }
        mutex_unlock(&dentry->d_inode->i_mutex);
 
-       return IS_ERR(file->private_data) ? PTR_ERR(file->private_data) : 0;
-
+       return err;
 }
 
 static int configfs_dir_close(struct inode *inode, struct file *file)
@@ -1491,6 +1611,10 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
                if (err) {
                        d_delete(dentry);
                        dput(dentry);
+               } else {
+                       spin_lock(&configfs_dirent_lock);
+                       configfs_dir_set_ready(dentry->d_fsdata);
+                       spin_unlock(&configfs_dirent_lock);
                }
        }
 
@@ -1517,11 +1641,13 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
        mutex_lock_nested(&configfs_sb->s_root->d_inode->i_mutex,
                          I_MUTEX_PARENT);
        mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
+       mutex_lock(&configfs_symlink_mutex);
        spin_lock(&configfs_dirent_lock);
        if (configfs_detach_prep(dentry, NULL)) {
                printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
        }
        spin_unlock(&configfs_dirent_lock);
+       mutex_unlock(&configfs_symlink_mutex);
        configfs_detach_group(&group->cg_item);
        dentry->d_inode->i_flags |= S_DEAD;
        mutex_unlock(&dentry->d_inode->i_mutex);
index 0004d18c40ac36d0cd730bd01d0d6ac070d9f12d..bf74973b0492372d65aafaeb0fa8af496979c54c 100644 (file)
@@ -31,6 +31,9 @@
 #include <linux/configfs.h>
 #include "configfs_internal.h"
 
+/* Protects attachments of new symlinks */
+DEFINE_MUTEX(configfs_symlink_mutex);
+
 static int item_depth(struct config_item * item)
 {
        struct config_item * p = item;
@@ -73,11 +76,20 @@ static int create_link(struct config_item *parent_item,
        struct configfs_symlink *sl;
        int ret;
 
+       ret = -ENOENT;
+       if (!configfs_dirent_is_ready(target_sd))
+               goto out;
        ret = -ENOMEM;
        sl = kmalloc(sizeof(struct configfs_symlink), GFP_KERNEL);
        if (sl) {
                sl->sl_target = config_item_get(item);
                spin_lock(&configfs_dirent_lock);
+               if (target_sd->s_type & CONFIGFS_USET_DROPPING) {
+                       spin_unlock(&configfs_dirent_lock);
+                       config_item_put(item);
+                       kfree(sl);
+                       return -ENOENT;
+               }
                list_add(&sl->sl_list, &target_sd->s_links);
                spin_unlock(&configfs_dirent_lock);
                ret = configfs_create_link(sl, parent_item->ci_dentry,
@@ -91,6 +103,7 @@ static int create_link(struct config_item *parent_item,
                }
        }
 
+out:
        return ret;
 }
 
@@ -120,6 +133,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
 {
        int ret;
        struct nameidata nd;
+       struct configfs_dirent *sd;
        struct config_item *parent_item;
        struct config_item *target_item;
        struct config_item_type *type;
@@ -128,9 +142,19 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
        if (dentry->d_parent == configfs_sb->s_root)
                goto out;
 
+       sd = dentry->d_parent->d_fsdata;
+       /*
+        * Fake invisibility if dir belongs to a group/default groups hierarchy
+        * being attached
+        */
+       ret = -ENOENT;
+       if (!configfs_dirent_is_ready(sd))
+               goto out;
+
        parent_item = configfs_get_config_item(dentry->d_parent);
        type = parent_item->ci_type;
 
+       ret = -EPERM;
        if (!type || !type->ct_item_ops ||
            !type->ct_item_ops->allow_link)
                goto out_put;
@@ -141,7 +165,9 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
 
        ret = type->ct_item_ops->allow_link(parent_item, target_item);
        if (!ret) {
+               mutex_lock(&configfs_symlink_mutex);
                ret = create_link(parent_item, target_item, dentry);
+               mutex_unlock(&configfs_symlink_mutex);
                if (ret && type->ct_item_ops->drop_link)
                        type->ct_item_ops->drop_link(parent_item,
                                                     target_item);
index f2584d22cb45e9a46cde2fb3f8c376a47273b39a..101663d15e9f07dabc6d5976e69cc5de369f7d37 100644 (file)
@@ -1220,6 +1220,107 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
        return new;
 }
 
+/**
+ * d_add_ci - lookup or allocate new dentry with case-exact name
+ * @inode:  the inode case-insensitive lookup has found
+ * @dentry: the negative dentry that was passed to the parent's lookup func
+ * @name:   the case-exact name to be associated with the returned dentry
+ *
+ * This is to avoid filling the dcache with case-insensitive names to the
+ * same inode, only the actual correct case is stored in the dcache for
+ * case-insensitive filesystems.
+ *
+ * For a case-insensitive lookup match and if the the case-exact dentry
+ * already exists in in the dcache, use it and return it.
+ *
+ * If no entry exists with the exact case name, allocate new dentry with
+ * the exact case, and return the spliced entry.
+ */
+struct dentry *d_add_ci(struct inode *inode, struct dentry *dentry,
+                       struct qstr *name)
+{
+       int error;
+       struct dentry *found;
+       struct dentry *new;
+
+       /* Does a dentry matching the name exist already? */
+       found = d_hash_and_lookup(dentry->d_parent, name);
+       /* If not, create it now and return */
+       if (!found) {
+               new = d_alloc(dentry->d_parent, name);
+               if (!new) {
+                       error = -ENOMEM;
+                       goto err_out;
+               }
+               found = d_splice_alias(inode, new);
+               if (found) {
+                       dput(new);
+                       return found;
+               }
+               return new;
+       }
+       /* Matching dentry exists, check if it is negative. */
+       if (found->d_inode) {
+               if (unlikely(found->d_inode != inode)) {
+                       /* This can't happen because bad inodes are unhashed. */
+                       BUG_ON(!is_bad_inode(inode));
+                       BUG_ON(!is_bad_inode(found->d_inode));
+               }
+               /*
+                * Already have the inode and the dentry attached, decrement
+                * the reference count to balance the iget() done
+                * earlier on.  We found the dentry using d_lookup() so it
+                * cannot be disconnected and thus we do not need to worry
+                * about any NFS/disconnectedness issues here.
+                */
+               iput(inode);
+               return found;
+       }
+       /*
+        * Negative dentry: instantiate it unless the inode is a directory and
+        * has a 'disconnected' dentry (i.e. IS_ROOT and DCACHE_DISCONNECTED),
+        * in which case d_move() that in place of the found dentry.
+        */
+       if (!S_ISDIR(inode->i_mode)) {
+               /* Not a directory; everything is easy. */
+               d_instantiate(found, inode);
+               return found;
+       }
+       spin_lock(&dcache_lock);
+       if (list_empty(&inode->i_dentry)) {
+               /*
+                * Directory without a 'disconnected' dentry; we need to do
+                * d_instantiate() by hand because it takes dcache_lock which
+                * we already hold.
+                */
+               list_add(&found->d_alias, &inode->i_dentry);
+               found->d_inode = inode;
+               spin_unlock(&dcache_lock);
+               security_d_instantiate(found, inode);
+               return found;
+       }
+       /*
+        * Directory with a 'disconnected' dentry; get a reference to the
+        * 'disconnected' dentry.
+        */
+       new = list_entry(inode->i_dentry.next, struct dentry, d_alias);
+       dget_locked(new);
+       spin_unlock(&dcache_lock);
+       /* Do security vodoo. */
+       security_d_instantiate(found, inode);
+       /* Move new in place of found. */
+       d_move(new, found);
+       /* Balance the iget() we did above. */
+       iput(inode);
+       /* Throw away found. */
+       dput(found);
+       /* Use new as the actual dentry. */
+       return new;
+
+err_out:
+       iput(inode);
+       return ERR_PTR(error);
+}
 
 /**
  * d_lookup - search for a dentry
@@ -2254,6 +2355,7 @@ EXPORT_SYMBOL(d_path);
 EXPORT_SYMBOL(d_prune_aliases);
 EXPORT_SYMBOL(d_rehash);
 EXPORT_SYMBOL(d_splice_alias);
+EXPORT_SYMBOL(d_add_ci);
 EXPORT_SYMBOL(d_validate);
 EXPORT_SYMBOL(dget_locked);
 EXPORT_SYMBOL(dput);
index 285b64a8b06e125b1aee42a8317cfd0873d69f20..488eb424f662141488cc8a966496776fa66e2dc9 100644 (file)
@@ -29,7 +29,7 @@
 #define DEVPTS_DEFAULT_MODE 0600
 
 extern int pty_limit;                  /* Config limit on Unix98 ptys */
-static DEFINE_IDR(allocated_ptys);
+static DEFINE_IDA(allocated_ptys);
 static DEFINE_MUTEX(allocated_ptys_lock);
 
 static struct vfsmount *devpts_mnt;
@@ -180,24 +180,24 @@ static struct dentry *get_node(int num)
 int devpts_new_index(void)
 {
        int index;
-       int idr_ret;
+       int ida_ret;
 
 retry:
-       if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) {
+       if (!ida_pre_get(&allocated_ptys, GFP_KERNEL)) {
                return -ENOMEM;
        }
 
        mutex_lock(&allocated_ptys_lock);
-       idr_ret = idr_get_new(&allocated_ptys, NULL, &index);
-       if (idr_ret < 0) {
+       ida_ret = ida_get_new(&allocated_ptys, &index);
+       if (ida_ret < 0) {
                mutex_unlock(&allocated_ptys_lock);
-               if (idr_ret == -EAGAIN)
+               if (ida_ret == -EAGAIN)
                        goto retry;
                return -EIO;
        }
 
        if (index >= pty_limit) {
-               idr_remove(&allocated_ptys, index);
+               ida_remove(&allocated_ptys, index);
                mutex_unlock(&allocated_ptys_lock);
                return -EIO;
        }
@@ -208,7 +208,7 @@ retry:
 void devpts_kill_index(int idx)
 {
        mutex_lock(&allocated_ptys_lock);
-       idr_remove(&allocated_ptys, idx);
+       ida_remove(&allocated_ptys, idx);
        mutex_unlock(&allocated_ptys_lock);
 }
 
index 1346eebe74ce973e1b81edd788a58442089329af..8ec4d6cc763317bf8403a7eae3c666ef2b97b136 100644 (file)
@@ -1793,6 +1793,21 @@ static int vfs_quota_on_remount(struct super_block *sb, int type)
        return ret;
 }
 
+int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
+                     struct path *path)
+{
+       int error = security_quota_on(path->dentry);
+       if (error)
+               return error;
+       /* Quota file not on the same filesystem? */
+       if (path->mnt->mnt_sb != sb)
+               error = -EXDEV;
+       else
+               error = vfs_quota_on_inode(path->dentry->d_inode, type,
+                                          format_id);
+       return error;
+}
+
 /* Actual function called from quotactl() */
 int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path,
                 int remount)
@@ -1804,19 +1819,10 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path,
                return vfs_quota_on_remount(sb, type);
 
        error = path_lookup(path, LOOKUP_FOLLOW, &nd);
-       if (error < 0)
-               return error;
-       error = security_quota_on(nd.path.dentry);
-       if (error)
-               goto out_path;
-       /* Quota file not on the same filesystem? */
-       if (nd.path.mnt->mnt_sb != sb)
-               error = -EXDEV;
-       else
-               error = vfs_quota_on_inode(nd.path.dentry->d_inode, type,
-                                          format_id);
-out_path:
-       path_put(&nd.path);
+       if (!error) {
+               error = vfs_quota_on_path(sb, type, format_id, &nd.path);
+               path_put(&nd.path);
+       }
        return error;
 }
 
@@ -2185,6 +2191,7 @@ EXPORT_SYMBOL(unregister_quota_format);
 EXPORT_SYMBOL(dqstats);
 EXPORT_SYMBOL(dq_data_lock);
 EXPORT_SYMBOL(vfs_quota_on);
+EXPORT_SYMBOL(vfs_quota_on_path);
 EXPORT_SYMBOL(vfs_quota_on_mount);
 EXPORT_SYMBOL(vfs_quota_off);
 EXPORT_SYMBOL(vfs_quota_sync);
index 8ddced38467483a5fded626a73d4e1d62d9d12a1..f38a5afc39a160c15b5a9e518ba41dd8bd4da2af 100644 (file)
@@ -2810,8 +2810,9 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
                journal_unlock_updates(EXT3_SB(sb)->s_journal);
        }
 
+       err = vfs_quota_on_path(sb, type, format_id, &nd.path);
        path_put(&nd.path);
-       return vfs_quota_on(sb, type, format_id, path, remount);
+       return err;
 }
 
 /* Read data from quotafile - avoid pagecache and such because we cannot afford
index c7d04e165446dfc5391930b24ce2a1d3280e71d1..694ed6fadcc8c59e1936a49919c67a427ba670e5 100644 (file)
@@ -40,34 +40,35 @@ ext4_acl_from_disk(const void *value, size_t size)
        acl = posix_acl_alloc(count, GFP_NOFS);
        if (!acl)
                return ERR_PTR(-ENOMEM);
-       for (n=0; n < count; n++) {
+       for (n = 0; n < count; n++) {
                ext4_acl_entry *entry =
                        (ext4_acl_entry *)value;
                if ((char *)value + sizeof(ext4_acl_entry_short) > end)
                        goto fail;
                acl->a_entries[n].e_tag  = le16_to_cpu(entry->e_tag);
                acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
-               switch(acl->a_entries[n].e_tag) {
-                       case ACL_USER_OBJ:
-                       case ACL_GROUP_OBJ:
-                       case ACL_MASK:
-                       case ACL_OTHER:
-                               value = (char *)value +
-                                       sizeof(ext4_acl_entry_short);
-                               acl->a_entries[n].e_id = ACL_UNDEFINED_ID;
-                               break;
-
-                       case ACL_USER:
-                       case ACL_GROUP:
-                               value = (char *)value + sizeof(ext4_acl_entry);
-                               if ((char *)value > end)
-                                       goto fail;
-                               acl->a_entries[n].e_id =
-                                       le32_to_cpu(entry->e_id);
-                               break;
-
-                       default:
+
+               switch (acl->a_entries[n].e_tag) {
+               case ACL_USER_OBJ:
+               case ACL_GROUP_OBJ:
+               case ACL_MASK:
+               case ACL_OTHER:
+                       value = (char *)value +
+                               sizeof(ext4_acl_entry_short);
+                       acl->a_entries[n].e_id = ACL_UNDEFINED_ID;
+                       break;
+
+               case ACL_USER:
+               case ACL_GROUP:
+                       value = (char *)value + sizeof(ext4_acl_entry);
+                       if ((char *)value > end)
                                goto fail;
+                       acl->a_entries[n].e_id =
+                               le32_to_cpu(entry->e_id);
+                       break;
+
+               default:
+                       goto fail;
                }
        }
        if (value != end)
@@ -96,27 +97,26 @@ ext4_acl_to_disk(const struct posix_acl *acl, size_t *size)
                return ERR_PTR(-ENOMEM);
        ext_acl->a_version = cpu_to_le32(EXT4_ACL_VERSION);
        e = (char *)ext_acl + sizeof(ext4_acl_header);
-       for (n=0; n < acl->a_count; n++) {
+       for (n = 0; n < acl->a_count; n++) {
                ext4_acl_entry *entry = (ext4_acl_entry *)e;
                entry->e_tag  = cpu_to_le16(acl->a_entries[n].e_tag);
                entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm);
-               switch(acl->a_entries[n].e_tag) {
-                       case ACL_USER:
-                       case ACL_GROUP:
-                               entry->e_id =
-                                       cpu_to_le32(acl->a_entries[n].e_id);
-                               e += sizeof(ext4_acl_entry);
-                               break;
-
-                       case ACL_USER_OBJ:
-                       case ACL_GROUP_OBJ:
-                       case ACL_MASK:
-                       case ACL_OTHER:
-                               e += sizeof(ext4_acl_entry_short);
-                               break;
-
-                       default:
-                               goto fail;
+               switch (acl->a_entries[n].e_tag) {
+               case ACL_USER:
+               case ACL_GROUP:
+                       entry->e_id = cpu_to_le32(acl->a_entries[n].e_id);
+                       e += sizeof(ext4_acl_entry);
+                       break;
+
+               case ACL_USER_OBJ:
+               case ACL_GROUP_OBJ:
+               case ACL_MASK:
+               case ACL_OTHER:
+                       e += sizeof(ext4_acl_entry_short);
+                       break;
+
+               default:
+                       goto fail;
                }
        }
        return (char *)ext_acl;
@@ -167,23 +167,23 @@ ext4_get_acl(struct inode *inode, int type)
        if (!test_opt(inode->i_sb, POSIX_ACL))
                return NULL;
 
-       switch(type) {
-               case ACL_TYPE_ACCESS:
-                       acl = ext4_iget_acl(inode, &ei->i_acl);
-                       if (acl != EXT4_ACL_NOT_CACHED)
-                               return acl;
-                       name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
-                       break;
-
-               case ACL_TYPE_DEFAULT:
-                       acl = ext4_iget_acl(inode, &ei->i_default_acl);
-                       if (acl != EXT4_ACL_NOT_CACHED)
-                               return acl;
-                       name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
-                       break;
-
-               default:
-                       return ERR_PTR(-EINVAL);
+       switch (type) {
+       case ACL_TYPE_ACCESS:
+               acl = ext4_iget_acl(inode, &ei->i_acl);
+               if (acl != EXT4_ACL_NOT_CACHED)
+                       return acl;
+               name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
+               break;
+
+       case ACL_TYPE_DEFAULT:
+               acl = ext4_iget_acl(inode, &ei->i_default_acl);
+               if (acl != EXT4_ACL_NOT_CACHED)
+                       return acl;
+               name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
+               break;
+
+       default:
+               return ERR_PTR(-EINVAL);
        }
        retval = ext4_xattr_get(inode, name_index, "", NULL, 0);
        if (retval > 0) {
@@ -201,14 +201,14 @@ ext4_get_acl(struct inode *inode, int type)
        kfree(value);
 
        if (!IS_ERR(acl)) {
-               switch(type) {
-                       case ACL_TYPE_ACCESS:
-                               ext4_iset_acl(inode, &ei->i_acl, acl);
-                               break;
-
-                       case ACL_TYPE_DEFAULT:
-                               ext4_iset_acl(inode, &ei->i_default_acl, acl);
-                               break;
+               switch (type) {
+               case ACL_TYPE_ACCESS:
+                       ext4_iset_acl(inode, &ei->i_acl, acl);
+                       break;
+
+               case ACL_TYPE_DEFAULT:
+                       ext4_iset_acl(inode, &ei->i_default_acl, acl);
+                       break;
                }
        }
        return acl;
@@ -232,31 +232,31 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
        if (S_ISLNK(inode->i_mode))
                return -EOPNOTSUPP;
 
-       switch(type) {
-               case ACL_TYPE_ACCESS:
-                       name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
-                       if (acl) {
-                               mode_t mode = inode->i_mode;
-                               error = posix_acl_equiv_mode(acl, &mode);
-                               if (error < 0)
-                                       return error;
-                               else {
-                                       inode->i_mode = mode;
-                                       ext4_mark_inode_dirty(handle, inode);
-                                       if (error == 0)
-                                               acl = NULL;
-                               }
+       switch (type) {
+       case ACL_TYPE_ACCESS:
+               name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
+               if (acl) {
+                       mode_t mode = inode->i_mode;
+                       error = posix_acl_equiv_mode(acl, &mode);
+                       if (error < 0)
+                               return error;
+                       else {
+                               inode->i_mode = mode;
+                               ext4_mark_inode_dirty(handle, inode);
+                               if (error == 0)
+                                       acl = NULL;
                        }
-                       break;
+               }
+               break;
 
-               case ACL_TYPE_DEFAULT:
-                       name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
-                       if (!S_ISDIR(inode->i_mode))
-                               return acl ? -EACCES : 0;
-                       break;
+       case ACL_TYPE_DEFAULT:
+               name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
+               if (!S_ISDIR(inode->i_mode))
+                       return acl ? -EACCES : 0;
+               break;
 
-               default:
-                       return -EINVAL;
+       default:
+               return -EINVAL;
        }
        if (acl) {
                value = ext4_acl_to_disk(acl, &size);
@@ -269,14 +269,14 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
 
        kfree(value);
        if (!error) {
-               switch(type) {
-                       case ACL_TYPE_ACCESS:
-                               ext4_iset_acl(inode, &ei->i_acl, acl);
-                               break;
-
-                       case ACL_TYPE_DEFAULT:
-                               ext4_iset_acl(inode, &ei->i_default_acl, acl);
-                               break;
+               switch (type) {
+               case ACL_TYPE_ACCESS:
+                       ext4_iset_acl(inode, &ei->i_acl, acl);
+                       break;
+
+               case ACL_TYPE_DEFAULT:
+                       ext4_iset_acl(inode, &ei->i_default_acl, acl);
+                       break;
                }
        }
        return error;
index 495ab21b9832a7c5e48116b1dbe2f123af27ec25..1ae5004e93fc20ffd99a652efa6be9897a0518c1 100644 (file)
@@ -314,25 +314,28 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
        if (unlikely(!bh)) {
                ext4_error(sb, __func__,
                            "Cannot read block bitmap - "
-                           "block_group = %d, block_bitmap = %llu",
-                           (int)block_group, (unsigned long long)bitmap_blk);
+                           "block_group = %lu, block_bitmap = %llu",
+                           block_group, bitmap_blk);
                return NULL;
        }
        if (bh_uptodate_or_lock(bh))
                return bh;
 
+       spin_lock(sb_bgl_lock(EXT4_SB(sb), block_group));
        if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
                ext4_init_block_bitmap(sb, bh, block_group, desc);
                set_buffer_uptodate(bh);
                unlock_buffer(bh);
+               spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
                return bh;
        }
+       spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
        if (bh_submit_read(bh) < 0) {
                put_bh(bh);
                ext4_error(sb, __func__,
                            "Cannot read block bitmap - "
-                           "block_group = %d, block_bitmap = %llu",
-                           (int)block_group, (unsigned long long)bitmap_blk);
+                           "block_group = %lu, block_bitmap = %llu",
+                           block_group, bitmap_blk);
                return NULL;
        }
        ext4_valid_block_bitmap(sb, desc, block_group, bh);
index 303e41cf7b142344d7ee202293e15a6647d6b1ce..6c7924d9e358caf3c0803dc43d0d26b76dd9b620 100644 (file)
@@ -1044,7 +1044,6 @@ extern void ext4_mb_update_group_info(struct ext4_group_info *grp,
 
 
 /* inode.c */
-void ext4_da_release_space(struct inode *inode, int used, int to_free);
 int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode,
                struct buffer_head *bh, ext4_fsblk_t blocknr);
 struct buffer_head *ext4_getblk(handle_t *, struct inode *,
index 42c4c0c892ed9b442617207b00acbdc7be99249f..612c3d2c38240ff59a643bcbf405c2229443a848 100644 (file)
@@ -99,7 +99,7 @@ static int ext4_ext_journal_restart(handle_t *handle, int needed)
        if (handle->h_buffer_credits > needed)
                return 0;
        err = ext4_journal_extend(handle, needed);
-       if (err)
+       if (err <= 0)
                return err;
        return ext4_journal_restart(handle, needed);
 }
@@ -1441,7 +1441,7 @@ unsigned int ext4_ext_check_overlap(struct inode *inode,
 
        /*
         * get the next allocated block if the extent in the path
-        * is before the requested block(s) 
+        * is before the requested block(s)
         */
        if (b2 < b1) {
                b2 = ext4_ext_next_allocated_block(path);
@@ -1910,9 +1910,13 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
                        BUG_ON(b != ex_ee_block + ex_ee_len - 1);
                }
 
-               /* at present, extent can't cross block group: */
-               /* leaf + bitmap + group desc + sb + inode */
-               credits = 5;
+               /*
+                * 3 for leaf, sb, and inode plus 2 (bmap and group
+                * descriptor) for each block group; assume two block
+                * groups plus ex_ee_len/blocks_per_block_group for
+                * the worst case
+                */
+               credits = 7 + 2*(ex_ee_len/EXT4_BLOCKS_PER_GROUP(inode->i_sb));
                if (ex == EXT_FIRST_EXTENT(eh)) {
                        correct_index = 1;
                        credits += (ext_depth(inode)) + 1;
@@ -2323,7 +2327,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                unsigned int newdepth;
                /* If extent has less than EXT4_EXT_ZERO_LEN zerout directly */
                if (allocated <= EXT4_EXT_ZERO_LEN) {
-                       /* Mark first half uninitialized.
+                       /*
+                        * iblock == ee_block is handled by the zerouout
+                        * at the beginning.
+                        * Mark first half uninitialized.
                         * Mark second half initialized and zero out the
                         * initialized extent
                         */
@@ -2346,7 +2353,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                                ex->ee_len   = orig_ex.ee_len;
                                ext4_ext_store_pblock(ex, ext_pblock(&orig_ex));
                                ext4_ext_dirty(handle, inode, path + depth);
-                               /* zeroed the full extent */
+                               /* blocks available from iblock */
                                return allocated;
 
                        } else if (err)
@@ -2374,6 +2381,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                                        err = PTR_ERR(path);
                                        return err;
                                }
+                               /* get the second half extent details */
                                ex = path[depth].p_ext;
                                err = ext4_ext_get_access(handle, inode,
                                                                path + depth);
@@ -2403,6 +2411,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                        ext4_ext_store_pblock(ex, ext_pblock(&orig_ex));
                        ext4_ext_dirty(handle, inode, path + depth);
                        /* zeroed the full extent */
+                       /* blocks available from iblock */
                        return allocated;
 
                } else if (err)
@@ -2418,23 +2427,22 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                 */
                orig_ex.ee_len = cpu_to_le16(ee_len -
                                                ext4_ext_get_actual_len(ex3));
-               if (newdepth != depth) {
-                       depth = newdepth;
-                       ext4_ext_drop_refs(path);
-                       path = ext4_ext_find_extent(inode, iblock, path);
-                       if (IS_ERR(path)) {
-                               err = PTR_ERR(path);
-                               goto out;
-                       }
-                       eh = path[depth].p_hdr;
-                       ex = path[depth].p_ext;
-                       if (ex2 != &newex)
-                               ex2 = ex;
-
-                       err = ext4_ext_get_access(handle, inode, path + depth);
-                       if (err)
-                               goto out;
+               depth = newdepth;
+               ext4_ext_drop_refs(path);
+               path = ext4_ext_find_extent(inode, iblock, path);
+               if (IS_ERR(path)) {
+                       err = PTR_ERR(path);
+                       goto out;
                }
+               eh = path[depth].p_hdr;
+               ex = path[depth].p_ext;
+               if (ex2 != &newex)
+                       ex2 = ex;
+
+               err = ext4_ext_get_access(handle, inode, path + depth);
+               if (err)
+                       goto out;
+
                allocated = max_blocks;
 
                /* If extent has less than EXT4_EXT_ZERO_LEN and we are trying
@@ -2452,6 +2460,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
                        ext4_ext_store_pblock(ex, ext_pblock(&orig_ex));
                        ext4_ext_dirty(handle, inode, path + depth);
                        /* zero out the first half */
+                       /* blocks available from iblock */
                        return allocated;
                }
        }
index a92eb305344fe2fd299cd3c15928a033a1374d10..655e760212b871655c2fa55a0e0f1b889476ae77 100644 (file)
@@ -97,34 +97,44 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh,
  * Return buffer_head of bitmap on success or NULL.
  */
 static struct buffer_head *
-read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
+ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
 {
        struct ext4_group_desc *desc;
        struct buffer_head *bh = NULL;
+       ext4_fsblk_t bitmap_blk;
 
        desc = ext4_get_group_desc(sb, block_group, NULL);
        if (!desc)
-               goto error_out;
-       if (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
-               bh = sb_getblk(sb, ext4_inode_bitmap(sb, desc));
-               if (!buffer_uptodate(bh)) {
-                       lock_buffer(bh);
-                       if (!buffer_uptodate(bh)) {
-                               ext4_init_inode_bitmap(sb, bh, block_group,
-                                                      desc);
-                               set_buffer_uptodate(bh);
-                       }
-                       unlock_buffer(bh);
-               }
-       } else {
-               bh = sb_bread(sb, ext4_inode_bitmap(sb, desc));
+               return NULL;
+       bitmap_blk = ext4_inode_bitmap(sb, desc);
+       bh = sb_getblk(sb, bitmap_blk);
+       if (unlikely(!bh)) {
+               ext4_error(sb, __func__,
+                           "Cannot read inode bitmap - "
+                           "block_group = %lu, inode_bitmap = %llu",
+                           block_group, bitmap_blk);
+               return NULL;
        }
-       if (!bh)
-               ext4_error(sb, "read_inode_bitmap",
+       if (bh_uptodate_or_lock(bh))
+               return bh;
+
+       spin_lock(sb_bgl_lock(EXT4_SB(sb), block_group));
+       if (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
+               ext4_init_inode_bitmap(sb, bh, block_group, desc);
+               set_buffer_uptodate(bh);
+               unlock_buffer(bh);
+               spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
+               return bh;
+       }
+       spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
+       if (bh_submit_read(bh) < 0) {
+               put_bh(bh);
+               ext4_error(sb, __func__,
                            "Cannot read inode bitmap - "
                            "block_group = %lu, inode_bitmap = %llu",
-                           block_group, ext4_inode_bitmap(sb, desc));
-error_out:
+                           block_group, bitmap_blk);
+               return NULL;
+       }
        return bh;
 }
 
@@ -200,7 +210,7 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
        }
        block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
        bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
-       bitmap_bh = read_inode_bitmap(sb, block_group);
+       bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
        if (!bitmap_bh)
                goto error_return;
 
@@ -623,7 +633,7 @@ got_group:
                        goto fail;
 
                brelse(bitmap_bh);
-               bitmap_bh = read_inode_bitmap(sb, group);
+               bitmap_bh = ext4_read_inode_bitmap(sb, group);
                if (!bitmap_bh)
                        goto fail;
 
@@ -728,7 +738,7 @@ got:
 
                        /* When marking the block group with
                         * ~EXT4_BG_INODE_UNINIT we don't want to depend
-                        * on the value of bg_itable_unsed even though
+                        * on the value of bg_itable_unused even though
                         * mke2fs could have initialized the same for us.
                         * Instead we calculated the value below
                         */
@@ -891,7 +901,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
 
        block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
        bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
-       bitmap_bh = read_inode_bitmap(sb, block_group);
+       bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
        if (!bitmap_bh) {
                ext4_warning(sb, __func__,
                             "inode bitmap error for orphan %lu", ino);
@@ -969,7 +979,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
                        continue;
                desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
                brelse(bitmap_bh);
-               bitmap_bh = read_inode_bitmap(sb, i);
+               bitmap_bh = ext4_read_inode_bitmap(sb, i);
                if (!bitmap_bh)
                        continue;
 
index 9843b046c2358974bff4bea0449583c688c27358..59fbbe899acc24a5817befbc67fda67ba427b3d1 100644 (file)
@@ -191,6 +191,7 @@ static int ext4_journal_test_restart(handle_t *handle, struct inode *inode)
 void ext4_delete_inode (struct inode * inode)
 {
        handle_t *handle;
+       int err;
 
        if (ext4_should_order_data(inode))
                ext4_begin_ordered_truncate(inode, 0);
@@ -199,8 +200,9 @@ void ext4_delete_inode (struct inode * inode)
        if (is_bad_inode(inode))
                goto no_delete;
 
-       handle = start_transaction(inode);
+       handle = ext4_journal_start(inode, blocks_for_truncate(inode)+3);
        if (IS_ERR(handle)) {
+               ext4_std_error(inode->i_sb, PTR_ERR(handle));
                /*
                 * If we're going to skip the normal cleanup, we still need to
                 * make sure that the in-core orphan linked list is properly
@@ -213,8 +215,34 @@ void ext4_delete_inode (struct inode * inode)
        if (IS_SYNC(inode))
                handle->h_sync = 1;
        inode->i_size = 0;
+       err = ext4_mark_inode_dirty(handle, inode);
+       if (err) {
+               ext4_warning(inode->i_sb, __func__,
+                            "couldn't mark inode dirty (err %d)", err);
+               goto stop_handle;
+       }
        if (inode->i_blocks)
                ext4_truncate(inode);
+
+       /*
+        * ext4_ext_truncate() doesn't reserve any slop when it
+        * restarts journal transactions; therefore there may not be
+        * enough credits left in the handle to remove the inode from
+        * the orphan list and set the dtime field.
+        */
+       if (handle->h_buffer_credits < 3) {
+               err = ext4_journal_extend(handle, 3);
+               if (err > 0)
+                       err = ext4_journal_restart(handle, 3);
+               if (err != 0) {
+                       ext4_warning(inode->i_sb, __func__,
+                                    "couldn't extend journal (err %d)", err);
+               stop_handle:
+                       ext4_journal_stop(handle);
+                       goto no_delete;
+               }
+       }
+
        /*
         * Kill off the orphan record which ext4_truncate created.
         * AKPM: I think this can be inside the above `if'.
@@ -952,6 +980,67 @@ out:
        return err;
 }
 
+/*
+ * Calculate the number of metadata blocks need to reserve
+ * to allocate @blocks for non extent file based file
+ */
+static int ext4_indirect_calc_metadata_amount(struct inode *inode, int blocks)
+{
+       int icap = EXT4_ADDR_PER_BLOCK(inode->i_sb);
+       int ind_blks, dind_blks, tind_blks;
+
+       /* number of new indirect blocks needed */
+       ind_blks = (blocks + icap - 1) / icap;
+
+       dind_blks = (ind_blks + icap - 1) / icap;
+
+       tind_blks = 1;
+
+       return ind_blks + dind_blks + tind_blks;
+}
+
+/*
+ * Calculate the number of metadata blocks need to reserve
+ * to allocate given number of blocks
+ */
+static int ext4_calc_metadata_amount(struct inode *inode, int blocks)
+{
+       if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)
+               return ext4_ext_calc_metadata_amount(inode, blocks);
+
+       return ext4_indirect_calc_metadata_amount(inode, blocks);
+}
+
+static void ext4_da_update_reserve_space(struct inode *inode, int used)
+{
+       struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
+       int total, mdb, mdb_free;
+
+       spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
+       /* recalculate the number of metablocks still need to be reserved */
+       total = EXT4_I(inode)->i_reserved_data_blocks - used;
+       mdb = ext4_calc_metadata_amount(inode, total);
+
+       /* figure out how many metablocks to release */
+       BUG_ON(mdb > EXT4_I(inode)->i_reserved_meta_blocks);
+       mdb_free = EXT4_I(inode)->i_reserved_meta_blocks - mdb;
+
+       /* Account for allocated meta_blocks */
+       mdb_free -= EXT4_I(inode)->i_allocated_meta_blocks;
+
+       /* update fs free blocks counter for truncate case */
+       percpu_counter_add(&sbi->s_freeblocks_counter, mdb_free);
+
+       /* update per-inode reservations */
+       BUG_ON(used  > EXT4_I(inode)->i_reserved_data_blocks);
+       EXT4_I(inode)->i_reserved_data_blocks -= used;
+
+       BUG_ON(mdb > EXT4_I(inode)->i_reserved_meta_blocks);
+       EXT4_I(inode)->i_reserved_meta_blocks = mdb;
+       EXT4_I(inode)->i_allocated_meta_blocks = 0;
+       spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
+}
+
 /* Maximum number of blocks we map for direct IO at once. */
 #define DIO_MAX_BLOCKS 4096
 /*
@@ -965,10 +1054,9 @@ out:
 
 
 /*
+ * The ext4_get_blocks_wrap() function try to look up the requested blocks,
+ * and returns if the blocks are already mapped.
  *
- *
- * ext4_ext4 get_block() wrapper function
- * It will do a look up first, and returns if the blocks already mapped.
  * Otherwise it takes the write lock of the i_data_sem and allocate blocks
  * and store the allocated blocks in the result buffer head and mark it
  * mapped.
@@ -1069,7 +1157,7 @@ int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
                 * which were deferred till now
                 */
                if ((retval > 0) && buffer_delay(bh))
-                       ext4_da_release_space(inode, retval, 0);
+                       ext4_da_update_reserve_space(inode, retval);
        }
 
        up_write((&EXT4_I(inode)->i_data_sem));
@@ -1336,12 +1424,8 @@ static int ext4_ordered_write_end(struct file *file,
 {
        handle_t *handle = ext4_journal_current_handle();
        struct inode *inode = mapping->host;
-       unsigned from, to;
        int ret = 0, ret2;
 
-       from = pos & (PAGE_CACHE_SIZE - 1);
-       to = from + len;
-
        ret = ext4_jbd2_file_inode(handle, inode);
 
        if (ret == 0) {
@@ -1437,36 +1521,6 @@ static int ext4_journalled_write_end(struct file *file,
 
        return ret ? ret : copied;
 }
-/*
- * Calculate the number of metadata blocks need to reserve
- * to allocate @blocks for non extent file based file
- */
-static int ext4_indirect_calc_metadata_amount(struct inode *inode, int blocks)
-{
-       int icap = EXT4_ADDR_PER_BLOCK(inode->i_sb);
-       int ind_blks, dind_blks, tind_blks;
-
-       /* number of new indirect blocks needed */
-       ind_blks = (blocks + icap - 1) / icap;
-
-       dind_blks = (ind_blks + icap - 1) / icap;
-
-       tind_blks = 1;
-
-       return ind_blks + dind_blks + tind_blks;
-}
-
-/*
- * Calculate the number of metadata blocks need to reserve
- * to allocate given number of blocks
- */
-static int ext4_calc_metadata_amount(struct inode *inode, int blocks)
-{
-       if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)
-               return ext4_ext_calc_metadata_amount(inode, blocks);
-
-       return ext4_indirect_calc_metadata_amount(inode, blocks);
-}
 
 static int ext4_da_reserve_space(struct inode *inode, int nrblocks)
 {
@@ -1490,7 +1544,6 @@ static int ext4_da_reserve_space(struct inode *inode, int nrblocks)
                spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
                return -ENOSPC;
        }
-
        /* reduce fs free blocks counter */
        percpu_counter_sub(&sbi->s_freeblocks_counter, total);
 
@@ -1501,35 +1554,31 @@ static int ext4_da_reserve_space(struct inode *inode, int nrblocks)
        return 0;       /* success */
 }
 
-void ext4_da_release_space(struct inode *inode, int used, int to_free)
+static void ext4_da_release_space(struct inode *inode, int to_free)
 {
        struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
        int total, mdb, mdb_free, release;
 
        spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
        /* recalculate the number of metablocks still need to be reserved */
-       total = EXT4_I(inode)->i_reserved_data_blocks - used - to_free;
+       total = EXT4_I(inode)->i_reserved_data_blocks - to_free;
        mdb = ext4_calc_metadata_amount(inode, total);
 
        /* figure out how many metablocks to release */
        BUG_ON(mdb > EXT4_I(inode)->i_reserved_meta_blocks);
        mdb_free = EXT4_I(inode)->i_reserved_meta_blocks - mdb;
 
-       /* Account for allocated meta_blocks */
-       mdb_free -= EXT4_I(inode)->i_allocated_meta_blocks;
-
        release = to_free + mdb_free;
 
        /* update fs free blocks counter for truncate case */
        percpu_counter_add(&sbi->s_freeblocks_counter, release);
 
        /* update per-inode reservations */
-       BUG_ON(used + to_free > EXT4_I(inode)->i_reserved_data_blocks);
-       EXT4_I(inode)->i_reserved_data_blocks -= (used + to_free);
+       BUG_ON(to_free > EXT4_I(inode)->i_reserved_data_blocks);
+       EXT4_I(inode)->i_reserved_data_blocks -= to_free;
 
        BUG_ON(mdb > EXT4_I(inode)->i_reserved_meta_blocks);
        EXT4_I(inode)->i_reserved_meta_blocks = mdb;
-       EXT4_I(inode)->i_allocated_meta_blocks = 0;
        spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
 }
 
@@ -1551,7 +1600,7 @@ static void ext4_da_page_release_reservation(struct page *page,
                }
                curr_off = next_off;
        } while ((bh = bh->b_this_page) != head);
-       ext4_da_release_space(page->mapping->host, 0, to_release);
+       ext4_da_release_space(page->mapping->host, to_release);
 }
 
 /*
@@ -2280,8 +2329,11 @@ retry:
        }
 
        page = __grab_cache_page(mapping, index);
-       if (!page)
-               return -ENOMEM;
+       if (!page) {
+               ext4_journal_stop(handle);
+               ret = -ENOMEM;
+               goto out;
+       }
        *pagep = page;
 
        ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
@@ -3590,6 +3642,16 @@ static int __ext4_get_inode_loc(struct inode *inode,
        }
        if (!buffer_uptodate(bh)) {
                lock_buffer(bh);
+
+               /*
+                * If the buffer has the write error flag, we have failed
+                * to write out another inode in the same block.  In this
+                * case, we don't have to read the block because we may
+                * read the old inode data successfully.
+                */
+               if (buffer_write_io_error(bh) && !buffer_uptodate(bh))
+                       set_buffer_uptodate(bh);
+
                if (buffer_uptodate(bh)) {
                        /* someone brought it uptodate while we waited */
                        unlock_buffer(bh);
index 8d141a25bbeece7ce4a3894374810daaa52cd4aa..865e9ddb44d406d298da48b0137a4f426f8d45dd 100644 (file)
@@ -787,13 +787,16 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
                if (bh_uptodate_or_lock(bh[i]))
                        continue;
 
+               spin_lock(sb_bgl_lock(EXT4_SB(sb), first_group + i));
                if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
                        ext4_init_block_bitmap(sb, bh[i],
                                                first_group + i, desc);
                        set_buffer_uptodate(bh[i]);
                        unlock_buffer(bh[i]);
+                       spin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));
                        continue;
                }
+               spin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));
                get_bh(bh[i]);
                bh[i]->b_end_io = end_buffer_read_sync;
                submit_bh(READ, bh[i]);
@@ -2477,7 +2480,7 @@ err_freesgi:
 int ext4_mb_init(struct super_block *sb, int needs_recovery)
 {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
-       unsigned i;
+       unsigned i, j;
        unsigned offset;
        unsigned max;
        int ret;
@@ -2537,7 +2540,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
        sbi->s_mb_history_filter = EXT4_MB_HISTORY_DEFAULT;
        sbi->s_mb_group_prealloc = MB_DEFAULT_GROUP_PREALLOC;
 
-       i = sizeof(struct ext4_locality_group) * NR_CPUS;
+       i = sizeof(struct ext4_locality_group) * nr_cpu_ids;
        sbi->s_locality_groups = kmalloc(i, GFP_KERNEL);
        if (sbi->s_locality_groups == NULL) {
                clear_opt(sbi->s_mount_opt, MBALLOC);
@@ -2545,11 +2548,12 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
                kfree(sbi->s_mb_maxs);
                return -ENOMEM;
        }
-       for (i = 0; i < NR_CPUS; i++) {
+       for (i = 0; i < nr_cpu_ids; i++) {
                struct ext4_locality_group *lg;
                lg = &sbi->s_locality_groups[i];
                mutex_init(&lg->lg_mutex);
-               INIT_LIST_HEAD(&lg->lg_prealloc_list);
+               for (j = 0; j < PREALLOC_TB_SIZE; j++)
+                       INIT_LIST_HEAD(&lg->lg_prealloc_list[j]);
                spin_lock_init(&lg->lg_prealloc_lock);
        }
 
@@ -3260,6 +3264,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
                                struct ext4_prealloc_space *pa)
 {
        unsigned int len = ac->ac_o_ex.fe_len;
+
        ext4_get_group_no_and_offset(ac->ac_sb, pa->pa_pstart,
                                        &ac->ac_b_ex.fe_group,
                                        &ac->ac_b_ex.fe_start);
@@ -3282,6 +3287,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
 static noinline_for_stack int
 ext4_mb_use_preallocated(struct ext4_allocation_context *ac)
 {
+       int order, i;
        struct ext4_inode_info *ei = EXT4_I(ac->ac_inode);
        struct ext4_locality_group *lg;
        struct ext4_prealloc_space *pa;
@@ -3322,22 +3328,29 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac)
        lg = ac->ac_lg;
        if (lg == NULL)
                return 0;
-
-       rcu_read_lock();
-       list_for_each_entry_rcu(pa, &lg->lg_prealloc_list, pa_inode_list) {
-               spin_lock(&pa->pa_lock);
-               if (pa->pa_deleted == 0 && pa->pa_free >= ac->ac_o_ex.fe_len) {
-                       atomic_inc(&pa->pa_count);
-                       ext4_mb_use_group_pa(ac, pa);
+       order  = fls(ac->ac_o_ex.fe_len) - 1;
+       if (order > PREALLOC_TB_SIZE - 1)
+               /* The max size of hash table is PREALLOC_TB_SIZE */
+               order = PREALLOC_TB_SIZE - 1;
+
+       for (i = order; i < PREALLOC_TB_SIZE; i++) {
+               rcu_read_lock();
+               list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[i],
+                                       pa_inode_list) {
+                       spin_lock(&pa->pa_lock);
+                       if (pa->pa_deleted == 0 &&
+                                       pa->pa_free >= ac->ac_o_ex.fe_len) {
+                               atomic_inc(&pa->pa_count);
+                               ext4_mb_use_group_pa(ac, pa);
+                               spin_unlock(&pa->pa_lock);
+                               ac->ac_criteria = 20;
+                               rcu_read_unlock();
+                               return 1;
+                       }
                        spin_unlock(&pa->pa_lock);
-                       ac->ac_criteria = 20;
-                       rcu_read_unlock();
-                       return 1;
                }
-               spin_unlock(&pa->pa_lock);
+               rcu_read_unlock();
        }
-       rcu_read_unlock();
-
        return 0;
 }
 
@@ -3560,6 +3573,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
        pa->pa_free = pa->pa_len;
        atomic_set(&pa->pa_count, 1);
        spin_lock_init(&pa->pa_lock);
+       INIT_LIST_HEAD(&pa->pa_inode_list);
        pa->pa_deleted = 0;
        pa->pa_linear = 1;
 
@@ -3580,10 +3594,10 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
        list_add(&pa->pa_group_list, &grp->bb_prealloc_list);
        ext4_unlock_group(sb, ac->ac_b_ex.fe_group);
 
-       spin_lock(pa->pa_obj_lock);
-       list_add_tail_rcu(&pa->pa_inode_list, &lg->lg_prealloc_list);
-       spin_unlock(pa->pa_obj_lock);
-
+       /*
+        * We will later add the new pa to the right bucket
+        * after updating the pa_free in ext4_mb_release_context
+        */
        return 0;
 }
 
@@ -3733,20 +3747,23 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
 
        bitmap_bh = ext4_read_block_bitmap(sb, group);
        if (bitmap_bh == NULL) {
-               /* error handling here */
-               ext4_mb_release_desc(&e4b);
-               BUG_ON(bitmap_bh == NULL);
+               ext4_error(sb, __func__, "Error in reading block "
+                               "bitmap for %lu\n", group);
+               return 0;
        }
 
        err = ext4_mb_load_buddy(sb, group, &e4b);
-       BUG_ON(err != 0); /* error handling here */
+       if (err) {
+               ext4_error(sb, __func__, "Error in loading buddy "
+                               "information for %lu\n", group);
+               put_bh(bitmap_bh);
+               return 0;
+       }
 
        if (needed == 0)
                needed = EXT4_BLOCKS_PER_GROUP(sb) + 1;
 
-       grp = ext4_get_group_info(sb, group);
        INIT_LIST_HEAD(&list);
-
        ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
 repeat:
        ext4_lock_group(sb, group);
@@ -3903,13 +3920,18 @@ repeat:
                ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL);
 
                err = ext4_mb_load_buddy(sb, group, &e4b);
-               BUG_ON(err != 0); /* error handling here */
+               if (err) {
+                       ext4_error(sb, __func__, "Error in loading buddy "
+                                       "information for %lu\n", group);
+                       continue;
+               }
 
                bitmap_bh = ext4_read_block_bitmap(sb, group);
                if (bitmap_bh == NULL) {
-                       /* error handling here */
+                       ext4_error(sb, __func__, "Error in reading block "
+                                       "bitmap for %lu\n", group);
                        ext4_mb_release_desc(&e4b);
-                       BUG_ON(bitmap_bh == NULL);
+                       continue;
                }
 
                ext4_lock_group(sb, group);
@@ -4112,22 +4134,168 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
 
 }
 
+static noinline_for_stack void
+ext4_mb_discard_lg_preallocations(struct super_block *sb,
+                                       struct ext4_locality_group *lg,
+                                       int order, int total_entries)
+{
+       ext4_group_t group = 0;
+       struct ext4_buddy e4b;
+       struct list_head discard_list;
+       struct ext4_prealloc_space *pa, *tmp;
+       struct ext4_allocation_context *ac;
+
+       mb_debug("discard locality group preallocation\n");
+
+       INIT_LIST_HEAD(&discard_list);
+       ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
+
+       spin_lock(&lg->lg_prealloc_lock);
+       list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order],
+                                               pa_inode_list) {
+               spin_lock(&pa->pa_lock);
+               if (atomic_read(&pa->pa_count)) {
+                       /*
+                        * This is the pa that we just used
+                        * for block allocation. So don't
+                        * free that
+                        */
+                       spin_unlock(&pa->pa_lock);
+                       continue;
+               }
+               if (pa->pa_deleted) {
+                       spin_unlock(&pa->pa_lock);
+                       continue;
+               }
+               /* only lg prealloc space */
+               BUG_ON(!pa->pa_linear);
+
+               /* seems this one can be freed ... */
+               pa->pa_deleted = 1;
+               spin_unlock(&pa->pa_lock);
+
+               list_del_rcu(&pa->pa_inode_list);
+               list_add(&pa->u.pa_tmp_list, &discard_list);
+
+               total_entries--;
+               if (total_entries <= 5) {
+                       /*
+                        * we want to keep only 5 entries
+                        * allowing it to grow to 8. This
+                        * mak sure we don't call discard
+                        * soon for this list.
+                        */
+                       break;
+               }
+       }
+       spin_unlock(&lg->lg_prealloc_lock);
+
+       list_for_each_entry_safe(pa, tmp, &discard_list, u.pa_tmp_list) {
+
+               ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL);
+               if (ext4_mb_load_buddy(sb, group, &e4b)) {
+                       ext4_error(sb, __func__, "Error in loading buddy "
+                                       "information for %lu\n", group);
+                       continue;
+               }
+               ext4_lock_group(sb, group);
+               list_del(&pa->pa_group_list);
+               ext4_mb_release_group_pa(&e4b, pa, ac);
+               ext4_unlock_group(sb, group);
+
+               ext4_mb_release_desc(&e4b);
+               list_del(&pa->u.pa_tmp_list);
+               call_rcu(&(pa)->u.pa_rcu, ext4_mb_pa_callback);
+       }
+       if (ac)
+               kmem_cache_free(ext4_ac_cachep, ac);
+}
+
+/*
+ * We have incremented pa_count. So it cannot be freed at this
+ * point. Also we hold lg_mutex. So no parallel allocation is
+ * possible from this lg. That means pa_free cannot be updated.
+ *
+ * A parallel ext4_mb_discard_group_preallocations is possible.
+ * which can cause the lg_prealloc_list to be updated.
+ */
+
+static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac)
+{
+       int order, added = 0, lg_prealloc_count = 1;
+       struct super_block *sb = ac->ac_sb;
+       struct ext4_locality_group *lg = ac->ac_lg;
+       struct ext4_prealloc_space *tmp_pa, *pa = ac->ac_pa;
+
+       order = fls(pa->pa_free) - 1;
+       if (order > PREALLOC_TB_SIZE - 1)
+               /* The max size of hash table is PREALLOC_TB_SIZE */
+               order = PREALLOC_TB_SIZE - 1;
+       /* Add the prealloc space to lg */
+       rcu_read_lock();
+       list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order],
+                                               pa_inode_list) {
+               spin_lock(&tmp_pa->pa_lock);
+               if (tmp_pa->pa_deleted) {
+                       spin_unlock(&pa->pa_lock);
+                       continue;
+               }
+               if (!added && pa->pa_free < tmp_pa->pa_free) {
+                       /* Add to the tail of the previous entry */
+                       list_add_tail_rcu(&pa->pa_inode_list,
+                                               &tmp_pa->pa_inode_list);
+                       added = 1;
+                       /*
+                        * we want to count the total
+                        * number of entries in the list
+                        */
+               }
+               spin_unlock(&tmp_pa->pa_lock);
+               lg_prealloc_count++;
+       }
+       if (!added)
+               list_add_tail_rcu(&pa->pa_inode_list,
+                                       &lg->lg_prealloc_list[order]);
+       rcu_read_unlock();
+
+       /* Now trim the list to be not more than 8 elements */
+       if (lg_prealloc_count > 8) {
+               ext4_mb_discard_lg_preallocations(sb, lg,
+                                               order, lg_prealloc_count);
+               return;
+       }
+       return ;
+}
+
 /*
  * release all resource we used in allocation
  */
 static int ext4_mb_release_context(struct ext4_allocation_context *ac)
 {
-       if (ac->ac_pa) {
-               if (ac->ac_pa->pa_linear) {
+       struct ext4_prealloc_space *pa = ac->ac_pa;
+       if (pa) {
+               if (pa->pa_linear) {
                        /* see comment in ext4_mb_use_group_pa() */
-                       spin_lock(&ac->ac_pa->pa_lock);
-                       ac->ac_pa->pa_pstart += ac->ac_b_ex.fe_len;
-                       ac->ac_pa->pa_lstart += ac->ac_b_ex.fe_len;
-                       ac->ac_pa->pa_free -= ac->ac_b_ex.fe_len;
-                       ac->ac_pa->pa_len -= ac->ac_b_ex.fe_len;
-                       spin_unlock(&ac->ac_pa->pa_lock);
+                       spin_lock(&pa->pa_lock);
+                       pa->pa_pstart += ac->ac_b_ex.fe_len;
+                       pa->pa_lstart += ac->ac_b_ex.fe_len;
+                       pa->pa_free -= ac->ac_b_ex.fe_len;
+                       pa->pa_len -= ac->ac_b_ex.fe_len;
+                       spin_unlock(&pa->pa_lock);
+                       /*
+                        * We want to add the pa to the right bucket.
+                        * Remove it from the list and while adding
+                        * make sure the list to which we are adding
+                        * doesn't grow big.
+                        */
+                       if (likely(pa->pa_free)) {
+                               spin_lock(pa->pa_obj_lock);
+                               list_del_rcu(&pa->pa_inode_list);
+                               spin_unlock(pa->pa_obj_lock);
+                               ext4_mb_add_n_trim(ac);
+                       }
                }
-               ext4_mb_put_pa(ac, ac->ac_sb, ac->ac_pa);
+               ext4_mb_put_pa(ac, ac->ac_sb, pa);
        }
        if (ac->ac_bitmap_page)
                page_cache_release(ac->ac_bitmap_page);
@@ -4420,11 +4588,15 @@ do_more:
                count -= overflow;
        }
        bitmap_bh = ext4_read_block_bitmap(sb, block_group);
-       if (!bitmap_bh)
+       if (!bitmap_bh) {
+               err = -EIO;
                goto error_return;
+       }
        gdp = ext4_get_group_desc(sb, block_group, &gd_bh);
-       if (!gdp)
+       if (!gdp) {
+               err = -EIO;
                goto error_return;
+       }
 
        if (in_range(ext4_block_bitmap(sb, gdp), block, count) ||
            in_range(ext4_inode_bitmap(sb, gdp), block, count) ||
index bfe6add46bcfdaa2988a449b2c6cd316c4802419..c7c9906c2a754dec0953412b1c0843873ef7f6b9 100644 (file)
@@ -164,11 +164,17 @@ struct ext4_free_extent {
  * Locality group:
  *   we try to group all related changes together
  *   so that writeback can flush/allocate them together as well
+ *   Size of lg_prealloc_list hash is determined by MB_DEFAULT_GROUP_PREALLOC
+ *   (512). We store prealloc space into the hash based on the pa_free blocks
+ *   order value.ie, fls(pa_free)-1;
  */
+#define PREALLOC_TB_SIZE 10
 struct ext4_locality_group {
        /* for allocator */
-       struct mutex            lg_mutex;       /* to serialize allocates */
-       struct list_head        lg_prealloc_list;/* list of preallocations */
+       /* to serialize allocates */
+       struct mutex            lg_mutex;
+       /* list of preallocations */
+       struct list_head        lg_prealloc_list[PREALLOC_TB_SIZE];
        spinlock_t              lg_prealloc_lock;
 };
 
index f000fbe2cd93c0fb10938e1eba8c89e63dfc434a..0a9265164265fda4be2aa94c1db1941c3bb0b247 100644 (file)
@@ -73,7 +73,7 @@ static int verify_group_input(struct super_block *sb,
                             "Inode bitmap not in group (block %llu)",
                             (unsigned long long)input->inode_bitmap);
        else if (outside(input->inode_table, start, end) ||
-                outside(itend - 1, start, end))
+                outside(itend - 1, start, end))
                ext4_warning(sb, __func__,
                             "Inode table not in group (blocks %llu-%llu)",
                             (unsigned long long)input->inode_table, itend - 1);
@@ -104,7 +104,7 @@ static int verify_group_input(struct super_block *sb,
                             (unsigned long long)input->inode_bitmap,
                             start, metaend - 1);
        else if (inside(input->inode_table, start, metaend) ||
-                inside(itend - 1, start, metaend))
+                inside(itend - 1, start, metaend))
                ext4_warning(sb, __func__,
                             "Inode table (%llu-%llu) overlaps"
                             "GDT table (%llu-%llu)",
@@ -158,9 +158,9 @@ static int extend_or_restart_transaction(handle_t *handle, int thresh,
        if (err) {
                if ((err = ext4_journal_restart(handle, EXT4_MAX_TRANS_DATA)))
                        return err;
-               if ((err = ext4_journal_get_write_access(handle, bh)))
+               if ((err = ext4_journal_get_write_access(handle, bh)))
                        return err;
-        }
+       }
 
        return 0;
 }
@@ -416,11 +416,11 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
                       "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
                       gdb_num);
 
-       /*
-        * If we are not using the primary superblock/GDT copy don't resize,
-        * because the user tools have no way of handling this.  Probably a
-        * bad time to do it anyways.
-        */
+        /*
+         * If we are not using the primary superblock/GDT copy don't resize,
+         * because the user tools have no way of handling this.  Probably a
+         * bad time to do it anyways.
+         */
        if (EXT4_SB(sb)->s_sbh->b_blocknr !=
            le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {
                ext4_warning(sb, __func__,
@@ -507,14 +507,14 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
        return 0;
 
 exit_inode:
-       //ext4_journal_release_buffer(handle, iloc.bh);
+       /* ext4_journal_release_buffer(handle, iloc.bh); */
        brelse(iloc.bh);
 exit_dindj:
-       //ext4_journal_release_buffer(handle, dind);
+       /* ext4_journal_release_buffer(handle, dind); */
 exit_primary:
-       //ext4_journal_release_buffer(handle, *primary);
+       /* ext4_journal_release_buffer(handle, *primary); */
 exit_sbh:
-       //ext4_journal_release_buffer(handle, *primary);
+       /* ext4_journal_release_buffer(handle, *primary); */
 exit_dind:
        brelse(dind);
 exit_bh:
@@ -818,12 +818,12 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
        if ((err = ext4_journal_get_write_access(handle, sbi->s_sbh)))
                goto exit_journal;
 
-       /*
-        * We will only either add reserved group blocks to a backup group
-        * or remove reserved blocks for the first group in a new group block.
-        * Doing both would be mean more complex code, and sane people don't
-        * use non-sparse filesystems anymore.  This is already checked above.
-        */
+        /*
+         * We will only either add reserved group blocks to a backup group
+         * or remove reserved blocks for the first group in a new group block.
+         * Doing both would be mean more complex code, and sane people don't
+         * use non-sparse filesystems anymore.  This is already checked above.
+         */
        if (gdb_off) {
                primary = sbi->s_group_desc[gdb_num];
                if ((err = ext4_journal_get_write_access(handle, primary)))
@@ -835,24 +835,24 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
        } else if ((err = add_new_gdb(handle, inode, input, &primary)))
                goto exit_journal;
 
-       /*
-        * OK, now we've set up the new group.  Time to make it active.
-        *
-        * Current kernels don't lock all allocations via lock_super(),
-        * so we have to be safe wrt. concurrent accesses the group
-        * data.  So we need to be careful to set all of the relevant
-        * group descriptor data etc. *before* we enable the group.
-        *
-        * The key field here is sbi->s_groups_count: as long as
-        * that retains its old value, nobody is going to access the new
-        * group.
-        *
-        * So first we update all the descriptor metadata for the new
-        * group; then we update the total disk blocks count; then we
-        * update the groups count to enable the group; then finally we
-        * update the free space counts so that the system can start
-        * using the new disk blocks.
-        */
+        /*
+         * OK, now we've set up the new group.  Time to make it active.
+         *
+         * Current kernels don't lock all allocations via lock_super(),
+         * so we have to be safe wrt. concurrent accesses the group
+         * data.  So we need to be careful to set all of the relevant
+         * group descriptor data etc. *before* we enable the group.
+         *
+         * The key field here is sbi->s_groups_count: as long as
+         * that retains its old value, nobody is going to access the new
+         * group.
+         *
+         * So first we update all the descriptor metadata for the new
+         * group; then we update the total disk blocks count; then we
+         * update the groups count to enable the group; then finally we
+         * update the free space counts so that the system can start
+         * using the new disk blocks.
+         */
 
        /* Update group descriptor block for new group */
        gdp = (struct ext4_group_desc *)((char *)primary->b_data +
@@ -946,7 +946,8 @@ exit_put:
        return err;
 } /* ext4_group_add */
 
-/* Extend the filesystem to the new number of blocks specified.  This entry
+/*
+ * Extend the filesystem to the new number of blocks specified.  This entry
  * point is only used to extend the current filesystem to the end of the last
  * existing group.  It can be accessed via ioctl, or by "remount,resize=<size>"
  * for emergencies (because it has no dependencies on reserved blocks).
@@ -1024,7 +1025,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
                             o_blocks_count + add, add);
 
        /* See if the device is actually as big as what was requested */
-       bh = sb_bread(sb, o_blocks_count + add -1);
+       bh = sb_bread(sb, o_blocks_count + add - 1);
        if (!bh) {
                ext4_warning(sb, __func__,
                             "can't read last block, resize aborted");
index b5479b1dff14b7513b077ddc2c920ceffc67b76d..d5d77958b861b9fc29114965a566a7e2dfdd4a84 100644 (file)
@@ -49,20 +49,19 @@ static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
                             unsigned long journal_devnum);
 static int ext4_create_journal(struct super_block *, struct ext4_super_block *,
                               unsigned int);
-static void ext4_commit_super (struct super_block * sb,
-                              struct ext4_super_block * es,
-                              int sync);
-static void ext4_mark_recovery_complete(struct super_block * sb,
-                                       struct ext4_super_block * es);
-static void ext4_clear_journal_err(struct super_block * sb,
-                                  struct ext4_super_block * es);
+static void ext4_commit_super(struct super_block *sb,
+                             struct ext4_super_block *es, int sync);
+static void ext4_mark_recovery_complete(struct super_block *sb,
+                                       struct ext4_super_block *es);
+static void ext4_clear_journal_err(struct super_block *sb,
+                                  struct ext4_super_block *es);
 static int ext4_sync_fs(struct super_block *sb, int wait);
-static const char *ext4_decode_error(struct super_block * sb, int errno,
+static const char *ext4_decode_error(struct super_block *sb, int errno,
                                     char nbuf[16]);
-static int ext4_remount (struct super_block * sb, int * flags, char * data);
-static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf);
+static int ext4_remount(struct super_block *sb, int *flags, char *data);
+static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
 static void ext4_unlockfs(struct super_block *sb);
-static void ext4_write_super (struct super_block * sb);
+static void ext4_write_super(struct super_block *sb);
 static void ext4_write_super_lockfs(struct super_block *sb);
 
 
@@ -211,15 +210,15 @@ static void ext4_handle_error(struct super_block *sb)
        if (sb->s_flags & MS_RDONLY)
                return;
 
-       if (!test_opt (sb, ERRORS_CONT)) {
+       if (!test_opt(sb, ERRORS_CONT)) {
                journal_t *journal = EXT4_SB(sb)->s_journal;
 
                EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT;
                if (journal)
                        jbd2_journal_abort(journal, -EIO);
        }
-       if (test_opt (sb, ERRORS_RO)) {
-               printk (KERN_CRIT "Remounting filesystem read-only\n");
+       if (test_opt(sb, ERRORS_RO)) {
+               printk(KERN_CRIT "Remounting filesystem read-only\n");
                sb->s_flags |= MS_RDONLY;
        }
        ext4_commit_super(sb, es, 1);
@@ -228,13 +227,13 @@ static void ext4_handle_error(struct super_block *sb)
                        sb->s_id);
 }
 
-void ext4_error (struct super_block * sb, const char * function,
-                const char * fmt, ...)
+void ext4_error(struct super_block *sb, const char *function,
+               const char *fmt, ...)
 {
        va_list args;
 
        va_start(args, fmt);
-       printk(KERN_CRIT "EXT4-fs error (device %s): %s: ",sb->s_id, function);
+       printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function);
        vprintk(fmt, args);
        printk("\n");
        va_end(args);
@@ -242,7 +241,7 @@ void ext4_error (struct super_block * sb, const char * function,
        ext4_handle_error(sb);
 }
 
-static const char *ext4_decode_error(struct super_block * sb, int errno,
+static const char *ext4_decode_error(struct super_block *sb, int errno,
                                     char nbuf[16])
 {
        char *errstr = NULL;
@@ -278,8 +277,7 @@ static const char *ext4_decode_error(struct super_block * sb, int errno,
 /* __ext4_std_error decodes expected errors from journaling functions
  * automatically and invokes the appropriate error response.  */
 
-void __ext4_std_error (struct super_block * sb, const char * function,
-                      int errno)
+void __ext4_std_error(struct super_block *sb, const char *function, int errno)
 {
        char nbuf[16];
        const char *errstr;
@@ -292,8 +290,8 @@ void __ext4_std_error (struct super_block * sb, const char * function,
                return;
 
        errstr = ext4_decode_error(sb, errno, nbuf);
-       printk (KERN_CRIT "EXT4-fs error (device %s) in %s: %s\n",
-               sb->s_id, function, errstr);
+       printk(KERN_CRIT "EXT4-fs error (device %s) in %s: %s\n",
+              sb->s_id, function, errstr);
 
        ext4_handle_error(sb);
 }
@@ -308,15 +306,15 @@ void __ext4_std_error (struct super_block * sb, const char * function,
  * case we take the easy way out and panic immediately.
  */
 
-void ext4_abort (struct super_block * sb, const char * function,
-                const char * fmt, ...)
+void ext4_abort(struct super_block *sb, const char *function,
+               const char *fmt, ...)
 {
        va_list args;
 
-       printk (KERN_CRIT "ext4_abort called.\n");
+       printk(KERN_CRIT "ext4_abort called.\n");
 
        va_start(args, fmt);
-       printk(KERN_CRIT "EXT4-fs error (device %s): %s: ",sb->s_id, function);
+       printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function);
        vprintk(fmt, args);
        printk("\n");
        va_end(args);
@@ -334,8 +332,8 @@ void ext4_abort (struct super_block * sb, const char * function,
        jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO);
 }
 
-void ext4_warning (struct super_block * sb, const char * function,
-                  const char * fmt, ...)
+void ext4_warning(struct super_block *sb, const char *function,
+                 const char *fmt, ...)
 {
        va_list args;
 
@@ -496,7 +494,7 @@ static void dump_orphan_list(struct super_block *sb, struct ext4_sb_info *sbi)
        }
 }
 
-static void ext4_put_super (struct super_block * sb)
+static void ext4_put_super(struct super_block *sb)
 {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_super_block *es = sbi->s_es;
@@ -647,7 +645,8 @@ static void ext4_clear_inode(struct inode *inode)
                                       &EXT4_I(inode)->jinode);
 }
 
-static inline void ext4_show_quota_options(struct seq_file *seq, struct super_block *sb)
+static inline void ext4_show_quota_options(struct seq_file *seq,
+                                          struct super_block *sb)
 {
 #if defined(CONFIG_QUOTA)
        struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -822,8 +821,8 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid,
 }
 
 #ifdef CONFIG_QUOTA
-#define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group")
-#define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
+#define QTYPE2NAME(t) ((t) == USRQUOTA?"user":"group")
+#define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
 
 static int ext4_dquot_initialize(struct inode *inode, int type);
 static int ext4_dquot_drop(struct inode *inode);
@@ -991,12 +990,12 @@ static ext4_fsblk_t get_sb_block(void **data)
        return sb_block;
 }
 
-static int parse_options (char *options, struct super_block *sb,
-                         unsigned int *inum, unsigned long *journal_devnum,
-                         ext4_fsblk_t *n_blocks_count, int is_remount)
+static int parse_options(char *options, struct super_block *sb,
+                        unsigned int *inum, unsigned long *journal_devnum,
+                        ext4_fsblk_t *n_blocks_count, int is_remount)
 {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
-       char * p;
+       char *p;
        substring_t args[MAX_OPT_ARGS];
        int data_opt = 0;
        int option;
@@ -1009,7 +1008,7 @@ static int parse_options (char *options, struct super_block *sb,
        if (!options)
                return 1;
 
-       while ((p = strsep (&options, ",")) != NULL) {
+       while ((p = strsep(&options, ",")) != NULL) {
                int token;
                if (!*p)
                        continue;
@@ -1017,16 +1016,16 @@ static int parse_options (char *options, struct super_block *sb,
                token = match_token(p, tokens, args);
                switch (token) {
                case Opt_bsd_df:
-                       clear_opt (sbi->s_mount_opt, MINIX_DF);
+                       clear_opt(sbi->s_mount_opt, MINIX_DF);
                        break;
                case Opt_minix_df:
-                       set_opt (sbi->s_mount_opt, MINIX_DF);
+                       set_opt(sbi->s_mount_opt, MINIX_DF);
                        break;
                case Opt_grpid:
-                       set_opt (sbi->s_mount_opt, GRPID);
+                       set_opt(sbi->s_mount_opt, GRPID);
                        break;
                case Opt_nogrpid:
-                       clear_opt (sbi->s_mount_opt, GRPID);
+                       clear_opt(sbi->s_mount_opt, GRPID);
                        break;
                case Opt_resuid:
                        if (match_int(&args[0], &option))
@@ -1043,41 +1042,41 @@ static int parse_options (char *options, struct super_block *sb,
                        /* *sb_block = match_int(&args[0]); */
                        break;
                case Opt_err_panic:
-                       clear_opt (sbi->s_mount_opt, ERRORS_CONT);
-                       clear_opt (sbi->s_mount_opt, ERRORS_RO);
-                       set_opt (sbi->s_mount_opt, ERRORS_PANIC);
+                       clear_opt(sbi->s_mount_opt, ERRORS_CONT);
+                       clear_opt(sbi->s_mount_opt, ERRORS_RO);
+                       set_opt(sbi->s_mount_opt, ERRORS_PANIC);
                        break;
                case Opt_err_ro:
-                       clear_opt (sbi->s_mount_opt, ERRORS_CONT);
-                       clear_opt (sbi->s_mount_opt, ERRORS_PANIC);
-                       set_opt (sbi->s_mount_opt, ERRORS_RO);
+                       clear_opt(sbi->s_mount_opt, ERRORS_CONT);
+                       clear_opt(sbi->s_mount_opt, ERRORS_PANIC);
+                       set_opt(sbi->s_mount_opt, ERRORS_RO);
                        break;
                case Opt_err_cont:
-                       clear_opt (sbi->s_mount_opt, ERRORS_RO);
-                       clear_opt (sbi->s_mount_opt, ERRORS_PANIC);
-                       set_opt (sbi->s_mount_opt, ERRORS_CONT);
+                       clear_opt(sbi->s_mount_opt, ERRORS_RO);
+                       clear_opt(sbi->s_mount_opt, ERRORS_PANIC);
+                       set_opt(sbi->s_mount_opt, ERRORS_CONT);
                        break;
                case Opt_nouid32:
-                       set_opt (sbi->s_mount_opt, NO_UID32);
+                       set_opt(sbi->s_mount_opt, NO_UID32);
                        break;
                case Opt_nocheck:
-                       clear_opt (sbi->s_mount_opt, CHECK);
+                       clear_opt(sbi->s_mount_opt, CHECK);
                        break;
                case Opt_debug:
-                       set_opt (sbi->s_mount_opt, DEBUG);
+                       set_opt(sbi->s_mount_opt, DEBUG);
                        break;
                case Opt_oldalloc:
-                       set_opt (sbi->s_mount_opt, OLDALLOC);
+                       set_opt(sbi->s_mount_opt, OLDALLOC);
                        break;
                case Opt_orlov:
-                       clear_opt (sbi->s_mount_opt, OLDALLOC);
+                       clear_opt(sbi->s_mount_opt, OLDALLOC);
                        break;
 #ifdef CONFIG_EXT4DEV_FS_XATTR
                case Opt_user_xattr:
-                       set_opt (sbi->s_mount_opt, XATTR_USER);
+                       set_opt(sbi->s_mount_opt, XATTR_USER);
                        break;
                case Opt_nouser_xattr:
-                       clear_opt (sbi->s_mount_opt, XATTR_USER);
+                       clear_opt(sbi->s_mount_opt, XATTR_USER);
                        break;
 #else
                case Opt_user_xattr:
@@ -1115,7 +1114,7 @@ static int parse_options (char *options, struct super_block *sb,
                                       "journal on remount\n");
                                return 0;
                        }
-                       set_opt (sbi->s_mount_opt, UPDATE_JOURNAL);
+                       set_opt(sbi->s_mount_opt, UPDATE_JOURNAL);
                        break;
                case Opt_journal_inum:
                        if (is_remount) {
@@ -1145,7 +1144,7 @@ static int parse_options (char *options, struct super_block *sb,
                        set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM);
                        break;
                case Opt_noload:
-                       set_opt (sbi->s_mount_opt, NOLOAD);
+                       set_opt(sbi->s_mount_opt, NOLOAD);
                        break;
                case Opt_commit:
                        if (match_int(&args[0], &option))
@@ -1331,7 +1330,7 @@ set_qf_format:
                                        "on this filesystem, use tune2fs\n");
                                return 0;
                        }
-                       set_opt (sbi->s_mount_opt, EXTENTS);
+                       set_opt(sbi->s_mount_opt, EXTENTS);
                        break;
                case Opt_noextents:
                        /*
@@ -1348,7 +1347,7 @@ set_qf_format:
                                                "-o noextents options\n");
                                return 0;
                        }
-                       clear_opt (sbi->s_mount_opt, EXTENTS);
+                       clear_opt(sbi->s_mount_opt, EXTENTS);
                        break;
                case Opt_i_version:
                        set_opt(sbi->s_mount_opt, I_VERSION);
@@ -1374,9 +1373,9 @@ set_qf_format:
                        set_opt(sbi->s_mount_opt, DELALLOC);
                        break;
                default:
-                       printk (KERN_ERR
-                               "EXT4-fs: Unrecognized mount option \"%s\" "
-                               "or missing value\n", p);
+                       printk(KERN_ERR
+                              "EXT4-fs: Unrecognized mount option \"%s\" "
+                              "or missing value\n", p);
                        return 0;
                }
        }
@@ -1423,31 +1422,31 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
        int res = 0;
 
        if (le32_to_cpu(es->s_rev_level) > EXT4_MAX_SUPP_REV) {
-               printk (KERN_ERR "EXT4-fs warning: revision level too high, "
-                       "forcing read-only mode\n");
+               printk(KERN_ERR "EXT4-fs warning: revision level too high, "
+                      "forcing read-only mode\n");
                res = MS_RDONLY;
        }
        if (read_only)
                return res;
        if (!(sbi->s_mount_state & EXT4_VALID_FS))
-               printk (KERN_WARNING "EXT4-fs warning: mounting unchecked fs, "
-                       "running e2fsck is recommended\n");
+               printk(KERN_WARNING "EXT4-fs warning: mounting unchecked fs, "
+                      "running e2fsck is recommended\n");
        else if ((sbi->s_mount_state & EXT4_ERROR_FS))
-               printk (KERN_WARNING
-                       "EXT4-fs warning: mounting fs with errors, "
-                       "running e2fsck is recommended\n");
+               printk(KERN_WARNING
+                      "EXT4-fs warning: mounting fs with errors, "
+                      "running e2fsck is recommended\n");
        else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
                 le16_to_cpu(es->s_mnt_count) >=
                 (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
-               printk (KERN_WARNING
-                       "EXT4-fs warning: maximal mount count reached, "
-                       "running e2fsck is recommended\n");
+               printk(KERN_WARNING
+                      "EXT4-fs warning: maximal mount count reached, "
+                      "running e2fsck is recommended\n");
        else if (le32_to_cpu(es->s_checkinterval) &&
                (le32_to_cpu(es->s_lastcheck) +
                        le32_to_cpu(es->s_checkinterval) <= get_seconds()))
-               printk (KERN_WARNING
-                       "EXT4-fs warning: checktime reached, "
-                       "running e2fsck is recommended\n");
+               printk(KERN_WARNING
+                      "EXT4-fs warning: checktime reached, "
+                      "running e2fsck is recommended\n");
 #if 0
                /* @@@ We _will_ want to clear the valid bit if we find
                 * inconsistencies, to force a fsck at reboot.  But for
@@ -1506,14 +1505,13 @@ static int ext4_fill_flex_info(struct super_block *sb)
 
        flex_group_count = (sbi->s_groups_count + groups_per_flex - 1) /
                groups_per_flex;
-       sbi->s_flex_groups = kmalloc(flex_group_count *
+       sbi->s_flex_groups = kzalloc(flex_group_count *
                                     sizeof(struct flex_groups), GFP_KERNEL);
        if (sbi->s_flex_groups == NULL) {
-               printk(KERN_ERR "EXT4-fs: not enough memory\n");
+               printk(KERN_ERR "EXT4-fs: not enough memory for "
+                               "%lu flex groups\n", flex_group_count);
                goto failed;
        }
-       memset(sbi->s_flex_groups, 0, flex_group_count *
-              sizeof(struct flex_groups));
 
        gdp = ext4_get_group_desc(sb, 1, &bh);
        block_bitmap = ext4_block_bitmap(sb, gdp) - 1;
@@ -1597,16 +1595,14 @@ static int ext4_check_descriptors(struct super_block *sb)
                                (EXT4_BLOCKS_PER_GROUP(sb) - 1);
 
                block_bitmap = ext4_block_bitmap(sb, gdp);
-               if (block_bitmap < first_block || block_bitmap > last_block)
-               {
+               if (block_bitmap < first_block || block_bitmap > last_block) {
                        printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
                               "Block bitmap for group %lu not in group "
                               "(block %llu)!", i, block_bitmap);
                        return 0;
                }
                inode_bitmap = ext4_inode_bitmap(sb, gdp);
-               if (inode_bitmap < first_block || inode_bitmap > last_block)
-               {
+               if (inode_bitmap < first_block || inode_bitmap > last_block) {
                        printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
                               "Inode bitmap for group %lu not in group "
                               "(block %llu)!", i, inode_bitmap);
@@ -1614,26 +1610,28 @@ static int ext4_check_descriptors(struct super_block *sb)
                }
                inode_table = ext4_inode_table(sb, gdp);
                if (inode_table < first_block ||
-                   inode_table + sbi->s_itb_per_group - 1 > last_block)
-               {
+                   inode_table + sbi->s_itb_per_group - 1 > last_block) {
                        printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
                               "Inode table for group %lu not in group "
                               "(block %llu)!", i, inode_table);
                        return 0;
                }
+               spin_lock(sb_bgl_lock(sbi, i));
                if (!ext4_group_desc_csum_verify(sbi, i, gdp)) {
                        printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
                               "Checksum for group %lu failed (%u!=%u)\n",
                               i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
                               gdp)), le16_to_cpu(gdp->bg_checksum));
-                       return 0;
+                       if (!(sb->s_flags & MS_RDONLY))
+                               return 0;
                }
+               spin_unlock(sb_bgl_lock(sbi, i));
                if (!flexbg_flag)
                        first_block += EXT4_BLOCKS_PER_GROUP(sb);
        }
 
        ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb));
-       sbi->s_es->s_free_inodes_count=cpu_to_le32(ext4_count_free_inodes(sb));
+       sbi->s_es->s_free_inodes_count = cpu_to_le32(ext4_count_free_inodes(sb));
        return 1;
 }
 
@@ -1654,8 +1652,8 @@ static int ext4_check_descriptors(struct super_block *sb)
  * e2fsck was run on this filesystem, and it must have already done the orphan
  * inode cleanup for us, so we can safely abort without any further action.
  */
-static void ext4_orphan_cleanup (struct super_block * sb,
-                                struct ext4_super_block * es)
+static void ext4_orphan_cleanup(struct super_block *sb,
+                               struct ext4_super_block *es)
 {
        unsigned int s_flags = sb->s_flags;
        int nr_orphans = 0, nr_truncates = 0;
@@ -1732,7 +1730,7 @@ static void ext4_orphan_cleanup (struct super_block * sb,
                iput(inode);  /* The delete magic happens here! */
        }
 
-#define PLURAL(x) (x), ((x)==1) ? "" : "s"
+#define PLURAL(x) (x), ((x) == 1) ? "" : "s"
 
        if (nr_orphans)
                printk(KERN_INFO "EXT4-fs: %s: %d orphan inode%s deleted\n",
@@ -1899,12 +1897,12 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)
        return 0;
 }
 
-static int ext4_fill_super (struct super_block *sb, void *data, int silent)
+static int ext4_fill_super(struct super_block *sb, void *data, int silent)
                                __releases(kernel_lock)
                                __acquires(kernel_lock)
 
 {
-       struct buffer_head * bh;
+       struct buffer_head *bh;
        struct ext4_super_block *es = NULL;
        struct ext4_sb_info *sbi;
        ext4_fsblk_t block;
@@ -1953,7 +1951,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        }
 
        if (!(bh = sb_bread(sb, logical_sb_block))) {
-               printk (KERN_ERR "EXT4-fs: unable to read superblock\n");
+               printk(KERN_ERR "EXT4-fs: unable to read superblock\n");
                goto out_fail;
        }
        /*
@@ -2026,8 +2024,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        set_opt(sbi->s_mount_opt, DELALLOC);
 
 
-       if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
-                           NULL, 0))
+       if (!parse_options((char *) data, sb, &journal_inum, &journal_devnum,
+                          NULL, 0))
                goto failed_mount;
 
        sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
@@ -2102,7 +2100,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                        goto failed_mount;
                }
 
-               brelse (bh);
+               brelse(bh);
                logical_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE;
                offset = do_div(logical_sb_block, blocksize);
                bh = sb_bread(sb, logical_sb_block);
@@ -2114,8 +2112,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                es = (struct ext4_super_block *)(((char *)bh->b_data) + offset);
                sbi->s_es = es;
                if (es->s_magic != cpu_to_le16(EXT4_SUPER_MAGIC)) {
-                       printk (KERN_ERR
-                               "EXT4-fs: Magic mismatch, very weird !\n");
+                       printk(KERN_ERR
+                              "EXT4-fs: Magic mismatch, very weird !\n");
                        goto failed_mount;
                }
        }
@@ -2132,9 +2130,9 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) ||
                    (!is_power_of_2(sbi->s_inode_size)) ||
                    (sbi->s_inode_size > blocksize)) {
-                       printk (KERN_ERR
-                               "EXT4-fs: unsupported inode size: %d\n",
-                               sbi->s_inode_size);
+                       printk(KERN_ERR
+                              "EXT4-fs: unsupported inode size: %d\n",
+                              sbi->s_inode_size);
                        goto failed_mount;
                }
                if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE)
@@ -2166,20 +2164,20 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        sbi->s_mount_state = le16_to_cpu(es->s_state);
        sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
        sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
-       for (i=0; i < 4; i++)
+       for (i = 0; i < 4; i++)
                sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
        sbi->s_def_hash_version = es->s_def_hash_version;
 
        if (sbi->s_blocks_per_group > blocksize * 8) {
-               printk (KERN_ERR
-                       "EXT4-fs: #blocks per group too big: %lu\n",
-                       sbi->s_blocks_per_group);
+               printk(KERN_ERR
+                      "EXT4-fs: #blocks per group too big: %lu\n",
+                      sbi->s_blocks_per_group);
                goto failed_mount;
        }
        if (sbi->s_inodes_per_group > blocksize * 8) {
-               printk (KERN_ERR
-                       "EXT4-fs: #inodes per group too big: %lu\n",
-                       sbi->s_inodes_per_group);
+               printk(KERN_ERR
+                      "EXT4-fs: #inodes per group too big: %lu\n",
+                      sbi->s_inodes_per_group);
                goto failed_mount;
        }
 
@@ -2213,10 +2211,10 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        sbi->s_groups_count = blocks_count;
        db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
                   EXT4_DESC_PER_BLOCK(sb);
-       sbi->s_group_desc = kmalloc(db_count * sizeof (struct buffer_head *),
+       sbi->s_group_desc = kmalloc(db_count * sizeof(struct buffer_head *),
                                    GFP_KERNEL);
        if (sbi->s_group_desc == NULL) {
-               printk (KERN_ERR "EXT4-fs: not enough memory\n");
+               printk(KERN_ERR "EXT4-fs: not enough memory\n");
                goto failed_mount;
        }
 
@@ -2226,13 +2224,13 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                block = descriptor_loc(sb, logical_sb_block, i);
                sbi->s_group_desc[i] = sb_bread(sb, block);
                if (!sbi->s_group_desc[i]) {
-                       printk (KERN_ERR "EXT4-fs: "
-                               "can't read group descriptor %d\n", i);
+                       printk(KERN_ERR "EXT4-fs: "
+                              "can't read group descriptor %d\n", i);
                        db_count = i;
                        goto failed_mount2;
                }
        }
-       if (!ext4_check_descriptors (sb)) {
+       if (!ext4_check_descriptors(sb)) {
                printk(KERN_ERR "EXT4-fs: group descriptors corrupted!\n");
                goto failed_mount2;
        }
@@ -2308,11 +2306,11 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                    EXT4_SB(sb)->s_journal->j_failed_commit) {
                        printk(KERN_CRIT "EXT4-fs error (device %s): "
                               "ext4_fill_super: Journal transaction "
-                              "%u is corrupt\n", sb->s_id, 
+                              "%u is corrupt\n", sb->s_id,
                               EXT4_SB(sb)->s_journal->j_failed_commit);
-                       if (test_opt (sb, ERRORS_RO)) {
-                               printk (KERN_CRIT
-                                       "Mounting filesystem read-only\n");
+                       if (test_opt(sb, ERRORS_RO)) {
+                               printk(KERN_CRIT
+                                      "Mounting filesystem read-only\n");
                                sb->s_flags |= MS_RDONLY;
                                EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
                                es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
@@ -2332,9 +2330,9 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                        goto failed_mount3;
        } else {
                if (!silent)
-                       printk (KERN_ERR
-                               "ext4: No journal on filesystem on %s\n",
-                               sb->s_id);
+                       printk(KERN_ERR
+                              "ext4: No journal on filesystem on %s\n",
+                              sb->s_id);
                goto failed_mount3;
        }
 
@@ -2418,7 +2416,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                goto failed_mount4;
        }
 
-       ext4_setup_super (sb, es, sb->s_flags & MS_RDONLY);
+       ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
 
        /* determine the minimum size of new large inodes, if present */
        if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
@@ -2457,12 +2455,12 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        ext4_orphan_cleanup(sb, es);
        EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS;
        if (needs_recovery)
-               printk (KERN_INFO "EXT4-fs: recovery complete.\n");
+               printk(KERN_INFO "EXT4-fs: recovery complete.\n");
        ext4_mark_recovery_complete(sb, es);
-       printk (KERN_INFO "EXT4-fs: mounted filesystem with %s data mode.\n",
-               test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ? "journal":
-               test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered":
-               "writeback");
+       printk(KERN_INFO "EXT4-fs: mounted filesystem with %s data mode.\n",
+              test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ? "journal":
+              test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered":
+              "writeback");
 
        if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
                printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - "
@@ -2575,14 +2573,14 @@ static journal_t *ext4_get_journal(struct super_block *sb,
 static journal_t *ext4_get_dev_journal(struct super_block *sb,
                                       dev_t j_dev)
 {
-       struct buffer_head * bh;
+       struct buffer_head *bh;
        journal_t *journal;
        ext4_fsblk_t start;
        ext4_fsblk_t len;
        int hblock, blocksize;
        ext4_fsblk_t sb_block;
        unsigned long offset;
-       struct ext4_super_block * es;
+       struct ext4_super_block *es;
        struct block_device *bdev;
 
        bdev = ext4_blkdev_get(j_dev);
@@ -2697,8 +2695,8 @@ static int ext4_load_journal(struct super_block *sb,
                                        "unavailable, cannot proceed.\n");
                                return -EROFS;
                        }
-                       printk (KERN_INFO "EXT4-fs: write access will "
-                                       "be enabled during recovery.\n");
+                       printk(KERN_INFO "EXT4-fs: write access will "
+                              "be enabled during recovery.\n");
                }
        }
 
@@ -2751,8 +2749,8 @@ static int ext4_load_journal(struct super_block *sb,
        return 0;
 }
 
-static int ext4_create_journal(struct super_block * sb,
-                              struct ext4_super_block * es,
+static int ext4_create_journal(struct super_block *sb,
+                              struct ext4_super_block *es,
                               unsigned int journal_inum)
 {
        journal_t *journal;
@@ -2793,9 +2791,8 @@ static int ext4_create_journal(struct super_block * sb,
        return 0;
 }
 
-static void ext4_commit_super (struct super_block * sb,
-                              struct ext4_super_block * es,
-                              int sync)
+static void ext4_commit_super(struct super_block *sb,
+                             struct ext4_super_block *es, int sync)
 {
        struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
 
@@ -2816,8 +2813,8 @@ static void ext4_commit_super (struct super_block * sb,
  * remounting) the filesystem readonly, then we will end up with a
  * consistent fs on disk.  Record that fact.
  */
-static void ext4_mark_recovery_complete(struct super_block * sb,
-                                       struct ext4_super_block * es)
+static void ext4_mark_recovery_complete(struct super_block *sb,
+                                       struct ext4_super_block *es)
 {
        journal_t *journal = EXT4_SB(sb)->s_journal;
 
@@ -2839,8 +2836,8 @@ static void ext4_mark_recovery_complete(struct super_block * sb,
  * has recorded an error from a previous lifetime, move that error to the
  * main filesystem now.
  */
-static void ext4_clear_journal_err(struct super_block * sb,
-                                  struct ext4_super_block * es)
+static void ext4_clear_journal_err(struct super_block *sb,
+                                  struct ext4_super_block *es)
 {
        journal_t *journal;
        int j_errno;
@@ -2865,7 +2862,7 @@ static void ext4_clear_journal_err(struct super_block * sb,
 
                EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
                es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
-               ext4_commit_super (sb, es, 1);
+               ext4_commit_super(sb, es, 1);
 
                jbd2_journal_clear_err(journal);
        }
@@ -2898,7 +2895,7 @@ int ext4_force_commit(struct super_block *sb)
  * This implicitly triggers the writebehind on sync().
  */
 
-static void ext4_write_super (struct super_block * sb)
+static void ext4_write_super(struct super_block *sb)
 {
        if (mutex_trylock(&sb->s_lock) != 0)
                BUG();
@@ -2954,13 +2951,14 @@ static void ext4_unlockfs(struct super_block *sb)
        }
 }
 
-static int ext4_remount (struct super_block * sb, int * flags, char * data)
+static int ext4_remount(struct super_block *sb, int *flags, char *data)
 {
-       struct ext4_super_block * es;
+       struct ext4_super_block *es;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        ext4_fsblk_t n_blocks_count = 0;
        unsigned long old_sb_flags;
        struct ext4_mount_options old_opts;
+       ext4_group_t g;
        int err;
 #ifdef CONFIG_QUOTA
        int i;
@@ -3038,6 +3036,26 @@ static int ext4_remount (struct super_block * sb, int * flags, char * data)
                                goto restore_opts;
                        }
 
+                       /*
+                        * Make sure the group descriptor checksums
+                        * are sane.  If they aren't, refuse to
+                        * remount r/w.
+                        */
+                       for (g = 0; g < sbi->s_groups_count; g++) {
+                               struct ext4_group_desc *gdp =
+                                       ext4_get_group_desc(sb, g, NULL);
+
+                               if (!ext4_group_desc_csum_verify(sbi, g, gdp)) {
+                                       printk(KERN_ERR
+              "EXT4-fs: ext4_remount: "
+               "Checksum for group %lu failed (%u!=%u)\n",
+               g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)),
+                                              le16_to_cpu(gdp->bg_checksum));
+                                       err = -EINVAL;
+                                       goto restore_opts;
+                               }
+                       }
+
                        /*
                         * If we have an unprocessed orphan list hanging
                         * around from a previously readonly bdev mount,
@@ -3063,7 +3081,7 @@ static int ext4_remount (struct super_block * sb, int * flags, char * data)
                        sbi->s_mount_state = le16_to_cpu(es->s_state);
                        if ((err = ext4_group_extend(sb, es, n_blocks_count)))
                                goto restore_opts;
-                       if (!ext4_setup_super (sb, es, 0))
+                       if (!ext4_setup_super(sb, es, 0))
                                sb->s_flags &= ~MS_RDONLY;
                }
        }
@@ -3093,7 +3111,7 @@ restore_opts:
        return err;
 }
 
-static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
+static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
        struct super_block *sb = dentry->d_sb;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -3331,12 +3349,12 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
        }
        /* Journaling quota? */
        if (EXT4_SB(sb)->s_qf_names[type]) {
-               /* Quotafile not of fs root? */
+               /* Quotafile not in fs root? */
                if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
                        printk(KERN_WARNING
                                "EXT4-fs: Quota file not on filesystem root. "
                                "Journaled quota will not work.\n");
-       }
+       }
 
        /*
         * When we journal data on quota file, we have to flush journal to see
@@ -3352,8 +3370,9 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
                jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
        }
 
+       err = vfs_quota_on_path(sb, type, format_id, &nd.path);
        path_put(&nd.path);
-       return vfs_quota_on(sb, type, format_id, path, remount);
+       return err;
 }
 
 /* Read data from quotafile - avoid pagecache and such because we cannot afford
index 93c5fdcdad2e3beae27e16f0c35830ce11d20db3..8954208b489328a662b68803caa8b2b9e5b59daf 100644 (file)
@@ -1512,7 +1512,7 @@ static inline void ext4_xattr_hash_entry(struct ext4_xattr_header *header,
        char *name = entry->e_name;
        int n;
 
-       for (n=0; n < entry->e_name_len; n++) {
+       for (n = 0; n < entry->e_name_len; n++) {
                hash = (hash << NAME_HASH_SHIFT) ^
                       (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^
                       *name++;
index 8707a8cfa02cdd8454056ed320ee49a4604c84f8..ddde37025ca674827d5dafe836a0956c70648f06 100644 (file)
@@ -313,6 +313,8 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
        return 0;
 }
 
+#define TIMES_SET_FLAGS        (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
+
 int fat_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
@@ -336,9 +338,9 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
 
        /* Check for setting the inode time. */
        ia_valid = attr->ia_valid;
-       if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) {
+       if (ia_valid & TIMES_SET_FLAGS) {
                if (fat_allow_set_time(sbi, inode))
-                       attr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET);
+                       attr->ia_valid &= ~TIMES_SET_FLAGS;
        }
 
        error = inode_change_ok(inode, attr);
index 61d625136813648c3ced7aa4c6daf344d6700e43..ac4f7db9f13452790e4d41daa8e6fc9633506259 100644 (file)
@@ -49,73 +49,6 @@ static int get_close_on_exec(unsigned int fd)
        return res;
 }
 
-/*
- * locate_fd finds a free file descriptor in the open_fds fdset,
- * expanding the fd arrays if necessary.  Must be called with the
- * file_lock held for write.
- */
-
-static int locate_fd(unsigned int orig_start, int cloexec)
-{
-       struct files_struct *files = current->files;
-       unsigned int newfd;
-       unsigned int start;
-       int error;
-       struct fdtable *fdt;
-
-       spin_lock(&files->file_lock);
-repeat:
-       fdt = files_fdtable(files);
-       /*
-        * Someone might have closed fd's in the range
-        * orig_start..fdt->next_fd
-        */
-       start = orig_start;
-       if (start < files->next_fd)
-               start = files->next_fd;
-
-       newfd = start;
-       if (start < fdt->max_fds)
-               newfd = find_next_zero_bit(fdt->open_fds->fds_bits,
-                                          fdt->max_fds, start);
-
-       error = expand_files(files, newfd);
-       if (error < 0)
-               goto out;
-
-       /*
-        * If we needed to expand the fs array we
-        * might have blocked - try again.
-        */
-       if (error)
-               goto repeat;
-
-       if (start <= files->next_fd)
-               files->next_fd = newfd + 1;
-
-       FD_SET(newfd, fdt->open_fds);
-       if (cloexec)
-               FD_SET(newfd, fdt->close_on_exec);
-       else
-               FD_CLR(newfd, fdt->close_on_exec);
-       error = newfd;
-
-out:
-       spin_unlock(&files->file_lock);
-       return error;
-}
-
-static int dupfd(struct file *file, unsigned int start, int cloexec)
-{
-       int fd = locate_fd(start, cloexec);
-       if (fd >= 0)
-               fd_install(fd, file);
-       else
-               fput(file);
-
-       return fd;
-}
-
 asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
 {
        int err = -EBADF;
@@ -130,31 +63,35 @@ asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
                return -EINVAL;
 
        spin_lock(&files->file_lock);
-       if (!(file = fcheck(oldfd)))
-               goto out_unlock;
-       get_file(file);                 /* We are now finished with oldfd */
-
        err = expand_files(files, newfd);
+       file = fcheck(oldfd);
+       if (unlikely(!file))
+               goto Ebadf;
        if (unlikely(err < 0)) {
                if (err == -EMFILE)
-                       err = -EBADF;
-               goto out_fput;
+                       goto Ebadf;
+               goto out_unlock;
        }
-
-       /* To avoid races with open() and dup(), we will mark the fd as
-        * in-use in the open-file bitmap throughout the entire dup2()
-        * process.  This is quite safe: do_close() uses the fd array
-        * entry, not the bitmap, to decide what work needs to be
-        * done.  --sct */
-       /* Doesn't work. open() might be there first. --AV */
-
-       /* Yes. It's a race. In user space. Nothing sane to do */
+       /*
+        * We need to detect attempts to do dup2() over allocated but still
+        * not finished descriptor.  NB: OpenBSD avoids that at the price of
+        * extra work in their equivalent of fget() - they insert struct
+        * file immediately after grabbing descriptor, mark it larval if
+        * more work (e.g. actual opening) is needed and make sure that
+        * fget() treats larval files as absent.  Potentially interesting,
+        * but while extra work in fget() is trivial, locking implications
+        * and amount of surgery on open()-related paths in VFS are not.
+        * FreeBSD fails with -EBADF in the same situation, NetBSD "solution"
+        * deadlocks in rather amusing ways, AFAICS.  All of that is out of
+        * scope of POSIX or SUS, since neither considers shared descriptor
+        * tables and this condition does not arise without those.
+        */
        err = -EBUSY;
        fdt = files_fdtable(files);
        tofree = fdt->fd[newfd];
        if (!tofree && FD_ISSET(newfd, fdt->open_fds))
-               goto out_fput;
-
+               goto out_unlock;
+       get_file(file);
        rcu_assign_pointer(fdt->fd[newfd], file);
        FD_SET(newfd, fdt->open_fds);
        if (flags & O_CLOEXEC)
@@ -165,17 +102,14 @@ asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
 
        if (tofree)
                filp_close(tofree, files);
-       err = newfd;
-out:
-       return err;
-out_unlock:
-       spin_unlock(&files->file_lock);
-       goto out;
 
-out_fput:
+       return newfd;
+
+Ebadf:
+       err = -EBADF;
+out_unlock:
        spin_unlock(&files->file_lock);
-       fput(file);
-       goto out;
+       return err;
 }
 
 asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
@@ -194,10 +128,15 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
 asmlinkage long sys_dup(unsigned int fildes)
 {
        int ret = -EBADF;
-       struct file * file = fget(fildes);
-
-       if (file)
-               ret = dupfd(file, 0, 0);
+       struct file *file = fget(fildes);
+
+       if (file) {
+               ret = get_unused_fd();
+               if (ret >= 0)
+                       fd_install(ret, file);
+               else
+                       fput(file);
+       }
        return ret;
 }
 
@@ -322,8 +261,11 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
        case F_DUPFD_CLOEXEC:
                if (arg >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur)
                        break;
-               get_file(filp);
-               err = dupfd(filp, arg, cmd == F_DUPFD_CLOEXEC);
+               err = alloc_fd(arg, cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0);
+               if (err >= 0) {
+                       get_file(filp);
+                       fd_install(err, filp);
+               }
                break;
        case F_GETFD:
                err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;
index d8773b19fe47fd23d6bbec2149679b123a79c139..f313314f996fcaeb4457c04d64fd8eae25338423 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -6,6 +6,7 @@
  *  Manage the dynamic fd arrays in the process files_struct.
  */
 
+#include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/time.h>
@@ -432,3 +433,63 @@ struct files_struct init_files = {
        },
        .file_lock      = __SPIN_LOCK_UNLOCKED(init_task.file_lock),
 };
+
+/*
+ * allocate a file descriptor, mark it busy.
+ */
+int alloc_fd(unsigned start, unsigned flags)
+{
+       struct files_struct *files = current->files;
+       unsigned int fd;
+       int error;
+       struct fdtable *fdt;
+
+       spin_lock(&files->file_lock);
+repeat:
+       fdt = files_fdtable(files);
+       fd = start;
+       if (fd < files->next_fd)
+               fd = files->next_fd;
+
+       if (fd < fdt->max_fds)
+               fd = find_next_zero_bit(fdt->open_fds->fds_bits,
+                                          fdt->max_fds, fd);
+
+       error = expand_files(files, fd);
+       if (error < 0)
+               goto out;
+
+       /*
+        * If we needed to expand the fs array we
+        * might have blocked - try again.
+        */
+       if (error)
+               goto repeat;
+
+       if (start <= files->next_fd)
+               files->next_fd = fd + 1;
+
+       FD_SET(fd, fdt->open_fds);
+       if (flags & O_CLOEXEC)
+               FD_SET(fd, fdt->close_on_exec);
+       else
+               FD_CLR(fd, fdt->close_on_exec);
+       error = fd;
+#if 1
+       /* Sanity check */
+       if (rcu_dereference(fdt->fd[fd]) != NULL) {
+               printk(KERN_WARNING "alloc_fd: slot %d not NULL!\n", fd);
+               rcu_assign_pointer(fdt->fd[fd], NULL);
+       }
+#endif
+
+out:
+       spin_unlock(&files->file_lock);
+       return error;
+}
+
+int get_unused_fd(void)
+{
+       return alloc_fd(0, 0);
+}
+EXPORT_SYMBOL(get_unused_fd);
index f8b3be8732262f1642c0a1b4e19399bd048b964f..adf0395f318e9d040e314a06ea84285ab5e6e5e4 100644 (file)
@@ -262,8 +262,18 @@ static int journal_finish_inode_data_buffers(journal_t *journal,
                jinode->i_flags |= JI_COMMIT_RUNNING;
                spin_unlock(&journal->j_list_lock);
                err = filemap_fdatawait(jinode->i_vfs_inode->i_mapping);
-               if (!ret)
-                       ret = err;
+               if (err) {
+                       /*
+                        * Because AS_EIO is cleared by
+                        * wait_on_page_writeback_range(), set it again so
+                        * that user process can get -EIO from fsync().
+                        */
+                       set_bit(AS_EIO,
+                               &jinode->i_vfs_inode->i_mapping->flags);
+
+                       if (!ret)
+                               ret = err;
+               }
                spin_lock(&journal->j_list_lock);
                jinode->i_flags &= ~JI_COMMIT_RUNNING;
                wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);
@@ -670,8 +680,14 @@ start_journal_io:
         * commit block, which happens below in such setting.
         */
        err = journal_finish_inode_data_buffers(journal, commit_transaction);
-       if (err)
-               jbd2_journal_abort(journal, err);
+       if (err) {
+               char b[BDEVNAME_SIZE];
+
+               printk(KERN_WARNING
+                       "JBD2: Detected IO errors while flushing file data "
+                       "on %s\n", bdevname(journal->j_fs_dev, b));
+               err = 0;
+       }
 
        /* Lo and behold: we have just managed to send a transaction to
            the log.  Before we can commit it, wait for the IO so far to
index b26c6d9fe6aeaeadb241e5b187dcb1ac75bc8884..8207a01c4edbea2d28747d93cf069d526c446aed 100644 (file)
@@ -68,7 +68,6 @@ EXPORT_SYMBOL(jbd2_journal_set_features);
 EXPORT_SYMBOL(jbd2_journal_create);
 EXPORT_SYMBOL(jbd2_journal_load);
 EXPORT_SYMBOL(jbd2_journal_destroy);
-EXPORT_SYMBOL(jbd2_journal_update_superblock);
 EXPORT_SYMBOL(jbd2_journal_abort);
 EXPORT_SYMBOL(jbd2_journal_errno);
 EXPORT_SYMBOL(jbd2_journal_ack_err);
index 629af01e5ade432c33c3c06506e6bc557125da08..6caf1e1ee26d33951e2d013c4710ed3b21c9d3e2 100644 (file)
@@ -23,6 +23,8 @@
 
 int jffs2_sum_init(struct jffs2_sb_info *c)
 {
+       uint32_t sum_size = max_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);
+
        c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
 
        if (!c->summary) {
@@ -30,7 +32,7 @@ int jffs2_sum_init(struct jffs2_sb_info *c)
                return -ENOMEM;
        }
 
-       c->summary->sum_buf = vmalloc(c->sector_size);
+       c->summary->sum_buf = kmalloc(sum_size, GFP_KERNEL);
 
        if (!c->summary->sum_buf) {
                JFFS2_WARNING("Can't allocate buffer for writing out summary information!\n");
@@ -49,7 +51,7 @@ void jffs2_sum_exit(struct jffs2_sb_info *c)
 
        jffs2_sum_disable_collecting(c->summary);
 
-       vfree(c->summary->sum_buf);
+       kfree(c->summary->sum_buf);
        c->summary->sum_buf = NULL;
 
        kfree(c->summary);
@@ -665,7 +667,7 @@ crc_err:
 /* Write summary data to flash - helper function for jffs2_sum_write_sumnode() */
 
 static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,
-                                       uint32_t infosize, uint32_t datasize, int padsize)
+                               uint32_t infosize, uint32_t datasize, int padsize)
 {
        struct jffs2_raw_summary isum;
        union jffs2_sum_mem *temp;
@@ -676,6 +678,26 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
        int ret;
        size_t retlen;
 
+       if (padsize + datasize > MAX_SUMMARY_SIZE) {
+               /* It won't fit in the buffer. Abort summary for this jeb */
+               jffs2_sum_disable_collecting(c->summary);
+
+               JFFS2_WARNING("Summary too big (%d data, %d pad) in eraseblock at %08x\n",
+                             datasize, padsize, jeb->offset);
+               /* Non-fatal */
+               return 0;
+       }
+       /* Is there enough space for summary? */
+       if (padsize < 0) {
+               /* don't try to write out summary for this jeb */
+               jffs2_sum_disable_collecting(c->summary);
+
+               JFFS2_WARNING("Not enough space for summary, padsize = %d\n",
+                             padsize);
+               /* Non-fatal */
+               return 0;
+       }
+
        memset(c->summary->sum_buf, 0xff, datasize);
        memset(&isum, 0, sizeof(isum));
 
@@ -821,7 +843,7 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
 {
        int datasize, infosize, padsize;
        struct jffs2_eraseblock *jeb;
-       int ret;
+       int ret = 0;
 
        dbg_summary("called\n");
 
@@ -841,16 +863,6 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
        infosize += padsize;
        datasize += padsize;
 
-       /* Is there enough space for summary? */
-       if (padsize < 0) {
-               /* don't try to write out summary for this jeb */
-               jffs2_sum_disable_collecting(c->summary);
-
-               JFFS2_WARNING("Not enough space for summary, padsize = %d\n", padsize);
-               spin_lock(&c->erase_completion_lock);
-               return 0;
-       }
-
        ret = jffs2_sum_write_data(c, jeb, infosize, datasize, padsize);
        spin_lock(&c->erase_completion_lock);
        return ret;
index 8bf34f2fa5ce30b6f50f9d16de3ad5b9df31195e..60207a2ae952777ee80445edddb9e57b8fc976e5 100644 (file)
 #ifndef JFFS2_SUMMARY_H
 #define JFFS2_SUMMARY_H
 
+/* Limit summary size to 64KiB so that we can kmalloc it. If the summary
+   is larger than that, we have to just ditch it and avoid using summary
+   for the eraseblock in question... and it probably doesn't hurt us much
+   anyway. */
+#define MAX_SUMMARY_SIZE 65536
+
 #include <linux/uio.h>
 #include <linux/jffs2.h>
 
index a7b0a0b8012873dd1c8db6fe79c45b459096af41..4ea63ed5e79100d991e5f25656a263b04a29e611 100644 (file)
@@ -274,7 +274,7 @@ int inode_permission(struct inode *inode, int mask)
                return retval;
 
        return security_inode_permission(inode,
-                       mask & (MAY_READ|MAY_WRITE|MAY_EXEC));
+                       mask & (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND));
 }
 
 /**
@@ -1431,8 +1431,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
  *  3. We should have write and exec permissions on dir
  *  4. We can't do it if dir is immutable (done in permission())
  */
-static inline int may_create(struct inode *dir, struct dentry *child,
-                            struct nameidata *nd)
+static inline int may_create(struct inode *dir, struct dentry *child)
 {
        if (child->d_inode)
                return -EEXIST;
@@ -1504,7 +1503,7 @@ void unlock_rename(struct dentry *p1, struct dentry *p2)
 int vfs_create(struct inode *dir, struct dentry *dentry, int mode,
                struct nameidata *nd)
 {
-       int error = may_create(dir, dentry, nd);
+       int error = may_create(dir, dentry);
 
        if (error)
                return error;
@@ -1948,7 +1947,7 @@ EXPORT_SYMBOL_GPL(lookup_create);
 
 int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
 {
-       int error = may_create(dir, dentry, NULL);
+       int error = may_create(dir, dentry);
 
        if (error)
                return error;
@@ -2049,7 +2048,7 @@ asmlinkage long sys_mknod(const char __user *filename, int mode, unsigned dev)
 
 int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 {
-       int error = may_create(dir, dentry, NULL);
+       int error = may_create(dir, dentry);
 
        if (error)
                return error;
@@ -2316,7 +2315,7 @@ asmlinkage long sys_unlink(const char __user *pathname)
 
 int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
 {
-       int error = may_create(dir, dentry, NULL);
+       int error = may_create(dir, dentry);
 
        if (error)
                return error;
@@ -2386,7 +2385,7 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
        if (!inode)
                return -ENOENT;
 
-       error = may_create(dir, new_dentry, NULL);
+       error = may_create(dir, new_dentry);
        if (error)
                return error;
 
@@ -2595,7 +2594,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                return error;
 
        if (!new_dentry->d_inode)
-               error = may_create(new_dir, new_dentry, NULL);
+               error = may_create(new_dir, new_dentry);
        else
                error = may_delete(new_dir, new_dentry, is_dir);
        if (error)
index 411728c0c8bb2b0ee1248d95106c32c1ad4ef36b..6e283c93b50dad95a723633b8f257c6d7dccefb7 100644 (file)
@@ -1667,31 +1667,31 @@ static noinline int do_new_mount(struct nameidata *nd, char *type, int flags,
        if (IS_ERR(mnt))
                return PTR_ERR(mnt);
 
-       return do_add_mount(mnt, nd, mnt_flags, NULL);
+       return do_add_mount(mnt, &nd->path, mnt_flags, NULL);
 }
 
 /*
  * add a mount into a namespace's mount tree
  * - provide the option of adding the new mount to an expiration list
  */
-int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
+int do_add_mount(struct vfsmount *newmnt, struct path *path,
                 int mnt_flags, struct list_head *fslist)
 {
        int err;
 
        down_write(&namespace_sem);
        /* Something was mounted here while we slept */
-       while (d_mountpoint(nd->path.dentry) &&
-              follow_down(&nd->path.mnt, &nd->path.dentry))
+       while (d_mountpoint(path->dentry) &&
+              follow_down(&path->mnt, &path->dentry))
                ;
        err = -EINVAL;
-       if (!check_mnt(nd->path.mnt))
+       if (!check_mnt(path->mnt))
                goto unlock;
 
        /* Refuse the same filesystem on the same mount point */
        err = -EBUSY;
-       if (nd->path.mnt->mnt_sb == newmnt->mnt_sb &&
-           nd->path.mnt->mnt_root == nd->path.dentry)
+       if (path->mnt->mnt_sb == newmnt->mnt_sb &&
+           path->mnt->mnt_root == path->dentry)
                goto unlock;
 
        err = -EINVAL;
@@ -1699,7 +1699,7 @@ int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
                goto unlock;
 
        newmnt->mnt_flags = mnt_flags;
-       if ((err = graft_tree(newmnt, &nd->path)))
+       if ((err = graft_tree(newmnt, path)))
                goto unlock;
 
        if (fslist) /* add to the specified expiration list */
index 2f285ef76399f227283146fc15d05a30508f6dbd..66df08dd1cafbb41cdbb7864128b0920e0c8dbd3 100644 (file)
@@ -129,7 +129,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
                goto out_err;
 
        mntget(mnt);
-       err = do_add_mount(mnt, nd, nd->path.mnt->mnt_flags|MNT_SHRINKABLE,
+       err = do_add_mount(mnt, &nd->path, nd->path.mnt->mnt_flags|MNT_SHRINKABLE,
                           &nfs_automount_list);
        if (err < 0) {
                mntput(mnt);
index 8478fc25daee196383f3e40a34999795be41585e..46763d1cd3976bca27f4d5dca5d3dd9e36d3453b 100644 (file)
@@ -127,7 +127,7 @@ enum {
        Opt_err
 };
 
-static match_table_t __initconst tokens = {
+static match_table_t __initdata tokens = {
        {Opt_port, "port=%u"},
        {Opt_rsize, "rsize=%u"},
        {Opt_wsize, "wsize=%u"},
index 1db080135c6d99436eb90c4dac46301535d4c3dc..506c24fb5078fe859a8b816e89239c7bb8818d4e 100644 (file)
@@ -1073,12 +1073,15 @@ static void ocfs2_write_failure(struct inode *inode,
        for(i = 0; i < wc->w_num_pages; i++) {
                tmppage = wc->w_pages[i];
 
-               if (ocfs2_should_order_data(inode))
-                       walk_page_buffers(wc->w_handle, page_buffers(tmppage),
-                                         from, to, NULL,
-                                         ocfs2_journal_dirty_data);
-
-               block_commit_write(tmppage, from, to);
+               if (page_has_buffers(tmppage)) {
+                       if (ocfs2_should_order_data(inode))
+                               walk_page_buffers(wc->w_handle,
+                                                 page_buffers(tmppage),
+                                                 from, to, NULL,
+                                                 ocfs2_journal_dirty_data);
+
+                       block_commit_write(tmppage, from, to);
+               }
        }
 }
 
@@ -1901,12 +1904,14 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
                        to = PAGE_CACHE_SIZE;
                }
 
-               if (ocfs2_should_order_data(inode))
-                       walk_page_buffers(wc->w_handle, page_buffers(tmppage),
-                                         from, to, NULL,
-                                         ocfs2_journal_dirty_data);
-
-               block_commit_write(tmppage, from, to);
+               if (page_has_buffers(tmppage)) {
+                       if (ocfs2_should_order_data(inode))
+                               walk_page_buffers(wc->w_handle,
+                                                 page_buffers(tmppage),
+                                                 from, to, NULL,
+                                                 ocfs2_journal_dirty_data);
+                       block_commit_write(tmppage, from, to);
+               }
        }
 
 out_write_size:
index be2dd95d3a1dc0c916229ad4deb643ed0ee841b0..ec2ed15c3daab10894cf249d698a834924d74651 100644 (file)
@@ -1766,8 +1766,8 @@ out_inode_unlock:
 out_rw_unlock:
        ocfs2_rw_unlock(inode, 1);
 
-       mutex_unlock(&inode->i_mutex);
 out:
+       mutex_unlock(&inode->i_mutex);
        return ret;
 }
 
index a8c19cb3cfdd874235d16fc3926c9f9e07bba794..7a37240f7a3117dce66ef2e7a67be76fd2156850 100644 (file)
@@ -57,7 +57,7 @@ static int __ocfs2_recovery_thread(void *arg);
 static int ocfs2_commit_cache(struct ocfs2_super *osb);
 static int ocfs2_wait_on_mount(struct ocfs2_super *osb);
 static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
-                                     int dirty);
+                                     int dirty, int replayed);
 static int ocfs2_trylock_journal(struct ocfs2_super *osb,
                                 int slot_num);
 static int ocfs2_recover_orphans(struct ocfs2_super *osb,
@@ -562,8 +562,18 @@ done:
        return status;
 }
 
+static void ocfs2_bump_recovery_generation(struct ocfs2_dinode *di)
+{
+       le32_add_cpu(&(di->id1.journal1.ij_recovery_generation), 1);
+}
+
+static u32 ocfs2_get_recovery_generation(struct ocfs2_dinode *di)
+{
+       return le32_to_cpu(di->id1.journal1.ij_recovery_generation);
+}
+
 static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
-                                     int dirty)
+                                     int dirty, int replayed)
 {
        int status;
        unsigned int flags;
@@ -593,6 +603,9 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
                flags &= ~OCFS2_JOURNAL_DIRTY_FL;
        fe->id1.journal1.ij_flags = cpu_to_le32(flags);
 
+       if (replayed)
+               ocfs2_bump_recovery_generation(fe);
+
        status = ocfs2_write_block(osb, bh, journal->j_inode);
        if (status < 0)
                mlog_errno(status);
@@ -667,7 +680,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
                 * Do not toggle if flush was unsuccessful otherwise
                 * will leave dirty metadata in a "clean" journal
                 */
-               status = ocfs2_journal_toggle_dirty(osb, 0);
+               status = ocfs2_journal_toggle_dirty(osb, 0, 0);
                if (status < 0)
                        mlog_errno(status);
        }
@@ -710,7 +723,7 @@ static void ocfs2_clear_journal_error(struct super_block *sb,
        }
 }
 
-int ocfs2_journal_load(struct ocfs2_journal *journal, int local)
+int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)
 {
        int status = 0;
        struct ocfs2_super *osb;
@@ -729,7 +742,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local)
 
        ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num);
 
-       status = ocfs2_journal_toggle_dirty(osb, 1);
+       status = ocfs2_journal_toggle_dirty(osb, 1, replayed);
        if (status < 0) {
                mlog_errno(status);
                goto done;
@@ -771,7 +784,7 @@ int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full)
                goto bail;
        }
 
-       status = ocfs2_journal_toggle_dirty(journal->j_osb, 0);
+       status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0);
        if (status < 0)
                mlog_errno(status);
 
@@ -1034,6 +1047,12 @@ restart:
        spin_unlock(&osb->osb_lock);
        mlog(0, "All nodes recovered\n");
 
+       /* Refresh all journal recovery generations from disk */
+       status = ocfs2_check_journals_nolocks(osb);
+       status = (status == -EROFS) ? 0 : status;
+       if (status < 0)
+               mlog_errno(status);
+
        ocfs2_super_unlock(osb, 1);
 
        /* We always run recovery on our own orphan dir - the dead
@@ -1096,6 +1115,42 @@ out:
        mlog_exit_void();
 }
 
+static int ocfs2_read_journal_inode(struct ocfs2_super *osb,
+                                   int slot_num,
+                                   struct buffer_head **bh,
+                                   struct inode **ret_inode)
+{
+       int status = -EACCES;
+       struct inode *inode = NULL;
+
+       BUG_ON(slot_num >= osb->max_slots);
+
+       inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
+                                           slot_num);
+       if (!inode || is_bad_inode(inode)) {
+               mlog_errno(status);
+               goto bail;
+       }
+       SET_INODE_JOURNAL(inode);
+
+       status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, bh, 0, inode);
+       if (status < 0) {
+               mlog_errno(status);
+               goto bail;
+       }
+
+       status = 0;
+
+bail:
+       if (inode) {
+               if (status || !ret_inode)
+                       iput(inode);
+               else
+                       *ret_inode = inode;
+       }
+       return status;
+}
+
 /* Does the actual journal replay and marks the journal inode as
  * clean. Will only replay if the journal inode is marked dirty. */
 static int ocfs2_replay_journal(struct ocfs2_super *osb,
@@ -1109,22 +1164,36 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
        struct ocfs2_dinode *fe;
        journal_t *journal = NULL;
        struct buffer_head *bh = NULL;
+       u32 slot_reco_gen;
 
-       inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
-                                           slot_num);
-       if (inode == NULL) {
-               status = -EACCES;
+       status = ocfs2_read_journal_inode(osb, slot_num, &bh, &inode);
+       if (status) {
                mlog_errno(status);
                goto done;
        }
-       if (is_bad_inode(inode)) {
-               status = -EACCES;
-               iput(inode);
-               inode = NULL;
-               mlog_errno(status);
+
+       fe = (struct ocfs2_dinode *)bh->b_data;
+       slot_reco_gen = ocfs2_get_recovery_generation(fe);
+       brelse(bh);
+       bh = NULL;
+
+       /*
+        * As the fs recovery is asynchronous, there is a small chance that
+        * another node mounted (and recovered) the slot before the recovery
+        * thread could get the lock. To handle that, we dirty read the journal
+        * inode for that slot to get the recovery generation. If it is
+        * different than what we expected, the slot has been recovered.
+        * If not, it needs recovery.
+        */
+       if (osb->slot_recovery_generations[slot_num] != slot_reco_gen) {
+               mlog(0, "Slot %u already recovered (old/new=%u/%u)\n", slot_num,
+                    osb->slot_recovery_generations[slot_num], slot_reco_gen);
+               osb->slot_recovery_generations[slot_num] = slot_reco_gen;
+               status = -EBUSY;
                goto done;
        }
-       SET_INODE_JOURNAL(inode);
+
+       /* Continue with recovery as the journal has not yet been recovered */
 
        status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
        if (status < 0) {
@@ -1138,9 +1207,12 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
        fe = (struct ocfs2_dinode *) bh->b_data;
 
        flags = le32_to_cpu(fe->id1.journal1.ij_flags);
+       slot_reco_gen = ocfs2_get_recovery_generation(fe);
 
        if (!(flags & OCFS2_JOURNAL_DIRTY_FL)) {
                mlog(0, "No recovery required for node %d\n", node_num);
+               /* Refresh recovery generation for the slot */
+               osb->slot_recovery_generations[slot_num] = slot_reco_gen;
                goto done;
        }
 
@@ -1188,6 +1260,11 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
        flags &= ~OCFS2_JOURNAL_DIRTY_FL;
        fe->id1.journal1.ij_flags = cpu_to_le32(flags);
 
+       /* Increment recovery generation to indicate successful recovery */
+       ocfs2_bump_recovery_generation(fe);
+       osb->slot_recovery_generations[slot_num] =
+                                       ocfs2_get_recovery_generation(fe);
+
        status = ocfs2_write_block(osb, bh, inode);
        if (status < 0)
                mlog_errno(status);
@@ -1252,6 +1329,13 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
 
        status = ocfs2_replay_journal(osb, node_num, slot_num);
        if (status < 0) {
+               if (status == -EBUSY) {
+                       mlog(0, "Skipping recovery for slot %u (node %u) "
+                            "as another node has recovered it\n", slot_num,
+                            node_num);
+                       status = 0;
+                       goto done;
+               }
                mlog_errno(status);
                goto done;
        }
@@ -1334,12 +1418,29 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb)
 {
        unsigned int node_num;
        int status, i;
+       struct buffer_head *bh = NULL;
+       struct ocfs2_dinode *di;
 
        /* This is called with the super block cluster lock, so we
         * know that the slot map can't change underneath us. */
 
        spin_lock(&osb->osb_lock);
        for (i = 0; i < osb->max_slots; i++) {
+               /* Read journal inode to get the recovery generation */
+               status = ocfs2_read_journal_inode(osb, i, &bh, NULL);
+               if (status) {
+                       mlog_errno(status);
+                       goto bail;
+               }
+               di = (struct ocfs2_dinode *)bh->b_data;
+               osb->slot_recovery_generations[i] =
+                                       ocfs2_get_recovery_generation(di);
+               brelse(bh);
+               bh = NULL;
+
+               mlog(0, "Slot %u recovery generation is %u\n", i,
+                    osb->slot_recovery_generations[i]);
+
                if (i == osb->slot_num)
                        continue;
 
@@ -1603,49 +1704,41 @@ static int ocfs2_commit_thread(void *arg)
        return 0;
 }
 
-/* Look for a dirty journal without taking any cluster locks. Used for
- * hard readonly access to determine whether the file system journals
- * require recovery. */
+/* Reads all the journal inodes without taking any cluster locks. Used
+ * for hard readonly access to determine whether any journal requires
+ * recovery. Also used to refresh the recovery generation numbers after
+ * a journal has been recovered by another node.
+ */
 int ocfs2_check_journals_nolocks(struct ocfs2_super *osb)
 {
        int ret = 0;
        unsigned int slot;
-       struct buffer_head *di_bh;
+       struct buffer_head *di_bh = NULL;
        struct ocfs2_dinode *di;
-       struct inode *journal = NULL;
+       int journal_dirty = 0;
 
        for(slot = 0; slot < osb->max_slots; slot++) {
-               journal = ocfs2_get_system_file_inode(osb,
-                                                     JOURNAL_SYSTEM_INODE,
-                                                     slot);
-               if (!journal || is_bad_inode(journal)) {
-                       ret = -EACCES;
-                       mlog_errno(ret);
-                       goto out;
-               }
-
-               di_bh = NULL;
-               ret = ocfs2_read_block(osb, OCFS2_I(journal)->ip_blkno, &di_bh,
-                                      0, journal);
-               if (ret < 0) {
+               ret = ocfs2_read_journal_inode(osb, slot, &di_bh, NULL);
+               if (ret) {
                        mlog_errno(ret);
                        goto out;
                }
 
                di = (struct ocfs2_dinode *) di_bh->b_data;
 
+               osb->slot_recovery_generations[slot] =
+                                       ocfs2_get_recovery_generation(di);
+
                if (le32_to_cpu(di->id1.journal1.ij_flags) &
                    OCFS2_JOURNAL_DIRTY_FL)
-                       ret = -EROFS;
+                       journal_dirty = 1;
 
                brelse(di_bh);
-               if (ret)
-                       break;
+               di_bh = NULL;
        }
 
 out:
-       if (journal)
-               iput(journal);
-
+       if (journal_dirty)
+               ret = -EROFS;
        return ret;
 }
index db82be2532ed5ef333c8a58a14e19cfbd3bbd6aa..2178ebffa05f62c85bb8251958d9b71c48370f0d 100644 (file)
@@ -161,7 +161,8 @@ int    ocfs2_journal_init(struct ocfs2_journal *journal,
 void   ocfs2_journal_shutdown(struct ocfs2_super *osb);
 int    ocfs2_journal_wipe(struct ocfs2_journal *journal,
                          int full);
-int    ocfs2_journal_load(struct ocfs2_journal *journal, int local);
+int    ocfs2_journal_load(struct ocfs2_journal *journal, int local,
+                         int replayed);
 int    ocfs2_check_journals_nolocks(struct ocfs2_super *osb);
 void   ocfs2_recovery_thread(struct ocfs2_super *osb,
                             int node_num);
index 1cb814be8ef1fc13baa80483ccc6eb6a2dfef78e..7f625f2b11174c4d0963f4d73971343da1ee04f6 100644 (file)
@@ -204,6 +204,8 @@ struct ocfs2_super
 
        struct ocfs2_slot_info *slot_info;
 
+       u32 *slot_recovery_generations;
+
        spinlock_t node_map_lock;
 
        u64 root_blkno;
index 3f1945177629d7cdbfc84779cb37536d38e9dff5..4f619850ccf7fd8b80bf4888fc39849c6bb93d4b 100644 (file)
@@ -660,7 +660,10 @@ struct ocfs2_dinode {
                struct {                /* Info for journal system
                                           inodes */
                        __le32 ij_flags;        /* Mounted, version, etc. */
-                       __le32 ij_pad;
+                       __le32 ij_recovery_generation; /* Incremented when the
+                                                         journal is recovered
+                                                         after an unclean
+                                                         shutdown */
                } journal1;
        } id1;                          /* Inode type dependant 1 */
 /*C0*/ union {
index 2560b33889aad8380b77f35ba4f21af7220459ac..88255d3f52b40ba39a847a0bd1976f98e94ab5e7 100644 (file)
@@ -1442,6 +1442,15 @@ static int ocfs2_initialize_super(struct super_block *sb,
        }
        mlog(0, "max_slots for this device: %u\n", osb->max_slots);
 
+       osb->slot_recovery_generations =
+               kcalloc(osb->max_slots, sizeof(*osb->slot_recovery_generations),
+                       GFP_KERNEL);
+       if (!osb->slot_recovery_generations) {
+               status = -ENOMEM;
+               mlog_errno(status);
+               goto bail;
+       }
+
        init_waitqueue_head(&osb->osb_wipe_event);
        osb->osb_orphan_wipes = kcalloc(osb->max_slots,
                                        sizeof(*osb->osb_orphan_wipes),
@@ -1703,7 +1712,7 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)
        local = ocfs2_mount_local(osb);
 
        /* will play back anything left in the journal. */
-       status = ocfs2_journal_load(osb->journal, local);
+       status = ocfs2_journal_load(osb->journal, local, dirty);
        if (status < 0) {
                mlog(ML_ERROR, "ocfs2 journal load failed! %d\n", status);
                goto finally;
@@ -1768,6 +1777,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
        ocfs2_free_slot_info(osb);
 
        kfree(osb->osb_orphan_wipes);
+       kfree(osb->slot_recovery_generations);
        /* FIXME
         * This belongs in journal shutdown, but because we have to
         * allocate osb->journal at the start of ocfs2_initalize_osb(),
index 52647be277a2c6bbe7e6ba5a9e0603d07ad33c71..07da9359481c720c045e2a25e154df02ba02e9ff 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -963,62 +963,6 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
 }
 EXPORT_SYMBOL(dentry_open);
 
-/*
- * Find an empty file descriptor entry, and mark it busy.
- */
-int get_unused_fd_flags(int flags)
-{
-       struct files_struct * files = current->files;
-       int fd, error;
-       struct fdtable *fdt;
-
-       spin_lock(&files->file_lock);
-
-repeat:
-       fdt = files_fdtable(files);
-       fd = find_next_zero_bit(fdt->open_fds->fds_bits, fdt->max_fds,
-                               files->next_fd);
-
-       /* Do we need to expand the fd array or fd set?  */
-       error = expand_files(files, fd);
-       if (error < 0)
-               goto out;
-
-       if (error) {
-               /*
-                * If we needed to expand the fs array we
-                * might have blocked - try again.
-                */
-               goto repeat;
-       }
-
-       FD_SET(fd, fdt->open_fds);
-       if (flags & O_CLOEXEC)
-               FD_SET(fd, fdt->close_on_exec);
-       else
-               FD_CLR(fd, fdt->close_on_exec);
-       files->next_fd = fd + 1;
-#if 1
-       /* Sanity check */
-       if (fdt->fd[fd] != NULL) {
-               printk(KERN_WARNING "get_unused_fd: slot %d not NULL!\n", fd);
-               fdt->fd[fd] = NULL;
-       }
-#endif
-       error = fd;
-
-out:
-       spin_unlock(&files->file_lock);
-       return error;
-}
-
-int get_unused_fd(void)
-{
-       return get_unused_fd_flags(0);
-}
-
-EXPORT_SYMBOL(get_unused_fd);
-
 static void __put_unused_fd(struct files_struct *files, unsigned int fd)
 {
        struct fdtable *fdt = files_fdtable(files);
index cb4096cc3fb7456f96a5a4e30dc1957e0707b10e..4fb81e9c94e3b616745bd696394e6909ec46b5bf 100644 (file)
@@ -300,10 +300,10 @@ out:
        return rtn;
 }
 
-static DEFINE_IDR(proc_inum_idr);
+static DEFINE_IDA(proc_inum_ida);
 static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */
 
-#define PROC_DYNAMIC_FIRST 0xF0000000UL
+#define PROC_DYNAMIC_FIRST 0xF0000000U
 
 /*
  * Return an inode number between PROC_DYNAMIC_FIRST and
@@ -311,36 +311,33 @@ static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */
  */
 static unsigned int get_inode_number(void)
 {
-       int i, inum = 0;
+       unsigned int i;
        int error;
 
 retry:
-       if (idr_pre_get(&proc_inum_idr, GFP_KERNEL) == 0)
+       if (ida_pre_get(&proc_inum_ida, GFP_KERNEL) == 0)
                return 0;
 
        spin_lock(&proc_inum_lock);
-       error = idr_get_new(&proc_inum_idr, NULL, &i);
+       error = ida_get_new(&proc_inum_ida, &i);
        spin_unlock(&proc_inum_lock);
        if (error == -EAGAIN)
                goto retry;
        else if (error)
                return 0;
 
-       inum = (i & MAX_ID_MASK) + PROC_DYNAMIC_FIRST;
-
-       /* inum will never be more than 0xf0ffffff, so no check
-        * for overflow.
-        */
-
-       return inum;
+       if (i > UINT_MAX - PROC_DYNAMIC_FIRST) {
+               spin_lock(&proc_inum_lock);
+               ida_remove(&proc_inum_ida, i);
+               spin_unlock(&proc_inum_lock);
+       }
+       return PROC_DYNAMIC_FIRST + i;
 }
 
 static void release_inode_number(unsigned int inum)
 {
-       int id = (inum - PROC_DYNAMIC_FIRST) | ~MAX_ID_MASK;
-
        spin_lock(&proc_inum_lock);
-       idr_remove(&proc_inum_idr, id);
+       ida_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST);
        spin_unlock(&proc_inum_lock);
 }
 
index 879e54d35c2d49400a48b3d748a69c92934acb7a..282a13596c702ac126e7697e97bd239fc4e905a4 100644 (file)
@@ -2076,8 +2076,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                return err;
        /* Quotafile not on the same filesystem? */
        if (nd.path.mnt->mnt_sb != sb) {
-               path_put(&nd.path);
-               return -EXDEV;
+               err = -EXDEV;
+               goto out;
        }
        inode = nd.path.dentry->d_inode;
        /* We must not pack tails for quota files on reiserfs for quota IO to work */
@@ -2087,8 +2087,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                        reiserfs_warning(sb,
                                "reiserfs: Unpacking tail of quota file failed"
                                " (%d). Cannot turn on quotas.", err);
-                       path_put(&nd.path);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto out;
                }
                mark_inode_dirty(inode);
        }
@@ -2109,13 +2109,15 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                /* Just start temporary transaction and finish it */
                err = journal_begin(&th, sb, 1);
                if (err)
-                       return err;
+                       goto out;
                err = journal_end_sync(&th, sb, 1);
                if (err)
-                       return err;
+                       goto out;
        }
+       err = vfs_quota_on_path(sb, type, format_id, &nd.path);
+out:
        path_put(&nd.path);
-       return vfs_quota_on(sb, type, format_id, path, 0);
+       return err;
 }
 
 /* Read data from quotafile - avoid pagecache and such because we cannot afford
index 3e30e40aa24d04c454612565ba746f72dabfc652..3141969b456daa5223b5999607958c0b3b33557c 100644 (file)
@@ -1233,7 +1233,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
        struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb);
        unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE;
-       const struct match_token *tp = tokens;
+       struct match_token *tp = tokens;
 
        while (tp->token != Opt_onerror_panic && tp->token != mval)
                ++tp;
index 36ec614e699ab21c958b5623a5ae8fc92d5e8cf2..737c9a425361df67f3f7ef9d0ff674e26caf6105 100644 (file)
@@ -106,7 +106,8 @@ xfs-y                               += $(addprefix $(XFS_LINUX)/, \
                                   xfs_iops.o \
                                   xfs_lrw.o \
                                   xfs_super.o \
-                                  xfs_vnode.o)
+                                  xfs_vnode.o \
+                                  xfs_xattr.o)
 
 # Objects in support/
 xfs-y                          += $(addprefix support/, \
index 9b1bb17a050160487dfa00887e385d017a0b496b..1cd3b55ee3d227d5916c18d95c2dd84a45e5285d 100644 (file)
@@ -90,7 +90,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize,
 }
 
 void
-kmem_free(void *ptr, size_t size)
+kmem_free(const void *ptr)
 {
        if (!is_vmalloc_addr(ptr)) {
                kfree(ptr);
@@ -100,7 +100,7 @@ kmem_free(void *ptr, size_t size)
 }
 
 void *
-kmem_realloc(void *ptr, size_t newsize, size_t oldsize,
+kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
             unsigned int __nocast flags)
 {
        void    *new;
@@ -110,7 +110,7 @@ kmem_realloc(void *ptr, size_t newsize, size_t oldsize,
                if (new)
                        memcpy(new, ptr,
                                ((oldsize < newsize) ? oldsize : newsize));
-               kmem_free(ptr, oldsize);
+               kmem_free(ptr);
        }
        return new;
 }
index a20683cf74ddde496cd78dbbeb09988559bfd35d..af6843c7ee4bb165f6345d3553ef145af97ae208 100644 (file)
@@ -57,8 +57,8 @@ kmem_flags_convert(unsigned int __nocast flags)
 extern void *kmem_alloc(size_t, unsigned int __nocast);
 extern void *kmem_zalloc(size_t, unsigned int __nocast);
 extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast);
-extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast);
-extern void  kmem_free(void *, size_t);
+extern void *kmem_realloc(const void *, size_t, size_t, unsigned int __nocast);
+extern void  kmem_free(const void *);
 
 /*
  * Zone interfaces
index a55c3b26d840e5e7d1be37fcb727dfd3c0f2686a..0b211cba19098a610c222e98553d7cc968502d0d 100644 (file)
@@ -409,7 +409,6 @@ xfs_start_buffer_writeback(
 STATIC void
 xfs_start_page_writeback(
        struct page             *page,
-       struct writeback_control *wbc,
        int                     clear_dirty,
        int                     buffers)
 {
@@ -858,7 +857,7 @@ xfs_convert_page(
                                done = 1;
                        }
                }
-               xfs_start_page_writeback(page, wbc, !page_dirty, count);
+               xfs_start_page_writeback(page, !page_dirty, count);
        }
 
        return done;
@@ -1130,7 +1129,7 @@ xfs_page_state_convert(
                SetPageUptodate(page);
 
        if (startio)
-               xfs_start_page_writeback(page, wbc, 1, count);
+               xfs_start_page_writeback(page, 1, count);
 
        if (ioend && iomap_valid) {
                offset = (iomap.iomap_offset + iomap.iomap_bsize - 1) >>
index 98e0e86093b49632e6fc6696c0e0384c26ffa208..9cc8f0213095b92e868fa396b099bc13c2a2ec47 100644 (file)
@@ -310,8 +310,7 @@ _xfs_buf_free_pages(
        xfs_buf_t       *bp)
 {
        if (bp->b_pages != bp->b_page_array) {
-               kmem_free(bp->b_pages,
-                         bp->b_page_count * sizeof(struct page *));
+               kmem_free(bp->b_pages);
        }
 }
 
@@ -1398,7 +1397,7 @@ STATIC void
 xfs_free_bufhash(
        xfs_buftarg_t           *btp)
 {
-       kmem_free(btp->bt_hash, (1<<btp->bt_hashshift) * sizeof(xfs_bufhash_t));
+       kmem_free(btp->bt_hash);
        btp->bt_hash = NULL;
 }
 
@@ -1428,13 +1427,10 @@ xfs_unregister_buftarg(
 
 void
 xfs_free_buftarg(
-       xfs_buftarg_t           *btp,
-       int                     external)
+       xfs_buftarg_t           *btp)
 {
        xfs_flush_buftarg(btp, 1);
        xfs_blkdev_issue_flush(btp);
-       if (external)
-               xfs_blkdev_put(btp->bt_bdev);
        xfs_free_bufhash(btp);
        iput(btp->bt_mapping->host);
 
@@ -1444,7 +1440,7 @@ xfs_free_buftarg(
        xfs_unregister_buftarg(btp);
        kthread_stop(btp->bt_task);
 
-       kmem_free(btp, sizeof(*btp));
+       kmem_free(btp);
 }
 
 STATIC int
@@ -1575,7 +1571,7 @@ xfs_alloc_buftarg(
        return btp;
 
 error:
-       kmem_free(btp, sizeof(*btp));
+       kmem_free(btp);
        return NULL;
 }
 
index f948ec7ba9a4300b2089ff1a4b8b4f3c2dd70ff4..29d1d4adc07897a7fdb47b76b4deb9fbf4c78e27 100644 (file)
@@ -429,7 +429,7 @@ static inline void xfs_bdwrite(void *mp, xfs_buf_t *bp)
  *     Handling of buftargs.
  */
 extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int);
-extern void xfs_free_buftarg(xfs_buftarg_t *, int);
+extern void xfs_free_buftarg(xfs_buftarg_t *);
 extern void xfs_wait_buftarg(xfs_buftarg_t *);
 extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int);
 extern int xfs_flush_buftarg(xfs_buftarg_t *, int);
index c672b3238b14b5d3a5a47b9ae606aeecd10d7fac..987fe84f7b1351d8204b18d182c4f49185f95218 100644 (file)
@@ -215,7 +215,7 @@ xfs_fs_get_parent(
        struct xfs_inode        *cip;
        struct dentry           *parent;
 
-       error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip);
+       error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip, NULL);
        if (unlikely(error))
                return ERR_PTR(-error);
 
index 01939ba2d8dea65c43b04b0754b9df4513e8864e..acb978d9d0859a17a5518dc544d6165c250288f5 100644 (file)
@@ -48,6 +48,8 @@
 #include "xfs_dfrag.h"
 #include "xfs_fsops.h"
 #include "xfs_vnodeops.h"
+#include "xfs_quota.h"
+#include "xfs_inode_item.h"
 
 #include <linux/capability.h>
 #include <linux/dcache.h>
@@ -468,6 +470,12 @@ xfs_attrlist_by_handle(
        if (al_hreq.buflen > XATTR_LIST_MAX)
                return -XFS_ERROR(EINVAL);
 
+       /*
+        * Reject flags, only allow namespaces.
+        */
+       if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE))
+               return -XFS_ERROR(EINVAL);
+
        error = xfs_vget_fsop_handlereq(mp, parinode, &al_hreq.hreq, &inode);
        if (error)
                goto out;
@@ -587,7 +595,7 @@ xfs_attrmulti_by_handle(
                goto out;
 
        error = E2BIG;
-       size = am_hreq.opcount * sizeof(attr_multiop_t);
+       size = am_hreq.opcount * sizeof(xfs_attr_multiop_t);
        if (!size || size > 16 * PAGE_SIZE)
                goto out_vn_rele;
 
@@ -680,9 +688,9 @@ xfs_ioc_space(
                return -XFS_ERROR(EFAULT);
 
        if (filp->f_flags & (O_NDELAY|O_NONBLOCK))
-               attr_flags |= ATTR_NONBLOCK;
+               attr_flags |= XFS_ATTR_NONBLOCK;
        if (ioflags & IO_INVIS)
-               attr_flags |= ATTR_DMI;
+               attr_flags |= XFS_ATTR_DMI;
 
        error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos,
                                              NULL, attr_flags);
@@ -873,6 +881,322 @@ xfs_ioc_fsgetxattr(
        return 0;
 }
 
+STATIC void
+xfs_set_diflags(
+       struct xfs_inode        *ip,
+       unsigned int            xflags)
+{
+       unsigned int            di_flags;
+
+       /* can't set PREALLOC this way, just preserve it */
+       di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
+       if (xflags & XFS_XFLAG_IMMUTABLE)
+               di_flags |= XFS_DIFLAG_IMMUTABLE;
+       if (xflags & XFS_XFLAG_APPEND)
+               di_flags |= XFS_DIFLAG_APPEND;
+       if (xflags & XFS_XFLAG_SYNC)
+               di_flags |= XFS_DIFLAG_SYNC;
+       if (xflags & XFS_XFLAG_NOATIME)
+               di_flags |= XFS_DIFLAG_NOATIME;
+       if (xflags & XFS_XFLAG_NODUMP)
+               di_flags |= XFS_DIFLAG_NODUMP;
+       if (xflags & XFS_XFLAG_PROJINHERIT)
+               di_flags |= XFS_DIFLAG_PROJINHERIT;
+       if (xflags & XFS_XFLAG_NODEFRAG)
+               di_flags |= XFS_DIFLAG_NODEFRAG;
+       if (xflags & XFS_XFLAG_FILESTREAM)
+               di_flags |= XFS_DIFLAG_FILESTREAM;
+       if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
+               if (xflags & XFS_XFLAG_RTINHERIT)
+                       di_flags |= XFS_DIFLAG_RTINHERIT;
+               if (xflags & XFS_XFLAG_NOSYMLINKS)
+                       di_flags |= XFS_DIFLAG_NOSYMLINKS;
+               if (xflags & XFS_XFLAG_EXTSZINHERIT)
+                       di_flags |= XFS_DIFLAG_EXTSZINHERIT;
+       } else if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) {
+               if (xflags & XFS_XFLAG_REALTIME)
+                       di_flags |= XFS_DIFLAG_REALTIME;
+               if (xflags & XFS_XFLAG_EXTSIZE)
+                       di_flags |= XFS_DIFLAG_EXTSIZE;
+       }
+
+       ip->i_d.di_flags = di_flags;
+}
+
+STATIC void
+xfs_diflags_to_linux(
+       struct xfs_inode        *ip)
+{
+       struct inode            *inode = XFS_ITOV(ip);
+       unsigned int            xflags = xfs_ip2xflags(ip);
+
+       if (xflags & XFS_XFLAG_IMMUTABLE)
+               inode->i_flags |= S_IMMUTABLE;
+       else
+               inode->i_flags &= ~S_IMMUTABLE;
+       if (xflags & XFS_XFLAG_APPEND)
+               inode->i_flags |= S_APPEND;
+       else
+               inode->i_flags &= ~S_APPEND;
+       if (xflags & XFS_XFLAG_SYNC)
+               inode->i_flags |= S_SYNC;
+       else
+               inode->i_flags &= ~S_SYNC;
+       if (xflags & XFS_XFLAG_NOATIME)
+               inode->i_flags |= S_NOATIME;
+       else
+               inode->i_flags &= ~S_NOATIME;
+}
+
+#define FSX_PROJID     1
+#define FSX_EXTSIZE    2
+#define FSX_XFLAGS     4
+#define FSX_NONBLOCK   8
+
+STATIC int
+xfs_ioctl_setattr(
+       xfs_inode_t             *ip,
+       struct fsxattr          *fa,
+       int                     mask)
+{
+       struct xfs_mount        *mp = ip->i_mount;
+       struct xfs_trans        *tp;
+       unsigned int            lock_flags = 0;
+       struct xfs_dquot        *udqp = NULL, *gdqp = NULL;
+       struct xfs_dquot        *olddquot = NULL;
+       int                     code;
+
+       xfs_itrace_entry(ip);
+
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
+               return XFS_ERROR(EROFS);
+       if (XFS_FORCED_SHUTDOWN(mp))
+               return XFS_ERROR(EIO);
+
+       /*
+        * If disk quotas is on, we make sure that the dquots do exist on disk,
+        * before we start any other transactions. Trying to do this later
+        * is messy. We don't care to take a readlock to look at the ids
+        * in inode here, because we can't hold it across the trans_reserve.
+        * If the IDs do change before we take the ilock, we're covered
+        * because the i_*dquot fields will get updated anyway.
+        */
+       if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) {
+               code = XFS_QM_DQVOPALLOC(mp, ip, ip->i_d.di_uid,
+                                        ip->i_d.di_gid, fa->fsx_projid,
+                                        XFS_QMOPT_PQUOTA, &udqp, &gdqp);
+               if (code)
+                       return code;
+       }
+
+       /*
+        * For the other attributes, we acquire the inode lock and
+        * first do an error checking pass.
+        */
+       tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE);
+       code = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0);
+       if (code)
+               goto error_return;
+
+       lock_flags = XFS_ILOCK_EXCL;
+       xfs_ilock(ip, lock_flags);
+
+       /*
+        * CAP_FOWNER overrides the following restrictions:
+        *
+        * The user ID of the calling process must be equal
+        * to the file owner ID, except in cases where the
+        * CAP_FSETID capability is applicable.
+        */
+       if (current->fsuid != ip->i_d.di_uid && !capable(CAP_FOWNER)) {
+               code = XFS_ERROR(EPERM);
+               goto error_return;
+       }
+
+       /*
+        * Do a quota reservation only if projid is actually going to change.
+        */
+       if (mask & FSX_PROJID) {
+               if (XFS_IS_PQUOTA_ON(mp) &&
+                   ip->i_d.di_projid != fa->fsx_projid) {
+                       ASSERT(tp);
+                       code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp,
+                                               capable(CAP_FOWNER) ?
+                                               XFS_QMOPT_FORCE_RES : 0);
+                       if (code)       /* out of quota */
+                               goto error_return;
+               }
+       }
+
+       if (mask & FSX_EXTSIZE) {
+               /*
+                * Can't change extent size if any extents are allocated.
+                */
+               if (ip->i_d.di_nextents &&
+                   ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) !=
+                    fa->fsx_extsize)) {
+                       code = XFS_ERROR(EINVAL);       /* EFBIG? */
+                       goto error_return;
+               }
+
+               /*
+                * Extent size must be a multiple of the appropriate block
+                * size, if set at all.
+                */
+               if (fa->fsx_extsize != 0) {
+                       xfs_extlen_t    size;
+
+                       if (XFS_IS_REALTIME_INODE(ip) ||
+                           ((mask & FSX_XFLAGS) &&
+                           (fa->fsx_xflags & XFS_XFLAG_REALTIME))) {
+                               size = mp->m_sb.sb_rextsize <<
+                                      mp->m_sb.sb_blocklog;
+                       } else {
+                               size = mp->m_sb.sb_blocksize;
+                       }
+
+                       if (fa->fsx_extsize % size) {
+                               code = XFS_ERROR(EINVAL);
+                               goto error_return;
+                       }
+               }
+       }
+
+
+       if (mask & FSX_XFLAGS) {
+               /*
+                * Can't change realtime flag if any extents are allocated.
+                */
+               if ((ip->i_d.di_nextents || ip->i_delayed_blks) &&
+                   (XFS_IS_REALTIME_INODE(ip)) !=
+                   (fa->fsx_xflags & XFS_XFLAG_REALTIME)) {
+                       code = XFS_ERROR(EINVAL);       /* EFBIG? */
+                       goto error_return;
+               }
+
+               /*
+                * If realtime flag is set then must have realtime data.
+                */
+               if ((fa->fsx_xflags & XFS_XFLAG_REALTIME)) {
+                       if ((mp->m_sb.sb_rblocks == 0) ||
+                           (mp->m_sb.sb_rextsize == 0) ||
+                           (ip->i_d.di_extsize % mp->m_sb.sb_rextsize)) {
+                               code = XFS_ERROR(EINVAL);
+                               goto error_return;
+                       }
+               }
+
+               /*
+                * Can't modify an immutable/append-only file unless
+                * we have appropriate permission.
+                */
+               if ((ip->i_d.di_flags &
+                               (XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) ||
+                    (fa->fsx_xflags &
+                               (XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) &&
+                   !capable(CAP_LINUX_IMMUTABLE)) {
+                       code = XFS_ERROR(EPERM);
+                       goto error_return;
+               }
+       }
+
+       xfs_trans_ijoin(tp, ip, lock_flags);
+       xfs_trans_ihold(tp, ip);
+
+       /*
+        * Change file ownership.  Must be the owner or privileged.
+        * If the system was configured with the "restricted_chown"
+        * option, the owner is not permitted to give away the file,
+        * and can change the group id only to a group of which he
+        * or she is a member.
+        */
+       if (mask & FSX_PROJID) {
+               /*
+                * CAP_FSETID overrides the following restrictions:
+                *
+                * The set-user-ID and set-group-ID bits of a file will be
+                * cleared upon successful return from chown()
+                */
+               if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) &&
+                   !capable(CAP_FSETID))
+                       ip->i_d.di_mode &= ~(S_ISUID|S_ISGID);
+
+               /*
+                * Change the ownerships and register quota modifications
+                * in the transaction.
+                */
+               if (ip->i_d.di_projid != fa->fsx_projid) {
+                       if (XFS_IS_PQUOTA_ON(mp)) {
+                               olddquot = XFS_QM_DQVOPCHOWN(mp, tp, ip,
+                                                       &ip->i_gdquot, gdqp);
+                       }
+                       ip->i_d.di_projid = fa->fsx_projid;
+
+                       /*
+                        * We may have to rev the inode as well as
+                        * the superblock version number since projids didn't
+                        * exist before DINODE_VERSION_2 and SB_VERSION_NLINK.
+                        */
+                       if (ip->i_d.di_version == XFS_DINODE_VERSION_1)
+                               xfs_bump_ino_vers2(tp, ip);
+               }
+
+       }
+
+       if (mask & FSX_EXTSIZE)
+               ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
+       if (mask & FSX_XFLAGS) {
+               xfs_set_diflags(ip, fa->fsx_xflags);
+               xfs_diflags_to_linux(ip);
+       }
+
+       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+       xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
+
+       XFS_STATS_INC(xs_ig_attrchg);
+
+       /*
+        * If this is a synchronous mount, make sure that the
+        * transaction goes to disk before returning to the user.
+        * This is slightly sub-optimal in that truncates require
+        * two sync transactions instead of one for wsync filesystems.
+        * One for the truncate and one for the timestamps since we
+        * don't want to change the timestamps unless we're sure the
+        * truncate worked.  Truncates are less than 1% of the laddis
+        * mix so this probably isn't worth the trouble to optimize.
+        */
+       if (mp->m_flags & XFS_MOUNT_WSYNC)
+               xfs_trans_set_sync(tp);
+       code = xfs_trans_commit(tp, 0);
+       xfs_iunlock(ip, lock_flags);
+
+       /*
+        * Release any dquot(s) the inode had kept before chown.
+        */
+       XFS_QM_DQRELE(mp, olddquot);
+       XFS_QM_DQRELE(mp, udqp);
+       XFS_QM_DQRELE(mp, gdqp);
+
+       if (code)
+               return code;
+
+       if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE)) {
+               XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL,
+                               NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0,
+                               (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0);
+       }
+
+       return 0;
+
+ error_return:
+       XFS_QM_DQRELE(mp, udqp);
+       XFS_QM_DQRELE(mp, gdqp);
+       xfs_trans_cancel(tp, 0);
+       if (lock_flags)
+               xfs_iunlock(ip, lock_flags);
+       return code;
+}
+
 STATIC int
 xfs_ioc_fssetxattr(
        xfs_inode_t             *ip,
@@ -880,31 +1204,16 @@ xfs_ioc_fssetxattr(
        void                    __user *arg)
 {
        struct fsxattr          fa;
-       struct bhv_vattr        *vattr;
-       int                     error;
-       int                     attr_flags;
+       unsigned int            mask;
 
        if (copy_from_user(&fa, arg, sizeof(fa)))
                return -EFAULT;
 
-       vattr = kmalloc(sizeof(*vattr), GFP_KERNEL);
-       if (unlikely(!vattr))
-               return -ENOMEM;
-
-       attr_flags = 0;
+       mask = FSX_XFLAGS | FSX_EXTSIZE | FSX_PROJID;
        if (filp->f_flags & (O_NDELAY|O_NONBLOCK))
-               attr_flags |= ATTR_NONBLOCK;
-
-       vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | XFS_AT_PROJID;
-       vattr->va_xflags  = fa.fsx_xflags;
-       vattr->va_extsize = fa.fsx_extsize;
-       vattr->va_projid  = fa.fsx_projid;
+               mask |= FSX_NONBLOCK;
 
-       error = -xfs_setattr(ip, vattr, attr_flags, NULL);
-       if (!error)
-               vn_revalidate(XFS_ITOV(ip));    /* update flags */
-       kfree(vattr);
-       return 0;
+       return -xfs_ioctl_setattr(ip, &fa, mask);
 }
 
 STATIC int
@@ -926,10 +1235,9 @@ xfs_ioc_setxflags(
        struct file             *filp,
        void                    __user *arg)
 {
-       struct bhv_vattr        *vattr;
+       struct fsxattr          fa;
        unsigned int            flags;
-       int                     attr_flags;
-       int                     error;
+       unsigned int            mask;
 
        if (copy_from_user(&flags, arg, sizeof(flags)))
                return -EFAULT;
@@ -939,22 +1247,12 @@ xfs_ioc_setxflags(
                      FS_SYNC_FL))
                return -EOPNOTSUPP;
 
-       vattr = kmalloc(sizeof(*vattr), GFP_KERNEL);
-       if (unlikely(!vattr))
-               return -ENOMEM;
-
-       attr_flags = 0;
+       mask = FSX_XFLAGS;
        if (filp->f_flags & (O_NDELAY|O_NONBLOCK))
-               attr_flags |= ATTR_NONBLOCK;
-
-       vattr->va_mask = XFS_AT_XFLAGS;
-       vattr->va_xflags = xfs_merge_ioc_xflags(flags, xfs_ip2xflags(ip));
+               mask |= FSX_NONBLOCK;
+       fa.fsx_xflags = xfs_merge_ioc_xflags(flags, xfs_ip2xflags(ip));
 
-       error = -xfs_setattr(ip, vattr, attr_flags, NULL);
-       if (likely(!error))
-               vn_revalidate(XFS_ITOV(ip));    /* update flags */
-       kfree(vattr);
-       return error;
+       return -xfs_ioctl_setattr(ip, &fa, mask);
 }
 
 STATIC int
index 5fc61c824bb9bbe1b53cca02ab6b72c427c900db..e88f51028086796d0ce80a7f47a88e0c953b72bd 100644 (file)
@@ -181,23 +181,6 @@ xfs_ichgtime_fast(
                mark_inode_dirty_sync(inode);
 }
 
-
-/*
- * Pull the link count and size up from the xfs inode to the linux inode
- */
-STATIC void
-xfs_validate_fields(
-       struct inode            *inode)
-{
-       struct xfs_inode        *ip = XFS_I(inode);
-       loff_t size;
-
-       /* we're under i_sem so i_size can't change under us */
-       size = XFS_ISIZE(ip);
-       if (i_size_read(inode) != size)
-               i_size_write(inode, size);
-}
-
 /*
  * Hook in SELinux.  This is not quite correct yet, what we really need
  * here (as we do for default ACLs) is a mechanism by which creation of
@@ -245,8 +228,7 @@ STATIC void
 xfs_cleanup_inode(
        struct inode    *dir,
        struct inode    *inode,
-       struct dentry   *dentry,
-       int             mode)
+       struct dentry   *dentry)
 {
        struct xfs_name teardown;
 
@@ -257,10 +239,7 @@ xfs_cleanup_inode(
         */
        xfs_dentry_to_name(&teardown, dentry);
 
-       if (S_ISDIR(mode))
-               xfs_rmdir(XFS_I(dir), &teardown, XFS_I(inode));
-       else
-               xfs_remove(XFS_I(dir), &teardown, XFS_I(inode));
+       xfs_remove(XFS_I(dir), &teardown, XFS_I(inode));
        iput(inode);
 }
 
@@ -275,7 +254,7 @@ xfs_vn_mknod(
        struct xfs_inode *ip = NULL;
        xfs_acl_t       *default_acl = NULL;
        struct xfs_name name;
-       attrexists_t    test_default_acl = _ACL_DEFAULT_EXISTS;
+       int (*test_default_acl)(struct inode *) = _ACL_DEFAULT_EXISTS;
        int             error;
 
        /*
@@ -335,14 +314,11 @@ xfs_vn_mknod(
        }
 
 
-       if (S_ISDIR(mode))
-               xfs_validate_fields(inode);
        d_instantiate(dentry, inode);
-       xfs_validate_fields(dir);
        return -error;
 
  out_cleanup_inode:
-       xfs_cleanup_inode(dir, inode, dentry, mode);
+       xfs_cleanup_inode(dir, inode, dentry);
  out_free_acl:
        if (default_acl)
                _ACL_FREE(default_acl);
@@ -382,7 +358,7 @@ xfs_vn_lookup(
                return ERR_PTR(-ENAMETOOLONG);
 
        xfs_dentry_to_name(&name, dentry);
-       error = xfs_lookup(XFS_I(dir), &name, &cip);
+       error = xfs_lookup(XFS_I(dir), &name, &cip, NULL);
        if (unlikely(error)) {
                if (unlikely(error != ENOENT))
                        return ERR_PTR(-error);
@@ -393,6 +369,46 @@ xfs_vn_lookup(
        return d_splice_alias(cip->i_vnode, dentry);
 }
 
+STATIC struct dentry *
+xfs_vn_ci_lookup(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       struct nameidata *nd)
+{
+       struct xfs_inode *ip;
+       struct xfs_name xname;
+       struct xfs_name ci_name;
+       struct qstr     dname;
+       int             error;
+
+       if (dentry->d_name.len >= MAXNAMELEN)
+               return ERR_PTR(-ENAMETOOLONG);
+
+       xfs_dentry_to_name(&xname, dentry);
+       error = xfs_lookup(XFS_I(dir), &xname, &ip, &ci_name);
+       if (unlikely(error)) {
+               if (unlikely(error != ENOENT))
+                       return ERR_PTR(-error);
+               /*
+                * call d_add(dentry, NULL) here when d_drop_negative_children
+                * is called in xfs_vn_mknod (ie. allow negative dentries
+                * with CI filesystems).
+                */
+               return NULL;
+       }
+
+       /* if exact match, just splice and exit */
+       if (!ci_name.name)
+               return d_splice_alias(ip->i_vnode, dentry);
+
+       /* else case-insensitive match... */
+       dname.name = ci_name.name;
+       dname.len = ci_name.len;
+       dentry = d_add_ci(ip->i_vnode, dentry, &dname);
+       kmem_free(ci_name.name);
+       return dentry;
+}
+
 STATIC int
 xfs_vn_link(
        struct dentry   *old_dentry,
@@ -414,7 +430,6 @@ xfs_vn_link(
        }
 
        xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED);
-       xfs_validate_fields(inode);
        d_instantiate(dentry, inode);
        return 0;
 }
@@ -424,19 +439,23 @@ xfs_vn_unlink(
        struct inode    *dir,
        struct dentry   *dentry)
 {
-       struct inode    *inode;
        struct xfs_name name;
        int             error;
 
-       inode = dentry->d_inode;
        xfs_dentry_to_name(&name, dentry);
 
-       error = xfs_remove(XFS_I(dir), &name, XFS_I(inode));
-       if (likely(!error)) {
-               xfs_validate_fields(dir);       /* size needs update */
-               xfs_validate_fields(inode);
-       }
-       return -error;
+       error = -xfs_remove(XFS_I(dir), &name, XFS_I(dentry->d_inode));
+       if (error)
+               return error;
+
+       /*
+        * With unlink, the VFS makes the dentry "negative": no inode,
+        * but still hashed. This is incompatible with case-insensitive
+        * mode, so invalidate (unhash) the dentry in CI-mode.
+        */
+       if (xfs_sb_version_hasasciici(&XFS_M(dir->i_sb)->m_sb))
+               d_invalidate(dentry);
+       return 0;
 }
 
 STATIC int
@@ -466,35 +485,14 @@ xfs_vn_symlink(
                goto out_cleanup_inode;
 
        d_instantiate(dentry, inode);
-       xfs_validate_fields(dir);
-       xfs_validate_fields(inode);
        return 0;
 
  out_cleanup_inode:
-       xfs_cleanup_inode(dir, inode, dentry, 0);
+       xfs_cleanup_inode(dir, inode, dentry);
  out:
        return -error;
 }
 
-STATIC int
-xfs_vn_rmdir(
-       struct inode    *dir,
-       struct dentry   *dentry)
-{
-       struct inode    *inode = dentry->d_inode;
-       struct xfs_name name;
-       int             error;
-
-       xfs_dentry_to_name(&name, dentry);
-
-       error = xfs_rmdir(XFS_I(dir), &name, XFS_I(inode));
-       if (likely(!error)) {
-               xfs_validate_fields(inode);
-               xfs_validate_fields(dir);
-       }
-       return -error;
-}
-
 STATIC int
 xfs_vn_rename(
        struct inode    *odir,
@@ -505,22 +503,13 @@ xfs_vn_rename(
        struct inode    *new_inode = ndentry->d_inode;
        struct xfs_name oname;
        struct xfs_name nname;
-       int             error;
 
        xfs_dentry_to_name(&oname, odentry);
        xfs_dentry_to_name(&nname, ndentry);
 
-       error = xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode),
+       return -xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode),
                           XFS_I(ndir), &nname, new_inode ?
                                                XFS_I(new_inode) : NULL);
-       if (likely(!error)) {
-               if (new_inode)
-                       xfs_validate_fields(new_inode);
-               xfs_validate_fields(odir);
-               if (ndir != odir)
-                       xfs_validate_fields(ndir);
-       }
-       return -error;
 }
 
 /*
@@ -659,57 +648,9 @@ xfs_vn_getattr(
 STATIC int
 xfs_vn_setattr(
        struct dentry   *dentry,
-       struct iattr    *attr)
+       struct iattr    *iattr)
 {
-       struct inode    *inode = dentry->d_inode;
-       unsigned int    ia_valid = attr->ia_valid;
-       bhv_vattr_t     vattr = { 0 };
-       int             flags = 0;
-       int             error;
-
-       if (ia_valid & ATTR_UID) {
-               vattr.va_mask |= XFS_AT_UID;
-               vattr.va_uid = attr->ia_uid;
-       }
-       if (ia_valid & ATTR_GID) {
-               vattr.va_mask |= XFS_AT_GID;
-               vattr.va_gid = attr->ia_gid;
-       }
-       if (ia_valid & ATTR_SIZE) {
-               vattr.va_mask |= XFS_AT_SIZE;
-               vattr.va_size = attr->ia_size;
-       }
-       if (ia_valid & ATTR_ATIME) {
-               vattr.va_mask |= XFS_AT_ATIME;
-               vattr.va_atime = attr->ia_atime;
-               inode->i_atime = attr->ia_atime;
-       }
-       if (ia_valid & ATTR_MTIME) {
-               vattr.va_mask |= XFS_AT_MTIME;
-               vattr.va_mtime = attr->ia_mtime;
-       }
-       if (ia_valid & ATTR_CTIME) {
-               vattr.va_mask |= XFS_AT_CTIME;
-               vattr.va_ctime = attr->ia_ctime;
-       }
-       if (ia_valid & ATTR_MODE) {
-               vattr.va_mask |= XFS_AT_MODE;
-               vattr.va_mode = attr->ia_mode;
-               if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
-                       inode->i_mode &= ~S_ISGID;
-       }
-
-       if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET))
-               flags |= ATTR_UTIME;
-#ifdef ATTR_NO_BLOCK
-       if ((ia_valid & ATTR_NO_BLOCK))
-               flags |= ATTR_NONBLOCK;
-#endif
-
-       error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL);
-       if (likely(!error))
-               vn_revalidate(vn_from_inode(inode));
-       return -error;
+       return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL);
 }
 
 /*
@@ -727,109 +668,6 @@ xfs_vn_truncate(
        WARN_ON(error);
 }
 
-STATIC int
-xfs_vn_setxattr(
-       struct dentry   *dentry,
-       const char      *name,
-       const void      *data,
-       size_t          size,
-       int             flags)
-{
-       bhv_vnode_t     *vp = vn_from_inode(dentry->d_inode);
-       char            *attr = (char *)name;
-       attrnames_t     *namesp;
-       int             xflags = 0;
-       int             error;
-
-       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       attr += namesp->attr_namelen;
-       error = namesp->attr_capable(vp, NULL);
-       if (error)
-               return error;
-
-       /* Convert Linux syscall to XFS internal ATTR flags */
-       if (flags & XATTR_CREATE)
-               xflags |= ATTR_CREATE;
-       if (flags & XATTR_REPLACE)
-               xflags |= ATTR_REPLACE;
-       xflags |= namesp->attr_flag;
-       return namesp->attr_set(vp, attr, (void *)data, size, xflags);
-}
-
-STATIC ssize_t
-xfs_vn_getxattr(
-       struct dentry   *dentry,
-       const char      *name,
-       void            *data,
-       size_t          size)
-{
-       bhv_vnode_t     *vp = vn_from_inode(dentry->d_inode);
-       char            *attr = (char *)name;
-       attrnames_t     *namesp;
-       int             xflags = 0;
-       ssize_t         error;
-
-       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       attr += namesp->attr_namelen;
-       error = namesp->attr_capable(vp, NULL);
-       if (error)
-               return error;
-
-       /* Convert Linux syscall to XFS internal ATTR flags */
-       if (!size) {
-               xflags |= ATTR_KERNOVAL;
-               data = NULL;
-       }
-       xflags |= namesp->attr_flag;
-       return namesp->attr_get(vp, attr, (void *)data, size, xflags);
-}
-
-STATIC ssize_t
-xfs_vn_listxattr(
-       struct dentry           *dentry,
-       char                    *data,
-       size_t                  size)
-{
-       bhv_vnode_t             *vp = vn_from_inode(dentry->d_inode);
-       int                     error, xflags = ATTR_KERNAMELS;
-       ssize_t                 result;
-
-       if (!size)
-               xflags |= ATTR_KERNOVAL;
-       xflags |= capable(CAP_SYS_ADMIN) ? ATTR_KERNFULLS : ATTR_KERNORMALS;
-
-       error = attr_generic_list(vp, data, size, xflags, &result);
-       if (error < 0)
-               return error;
-       return result;
-}
-
-STATIC int
-xfs_vn_removexattr(
-       struct dentry   *dentry,
-       const char      *name)
-{
-       bhv_vnode_t     *vp = vn_from_inode(dentry->d_inode);
-       char            *attr = (char *)name;
-       attrnames_t     *namesp;
-       int             xflags = 0;
-       int             error;
-
-       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       attr += namesp->attr_namelen;
-       error = namesp->attr_capable(vp, NULL);
-       if (error)
-               return error;
-       xflags |= namesp->attr_flag;
-       return namesp->attr_remove(vp, attr, xflags);
-}
-
 STATIC long
 xfs_vn_fallocate(
        struct inode    *inode,
@@ -853,18 +691,18 @@ xfs_vn_fallocate(
 
        xfs_ilock(ip, XFS_IOLOCK_EXCL);
        error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
-                                               0, NULL, ATTR_NOLOCK);
+                                     0, NULL, XFS_ATTR_NOLOCK);
        if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
            offset + len > i_size_read(inode))
                new_size = offset + len;
 
        /* Change file size if needed */
        if (new_size) {
-               bhv_vattr_t     va;
+               struct iattr iattr;
 
-               va.va_mask = XFS_AT_SIZE;
-               va.va_size = new_size;
-               error = xfs_setattr(ip, &va, ATTR_NOLOCK, NULL);
+               iattr.ia_valid = ATTR_SIZE;
+               iattr.ia_size = new_size;
+               error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL);
        }
 
        xfs_iunlock(ip, XFS_IOLOCK_EXCL);
@@ -877,10 +715,10 @@ const struct inode_operations xfs_inode_operations = {
        .truncate               = xfs_vn_truncate,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
-       .setxattr               = xfs_vn_setxattr,
-       .getxattr               = xfs_vn_getxattr,
+       .setxattr               = generic_setxattr,
+       .getxattr               = generic_getxattr,
+       .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
-       .removexattr            = xfs_vn_removexattr,
        .fallocate              = xfs_vn_fallocate,
 };
 
@@ -891,16 +729,47 @@ const struct inode_operations xfs_dir_inode_operations = {
        .unlink                 = xfs_vn_unlink,
        .symlink                = xfs_vn_symlink,
        .mkdir                  = xfs_vn_mkdir,
-       .rmdir                  = xfs_vn_rmdir,
+       /*
+        * Yes, XFS uses the same method for rmdir and unlink.
+        *
+        * There are some subtile differences deeper in the code,
+        * but we use S_ISDIR to check for those.
+        */
+       .rmdir                  = xfs_vn_unlink,
+       .mknod                  = xfs_vn_mknod,
+       .rename                 = xfs_vn_rename,
+       .permission             = xfs_vn_permission,
+       .getattr                = xfs_vn_getattr,
+       .setattr                = xfs_vn_setattr,
+       .setxattr               = generic_setxattr,
+       .getxattr               = generic_getxattr,
+       .removexattr            = generic_removexattr,
+       .listxattr              = xfs_vn_listxattr,
+};
+
+const struct inode_operations xfs_dir_ci_inode_operations = {
+       .create                 = xfs_vn_create,
+       .lookup                 = xfs_vn_ci_lookup,
+       .link                   = xfs_vn_link,
+       .unlink                 = xfs_vn_unlink,
+       .symlink                = xfs_vn_symlink,
+       .mkdir                  = xfs_vn_mkdir,
+       /*
+        * Yes, XFS uses the same method for rmdir and unlink.
+        *
+        * There are some subtile differences deeper in the code,
+        * but we use S_ISDIR to check for those.
+        */
+       .rmdir                  = xfs_vn_unlink,
        .mknod                  = xfs_vn_mknod,
        .rename                 = xfs_vn_rename,
        .permission             = xfs_vn_permission,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
-       .setxattr               = xfs_vn_setxattr,
-       .getxattr               = xfs_vn_getxattr,
+       .setxattr               = generic_setxattr,
+       .getxattr               = generic_getxattr,
+       .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
-       .removexattr            = xfs_vn_removexattr,
 };
 
 const struct inode_operations xfs_symlink_inode_operations = {
@@ -910,8 +779,8 @@ const struct inode_operations xfs_symlink_inode_operations = {
        .permission             = xfs_vn_permission,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
-       .setxattr               = xfs_vn_setxattr,
-       .getxattr               = xfs_vn_getxattr,
+       .setxattr               = generic_setxattr,
+       .getxattr               = generic_getxattr,
+       .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
-       .removexattr            = xfs_vn_removexattr,
 };
index 14d0deb7afff2f57acfb65b7ec1d6de40f0aecc9..d97ba934a2ac8df74ff3a07cf18f7ad4cd53ddc0 100644 (file)
 
 extern const struct inode_operations xfs_inode_operations;
 extern const struct inode_operations xfs_dir_inode_operations;
+extern const struct inode_operations xfs_dir_ci_inode_operations;
 extern const struct inode_operations xfs_symlink_inode_operations;
 
 extern const struct file_operations xfs_file_operations;
 extern const struct file_operations xfs_dir_file_operations;
 extern const struct file_operations xfs_invis_file_operations;
 
+extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size);
 
 struct xfs_inode;
 extern void xfs_ichgtime(struct xfs_inode *, int);
index 4edc46915b575a7eb1261f2bda587cfbccfe0462..4d45d9351a6c7d0faef80065b73cc235714be712 100644 (file)
@@ -76,6 +76,7 @@
 #include <linux/log2.h>
 #include <linux/spinlock.h>
 #include <linux/random.h>
+#include <linux/ctype.h>
 
 #include <asm/page.h>
 #include <asm/div64.h>
@@ -299,4 +300,11 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
        return x;
 }
 
+/* ARM old ABI has some weird alignment/padding */
+#if defined(__arm__) && !defined(__ARM_EABI__)
+#define __arch_pack __attribute__((packed))
+#else
+#define __arch_pack
+#endif
+
 #endif /* __XFS_LINUX__ */
index e480b610205198db045d49c623f39578eca1636a..3d5b67c075c7ab5b927884313f35196fd9249e80 100644 (file)
@@ -98,12 +98,21 @@ xfs_read_xfsstats(
        return len;
 }
 
-void
+int
 xfs_init_procfs(void)
 {
        if (!proc_mkdir("fs/xfs", NULL))
-               return;
-       create_proc_read_entry("fs/xfs/stat", 0, NULL, xfs_read_xfsstats, NULL);
+               goto out;
+
+       if (!create_proc_read_entry("fs/xfs/stat", 0, NULL,
+                       xfs_read_xfsstats, NULL))
+               goto out_remove_entry;
+       return 0;
+
+ out_remove_entry:
+       remove_proc_entry("fs/xfs", NULL);
+ out:
+       return -ENOMEM;
 }
 
 void
index afd0b0d5fdb26f1731e231045935f40e8e55317c..e83820febc9feacc8b642f3555d147017048c1c8 100644 (file)
@@ -134,7 +134,7 @@ DECLARE_PER_CPU(struct xfsstats, xfsstats);
 #define XFS_STATS_DEC(v)       (per_cpu(xfsstats, current_cpu()).v--)
 #define XFS_STATS_ADD(v, inc)  (per_cpu(xfsstats, current_cpu()).v += (inc))
 
-extern void xfs_init_procfs(void);
+extern int xfs_init_procfs(void);
 extern void xfs_cleanup_procfs(void);
 
 
@@ -144,8 +144,14 @@ extern void xfs_cleanup_procfs(void);
 # define XFS_STATS_DEC(count)
 # define XFS_STATS_ADD(count, inc)
 
-static inline void xfs_init_procfs(void) { };
-static inline void xfs_cleanup_procfs(void) { };
+static inline int xfs_init_procfs(void)
+{
+       return 0;
+}
+
+static inline void xfs_cleanup_procfs(void)
+{
+}
 
 #endif /* !CONFIG_PROC_FS */
 
index 943381284e2e842245b42137b7516c84220cef86..30ae96397e318854ab0eb93ecc124916e04bfde5 100644 (file)
 #include "xfs_version.h"
 #include "xfs_log_priv.h"
 #include "xfs_trans_priv.h"
+#include "xfs_filestream.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_extfree_item.h"
+#include "xfs_mru_cache.h"
+#include "xfs_inode_item.h"
 
 #include <linux/namei.h>
 #include <linux/init.h>
@@ -60,6 +66,7 @@
 #include <linux/writeback.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
+#include <linux/parser.h>
 
 static struct quotactl_ops xfs_quotactl_operations;
 static struct super_operations xfs_super_operations;
@@ -74,7 +81,10 @@ xfs_args_allocate(
 {
        struct xfs_mount_args   *args;
 
-       args = kmem_zalloc(sizeof(struct xfs_mount_args), KM_SLEEP);
+       args = kzalloc(sizeof(struct xfs_mount_args), GFP_KERNEL);
+       if (!args)
+               return NULL;
+
        args->logbufs = args->logbufsize = -1;
        strncpy(args->fsname, sb->s_id, MAXNAMELEN);
 
@@ -138,6 +148,23 @@ xfs_args_allocate(
 #define MNTOPT_XDSM    "xdsm"          /* DMI enabled (DMAPI / XDSM) */
 #define MNTOPT_DMI     "dmi"           /* DMI enabled (DMAPI / XDSM) */
 
+/*
+ * Table driven mount option parser.
+ *
+ * Currently only used for remount, but it will be used for mount
+ * in the future, too.
+ */
+enum {
+       Opt_barrier, Opt_nobarrier, Opt_err
+};
+
+static match_table_t tokens = {
+       {Opt_barrier, "barrier"},
+       {Opt_nobarrier, "nobarrier"},
+       {Opt_err, NULL}
+};
+
+
 STATIC unsigned long
 suffix_strtoul(char *s, char **endp, unsigned int base)
 {
@@ -314,6 +341,7 @@ xfs_parseargs(
                        args->flags |= XFSMNT_ATTR2;
                } else if (!strcmp(this_char, MNTOPT_NOATTR2)) {
                        args->flags &= ~XFSMNT_ATTR2;
+                       args->flags |= XFSMNT_NOATTR2;
                } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) {
                        args->flags2 |= XFSMNT2_FILESTREAMS;
                } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) {
@@ -564,7 +592,10 @@ xfs_set_inodeops(
                inode->i_mapping->a_ops = &xfs_address_space_operations;
                break;
        case S_IFDIR:
-               inode->i_op = &xfs_dir_inode_operations;
+               if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb))
+                       inode->i_op = &xfs_dir_ci_inode_operations;
+               else
+                       inode->i_op = &xfs_dir_inode_operations;
                inode->i_fop = &xfs_dir_file_operations;
                break;
        case S_IFLNK:
@@ -733,14 +764,6 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp)
                return;
        }
 
-       if (mp->m_ddev_targp->bt_bdev->bd_disk->queue->ordered ==
-                                       QUEUE_ORDERED_NONE) {
-               xfs_fs_cmn_err(CE_NOTE, mp,
-                 "Disabling barriers, not supported by the underlying device");
-               mp->m_flags &= ~XFS_MOUNT_BARRIER;
-               return;
-       }
-
        if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
                xfs_fs_cmn_err(CE_NOTE, mp,
                  "Disabling barriers, underlying device is readonly");
@@ -764,6 +787,139 @@ xfs_blkdev_issue_flush(
        blkdev_issue_flush(buftarg->bt_bdev, NULL);
 }
 
+STATIC void
+xfs_close_devices(
+       struct xfs_mount        *mp)
+{
+       if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
+               struct block_device *logdev = mp->m_logdev_targp->bt_bdev;
+               xfs_free_buftarg(mp->m_logdev_targp);
+               xfs_blkdev_put(logdev);
+       }
+       if (mp->m_rtdev_targp) {
+               struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev;
+               xfs_free_buftarg(mp->m_rtdev_targp);
+               xfs_blkdev_put(rtdev);
+       }
+       xfs_free_buftarg(mp->m_ddev_targp);
+}
+
+/*
+ * The file system configurations are:
+ *     (1) device (partition) with data and internal log
+ *     (2) logical volume with data and log subvolumes.
+ *     (3) logical volume with data, log, and realtime subvolumes.
+ *
+ * We only have to handle opening the log and realtime volumes here if
+ * they are present.  The data subvolume has already been opened by
+ * get_sb_bdev() and is stored in sb->s_bdev.
+ */
+STATIC int
+xfs_open_devices(
+       struct xfs_mount        *mp,
+       struct xfs_mount_args   *args)
+{
+       struct block_device     *ddev = mp->m_super->s_bdev;
+       struct block_device     *logdev = NULL, *rtdev = NULL;
+       int                     error;
+
+       /*
+        * Open real time and log devices - order is important.
+        */
+       if (args->logname[0]) {
+               error = xfs_blkdev_get(mp, args->logname, &logdev);
+               if (error)
+                       goto out;
+       }
+
+       if (args->rtname[0]) {
+               error = xfs_blkdev_get(mp, args->rtname, &rtdev);
+               if (error)
+                       goto out_close_logdev;
+
+               if (rtdev == ddev || rtdev == logdev) {
+                       cmn_err(CE_WARN,
+       "XFS: Cannot mount filesystem with identical rtdev and ddev/logdev.");
+                       error = EINVAL;
+                       goto out_close_rtdev;
+               }
+       }
+
+       /*
+        * Setup xfs_mount buffer target pointers
+        */
+       error = ENOMEM;
+       mp->m_ddev_targp = xfs_alloc_buftarg(ddev, 0);
+       if (!mp->m_ddev_targp)
+               goto out_close_rtdev;
+
+       if (rtdev) {
+               mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev, 1);
+               if (!mp->m_rtdev_targp)
+                       goto out_free_ddev_targ;
+       }
+
+       if (logdev && logdev != ddev) {
+               mp->m_logdev_targp = xfs_alloc_buftarg(logdev, 1);
+               if (!mp->m_logdev_targp)
+                       goto out_free_rtdev_targ;
+       } else {
+               mp->m_logdev_targp = mp->m_ddev_targp;
+       }
+
+       return 0;
+
+ out_free_rtdev_targ:
+       if (mp->m_rtdev_targp)
+               xfs_free_buftarg(mp->m_rtdev_targp);
+ out_free_ddev_targ:
+       xfs_free_buftarg(mp->m_ddev_targp);
+ out_close_rtdev:
+       if (rtdev)
+               xfs_blkdev_put(rtdev);
+ out_close_logdev:
+       if (logdev && logdev != ddev)
+               xfs_blkdev_put(logdev);
+ out:
+       return error;
+}
+
+/*
+ * Setup xfs_mount buffer target pointers based on superblock
+ */
+STATIC int
+xfs_setup_devices(
+       struct xfs_mount        *mp)
+{
+       int                     error;
+
+       error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
+                                   mp->m_sb.sb_sectsize);
+       if (error)
+               return error;
+
+       if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
+               unsigned int    log_sector_size = BBSIZE;
+
+               if (xfs_sb_version_hassector(&mp->m_sb))
+                       log_sector_size = mp->m_sb.sb_logsectsize;
+               error = xfs_setsize_buftarg(mp->m_logdev_targp,
+                                           mp->m_sb.sb_blocksize,
+                                           log_sector_size);
+               if (error)
+                       return error;
+       }
+       if (mp->m_rtdev_targp) {
+               error = xfs_setsize_buftarg(mp->m_rtdev_targp,
+                                           mp->m_sb.sb_blocksize,
+                                           mp->m_sb.sb_sectsize);
+               if (error)
+                       return error;
+       }
+
+       return 0;
+}
+
 /*
  * XFS AIL push thread support
  */
@@ -848,42 +1004,6 @@ xfs_fs_inode_init_once(
        inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
 }
 
-STATIC int __init
-xfs_init_zones(void)
-{
-       xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
-                                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
-                                       KM_ZONE_SPREAD,
-                                       xfs_fs_inode_init_once);
-       if (!xfs_vnode_zone)
-               goto out;
-
-       xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend");
-       if (!xfs_ioend_zone)
-               goto out_destroy_vnode_zone;
-
-       xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE,
-                                                 xfs_ioend_zone);
-       if (!xfs_ioend_pool)
-               goto out_free_ioend_zone;
-       return 0;
-
- out_free_ioend_zone:
-       kmem_zone_destroy(xfs_ioend_zone);
- out_destroy_vnode_zone:
-       kmem_zone_destroy(xfs_vnode_zone);
- out:
-       return -ENOMEM;
-}
-
-STATIC void
-xfs_destroy_zones(void)
-{
-       mempool_destroy(xfs_ioend_pool);
-       kmem_zone_destroy(xfs_vnode_zone);
-       kmem_zone_destroy(xfs_ioend_zone);
-}
-
 /*
  * Attempt to flush the inode, this will actually fail
  * if the inode is pinned, but we dirty the inode again
@@ -1073,7 +1193,7 @@ xfssyncd(
                        list_del(&work->w_list);
                        if (work == &mp->m_sync_work)
                                continue;
-                       kmem_free(work, sizeof(struct bhv_vfs_sync_work));
+                       kmem_free(work);
                }
        }
 
@@ -1085,14 +1205,63 @@ xfs_fs_put_super(
        struct super_block      *sb)
 {
        struct xfs_mount        *mp = XFS_M(sb);
+       struct xfs_inode        *rip = mp->m_rootip;
+       int                     unmount_event_flags = 0;
        int                     error;
 
        kthread_stop(mp->m_sync_task);
 
        xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI);
-       error = xfs_unmount(mp, 0, NULL);
-       if (error)
-               printk("XFS: unmount got error=%d\n", error);
+
+#ifdef HAVE_DMAPI
+       if (mp->m_flags & XFS_MOUNT_DMAPI) {
+               unmount_event_flags =
+                       (mp->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ?
+                               0 : DM_FLAGS_UNWANTED;
+               /*
+                * Ignore error from dmapi here, first unmount is not allowed
+                * to fail anyway, and second we wouldn't want to fail a
+                * unmount because of dmapi.
+                */
+               XFS_SEND_PREUNMOUNT(mp, rip, DM_RIGHT_NULL, rip, DM_RIGHT_NULL,
+                               NULL, NULL, 0, 0, unmount_event_flags);
+       }
+#endif
+
+       /*
+        * Blow away any referenced inode in the filestreams cache.
+        * This can and will cause log traffic as inodes go inactive
+        * here.
+        */
+       xfs_filestream_unmount(mp);
+
+       XFS_bflush(mp->m_ddev_targp);
+       error = xfs_unmount_flush(mp, 0);
+       WARN_ON(error);
+
+       IRELE(rip);
+
+       /*
+        * If we're forcing a shutdown, typically because of a media error,
+        * we want to make sure we invalidate dirty pages that belong to
+        * referenced vnodes as well.
+        */
+       if (XFS_FORCED_SHUTDOWN(mp)) {
+               error = xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE);
+               ASSERT(error != EFSCORRUPTED);
+       }
+
+       if (mp->m_flags & XFS_MOUNT_DMAPI) {
+               XFS_SEND_UNMOUNT(mp, rip, DM_RIGHT_NULL, 0, 0,
+                               unmount_event_flags);
+       }
+
+       xfs_unmountfs(mp);
+       xfs_icsb_destroy_counters(mp);
+       xfs_close_devices(mp);
+       xfs_qmops_put(mp);
+       xfs_dmops_put(mp);
+       kfree(mp);
 }
 
 STATIC void
@@ -1215,14 +1384,54 @@ xfs_fs_remount(
        char                    *options)
 {
        struct xfs_mount        *mp = XFS_M(sb);
-       struct xfs_mount_args   *args = xfs_args_allocate(sb, 0);
-       int                     error;
+       substring_t             args[MAX_OPT_ARGS];
+       char                    *p;
 
-       error = xfs_parseargs(mp, options, args, 1);
-       if (!error)
-               error = xfs_mntupdate(mp, flags, args);
-       kmem_free(args, sizeof(*args));
-       return -error;
+       while ((p = strsep(&options, ",")) != NULL) {
+               int token;
+
+               if (!*p)
+                       continue;
+
+               token = match_token(p, tokens, args);
+               switch (token) {
+               case Opt_barrier:
+                       mp->m_flags |= XFS_MOUNT_BARRIER;
+
+                       /*
+                        * Test if barriers are actually working if we can,
+                        * else delay this check until the filesystem is
+                        * marked writeable.
+                        */
+                       if (!(mp->m_flags & XFS_MOUNT_RDONLY))
+                               xfs_mountfs_check_barriers(mp);
+                       break;
+               case Opt_nobarrier:
+                       mp->m_flags &= ~XFS_MOUNT_BARRIER;
+                       break;
+               default:
+                       printk(KERN_INFO
+       "XFS: mount option \"%s\" not supported for remount\n", p);
+                       return -EINVAL;
+               }
+       }
+
+       /* rw/ro -> rw */
+       if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) {
+               mp->m_flags &= ~XFS_MOUNT_RDONLY;
+               if (mp->m_flags & XFS_MOUNT_BARRIER)
+                       xfs_mountfs_check_barriers(mp);
+       }
+
+       /* rw -> ro */
+       if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (*flags & MS_RDONLY)) {
+               xfs_filestream_flush(mp);
+               xfs_sync(mp, SYNC_DATA_QUIESCE);
+               xfs_attr_quiesce(mp);
+               mp->m_flags |= XFS_MOUNT_RDONLY;
+       }
+
+       return 0;
 }
 
 /*
@@ -1299,6 +1508,225 @@ xfs_fs_setxquota(
                                   Q_XSETPQLIM), id, (caddr_t)fdq);
 }
 
+/*
+ * This function fills in xfs_mount_t fields based on mount args.
+ * Note: the superblock has _not_ yet been read in.
+ */
+STATIC int
+xfs_start_flags(
+       struct xfs_mount_args   *ap,
+       struct xfs_mount        *mp)
+{
+       /* Values are in BBs */
+       if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
+               /*
+                * At this point the superblock has not been read
+                * in, therefore we do not know the block size.
+                * Before the mount call ends we will convert
+                * these to FSBs.
+                */
+               mp->m_dalign = ap->sunit;
+               mp->m_swidth = ap->swidth;
+       }
+
+       if (ap->logbufs != -1 &&
+           ap->logbufs != 0 &&
+           (ap->logbufs < XLOG_MIN_ICLOGS ||
+            ap->logbufs > XLOG_MAX_ICLOGS)) {
+               cmn_err(CE_WARN,
+                       "XFS: invalid logbufs value: %d [not %d-%d]",
+                       ap->logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS);
+               return XFS_ERROR(EINVAL);
+       }
+       mp->m_logbufs = ap->logbufs;
+       if (ap->logbufsize != -1 &&
+           ap->logbufsize !=  0 &&
+           (ap->logbufsize < XLOG_MIN_RECORD_BSIZE ||
+            ap->logbufsize > XLOG_MAX_RECORD_BSIZE ||
+            !is_power_of_2(ap->logbufsize))) {
+               cmn_err(CE_WARN,
+       "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]",
+                       ap->logbufsize);
+               return XFS_ERROR(EINVAL);
+       }
+       mp->m_logbsize = ap->logbufsize;
+       mp->m_fsname_len = strlen(ap->fsname) + 1;
+       mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
+       strcpy(mp->m_fsname, ap->fsname);
+       if (ap->rtname[0]) {
+               mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP);
+               strcpy(mp->m_rtname, ap->rtname);
+       }
+       if (ap->logname[0]) {
+               mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP);
+               strcpy(mp->m_logname, ap->logname);
+       }
+
+       if (ap->flags & XFSMNT_WSYNC)
+               mp->m_flags |= XFS_MOUNT_WSYNC;
+#if XFS_BIG_INUMS
+       if (ap->flags & XFSMNT_INO64) {
+               mp->m_flags |= XFS_MOUNT_INO64;
+               mp->m_inoadd = XFS_INO64_OFFSET;
+       }
+#endif
+       if (ap->flags & XFSMNT_RETERR)
+               mp->m_flags |= XFS_MOUNT_RETERR;
+       if (ap->flags & XFSMNT_NOALIGN)
+               mp->m_flags |= XFS_MOUNT_NOALIGN;
+       if (ap->flags & XFSMNT_SWALLOC)
+               mp->m_flags |= XFS_MOUNT_SWALLOC;
+       if (ap->flags & XFSMNT_OSYNCISOSYNC)
+               mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
+       if (ap->flags & XFSMNT_32BITINODES)
+               mp->m_flags |= XFS_MOUNT_32BITINODES;
+
+       if (ap->flags & XFSMNT_IOSIZE) {
+               if (ap->iosizelog > XFS_MAX_IO_LOG ||
+                   ap->iosizelog < XFS_MIN_IO_LOG) {
+                       cmn_err(CE_WARN,
+               "XFS: invalid log iosize: %d [not %d-%d]",
+                               ap->iosizelog, XFS_MIN_IO_LOG,
+                               XFS_MAX_IO_LOG);
+                       return XFS_ERROR(EINVAL);
+               }
+
+               mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE;
+               mp->m_readio_log = mp->m_writeio_log = ap->iosizelog;
+       }
+
+       if (ap->flags & XFSMNT_IKEEP)
+               mp->m_flags |= XFS_MOUNT_IKEEP;
+       if (ap->flags & XFSMNT_DIRSYNC)
+               mp->m_flags |= XFS_MOUNT_DIRSYNC;
+       if (ap->flags & XFSMNT_ATTR2)
+               mp->m_flags |= XFS_MOUNT_ATTR2;
+       if (ap->flags & XFSMNT_NOATTR2)
+               mp->m_flags |= XFS_MOUNT_NOATTR2;
+
+       if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
+               mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
+
+       /*
+        * no recovery flag requires a read-only mount
+        */
+       if (ap->flags & XFSMNT_NORECOVERY) {
+               if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
+                       cmn_err(CE_WARN,
+       "XFS: tried to mount a FS read-write without recovery!");
+                       return XFS_ERROR(EINVAL);
+               }
+               mp->m_flags |= XFS_MOUNT_NORECOVERY;
+       }
+
+       if (ap->flags & XFSMNT_NOUUID)
+               mp->m_flags |= XFS_MOUNT_NOUUID;
+       if (ap->flags & XFSMNT_BARRIER)
+               mp->m_flags |= XFS_MOUNT_BARRIER;
+       else
+               mp->m_flags &= ~XFS_MOUNT_BARRIER;
+
+       if (ap->flags2 & XFSMNT2_FILESTREAMS)
+               mp->m_flags |= XFS_MOUNT_FILESTREAMS;
+
+       if (ap->flags & XFSMNT_DMAPI)
+               mp->m_flags |= XFS_MOUNT_DMAPI;
+       return 0;
+}
+
+/*
+ * This function fills in xfs_mount_t fields based on mount args.
+ * Note: the superblock _has_ now been read in.
+ */
+STATIC int
+xfs_finish_flags(
+       struct xfs_mount_args   *ap,
+       struct xfs_mount        *mp)
+{
+       int                     ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
+
+       /* Fail a mount where the logbuf is smaller then the log stripe */
+       if (xfs_sb_version_haslogv2(&mp->m_sb)) {
+               if ((ap->logbufsize <= 0) &&
+                   (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) {
+                       mp->m_logbsize = mp->m_sb.sb_logsunit;
+               } else if (ap->logbufsize > 0 &&
+                          ap->logbufsize < mp->m_sb.sb_logsunit) {
+                       cmn_err(CE_WARN,
+       "XFS: logbuf size must be greater than or equal to log stripe size");
+                       return XFS_ERROR(EINVAL);
+               }
+       } else {
+               /* Fail a mount if the logbuf is larger than 32K */
+               if (ap->logbufsize > XLOG_BIG_RECORD_BSIZE) {
+                       cmn_err(CE_WARN,
+       "XFS: logbuf size for version 1 logs must be 16K or 32K");
+                       return XFS_ERROR(EINVAL);
+               }
+       }
+
+       /*
+        * mkfs'ed attr2 will turn on attr2 mount unless explicitly
+        * told by noattr2 to turn it off
+        */
+       if (xfs_sb_version_hasattr2(&mp->m_sb) &&
+           !(ap->flags & XFSMNT_NOATTR2))
+               mp->m_flags |= XFS_MOUNT_ATTR2;
+
+       /*
+        * prohibit r/w mounts of read-only filesystems
+        */
+       if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) {
+               cmn_err(CE_WARN,
+       "XFS: cannot mount a read-only filesystem as read-write");
+               return XFS_ERROR(EROFS);
+       }
+
+       /*
+        * check for shared mount.
+        */
+       if (ap->flags & XFSMNT_SHARED) {
+               if (!xfs_sb_version_hasshared(&mp->m_sb))
+                       return XFS_ERROR(EINVAL);
+
+               /*
+                * For IRIX 6.5, shared mounts must have the shared
+                * version bit set, have the persistent readonly
+                * field set, must be version 0 and can only be mounted
+                * read-only.
+                */
+               if (!ronly || !(mp->m_sb.sb_flags & XFS_SBF_READONLY) ||
+                    (mp->m_sb.sb_shared_vn != 0))
+                       return XFS_ERROR(EINVAL);
+
+               mp->m_flags |= XFS_MOUNT_SHARED;
+
+               /*
+                * Shared XFS V0 can't deal with DMI.  Return EINVAL.
+                */
+               if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI))
+                       return XFS_ERROR(EINVAL);
+       }
+
+       if (ap->flags & XFSMNT_UQUOTA) {
+               mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE);
+               if (ap->flags & XFSMNT_UQUOTAENF)
+                       mp->m_qflags |= XFS_UQUOTA_ENFD;
+       }
+
+       if (ap->flags & XFSMNT_GQUOTA) {
+               mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE);
+               if (ap->flags & XFSMNT_GQUOTAENF)
+                       mp->m_qflags |= XFS_OQUOTA_ENFD;
+       } else if (ap->flags & XFSMNT_PQUOTA) {
+               mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE);
+               if (ap->flags & XFSMNT_PQUOTAENF)
+                       mp->m_qflags |= XFS_OQUOTA_ENFD;
+       }
+
+       return 0;
+}
+
 STATIC int
 xfs_fs_fill_super(
        struct super_block      *sb,
@@ -1307,11 +1735,21 @@ xfs_fs_fill_super(
 {
        struct inode            *root;
        struct xfs_mount        *mp = NULL;
-       struct xfs_mount_args   *args = xfs_args_allocate(sb, silent);
-       int                     error;
+       struct xfs_mount_args   *args;
+       int                     flags = 0, error = ENOMEM;
+
+       args = xfs_args_allocate(sb, silent);
+       if (!args)
+               return -ENOMEM;
 
-       mp = xfs_mount_init();
+       mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
+       if (!mp)
+               goto out_free_args;
 
+       spin_lock_init(&mp->m_sb_lock);
+       mutex_init(&mp->m_ilock);
+       mutex_init(&mp->m_growlock);
+       atomic_set(&mp->m_active_trans, 0);
        INIT_LIST_HEAD(&mp->m_sync_list);
        spin_lock_init(&mp->m_sync_lock);
        init_waitqueue_head(&mp->m_wait_single_sync_task);
@@ -1324,16 +1762,60 @@ xfs_fs_fill_super(
 
        error = xfs_parseargs(mp, (char *)data, args, 0);
        if (error)
-               goto fail_vfsop;
+               goto out_free_mp;
 
        sb_min_blocksize(sb, BBSIZE);
+       sb->s_xattr = xfs_xattr_handlers;
        sb->s_export_op = &xfs_export_operations;
        sb->s_qcop = &xfs_quotactl_operations;
        sb->s_op = &xfs_super_operations;
 
-       error = xfs_mount(mp, args, NULL);
+       error = xfs_dmops_get(mp, args);
        if (error)
-               goto fail_vfsop;
+               goto out_free_mp;
+       error = xfs_qmops_get(mp, args);
+       if (error)
+               goto out_put_dmops;
+
+       if (args->flags & XFSMNT_QUIET)
+               flags |= XFS_MFSI_QUIET;
+
+       error = xfs_open_devices(mp, args);
+       if (error)
+               goto out_put_qmops;
+
+       if (xfs_icsb_init_counters(mp))
+               mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
+
+       /*
+        * Setup flags based on mount(2) options and then the superblock
+        */
+       error = xfs_start_flags(args, mp);
+       if (error)
+               goto out_destroy_counters;
+       error = xfs_readsb(mp, flags);
+       if (error)
+               goto out_destroy_counters;
+       error = xfs_finish_flags(args, mp);
+       if (error)
+               goto out_free_sb;
+
+       error = xfs_setup_devices(mp);
+       if (error)
+               goto out_free_sb;
+
+       if (mp->m_flags & XFS_MOUNT_BARRIER)
+               xfs_mountfs_check_barriers(mp);
+
+       error = xfs_filestream_mount(mp);
+       if (error)
+               goto out_free_sb;
+
+       error = xfs_mountfs(mp, flags);
+       if (error)
+               goto out_filestream_unmount;
+
+       XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname);
 
        sb->s_dirt = 1;
        sb->s_magic = XFS_SB_MAGIC;
@@ -1368,10 +1850,27 @@ xfs_fs_fill_super(
 
        xfs_itrace_exit(XFS_I(sb->s_root->d_inode));
 
-       kmem_free(args, sizeof(*args));
+       kfree(args);
        return 0;
 
-fail_vnrele:
+ out_filestream_unmount:
+       xfs_filestream_unmount(mp);
+ out_free_sb:
+       xfs_freesb(mp);
+ out_destroy_counters:
+       xfs_icsb_destroy_counters(mp);
+       xfs_close_devices(mp);
+ out_put_qmops:
+       xfs_qmops_put(mp);
+ out_put_dmops:
+       xfs_dmops_put(mp);
+ out_free_mp:
+       kfree(mp);
+ out_free_args:
+       kfree(args);
+       return -error;
+
+ fail_vnrele:
        if (sb->s_root) {
                dput(sb->s_root);
                sb->s_root = NULL;
@@ -1379,12 +1878,22 @@ fail_vnrele:
                iput(root);
        }
 
-fail_unmount:
-       xfs_unmount(mp, 0, NULL);
+ fail_unmount:
+       /*
+        * Blow away any referenced inode in the filestreams cache.
+        * This can and will cause log traffic as inodes go inactive
+        * here.
+        */
+       xfs_filestream_unmount(mp);
 
-fail_vfsop:
-       kmem_free(args, sizeof(*args));
-       return -error;
+       XFS_bflush(mp->m_ddev_targp);
+       error = xfs_unmount_flush(mp, 0);
+       WARN_ON(error);
+
+       IRELE(mp->m_rootip);
+
+       xfs_unmountfs(mp);
+       goto out_destroy_counters;
 }
 
 STATIC int
@@ -1429,9 +1938,235 @@ static struct file_system_type xfs_fs_type = {
        .fs_flags               = FS_REQUIRES_DEV,
 };
 
+STATIC int __init
+xfs_alloc_trace_bufs(void)
+{
+#ifdef XFS_ALLOC_TRACE
+       xfs_alloc_trace_buf = ktrace_alloc(XFS_ALLOC_TRACE_SIZE, KM_MAYFAIL);
+       if (!xfs_alloc_trace_buf)
+               goto out;
+#endif
+#ifdef XFS_BMAP_TRACE
+       xfs_bmap_trace_buf = ktrace_alloc(XFS_BMAP_TRACE_SIZE, KM_MAYFAIL);
+       if (!xfs_bmap_trace_buf)
+               goto out_free_alloc_trace;
+#endif
+#ifdef XFS_BMBT_TRACE
+       xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL);
+       if (!xfs_bmbt_trace_buf)
+               goto out_free_bmap_trace;
+#endif
+#ifdef XFS_ATTR_TRACE
+       xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL);
+       if (!xfs_attr_trace_buf)
+               goto out_free_bmbt_trace;
+#endif
+#ifdef XFS_DIR2_TRACE
+       xfs_dir2_trace_buf = ktrace_alloc(XFS_DIR2_GTRACE_SIZE, KM_MAYFAIL);
+       if (!xfs_dir2_trace_buf)
+               goto out_free_attr_trace;
+#endif
+
+       return 0;
+
+#ifdef XFS_DIR2_TRACE
+ out_free_attr_trace:
+#endif
+#ifdef XFS_ATTR_TRACE
+       ktrace_free(xfs_attr_trace_buf);
+ out_free_bmbt_trace:
+#endif
+#ifdef XFS_BMBT_TRACE
+       ktrace_free(xfs_bmbt_trace_buf);
+ out_free_bmap_trace:
+#endif
+#ifdef XFS_BMAP_TRACE
+       ktrace_free(xfs_bmap_trace_buf);
+ out_free_alloc_trace:
+#endif
+#ifdef XFS_ALLOC_TRACE
+       ktrace_free(xfs_alloc_trace_buf);
+ out:
+#endif
+       return -ENOMEM;
+}
+
+STATIC void
+xfs_free_trace_bufs(void)
+{
+#ifdef XFS_DIR2_TRACE
+       ktrace_free(xfs_dir2_trace_buf);
+#endif
+#ifdef XFS_ATTR_TRACE
+       ktrace_free(xfs_attr_trace_buf);
+#endif
+#ifdef XFS_BMBT_TRACE
+       ktrace_free(xfs_bmbt_trace_buf);
+#endif
+#ifdef XFS_BMAP_TRACE
+       ktrace_free(xfs_bmap_trace_buf);
+#endif
+#ifdef XFS_ALLOC_TRACE
+       ktrace_free(xfs_alloc_trace_buf);
+#endif
+}
 
 STATIC int __init
-init_xfs_fs( void )
+xfs_init_zones(void)
+{
+       xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
+                                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
+                                       KM_ZONE_SPREAD,
+                                       xfs_fs_inode_init_once);
+       if (!xfs_vnode_zone)
+               goto out;
+
+       xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend");
+       if (!xfs_ioend_zone)
+               goto out_destroy_vnode_zone;
+
+       xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE,
+                                                 xfs_ioend_zone);
+       if (!xfs_ioend_pool)
+               goto out_destroy_ioend_zone;
+
+       xfs_log_ticket_zone = kmem_zone_init(sizeof(xlog_ticket_t),
+                                               "xfs_log_ticket");
+       if (!xfs_log_ticket_zone)
+               goto out_destroy_ioend_pool;
+
+       xfs_bmap_free_item_zone = kmem_zone_init(sizeof(xfs_bmap_free_item_t),
+                                               "xfs_bmap_free_item");
+       if (!xfs_bmap_free_item_zone)
+               goto out_destroy_log_ticket_zone;
+       xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t),
+                                               "xfs_btree_cur");
+       if (!xfs_btree_cur_zone)
+               goto out_destroy_bmap_free_item_zone;
+
+       xfs_da_state_zone = kmem_zone_init(sizeof(xfs_da_state_t),
+                                               "xfs_da_state");
+       if (!xfs_da_state_zone)
+               goto out_destroy_btree_cur_zone;
+
+       xfs_dabuf_zone = kmem_zone_init(sizeof(xfs_dabuf_t), "xfs_dabuf");
+       if (!xfs_dabuf_zone)
+               goto out_destroy_da_state_zone;
+
+       xfs_ifork_zone = kmem_zone_init(sizeof(xfs_ifork_t), "xfs_ifork");
+       if (!xfs_ifork_zone)
+               goto out_destroy_dabuf_zone;
+
+       xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans");
+       if (!xfs_trans_zone)
+               goto out_destroy_ifork_zone;
+
+       /*
+        * The size of the zone allocated buf log item is the maximum
+        * size possible under XFS.  This wastes a little bit of memory,
+        * but it is much faster.
+        */
+       xfs_buf_item_zone = kmem_zone_init((sizeof(xfs_buf_log_item_t) +
+                               (((XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK) /
+                                 NBWORD) * sizeof(int))), "xfs_buf_item");
+       if (!xfs_buf_item_zone)
+               goto out_destroy_trans_zone;
+
+       xfs_efd_zone = kmem_zone_init((sizeof(xfs_efd_log_item_t) +
+                       ((XFS_EFD_MAX_FAST_EXTENTS - 1) *
+                                sizeof(xfs_extent_t))), "xfs_efd_item");
+       if (!xfs_efd_zone)
+               goto out_destroy_buf_item_zone;
+
+       xfs_efi_zone = kmem_zone_init((sizeof(xfs_efi_log_item_t) +
+                       ((XFS_EFI_MAX_FAST_EXTENTS - 1) *
+                               sizeof(xfs_extent_t))), "xfs_efi_item");
+       if (!xfs_efi_zone)
+               goto out_destroy_efd_zone;
+
+       xfs_inode_zone =
+               kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
+                                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
+                                       KM_ZONE_SPREAD, NULL);
+       if (!xfs_inode_zone)
+               goto out_destroy_efi_zone;
+
+       xfs_ili_zone =
+               kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili",
+                                       KM_ZONE_SPREAD, NULL);
+       if (!xfs_ili_zone)
+               goto out_destroy_inode_zone;
+
+#ifdef CONFIG_XFS_POSIX_ACL
+       xfs_acl_zone = kmem_zone_init(sizeof(xfs_acl_t), "xfs_acl");
+       if (!xfs_acl_zone)
+               goto out_destroy_ili_zone;
+#endif
+
+       return 0;
+
+#ifdef CONFIG_XFS_POSIX_ACL
+ out_destroy_ili_zone:
+#endif
+       kmem_zone_destroy(xfs_ili_zone);
+ out_destroy_inode_zone:
+       kmem_zone_destroy(xfs_inode_zone);
+ out_destroy_efi_zone:
+       kmem_zone_destroy(xfs_efi_zone);
+ out_destroy_efd_zone:
+       kmem_zone_destroy(xfs_efd_zone);
+ out_destroy_buf_item_zone:
+       kmem_zone_destroy(xfs_buf_item_zone);
+ out_destroy_trans_zone:
+       kmem_zone_destroy(xfs_trans_zone);
+ out_destroy_ifork_zone:
+       kmem_zone_destroy(xfs_ifork_zone);
+ out_destroy_dabuf_zone:
+       kmem_zone_destroy(xfs_dabuf_zone);
+ out_destroy_da_state_zone:
+       kmem_zone_destroy(xfs_da_state_zone);
+ out_destroy_btree_cur_zone:
+       kmem_zone_destroy(xfs_btree_cur_zone);
+ out_destroy_bmap_free_item_zone:
+       kmem_zone_destroy(xfs_bmap_free_item_zone);
+ out_destroy_log_ticket_zone:
+       kmem_zone_destroy(xfs_log_ticket_zone);
+ out_destroy_ioend_pool:
+       mempool_destroy(xfs_ioend_pool);
+ out_destroy_ioend_zone:
+       kmem_zone_destroy(xfs_ioend_zone);
+ out_destroy_vnode_zone:
+       kmem_zone_destroy(xfs_vnode_zone);
+ out:
+       return -ENOMEM;
+}
+
+STATIC void
+xfs_destroy_zones(void)
+{
+#ifdef CONFIG_XFS_POSIX_ACL
+       kmem_zone_destroy(xfs_acl_zone);
+#endif
+       kmem_zone_destroy(xfs_ili_zone);
+       kmem_zone_destroy(xfs_inode_zone);
+       kmem_zone_destroy(xfs_efi_zone);
+       kmem_zone_destroy(xfs_efd_zone);
+       kmem_zone_destroy(xfs_buf_item_zone);
+       kmem_zone_destroy(xfs_trans_zone);
+       kmem_zone_destroy(xfs_ifork_zone);
+       kmem_zone_destroy(xfs_dabuf_zone);
+       kmem_zone_destroy(xfs_da_state_zone);
+       kmem_zone_destroy(xfs_btree_cur_zone);
+       kmem_zone_destroy(xfs_bmap_free_item_zone);
+       kmem_zone_destroy(xfs_log_ticket_zone);
+       mempool_destroy(xfs_ioend_pool);
+       kmem_zone_destroy(xfs_ioend_zone);
+       kmem_zone_destroy(xfs_vnode_zone);
+
+}
+
+STATIC int __init
+init_xfs_fs(void)
 {
        int                     error;
        static char             message[] __initdata = KERN_INFO \
@@ -1440,42 +2175,73 @@ init_xfs_fs( void )
        printk(message);
 
        ktrace_init(64);
+       vn_init();
+       xfs_dir_startup();
 
        error = xfs_init_zones();
-       if (error < 0)
-               goto undo_zones;
+       if (error)
+               goto out;
+
+       error = xfs_alloc_trace_bufs();
+       if (error)
+               goto out_destroy_zones;
+
+       error = xfs_mru_cache_init();
+       if (error)
+               goto out_free_trace_buffers;
+
+       error = xfs_filestream_init();
+       if (error)
+               goto out_mru_cache_uninit;
 
        error = xfs_buf_init();
-       if (error < 0)
-               goto undo_buffers;
+       if (error)
+               goto out_filestream_uninit;
+
+       error = xfs_init_procfs();
+       if (error)
+               goto out_buf_terminate;
+
+       error = xfs_sysctl_register();
+       if (error)
+               goto out_cleanup_procfs;
 
-       vn_init();
-       xfs_init();
-       uuid_init();
        vfs_initquota();
 
        error = register_filesystem(&xfs_fs_type);
        if (error)
-               goto undo_register;
+               goto out_sysctl_unregister;
        return 0;
 
-undo_register:
+ out_sysctl_unregister:
+       xfs_sysctl_unregister();
+ out_cleanup_procfs:
+       xfs_cleanup_procfs();
+ out_buf_terminate:
        xfs_buf_terminate();
-
-undo_buffers:
+ out_filestream_uninit:
+       xfs_filestream_uninit();
+ out_mru_cache_uninit:
+       xfs_mru_cache_uninit();
+ out_free_trace_buffers:
+       xfs_free_trace_bufs();
+ out_destroy_zones:
        xfs_destroy_zones();
-
-undo_zones:
+ out:
        return error;
 }
 
 STATIC void __exit
-exit_xfs_fs( void )
+exit_xfs_fs(void)
 {
        vfs_exitquota();
        unregister_filesystem(&xfs_fs_type);
-       xfs_cleanup();
+       xfs_sysctl_unregister();
+       xfs_cleanup_procfs();
        xfs_buf_terminate();
+       xfs_filestream_uninit();
+       xfs_mru_cache_uninit();
+       xfs_free_trace_bufs();
        xfs_destroy_zones();
        ktrace_uninit();
 }
index 3efb7c6d330352201bdb897d200b1f1e76ac295b..b7d13da01bd6d45a0ce826511b1f0332e27dadff 100644 (file)
@@ -107,12 +107,10 @@ extern void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp,
 extern void xfs_flush_inode(struct xfs_inode *);
 extern void xfs_flush_device(struct xfs_inode *);
 
-extern int  xfs_blkdev_get(struct xfs_mount *, const char *,
-                               struct block_device **);
-extern void xfs_blkdev_put(struct block_device *);
 extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
 
 extern const struct export_operations xfs_export_operations;
+extern struct xattr_handler *xfs_xattr_handlers[];
 
 #define XFS_M(sb)              ((struct xfs_mount *)((sb)->s_fs_info))
 
index bb997d75c05c3326c129bd79f57f12aee7d343c1..7dacb5bbde3f30123da154cc1fb3563046b694af 100644 (file)
@@ -259,15 +259,17 @@ static ctl_table xfs_root_table[] = {
        {}
 };
 
-void
+int
 xfs_sysctl_register(void)
 {
        xfs_table_header = register_sysctl_table(xfs_root_table);
+       if (!xfs_table_header)
+               return -ENOMEM;
+       return 0;
 }
 
 void
 xfs_sysctl_unregister(void)
 {
-       if (xfs_table_header)
-               unregister_sysctl_table(xfs_table_header);
+       unregister_sysctl_table(xfs_table_header);
 }
index 98b97e399d6fe7038c5e487d134c7a7ed01334ec..4aadb8056c373c95b0a867e40397234e505d10ae 100644 (file)
@@ -93,10 +93,10 @@ enum {
 extern xfs_param_t     xfs_params;
 
 #ifdef CONFIG_SYSCTL
-extern void xfs_sysctl_register(void);
+extern int xfs_sysctl_register(void);
 extern void xfs_sysctl_unregister(void);
 #else
-# define xfs_sysctl_register()         do { } while (0)
+# define xfs_sysctl_register()         (0)
 # define xfs_sysctl_unregister()       do { } while (0)
 #endif /* CONFIG_SYSCTL */
 
index bc7afe00733801c869840881051f966ea9b553bf..25488b6d98817241e1bb99f6e7b5701701fc6538 100644 (file)
@@ -82,56 +82,6 @@ vn_ioerror(
                xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l);
 }
 
-/*
- * Revalidate the Linux inode from the XFS inode.
- * Note: i_size _not_ updated; we must hold the inode
- * semaphore when doing that - callers responsibility.
- */
-int
-vn_revalidate(
-       bhv_vnode_t             *vp)
-{
-       struct inode            *inode = vn_to_inode(vp);
-       struct xfs_inode        *ip = XFS_I(inode);
-       struct xfs_mount        *mp = ip->i_mount;
-       unsigned long           xflags;
-
-       xfs_itrace_entry(ip);
-
-       if (XFS_FORCED_SHUTDOWN(mp))
-               return -EIO;
-
-       xfs_ilock(ip, XFS_ILOCK_SHARED);
-       inode->i_mode       = ip->i_d.di_mode;
-       inode->i_uid        = ip->i_d.di_uid;
-       inode->i_gid        = ip->i_d.di_gid;
-       inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
-       inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
-       inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
-       inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec;
-
-       xflags = xfs_ip2xflags(ip);
-       if (xflags & XFS_XFLAG_IMMUTABLE)
-               inode->i_flags |= S_IMMUTABLE;
-       else
-               inode->i_flags &= ~S_IMMUTABLE;
-       if (xflags & XFS_XFLAG_APPEND)
-               inode->i_flags |= S_APPEND;
-       else
-               inode->i_flags &= ~S_APPEND;
-       if (xflags & XFS_XFLAG_SYNC)
-               inode->i_flags |= S_SYNC;
-       else
-               inode->i_flags &= ~S_SYNC;
-       if (xflags & XFS_XFLAG_NOATIME)
-               inode->i_flags |= S_NOATIME;
-       else
-               inode->i_flags &= ~S_NOATIME;
-       xfs_iunlock(ip, XFS_ILOCK_SHARED);
-
-       xfs_iflags_clear(ip, XFS_IMODIFIED);
-       return 0;
-}
 
 /*
  * Add a reference to a referenced vnode.
index 25eb2a9e8d9b6cfc1bd859f19476e9372631a857..41ca2cec5d310da74c6b285c8cec9783e3b9e797 100644 (file)
@@ -19,7 +19,6 @@
 #define __XFS_VNODE_H__
 
 struct file;
-struct bhv_vattr;
 struct xfs_iomap;
 struct attrlist_cursor_kern;
 
@@ -66,87 +65,8 @@ static inline struct inode *vn_to_inode(bhv_vnode_t *vnode)
                                           Prevent VM access to the pages until
                                           the operation completes. */
 
-/*
- * Vnode attributes.  va_mask indicates those attributes the caller
- * wants to set or extract.
- */
-typedef struct bhv_vattr {
-       int             va_mask;        /* bit-mask of attributes present */
-       mode_t          va_mode;        /* file access mode and type */
-       xfs_nlink_t     va_nlink;       /* number of references to file */
-       uid_t           va_uid;         /* owner user id */
-       gid_t           va_gid;         /* owner group id */
-       xfs_ino_t       va_nodeid;      /* file id */
-       xfs_off_t       va_size;        /* file size in bytes */
-       u_long          va_blocksize;   /* blocksize preferred for i/o */
-       struct timespec va_atime;       /* time of last access */
-       struct timespec va_mtime;       /* time of last modification */
-       struct timespec va_ctime;       /* time file changed */
-       u_int           va_gen;         /* generation number of file */
-       xfs_dev_t       va_rdev;        /* device the special file represents */
-       __int64_t       va_nblocks;     /* number of blocks allocated */
-       u_long          va_xflags;      /* random extended file flags */
-       u_long          va_extsize;     /* file extent size */
-       u_long          va_nextents;    /* number of extents in file */
-       u_long          va_anextents;   /* number of attr extents in file */
-       prid_t          va_projid;      /* project id */
-} bhv_vattr_t;
-
-/*
- * setattr or getattr attributes
- */
-#define XFS_AT_TYPE            0x00000001
-#define XFS_AT_MODE            0x00000002
-#define XFS_AT_UID             0x00000004
-#define XFS_AT_GID             0x00000008
-#define XFS_AT_FSID            0x00000010
-#define XFS_AT_NODEID          0x00000020
-#define XFS_AT_NLINK           0x00000040
-#define XFS_AT_SIZE            0x00000080
-#define XFS_AT_ATIME           0x00000100
-#define XFS_AT_MTIME           0x00000200
-#define XFS_AT_CTIME           0x00000400
-#define XFS_AT_RDEV            0x00000800
-#define XFS_AT_BLKSIZE         0x00001000
-#define XFS_AT_NBLOCKS         0x00002000
-#define XFS_AT_VCODE           0x00004000
-#define XFS_AT_MAC             0x00008000
-#define XFS_AT_UPDATIME                0x00010000
-#define XFS_AT_UPDMTIME                0x00020000
-#define XFS_AT_UPDCTIME                0x00040000
-#define XFS_AT_ACL             0x00080000
-#define XFS_AT_CAP             0x00100000
-#define XFS_AT_INF             0x00200000
-#define XFS_AT_XFLAGS          0x00400000
-#define XFS_AT_EXTSIZE         0x00800000
-#define XFS_AT_NEXTENTS                0x01000000
-#define XFS_AT_ANEXTENTS       0x02000000
-#define XFS_AT_PROJID          0x04000000
-#define XFS_AT_SIZE_NOPERM     0x08000000
-#define XFS_AT_GENCOUNT                0x10000000
-
-#define XFS_AT_ALL     (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
-               XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
-               XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
-               XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\
-               XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\
-               XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT)
-
-#define XFS_AT_STAT    (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
-               XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
-               XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
-               XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_PROJID)
-
-#define XFS_AT_TIMES   (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME)
-
-#define XFS_AT_UPDTIMES        (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME)
-
-#define XFS_AT_NOSET   (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\
-               XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\
-               XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT)
 
 extern void    vn_init(void);
-extern int     vn_revalidate(bhv_vnode_t *);
 
 /*
  * Yeah, these don't take vnode anymore at all, all this should be
@@ -219,15 +139,6 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
 #define VN_DIRTY(vp)   mapping_tagged(vn_to_inode(vp)->i_mapping, \
                                        PAGECACHE_TAG_DIRTY)
 
-/*
- * Flags to vop_setattr/getattr.
- */
-#define        ATTR_UTIME      0x01    /* non-default utime(2) request */
-#define        ATTR_DMI        0x08    /* invocation from a DMI function */
-#define        ATTR_LAZY       0x80    /* set/get attributes lazily */
-#define        ATTR_NONBLOCK   0x100   /* return EAGAIN if operation would block */
-#define ATTR_NOLOCK    0x200   /* Don't grab any conflicting locks */
-#define ATTR_NOSIZETOK 0x400   /* Don't get the SIZE token */
 
 /*
  * Tracking vnode activity.
diff --git a/fs/xfs/linux-2.6/xfs_xattr.c b/fs/xfs/linux-2.6/xfs_xattr.c
new file mode 100644 (file)
index 0000000..964621f
--- /dev/null
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2008 Christoph Hellwig.
+ * Portions Copyright (C) 2000-2008 Silicon Graphics, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it would 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 the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "xfs.h"
+#include "xfs_da_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_inode.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_acl.h"
+#include "xfs_vnodeops.h"
+
+#include <linux/posix_acl_xattr.h>
+#include <linux/xattr.h>
+
+
+/*
+ * ACL handling.  Should eventually be moved into xfs_acl.c
+ */
+
+static int
+xfs_decode_acl(const char *name)
+{
+       if (strcmp(name, "posix_acl_access") == 0)
+               return _ACL_TYPE_ACCESS;
+       else if (strcmp(name, "posix_acl_default") == 0)
+               return _ACL_TYPE_DEFAULT;
+       return -EINVAL;
+}
+
+/*
+ * Get system extended attributes which at the moment only
+ * includes Posix ACLs.
+ */
+static int
+xfs_xattr_system_get(struct inode *inode, const char *name,
+               void *buffer, size_t size)
+{
+       int acl;
+
+       acl = xfs_decode_acl(name);
+       if (acl < 0)
+               return acl;
+
+       return xfs_acl_vget(inode, buffer, size, acl);
+}
+
+static int
+xfs_xattr_system_set(struct inode *inode, const char *name,
+               const void *value, size_t size, int flags)
+{
+       int acl;
+
+       acl = xfs_decode_acl(name);
+       if (acl < 0)
+               return acl;
+       if (flags & XATTR_CREATE)
+               return -EINVAL;
+
+       if (!value)
+               return xfs_acl_vremove(inode, acl);
+
+       return xfs_acl_vset(inode, (void *)value, size, acl);
+}
+
+static struct xattr_handler xfs_xattr_system_handler = {
+       .prefix = XATTR_SYSTEM_PREFIX,
+       .get    = xfs_xattr_system_get,
+       .set    = xfs_xattr_system_set,
+};
+
+
+/*
+ * Real xattr handling.  The only difference between the namespaces is
+ * a flag passed to the low-level attr code.
+ */
+
+static int
+__xfs_xattr_get(struct inode *inode, const char *name,
+               void *value, size_t size, int xflags)
+{
+       struct xfs_inode *ip = XFS_I(inode);
+       int error, asize = size;
+
+       if (strcmp(name, "") == 0)
+               return -EINVAL;
+
+       /* Convert Linux syscall to XFS internal ATTR flags */
+       if (!size) {
+               xflags |= ATTR_KERNOVAL;
+               value = NULL;
+       }
+
+       error = -xfs_attr_get(ip, name, value, &asize, xflags);
+       if (error)
+               return error;
+       return asize;
+}
+
+static int
+__xfs_xattr_set(struct inode *inode, const char *name, const void *value,
+               size_t size, int flags, int xflags)
+{
+       struct xfs_inode *ip = XFS_I(inode);
+
+       if (strcmp(name, "") == 0)
+               return -EINVAL;
+
+       /* Convert Linux syscall to XFS internal ATTR flags */
+       if (flags & XATTR_CREATE)
+               xflags |= ATTR_CREATE;
+       if (flags & XATTR_REPLACE)
+               xflags |= ATTR_REPLACE;
+
+       if (!value)
+               return -xfs_attr_remove(ip, name, xflags);
+       return -xfs_attr_set(ip, name, (void *)value, size, xflags);
+}
+
+static int
+xfs_xattr_user_get(struct inode *inode, const char *name,
+               void *value, size_t size)
+{
+       return __xfs_xattr_get(inode, name, value, size, 0);
+}
+
+static int
+xfs_xattr_user_set(struct inode *inode, const char *name,
+               const void *value, size_t size, int flags)
+{
+       return __xfs_xattr_set(inode, name, value, size, flags, 0);
+}
+
+static struct xattr_handler xfs_xattr_user_handler = {
+       .prefix = XATTR_USER_PREFIX,
+       .get    = xfs_xattr_user_get,
+       .set    = xfs_xattr_user_set,
+};
+
+
+static int
+xfs_xattr_trusted_get(struct inode *inode, const char *name,
+               void *value, size_t size)
+{
+       return __xfs_xattr_get(inode, name, value, size, ATTR_ROOT);
+}
+
+static int
+xfs_xattr_trusted_set(struct inode *inode, const char *name,
+               const void *value, size_t size, int flags)
+{
+       return __xfs_xattr_set(inode, name, value, size, flags, ATTR_ROOT);
+}
+
+static struct xattr_handler xfs_xattr_trusted_handler = {
+       .prefix = XATTR_TRUSTED_PREFIX,
+       .get    = xfs_xattr_trusted_get,
+       .set    = xfs_xattr_trusted_set,
+};
+
+
+static int
+xfs_xattr_secure_get(struct inode *inode, const char *name,
+               void *value, size_t size)
+{
+       return __xfs_xattr_get(inode, name, value, size, ATTR_SECURE);
+}
+
+static int
+xfs_xattr_secure_set(struct inode *inode, const char *name,
+               const void *value, size_t size, int flags)
+{
+       return __xfs_xattr_set(inode, name, value, size, flags, ATTR_SECURE);
+}
+
+static struct xattr_handler xfs_xattr_security_handler = {
+       .prefix = XATTR_SECURITY_PREFIX,
+       .get    = xfs_xattr_secure_get,
+       .set    = xfs_xattr_secure_set,
+};
+
+
+struct xattr_handler *xfs_xattr_handlers[] = {
+       &xfs_xattr_user_handler,
+       &xfs_xattr_trusted_handler,
+       &xfs_xattr_security_handler,
+       &xfs_xattr_system_handler,
+       NULL
+};
+
+static unsigned int xfs_xattr_prefix_len(int flags)
+{
+       if (flags & XFS_ATTR_SECURE)
+               return sizeof("security");
+       else if (flags & XFS_ATTR_ROOT)
+               return sizeof("trusted");
+       else
+               return sizeof("user");
+}
+
+static const char *xfs_xattr_prefix(int flags)
+{
+       if (flags & XFS_ATTR_SECURE)
+               return xfs_xattr_security_handler.prefix;
+       else if (flags & XFS_ATTR_ROOT)
+               return xfs_xattr_trusted_handler.prefix;
+       else
+               return xfs_xattr_user_handler.prefix;
+}
+
+static int
+xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags,
+               char *name, int namelen, int valuelen, char *value)
+{
+       unsigned int prefix_len = xfs_xattr_prefix_len(flags);
+       char *offset;
+       int arraytop;
+
+       ASSERT(context->count >= 0);
+
+       /*
+        * Only show root namespace entries if we are actually allowed to
+        * see them.
+        */
+       if ((flags & XFS_ATTR_ROOT) && !capable(CAP_SYS_ADMIN))
+               return 0;
+
+       arraytop = context->count + prefix_len + namelen + 1;
+       if (arraytop > context->firstu) {
+               context->count = -1;    /* insufficient space */
+               return 1;
+       }
+       offset = (char *)context->alist + context->count;
+       strncpy(offset, xfs_xattr_prefix(flags), prefix_len);
+       offset += prefix_len;
+       strncpy(offset, name, namelen);                 /* real name */
+       offset += namelen;
+       *offset = '\0';
+       context->count += prefix_len + namelen + 1;
+       return 0;
+}
+
+static int
+xfs_xattr_put_listent_sizes(struct xfs_attr_list_context *context, int flags,
+               char *name, int namelen, int valuelen, char *value)
+{
+       context->count += xfs_xattr_prefix_len(flags) + namelen + 1;
+       return 0;
+}
+
+static int
+list_one_attr(const char *name, const size_t len, void *data,
+               size_t size, ssize_t *result)
+{
+       char *p = data + *result;
+
+       *result += len;
+       if (!size)
+               return 0;
+       if (*result > size)
+               return -ERANGE;
+
+       strcpy(p, name);
+       return 0;
+}
+
+ssize_t
+xfs_vn_listxattr(struct dentry *dentry, char *data, size_t size)
+{
+       struct xfs_attr_list_context context;
+       struct attrlist_cursor_kern cursor = { 0 };
+       struct inode            *inode = dentry->d_inode;
+       int                     error;
+
+       /*
+        * First read the regular on-disk attributes.
+        */
+       memset(&context, 0, sizeof(context));
+       context.dp = XFS_I(inode);
+       context.cursor = &cursor;
+       context.resynch = 1;
+       context.alist = data;
+       context.bufsize = size;
+       context.firstu = context.bufsize;
+
+       if (size)
+               context.put_listent = xfs_xattr_put_listent;
+       else
+               context.put_listent = xfs_xattr_put_listent_sizes;
+
+       xfs_attr_list_int(&context);
+       if (context.count < 0)
+               return -ERANGE;
+
+       /*
+        * Then add the two synthetic ACL attributes.
+        */
+       if (xfs_acl_vhasacl_access(inode)) {
+               error = list_one_attr(POSIX_ACL_XATTR_ACCESS,
+                               strlen(POSIX_ACL_XATTR_ACCESS) + 1,
+                               data, size, &context.count);
+               if (error)
+                       return error;
+       }
+
+       if (xfs_acl_vhasacl_default(inode)) {
+               error = list_one_attr(POSIX_ACL_XATTR_DEFAULT,
+                               strlen(POSIX_ACL_XATTR_DEFAULT) + 1,
+                               data, size, &context.count);
+               if (error)
+                       return error;
+       }
+
+       return context.count;
+}
index 85df3288efd5b8530ad2ff42b23f10ce9104cb25..fc9f3fb39b7b31bfe7d0a778b69c4f7eb049eea7 100644 (file)
@@ -1435,8 +1435,7 @@ xfs_dqlock2(
 /* ARGSUSED */
 int
 xfs_qm_dqpurge(
-       xfs_dquot_t     *dqp,
-       uint            flags)
+       xfs_dquot_t     *dqp)
 {
        xfs_dqhash_t    *thishash;
        xfs_mount_t     *mp = dqp->q_mount;
index 5c371a92e3e24c010cbed274fb8b3f37169a466e..f7393bba4e95b38a6d9ec7ee0890633f64227e1f 100644 (file)
@@ -164,7 +164,7 @@ extern void         xfs_qm_dqprint(xfs_dquot_t *);
 
 extern void            xfs_qm_dqdestroy(xfs_dquot_t *);
 extern int             xfs_qm_dqflush(xfs_dquot_t *, uint);
-extern int             xfs_qm_dqpurge(xfs_dquot_t *, uint);
+extern int             xfs_qm_dqpurge(xfs_dquot_t *);
 extern void            xfs_qm_dqunpin_wait(xfs_dquot_t *);
 extern int             xfs_qm_dqlock_nowait(xfs_dquot_t *);
 extern int             xfs_qm_dqflock_nowait(xfs_dquot_t *);
index 36e05ca784123753612233cadad12aab69a8b991..08d2fc89e6a1741fc24d156f0ce96ea1e5c0780f 100644 (file)
@@ -576,8 +576,8 @@ xfs_qm_qoffend_logitem_committed(
         * xfs_trans_delete_ail() drops the AIL lock.
         */
        xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs);
-       kmem_free(qfs, sizeof(xfs_qoff_logitem_t));
-       kmem_free(qfe, sizeof(xfs_qoff_logitem_t));
+       kmem_free(qfs);
+       kmem_free(qfe);
        return (xfs_lsn_t)-1;
 }
 
index d31cce1165c59cd03ad1c8590c5bbc487494b95a..021934a3d45661149a1301303a9f8e53cc244713 100644 (file)
@@ -192,8 +192,8 @@ xfs_qm_destroy(
                xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i]));
                xfs_qm_list_destroy(&(xqm->qm_grp_dqhtable[i]));
        }
-       kmem_free(xqm->qm_usr_dqhtable, hsize * sizeof(xfs_dqhash_t));
-       kmem_free(xqm->qm_grp_dqhtable, hsize * sizeof(xfs_dqhash_t));
+       kmem_free(xqm->qm_usr_dqhtable);
+       kmem_free(xqm->qm_grp_dqhtable);
        xqm->qm_usr_dqhtable = NULL;
        xqm->qm_grp_dqhtable = NULL;
        xqm->qm_dqhashmask = 0;
@@ -201,7 +201,7 @@ xfs_qm_destroy(
 #ifdef DEBUG
        mutex_destroy(&qcheck_lock);
 #endif
-       kmem_free(xqm, sizeof(xfs_qm_t));
+       kmem_free(xqm);
 }
 
 /*
@@ -445,11 +445,11 @@ xfs_qm_unmount_quotas(
                }
        }
        if (uqp) {
-                XFS_PURGE_INODE(uqp);
+                IRELE(uqp);
                 mp->m_quotainfo->qi_uquotaip = NULL;
        }
        if (gqp) {
-               XFS_PURGE_INODE(gqp);
+               IRELE(gqp);
                mp->m_quotainfo->qi_gquotaip = NULL;
        }
 out:
@@ -631,7 +631,7 @@ xfs_qm_dqpurge_int(
                 * freelist in INACTIVE state.
                 */
                nextdqp = dqp->MPL_NEXT;
-               nmisses += xfs_qm_dqpurge(dqp, flags);
+               nmisses += xfs_qm_dqpurge(dqp);
                dqp = nextdqp;
        }
        xfs_qm_mplist_unlock(mp);
@@ -1134,7 +1134,7 @@ xfs_qm_init_quotainfo(
         * and change the superblock accordingly.
         */
        if ((error = xfs_qm_init_quotainos(mp))) {
-               kmem_free(qinf, sizeof(xfs_quotainfo_t));
+               kmem_free(qinf);
                mp->m_quotainfo = NULL;
                return error;
        }
@@ -1240,15 +1240,15 @@ xfs_qm_destroy_quotainfo(
        xfs_qm_list_destroy(&qi->qi_dqlist);
 
        if (qi->qi_uquotaip) {
-               XFS_PURGE_INODE(qi->qi_uquotaip);
+               IRELE(qi->qi_uquotaip);
                qi->qi_uquotaip = NULL; /* paranoia */
        }
        if (qi->qi_gquotaip) {
-               XFS_PURGE_INODE(qi->qi_gquotaip);
+               IRELE(qi->qi_gquotaip);
                qi->qi_gquotaip = NULL;
        }
        mutex_destroy(&qi->qi_quotaofflock);
-       kmem_free(qi, sizeof(xfs_quotainfo_t));
+       kmem_free(qi);
        mp->m_quotainfo = NULL;
 }
 
@@ -1394,7 +1394,7 @@ xfs_qm_qino_alloc(
         * locked exclusively and joined to the transaction already.
         */
        ASSERT(xfs_isilocked(*ip, XFS_ILOCK_EXCL));
-       VN_HOLD(XFS_ITOV((*ip)));
+       IHOLD(*ip);
 
        /*
         * Make the changes in the superblock, and log those too.
@@ -1623,7 +1623,7 @@ xfs_qm_dqiterate(
                        break;
        } while (nmaps > 0);
 
-       kmem_free(map, XFS_DQITER_MAP_SIZE * sizeof(*map));
+       kmem_free(map);
 
        return error;
 }
index 768a3b27d2b67c68a5361c853b277e778c8f0c8e..adfb8723f65af336d92501163aff0ee095634828 100644 (file)
@@ -362,11 +362,11 @@ xfs_qm_scall_quotaoff(
         * if we don't need them anymore.
         */
        if ((dqtype & XFS_QMOPT_UQUOTA) && XFS_QI_UQIP(mp)) {
-               XFS_PURGE_INODE(XFS_QI_UQIP(mp));
+               IRELE(XFS_QI_UQIP(mp));
                XFS_QI_UQIP(mp) = NULL;
        }
        if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && XFS_QI_GQIP(mp)) {
-               XFS_PURGE_INODE(XFS_QI_GQIP(mp));
+               IRELE(XFS_QI_GQIP(mp));
                XFS_QI_GQIP(mp) = NULL;
        }
 out_error:
@@ -1449,14 +1449,14 @@ xfs_qm_internalqcheck(
                for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) {
                        xfs_dqtest_cmp(d);
                        e = (xfs_dqtest_t *) d->HL_NEXT;
-                       kmem_free(d, sizeof(xfs_dqtest_t));
+                       kmem_free(d);
                        d = e;
                }
                h1 = &qmtest_gdqtab[i];
                for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) {
                        xfs_dqtest_cmp(d);
                        e = (xfs_dqtest_t *) d->HL_NEXT;
-                       kmem_free(d, sizeof(xfs_dqtest_t));
+                       kmem_free(d);
                        d = e;
                }
        }
@@ -1467,8 +1467,8 @@ xfs_qm_internalqcheck(
        } else {
                cmn_err(CE_DEBUG, "******** quotacheck successful! ********");
        }
-       kmem_free(qmtest_udqtab, qmtest_hashmask * sizeof(xfs_dqhash_t));
-       kmem_free(qmtest_gdqtab, qmtest_hashmask * sizeof(xfs_dqhash_t));
+       kmem_free(qmtest_udqtab);
+       kmem_free(qmtest_gdqtab);
        mutex_unlock(&qcheck_lock);
        return (qmtest_nfails);
 }
index 5e4a40b1c565c3d9388669145b768496a3e345fd..c4fcea600bc2f15ed7087653bbe6728bc37a71a4 100644 (file)
@@ -158,9 +158,6 @@ for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \
 #define XFS_IS_SUSER_DQUOT(dqp)                \
        (!((dqp)->q_core.d_id))
 
-#define XFS_PURGE_INODE(ip)            \
-       IRELE(ip);
-
 #define DQFLAGTO_TYPESTR(d)    (((d)->dq_flags & XFS_DQ_USER) ? "USR" : \
                                 (((d)->dq_flags & XFS_DQ_GROUP) ? "GRP" : \
                                 (((d)->dq_flags & XFS_DQ_PROJ) ? "PRJ":"???")))
index 0b75d302508f86a1266b200c7d4ae048474ad870..a34ef05489b1c323369c7b22cf40400febaa28dd 100644 (file)
@@ -89,7 +89,7 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
                if (sleep & KM_SLEEP)
                        panic("ktrace_alloc: NULL memory on KM_SLEEP request!");
 
-               kmem_free(ktp, sizeof(*ktp));
+               kmem_free(ktp);
 
                return NULL;
        }
@@ -126,7 +126,7 @@ ktrace_free(ktrace_t *ktp)
        } else {
                entries_size = (int)(ktp->kt_nentries * sizeof(ktrace_entry_t));
 
-               kmem_free(ktp->kt_entries, entries_size);
+               kmem_free(ktp->kt_entries);
        }
 
        kmem_zone_free(ktrace_hdr_zone, ktp);
index 493a6ecf8590c5e697bcf7fe116875ae14ce90e3..5830c040ea7ebba66274eeebbdab553c206ab981 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <xfs.h>
 
-static mutex_t uuid_monitor;
+static DEFINE_MUTEX(uuid_monitor);
 static int     uuid_table_size;
 static uuid_t  *uuid_table;
 
@@ -132,9 +132,3 @@ uuid_table_remove(uuid_t *uuid)
        ASSERT(i < uuid_table_size);
        mutex_unlock(&uuid_monitor);
 }
-
-void __init
-uuid_init(void)
-{
-       mutex_init(&uuid_monitor);
-}
index b6f5922199ba699cde507ce7b81bee286a3a1ff0..cff5b607d445e80888a73de26c2a23952bf30a08 100644 (file)
@@ -22,7 +22,6 @@ typedef struct {
        unsigned char   __u_bits[16];
 } uuid_t;
 
-extern void uuid_init(void);
 extern void uuid_create_nil(uuid_t *uuid);
 extern int uuid_is_nil(uuid_t *uuid);
 extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
index ebee3a4f703aa5128756e950631a3bd3f50e7103..3e4648ad9cfcbda429ed52587d42a1d989fb21f5 100644 (file)
@@ -341,8 +341,7 @@ xfs_acl_iaccess(
 
        /* If the file has no ACL return -1. */
        rval = sizeof(xfs_acl_t);
-       if (xfs_attr_fetch(ip, &acl_name, (char *)acl, &rval,
-                                       ATTR_ROOT | ATTR_KERNACCESS)) {
+       if (xfs_attr_fetch(ip, &acl_name, (char *)acl, &rval, ATTR_ROOT)) {
                _ACL_FREE(acl);
                return -1;
        }
@@ -720,7 +719,7 @@ xfs_acl_setmode(
        xfs_acl_t       *acl,
        int             *basicperms)
 {
-       bhv_vattr_t     va;
+       struct iattr    iattr;
        xfs_acl_entry_t *ap;
        xfs_acl_entry_t *gap = NULL;
        int             i, nomask = 1;
@@ -734,25 +733,25 @@ xfs_acl_setmode(
         * Copy the u::, g::, o::, and m:: bits from the ACL into the
         * mode.  The m:: bits take precedence over the g:: bits.
         */
-       va.va_mask = XFS_AT_MODE;
-       va.va_mode = xfs_vtoi(vp)->i_d.di_mode;
-       va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
+       iattr.ia_valid = ATTR_MODE;
+       iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode;
+       iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
        ap = acl->acl_entry;
        for (i = 0; i < acl->acl_cnt; ++i) {
                switch (ap->ae_tag) {
                case ACL_USER_OBJ:
-                       va.va_mode |= ap->ae_perm << 6;
+                       iattr.ia_mode |= ap->ae_perm << 6;
                        break;
                case ACL_GROUP_OBJ:
                        gap = ap;
                        break;
                case ACL_MASK:  /* more than just standard modes */
                        nomask = 0;
-                       va.va_mode |= ap->ae_perm << 3;
+                       iattr.ia_mode |= ap->ae_perm << 3;
                        *basicperms = 0;
                        break;
                case ACL_OTHER:
-                       va.va_mode |= ap->ae_perm;
+                       iattr.ia_mode |= ap->ae_perm;
                        break;
                default:        /* more than just standard modes */
                        *basicperms = 0;
@@ -763,9 +762,9 @@ xfs_acl_setmode(
 
        /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */
        if (gap && nomask)
-               va.va_mode |= gap->ae_perm << 3;
+               iattr.ia_mode |= gap->ae_perm << 3;
 
-       return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred);
+       return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred);
 }
 
 /*
index 332a772461c47ad6a25fc42a812bd055d6579d3c..323ee94cf831cfbba001e890edfeecbb18bf69a4 100644 (file)
@@ -46,6 +46,8 @@ typedef struct xfs_acl {
 #define SGI_ACL_FILE_SIZE      (sizeof(SGI_ACL_FILE)-1)
 #define SGI_ACL_DEFAULT_SIZE   (sizeof(SGI_ACL_DEFAULT)-1)
 
+#define _ACL_TYPE_ACCESS       1
+#define _ACL_TYPE_DEFAULT      2
 
 #ifdef CONFIG_XFS_POSIX_ACL
 
@@ -66,8 +68,6 @@ extern int xfs_acl_vset(bhv_vnode_t *, void *, size_t, int);
 extern int xfs_acl_vget(bhv_vnode_t *, void *, size_t, int);
 extern int xfs_acl_vremove(bhv_vnode_t *, int);
 
-#define _ACL_TYPE_ACCESS       1
-#define _ACL_TYPE_DEFAULT      2
 #define _ACL_PERM_INVALID(perm)        ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
 
 #define _ACL_INHERIT(c,m,d)    (xfs_acl_inherit(c,m,d))
index df151a859186cdf569ae2e3436af8157e0812887..78de80e3caa2f4bfdee2704a88e3637fc388894f 100644 (file)
@@ -16,8 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/capability.h>
-
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
  * Provide the external interfaces to manage attribute lists.
  */
 
-#define ATTR_SYSCOUNT  2
-static struct attrnames posix_acl_access;
-static struct attrnames posix_acl_default;
-static struct attrnames *attr_system_names[ATTR_SYSCOUNT];
-
 /*========================================================================
  * Function prototypes for the kernel.
  *========================================================================*/
@@ -116,6 +109,17 @@ xfs_attr_name_to_xname(
        return 0;
 }
 
+STATIC int
+xfs_inode_hasattr(
+       struct xfs_inode        *ip)
+{
+       if (!XFS_IFORK_Q(ip) ||
+           (ip->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
+            ip->i_d.di_anextents == 0))
+               return 0;
+       return 1;
+}
+
 /*========================================================================
  * Overall external interface routines.
  *========================================================================*/
@@ -127,10 +131,8 @@ xfs_attr_fetch(xfs_inode_t *ip, struct xfs_name *name,
        xfs_da_args_t   args;
        int             error;
 
-       if ((XFS_IFORK_Q(ip) == 0) ||
-           (ip->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            ip->i_d.di_anextents == 0))
-               return(ENOATTR);
+       if (!xfs_inode_hasattr(ip))
+               return ENOATTR;
 
        /*
         * Fill in the arg structure for this request.
@@ -148,11 +150,7 @@ xfs_attr_fetch(xfs_inode_t *ip, struct xfs_name *name,
        /*
         * Decide on what work routines to call based on the inode size.
         */
-       if (XFS_IFORK_Q(ip) == 0 ||
-           (ip->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            ip->i_d.di_anextents == 0)) {
-               error = XFS_ERROR(ENOATTR);
-       } else if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
+       if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
                error = xfs_attr_shortform_getvalue(&args);
        } else if (xfs_bmap_one_block(ip, XFS_ATTR_FORK)) {
                error = xfs_attr_leaf_get(&args);
@@ -241,8 +239,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name,
        args.firstblock = &firstblock;
        args.flist = &flist;
        args.whichfork = XFS_ATTR_FORK;
-       args.addname = 1;
-       args.oknoent = 1;
+       args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
 
        /*
         * Determine space new attribute will use, and if it would be
@@ -529,9 +526,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, struct xfs_name *name, int flags)
        /*
         * Decide on what work routines to call based on the inode size.
         */
-       if (XFS_IFORK_Q(dp) == 0 ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            dp->i_d.di_anextents == 0)) {
+       if (!xfs_inode_hasattr(dp)) {
                error = XFS_ERROR(ENOATTR);
                goto out;
        }
@@ -601,29 +596,33 @@ xfs_attr_remove(
                return error;
 
        xfs_ilock(dp, XFS_ILOCK_SHARED);
-       if (XFS_IFORK_Q(dp) == 0 ||
-                  (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-                   dp->i_d.di_anextents == 0)) {
+       if (!xfs_inode_hasattr(dp)) {
                xfs_iunlock(dp, XFS_ILOCK_SHARED);
-               return(XFS_ERROR(ENOATTR));
+               return XFS_ERROR(ENOATTR);
        }
        xfs_iunlock(dp, XFS_ILOCK_SHARED);
 
        return xfs_attr_remove_int(dp, &xname, flags);
 }
 
-STATIC int
+int
 xfs_attr_list_int(xfs_attr_list_context_t *context)
 {
        int error;
        xfs_inode_t *dp = context->dp;
 
+       XFS_STATS_INC(xs_attr_list);
+
+       if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+               return EIO;
+
+       xfs_ilock(dp, XFS_ILOCK_SHARED);
+       xfs_attr_trace_l_c("syscall start", context);
+
        /*
         * Decide on what work routines to call based on the inode size.
         */
-       if (XFS_IFORK_Q(dp) == 0 ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            dp->i_d.di_anextents == 0)) {
+       if (!xfs_inode_hasattr(dp)) {
                error = 0;
        } else if (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
                error = xfs_attr_shortform_list(context);
@@ -632,6 +631,10 @@ xfs_attr_list_int(xfs_attr_list_context_t *context)
        } else {
                error = xfs_attr_node_list(context);
        }
+
+       xfs_iunlock(dp, XFS_ILOCK_SHARED);
+       xfs_attr_trace_l_c("syscall end", context);
+
        return error;
 }
 
@@ -648,74 +651,50 @@ xfs_attr_list_int(xfs_attr_list_context_t *context)
  */
 /*ARGSUSED*/
 STATIC int
-xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *namesp,
+xfs_attr_put_listent(xfs_attr_list_context_t *context, int flags,
                     char *name, int namelen,
                     int valuelen, char *value)
 {
+       struct attrlist *alist = (struct attrlist *)context->alist;
        attrlist_ent_t *aep;
        int arraytop;
 
        ASSERT(!(context->flags & ATTR_KERNOVAL));
        ASSERT(context->count >= 0);
        ASSERT(context->count < (ATTR_MAX_VALUELEN/8));
-       ASSERT(context->firstu >= sizeof(*context->alist));
+       ASSERT(context->firstu >= sizeof(*alist));
        ASSERT(context->firstu <= context->bufsize);
 
-       arraytop = sizeof(*context->alist) +
-                       context->count * sizeof(context->alist->al_offset[0]);
+       /*
+        * Only list entries in the right namespace.
+        */
+       if (((context->flags & ATTR_SECURE) == 0) !=
+           ((flags & XFS_ATTR_SECURE) == 0))
+               return 0;
+       if (((context->flags & ATTR_ROOT) == 0) !=
+           ((flags & XFS_ATTR_ROOT) == 0))
+               return 0;
+
+       arraytop = sizeof(*alist) +
+                       context->count * sizeof(alist->al_offset[0]);
        context->firstu -= ATTR_ENTSIZE(namelen);
        if (context->firstu < arraytop) {
                xfs_attr_trace_l_c("buffer full", context);
-               context->alist->al_more = 1;
+               alist->al_more = 1;
                context->seen_enough = 1;
                return 1;
        }
 
-       aep = (attrlist_ent_t *)&(((char *)context->alist)[ context->firstu ]);
+       aep = (attrlist_ent_t *)&context->alist[context->firstu];
        aep->a_valuelen = valuelen;
        memcpy(aep->a_name, name, namelen);
-       aep->a_name[ namelen ] = 0;
-       context->alist->al_offset[ context->count++ ] = context->firstu;
-       context->alist->al_count = context->count;
+       aep->a_name[namelen] = 0;
+       alist->al_offset[context->count++] = context->firstu;
+       alist->al_count = context->count;
        xfs_attr_trace_l_c("add", context);
        return 0;
 }
 
-STATIC int
-xfs_attr_kern_list(xfs_attr_list_context_t *context, attrnames_t *namesp,
-                    char *name, int namelen,
-                    int valuelen, char *value)
-{
-       char *offset;
-       int arraytop;
-
-       ASSERT(context->count >= 0);
-
-       arraytop = context->count + namesp->attr_namelen + namelen + 1;
-       if (arraytop > context->firstu) {
-               context->count = -1;    /* insufficient space */
-               return 1;
-       }
-       offset = (char *)context->alist + context->count;
-       strncpy(offset, namesp->attr_name, namesp->attr_namelen);
-       offset += namesp->attr_namelen;
-       strncpy(offset, name, namelen);                 /* real name */
-       offset += namelen;
-       *offset = '\0';
-       context->count += namesp->attr_namelen + namelen + 1;
-       return 0;
-}
-
-/*ARGSUSED*/
-STATIC int
-xfs_attr_kern_list_sizes(xfs_attr_list_context_t *context, attrnames_t *namesp,
-                    char *name, int namelen,
-                    int valuelen, char *value)
-{
-       context->count += namesp->attr_namelen + namelen + 1;
-       return 0;
-}
-
 /*
  * Generate a list of extended attribute names and optionally
  * also value lengths.  Positive return value follows the XFS
@@ -732,10 +711,9 @@ xfs_attr_list(
        attrlist_cursor_kern_t *cursor)
 {
        xfs_attr_list_context_t context;
+       struct attrlist *alist;
        int error;
 
-       XFS_STATS_INC(xs_attr_list);
-
        /*
         * Validate the cursor.
         */
@@ -756,52 +734,23 @@ xfs_attr_list(
        /*
         * Initialize the output buffer.
         */
+       memset(&context, 0, sizeof(context));
        context.dp = dp;
        context.cursor = cursor;
-       context.count = 0;
-       context.dupcnt = 0;
        context.resynch = 1;
        context.flags = flags;
-       context.seen_enough = 0;
-       context.alist = (attrlist_t *)buffer;
-       context.put_value = 0;
-
-       if (flags & ATTR_KERNAMELS) {
-               context.bufsize = bufsize;
-               context.firstu = context.bufsize;
-               if (flags & ATTR_KERNOVAL)
-                       context.put_listent = xfs_attr_kern_list_sizes;
-               else
-                       context.put_listent = xfs_attr_kern_list;
-       } else {
-               context.bufsize = (bufsize & ~(sizeof(int)-1));  /* align */
-               context.firstu = context.bufsize;
-               context.alist->al_count = 0;
-               context.alist->al_more = 0;
-               context.alist->al_offset[0] = context.bufsize;
-               context.put_listent = xfs_attr_put_listent;
-       }
+       context.alist = buffer;
+       context.bufsize = (bufsize & ~(sizeof(int)-1));  /* align */
+       context.firstu = context.bufsize;
+       context.put_listent = xfs_attr_put_listent;
 
-       if (XFS_FORCED_SHUTDOWN(dp->i_mount))
-               return EIO;
-
-       xfs_ilock(dp, XFS_ILOCK_SHARED);
-       xfs_attr_trace_l_c("syscall start", &context);
+       alist = (struct attrlist *)context.alist;
+       alist->al_count = 0;
+       alist->al_more = 0;
+       alist->al_offset[0] = context.bufsize;
 
        error = xfs_attr_list_int(&context);
-
-       xfs_iunlock(dp, XFS_ILOCK_SHARED);
-       xfs_attr_trace_l_c("syscall end", &context);
-
-       if (context.flags & (ATTR_KERNOVAL|ATTR_KERNAMELS)) {
-               /* must return negated buffer size or the error */
-               if (context.count < 0)
-                       error = XFS_ERROR(ERANGE);
-               else
-                       error = -context.count;
-       } else
-               ASSERT(error >= 0);
-
+       ASSERT(error >= 0);
        return error;
 }
 
@@ -816,12 +765,10 @@ xfs_attr_inactive(xfs_inode_t *dp)
        ASSERT(! XFS_NOT_DQATTACHED(mp, dp));
 
        xfs_ilock(dp, XFS_ILOCK_SHARED);
-       if ((XFS_IFORK_Q(dp) == 0) ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            dp->i_d.di_anextents == 0)) {
+       if (!xfs_inode_hasattr(dp) ||
+           dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
                xfs_iunlock(dp, XFS_ILOCK_SHARED);
-               return(0);
+               return 0;
        }
        xfs_iunlock(dp, XFS_ILOCK_SHARED);
 
@@ -854,10 +801,8 @@ xfs_attr_inactive(xfs_inode_t *dp)
        /*
         * Decide on what work routines to call based on the inode size.
         */
-       if ((XFS_IFORK_Q(dp) == 0) ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) ||
-           (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS &&
-            dp->i_d.di_anextents == 0)) {
+       if (!xfs_inode_hasattr(dp) ||
+           dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
                error = 0;
                goto out;
        }
@@ -974,7 +919,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
                        xfs_da_brelse(args->trans, bp);
                        return(retval);
                }
-               args->rename = 1;                       /* an atomic rename */
+               args->op_flags |= XFS_DA_OP_RENAME;     /* an atomic rename */
                args->blkno2 = args->blkno;             /* set 2nd entry info*/
                args->index2 = args->index;
                args->rmtblkno2 = args->rmtblkno;
@@ -1054,7 +999,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
         * so that one disappears and one appears atomically.  Then we
         * must remove the "old" attribute/value pair.
         */
-       if (args->rename) {
+       if (args->op_flags & XFS_DA_OP_RENAME) {
                /*
                 * In a separate transaction, set the incomplete flag on the
                 * "old" attr and clear the incomplete flag on the "new" attr.
@@ -1307,7 +1252,7 @@ restart:
        } else if (retval == EEXIST) {
                if (args->flags & ATTR_CREATE)
                        goto out;
-               args->rename = 1;                       /* atomic rename op */
+               args->op_flags |= XFS_DA_OP_RENAME;     /* atomic rename op */
                args->blkno2 = args->blkno;             /* set 2nd entry info*/
                args->index2 = args->index;
                args->rmtblkno2 = args->rmtblkno;
@@ -1425,7 +1370,7 @@ restart:
         * so that one disappears and one appears atomically.  Then we
         * must remove the "old" attribute/value pair.
         */
-       if (args->rename) {
+       if (args->op_flags & XFS_DA_OP_RENAME) {
                /*
                 * In a separate transaction, set the incomplete flag on the
                 * "old" attr and clear the incomplete flag on the "new" attr.
@@ -2300,23 +2245,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
 void
 xfs_attr_trace_l_c(char *where, struct xfs_attr_list_context *context)
 {
-       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_C, where,
-               (__psunsigned_t)context->dp,
-               (__psunsigned_t)context->cursor->hashval,
-               (__psunsigned_t)context->cursor->blkno,
-               (__psunsigned_t)context->cursor->offset,
-               (__psunsigned_t)context->alist,
-               (__psunsigned_t)context->bufsize,
-               (__psunsigned_t)context->count,
-               (__psunsigned_t)context->firstu,
-               (__psunsigned_t)
-                       ((context->count > 0) &&
-                       !(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
-                               ? (ATTR_ENTRY(context->alist,
-                                             context->count-1)->a_valuelen)
-                               : 0,
-               (__psunsigned_t)context->dupcnt,
-               (__psunsigned_t)context->flags,
+       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_C, where, context,
                (__psunsigned_t)NULL,
                (__psunsigned_t)NULL,
                (__psunsigned_t)NULL);
@@ -2329,23 +2258,7 @@ void
 xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context,
                         struct xfs_da_intnode *node)
 {
-       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CN, where,
-               (__psunsigned_t)context->dp,
-               (__psunsigned_t)context->cursor->hashval,
-               (__psunsigned_t)context->cursor->blkno,
-               (__psunsigned_t)context->cursor->offset,
-               (__psunsigned_t)context->alist,
-               (__psunsigned_t)context->bufsize,
-               (__psunsigned_t)context->count,
-               (__psunsigned_t)context->firstu,
-               (__psunsigned_t)
-                       ((context->count > 0) &&
-                       !(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
-                               ? (ATTR_ENTRY(context->alist,
-                                             context->count-1)->a_valuelen)
-                               : 0,
-               (__psunsigned_t)context->dupcnt,
-               (__psunsigned_t)context->flags,
+       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CN, where, context,
                (__psunsigned_t)be16_to_cpu(node->hdr.count),
                (__psunsigned_t)be32_to_cpu(node->btree[0].hashval),
                (__psunsigned_t)be32_to_cpu(node->btree[
@@ -2359,23 +2272,7 @@ void
 xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context,
                          struct xfs_da_node_entry *btree)
 {
-       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CB, where,
-               (__psunsigned_t)context->dp,
-               (__psunsigned_t)context->cursor->hashval,
-               (__psunsigned_t)context->cursor->blkno,
-               (__psunsigned_t)context->cursor->offset,
-               (__psunsigned_t)context->alist,
-               (__psunsigned_t)context->bufsize,
-               (__psunsigned_t)context->count,
-               (__psunsigned_t)context->firstu,
-               (__psunsigned_t)
-                       ((context->count > 0) &&
-                       !(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
-                               ? (ATTR_ENTRY(context->alist,
-                                             context->count-1)->a_valuelen)
-                               : 0,
-               (__psunsigned_t)context->dupcnt,
-               (__psunsigned_t)context->flags,
+       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CB, where, context,
                (__psunsigned_t)be32_to_cpu(btree->hashval),
                (__psunsigned_t)be32_to_cpu(btree->before),
                (__psunsigned_t)NULL);
@@ -2388,23 +2285,7 @@ void
 xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context,
                              struct xfs_attr_leafblock *leaf)
 {
-       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CL, where,
-               (__psunsigned_t)context->dp,
-               (__psunsigned_t)context->cursor->hashval,
-               (__psunsigned_t)context->cursor->blkno,
-               (__psunsigned_t)context->cursor->offset,
-               (__psunsigned_t)context->alist,
-               (__psunsigned_t)context->bufsize,
-               (__psunsigned_t)context->count,
-               (__psunsigned_t)context->firstu,
-               (__psunsigned_t)
-                       ((context->count > 0) &&
-                       !(context->flags & (ATTR_KERNAMELS|ATTR_KERNOVAL)))
-                               ? (ATTR_ENTRY(context->alist,
-                                             context->count-1)->a_valuelen)
-                               : 0,
-               (__psunsigned_t)context->dupcnt,
-               (__psunsigned_t)context->flags,
+       xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CL, where, context,
                (__psunsigned_t)be16_to_cpu(leaf->hdr.count),
                (__psunsigned_t)be32_to_cpu(leaf->entries[0].hashval),
                (__psunsigned_t)be32_to_cpu(leaf->entries[
@@ -2417,329 +2298,24 @@ xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context,
  */
 void
 xfs_attr_trace_enter(int type, char *where,
-                        __psunsigned_t a2, __psunsigned_t a3,
-                        __psunsigned_t a4, __psunsigned_t a5,
-                        __psunsigned_t a6, __psunsigned_t a7,
-                        __psunsigned_t a8, __psunsigned_t a9,
-                        __psunsigned_t a10, __psunsigned_t a11,
-                        __psunsigned_t a12, __psunsigned_t a13,
-                        __psunsigned_t a14, __psunsigned_t a15)
+                        struct xfs_attr_list_context *context,
+                        __psunsigned_t a13, __psunsigned_t a14,
+                        __psunsigned_t a15)
 {
        ASSERT(xfs_attr_trace_buf);
        ktrace_enter(xfs_attr_trace_buf, (void *)((__psunsigned_t)type),
-                                        (void *)where,
-                                        (void *)a2,  (void *)a3,  (void *)a4,
-                                        (void *)a5,  (void *)a6,  (void *)a7,
-                                        (void *)a8,  (void *)a9,  (void *)a10,
-                                        (void *)a11, (void *)a12, (void *)a13,
-                                        (void *)a14, (void *)a15);
+               (void *)((__psunsigned_t)where),
+               (void *)((__psunsigned_t)context->dp),
+               (void *)((__psunsigned_t)context->cursor->hashval),
+               (void *)((__psunsigned_t)context->cursor->blkno),
+               (void *)((__psunsigned_t)context->cursor->offset),
+               (void *)((__psunsigned_t)context->alist),
+               (void *)((__psunsigned_t)context->bufsize),
+               (void *)((__psunsigned_t)context->count),
+               (void *)((__psunsigned_t)context->firstu),
+               NULL,
+               (void *)((__psunsigned_t)context->dupcnt),
+               (void *)((__psunsigned_t)context->flags),
+               (void *)a13, (void *)a14, (void *)a15);
 }
 #endif /* XFS_ATTR_TRACE */
-
-
-/*========================================================================
- * System (pseudo) namespace attribute interface routines.
- *========================================================================*/
-
-STATIC int
-posix_acl_access_set(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       return xfs_acl_vset(vp, data, size, _ACL_TYPE_ACCESS);
-}
-
-STATIC int
-posix_acl_access_remove(
-       bhv_vnode_t *vp, char *name, int xflags)
-{
-       return xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
-}
-
-STATIC int
-posix_acl_access_get(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       return xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
-}
-
-STATIC int
-posix_acl_access_exists(
-       bhv_vnode_t *vp)
-{
-       return xfs_acl_vhasacl_access(vp);
-}
-
-STATIC int
-posix_acl_default_set(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       return xfs_acl_vset(vp, data, size, _ACL_TYPE_DEFAULT);
-}
-
-STATIC int
-posix_acl_default_get(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       return xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT);
-}
-
-STATIC int
-posix_acl_default_remove(
-       bhv_vnode_t *vp, char *name, int xflags)
-{
-       return xfs_acl_vremove(vp, _ACL_TYPE_DEFAULT);
-}
-
-STATIC int
-posix_acl_default_exists(
-       bhv_vnode_t *vp)
-{
-       return xfs_acl_vhasacl_default(vp);
-}
-
-static struct attrnames posix_acl_access = {
-       .attr_name      = "posix_acl_access",
-       .attr_namelen   = sizeof("posix_acl_access") - 1,
-       .attr_get       = posix_acl_access_get,
-       .attr_set       = posix_acl_access_set,
-       .attr_remove    = posix_acl_access_remove,
-       .attr_exists    = posix_acl_access_exists,
-};
-
-static struct attrnames posix_acl_default = {
-       .attr_name      = "posix_acl_default",
-       .attr_namelen   = sizeof("posix_acl_default") - 1,
-       .attr_get       = posix_acl_default_get,
-       .attr_set       = posix_acl_default_set,
-       .attr_remove    = posix_acl_default_remove,
-       .attr_exists    = posix_acl_default_exists,
-};
-
-static struct attrnames *attr_system_names[] =
-       { &posix_acl_access, &posix_acl_default };
-
-
-/*========================================================================
- * Namespace-prefix-style attribute name interface routines.
- *========================================================================*/
-
-STATIC int
-attr_generic_set(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       return -xfs_attr_set(xfs_vtoi(vp), name, data, size, xflags);
-}
-
-STATIC int
-attr_generic_get(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       int     error, asize = size;
-
-       error = xfs_attr_get(xfs_vtoi(vp), name, data, &asize, xflags);
-       if (!error)
-               return asize;
-       return -error;
-}
-
-STATIC int
-attr_generic_remove(
-       bhv_vnode_t *vp, char *name, int xflags)
-{
-       return -xfs_attr_remove(xfs_vtoi(vp), name, xflags);
-}
-
-STATIC int
-attr_generic_listadd(
-       attrnames_t             *prefix,
-       attrnames_t             *namesp,
-       void                    *data,
-       size_t                  size,
-       ssize_t                 *result)
-{
-       char                    *p = data + *result;
-
-       *result += prefix->attr_namelen;
-       *result += namesp->attr_namelen + 1;
-       if (!size)
-               return 0;
-       if (*result > size)
-               return -ERANGE;
-       strcpy(p, prefix->attr_name);
-       p += prefix->attr_namelen;
-       strcpy(p, namesp->attr_name);
-       p += namesp->attr_namelen + 1;
-       return 0;
-}
-
-STATIC int
-attr_system_list(
-       bhv_vnode_t             *vp,
-       void                    *data,
-       size_t                  size,
-       ssize_t                 *result)
-{
-       attrnames_t             *namesp;
-       int                     i, error = 0;
-
-       for (i = 0; i < ATTR_SYSCOUNT; i++) {
-               namesp = attr_system_names[i];
-               if (!namesp->attr_exists || !namesp->attr_exists(vp))
-                       continue;
-               error = attr_generic_listadd(&attr_system, namesp,
-                                               data, size, result);
-               if (error)
-                       break;
-       }
-       return error;
-}
-
-int
-attr_generic_list(
-       bhv_vnode_t *vp, void *data, size_t size, int xflags, ssize_t *result)
-{
-       attrlist_cursor_kern_t  cursor = { 0 };
-       int                     error;
-
-       error = xfs_attr_list(xfs_vtoi(vp), data, size, xflags, &cursor);
-       if (error > 0)
-               return -error;
-       *result = -error;
-       return attr_system_list(vp, data, size, result);
-}
-
-attrnames_t *
-attr_lookup_namespace(
-       char                    *name,
-       struct attrnames        **names,
-       int                     nnames)
-{
-       int                     i;
-
-       for (i = 0; i < nnames; i++)
-               if (!strncmp(name, names[i]->attr_name, names[i]->attr_namelen))
-                       return names[i];
-       return NULL;
-}
-
-/*
- * Some checks to prevent people abusing EAs to get over quota:
- * - Don't allow modifying user EAs on devices/symlinks;
- * - Don't allow modifying user EAs if sticky bit set;
- */
-STATIC int
-attr_user_capable(
-       bhv_vnode_t     *vp,
-       cred_t          *cred)
-{
-       struct inode    *inode = vn_to_inode(vp);
-
-       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               return -EPERM;
-       if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode) &&
-           !capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
-           (current_fsuid(cred) != inode->i_uid) && !capable(CAP_FOWNER))
-               return -EPERM;
-       return 0;
-}
-
-STATIC int
-attr_trusted_capable(
-       bhv_vnode_t     *vp,
-       cred_t          *cred)
-{
-       struct inode    *inode = vn_to_inode(vp);
-
-       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               return -EPERM;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       return 0;
-}
-
-STATIC int
-attr_system_set(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       attrnames_t     *namesp;
-       int             error;
-
-       if (xflags & ATTR_CREATE)
-               return -EINVAL;
-
-       namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       error = namesp->attr_set(vp, name, data, size, xflags);
-       if (!error)
-               error = vn_revalidate(vp);
-       return error;
-}
-
-STATIC int
-attr_system_get(
-       bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
-{
-       attrnames_t     *namesp;
-
-       namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       return namesp->attr_get(vp, name, data, size, xflags);
-}
-
-STATIC int
-attr_system_remove(
-       bhv_vnode_t *vp, char *name, int xflags)
-{
-       attrnames_t     *namesp;
-
-       namesp = attr_lookup_namespace(name, attr_system_names, ATTR_SYSCOUNT);
-       if (!namesp)
-               return -EOPNOTSUPP;
-       return namesp->attr_remove(vp, name, xflags);
-}
-
-struct attrnames attr_system = {
-       .attr_name      = "system.",
-       .attr_namelen   = sizeof("system.") - 1,
-       .attr_flag      = ATTR_SYSTEM,
-       .attr_get       = attr_system_get,
-       .attr_set       = attr_system_set,
-       .attr_remove    = attr_system_remove,
-       .attr_capable   = (attrcapable_t)fs_noerr,
-};
-
-struct attrnames attr_trusted = {
-       .attr_name      = "trusted.",
-       .attr_namelen   = sizeof("trusted.") - 1,
-       .attr_flag      = ATTR_ROOT,
-       .attr_get       = attr_generic_get,
-       .attr_set       = attr_generic_set,
-       .attr_remove    = attr_generic_remove,
-       .attr_capable   = attr_trusted_capable,
-};
-
-struct attrnames attr_secure = {
-       .attr_name      = "security.",
-       .attr_namelen   = sizeof("security.") - 1,
-       .attr_flag      = ATTR_SECURE,
-       .attr_get       = attr_generic_get,
-       .attr_set       = attr_generic_set,
-       .attr_remove    = attr_generic_remove,
-       .attr_capable   = (attrcapable_t)fs_noerr,
-};
-
-struct attrnames attr_user = {
-       .attr_name      = "user.",
-       .attr_namelen   = sizeof("user.") - 1,
-       .attr_get       = attr_generic_get,
-       .attr_set       = attr_generic_set,
-       .attr_remove    = attr_generic_remove,
-       .attr_capable   = attr_user_capable,
-};
-
-struct attrnames *attr_namespaces[] =
-       { &attr_system, &attr_trusted, &attr_secure, &attr_user };
index 6cfc9384fe35c952640edc8baa04ca6d4c1d3b78..8b2d31c19e4dbd3b2abb6ccb8bb9921d2a447ff4 100644 (file)
 #ifndef __XFS_ATTR_H__
 #define        __XFS_ATTR_H__
 
+struct xfs_inode;
+struct xfs_da_args;
+struct xfs_attr_list_context;
+
 /*
- * xfs_attr.h
- *
  * Large attribute lists are structured around Btrees where all the data
  * elements are in the leaf nodes.  Attribute names are hashed into an int,
  * then that int is used as the index into the Btree.  Since the hashval
  * External interfaces
  *========================================================================*/
 
-struct cred;
-struct xfs_attr_list_context;
-
-typedef int (*attrset_t)(bhv_vnode_t *, char *, void *, size_t, int);
-typedef int (*attrget_t)(bhv_vnode_t *, char *, void *, size_t, int);
-typedef int (*attrremove_t)(bhv_vnode_t *, char *, int);
-typedef int (*attrexists_t)(bhv_vnode_t *);
-typedef int (*attrcapable_t)(bhv_vnode_t *, struct cred *);
-
-typedef struct attrnames {
-       char *          attr_name;
-       unsigned int    attr_namelen;
-       unsigned int    attr_flag;
-       attrget_t       attr_get;
-       attrset_t       attr_set;
-       attrremove_t    attr_remove;
-       attrexists_t    attr_exists;
-       attrcapable_t   attr_capable;
-} attrnames_t;
-
-#define ATTR_NAMECOUNT 4
-extern struct attrnames attr_user;
-extern struct attrnames attr_secure;
-extern struct attrnames attr_system;
-extern struct attrnames attr_trusted;
-extern struct attrnames *attr_namespaces[ATTR_NAMECOUNT];
-
-extern attrnames_t *attr_lookup_namespace(char *, attrnames_t **, int);
-extern int attr_generic_list(bhv_vnode_t *, void *, size_t, int, ssize_t *);
 
 #define ATTR_DONTFOLLOW        0x0001  /* -- unused, from IRIX -- */
 #define ATTR_ROOT      0x0002  /* use attrs in root (trusted) namespace */
@@ -71,16 +44,9 @@ extern int attr_generic_list(bhv_vnode_t *, void *, size_t, int, ssize_t *);
 #define ATTR_SECURE    0x0008  /* use attrs in security namespace */
 #define ATTR_CREATE    0x0010  /* pure create: fail if attr already exists */
 #define ATTR_REPLACE   0x0020  /* pure set: fail if attr does not exist */
-#define ATTR_SYSTEM    0x0100  /* use attrs in system (pseudo) namespace */
 
-#define ATTR_KERNACCESS        0x0400  /* [kernel] iaccess, inode held io-locked */
 #define ATTR_KERNOTIME 0x1000  /* [kernel] don't update inode timestamps */
 #define ATTR_KERNOVAL  0x2000  /* [kernel] get attr size only, not value */
-#define ATTR_KERNAMELS 0x4000  /* [kernel] list attr names (simple list) */
-
-#define ATTR_KERNORMALS        0x0800  /* [kernel] normal attr list: user+secure */
-#define ATTR_KERNROOTLS        0x8000  /* [kernel] include root in the attr list */
-#define ATTR_KERNFULLS (ATTR_KERNORMALS|ATTR_KERNROOTLS)
 
 /*
  * The maximum size (into the kernel or returned from the kernel) of an
@@ -118,22 +84,6 @@ typedef struct attrlist_ent {       /* data from attr_list() */
        ((attrlist_ent_t *)                     \
         &((char *)buffer)[ ((attrlist_t *)(buffer))->al_offset[index] ])
 
-/*
- * Multi-attribute operation vector.
- */
-typedef struct attr_multiop {
-       int     am_opcode;      /* operation to perform (ATTR_OP_GET, etc.) */
-       int     am_error;       /* [out arg] result of this sub-op (an errno) */
-       char    *am_attrname;   /* attribute name to work with */
-       char    *am_attrvalue;  /* [in/out arg] attribute value (raw bytes) */
-       int     am_length;      /* [in/out arg] length of value */
-       int     am_flags;       /* bitwise OR of attr API flags defined above */
-} attr_multiop_t;
-
-#define ATTR_OP_GET    1       /* return the indicated attr's value */
-#define ATTR_OP_SET    2       /* set/create the indicated attr/value pair */
-#define ATTR_OP_REMOVE 3       /* remove the indicated attr */
-
 /*
  * Kernel-internal version of the attrlist cursor.
  */
@@ -148,20 +98,40 @@ typedef struct attrlist_cursor_kern {
 
 
 /*========================================================================
- * Function prototypes for the kernel.
+ * Structure used to pass context around among the routines.
  *========================================================================*/
 
-struct xfs_inode;
-struct attrlist_cursor_kern;
-struct xfs_da_args;
+
+typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, int,
+                                     char *, int, int, char *);
+
+typedef struct xfs_attr_list_context {
+       struct xfs_inode                *dp;            /* inode */
+       struct attrlist_cursor_kern     *cursor;        /* position in list */
+       char                            *alist;         /* output buffer */
+       int                             seen_enough;    /* T/F: seen enough of list? */
+       ssize_t                         count;          /* num used entries */
+       int                             dupcnt;         /* count dup hashvals seen */
+       int                             bufsize;        /* total buffer size */
+       int                             firstu;         /* first used byte in buffer */
+       int                             flags;          /* from VOP call */
+       int                             resynch;        /* T/F: resynch with cursor */
+       int                             put_value;      /* T/F: need value for listent */
+       put_listent_func_t              put_listent;    /* list output fmt function */
+       int                             index;          /* index into output buffer */
+} xfs_attr_list_context_t;
+
+
+/*========================================================================
+ * Function prototypes for the kernel.
+ *========================================================================*/
 
 /*
  * Overall external interface routines.
  */
 int xfs_attr_inactive(struct xfs_inode *dp);
-
-int xfs_attr_shortform_getvalue(struct xfs_da_args *);
 int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int);
 int xfs_attr_rmtval_get(struct xfs_da_args *args);
+int xfs_attr_list_int(struct xfs_attr_list_context *);
 
 #endif /* __XFS_ATTR_H__ */
index 303d41e4217b49590daae8814c3c2c863158c641..23ef5d7c87e1ba774709594da87cae681a2033ae 100644 (file)
@@ -94,13 +94,6 @@ STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
  * Namespace helper routines
  *========================================================================*/
 
-STATIC_INLINE attrnames_t *
-xfs_attr_flags_namesp(int flags)
-{
-       return ((flags & XFS_ATTR_SECURE) ? &attr_secure:
-                 ((flags & XFS_ATTR_ROOT) ? &attr_trusted : &attr_user));
-}
-
 /*
  * If namespace bits don't match return 0.
  * If all match then return 1.
@@ -111,25 +104,6 @@ xfs_attr_namesp_match(int arg_flags, int ondisk_flags)
        return XFS_ATTR_NSP_ONDISK(ondisk_flags) == XFS_ATTR_NSP_ARGS_TO_ONDISK(arg_flags);
 }
 
-/*
- * If namespace bits don't match and we don't have an override for it
- * then return 0.
- * If all match or are overridable then return 1.
- */
-STATIC_INLINE int
-xfs_attr_namesp_match_overrides(int arg_flags, int ondisk_flags)
-{
-       if (((arg_flags & ATTR_SECURE) == 0) !=
-           ((ondisk_flags & XFS_ATTR_SECURE) == 0) &&
-           !(arg_flags & ATTR_KERNORMALS))
-               return 0;
-       if (((arg_flags & ATTR_ROOT) == 0) !=
-           ((ondisk_flags & XFS_ATTR_ROOT) == 0) &&
-           !(arg_flags & ATTR_KERNROOTLS))
-               return 0;
-       return 1;
-}
-
 
 /*========================================================================
  * External routines when attribute fork size < XFS_LITINO(mp).
@@ -369,9 +343,10 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
         * Fix up the start offset of the attribute fork
         */
        totsize -= size;
-       if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname &&
-           (mp->m_flags & XFS_MOUNT_ATTR2) && 
-           (dp->i_d.di_format != XFS_DINODE_FMT_BTREE)) {
+       if (totsize == sizeof(xfs_attr_sf_hdr_t) &&
+                               !(args->op_flags & XFS_DA_OP_ADDNAME) &&
+                               (mp->m_flags & XFS_MOUNT_ATTR2) &&
+                               (dp->i_d.di_format != XFS_DINODE_FMT_BTREE)) {
                /*
                 * Last attribute now removed, revert to original
                 * inode format making all literal area available
@@ -389,9 +364,10 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
                xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);
                dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);
                ASSERT(dp->i_d.di_forkoff);
-               ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname ||
-                       !(mp->m_flags & XFS_MOUNT_ATTR2) ||
-                       dp->i_d.di_format == XFS_DINODE_FMT_BTREE);
+               ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) ||
+                               (args->op_flags & XFS_DA_OP_ADDNAME) ||
+                               !(mp->m_flags & XFS_MOUNT_ATTR2) ||
+                               dp->i_d.di_format == XFS_DINODE_FMT_BTREE);
                dp->i_afp->if_ext_max =
                        XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t);
                dp->i_df.if_ext_max =
@@ -531,7 +507,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)
        nargs.total = args->total;
        nargs.whichfork = XFS_ATTR_FORK;
        nargs.trans = args->trans;
-       nargs.oknoent = 1;
+       nargs.op_flags = XFS_DA_OP_OKNOENT;
 
        sfe = &sf->list[0];
        for (i = 0; i < sf->hdr.count; i++) {
@@ -555,7 +531,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)
 out:
        if(bp)
                xfs_da_buf_done(bp);
-       kmem_free(tmpbuffer, size);
+       kmem_free(tmpbuffer);
        return(error);
 }
 
@@ -624,15 +600,8 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
            (XFS_ISRESET_CURSOR(cursor) &&
              (dp->i_afp->if_bytes + sf->hdr.count * 16) < context->bufsize)) {
                for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) {
-                       attrnames_t     *namesp;
-
-                       if (!xfs_attr_namesp_match_overrides(context->flags, sfe->flags)) {
-                               sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
-                               continue;
-                       }
-                       namesp = xfs_attr_flags_namesp(sfe->flags);
                        error = context->put_listent(context,
-                                          namesp,
+                                          sfe->flags,
                                           (char *)sfe->nameval,
                                           (int)sfe->namelen,
                                           (int)sfe->valuelen,
@@ -676,13 +645,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
                                             XFS_ERRLEVEL_LOW,
                                             context->dp->i_mount, sfe);
                        xfs_attr_trace_l_c("sf corrupted", context);
-                       kmem_free(sbuf, sbsize);
+                       kmem_free(sbuf);
                        return XFS_ERROR(EFSCORRUPTED);
                }
-               if (!xfs_attr_namesp_match_overrides(context->flags, sfe->flags)) {
-                       sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
-                       continue;
-               }
+
                sbp->entno = i;
                sbp->hash = xfs_da_hashname((char *)sfe->nameval, sfe->namelen);
                sbp->name = (char *)sfe->nameval;
@@ -717,7 +683,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
                }
        }
        if (i == nsbuf) {
-               kmem_free(sbuf, sbsize);
+               kmem_free(sbuf);
                xfs_attr_trace_l_c("blk end", context);
                return(0);
        }
@@ -726,16 +692,12 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
         * Loop putting entries into the user buffer.
         */
        for ( ; i < nsbuf; i++, sbp++) {
-               attrnames_t     *namesp;
-
-               namesp = xfs_attr_flags_namesp(sbp->flags);
-
                if (cursor->hashval != sbp->hash) {
                        cursor->hashval = sbp->hash;
                        cursor->offset = 0;
                }
                error = context->put_listent(context,
-                                       namesp,
+                                       sbp->flags,
                                        sbp->name,
                                        sbp->namelen,
                                        sbp->valuelen,
@@ -747,7 +709,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
                cursor->offset++;
        }
 
-       kmem_free(sbuf, sbsize);
+       kmem_free(sbuf);
        xfs_attr_trace_l_c("sf E-O-F", context);
        return(0);
 }
@@ -853,7 +815,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
        nargs.total = args->total;
        nargs.whichfork = XFS_ATTR_FORK;
        nargs.trans = args->trans;
-       nargs.oknoent = 1;
+       nargs.op_flags = XFS_DA_OP_OKNOENT;
        entry = &leaf->entries[0];
        for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
                if (entry->flags & XFS_ATTR_INCOMPLETE)
@@ -873,7 +835,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
        error = 0;
 
 out:
-       kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount));
+       kmem_free(tmpbuffer);
        return(error);
 }
 
@@ -1155,7 +1117,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex)
        entry->hashval = cpu_to_be32(args->hashval);
        entry->flags = tmp ? XFS_ATTR_LOCAL : 0;
        entry->flags |= XFS_ATTR_NSP_ARGS_TO_ONDISK(args->flags);
-       if (args->rename) {
+       if (args->op_flags & XFS_DA_OP_RENAME) {
                entry->flags |= XFS_ATTR_INCOMPLETE;
                if ((args->blkno2 == args->blkno) &&
                    (args->index2 <= args->index)) {
@@ -1271,7 +1233,7 @@ xfs_attr_leaf_compact(xfs_trans_t *trans, xfs_dabuf_t *bp)
                                be16_to_cpu(hdr_s->count), mp);
        xfs_da_log_buf(trans, bp, 0, XFS_LBSIZE(mp) - 1);
 
-       kmem_free(tmpbuffer, XFS_LBSIZE(mp));
+       kmem_free(tmpbuffer);
 }
 
 /*
@@ -1921,7 +1883,7 @@ xfs_attr_leaf_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
                                be16_to_cpu(drop_hdr->count), mp);
                }
                memcpy((char *)save_leaf, (char *)tmp_leaf, state->blocksize);
-               kmem_free(tmpbuffer, state->blocksize);
+               kmem_free(tmpbuffer);
        }
 
        xfs_da_log_buf(state->args->trans, save_blk->bp, 0,
@@ -2400,8 +2362,6 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
         */
        retval = 0;
        for (  ; (i < be16_to_cpu(leaf->hdr.count)); entry++, i++) {
-               attrnames_t *namesp;
-
                if (be32_to_cpu(entry->hashval) != cursor->hashval) {
                        cursor->hashval = be32_to_cpu(entry->hashval);
                        cursor->offset = 0;
@@ -2409,17 +2369,13 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
 
                if (entry->flags & XFS_ATTR_INCOMPLETE)
                        continue;               /* skip incomplete entries */
-               if (!xfs_attr_namesp_match_overrides(context->flags, entry->flags))
-                       continue;
-
-               namesp = xfs_attr_flags_namesp(entry->flags);
 
                if (entry->flags & XFS_ATTR_LOCAL) {
                        xfs_attr_leaf_name_local_t *name_loc =
                                XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
 
                        retval = context->put_listent(context,
-                                               namesp,
+                                               entry->flags,
                                                (char *)name_loc->nameval,
                                                (int)name_loc->namelen,
                                                be16_to_cpu(name_loc->valuelen),
@@ -2446,16 +2402,15 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
                                if (retval)
                                        return retval;
                                retval = context->put_listent(context,
-                                               namesp,
+                                               entry->flags,
                                                (char *)name_rmt->name,
                                                (int)name_rmt->namelen,
                                                valuelen,
                                                (char*)args.value);
-                               kmem_free(args.value, valuelen);
-                       }
-                       else {
+                               kmem_free(args.value);
+                       } else {
                                retval = context->put_listent(context,
-                                               namesp,
+                                               entry->flags,
                                                (char *)name_rmt->name,
                                                (int)name_rmt->namelen,
                                                valuelen,
@@ -2954,7 +2909,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
                        error = tmp;    /* save only the 1st errno */
        }
 
-       kmem_free((xfs_caddr_t)list, size);
+       kmem_free((xfs_caddr_t)list);
        return(error);
 }
 
index 040f732ce1e22a22e513bd3afca283c1d432e167..5ecf437b782556ffc663f55f9eac51fa4f9291c3 100644 (file)
@@ -30,7 +30,7 @@
 
 struct attrlist;
 struct attrlist_cursor_kern;
-struct attrnames;
+struct xfs_attr_list_context;
 struct xfs_dabuf;
 struct xfs_da_args;
 struct xfs_da_state;
@@ -204,33 +204,6 @@ static inline int xfs_attr_leaf_entsize_local_max(int bsize)
        return (((bsize) >> 1) + ((bsize) >> 2));
 }
 
-
-/*========================================================================
- * Structure used to pass context around among the routines.
- *========================================================================*/
-
-
-struct xfs_attr_list_context;
-
-typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, struct attrnames *,
-                                     char *, int, int, char *);
-
-typedef struct xfs_attr_list_context {
-       struct xfs_inode                *dp;            /* inode */
-       struct attrlist_cursor_kern     *cursor;        /* position in list */
-       struct attrlist                 *alist;         /* output buffer */
-       int                             seen_enough;    /* T/F: seen enough of list? */
-       int                             count;          /* num used entries */
-       int                             dupcnt;         /* count dup hashvals seen */
-       int                             bufsize;        /* total buffer size */
-       int                             firstu;         /* first used byte in buffer */
-       int                             flags;          /* from VOP call */
-       int                             resynch;        /* T/F: resynch with cursor */
-       int                             put_value;      /* T/F: need value for listent */
-       put_listent_func_t              put_listent;    /* list output fmt function */
-       int                             index;          /* index into output buffer */
-} xfs_attr_list_context_t;
-
 /*
  * Used to keep a list of "remote value" extents when unlinking an inode.
  */
index f67f917803b1d2d5efdb764647f9e9be6026ec04..ea22839caed22757a5076a6997afe66666f14edd 100644 (file)
@@ -97,13 +97,9 @@ void xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context,
 void xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context,
                              struct xfs_attr_leafblock *leaf);
 void xfs_attr_trace_enter(int type, char *where,
-                            __psunsigned_t a2, __psunsigned_t a3,
-                            __psunsigned_t a4, __psunsigned_t a5,
-                            __psunsigned_t a6, __psunsigned_t a7,
-                            __psunsigned_t a8, __psunsigned_t a9,
-                            __psunsigned_t a10, __psunsigned_t a11,
-                            __psunsigned_t a12, __psunsigned_t a13,
-                            __psunsigned_t a14, __psunsigned_t a15);
+                            struct xfs_attr_list_context *context,
+                            __psunsigned_t a13, __psunsigned_t a14,
+                            __psunsigned_t a15);
 #else
 #define        xfs_attr_trace_l_c(w,c)
 #define        xfs_attr_trace_l_cn(w,c,n)
index 53c259f5a5af5e7b85fde5f73ee678670e692ad9..3c4beb3a43266585c948f91fefe2a1a7adbb82ea 100644 (file)
@@ -428,7 +428,8 @@ xfs_bmap_add_attrfork_btree(
                cur->bc_private.b.firstblock = *firstblock;
                if ((error = xfs_bmbt_lookup_ge(cur, 0, 0, 0, &stat)))
                        goto error0;
-               ASSERT(stat == 1);      /* must be at least one entry */
+               /* must be at least one entry */
+               XFS_WANT_CORRUPTED_GOTO(stat == 1, error0);
                if ((error = xfs_bmbt_newroot(cur, flags, &stat)))
                        goto error0;
                if (stat == 0) {
@@ -816,13 +817,13 @@ xfs_bmap_add_extent_delay_real(
                                        RIGHT.br_startblock,
                                        RIGHT.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
                                        LEFT.br_startblock,
                                        LEFT.br_blockcount +
@@ -860,7 +861,7 @@ xfs_bmap_add_extent_delay_real(
                                        LEFT.br_startblock, LEFT.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
                                        LEFT.br_startblock,
                                        LEFT.br_blockcount +
@@ -895,7 +896,7 @@ xfs_bmap_add_extent_delay_real(
                                        RIGHT.br_startblock,
                                        RIGHT.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
                                        new->br_startblock,
                                        PREV.br_blockcount +
@@ -928,11 +929,11 @@ xfs_bmap_add_extent_delay_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = XFS_EXT_NORM;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                *dnew = 0;
                /* DELTA: The in-core extent described by new changed type. */
@@ -963,7 +964,7 @@ xfs_bmap_add_extent_delay_real(
                                        LEFT.br_startblock, LEFT.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
                                        LEFT.br_startblock,
                                        LEFT.br_blockcount +
@@ -1004,11 +1005,11 @@ xfs_bmap_add_extent_delay_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = XFS_EXT_NORM;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
                    ip->i_d.di_nextents > ip->i_df.if_ext_max) {
@@ -1054,7 +1055,7 @@ xfs_bmap_add_extent_delay_real(
                                        RIGHT.br_startblock,
                                        RIGHT.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, new->br_startoff,
                                        new->br_startblock,
                                        new->br_blockcount +
@@ -1094,11 +1095,11 @@ xfs_bmap_add_extent_delay_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = XFS_EXT_NORM;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
                    ip->i_d.di_nextents > ip->i_df.if_ext_max) {
@@ -1149,11 +1150,11 @@ xfs_bmap_add_extent_delay_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = XFS_EXT_NORM;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
                    ip->i_d.di_nextents > ip->i_df.if_ext_max) {
@@ -1377,19 +1378,19 @@ xfs_bmap_add_extent_unwritten_real(
                                        RIGHT.br_startblock,
                                        RIGHT.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
                                LEFT.br_startblock,
                                LEFT.br_blockcount + PREV.br_blockcount +
@@ -1426,13 +1427,13 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock, PREV.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
                                LEFT.br_startblock,
                                LEFT.br_blockcount + PREV.br_blockcount,
@@ -1469,13 +1470,13 @@ xfs_bmap_add_extent_unwritten_real(
                                        RIGHT.br_startblock,
                                        RIGHT.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, new->br_startoff,
                                new->br_startblock,
                                new->br_blockcount + RIGHT.br_blockcount,
@@ -1508,7 +1509,7 @@ xfs_bmap_add_extent_unwritten_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, new->br_startoff,
                                new->br_startblock, new->br_blockcount,
                                newext)))
@@ -1549,7 +1550,7 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock, PREV.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur,
                                PREV.br_startoff + new->br_blockcount,
                                PREV.br_startblock + new->br_blockcount,
@@ -1596,7 +1597,7 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock, PREV.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur,
                                PREV.br_startoff + new->br_blockcount,
                                PREV.br_startblock + new->br_blockcount,
@@ -1606,7 +1607,7 @@ xfs_bmap_add_extent_unwritten_real(
                        cur->bc_rec.b = *new;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                /* DELTA: One in-core extent is split in two. */
                temp = PREV.br_startoff;
@@ -1640,7 +1641,7 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock,
                                        PREV.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
                                PREV.br_startblock,
                                PREV.br_blockcount - new->br_blockcount,
@@ -1682,7 +1683,7 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock, PREV.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
                                PREV.br_startblock,
                                PREV.br_blockcount - new->br_blockcount,
@@ -1692,11 +1693,11 @@ xfs_bmap_add_extent_unwritten_real(
                                        new->br_startblock, new->br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = XFS_EXT_NORM;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                /* DELTA: One in-core extent is split in two. */
                temp = PREV.br_startoff;
@@ -1732,27 +1733,34 @@ xfs_bmap_add_extent_unwritten_real(
                                        PREV.br_startblock, PREV.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        /* new right extent - oldext */
                        if ((error = xfs_bmbt_update(cur, r[1].br_startoff,
                                r[1].br_startblock, r[1].br_blockcount,
                                r[1].br_state)))
                                goto done;
                        /* new left extent - oldext */
-                       PREV.br_blockcount =
-                               new->br_startoff - PREV.br_startoff;
                        cur->bc_rec.b = PREV;
+                       cur->bc_rec.b.br_blockcount =
+                               new->br_startoff - PREV.br_startoff;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
-                       if ((error = xfs_bmbt_increment(cur, 0, &i)))
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
+                       /*
+                        * Reset the cursor to the position of the new extent
+                        * we are about to insert as we can't trust it after
+                        * the previous insert.
+                        */
+                       if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+                                       new->br_startblock, new->br_blockcount,
+                                       &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        /* new middle extent - newext */
-                       cur->bc_rec.b = *new;
+                       cur->bc_rec.b.br_state = new->br_state;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                /* DELTA: One in-core extent is split in three. */
                temp = PREV.br_startoff;
@@ -2097,13 +2105,13 @@ xfs_bmap_add_extent_hole_real(
                                        right.br_startblock,
                                        right.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_delete(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_decrement(cur, 0, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, left.br_startoff,
                                        left.br_startblock,
                                        left.br_blockcount +
@@ -2139,7 +2147,7 @@ xfs_bmap_add_extent_hole_real(
                                        left.br_startblock,
                                        left.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, left.br_startoff,
                                        left.br_startblock,
                                        left.br_blockcount +
@@ -2174,7 +2182,7 @@ xfs_bmap_add_extent_hole_real(
                                        right.br_startblock,
                                        right.br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        if ((error = xfs_bmbt_update(cur, new->br_startoff,
                                        new->br_startblock,
                                        new->br_blockcount +
@@ -2208,11 +2216,11 @@ xfs_bmap_add_extent_hole_real(
                                        new->br_startblock,
                                        new->br_blockcount, &i)))
                                goto done;
-                       ASSERT(i == 0);
+                       XFS_WANT_CORRUPTED_GOTO(i == 0, done);
                        cur->bc_rec.b.br_state = new->br_state;
                        if ((error = xfs_bmbt_insert(cur, &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                /* DELTA: A new extent was added in a hole. */
                temp = new->br_startoff;
@@ -3131,7 +3139,7 @@ xfs_bmap_del_extent(
                                        got.br_startblock, got.br_blockcount,
                                        &i)))
                                goto done;
-                       ASSERT(i == 1);
+                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                }
                da_old = da_new = 0;
        } else {
@@ -3164,7 +3172,7 @@ xfs_bmap_del_extent(
                }
                if ((error = xfs_bmbt_delete(cur, &i)))
                        goto done;
-               ASSERT(i == 1);
+               XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                break;
 
        case 2:
@@ -3268,7 +3276,7 @@ xfs_bmap_del_extent(
                                                        got.br_startblock,
                                                        temp, &i)))
                                                goto done;
-                                       ASSERT(i == 1);
+                                       XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                                        /*
                                         * Update the btree record back
                                         * to the original value.
@@ -3289,7 +3297,7 @@ xfs_bmap_del_extent(
                                        error = XFS_ERROR(ENOSPC);
                                        goto done;
                                }
-                               ASSERT(i == 1);
+                               XFS_WANT_CORRUPTED_GOTO(i == 1, done);
                        } else
                                flags |= XFS_ILOG_FEXT(whichfork);
                        XFS_IFORK_NEXT_SET(ip, whichfork,
@@ -5970,7 +5978,7 @@ unlock_and_return:
        xfs_iunlock_map_shared(ip, lock);
        xfs_iunlock(ip, XFS_IOLOCK_SHARED);
 
-       kmem_free(map, subnex * sizeof(*map));
+       kmem_free(map);
 
        return error;
 }
index 6ff70cda451cbe6011a118ac6a612eaf79dfd3a5..9f3e3a836d153b6bbf09d222588b84ae06c1be34 100644 (file)
@@ -54,12 +54,23 @@ typedef struct xfs_bmap_free_item
 
 /*
  * Header for free extent list.
+ *
+ * xbf_low is used by the allocator to activate the lowspace algorithm -
+ * when free space is running low the extent allocator may choose to
+ * allocate an extent from an AG without leaving sufficient space for
+ * a btree split when inserting the new extent.  In this case the allocator
+ * will enable the lowspace algorithm which is supposed to allow further
+ * allocations (such as btree splits and newroots) to allocate from
+ * sequential AGs.  In order to avoid locking AGs out of order the lowspace
+ * algorithm will start searching for free space from AG 0.  If the correct
+ * transaction reservations have been made then this algorithm will eventually
+ * find all the space it needs.
  */
 typedef        struct xfs_bmap_free
 {
        xfs_bmap_free_item_t    *xbf_first;     /* list of to-be-free extents */
        int                     xbf_count;      /* count of items on list */
-       int                     xbf_low;        /* kludge: alloc in low mode */
+       int                     xbf_low;        /* alloc in low mode */
 } xfs_bmap_free_t;
 
 #define        XFS_BMAP_MAX_NMAP       4
index 4f0e849d973edda419fb75980b62f5e4f159419a..23efad29a5cd680b1229ae32a3e56fa9b78d50a8 100644 (file)
@@ -1493,12 +1493,27 @@ xfs_bmbt_split(
        left = XFS_BUF_TO_BMBT_BLOCK(lbp);
        args.fsbno = cur->bc_private.b.firstblock;
        args.firstblock = args.fsbno;
+       args.minleft = 0;
        if (args.fsbno == NULLFSBLOCK) {
                args.fsbno = lbno;
                args.type = XFS_ALLOCTYPE_START_BNO;
-       } else
+               /*
+                * Make sure there is sufficient room left in the AG to
+                * complete a full tree split for an extent insert.  If
+                * we are converting the middle part of an extent then
+                * we may need space for two tree splits.
+                *
+                * We are relying on the caller to make the correct block
+                * reservation for this operation to succeed.  If the
+                * reservation amount is insufficient then we may fail a
+                * block allocation here and corrupt the filesystem.
+                */
+               args.minleft = xfs_trans_get_block_res(args.tp);
+       } else if (cur->bc_private.b.flist->xbf_low)
+               args.type = XFS_ALLOCTYPE_START_BNO;
+       else
                args.type = XFS_ALLOCTYPE_NEAR_BNO;
-       args.mod = args.minleft = args.alignment = args.total = args.isfl =
+       args.mod = args.alignment = args.total = args.isfl =
                args.userdata = args.minalignslop = 0;
        args.minlen = args.maxlen = args.prod = 1;
        args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
@@ -1510,6 +1525,21 @@ xfs_bmbt_split(
                XFS_BMBT_TRACE_CURSOR(cur, ERROR);
                return error;
        }
+       if (args.fsbno == NULLFSBLOCK && args.minleft) {
+               /*
+                * Could not find an AG with enough free space to satisfy
+                * a full btree split.  Try again without minleft and if
+                * successful activate the lowspace algorithm.
+                */
+               args.fsbno = 0;
+               args.type = XFS_ALLOCTYPE_FIRST_AG;
+               args.minleft = 0;
+               if ((error = xfs_alloc_vextent(&args))) {
+                       XFS_BMBT_TRACE_CURSOR(cur, ERROR);
+                       return error;
+               }
+               cur->bc_private.b.flist->xbf_low = 1;
+       }
        if (args.fsbno == NULLFSBLOCK) {
                XFS_BMBT_TRACE_CURSOR(cur, EXIT);
                *stat = 0;
@@ -2029,22 +2059,8 @@ xfs_bmbt_increment(
  * Insert the current record at the point referenced by cur.
  *
  * A multi-level split of the tree on insert will invalidate the original
- * cursor. It appears, however, that some callers assume that the cursor is
- * always valid. Hence if we do a multi-level split we need to revalidate the
- * cursor.
- *
- * When a split occurs, we will see a new cursor returned. Use that as a
- * trigger to determine if we need to revalidate the original cursor. If we get
- * a split, then use the original irec to lookup up the path of the record we
- * just inserted.
- *
- * Note that the fact that the btree root is in the inode means that we can
- * have the level of the tree change without a "split" occurring at the root
- * level. What happens is that the root is migrated to an allocated block and
- * the inode root is pointed to it. This means a single split can change the
- * level of the tree (level 2 -> level 3) and invalidate the old cursor. Hence
- * the level change should be accounted as a split so as to correctly trigger a
- * revalidation of the old cursor.
+ * cursor.  All callers of this function should assume that the cursor is
+ * no longer valid and revalidate it.
  */
 int                                    /* error */
 xfs_bmbt_insert(
@@ -2057,14 +2073,11 @@ xfs_bmbt_insert(
        xfs_fsblock_t   nbno;
        xfs_btree_cur_t *ncur;
        xfs_bmbt_rec_t  nrec;
-       xfs_bmbt_irec_t oirec;          /* original irec */
        xfs_btree_cur_t *pcur;
-       int             splits = 0;
 
        XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
        level = 0;
        nbno = NULLFSBLOCK;
-       oirec = cur->bc_rec.b;
        xfs_bmbt_disk_set_all(&nrec, &cur->bc_rec.b);
        ncur = NULL;
        pcur = cur;
@@ -2073,13 +2086,11 @@ xfs_bmbt_insert(
                                &i))) {
                        if (pcur != cur)
                                xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR);
-                       goto error0;
+                       XFS_BMBT_TRACE_CURSOR(cur, ERROR);
+                       return error;
                }
                XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
                if (pcur != cur && (ncur || nbno == NULLFSBLOCK)) {
-                       /* allocating a new root is effectively a split */
-                       if (cur->bc_nlevels != pcur->bc_nlevels)
-                               splits++;
                        cur->bc_nlevels = pcur->bc_nlevels;
                        cur->bc_private.b.allocated +=
                                pcur->bc_private.b.allocated;
@@ -2093,21 +2104,10 @@ xfs_bmbt_insert(
                        xfs_btree_del_cursor(pcur, XFS_BTREE_NOERROR);
                }
                if (ncur) {
-                       splits++;
                        pcur = ncur;
                        ncur = NULL;
                }
        } while (nbno != NULLFSBLOCK);
-
-       if (splits > 1) {
-               /* revalidate the old cursor as we had a multi-level split */
-               error = xfs_bmbt_lookup_eq(cur, oirec.br_startoff,
-                               oirec.br_startblock, oirec.br_blockcount, &i);
-               if (error)
-                       goto error0;
-               ASSERT(i == 1);
-       }
-
        XFS_BMBT_TRACE_CURSOR(cur, EXIT);
        *stat = i;
        return 0;
@@ -2254,7 +2254,9 @@ xfs_bmbt_newroot(
 #endif
                args.fsbno = be64_to_cpu(*pp);
                args.type = XFS_ALLOCTYPE_START_BNO;
-       } else
+       } else if (cur->bc_private.b.flist->xbf_low)
+               args.type = XFS_ALLOCTYPE_START_BNO;
+       else
                args.type = XFS_ALLOCTYPE_NEAR_BNO;
        if ((error = xfs_alloc_vextent(&args))) {
                XFS_BMBT_TRACE_CURSOR(cur, ERROR);
index 53a71c62025d2ba3923f11f610be93e94f37e7eb..d86ca2c03a70d596ae42f2028faa932549ba1601 100644 (file)
@@ -889,9 +889,9 @@ xfs_buf_item_relse(
        }
 
 #ifdef XFS_TRANS_DEBUG
-       kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp));
+       kmem_free(bip->bli_orig);
        bip->bli_orig = NULL;
-       kmem_free(bip->bli_logged, XFS_BUF_COUNT(bp) / NBBY);
+       kmem_free(bip->bli_logged);
        bip->bli_logged = NULL;
 #endif /* XFS_TRANS_DEBUG */
 
@@ -1138,9 +1138,9 @@ xfs_buf_iodone(
        xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip);
 
 #ifdef XFS_TRANS_DEBUG
-       kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp));
+       kmem_free(bip->bli_orig);
        bip->bli_orig = NULL;
-       kmem_free(bip->bli_logged, XFS_BUF_COUNT(bp) / NBBY);
+       kmem_free(bip->bli_logged);
        bip->bli_logged = NULL;
 #endif /* XFS_TRANS_DEBUG */
 
index d5d1e60ee2247ba7281954888a0412c51a0bbd3f..d2ce5dd70d878ddc8bd7548c1841dfa1d67fc836 100644 (file)
@@ -78,6 +78,7 @@ struct xfs_mount_args {
 #define XFSMNT_IOSIZE          0x00002000      /* optimize for I/O size */
 #define XFSMNT_OSYNCISOSYNC    0x00004000      /* o_sync is REALLY o_sync */
                                                /* (osyncisdsync is default) */
+#define XFSMNT_NOATTR2         0x00008000      /* turn off ATTR2 EA format */
 #define XFSMNT_32BITINODES     0x00200000      /* restrict inodes to 32
                                                 * bits of address space */
 #define XFSMNT_GQUOTA          0x00400000      /* group quota accounting */
index 021a8f7e563f340df77bb75977ee397317d2d322..9e561a9cefcaa193c5a4214ad7449246dcd96a44 100644 (file)
@@ -1431,7 +1431,7 @@ xfs_da_path_shift(xfs_da_state_t *state, xfs_da_state_path_t *path,
        }
        if (level < 0) {
                *result = XFS_ERROR(ENOENT);    /* we're out of our tree */
-               ASSERT(args->oknoent);
+               ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
                return(0);
        }
 
@@ -1530,6 +1530,28 @@ xfs_da_hashname(const uchar_t *name, int namelen)
        }
 }
 
+enum xfs_dacmp
+xfs_da_compname(
+       struct xfs_da_args *args,
+       const char      *name,
+       int             len)
+{
+       return (args->namelen == len && memcmp(args->name, name, len) == 0) ?
+                                       XFS_CMP_EXACT : XFS_CMP_DIFFERENT;
+}
+
+static xfs_dahash_t
+xfs_default_hashname(
+       struct xfs_name *name)
+{
+       return xfs_da_hashname(name->name, name->len);
+}
+
+const struct xfs_nameops xfs_default_nameops = {
+       .hashname       = xfs_default_hashname,
+       .compname       = xfs_da_compname
+};
+
 /*
  * Add a block to the btree ahead of the file.
  * Return the new block number to the caller.
@@ -1598,7 +1620,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
                                        args->firstblock, args->total,
                                        &mapp[mapi], &nmap, args->flist,
                                        NULL))) {
-                               kmem_free(mapp, sizeof(*mapp) * count);
+                               kmem_free(mapp);
                                return error;
                        }
                        if (nmap < 1)
@@ -1620,11 +1642,11 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
            mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount !=
            bno + count) {
                if (mapp != &map)
-                       kmem_free(mapp, sizeof(*mapp) * count);
+                       kmem_free(mapp);
                return XFS_ERROR(ENOSPC);
        }
        if (mapp != &map)
-               kmem_free(mapp, sizeof(*mapp) * count);
+               kmem_free(mapp);
        *new_blkno = (xfs_dablk_t)bno;
        return 0;
 }
@@ -2090,10 +2112,10 @@ xfs_da_do_buf(
                }
        }
        if (bplist) {
-               kmem_free(bplist, sizeof(*bplist) * nmap);
+               kmem_free(bplist);
        }
        if (mapp != &map) {
-               kmem_free(mapp, sizeof(*mapp) * nfsb);
+               kmem_free(mapp);
        }
        if (bpp)
                *bpp = rbp;
@@ -2102,11 +2124,11 @@ exit1:
        if (bplist) {
                for (i = 0; i < nbplist; i++)
                        xfs_trans_brelse(trans, bplist[i]);
-               kmem_free(bplist, sizeof(*bplist) * nmap);
+               kmem_free(bplist);
        }
 exit0:
        if (mapp != &map)
-               kmem_free(mapp, sizeof(*mapp) * nfsb);
+               kmem_free(mapp);
        if (bpp)
                *bpp = NULL;
        return error;
@@ -2218,7 +2240,7 @@ xfs_da_state_free(xfs_da_state_t *state)
 
 #ifdef XFS_DABUF_DEBUG
 xfs_dabuf_t    *xfs_dabuf_global_list;
-spinlock_t     xfs_dabuf_global_lock;
+static DEFINE_SPINLOCK(xfs_dabuf_global_lock);
 #endif
 
 /*
@@ -2315,7 +2337,7 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf)
        if (dabuf->dirty)
                xfs_da_buf_clean(dabuf);
        if (dabuf->nbuf > 1)
-               kmem_free(dabuf->data, BBTOB(dabuf->bbcount));
+               kmem_free(dabuf->data);
 #ifdef XFS_DABUF_DEBUG
        {
                spin_lock(&xfs_dabuf_global_lock);
@@ -2332,7 +2354,7 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf)
        if (dabuf->nbuf == 1)
                kmem_zone_free(xfs_dabuf_zone, dabuf);
        else
-               kmem_free(dabuf, XFS_DA_BUF_SIZE(dabuf->nbuf));
+               kmem_free(dabuf);
 }
 
 /*
@@ -2403,7 +2425,7 @@ xfs_da_brelse(xfs_trans_t *tp, xfs_dabuf_t *dabuf)
        for (i = 0; i < nbuf; i++)
                xfs_trans_brelse(tp, bplist[i]);
        if (bplist != &bp)
-               kmem_free(bplist, nbuf * sizeof(*bplist));
+               kmem_free(bplist);
 }
 
 /*
@@ -2429,7 +2451,7 @@ xfs_da_binval(xfs_trans_t *tp, xfs_dabuf_t *dabuf)
        for (i = 0; i < nbuf; i++)
                xfs_trans_binval(tp, bplist[i]);
        if (bplist != &bp)
-               kmem_free(bplist, nbuf * sizeof(*bplist));
+               kmem_free(bplist);
 }
 
 /*
index 7facf86f74f92c6904fcfc5da89435ecc5f8a3db..8be0b00ede9aafc83970a23e4ad9c7df2565b54d 100644 (file)
@@ -98,6 +98,15 @@ typedef struct xfs_da_node_entry xfs_da_node_entry_t;
  * Btree searching and modification structure definitions.
  *========================================================================*/
 
+/*
+ * Search comparison results
+ */
+enum xfs_dacmp {
+       XFS_CMP_DIFFERENT,      /* names are completely different */
+       XFS_CMP_EXACT,          /* names are exactly the same */
+       XFS_CMP_CASE            /* names are same but differ in case */
+};
+
 /*
  * Structure to ease passing around component names.
  */
@@ -123,12 +132,19 @@ typedef struct xfs_da_args {
        int             index2;         /* index of 2nd attr in blk */
        xfs_dablk_t     rmtblkno2;      /* remote attr value starting blkno */
        int             rmtblkcnt2;     /* remote attr value block count */
-       unsigned char   justcheck;      /* T/F: check for ok with no space */
-       unsigned char   rename;         /* T/F: this is an atomic rename op */
-       unsigned char   addname;        /* T/F: this is an add operation */
-       unsigned char   oknoent;        /* T/F: ok to return ENOENT, else die */
+       int             op_flags;       /* operation flags */
+       enum xfs_dacmp  cmpresult;      /* name compare result for lookups */
 } xfs_da_args_t;
 
+/*
+ * Operation flags:
+ */
+#define XFS_DA_OP_JUSTCHECK    0x0001  /* check for ok with no space */
+#define XFS_DA_OP_RENAME       0x0002  /* this is an atomic rename op */
+#define XFS_DA_OP_ADDNAME      0x0004  /* this is an add operation */
+#define XFS_DA_OP_OKNOENT      0x0008  /* lookup/add op, ENOENT ok, else die */
+#define XFS_DA_OP_CILOOKUP     0x0010  /* lookup to return CI name if found */
+
 /*
  * Structure to describe buffer(s) for a block.
  * This is needed in the directory version 2 format case, when
@@ -201,6 +217,14 @@ typedef struct xfs_da_state {
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1)
 
+/*
+ * Name ops for directory and/or attr name operations
+ */
+struct xfs_nameops {
+       xfs_dahash_t    (*hashname)(struct xfs_name *);
+       enum xfs_dacmp  (*compname)(struct xfs_da_args *, const char *, int);
+};
+
 
 #ifdef __KERNEL__
 /*========================================================================
@@ -249,6 +273,10 @@ int        xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
                                          xfs_dabuf_t *dead_buf);
 
 uint xfs_da_hashname(const uchar_t *name_string, int name_length);
+enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
+                               const char *name, int len);
+
+
 xfs_da_state_t *xfs_da_state_alloc(void);
 void xfs_da_state_free(xfs_da_state_t *state);
 
index 5f3647cb98851aa13855ed53d26d102bdb0f08c7..2211e885ef243d47d690bb9a4bf044cf9bf26504 100644 (file)
@@ -116,7 +116,7 @@ xfs_swapext(
  out_put_file:
        fput(file);
  out_free_sxp:
-       kmem_free(sxp, sizeof(xfs_swapext_t));
+       kmem_free(sxp);
  out:
        return error;
 }
@@ -381,6 +381,6 @@ xfs_swap_extents(
                xfs_iunlock(tip, lock_flags);
        }
        if (tempifp != NULL)
-               kmem_free(tempifp, sizeof(xfs_ifork_t));
+               kmem_free(tempifp);
        return error;
 }
index 7cb26529766b7759c2ed743273d0942d71765a15..80e0dc51361c07e541726ff75871f399fd58d181 100644 (file)
 
 struct xfs_name xfs_name_dotdot = {"..", 2};
 
+extern const struct xfs_nameops xfs_default_nameops;
+
+/*
+ * ASCII case-insensitive (ie. A-Z) support for directories that was
+ * used in IRIX.
+ */
+STATIC xfs_dahash_t
+xfs_ascii_ci_hashname(
+       struct xfs_name *name)
+{
+       xfs_dahash_t    hash;
+       int             i;
+
+       for (i = 0, hash = 0; i < name->len; i++)
+               hash = tolower(name->name[i]) ^ rol32(hash, 7);
+
+       return hash;
+}
+
+STATIC enum xfs_dacmp
+xfs_ascii_ci_compname(
+       struct xfs_da_args *args,
+       const char      *name,
+       int             len)
+{
+       enum xfs_dacmp  result;
+       int             i;
+
+       if (args->namelen != len)
+               return XFS_CMP_DIFFERENT;
+
+       result = XFS_CMP_EXACT;
+       for (i = 0; i < len; i++) {
+               if (args->name[i] == name[i])
+                       continue;
+               if (tolower(args->name[i]) != tolower(name[i]))
+                       return XFS_CMP_DIFFERENT;
+               result = XFS_CMP_CASE;
+       }
+
+       return result;
+}
+
+static struct xfs_nameops xfs_ascii_ci_nameops = {
+       .hashname       = xfs_ascii_ci_hashname,
+       .compname       = xfs_ascii_ci_compname,
+};
+
 void
 xfs_dir_mount(
        xfs_mount_t     *mp)
@@ -65,6 +113,10 @@ xfs_dir_mount(
                (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) /
                (uint)sizeof(xfs_da_node_entry_t);
        mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100;
+       if (xfs_sb_version_hasasciici(&mp->m_sb))
+               mp->m_dirnameops = &xfs_ascii_ci_nameops;
+       else
+               mp->m_dirnameops = &xfs_default_nameops;
 }
 
 /*
@@ -162,9 +214,10 @@ xfs_dir_createname(
                return rval;
        XFS_STATS_INC(xs_dir_create);
 
+       memset(&args, 0, sizeof(xfs_da_args_t));
        args.name = name->name;
        args.namelen = name->len;
-       args.hashval = xfs_da_hashname(name->name, name->len);
+       args.hashval = dp->i_mount->m_dirnameops->hashname(name);
        args.inumber = inum;
        args.dp = dp;
        args.firstblock = first;
@@ -172,8 +225,7 @@ xfs_dir_createname(
        args.total = total;
        args.whichfork = XFS_DATA_FORK;
        args.trans = tp;
-       args.justcheck = 0;
-       args.addname = args.oknoent = 1;
+       args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
 
        if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
                rval = xfs_dir2_sf_addname(&args);
@@ -190,15 +242,44 @@ xfs_dir_createname(
        return rval;
 }
 
+/*
+ * If doing a CI lookup and case-insensitive match, dup actual name into
+ * args.value. Return EEXIST for success (ie. name found) or an error.
+ */
+int
+xfs_dir_cilookup_result(
+       struct xfs_da_args *args,
+       const char      *name,
+       int             len)
+{
+       if (args->cmpresult == XFS_CMP_DIFFERENT)
+               return ENOENT;
+       if (args->cmpresult != XFS_CMP_CASE ||
+                                       !(args->op_flags & XFS_DA_OP_CILOOKUP))
+               return EEXIST;
+
+       args->value = kmem_alloc(len, KM_MAYFAIL);
+       if (!args->value)
+               return ENOMEM;
+
+       memcpy(args->value, name, len);
+       args->valuelen = len;
+       return EEXIST;
+}
+
 /*
  * Lookup a name in a directory, give back the inode number.
+ * If ci_name is not NULL, returns the actual name in ci_name if it differs
+ * to name, or ci_name->name is set to NULL for an exact match.
  */
+
 int
 xfs_dir_lookup(
        xfs_trans_t     *tp,
        xfs_inode_t     *dp,
        struct xfs_name *name,
-       xfs_ino_t       *inum)          /* out: inode number */
+       xfs_ino_t       *inum,          /* out: inode number */
+       struct xfs_name *ci_name)       /* out: actual name if CI match */
 {
        xfs_da_args_t   args;
        int             rval;
@@ -206,15 +287,17 @@ xfs_dir_lookup(
 
        ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
        XFS_STATS_INC(xs_dir_lookup);
-       memset(&args, 0, sizeof(xfs_da_args_t));
 
+       memset(&args, 0, sizeof(xfs_da_args_t));
        args.name = name->name;
        args.namelen = name->len;
-       args.hashval = xfs_da_hashname(name->name, name->len);
+       args.hashval = dp->i_mount->m_dirnameops->hashname(name);
        args.dp = dp;
        args.whichfork = XFS_DATA_FORK;
        args.trans = tp;
-       args.oknoent = 1;
+       args.op_flags = XFS_DA_OP_OKNOENT;
+       if (ci_name)
+               args.op_flags |= XFS_DA_OP_CILOOKUP;
 
        if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
                rval = xfs_dir2_sf_lookup(&args);
@@ -230,8 +313,13 @@ xfs_dir_lookup(
                rval = xfs_dir2_node_lookup(&args);
        if (rval == EEXIST)
                rval = 0;
-       if (rval == 0)
+       if (!rval) {
                *inum = args.inumber;
+               if (ci_name) {
+                       ci_name->name = args.value;
+                       ci_name->len = args.valuelen;
+               }
+       }
        return rval;
 }
 
@@ -255,9 +343,10 @@ xfs_dir_removename(
        ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
        XFS_STATS_INC(xs_dir_remove);
 
+       memset(&args, 0, sizeof(xfs_da_args_t));
        args.name = name->name;
        args.namelen = name->len;
-       args.hashval = xfs_da_hashname(name->name, name->len);
+       args.hashval = dp->i_mount->m_dirnameops->hashname(name);
        args.inumber = ino;
        args.dp = dp;
        args.firstblock = first;
@@ -265,7 +354,6 @@ xfs_dir_removename(
        args.total = total;
        args.whichfork = XFS_DATA_FORK;
        args.trans = tp;
-       args.justcheck = args.addname = args.oknoent = 0;
 
        if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
                rval = xfs_dir2_sf_removename(&args);
@@ -338,9 +426,10 @@ xfs_dir_replace(
        if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum)))
                return rval;
 
+       memset(&args, 0, sizeof(xfs_da_args_t));
        args.name = name->name;
        args.namelen = name->len;
-       args.hashval = xfs_da_hashname(name->name, name->len);
+       args.hashval = dp->i_mount->m_dirnameops->hashname(name);
        args.inumber = inum;
        args.dp = dp;
        args.firstblock = first;
@@ -348,7 +437,6 @@ xfs_dir_replace(
        args.total = total;
        args.whichfork = XFS_DATA_FORK;
        args.trans = tp;
-       args.justcheck = args.addname = args.oknoent = 0;
 
        if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
                rval = xfs_dir2_sf_replace(&args);
@@ -384,15 +472,16 @@ xfs_dir_canenter(
                return 0;
 
        ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
-       memset(&args, 0, sizeof(xfs_da_args_t));
 
+       memset(&args, 0, sizeof(xfs_da_args_t));
        args.name = name->name;
        args.namelen = name->len;
-       args.hashval = xfs_da_hashname(name->name, name->len);
+       args.hashval = dp->i_mount->m_dirnameops->hashname(name);
        args.dp = dp;
        args.whichfork = XFS_DATA_FORK;
        args.trans = tp;
-       args.justcheck = args.addname = args.oknoent = 1;
+       args.op_flags = XFS_DA_OP_JUSTCHECK | XFS_DA_OP_ADDNAME |
+                                                       XFS_DA_OP_OKNOENT;
 
        if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
                rval = xfs_dir2_sf_addname(&args);
@@ -493,7 +582,7 @@ xfs_dir2_grow_inode(
                                        args->firstblock, args->total,
                                        &mapp[mapi], &nmap, args->flist,
                                        NULL))) {
-                               kmem_free(mapp, sizeof(*mapp) * count);
+                               kmem_free(mapp);
                                return error;
                        }
                        if (nmap < 1)
@@ -525,14 +614,14 @@ xfs_dir2_grow_inode(
            mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount !=
            bno + count) {
                if (mapp != &map)
-                       kmem_free(mapp, sizeof(*mapp) * count);
+                       kmem_free(mapp);
                return XFS_ERROR(ENOSPC);
        }
        /*
         * Done with the temporary mapping table.
         */
        if (mapp != &map)
-               kmem_free(mapp, sizeof(*mapp) * count);
+               kmem_free(mapp);
        *dbp = xfs_dir2_da_to_db(mp, (xfs_dablk_t)bno);
        /*
         * Update file's size if this is the data space and it grew.
index 6392f939029fff32e28934e17c90143f4e38bf78..1d9ef96f33aa736beeeeda6b368453cecbe774e6 100644 (file)
@@ -74,7 +74,8 @@ extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp,
                                xfs_fsblock_t *first,
                                struct xfs_bmap_free *flist, xfs_extlen_t tot);
 extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp,
-                               struct xfs_name *name, xfs_ino_t *inum);
+                               struct xfs_name *name, xfs_ino_t *inum,
+                               struct xfs_name *ci_name);
 extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *dp,
                                struct xfs_name *name, xfs_ino_t ino,
                                xfs_fsblock_t *first,
@@ -99,4 +100,7 @@ extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp,
 extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db,
                                struct xfs_dabuf *bp);
 
+extern int xfs_dir_cilookup_result(struct xfs_da_args *args, const char *name,
+                               int len);
+
 #endif /* __XFS_DIR2_H__ */
index fb5a556725b344904090769fb37c78f6e970179a..e2fa0a1d8e9635b7bff941bb107f4ebb96f05dde 100644 (file)
@@ -215,7 +215,7 @@ xfs_dir2_block_addname(
        /*
         * If this isn't a real add, we're done with the buffer.
         */
-       if (args->justcheck)
+       if (args->op_flags & XFS_DA_OP_JUSTCHECK)
                xfs_da_brelse(tp, bp);
        /*
         * If we don't have space for the new entry & leaf ...
@@ -225,7 +225,7 @@ xfs_dir2_block_addname(
                 * Not trying to actually do anything, or don't have
                 * a space reservation: return no-space.
                 */
-               if (args->justcheck || args->total == 0)
+               if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || args->total == 0)
                        return XFS_ERROR(ENOSPC);
                /*
                 * Convert to the next larger format.
@@ -240,7 +240,7 @@ xfs_dir2_block_addname(
        /*
         * Just checking, and it would work, so say so.
         */
-       if (args->justcheck)
+       if (args->op_flags & XFS_DA_OP_JUSTCHECK)
                return 0;
        needlog = needscan = 0;
        /*
@@ -610,14 +610,15 @@ xfs_dir2_block_lookup(
        /*
         * Get the offset from the leaf entry, to point to the data.
         */
-       dep = (xfs_dir2_data_entry_t *)
-             ((char *)block + xfs_dir2_dataptr_to_off(mp, be32_to_cpu(blp[ent].address)));
+       dep = (xfs_dir2_data_entry_t *)((char *)block +
+               xfs_dir2_dataptr_to_off(mp, be32_to_cpu(blp[ent].address)));
        /*
-        * Fill in inode number, release the block.
+        * Fill in inode number, CI name if appropriate, release the block.
         */
        args->inumber = be64_to_cpu(dep->inumber);
+       error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
        xfs_da_brelse(args->trans, bp);
-       return XFS_ERROR(EEXIST);
+       return XFS_ERROR(error);
 }
 
 /*
@@ -643,6 +644,7 @@ xfs_dir2_block_lookup_int(
        int                     mid;            /* binary search current idx */
        xfs_mount_t             *mp;            /* filesystem mount point */
        xfs_trans_t             *tp;            /* transaction pointer */
+       enum xfs_dacmp          cmp;            /* comparison result */
 
        dp = args->dp;
        tp = args->trans;
@@ -673,7 +675,7 @@ xfs_dir2_block_lookup_int(
                else
                        high = mid - 1;
                if (low > high) {
-                       ASSERT(args->oknoent);
+                       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
                        xfs_da_brelse(tp, bp);
                        return XFS_ERROR(ENOENT);
                }
@@ -697,20 +699,31 @@ xfs_dir2_block_lookup_int(
                dep = (xfs_dir2_data_entry_t *)
                        ((char *)block + xfs_dir2_dataptr_to_off(mp, addr));
                /*
-                * Compare, if it's right give back buffer & entry number.
+                * Compare name and if it's an exact match, return the index
+                * and buffer. If it's the first case-insensitive match, store
+                * the index and buffer and continue looking for an exact match.
                 */
-               if (dep->namelen == args->namelen &&
-                   dep->name[0] == args->name[0] &&
-                   memcmp(dep->name, args->name, args->namelen) == 0) {
+               cmp = mp->m_dirnameops->compname(args, dep->name, dep->namelen);
+               if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
+                       args->cmpresult = cmp;
                        *bpp = bp;
                        *entno = mid;
-                       return 0;
+                       if (cmp == XFS_CMP_EXACT)
+                               return 0;
                }
-       } while (++mid < be32_to_cpu(btp->count) && be32_to_cpu(blp[mid].hashval) == hash);
+       } while (++mid < be32_to_cpu(btp->count) &&
+                       be32_to_cpu(blp[mid].hashval) == hash);
+
+       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
+       /*
+        * Here, we can only be doing a lookup (not a rename or replace).
+        * If a case-insensitive match was found earlier, return success.
+        */
+       if (args->cmpresult == XFS_CMP_CASE)
+               return 0;
        /*
         * No match, release the buffer and return ENOENT.
         */
-       ASSERT(args->oknoent);
        xfs_da_brelse(tp, bp);
        return XFS_ERROR(ENOENT);
 }
@@ -1033,6 +1046,7 @@ xfs_dir2_sf_to_block(
        xfs_dir2_sf_t           *sfp;           /* shortform structure */
        __be16                  *tagp;          /* end of data entry */
        xfs_trans_t             *tp;            /* transaction pointer */
+       struct xfs_name         name;
 
        xfs_dir2_trace_args("sf_to_block", args);
        dp = args->dp;
@@ -1071,7 +1085,7 @@ xfs_dir2_sf_to_block(
         */
        error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, &blkno);
        if (error) {
-               kmem_free(buf, buf_len);
+               kmem_free(buf);
                return error;
        }
        /*
@@ -1079,7 +1093,7 @@ xfs_dir2_sf_to_block(
         */
        error = xfs_dir2_data_init(args, blkno, &bp);
        if (error) {
-               kmem_free(buf, buf_len);
+               kmem_free(buf);
                return error;
        }
        block = bp->data;
@@ -1187,8 +1201,10 @@ xfs_dir2_sf_to_block(
                tagp = xfs_dir2_data_entry_tag_p(dep);
                *tagp = cpu_to_be16((char *)dep - (char *)block);
                xfs_dir2_data_log_entry(tp, bp, dep);
-               blp[2 + i].hashval = cpu_to_be32(xfs_da_hashname(
-                                       (char *)sfep->name, sfep->namelen));
+               name.name = sfep->name;
+               name.len = sfep->namelen;
+               blp[2 + i].hashval = cpu_to_be32(mp->m_dirnameops->
+                                                       hashname(&name));
                blp[2 + i].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
                                                 (char *)dep - (char *)block));
                offset = (int)((char *)(tagp + 1) - (char *)block);
@@ -1198,7 +1214,7 @@ xfs_dir2_sf_to_block(
                        sfep = xfs_dir2_sf_nextentry(sfp, sfep);
        }
        /* Done with the temporary buffer */
-       kmem_free(buf, buf_len);
+       kmem_free(buf);
        /*
         * Sort the leaf entries by hash value.
         */
index fb8c9e08b23db9bf94151bbf86a45feccdf0d676..498f8d694330dba475aad5c1c1d1147f73bfab9c 100644 (file)
@@ -65,6 +65,7 @@ xfs_dir2_data_check(
        xfs_mount_t             *mp;            /* filesystem mount point */
        char                    *p;             /* current data position */
        int                     stale;          /* count of stale leaves */
+       struct xfs_name         name;
 
        mp = dp->i_mount;
        d = bp->data;
@@ -140,7 +141,9 @@ xfs_dir2_data_check(
                        addr = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
                                (xfs_dir2_data_aoff_t)
                                ((char *)dep - (char *)d));
-                       hash = xfs_da_hashname((char *)dep->name, dep->namelen);
+                       name.name = dep->name;
+                       name.len = dep->namelen;
+                       hash = mp->m_dirnameops->hashname(&name);
                        for (i = 0; i < be32_to_cpu(btp->count); i++) {
                                if (be32_to_cpu(lep[i].address) == addr &&
                                    be32_to_cpu(lep[i].hashval) == hash)
index bc52b803d79ba93d8e8483dd614798c8c090938a..93535992cb60e79491b490f07e85a9338dfc0faf 100644 (file)
@@ -263,20 +263,21 @@ xfs_dir2_leaf_addname(
         * If we don't have enough free bytes but we can make enough
         * by compacting out stale entries, we'll do that.
         */
-       if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] < needbytes &&
-           be16_to_cpu(leaf->hdr.stale) > 1) {
+       if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] <
+                               needbytes && be16_to_cpu(leaf->hdr.stale) > 1) {
                compact = 1;
        }
        /*
         * Otherwise if we don't have enough free bytes we need to
         * convert to node form.
         */
-       else if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] <
-                needbytes) {
+       else if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(
+                                               leaf->hdr.count)] < needbytes) {
                /*
                 * Just checking or no space reservation, give up.
                 */
-               if (args->justcheck || args->total == 0) {
+               if ((args->op_flags & XFS_DA_OP_JUSTCHECK) ||
+                                                       args->total == 0) {
                        xfs_da_brelse(tp, lbp);
                        return XFS_ERROR(ENOSPC);
                }
@@ -301,7 +302,7 @@ xfs_dir2_leaf_addname(
         * If just checking, then it will fit unless we needed to allocate
         * a new data block.
         */
-       if (args->justcheck) {
+       if (args->op_flags & XFS_DA_OP_JUSTCHECK) {
                xfs_da_brelse(tp, lbp);
                return use_block == -1 ? XFS_ERROR(ENOSPC) : 0;
        }
@@ -1110,7 +1111,7 @@ xfs_dir2_leaf_getdents(
                *offset = XFS_DIR2_MAX_DATAPTR;
        else
                *offset = xfs_dir2_byte_to_dataptr(mp, curoff);
-       kmem_free(map, map_size * sizeof(*map));
+       kmem_free(map);
        if (bp)
                xfs_da_brelse(NULL, bp);
        return error;
@@ -1298,12 +1299,13 @@ xfs_dir2_leaf_lookup(
              ((char *)dbp->data +
               xfs_dir2_dataptr_to_off(dp->i_mount, be32_to_cpu(lep->address)));
        /*
-        * Return the found inode number.
+        * Return the found inode number & CI name if appropriate
         */
        args->inumber = be64_to_cpu(dep->inumber);
+       error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
        xfs_da_brelse(tp, dbp);
        xfs_da_brelse(tp, lbp);
-       return XFS_ERROR(EEXIST);
+       return XFS_ERROR(error);
 }
 
 /*
@@ -1319,8 +1321,8 @@ xfs_dir2_leaf_lookup_int(
        int                     *indexp,        /* out: index in leaf block */
        xfs_dabuf_t             **dbpp)         /* out: data buffer */
 {
-       xfs_dir2_db_t           curdb;          /* current data block number */
-       xfs_dabuf_t             *dbp;           /* data buffer */
+       xfs_dir2_db_t           curdb = -1;     /* current data block number */
+       xfs_dabuf_t             *dbp = NULL;    /* data buffer */
        xfs_dir2_data_entry_t   *dep;           /* data entry */
        xfs_inode_t             *dp;            /* incore directory inode */
        int                     error;          /* error return code */
@@ -1331,6 +1333,8 @@ xfs_dir2_leaf_lookup_int(
        xfs_mount_t             *mp;            /* filesystem mount point */
        xfs_dir2_db_t           newdb;          /* new data block number */
        xfs_trans_t             *tp;            /* transaction pointer */
+       xfs_dir2_db_t           cidb = -1;      /* case match data block no. */
+       enum xfs_dacmp          cmp;            /* name compare result */
 
        dp = args->dp;
        tp = args->trans;
@@ -1338,11 +1342,10 @@ xfs_dir2_leaf_lookup_int(
        /*
         * Read the leaf block into the buffer.
         */
-       if ((error =
-           xfs_da_read_buf(tp, dp, mp->m_dirleafblk, -1, &lbp,
-                   XFS_DATA_FORK))) {
+       error = xfs_da_read_buf(tp, dp, mp->m_dirleafblk, -1, &lbp,
+                                                       XFS_DATA_FORK);
+       if (error)
                return error;
-       }
        *lbpp = lbp;
        leaf = lbp->data;
        xfs_dir2_leaf_check(dp, lbp);
@@ -1354,9 +1357,9 @@ xfs_dir2_leaf_lookup_int(
         * Loop over all the entries with the right hash value
         * looking to match the name.
         */
-       for (lep = &leaf->ents[index], dbp = NULL, curdb = -1;
-            index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval) == args->hashval;
-            lep++, index++) {
+       for (lep = &leaf->ents[index]; index < be16_to_cpu(leaf->hdr.count) &&
+                               be32_to_cpu(lep->hashval) == args->hashval;
+                               lep++, index++) {
                /*
                 * Skip over stale leaf entries.
                 */
@@ -1373,10 +1376,10 @@ xfs_dir2_leaf_lookup_int(
                if (newdb != curdb) {
                        if (dbp)
                                xfs_da_brelse(tp, dbp);
-                       if ((error =
-                           xfs_da_read_buf(tp, dp,
-                                   xfs_dir2_db_to_da(mp, newdb), -1, &dbp,
-                                   XFS_DATA_FORK))) {
+                       error = xfs_da_read_buf(tp, dp,
+                                               xfs_dir2_db_to_da(mp, newdb),
+                                               -1, &dbp, XFS_DATA_FORK);
+                       if (error) {
                                xfs_da_brelse(tp, lbp);
                                return error;
                        }
@@ -1386,24 +1389,50 @@ xfs_dir2_leaf_lookup_int(
                /*
                 * Point to the data entry.
                 */
-               dep = (xfs_dir2_data_entry_t *)
-                     ((char *)dbp->data +
-                      xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address)));
+               dep = (xfs_dir2_data_entry_t *)((char *)dbp->data +
+                       xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address)));
                /*
-                * If it matches then return it.
+                * Compare name and if it's an exact match, return the index
+                * and buffer. If it's the first case-insensitive match, store
+                * the index and buffer and continue looking for an exact match.
                 */
-               if (dep->namelen == args->namelen &&
-                   dep->name[0] == args->name[0] &&
-                   memcmp(dep->name, args->name, args->namelen) == 0) {
-                       *dbpp = dbp;
+               cmp = mp->m_dirnameops->compname(args, dep->name, dep->namelen);
+               if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
+                       args->cmpresult = cmp;
                        *indexp = index;
-                       return 0;
+                       /* case exact match: return the current buffer. */
+                       if (cmp == XFS_CMP_EXACT) {
+                               *dbpp = dbp;
+                               return 0;
+                       }
+                       cidb = curdb;
                }
        }
+       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
+       /*
+        * Here, we can only be doing a lookup (not a rename or remove).
+        * If a case-insensitive match was found earlier, re-read the
+        * appropriate data block if required and return it.
+        */
+       if (args->cmpresult == XFS_CMP_CASE) {
+               ASSERT(cidb != -1);
+               if (cidb != curdb) {
+                       xfs_da_brelse(tp, dbp);
+                       error = xfs_da_read_buf(tp, dp,
+                                               xfs_dir2_db_to_da(mp, cidb),
+                                               -1, &dbp, XFS_DATA_FORK);
+                       if (error) {
+                               xfs_da_brelse(tp, lbp);
+                               return error;
+                       }
+               }
+               *dbpp = dbp;
+               return 0;
+       }
        /*
         * No match found, return ENOENT.
         */
-       ASSERT(args->oknoent);
+       ASSERT(cidb == -1);
        if (dbp)
                xfs_da_brelse(tp, dbp);
        xfs_da_brelse(tp, lbp);
index 8dade711f0995c4cfe2d74f46abd41ff624d7953..fa6c3a5ddbc65fba6fa05dca30cdc0fd3664b567 100644 (file)
@@ -226,7 +226,7 @@ xfs_dir2_leafn_add(
        ASSERT(index == be16_to_cpu(leaf->hdr.count) ||
               be32_to_cpu(leaf->ents[index].hashval) >= args->hashval);
 
-       if (args->justcheck)
+       if (args->op_flags & XFS_DA_OP_JUSTCHECK)
                return 0;
 
        /*
@@ -387,28 +387,26 @@ xfs_dir2_leafn_lasthash(
 }
 
 /*
- * Look up a leaf entry in a node-format leaf block.
- * If this is an addname then the extrablk in state is a freespace block,
- * otherwise it's a data block.
+ * Look up a leaf entry for space to add a name in a node-format leaf block.
+ * The extrablk in state is a freespace block.
  */
-int
-xfs_dir2_leafn_lookup_int(
+STATIC int
+xfs_dir2_leafn_lookup_for_addname(
        xfs_dabuf_t             *bp,            /* leaf buffer */
        xfs_da_args_t           *args,          /* operation arguments */
        int                     *indexp,        /* out: leaf entry index */
        xfs_da_state_t          *state)         /* state to fill in */
 {
-       xfs_dabuf_t             *curbp;         /* current data/free buffer */
-       xfs_dir2_db_t           curdb;          /* current data block number */
-       xfs_dir2_db_t           curfdb;         /* current free block number */
-       xfs_dir2_data_entry_t   *dep;           /* data block entry */
+       xfs_dabuf_t             *curbp = NULL;  /* current data/free buffer */
+       xfs_dir2_db_t           curdb = -1;     /* current data block number */
+       xfs_dir2_db_t           curfdb = -1;    /* current free block number */
        xfs_inode_t             *dp;            /* incore directory inode */
        int                     error;          /* error return value */
        int                     fi;             /* free entry index */
-       xfs_dir2_free_t         *free=NULL;     /* free block structure */
+       xfs_dir2_free_t         *free = NULL;   /* free block structure */
        int                     index;          /* leaf entry index */
        xfs_dir2_leaf_t         *leaf;          /* leaf structure */
-       int                     length=0;       /* length of new data entry */
+       int                     length;         /* length of new data entry */
        xfs_dir2_leaf_entry_t   *lep;           /* leaf entry */
        xfs_mount_t             *mp;            /* filesystem mount point */
        xfs_dir2_db_t           newdb;          /* new data block number */
@@ -431,33 +429,20 @@ xfs_dir2_leafn_lookup_int(
        /*
         * Do we have a buffer coming in?
         */
-       if (state->extravalid)
+       if (state->extravalid) {
+               /* If so, it's a free block buffer, get the block number. */
                curbp = state->extrablk.bp;
-       else
-               curbp = NULL;
-       /*
-        * For addname, it's a free block buffer, get the block number.
-        */
-       if (args->addname) {
-               curfdb = curbp ? state->extrablk.blkno : -1;
-               curdb = -1;
-               length = xfs_dir2_data_entsize(args->namelen);
-               if ((free = (curbp ? curbp->data : NULL)))
-                       ASSERT(be32_to_cpu(free->hdr.magic) == XFS_DIR2_FREE_MAGIC);
-       }
-       /*
-        * For others, it's a data block buffer, get the block number.
-        */
-       else {
-               curfdb = -1;
-               curdb = curbp ? state->extrablk.blkno : -1;
+               curfdb = state->extrablk.blkno;
+               free = curbp->data;
+               ASSERT(be32_to_cpu(free->hdr.magic) == XFS_DIR2_FREE_MAGIC);
        }
+       length = xfs_dir2_data_entsize(args->namelen);
        /*
         * Loop over leaf entries with the right hash value.
         */
-       for (lep = &leaf->ents[index];
-            index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval) == args->hashval;
-            lep++, index++) {
+       for (lep = &leaf->ents[index]; index < be16_to_cpu(leaf->hdr.count) &&
+                               be32_to_cpu(lep->hashval) == args->hashval;
+                               lep++, index++) {
                /*
                 * Skip stale leaf entries.
                 */
@@ -471,160 +456,243 @@ xfs_dir2_leafn_lookup_int(
                 * For addname, we're looking for a place to put the new entry.
                 * We want to use a data block with an entry of equal
                 * hash value to ours if there is one with room.
+                *
+                * If this block isn't the data block we already have
+                * in hand, take a look at it.
                 */
-               if (args->addname) {
+               if (newdb != curdb) {
+                       curdb = newdb;
                        /*
-                        * If this block isn't the data block we already have
-                        * in hand, take a look at it.
+                        * Convert the data block to the free block
+                        * holding its freespace information.
                         */
-                       if (newdb != curdb) {
-                               curdb = newdb;
-                               /*
-                                * Convert the data block to the free block
-                                * holding its freespace information.
-                                */
-                               newfdb = xfs_dir2_db_to_fdb(mp, newdb);
-                               /*
-                                * If it's not the one we have in hand,
-                                * read it in.
-                                */
-                               if (newfdb != curfdb) {
-                                       /*
-                                        * If we had one before, drop it.
-                                        */
-                                       if (curbp)
-                                               xfs_da_brelse(tp, curbp);
-                                       /*
-                                        * Read the free block.
-                                        */
-                                       if ((error = xfs_da_read_buf(tp, dp,
-                                                       xfs_dir2_db_to_da(mp,
-                                                               newfdb),
-                                                       -1, &curbp,
-                                                       XFS_DATA_FORK))) {
-                                               return error;
-                                       }
-                                       free = curbp->data;
-                                       ASSERT(be32_to_cpu(free->hdr.magic) ==
-                                              XFS_DIR2_FREE_MAGIC);
-                                       ASSERT((be32_to_cpu(free->hdr.firstdb) %
-                                               XFS_DIR2_MAX_FREE_BESTS(mp)) ==
-                                              0);
-                                       ASSERT(be32_to_cpu(free->hdr.firstdb) <= curdb);
-                                       ASSERT(curdb <
-                                              be32_to_cpu(free->hdr.firstdb) +
-                                              be32_to_cpu(free->hdr.nvalid));
-                               }
-                               /*
-                                * Get the index for our entry.
-                                */
-                               fi = xfs_dir2_db_to_fdindex(mp, curdb);
-                               /*
-                                * If it has room, return it.
-                                */
-                               if (unlikely(be16_to_cpu(free->bests[fi]) == NULLDATAOFF)) {
-                                       XFS_ERROR_REPORT("xfs_dir2_leafn_lookup_int",
-                                                        XFS_ERRLEVEL_LOW, mp);
-                                       if (curfdb != newfdb)
-                                               xfs_da_brelse(tp, curbp);
-                                       return XFS_ERROR(EFSCORRUPTED);
-                               }
-                               curfdb = newfdb;
-                               if (be16_to_cpu(free->bests[fi]) >= length) {
-                                       *indexp = index;
-                                       state->extravalid = 1;
-                                       state->extrablk.bp = curbp;
-                                       state->extrablk.blkno = curfdb;
-                                       state->extrablk.index = fi;
-                                       state->extrablk.magic =
-                                               XFS_DIR2_FREE_MAGIC;
-                                       ASSERT(args->oknoent);
-                                       return XFS_ERROR(ENOENT);
-                               }
-                       }
-               }
-               /*
-                * Not adding a new entry, so we really want to find
-                * the name given to us.
-                */
-               else {
+                       newfdb = xfs_dir2_db_to_fdb(mp, newdb);
                        /*
-                        * If it's a different data block, go get it.
+                        * If it's not the one we have in hand, read it in.
                         */
-                       if (newdb != curdb) {
+                       if (newfdb != curfdb) {
                                /*
-                                * If we had a block before, drop it.
+                                * If we had one before, drop it.
                                 */
                                if (curbp)
                                        xfs_da_brelse(tp, curbp);
                                /*
-                                * Read the data block.
+                                * Read the free block.
                                 */
-                               if ((error =
-                                   xfs_da_read_buf(tp, dp,
-                                           xfs_dir2_db_to_da(mp, newdb), -1,
-                                           &curbp, XFS_DATA_FORK))) {
+                               error = xfs_da_read_buf(tp, dp,
+                                               xfs_dir2_db_to_da(mp, newfdb),
+                                               -1, &curbp, XFS_DATA_FORK);
+                               if (error)
                                        return error;
-                               }
-                               xfs_dir2_data_check(dp, curbp);
-                               curdb = newdb;
+                               free = curbp->data;
+                               ASSERT(be32_to_cpu(free->hdr.magic) ==
+                                       XFS_DIR2_FREE_MAGIC);
+                               ASSERT((be32_to_cpu(free->hdr.firstdb) %
+                                       XFS_DIR2_MAX_FREE_BESTS(mp)) == 0);
+                               ASSERT(be32_to_cpu(free->hdr.firstdb) <= curdb);
+                               ASSERT(curdb < be32_to_cpu(free->hdr.firstdb) +
+                                       be32_to_cpu(free->hdr.nvalid));
                        }
                        /*
-                        * Point to the data entry.
+                        * Get the index for our entry.
                         */
-                       dep = (xfs_dir2_data_entry_t *)
-                             ((char *)curbp->data +
-                              xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address)));
+                       fi = xfs_dir2_db_to_fdindex(mp, curdb);
                        /*
-                        * Compare the entry, return it if it matches.
+                        * If it has room, return it.
                         */
-                       if (dep->namelen == args->namelen &&
-                           dep->name[0] == args->name[0] &&
-                           memcmp(dep->name, args->name, args->namelen) == 0) {
-                               args->inumber = be64_to_cpu(dep->inumber);
-                               *indexp = index;
-                               state->extravalid = 1;
-                               state->extrablk.bp = curbp;
-                               state->extrablk.blkno = curdb;
-                               state->extrablk.index =
-                                       (int)((char *)dep -
-                                             (char *)curbp->data);
-                               state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
-                               return XFS_ERROR(EEXIST);
+                       if (unlikely(be16_to_cpu(free->bests[fi]) == NULLDATAOFF)) {
+                               XFS_ERROR_REPORT("xfs_dir2_leafn_lookup_int",
+                                                       XFS_ERRLEVEL_LOW, mp);
+                               if (curfdb != newfdb)
+                                       xfs_da_brelse(tp, curbp);
+                               return XFS_ERROR(EFSCORRUPTED);
                        }
+                       curfdb = newfdb;
+                       if (be16_to_cpu(free->bests[fi]) >= length)
+                               goto out;
                }
        }
+       /* Didn't find any space */
+       fi = -1;
+out:
+       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
+       if (curbp) {
+               /* Giving back a free block. */
+               state->extravalid = 1;
+               state->extrablk.bp = curbp;
+               state->extrablk.index = fi;
+               state->extrablk.blkno = curfdb;
+               state->extrablk.magic = XFS_DIR2_FREE_MAGIC;
+       } else {
+               state->extravalid = 0;
+       }
        /*
-        * Didn't find a match.
-        * If we are holding a buffer, give it back in case our caller
-        * finds it useful.
+        * Return the index, that will be the insertion point.
         */
-       if ((state->extravalid = (curbp != NULL))) {
-               state->extrablk.bp = curbp;
-               state->extrablk.index = -1;
+       *indexp = index;
+       return XFS_ERROR(ENOENT);
+}
+
+/*
+ * Look up a leaf entry in a node-format leaf block.
+ * The extrablk in state a data block.
+ */
+STATIC int
+xfs_dir2_leafn_lookup_for_entry(
+       xfs_dabuf_t             *bp,            /* leaf buffer */
+       xfs_da_args_t           *args,          /* operation arguments */
+       int                     *indexp,        /* out: leaf entry index */
+       xfs_da_state_t          *state)         /* state to fill in */
+{
+       xfs_dabuf_t             *curbp = NULL;  /* current data/free buffer */
+       xfs_dir2_db_t           curdb = -1;     /* current data block number */
+       xfs_dir2_data_entry_t   *dep;           /* data block entry */
+       xfs_inode_t             *dp;            /* incore directory inode */
+       int                     error;          /* error return value */
+       int                     index;          /* leaf entry index */
+       xfs_dir2_leaf_t         *leaf;          /* leaf structure */
+       xfs_dir2_leaf_entry_t   *lep;           /* leaf entry */
+       xfs_mount_t             *mp;            /* filesystem mount point */
+       xfs_dir2_db_t           newdb;          /* new data block number */
+       xfs_trans_t             *tp;            /* transaction pointer */
+       enum xfs_dacmp          cmp;            /* comparison result */
+
+       dp = args->dp;
+       tp = args->trans;
+       mp = dp->i_mount;
+       leaf = bp->data;
+       ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC);
+#ifdef __KERNEL__
+       ASSERT(be16_to_cpu(leaf->hdr.count) > 0);
+#endif
+       xfs_dir2_leafn_check(dp, bp);
+       /*
+        * Look up the hash value in the leaf entries.
+        */
+       index = xfs_dir2_leaf_search_hash(args, bp);
+       /*
+        * Do we have a buffer coming in?
+        */
+       if (state->extravalid) {
+               curbp = state->extrablk.bp;
+               curdb = state->extrablk.blkno;
+       }
+       /*
+        * Loop over leaf entries with the right hash value.
+        */
+       for (lep = &leaf->ents[index]; index < be16_to_cpu(leaf->hdr.count) &&
+                               be32_to_cpu(lep->hashval) == args->hashval;
+                               lep++, index++) {
                /*
-                * For addname, giving back a free block.
+                * Skip stale leaf entries.
                 */
-               if (args->addname) {
-                       state->extrablk.blkno = curfdb;
-                       state->extrablk.magic = XFS_DIR2_FREE_MAGIC;
+               if (be32_to_cpu(lep->address) == XFS_DIR2_NULL_DATAPTR)
+                       continue;
+               /*
+                * Pull the data block number from the entry.
+                */
+               newdb = xfs_dir2_dataptr_to_db(mp, be32_to_cpu(lep->address));
+               /*
+                * Not adding a new entry, so we really want to find
+                * the name given to us.
+                *
+                * If it's a different data block, go get it.
+                */
+               if (newdb != curdb) {
+                       /*
+                        * If we had a block before that we aren't saving
+                        * for a CI name, drop it
+                        */
+                       if (curbp && (args->cmpresult == XFS_CMP_DIFFERENT ||
+                                               curdb != state->extrablk.blkno))
+                               xfs_da_brelse(tp, curbp);
+                       /*
+                        * If needing the block that is saved with a CI match,
+                        * use it otherwise read in the new data block.
+                        */
+                       if (args->cmpresult != XFS_CMP_DIFFERENT &&
+                                       newdb == state->extrablk.blkno) {
+                               ASSERT(state->extravalid);
+                               curbp = state->extrablk.bp;
+                       } else {
+                               error = xfs_da_read_buf(tp, dp,
+                                               xfs_dir2_db_to_da(mp, newdb),
+                                               -1, &curbp, XFS_DATA_FORK);
+                               if (error)
+                                       return error;
+                       }
+                       xfs_dir2_data_check(dp, curbp);
+                       curdb = newdb;
                }
                /*
-                * For other callers, giving back a data block.
+                * Point to the data entry.
                 */
-               else {
+               dep = (xfs_dir2_data_entry_t *)((char *)curbp->data +
+                       xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address)));
+               /*
+                * Compare the entry and if it's an exact match, return
+                * EEXIST immediately. If it's the first case-insensitive
+                * match, store the block & inode number and continue looking.
+                */
+               cmp = mp->m_dirnameops->compname(args, dep->name, dep->namelen);
+               if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
+                       /* If there is a CI match block, drop it */
+                       if (args->cmpresult != XFS_CMP_DIFFERENT &&
+                                               curdb != state->extrablk.blkno)
+                               xfs_da_brelse(tp, state->extrablk.bp);
+                       args->cmpresult = cmp;
+                       args->inumber = be64_to_cpu(dep->inumber);
+                       *indexp = index;
+                       state->extravalid = 1;
+                       state->extrablk.bp = curbp;
                        state->extrablk.blkno = curdb;
+                       state->extrablk.index = (int)((char *)dep -
+                                                       (char *)curbp->data);
                        state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
+                       if (cmp == XFS_CMP_EXACT)
+                               return XFS_ERROR(EEXIST);
                }
        }
-       /*
-        * Return the final index, that will be the insertion point.
-        */
+       ASSERT(index == be16_to_cpu(leaf->hdr.count) ||
+                                       (args->op_flags & XFS_DA_OP_OKNOENT));
+       if (curbp) {
+               if (args->cmpresult == XFS_CMP_DIFFERENT) {
+                       /* Giving back last used data block. */
+                       state->extravalid = 1;
+                       state->extrablk.bp = curbp;
+                       state->extrablk.index = -1;
+                       state->extrablk.blkno = curdb;
+                       state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
+               } else {
+                       /* If the curbp is not the CI match block, drop it */
+                       if (state->extrablk.bp != curbp)
+                               xfs_da_brelse(tp, curbp);
+               }
+       } else {
+               state->extravalid = 0;
+       }
        *indexp = index;
-       ASSERT(index == be16_to_cpu(leaf->hdr.count) || args->oknoent);
        return XFS_ERROR(ENOENT);
 }
 
+/*
+ * Look up a leaf entry in a node-format leaf block.
+ * If this is an addname then the extrablk in state is a freespace block,
+ * otherwise it's a data block.
+ */
+int
+xfs_dir2_leafn_lookup_int(
+       xfs_dabuf_t             *bp,            /* leaf buffer */
+       xfs_da_args_t           *args,          /* operation arguments */
+       int                     *indexp,        /* out: leaf entry index */
+       xfs_da_state_t          *state)         /* state to fill in */
+{
+       if (args->op_flags & XFS_DA_OP_ADDNAME)
+               return xfs_dir2_leafn_lookup_for_addname(bp, args, indexp,
+                                                       state);
+       return xfs_dir2_leafn_lookup_for_entry(bp, args, indexp, state);
+}
+
 /*
  * Move count leaf entries from source to destination leaf.
  * Log entries and headers.  Stale entries are preserved.
@@ -823,9 +891,10 @@ xfs_dir2_leafn_rebalance(
         */
        if (!state->inleaf)
                blk2->index = blk1->index - be16_to_cpu(leaf1->hdr.count);
-       
-       /* 
-        * Finally sanity check just to make sure we are not returning a negative index 
+
+       /*
+        * Finally sanity check just to make sure we are not returning a
+        * negative index
         */
        if(blk2->index < 0) {
                state->inleaf = 1;
@@ -1332,7 +1401,7 @@ xfs_dir2_node_addname(
                /*
                 * It worked, fix the hash values up the btree.
                 */
-               if (!args->justcheck)
+               if (!(args->op_flags & XFS_DA_OP_JUSTCHECK))
                        xfs_da_fixhashpath(state, &state->path);
        } else {
                /*
@@ -1515,7 +1584,8 @@ xfs_dir2_node_addname_int(
                /*
                 * Not allowed to allocate, return failure.
                 */
-               if (args->justcheck || args->total == 0) {
+               if ((args->op_flags & XFS_DA_OP_JUSTCHECK) ||
+                                                       args->total == 0) {
                        /*
                         * Drop the freespace buffer unless it came from our
                         * caller.
@@ -1661,7 +1731,7 @@ xfs_dir2_node_addname_int(
                /*
                 * If just checking, we succeeded.
                 */
-               if (args->justcheck) {
+               if (args->op_flags & XFS_DA_OP_JUSTCHECK) {
                        if ((fblk == NULL || fblk->bp == NULL) && fbp != NULL)
                                xfs_da_buf_done(fbp);
                        return 0;
@@ -1767,6 +1837,14 @@ xfs_dir2_node_lookup(
        error = xfs_da_node_lookup_int(state, &rval);
        if (error)
                rval = error;
+       else if (rval == ENOENT && args->cmpresult == XFS_CMP_CASE) {
+               /* If a CI match, dup the actual name and return EEXIST */
+               xfs_dir2_data_entry_t   *dep;
+
+               dep = (xfs_dir2_data_entry_t *)((char *)state->extrablk.bp->
+                                               data + state->extrablk.index);
+               rval = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
+       }
        /*
         * Release the btree blocks and leaf block.
         */
@@ -1810,9 +1888,8 @@ xfs_dir2_node_removename(
         * Look up the entry we're deleting, set up the cursor.
         */
        error = xfs_da_node_lookup_int(state, &rval);
-       if (error) {
+       if (error)
                rval = error;
-       }
        /*
         * Didn't find it, upper layer screwed up.
         */
@@ -1829,9 +1906,8 @@ xfs_dir2_node_removename(
         */
        error = xfs_dir2_leafn_remove(args, blk->bp, blk->index,
                &state->extrablk, &rval);
-       if (error) {
+       if (error)
                return error;
-       }
        /*
         * Fix the hash values up the btree.
         */
index 919d275a1cef41c70fcb8d204104cfc918669f7a..b46af0013ec9167d7695273ce037c51029da71bc 100644 (file)
@@ -255,7 +255,7 @@ xfs_dir2_block_to_sf(
        xfs_dir2_sf_check(args);
 out:
        xfs_trans_log_inode(args->trans, dp, logflags);
-       kmem_free(block, mp->m_dirblksize);
+       kmem_free(block);
        return error;
 }
 
@@ -332,7 +332,7 @@ xfs_dir2_sf_addname(
                /*
                 * Just checking or no space reservation, it doesn't fit.
                 */
-               if (args->justcheck || args->total == 0)
+               if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || args->total == 0)
                        return XFS_ERROR(ENOSPC);
                /*
                 * Convert to block form then add the name.
@@ -345,7 +345,7 @@ xfs_dir2_sf_addname(
        /*
         * Just checking, it fits.
         */
-       if (args->justcheck)
+       if (args->op_flags & XFS_DA_OP_JUSTCHECK)
                return 0;
        /*
         * Do it the easy way - just add it at the end.
@@ -512,7 +512,7 @@ xfs_dir2_sf_addname_hard(
                sfep = xfs_dir2_sf_nextentry(sfp, sfep);
                memcpy(sfep, oldsfep, old_isize - nbytes);
        }
-       kmem_free(buf, old_isize);
+       kmem_free(buf);
        dp->i_d.di_size = new_isize;
        xfs_dir2_sf_check(args);
 }
@@ -812,8 +812,11 @@ xfs_dir2_sf_lookup(
 {
        xfs_inode_t             *dp;            /* incore directory inode */
        int                     i;              /* entry index */
+       int                     error;
        xfs_dir2_sf_entry_t     *sfep;          /* shortform directory entry */
        xfs_dir2_sf_t           *sfp;           /* shortform structure */
+       enum xfs_dacmp          cmp;            /* comparison result */
+       xfs_dir2_sf_entry_t     *ci_sfep;       /* case-insens. entry */
 
        xfs_dir2_trace_args("sf_lookup", args);
        xfs_dir2_sf_check(args);
@@ -836,6 +839,7 @@ xfs_dir2_sf_lookup(
         */
        if (args->namelen == 1 && args->name[0] == '.') {
                args->inumber = dp->i_ino;
+               args->cmpresult = XFS_CMP_EXACT;
                return XFS_ERROR(EEXIST);
        }
        /*
@@ -844,28 +848,41 @@ xfs_dir2_sf_lookup(
        if (args->namelen == 2 &&
            args->name[0] == '.' && args->name[1] == '.') {
                args->inumber = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent);
+               args->cmpresult = XFS_CMP_EXACT;
                return XFS_ERROR(EEXIST);
        }
        /*
         * Loop over all the entries trying to match ours.
         */
-       for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp);
-            i < sfp->hdr.count;
-            i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
-               if (sfep->namelen == args->namelen &&
-                   sfep->name[0] == args->name[0] &&
-                   memcmp(args->name, sfep->name, args->namelen) == 0) {
-                       args->inumber =
-                               xfs_dir2_sf_get_inumber(sfp,
-                                       xfs_dir2_sf_inumberp(sfep));
-                       return XFS_ERROR(EEXIST);
+       ci_sfep = NULL;
+       for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count;
+                               i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
+               /*
+                * Compare name and if it's an exact match, return the inode
+                * number. If it's the first case-insensitive match, store the
+                * inode number and continue looking for an exact match.
+                */
+               cmp = dp->i_mount->m_dirnameops->compname(args, sfep->name,
+                                                               sfep->namelen);
+               if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
+                       args->cmpresult = cmp;
+                       args->inumber = xfs_dir2_sf_get_inumber(sfp,
+                                               xfs_dir2_sf_inumberp(sfep));
+                       if (cmp == XFS_CMP_EXACT)
+                               return XFS_ERROR(EEXIST);
+                       ci_sfep = sfep;
                }
        }
+       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
        /*
-        * Didn't find it.
+        * Here, we can only be doing a lookup (not a rename or replace).
+        * If a case-insensitive match was not found, return ENOENT.
         */
-       ASSERT(args->oknoent);
-       return XFS_ERROR(ENOENT);
+       if (!ci_sfep)
+               return XFS_ERROR(ENOENT);
+       /* otherwise process the CI match as required by the caller */
+       error = xfs_dir_cilookup_result(args, ci_sfep->name, ci_sfep->namelen);
+       return XFS_ERROR(error);
 }
 
 /*
@@ -904,24 +921,21 @@ xfs_dir2_sf_removename(
         * Loop over the old directory entries.
         * Find the one we're deleting.
         */
-       for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp);
-            i < sfp->hdr.count;
-            i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
-               if (sfep->namelen == args->namelen &&
-                   sfep->name[0] == args->name[0] &&
-                   memcmp(sfep->name, args->name, args->namelen) == 0) {
+       for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count;
+                               i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
+               if (xfs_da_compname(args, sfep->name, sfep->namelen) ==
+                                                               XFS_CMP_EXACT) {
                        ASSERT(xfs_dir2_sf_get_inumber(sfp,
-                                       xfs_dir2_sf_inumberp(sfep)) ==
-                               args->inumber);
+                                               xfs_dir2_sf_inumberp(sfep)) ==
+                                                               args->inumber);
                        break;
                }
        }
        /*
         * Didn't find it.
         */
-       if (i == sfp->hdr.count) {
+       if (i == sfp->hdr.count)
                return XFS_ERROR(ENOENT);
-       }
        /*
         * Calculate sizes.
         */
@@ -1042,11 +1056,10 @@ xfs_dir2_sf_replace(
         */
        else {
                for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp);
-                    i < sfp->hdr.count;
-                    i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
-                       if (sfep->namelen == args->namelen &&
-                           sfep->name[0] == args->name[0] &&
-                           memcmp(args->name, sfep->name, args->namelen) == 0) {
+                               i < sfp->hdr.count;
+                               i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) {
+                       if (xfs_da_compname(args, sfep->name, sfep->namelen) ==
+                                                               XFS_CMP_EXACT) {
 #if XFS_BIG_INUMS || defined(DEBUG)
                                ino = xfs_dir2_sf_get_inumber(sfp,
                                        xfs_dir2_sf_inumberp(sfep));
@@ -1061,7 +1074,7 @@ xfs_dir2_sf_replace(
                 * Didn't find it.
                 */
                if (i == sfp->hdr.count) {
-                       ASSERT(args->oknoent);
+                       ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
 #if XFS_BIG_INUMS
                        if (i8elevated)
                                xfs_dir2_sf_toino4(args);
@@ -1174,7 +1187,7 @@ xfs_dir2_sf_toino4(
        /*
         * Clean up the inode.
         */
-       kmem_free(buf, oldsize);
+       kmem_free(buf);
        dp->i_d.di_size = newsize;
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
 }
@@ -1251,7 +1264,7 @@ xfs_dir2_sf_toino8(
        /*
         * Clean up the inode.
         */
-       kmem_free(buf, oldsize);
+       kmem_free(buf);
        dp->i_d.di_size = newsize;
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
 }
index 005629d702d2128845a1d33909bbd6cfc4e42907..deecc9d238f874b221086769c7eca5598826ca60 100644 (file)
@@ -62,7 +62,7 @@ typedef union {
  * Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t.
  * Only need 16 bits, this is the byte offset into the single block form.
  */
-typedef struct { __uint8_t i[2]; } xfs_dir2_sf_off_t;
+typedef struct { __uint8_t i[2]; } __arch_pack xfs_dir2_sf_off_t;
 
 /*
  * The parent directory has a dedicated field, and the self-pointer must
@@ -76,14 +76,14 @@ typedef struct xfs_dir2_sf_hdr {
        __uint8_t               count;          /* count of entries */
        __uint8_t               i8count;        /* count of 8-byte inode #s */
        xfs_dir2_inou_t         parent;         /* parent dir inode number */
-} xfs_dir2_sf_hdr_t;
+} __arch_pack xfs_dir2_sf_hdr_t;
 
 typedef struct xfs_dir2_sf_entry {
        __uint8_t               namelen;        /* actual name length */
        xfs_dir2_sf_off_t       offset;         /* saved offset */
        __uint8_t               name[1];        /* name, variable size */
        xfs_dir2_inou_t         inumber;        /* inode number, var. offset */
-} xfs_dir2_sf_entry_t;
+} __arch_pack xfs_dir2_sf_entry_t; 
 
 typedef struct xfs_dir2_sf {
        xfs_dir2_sf_hdr_t       hdr;            /* shortform header */
index f3fb2ffd6f5c7ca0c897257f05db9acd5d5a8a14..6cc7c0c681acdf0e6a919ba387edaed8c9161f57 100644 (file)
@@ -85,7 +85,8 @@ xfs_dir2_trace_args(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck, NULL, NULL);
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
+               NULL, NULL);
 }
 
 void
@@ -100,7 +101,7 @@ xfs_dir2_trace_args_b(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck,
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
                (void *)(bp ? bp->bps[0] : NULL), NULL);
 }
 
@@ -117,7 +118,7 @@ xfs_dir2_trace_args_bb(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck,
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
                (void *)(lbp ? lbp->bps[0] : NULL),
                (void *)(dbp ? dbp->bps[0] : NULL));
 }
@@ -157,8 +158,8 @@ xfs_dir2_trace_args_db(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck, (void *)(long)db,
-               (void *)dbp);
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
+               (void *)(long)db, (void *)dbp);
 }
 
 void
@@ -173,7 +174,7 @@ xfs_dir2_trace_args_i(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck,
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
                (void *)((unsigned long)(i >> 32)),
                (void *)((unsigned long)(i & 0xFFFFFFFF)));
 }
@@ -190,7 +191,8 @@ xfs_dir2_trace_args_s(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck, (void *)(long)s, NULL);
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
+               (void *)(long)s, NULL);
 }
 
 void
@@ -208,7 +210,7 @@ xfs_dir2_trace_args_sb(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck, (void *)(long)s,
-               (void *)dbp);
+               (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK),
+               (void *)(long)s, (void *)dbp);
 }
 #endif /* XFS_DIR2_TRACE */
index f71784ab6a601182e8bcbe87908ce81391e1310b..cdc2d3464a1af7ddc84efac8bcdca346cb773926 100644 (file)
@@ -166,6 +166,6 @@ typedef enum {
 
 #define FILP_DELAY_FLAG(filp) ((filp->f_flags&(O_NDELAY|O_NONBLOCK)) ? \
                        DM_FLAGS_NDELAY : 0)
-#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0)
+#define AT_DELAY_FLAG(f) ((f & XFS_ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0)
 
 #endif  /* __XFS_DMAPI_H__ */
index 05e5365d3c3170bd034c16e1cd79761e5dcf7bcf..f66756cfb5e8c0c327305212910c53eba7c98443 100644 (file)
@@ -66,14 +66,6 @@ int  xfs_etest[XFS_NUM_INJECT_ERROR];
 int64_t        xfs_etest_fsid[XFS_NUM_INJECT_ERROR];
 char * xfs_etest_fsname[XFS_NUM_INJECT_ERROR];
 
-void
-xfs_error_test_init(void)
-{
-       memset(xfs_etest, 0, sizeof(xfs_etest));
-       memset(xfs_etest_fsid, 0, sizeof(xfs_etest_fsid));
-       memset(xfs_etest_fsname, 0, sizeof(xfs_etest_fsname));
-}
-
 int
 xfs_error_test(int error_tag, int *fsidp, char *expression,
               int line, char *file, unsigned long randfactor)
@@ -150,8 +142,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud)
                                xfs_etest[i]);
                        xfs_etest[i] = 0;
                        xfs_etest_fsid[i] = 0LL;
-                       kmem_free(xfs_etest_fsname[i],
-                                 strlen(xfs_etest_fsname[i]) + 1);
+                       kmem_free(xfs_etest_fsname[i]);
                        xfs_etest_fsname[i] = NULL;
                }
        }
@@ -175,7 +166,7 @@ xfs_fs_vcmn_err(int level, xfs_mount_t *mp, char *fmt, va_list ap)
                newfmt = kmem_alloc(len, KM_SLEEP);
                sprintf(newfmt, "Filesystem \"%s\": %s", mp->m_fsname, fmt);
                icmn_err(level, newfmt, ap);
-               kmem_free(newfmt, len);
+               kmem_free(newfmt);
        } else {
                icmn_err(level, fmt, ap);
        }
index 6490d2a9f8e1268d6bea93782eecc89f66f34b48..d8559d132efae28c5797ef2a898f0342d454463c 100644 (file)
@@ -127,7 +127,6 @@ extern void xfs_corruption_error(char *tag, int level, struct xfs_mount *mp,
 
 #if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
 extern int xfs_error_test(int, int *, char *, int, char *, unsigned long);
-extern void xfs_error_test_init(void);
 
 #define        XFS_NUM_INJECT_ERROR                            10
 
index 132bd07b9bb8abb5663e97e2190f3ee075260d61..8aa28f751b2a6cb54bf60762772079820f74426c 100644 (file)
@@ -41,8 +41,7 @@ xfs_efi_item_free(xfs_efi_log_item_t *efip)
        int nexts = efip->efi_format.efi_nextents;
 
        if (nexts > XFS_EFI_MAX_FAST_EXTENTS) {
-               kmem_free(efip, sizeof(xfs_efi_log_item_t) +
-                               (nexts - 1) * sizeof(xfs_extent_t));
+               kmem_free(efip);
        } else {
                kmem_zone_free(xfs_efi_zone, efip);
        }
@@ -374,8 +373,7 @@ xfs_efd_item_free(xfs_efd_log_item_t *efdp)
        int nexts = efdp->efd_format.efd_nextents;
 
        if (nexts > XFS_EFD_MAX_FAST_EXTENTS) {
-               kmem_free(efdp, sizeof(xfs_efd_log_item_t) +
-                               (nexts - 1) * sizeof(xfs_extent_t));
+               kmem_free(efdp);
        } else {
                kmem_zone_free(xfs_efd_zone, efdp);
        }
index 3f3785b10804a1d9b00bcfad52091e4547f53934..c38fd14fca29c7821001d6eca11df641b466908a 100644 (file)
@@ -397,10 +397,12 @@ int
 xfs_filestream_init(void)
 {
        item_zone = kmem_zone_init(sizeof(fstrm_item_t), "fstrm_item");
+       if (!item_zone)
+               return -ENOMEM;
 #ifdef XFS_FILESTREAMS_TRACE
        xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_SLEEP);
 #endif
-       return item_zone ? 0 : -ENOMEM;
+       return 0;
 }
 
 /*
index 3bed6433d0501f09ab8589961aeabd1e810bb200..01c0cc88d3f37055bc071dc545ca731509361bc6 100644 (file)
@@ -239,6 +239,7 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_LOGV2      0x0100  /* log format version 2 */
 #define XFS_FSOP_GEOM_FLAGS_SECTOR     0x0200  /* sector sizes >1BB    */
 #define XFS_FSOP_GEOM_FLAGS_ATTR2      0x0400  /* inline attributes rework */
+#define XFS_FSOP_GEOM_FLAGS_DIRV2CI    0x1000  /* ASCII only CI names */
 #define XFS_FSOP_GEOM_FLAGS_LAZYSB     0x4000  /* lazy superblock counters */
 
 
@@ -371,6 +372,9 @@ typedef struct xfs_fsop_attrlist_handlereq {
 
 typedef struct xfs_attr_multiop {
        __u32           am_opcode;
+#define ATTR_OP_GET    1       /* return the indicated attr's value */
+#define ATTR_OP_SET    2       /* set/create the indicated attr/value pair */
+#define ATTR_OP_REMOVE 3       /* remove the indicated attr */
        __s32           am_error;
        void            __user *am_attrname;
        void            __user *am_attrvalue;
index 381ebda4f7bc606c484d504e665769ab45a08377..84583cf73db329ac156986cfc9476f210a48fdda 100644 (file)
@@ -95,6 +95,8 @@ xfs_fs_geometry(
                                XFS_FSOP_GEOM_FLAGS_DIRV2 : 0) |
                        (xfs_sb_version_hassector(&mp->m_sb) ?
                                XFS_FSOP_GEOM_FLAGS_SECTOR : 0) |
+                       (xfs_sb_version_hasasciici(&mp->m_sb) ?
+                               XFS_FSOP_GEOM_FLAGS_DIRV2CI : 0) |
                        (xfs_sb_version_haslazysbcount(&mp->m_sb) ?
                                XFS_FSOP_GEOM_FLAGS_LAZYSB : 0) |
                        (xfs_sb_version_hasattr2(&mp->m_sb) ?
@@ -625,7 +627,7 @@ xfs_fs_goingdown(
                        xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
                        thaw_bdev(sb->s_bdev, sb);
                }
-       
+
                break;
        }
        case XFS_FSOP_GOING_FLAGS_LOGFLUSH:
index e569bf5d6cf0d9509356e93aef781048202c669b..bedc66163176484b5dc7e7911637ab0059e6c0a8 100644 (file)
@@ -1763,67 +1763,6 @@ xfs_itruncate_finish(
        return 0;
 }
 
-
-/*
- * xfs_igrow_start
- *
- * Do the first part of growing a file: zero any data in the last
- * block that is beyond the old EOF.  We need to do this before
- * the inode is joined to the transaction to modify the i_size.
- * That way we can drop the inode lock and call into the buffer
- * cache to get the buffer mapping the EOF.
- */
-int
-xfs_igrow_start(
-       xfs_inode_t     *ip,
-       xfs_fsize_t     new_size,
-       cred_t          *credp)
-{
-       ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL));
-       ASSERT(new_size > ip->i_size);
-
-       /*
-        * Zero any pages that may have been created by
-        * xfs_write_file() beyond the end of the file
-        * and any blocks between the old and new file sizes.
-        */
-       return xfs_zero_eof(ip, new_size, ip->i_size);
-}
-
-/*
- * xfs_igrow_finish
- *
- * This routine is called to extend the size of a file.
- * The inode must have both the iolock and the ilock locked
- * for update and it must be a part of the current transaction.
- * The xfs_igrow_start() function must have been called previously.
- * If the change_flag is not zero, the inode change timestamp will
- * be updated.
- */
-void
-xfs_igrow_finish(
-       xfs_trans_t     *tp,
-       xfs_inode_t     *ip,
-       xfs_fsize_t     new_size,
-       int             change_flag)
-{
-       ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL));
-       ASSERT(ip->i_transp == tp);
-       ASSERT(new_size > ip->i_size);
-
-       /*
-        * Update the file size.  Update the inode change timestamp
-        * if change_flag set.
-        */
-       ip->i_d.di_size = new_size;
-       ip->i_size = new_size;
-       if (change_flag)
-               xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
-       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-
-}
-
-
 /*
  * This is called when the inode's link count goes to 0.
  * We place the on-disk inode on a list in the AGI.  It
@@ -2258,7 +2197,7 @@ xfs_ifree_cluster(
                xfs_trans_binval(tp, bp);
        }
 
-       kmem_free(ip_found, ninodes * sizeof(xfs_inode_t *));
+       kmem_free(ip_found);
        xfs_put_perag(mp, pag);
 }
 
@@ -2470,7 +2409,7 @@ xfs_iroot_realloc(
                                                     (int)new_size);
                memcpy(np, op, new_max * (uint)sizeof(xfs_dfsbno_t));
        }
-       kmem_free(ifp->if_broot, ifp->if_broot_bytes);
+       kmem_free(ifp->if_broot);
        ifp->if_broot = new_broot;
        ifp->if_broot_bytes = (int)new_size;
        ASSERT(ifp->if_broot_bytes <=
@@ -2514,7 +2453,7 @@ xfs_idata_realloc(
 
        if (new_size == 0) {
                if (ifp->if_u1.if_data != ifp->if_u2.if_inline_data) {
-                       kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes);
+                       kmem_free(ifp->if_u1.if_data);
                }
                ifp->if_u1.if_data = NULL;
                real_size = 0;
@@ -2529,7 +2468,7 @@ xfs_idata_realloc(
                        ASSERT(ifp->if_real_bytes != 0);
                        memcpy(ifp->if_u2.if_inline_data, ifp->if_u1.if_data,
                              new_size);
-                       kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes);
+                       kmem_free(ifp->if_u1.if_data);
                        ifp->if_u1.if_data = ifp->if_u2.if_inline_data;
                }
                real_size = 0;
@@ -2636,7 +2575,7 @@ xfs_idestroy_fork(
 
        ifp = XFS_IFORK_PTR(ip, whichfork);
        if (ifp->if_broot != NULL) {
-               kmem_free(ifp->if_broot, ifp->if_broot_bytes);
+               kmem_free(ifp->if_broot);
                ifp->if_broot = NULL;
        }
 
@@ -2650,7 +2589,7 @@ xfs_idestroy_fork(
                if ((ifp->if_u1.if_data != ifp->if_u2.if_inline_data) &&
                    (ifp->if_u1.if_data != NULL)) {
                        ASSERT(ifp->if_real_bytes != 0);
-                       kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes);
+                       kmem_free(ifp->if_u1.if_data);
                        ifp->if_u1.if_data = NULL;
                        ifp->if_real_bytes = 0;
                }
@@ -3058,7 +2997,7 @@ xfs_iflush_cluster(
 
 out_free:
        read_unlock(&pag->pag_ici_lock);
-       kmem_free(ilist, ilist_size);
+       kmem_free(ilist);
        return 0;
 
 
@@ -3102,7 +3041,7 @@ cluster_corrupt_out:
         * Unlocks the flush lock
         */
        xfs_iflush_abort(iq);
-       kmem_free(ilist, ilist_size);
+       kmem_free(ilist);
        return XFS_ERROR(EFSCORRUPTED);
 }
 
@@ -3143,8 +3082,6 @@ xfs_iflush(
         * flush lock and do nothing.
         */
        if (xfs_inode_clean(ip)) {
-               ASSERT((iip != NULL) ?
-                        !(iip->ili_item.li_flags & XFS_LI_IN_AIL) : 1);
                xfs_ifunlock(ip);
                return 0;
        }
@@ -3836,7 +3773,7 @@ xfs_iext_add_indirect_multi(
                        erp = xfs_iext_irec_new(ifp, erp_idx);
                }
                memmove(&erp->er_extbuf[i], nex2_ep, byte_diff);
-               kmem_free(nex2_ep, byte_diff);
+               kmem_free(nex2_ep);
                erp->er_extcount += nex2;
                xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, nex2);
        }
@@ -4112,7 +4049,7 @@ xfs_iext_direct_to_inline(
         */
        memcpy(ifp->if_u2.if_inline_ext, ifp->if_u1.if_extents,
                nextents * sizeof(xfs_bmbt_rec_t));
-       kmem_free(ifp->if_u1.if_extents, ifp->if_real_bytes);
+       kmem_free(ifp->if_u1.if_extents);
        ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext;
        ifp->if_real_bytes = 0;
 }
@@ -4186,7 +4123,7 @@ xfs_iext_indirect_to_direct(
        ASSERT(ifp->if_real_bytes == XFS_IEXT_BUFSZ);
 
        ep = ifp->if_u1.if_ext_irec->er_extbuf;
-       kmem_free(ifp->if_u1.if_ext_irec, sizeof(xfs_ext_irec_t));
+       kmem_free(ifp->if_u1.if_ext_irec);
        ifp->if_flags &= ~XFS_IFEXTIREC;
        ifp->if_u1.if_extents = ep;
        ifp->if_bytes = size;
@@ -4212,7 +4149,7 @@ xfs_iext_destroy(
                }
                ifp->if_flags &= ~XFS_IFEXTIREC;
        } else if (ifp->if_real_bytes) {
-               kmem_free(ifp->if_u1.if_extents, ifp->if_real_bytes);
+               kmem_free(ifp->if_u1.if_extents);
        } else if (ifp->if_bytes) {
                memset(ifp->if_u2.if_inline_ext, 0, XFS_INLINE_EXTS *
                        sizeof(xfs_bmbt_rec_t));
@@ -4483,7 +4420,7 @@ xfs_iext_irec_remove(
        if (erp->er_extbuf) {
                xfs_iext_irec_update_extoffs(ifp, erp_idx + 1,
                        -erp->er_extcount);
-               kmem_free(erp->er_extbuf, XFS_IEXT_BUFSZ);
+               kmem_free(erp->er_extbuf);
        }
        /* Compact extent records */
        erp = ifp->if_u1.if_ext_irec;
@@ -4501,8 +4438,7 @@ xfs_iext_irec_remove(
                xfs_iext_realloc_indirect(ifp,
                        nlists * sizeof(xfs_ext_irec_t));
        } else {
-               kmem_free(ifp->if_u1.if_ext_irec,
-                       sizeof(xfs_ext_irec_t));
+               kmem_free(ifp->if_u1.if_ext_irec);
        }
        ifp->if_real_bytes = nlists * XFS_IEXT_BUFSZ;
 }
@@ -4571,7 +4507,7 @@ xfs_iext_irec_compact_pages(
                         * so er_extoffs don't get modified in
                         * xfs_iext_irec_remove.
                         */
-                       kmem_free(erp_next->er_extbuf, XFS_IEXT_BUFSZ);
+                       kmem_free(erp_next->er_extbuf);
                        erp_next->er_extbuf = NULL;
                        xfs_iext_irec_remove(ifp, erp_idx + 1);
                        nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
@@ -4596,40 +4532,63 @@ xfs_iext_irec_compact_full(
        int             nlists;                 /* number of irec's (ex lists) */
 
        ASSERT(ifp->if_flags & XFS_IFEXTIREC);
+
        nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
        erp = ifp->if_u1.if_ext_irec;
        ep = &erp->er_extbuf[erp->er_extcount];
        erp_next = erp + 1;
        ep_next = erp_next->er_extbuf;
+
        while (erp_idx < nlists - 1) {
+               /*
+                * Check how many extent records are available in this irec.
+                * If there is none skip the whole exercise.
+                */
                ext_avail = XFS_LINEAR_EXTS - erp->er_extcount;
-               ext_diff = MIN(ext_avail, erp_next->er_extcount);
-               memcpy(ep, ep_next, ext_diff * sizeof(xfs_bmbt_rec_t));
-               erp->er_extcount += ext_diff;
-               erp_next->er_extcount -= ext_diff;
-               /* Remove next page */
-               if (erp_next->er_extcount == 0) {
+               if (ext_avail) {
+
                        /*
-                        * Free page before removing extent record
-                        * so er_extoffs don't get modified in
-                        * xfs_iext_irec_remove.
+                        * Copy over as many as possible extent records into
+                        * the previous page.
                         */
-                       kmem_free(erp_next->er_extbuf,
-                               erp_next->er_extcount * sizeof(xfs_bmbt_rec_t));
-                       erp_next->er_extbuf = NULL;
-                       xfs_iext_irec_remove(ifp, erp_idx + 1);
-                       erp = &ifp->if_u1.if_ext_irec[erp_idx];
-                       nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
-               /* Update next page */
-               } else {
-                       /* Move rest of page up to become next new page */
-                       memmove(erp_next->er_extbuf, ep_next,
-                               erp_next->er_extcount * sizeof(xfs_bmbt_rec_t));
-                       ep_next = erp_next->er_extbuf;
-                       memset(&ep_next[erp_next->er_extcount], 0,
-                               (XFS_LINEAR_EXTS - erp_next->er_extcount) *
-                               sizeof(xfs_bmbt_rec_t));
+                       ext_diff = MIN(ext_avail, erp_next->er_extcount);
+                       memcpy(ep, ep_next, ext_diff * sizeof(xfs_bmbt_rec_t));
+                       erp->er_extcount += ext_diff;
+                       erp_next->er_extcount -= ext_diff;
+
+                       /*
+                        * If the next irec is empty now we can simply
+                        * remove it.
+                        */
+                       if (erp_next->er_extcount == 0) {
+                               /*
+                                * Free page before removing extent record
+                                * so er_extoffs don't get modified in
+                                * xfs_iext_irec_remove.
+                                */
+                               kmem_free(erp_next->er_extbuf);
+                               erp_next->er_extbuf = NULL;
+                               xfs_iext_irec_remove(ifp, erp_idx + 1);
+                               erp = &ifp->if_u1.if_ext_irec[erp_idx];
+                               nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
+
+                       /*
+                        * If the next irec is not empty move up the content
+                        * that has not been copied to the previous page to
+                        * the beggining of this one.
+                        */
+                       } else {
+                               memmove(erp_next->er_extbuf, &ep_next[ext_diff],
+                                       erp_next->er_extcount *
+                                       sizeof(xfs_bmbt_rec_t));
+                               ep_next = erp_next->er_extbuf;
+                               memset(&ep_next[erp_next->er_extcount], 0,
+                                       (XFS_LINEAR_EXTS -
+                                               erp_next->er_extcount) *
+                                       sizeof(xfs_bmbt_rec_t));
+                       }
                }
+
                if (erp->er_extcount == XFS_LINEAR_EXTS) {
                        erp_idx++;
                        if (erp_idx < nlists)
index 0a999fee4f03e343e4038e9e818464e3bf06b83d..17a04b6321ed7c0264ff8795f55e6bfc445cbc3f 100644 (file)
@@ -507,9 +507,6 @@ int         xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t);
 int            xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *,
                                     xfs_fsize_t, int, int);
 int            xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
-int            xfs_igrow_start(xfs_inode_t *, xfs_fsize_t, struct cred *);
-void           xfs_igrow_finish(struct xfs_trans *, xfs_inode_t *,
-                                xfs_fsize_t, int);
 
 void           xfs_idestroy_fork(xfs_inode_t *, int);
 void           xfs_idestroy(xfs_inode_t *);
index 167b33f15772c395c1f5d3260bf1e2d36d666c39..0eee08a32c269d88e04207c2773bf717528626cb 100644 (file)
@@ -686,7 +686,7 @@ xfs_inode_item_unlock(
                ASSERT(ip->i_d.di_nextents > 0);
                ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_DEXT);
                ASSERT(ip->i_df.if_bytes > 0);
-               kmem_free(iip->ili_extents_buf, ip->i_df.if_bytes);
+               kmem_free(iip->ili_extents_buf);
                iip->ili_extents_buf = NULL;
        }
        if (iip->ili_aextents_buf != NULL) {
@@ -694,7 +694,7 @@ xfs_inode_item_unlock(
                ASSERT(ip->i_d.di_anextents > 0);
                ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_AEXT);
                ASSERT(ip->i_afp->if_bytes > 0);
-               kmem_free(iip->ili_aextents_buf, ip->i_afp->if_bytes);
+               kmem_free(iip->ili_aextents_buf);
                iip->ili_aextents_buf = NULL;
        }
 
@@ -957,8 +957,7 @@ xfs_inode_item_destroy(
 {
 #ifdef XFS_TRANS_DEBUG
        if (ip->i_itemp->ili_root_size != 0) {
-               kmem_free(ip->i_itemp->ili_orig_root,
-                         ip->i_itemp->ili_root_size);
+               kmem_free(ip->i_itemp->ili_orig_root);
        }
 #endif
        kmem_zone_free(xfs_ili_zone, ip->i_itemp);
index 7edcde691d1a2539e340db2e83769ad12188e6e6..67f22b2b44b3c41c51ce3ac6c1f911f5db47b181 100644 (file)
@@ -889,6 +889,16 @@ xfs_iomap_write_unwritten(
        count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
        count_fsb = (xfs_filblks_t)(count_fsb - offset_fsb);
 
+       /*
+        * Reserve enough blocks in this transaction for two complete extent
+        * btree splits.  We may be converting the middle part of an unwritten
+        * extent and in this case we will insert two new extents in the btree
+        * each of which could cause a full split.
+        *
+        * This reservation amount will be used in the first call to
+        * xfs_bmbt_split() to select an AG with enough space to satisfy the
+        * rest of the operation.
+        */
        resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1;
 
        do {
index 419de15aeb43f004f3ae1e67ef37676a3e2f8629..9a3ef9dcaeb9063b9be707c4e3f4ea8098822d20 100644 (file)
@@ -257,7 +257,7 @@ xfs_bulkstat_one(
                *ubused = error;
 
  out_free:
-       kmem_free(buf, sizeof(*buf));
+       kmem_free(buf);
        return error;
 }
 
@@ -708,7 +708,7 @@ xfs_bulkstat(
        /*
         * Done, we're either out of filesystem or space to put the data.
         */
-       kmem_free(irbuf, irbsize);
+       kmem_free(irbuf);
        *ubcountp = ubelem;
        /*
         * Found some inodes, return them now and return the error next time.
@@ -914,7 +914,7 @@ xfs_inumbers(
                }
                *lastino = XFS_AGINO_TO_INO(mp, agno, agino);
        }
-       kmem_free(buffer, bcount * sizeof(*buffer));
+       kmem_free(buffer);
        if (cur)
                xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
                                           XFS_BTREE_NOERROR));
index ad3d26ddfe3160739908362ab2f2054d0bfb530e..91b00a5686cd5331c5ce1a9221f066c5b4cc4cd7 100644 (file)
@@ -226,20 +226,24 @@ xlog_grant_sub_space(struct log *log, int bytes)
 static void
 xlog_grant_add_space_write(struct log *log, int bytes)
 {
-       log->l_grant_write_bytes += bytes;
-       if (log->l_grant_write_bytes > log->l_logsize) {
-               log->l_grant_write_bytes -= log->l_logsize;
+       int tmp = log->l_logsize - log->l_grant_write_bytes;
+       if (tmp > bytes)
+               log->l_grant_write_bytes += bytes;
+       else {
                log->l_grant_write_cycle++;
+               log->l_grant_write_bytes = bytes - tmp;
        }
 }
 
 static void
 xlog_grant_add_space_reserve(struct log *log, int bytes)
 {
-       log->l_grant_reserve_bytes += bytes;
-       if (log->l_grant_reserve_bytes > log->l_logsize) {
-               log->l_grant_reserve_bytes -= log->l_logsize;
+       int tmp = log->l_logsize - log->l_grant_reserve_bytes;
+       if (tmp > bytes)
+               log->l_grant_reserve_bytes += bytes;
+       else {
                log->l_grant_reserve_cycle++;
+               log->l_grant_reserve_bytes = bytes - tmp;
        }
 }
 
@@ -1228,7 +1232,7 @@ xlog_alloc_log(xfs_mount_t        *mp,
 
        spin_lock_init(&log->l_icloglock);
        spin_lock_init(&log->l_grant_lock);
-       initnsema(&log->l_flushsema, 0, "ic-flush");
+       sv_init(&log->l_flush_wait, 0, "flush_wait");
 
        /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */
        ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0);
@@ -1570,10 +1574,9 @@ xlog_dealloc_log(xlog_t *log)
                }
 #endif
                next_iclog = iclog->ic_next;
-               kmem_free(iclog, sizeof(xlog_in_core_t));
+               kmem_free(iclog);
                iclog = next_iclog;
        }
-       freesema(&log->l_flushsema);
        spinlock_destroy(&log->l_icloglock);
        spinlock_destroy(&log->l_grant_lock);
 
@@ -1587,7 +1590,7 @@ xlog_dealloc_log(xlog_t *log)
        }
 #endif
        log->l_mp->m_log = NULL;
-       kmem_free(log, sizeof(xlog_t));
+       kmem_free(log);
 }      /* xlog_dealloc_log */
 
 /*
@@ -2097,6 +2100,7 @@ xlog_state_do_callback(
        int                funcdidcallbacks; /* flag: function did callbacks */
        int                repeats;     /* for issuing console warnings if
                                         * looping too many times */
+       int                wake = 0;
 
        spin_lock(&log->l_icloglock);
        first_iclog = iclog = log->l_iclog;
@@ -2278,15 +2282,13 @@ xlog_state_do_callback(
        }
 #endif
 
-       flushcnt = 0;
-       if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR)) {
-               flushcnt = log->l_flushcnt;
-               log->l_flushcnt = 0;
-       }
+       if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR))
+               wake = 1;
        spin_unlock(&log->l_icloglock);
-       while (flushcnt--)
-               vsema(&log->l_flushsema);
-}      /* xlog_state_do_callback */
+
+       if (wake)
+               sv_broadcast(&log->l_flush_wait);
+}
 
 
 /*
@@ -2384,16 +2386,15 @@ restart:
        }
 
        iclog = log->l_iclog;
-       if (! (iclog->ic_state == XLOG_STATE_ACTIVE)) {
-               log->l_flushcnt++;
-               spin_unlock(&log->l_icloglock);
+       if (iclog->ic_state != XLOG_STATE_ACTIVE) {
                xlog_trace_iclog(iclog, XLOG_TRACE_SLEEP_FLUSH);
                XFS_STATS_INC(xs_log_noiclogs);
-               /* Ensure that log writes happen */
-               psema(&log->l_flushsema, PINOD);
+
+               /* Wait for log writes to have flushed */
+               sv_wait(&log->l_flush_wait, 0, &log->l_icloglock, 0);
                goto restart;
        }
-       ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE);
+
        head = &iclog->ic_header;
 
        atomic_inc(&iclog->ic_refcnt);  /* prevents sync */
index 8952a392b5f3663e6c048b5cf413ff9d2e4007d7..6245913196b4ec483f5488b2b6525a555ec6734b 100644 (file)
@@ -423,10 +423,8 @@ typedef struct log {
        int                     l_logBBsize;    /* size of log in BB chunks */
 
        /* The following block of fields are changed while holding icloglock */
-       sema_t                  l_flushsema ____cacheline_aligned_in_smp;
-                                               /* iclog flushing semaphore */
-       int                     l_flushcnt;     /* # of procs waiting on this
-                                                * sema */
+       sv_t                    l_flush_wait ____cacheline_aligned_in_smp;
+                                               /* waiting for iclog flush */
        int                     l_covered_state;/* state of "covering disk
                                                 * log entries" */
        xlog_in_core_t          *l_iclog;       /* head log queue       */
index e65ab4af0955512de7922306edd9bc5e5767c645..9eb722ec744e528bd4aa5a8a76ce473ef35bd3f4 100644 (file)
@@ -1715,8 +1715,7 @@ xlog_check_buffer_cancelled(
                                        } else {
                                                prevp->bc_next = bcp->bc_next;
                                        }
-                                       kmem_free(bcp,
-                                                 sizeof(xfs_buf_cancel_t));
+                                       kmem_free(bcp);
                                }
                        }
                        return 1;
@@ -2519,7 +2518,7 @@ write_inode_buffer:
 
 error:
        if (need_free)
-               kmem_free(in_f, sizeof(*in_f));
+               kmem_free(in_f);
        return XFS_ERROR(error);
 }
 
@@ -2830,16 +2829,14 @@ xlog_recover_free_trans(
                item = item->ri_next;
                 /* Free the regions in the item. */
                for (i = 0; i < free_item->ri_cnt; i++) {
-                       kmem_free(free_item->ri_buf[i].i_addr,
-                                 free_item->ri_buf[i].i_len);
+                       kmem_free(free_item->ri_buf[i].i_addr);
                }
                /* Free the item itself */
-               kmem_free(free_item->ri_buf,
-                         (free_item->ri_total * sizeof(xfs_log_iovec_t)));
-               kmem_free(free_item, sizeof(xlog_recover_item_t));
+               kmem_free(free_item->ri_buf);
+               kmem_free(free_item);
        } while (first_item != item);
        /* Free the transaction recover structure */
-       kmem_free(trans, sizeof(xlog_recover_t));
+       kmem_free(trans);
 }
 
 STATIC int
@@ -3786,8 +3783,7 @@ xlog_do_log_recovery(
        error = xlog_do_recovery_pass(log, head_blk, tail_blk,
                                      XLOG_RECOVER_PASS1);
        if (error != 0) {
-               kmem_free(log->l_buf_cancel_table,
-                         XLOG_BC_TABLE_SIZE * sizeof(xfs_buf_cancel_t*));
+               kmem_free(log->l_buf_cancel_table);
                log->l_buf_cancel_table = NULL;
                return error;
        }
@@ -3806,8 +3802,7 @@ xlog_do_log_recovery(
        }
 #endif /* DEBUG */
 
-       kmem_free(log->l_buf_cancel_table,
-                 XLOG_BC_TABLE_SIZE * sizeof(xfs_buf_cancel_t*));
+       kmem_free(log->l_buf_cancel_table);
        log->l_buf_cancel_table = NULL;
 
        return error;
index da3988453b712b0c64d3afc00f6fc159271c34cf..6c5d1325e7f65661ce35a765badac586b474fd01 100644 (file)
 
 STATIC int     xfs_mount_log_sb(xfs_mount_t *, __int64_t);
 STATIC int     xfs_uuid_mount(xfs_mount_t *);
-STATIC void    xfs_uuid_unmount(xfs_mount_t *mp);
 STATIC void    xfs_unmountfs_wait(xfs_mount_t *);
 
 
 #ifdef HAVE_PERCPU_SB
-STATIC void    xfs_icsb_destroy_counters(xfs_mount_t *);
 STATIC void    xfs_icsb_balance_counter(xfs_mount_t *, xfs_sb_field_t,
                                                int);
 STATIC void    xfs_icsb_balance_counter_locked(xfs_mount_t *, xfs_sb_field_t,
@@ -63,7 +61,6 @@ STATIC void   xfs_icsb_disable_counter(xfs_mount_t *, xfs_sb_field_t);
 
 #else
 
-#define xfs_icsb_destroy_counters(mp)                  do { } while (0)
 #define xfs_icsb_balance_counter(mp, a, b)             do { } while (0)
 #define xfs_icsb_balance_counter_locked(mp, a, b)      do { } while (0)
 #define xfs_icsb_modify_counters(mp, a, b, c)          do { } while (0)
@@ -125,34 +122,12 @@ static const struct {
     { sizeof(xfs_sb_t),                         0 }
 };
 
-/*
- * Return a pointer to an initialized xfs_mount structure.
- */
-xfs_mount_t *
-xfs_mount_init(void)
-{
-       xfs_mount_t *mp;
-
-       mp = kmem_zalloc(sizeof(xfs_mount_t), KM_SLEEP);
-
-       if (xfs_icsb_init_counters(mp)) {
-               mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
-       }
-
-       spin_lock_init(&mp->m_sb_lock);
-       mutex_init(&mp->m_ilock);
-       mutex_init(&mp->m_growlock);
-       atomic_set(&mp->m_active_trans, 0);
-
-       return mp;
-}
-
 /*
  * Free up the resources associated with a mount structure.  Assume that
  * the structure was initially zeroed, so we can tell which fields got
  * initialized.
  */
-void
+STATIC void
 xfs_mount_free(
        xfs_mount_t     *mp)
 {
@@ -161,11 +136,8 @@ xfs_mount_free(
 
                for (agno = 0; agno < mp->m_maxagi; agno++)
                        if (mp->m_perag[agno].pagb_list)
-                               kmem_free(mp->m_perag[agno].pagb_list,
-                                               sizeof(xfs_perag_busy_t) *
-                                                       XFS_PAGB_NUM_SLOTS);
-               kmem_free(mp->m_perag,
-                         sizeof(xfs_perag_t) * mp->m_sb.sb_agcount);
+                               kmem_free(mp->m_perag[agno].pagb_list);
+               kmem_free(mp->m_perag);
        }
 
        spinlock_destroy(&mp->m_ail_lock);
@@ -176,13 +148,11 @@ xfs_mount_free(
                XFS_QM_DONE(mp);
 
        if (mp->m_fsname != NULL)
-               kmem_free(mp->m_fsname, mp->m_fsname_len);
+               kmem_free(mp->m_fsname);
        if (mp->m_rtname != NULL)
-               kmem_free(mp->m_rtname, strlen(mp->m_rtname) + 1);
+               kmem_free(mp->m_rtname);
        if (mp->m_logname != NULL)
-               kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
-
-       xfs_icsb_destroy_counters(mp);
+               kmem_free(mp->m_logname);
 }
 
 /*
@@ -288,6 +258,19 @@ xfs_mount_validate_sb(
                return XFS_ERROR(EFSCORRUPTED);
        }
 
+       /*
+        * Until this is fixed only page-sized or smaller data blocks work.
+        */
+       if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
+               xfs_fs_mount_cmn_err(flags,
+                       "file system with blocksize %d bytes",
+                       sbp->sb_blocksize);
+               xfs_fs_mount_cmn_err(flags,
+                       "only pagesize (%ld) or less will currently work.",
+                       PAGE_SIZE);
+               return XFS_ERROR(ENOSYS);
+       }
+
        if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
            xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
                xfs_fs_mount_cmn_err(flags,
@@ -309,19 +292,6 @@ xfs_mount_validate_sb(
                return XFS_ERROR(ENOSYS);
        }
 
-       /*
-        * Until this is fixed only page-sized or smaller data blocks work.
-        */
-       if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
-               xfs_fs_mount_cmn_err(flags,
-                       "file system with blocksize %d bytes",
-                       sbp->sb_blocksize);
-               xfs_fs_mount_cmn_err(flags,
-                       "only pagesize (%ld) or less will currently work.",
-                       PAGE_SIZE);
-               return XFS_ERROR(ENOSYS);
-       }
-
        return 0;
 }
 
@@ -994,9 +964,19 @@ xfs_mountfs(
                 * Re-check for ATTR2 in case it was found in bad_features2
                 * slot.
                 */
-               if (xfs_sb_version_hasattr2(&mp->m_sb))
+               if (xfs_sb_version_hasattr2(&mp->m_sb) &&
+                  !(mp->m_flags & XFS_MOUNT_NOATTR2))
                        mp->m_flags |= XFS_MOUNT_ATTR2;
+       }
+
+       if (xfs_sb_version_hasattr2(&mp->m_sb) &&
+          (mp->m_flags & XFS_MOUNT_NOATTR2)) {
+               xfs_sb_version_removeattr2(&mp->m_sb);
+               update_flags |= XFS_SB_FEATURES2;
 
+               /* update sb_versionnum for the clearing of the morebits */
+               if (!sbp->sb_features2)
+                       update_flags |= XFS_SB_VERSIONNUM;
        }
 
        /*
@@ -1255,15 +1235,13 @@ xfs_mountfs(
  error2:
        for (agno = 0; agno < sbp->sb_agcount; agno++)
                if (mp->m_perag[agno].pagb_list)
-                       kmem_free(mp->m_perag[agno].pagb_list,
-                         sizeof(xfs_perag_busy_t) * XFS_PAGB_NUM_SLOTS);
-       kmem_free(mp->m_perag, sbp->sb_agcount * sizeof(xfs_perag_t));
+                       kmem_free(mp->m_perag[agno].pagb_list);
+       kmem_free(mp->m_perag);
        mp->m_perag = NULL;
        /* FALLTHROUGH */
  error1:
        if (uuid_mounted)
-               xfs_uuid_unmount(mp);
-       xfs_freesb(mp);
+               uuid_table_remove(&mp->m_sb.sb_uuid);
        return error;
 }
 
@@ -1274,7 +1252,7 @@ xfs_mountfs(
  * log and makes sure that incore structures are freed.
  */
 int
-xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
+xfs_unmountfs(xfs_mount_t *mp)
 {
        __uint64_t      resblks;
        int             error = 0;
@@ -1341,9 +1319,8 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
         */
        ASSERT(mp->m_inodes == NULL);
 
-       xfs_unmountfs_close(mp, cr);
        if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0)
-               xfs_uuid_unmount(mp);
+               uuid_table_remove(&mp->m_sb.sb_uuid);
 
 #if defined(DEBUG) || defined(INDUCE_IO_ERROR)
        xfs_errortag_clearall(mp, 0);
@@ -1352,16 +1329,6 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
        return 0;
 }
 
-void
-xfs_unmountfs_close(xfs_mount_t *mp, struct cred *cr)
-{
-       if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
-               xfs_free_buftarg(mp->m_logdev_targp, 1);
-       if (mp->m_rtdev_targp)
-               xfs_free_buftarg(mp->m_rtdev_targp, 1);
-       xfs_free_buftarg(mp->m_ddev_targp, 0);
-}
-
 STATIC void
 xfs_unmountfs_wait(xfs_mount_t *mp)
 {
@@ -1904,16 +1871,6 @@ xfs_uuid_mount(
        return 0;
 }
 
-/*
- * Remove filesystem from the UUID table.
- */
-STATIC void
-xfs_uuid_unmount(
-       xfs_mount_t     *mp)
-{
-       uuid_table_remove(&mp->m_sb.sb_uuid);
-}
-
 /*
  * Used to log changes to the superblock unit and width fields which could
  * be altered by the mount options, as well as any potential sb_features2
@@ -1928,7 +1885,8 @@ xfs_mount_log_sb(
        int             error;
 
        ASSERT(fields & (XFS_SB_UNIT | XFS_SB_WIDTH | XFS_SB_UUID |
-                        XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2));
+                        XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2 |
+                        XFS_SB_VERSIONNUM));
 
        tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT);
        error = xfs_trans_reserve(tp, 0, mp->m_sb.sb_sectsize + 128, 0, 0,
@@ -2109,7 +2067,7 @@ xfs_icsb_reinit_counters(
        xfs_icsb_unlock(mp);
 }
 
-STATIC void
+void
 xfs_icsb_destroy_counters(
        xfs_mount_t     *mp)
 {
index 63e0693a358a295e4657eabde52ebc88b8de965e..5269bd6e3df08ffa624ccf8c1e691ccd0622c33c 100644 (file)
@@ -61,6 +61,7 @@ struct xfs_bmap_free;
 struct xfs_extdelta;
 struct xfs_swapext;
 struct xfs_mru_cache;
+struct xfs_nameops;
 
 /*
  * Prototypes and functions for the Data Migration subsystem.
@@ -210,12 +211,14 @@ typedef struct xfs_icsb_cnts {
 
 extern int     xfs_icsb_init_counters(struct xfs_mount *);
 extern void    xfs_icsb_reinit_counters(struct xfs_mount *);
+extern void    xfs_icsb_destroy_counters(struct xfs_mount *);
 extern void    xfs_icsb_sync_counters(struct xfs_mount *, int);
 extern void    xfs_icsb_sync_counters_locked(struct xfs_mount *, int);
 
 #else
-#define xfs_icsb_init_counters(mp)     (0)
-#define xfs_icsb_reinit_counters(mp)   do { } while (0)
+#define xfs_icsb_init_counters(mp)             (0)
+#define xfs_icsb_destroy_counters(mp)          do { } while (0)
+#define xfs_icsb_reinit_counters(mp)           do { } while (0)
 #define xfs_icsb_sync_counters(mp, flags)      do { } while (0)
 #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0)
 #endif
@@ -313,6 +316,7 @@ typedef struct xfs_mount {
        __uint8_t               m_inode_quiesce;/* call quiesce on new inodes.
                                                   field governed by m_ilock */
        __uint8_t               m_sectbb_log;   /* sectlog - BBSHIFT */
+       const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */
        int                     m_dirblksize;   /* directory block sz--bytes */
        int                     m_dirblkfsbs;   /* directory block sz--fsbs */
        xfs_dablk_t             m_dirdatablk;   /* blockno of dir data v2 */
@@ -378,6 +382,7 @@ typedef struct xfs_mount {
                                                   counters */
 #define XFS_MOUNT_FILESTREAMS  (1ULL << 24)    /* enable the filestreams
                                                   allocator */
+#define XFS_MOUNT_NOATTR2      (1ULL << 25)    /* disable use of attr2 format */
 
 
 /*
@@ -510,15 +515,12 @@ typedef struct xfs_mod_sb {
 #define        XFS_MOUNT_ILOCK(mp)     mutex_lock(&((mp)->m_ilock))
 #define        XFS_MOUNT_IUNLOCK(mp)   mutex_unlock(&((mp)->m_ilock))
 
-extern xfs_mount_t *xfs_mount_init(void);
 extern void    xfs_mod_sb(xfs_trans_t *, __int64_t);
 extern int     xfs_log_sbcount(xfs_mount_t *, uint);
-extern void    xfs_mount_free(xfs_mount_t *mp);
 extern int     xfs_mountfs(xfs_mount_t *mp, int);
 extern void    xfs_mountfs_check_barriers(xfs_mount_t *mp);
 
-extern int     xfs_unmountfs(xfs_mount_t *, struct cred *);
-extern void    xfs_unmountfs_close(xfs_mount_t *, struct cred *);
+extern int     xfs_unmountfs(xfs_mount_t *);
 extern int     xfs_unmountfs_writesb(xfs_mount_t *);
 extern int     xfs_unmount_flush(xfs_mount_t *, int);
 extern int     xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int);
@@ -544,9 +546,6 @@ extern void xfs_qmops_put(struct xfs_mount *);
 
 extern struct xfs_dmops xfs_dmcore_xfs;
 
-extern int     xfs_init(void);
-extern void    xfs_cleanup(void);
-
 #endif /* __KERNEL__ */
 
 #endif /* __XFS_MOUNT_H__ */
index a0b2c0a2589a97166f23982999aa3a15b95a9687..afee7eb243234824a44a8ad9b91fc23200fdc6ea 100644 (file)
@@ -307,15 +307,18 @@ xfs_mru_cache_init(void)
        xfs_mru_elem_zone = kmem_zone_init(sizeof(xfs_mru_cache_elem_t),
                                         "xfs_mru_cache_elem");
        if (!xfs_mru_elem_zone)
-               return ENOMEM;
+               goto out;
 
        xfs_mru_reap_wq = create_singlethread_workqueue("xfs_mru_cache");
-       if (!xfs_mru_reap_wq) {
-               kmem_zone_destroy(xfs_mru_elem_zone);
-               return ENOMEM;
-       }
+       if (!xfs_mru_reap_wq)
+               goto out_destroy_mru_elem_zone;
 
        return 0;
+
+ out_destroy_mru_elem_zone:
+       kmem_zone_destroy(xfs_mru_elem_zone);
+ out:
+       return -ENOMEM;
 }
 
 void
@@ -382,9 +385,9 @@ xfs_mru_cache_create(
 
 exit:
        if (err && mru && mru->lists)
-               kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists));
+               kmem_free(mru->lists);
        if (err && mru)
-               kmem_free(mru, sizeof(*mru));
+               kmem_free(mru);
 
        return err;
 }
@@ -424,8 +427,8 @@ xfs_mru_cache_destroy(
 
        xfs_mru_cache_flush(mru);
 
-       kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists));
-       kmem_free(mru, sizeof(*mru));
+       kmem_free(mru->lists);
+       kmem_free(mru);
 }
 
 /*
index d8063e1ad2987e94470a9ff24cff44dece1c5f0d..d700dacdb10e7f68302853945b22ab56a752c7ad 100644 (file)
@@ -336,21 +336,17 @@ xfs_rename(
                ASSERT(error != EEXIST);
                if (error)
                        goto abort_return;
-               xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-
-       } else {
-               /*
-                * We always want to hit the ctime on the source inode.
-                * We do it in the if clause above for the 'new_parent &&
-                * src_is_directory' case, and here we get all the other
-                * cases.  This isn't strictly required by the standards
-                * since the source inode isn't really being changed,
-                * but old unix file systems did it and some incremental
-                * backup programs won't work without it.
-                */
-               xfs_ichgtime(src_ip, XFS_ICHGTIME_CHG);
        }
 
+       /*
+        * We always want to hit the ctime on the source inode.
+        *
+        * This isn't strictly required by the standards since the source
+        * inode isn't really being changed, but old unix file systems did
+        * it and some incremental backup programs won't work without it.
+        */
+       xfs_ichgtime(src_ip, XFS_ICHGTIME_CHG);
+
        /*
         * Adjust the link count on src_dp.  This is necessary when
         * renaming a directory, either within one parent when
index a0dc6e5bc5b9fe5a7fa0fd2cc6e4be759c3399d9..bf87a5913504382a07b121ca119c0187bbeb7473 100644 (file)
@@ -2062,7 +2062,7 @@ xfs_growfs_rt(
        /*
         * Free the fake mp structure.
         */
-       kmem_free(nmp, sizeof(*nmp));
+       kmem_free(nmp);
 
        return error;
 }
index d904efe7f871dd6725809e681cb8a385b857a69b..3f8cf1587f4cc09521ad17815160af4ad7395cd8 100644 (file)
@@ -46,10 +46,12 @@ struct xfs_mount;
 #define XFS_SB_VERSION_SECTORBIT       0x0800
 #define        XFS_SB_VERSION_EXTFLGBIT        0x1000
 #define        XFS_SB_VERSION_DIRV2BIT         0x2000
+#define        XFS_SB_VERSION_BORGBIT          0x4000  /* ASCII only case-insens. */
 #define        XFS_SB_VERSION_MOREBITSBIT      0x8000
 #define        XFS_SB_VERSION_OKSASHFBITS      \
        (XFS_SB_VERSION_EXTFLGBIT | \
-        XFS_SB_VERSION_DIRV2BIT)
+        XFS_SB_VERSION_DIRV2BIT | \
+        XFS_SB_VERSION_BORGBIT)
 #define        XFS_SB_VERSION_OKREALFBITS      \
        (XFS_SB_VERSION_ATTRBIT | \
         XFS_SB_VERSION_NLINKBIT | \
@@ -437,6 +439,12 @@ static inline int xfs_sb_version_hassector(xfs_sb_t *sbp)
                ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT);
 }
 
+static inline int xfs_sb_version_hasasciici(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT);
+}
+
 static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp)
 {
        return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
@@ -473,6 +481,13 @@ static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp)
                ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT)));
 }
 
+static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp)
+{
+       sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
+       if (!sbp->sb_features2)
+               sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
+}
+
 /*
  * end of superblock version macros
  */
index 140386434aa3ec85d32528274e3add8d8be99cae..e4ebddd3c500bd577c29fecbfd233efa6a890f5f 100644 (file)
@@ -889,7 +889,7 @@ shut_us_down:
 
        tp->t_commit_lsn = commit_lsn;
        if (nvec > XFS_TRANS_LOGVEC_COUNT) {
-               kmem_free(log_vector, nvec * sizeof(xfs_log_iovec_t));
+               kmem_free(log_vector);
        }
 
        /*
@@ -1265,7 +1265,7 @@ xfs_trans_committed(
                ASSERT(!XFS_LIC_ARE_ALL_FREE(licp));
                xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag);
                next_licp = licp->lic_next;
-               kmem_free(licp, sizeof(xfs_log_item_chunk_t));
+               kmem_free(licp);
                licp = next_licp;
        }
 
index 4c70bf5e9985a8145a65b2a3670e41a5ca42ab8a..2a1c0f071f9181e8a045a70dc2bc72dd453c0d05 100644 (file)
@@ -291,7 +291,7 @@ xfs_trans_inode_broot_debug(
        iip = ip->i_itemp;
        if (iip->ili_root_size != 0) {
                ASSERT(iip->ili_orig_root != NULL);
-               kmem_free(iip->ili_orig_root, iip->ili_root_size);
+               kmem_free(iip->ili_orig_root);
                iip->ili_root_size = 0;
                iip->ili_orig_root = NULL;
        }
index 66a09f0d894b0c42b2eafb5a667bf1e0c57b4b97..db5c83595526442cae1f2890080525aecfdbf33b 100644 (file)
@@ -161,7 +161,7 @@ xfs_trans_free_item(xfs_trans_t     *tp, xfs_log_item_desc_t *lidp)
                        licpp = &((*licpp)->lic_next);
                }
                *licpp = licp->lic_next;
-               kmem_free(licp, sizeof(xfs_log_item_chunk_t));
+               kmem_free(licp);
                tp->t_items_free -= XFS_LIC_NUM_SLOTS;
        }
 }
@@ -314,7 +314,7 @@ xfs_trans_free_items(
                ASSERT(!XFS_LIC_ARE_ALL_FREE(licp));
                (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN);
                next_licp = licp->lic_next;
-               kmem_free(licp, sizeof(xfs_log_item_chunk_t));
+               kmem_free(licp);
                licp = next_licp;
        }
 
@@ -363,7 +363,7 @@ xfs_trans_unlock_items(xfs_trans_t *tp, xfs_lsn_t commit_lsn)
                next_licp = licp->lic_next;
                if (XFS_LIC_ARE_ALL_FREE(licp)) {
                        *licpp = next_licp;
-                       kmem_free(licp, sizeof(xfs_log_item_chunk_t));
+                       kmem_free(licp);
                        freed -= XFS_LIC_NUM_SLOTS;
                } else {
                        licpp = &(licp->lic_next);
@@ -530,7 +530,7 @@ xfs_trans_free_busy(xfs_trans_t *tp)
        lbcp = tp->t_busy.lbc_next;
        while (lbcp != NULL) {
                lbcq = lbcp->lbc_next;
-               kmem_free(lbcp, sizeof(xfs_log_busy_chunk_t));
+               kmem_free(lbcp);
                lbcp = lbcq;
        }
 
index 30bacd8bb0e5b8a86251e3dbe03f9fe2c6f08ace..4a9a43315a8662262906292d0d3c21293644d015 100644 (file)
 #include "xfs_utils.h"
 
 
-int __init
-xfs_init(void)
-{
-#ifdef XFS_DABUF_DEBUG
-       extern spinlock_t        xfs_dabuf_global_lock;
-       spin_lock_init(&xfs_dabuf_global_lock);
-#endif
-
-       /*
-        * Initialize all of the zone allocators we use.
-        */
-       xfs_log_ticket_zone = kmem_zone_init(sizeof(xlog_ticket_t),
-                                               "xfs_log_ticket");
-       xfs_bmap_free_item_zone = kmem_zone_init(sizeof(xfs_bmap_free_item_t),
-                                               "xfs_bmap_free_item");
-       xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t),
-                                               "xfs_btree_cur");
-       xfs_da_state_zone = kmem_zone_init(sizeof(xfs_da_state_t),
-                                               "xfs_da_state");
-       xfs_dabuf_zone = kmem_zone_init(sizeof(xfs_dabuf_t), "xfs_dabuf");
-       xfs_ifork_zone = kmem_zone_init(sizeof(xfs_ifork_t), "xfs_ifork");
-       xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans");
-       xfs_acl_zone_init(xfs_acl_zone, "xfs_acl");
-       xfs_mru_cache_init();
-       xfs_filestream_init();
-
-       /*
-        * The size of the zone allocated buf log item is the maximum
-        * size possible under XFS.  This wastes a little bit of memory,
-        * but it is much faster.
-        */
-       xfs_buf_item_zone =
-               kmem_zone_init((sizeof(xfs_buf_log_item_t) +
-                               (((XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK) /
-                                 NBWORD) * sizeof(int))),
-                              "xfs_buf_item");
-       xfs_efd_zone =
-               kmem_zone_init((sizeof(xfs_efd_log_item_t) +
-                              ((XFS_EFD_MAX_FAST_EXTENTS - 1) *
-                                sizeof(xfs_extent_t))),
-                                     "xfs_efd_item");
-       xfs_efi_zone =
-               kmem_zone_init((sizeof(xfs_efi_log_item_t) +
-                              ((XFS_EFI_MAX_FAST_EXTENTS - 1) *
-                                sizeof(xfs_extent_t))),
-                                     "xfs_efi_item");
-
-       /*
-        * These zones warrant special memory allocator hints
-        */
-       xfs_inode_zone =
-               kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
-                                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
-                                       KM_ZONE_SPREAD, NULL);
-       xfs_ili_zone =
-               kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili",
-                                       KM_ZONE_SPREAD, NULL);
-
-       /*
-        * Allocate global trace buffers.
-        */
-#ifdef XFS_ALLOC_TRACE
-       xfs_alloc_trace_buf = ktrace_alloc(XFS_ALLOC_TRACE_SIZE, KM_SLEEP);
-#endif
-#ifdef XFS_BMAP_TRACE
-       xfs_bmap_trace_buf = ktrace_alloc(XFS_BMAP_TRACE_SIZE, KM_SLEEP);
-#endif
-#ifdef XFS_BMBT_TRACE
-       xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_SLEEP);
-#endif
-#ifdef XFS_ATTR_TRACE
-       xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_SLEEP);
-#endif
-#ifdef XFS_DIR2_TRACE
-       xfs_dir2_trace_buf = ktrace_alloc(XFS_DIR2_GTRACE_SIZE, KM_SLEEP);
-#endif
-
-       xfs_dir_startup();
-
-#if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
-       xfs_error_test_init();
-#endif /* DEBUG || INDUCE_IO_ERROR */
-
-       xfs_init_procfs();
-       xfs_sysctl_register();
-       return 0;
-}
-
-void __exit
-xfs_cleanup(void)
-{
-       extern kmem_zone_t      *xfs_inode_zone;
-       extern kmem_zone_t      *xfs_efd_zone;
-       extern kmem_zone_t      *xfs_efi_zone;
-
-       xfs_cleanup_procfs();
-       xfs_sysctl_unregister();
-       xfs_filestream_uninit();
-       xfs_mru_cache_uninit();
-       xfs_acl_zone_destroy(xfs_acl_zone);
-
-#ifdef XFS_DIR2_TRACE
-       ktrace_free(xfs_dir2_trace_buf);
-#endif
-#ifdef XFS_ATTR_TRACE
-       ktrace_free(xfs_attr_trace_buf);
-#endif
-#ifdef XFS_BMBT_TRACE
-       ktrace_free(xfs_bmbt_trace_buf);
-#endif
-#ifdef XFS_BMAP_TRACE
-       ktrace_free(xfs_bmap_trace_buf);
-#endif
-#ifdef XFS_ALLOC_TRACE
-       ktrace_free(xfs_alloc_trace_buf);
-#endif
-
-       kmem_zone_destroy(xfs_bmap_free_item_zone);
-       kmem_zone_destroy(xfs_btree_cur_zone);
-       kmem_zone_destroy(xfs_inode_zone);
-       kmem_zone_destroy(xfs_trans_zone);
-       kmem_zone_destroy(xfs_da_state_zone);
-       kmem_zone_destroy(xfs_dabuf_zone);
-       kmem_zone_destroy(xfs_buf_item_zone);
-       kmem_zone_destroy(xfs_efd_zone);
-       kmem_zone_destroy(xfs_efi_zone);
-       kmem_zone_destroy(xfs_ifork_zone);
-       kmem_zone_destroy(xfs_ili_zone);
-       kmem_zone_destroy(xfs_log_ticket_zone);
-}
-
-/*
- * xfs_start_flags
- *
- * This function fills in xfs_mount_t fields based on mount args.
- * Note: the superblock has _not_ yet been read in.
- */
-STATIC int
-xfs_start_flags(
-       struct xfs_mount_args   *ap,
-       struct xfs_mount        *mp)
-{
-       /* Values are in BBs */
-       if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
-               /*
-                * At this point the superblock has not been read
-                * in, therefore we do not know the block size.
-                * Before the mount call ends we will convert
-                * these to FSBs.
-                */
-               mp->m_dalign = ap->sunit;
-               mp->m_swidth = ap->swidth;
-       }
-
-       if (ap->logbufs != -1 &&
-           ap->logbufs != 0 &&
-           (ap->logbufs < XLOG_MIN_ICLOGS ||
-            ap->logbufs > XLOG_MAX_ICLOGS)) {
-               cmn_err(CE_WARN,
-                       "XFS: invalid logbufs value: %d [not %d-%d]",
-                       ap->logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS);
-               return XFS_ERROR(EINVAL);
-       }
-       mp->m_logbufs = ap->logbufs;
-       if (ap->logbufsize != -1 &&
-           ap->logbufsize !=  0 &&
-           (ap->logbufsize < XLOG_MIN_RECORD_BSIZE ||
-            ap->logbufsize > XLOG_MAX_RECORD_BSIZE ||
-            !is_power_of_2(ap->logbufsize))) {
-               cmn_err(CE_WARN,
-       "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]",
-                       ap->logbufsize);
-               return XFS_ERROR(EINVAL);
-       }
-       mp->m_logbsize = ap->logbufsize;
-       mp->m_fsname_len = strlen(ap->fsname) + 1;
-       mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
-       strcpy(mp->m_fsname, ap->fsname);
-       if (ap->rtname[0]) {
-               mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP);
-               strcpy(mp->m_rtname, ap->rtname);
-       }
-       if (ap->logname[0]) {
-               mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP);
-               strcpy(mp->m_logname, ap->logname);
-       }
-
-       if (ap->flags & XFSMNT_WSYNC)
-               mp->m_flags |= XFS_MOUNT_WSYNC;
-#if XFS_BIG_INUMS
-       if (ap->flags & XFSMNT_INO64) {
-               mp->m_flags |= XFS_MOUNT_INO64;
-               mp->m_inoadd = XFS_INO64_OFFSET;
-       }
-#endif
-       if (ap->flags & XFSMNT_RETERR)
-               mp->m_flags |= XFS_MOUNT_RETERR;
-       if (ap->flags & XFSMNT_NOALIGN)
-               mp->m_flags |= XFS_MOUNT_NOALIGN;
-       if (ap->flags & XFSMNT_SWALLOC)
-               mp->m_flags |= XFS_MOUNT_SWALLOC;
-       if (ap->flags & XFSMNT_OSYNCISOSYNC)
-               mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
-       if (ap->flags & XFSMNT_32BITINODES)
-               mp->m_flags |= XFS_MOUNT_32BITINODES;
-
-       if (ap->flags & XFSMNT_IOSIZE) {
-               if (ap->iosizelog > XFS_MAX_IO_LOG ||
-                   ap->iosizelog < XFS_MIN_IO_LOG) {
-                       cmn_err(CE_WARN,
-               "XFS: invalid log iosize: %d [not %d-%d]",
-                               ap->iosizelog, XFS_MIN_IO_LOG,
-                               XFS_MAX_IO_LOG);
-                       return XFS_ERROR(EINVAL);
-               }
-
-               mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE;
-               mp->m_readio_log = mp->m_writeio_log = ap->iosizelog;
-       }
-
-       if (ap->flags & XFSMNT_IKEEP)
-               mp->m_flags |= XFS_MOUNT_IKEEP;
-       if (ap->flags & XFSMNT_DIRSYNC)
-               mp->m_flags |= XFS_MOUNT_DIRSYNC;
-       if (ap->flags & XFSMNT_ATTR2)
-               mp->m_flags |= XFS_MOUNT_ATTR2;
-
-       if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
-               mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
-
-       /*
-        * no recovery flag requires a read-only mount
-        */
-       if (ap->flags & XFSMNT_NORECOVERY) {
-               if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
-                       cmn_err(CE_WARN,
-       "XFS: tried to mount a FS read-write without recovery!");
-                       return XFS_ERROR(EINVAL);
-               }
-               mp->m_flags |= XFS_MOUNT_NORECOVERY;
-       }
-
-       if (ap->flags & XFSMNT_NOUUID)
-               mp->m_flags |= XFS_MOUNT_NOUUID;
-       if (ap->flags & XFSMNT_BARRIER)
-               mp->m_flags |= XFS_MOUNT_BARRIER;
-       else
-               mp->m_flags &= ~XFS_MOUNT_BARRIER;
-
-       if (ap->flags2 & XFSMNT2_FILESTREAMS)
-               mp->m_flags |= XFS_MOUNT_FILESTREAMS;
-
-       if (ap->flags & XFSMNT_DMAPI)
-               mp->m_flags |= XFS_MOUNT_DMAPI;
-       return 0;
-}
-
-/*
- * This function fills in xfs_mount_t fields based on mount args.
- * Note: the superblock _has_ now been read in.
- */
-STATIC int
-xfs_finish_flags(
-       struct xfs_mount_args   *ap,
-       struct xfs_mount        *mp)
-{
-       int                     ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
-
-       /* Fail a mount where the logbuf is smaller then the log stripe */
-       if (xfs_sb_version_haslogv2(&mp->m_sb)) {
-               if ((ap->logbufsize <= 0) &&
-                   (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) {
-                       mp->m_logbsize = mp->m_sb.sb_logsunit;
-               } else if (ap->logbufsize > 0 &&
-                          ap->logbufsize < mp->m_sb.sb_logsunit) {
-                       cmn_err(CE_WARN,
-       "XFS: logbuf size must be greater than or equal to log stripe size");
-                       return XFS_ERROR(EINVAL);
-               }
-       } else {
-               /* Fail a mount if the logbuf is larger than 32K */
-               if (ap->logbufsize > XLOG_BIG_RECORD_BSIZE) {
-                       cmn_err(CE_WARN,
-       "XFS: logbuf size for version 1 logs must be 16K or 32K");
-                       return XFS_ERROR(EINVAL);
-               }
-       }
-
-       if (xfs_sb_version_hasattr2(&mp->m_sb))
-               mp->m_flags |= XFS_MOUNT_ATTR2;
-
-       /*
-        * prohibit r/w mounts of read-only filesystems
-        */
-       if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) {
-               cmn_err(CE_WARN,
-       "XFS: cannot mount a read-only filesystem as read-write");
-               return XFS_ERROR(EROFS);
-       }
-
-       /*
-        * check for shared mount.
-        */
-       if (ap->flags & XFSMNT_SHARED) {
-               if (!xfs_sb_version_hasshared(&mp->m_sb))
-                       return XFS_ERROR(EINVAL);
-
-               /*
-                * For IRIX 6.5, shared mounts must have the shared
-                * version bit set, have the persistent readonly
-                * field set, must be version 0 and can only be mounted
-                * read-only.
-                */
-               if (!ronly || !(mp->m_sb.sb_flags & XFS_SBF_READONLY) ||
-                    (mp->m_sb.sb_shared_vn != 0))
-                       return XFS_ERROR(EINVAL);
-
-               mp->m_flags |= XFS_MOUNT_SHARED;
-
-               /*
-                * Shared XFS V0 can't deal with DMI.  Return EINVAL.
-                */
-               if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI))
-                       return XFS_ERROR(EINVAL);
-       }
-
-       if (ap->flags & XFSMNT_UQUOTA) {
-               mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE);
-               if (ap->flags & XFSMNT_UQUOTAENF)
-                       mp->m_qflags |= XFS_UQUOTA_ENFD;
-       }
-
-       if (ap->flags & XFSMNT_GQUOTA) {
-               mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE);
-               if (ap->flags & XFSMNT_GQUOTAENF)
-                       mp->m_qflags |= XFS_OQUOTA_ENFD;
-       } else if (ap->flags & XFSMNT_PQUOTA) {
-               mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE);
-               if (ap->flags & XFSMNT_PQUOTAENF)
-                       mp->m_qflags |= XFS_OQUOTA_ENFD;
-       }
-
-       return 0;
-}
-
-/*
- * xfs_mount
- *
- * The file system configurations are:
- *     (1) device (partition) with data and internal log
- *     (2) logical volume with data and log subvolumes.
- *     (3) logical volume with data, log, and realtime subvolumes.
- *
- * We only have to handle opening the log and realtime volumes here if
- * they are present.  The data subvolume has already been opened by
- * get_sb_bdev() and is stored in vfsp->vfs_super->s_bdev.
- */
-int
-xfs_mount(
-       struct xfs_mount        *mp,
-       struct xfs_mount_args   *args,
-       cred_t                  *credp)
-{
-       struct block_device     *ddev, *logdev, *rtdev;
-       int                     flags = 0, error;
-
-       ddev = mp->m_super->s_bdev;
-       logdev = rtdev = NULL;
-
-       error = xfs_dmops_get(mp, args);
-       if (error)
-               return error;
-       error = xfs_qmops_get(mp, args);
-       if (error)
-               return error;
-
-       if (args->flags & XFSMNT_QUIET)
-               flags |= XFS_MFSI_QUIET;
-
-       /*
-        * Open real time and log devices - order is important.
-        */
-       if (args->logname[0]) {
-               error = xfs_blkdev_get(mp, args->logname, &logdev);
-               if (error)
-                       return error;
-       }
-       if (args->rtname[0]) {
-               error = xfs_blkdev_get(mp, args->rtname, &rtdev);
-               if (error) {
-                       xfs_blkdev_put(logdev);
-                       return error;
-               }
-
-               if (rtdev == ddev || rtdev == logdev) {
-                       cmn_err(CE_WARN,
-       "XFS: Cannot mount filesystem with identical rtdev and ddev/logdev.");
-                       xfs_blkdev_put(logdev);
-                       xfs_blkdev_put(rtdev);
-                       return EINVAL;
-               }
-       }
-
-       /*
-        * Setup xfs_mount buffer target pointers
-        */
-       error = ENOMEM;
-       mp->m_ddev_targp = xfs_alloc_buftarg(ddev, 0);
-       if (!mp->m_ddev_targp) {
-               xfs_blkdev_put(logdev);
-               xfs_blkdev_put(rtdev);
-               return error;
-       }
-       if (rtdev) {
-               mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev, 1);
-               if (!mp->m_rtdev_targp) {
-                       xfs_blkdev_put(logdev);
-                       xfs_blkdev_put(rtdev);
-                       goto error0;
-               }
-       }
-       mp->m_logdev_targp = (logdev && logdev != ddev) ?
-                               xfs_alloc_buftarg(logdev, 1) : mp->m_ddev_targp;
-       if (!mp->m_logdev_targp) {
-               xfs_blkdev_put(logdev);
-               xfs_blkdev_put(rtdev);
-               goto error0;
-       }
-
-       /*
-        * Setup flags based on mount(2) options and then the superblock
-        */
-       error = xfs_start_flags(args, mp);
-       if (error)
-               goto error1;
-       error = xfs_readsb(mp, flags);
-       if (error)
-               goto error1;
-       error = xfs_finish_flags(args, mp);
-       if (error)
-               goto error2;
-
-       /*
-        * Setup xfs_mount buffer target pointers based on superblock
-        */
-       error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
-                                   mp->m_sb.sb_sectsize);
-       if (!error && logdev && logdev != ddev) {
-               unsigned int    log_sector_size = BBSIZE;
-
-               if (xfs_sb_version_hassector(&mp->m_sb))
-                       log_sector_size = mp->m_sb.sb_logsectsize;
-               error = xfs_setsize_buftarg(mp->m_logdev_targp,
-                                           mp->m_sb.sb_blocksize,
-                                           log_sector_size);
-       }
-       if (!error && rtdev)
-               error = xfs_setsize_buftarg(mp->m_rtdev_targp,
-                                           mp->m_sb.sb_blocksize,
-                                           mp->m_sb.sb_sectsize);
-       if (error)
-               goto error2;
-
-       if (mp->m_flags & XFS_MOUNT_BARRIER)
-               xfs_mountfs_check_barriers(mp);
-
-       if ((error = xfs_filestream_mount(mp)))
-               goto error2;
-
-       error = xfs_mountfs(mp, flags);
-       if (error)
-               goto error2;
-
-       XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname);
-
-       return 0;
-
-error2:
-       if (mp->m_sb_bp)
-               xfs_freesb(mp);
-error1:
-       xfs_binval(mp->m_ddev_targp);
-       if (logdev && logdev != ddev)
-               xfs_binval(mp->m_logdev_targp);
-       if (rtdev)
-               xfs_binval(mp->m_rtdev_targp);
-error0:
-       xfs_unmountfs_close(mp, credp);
-       xfs_qmops_put(mp);
-       xfs_dmops_put(mp);
-       return error;
-}
-
-int
-xfs_unmount(
-       xfs_mount_t     *mp,
-       int             flags,
-       cred_t          *credp)
-{
-       xfs_inode_t     *rip;
-       bhv_vnode_t     *rvp;
-       int             unmount_event_wanted = 0;
-       int             unmount_event_flags = 0;
-       int             xfs_unmountfs_needed = 0;
-       int             error;
-
-       rip = mp->m_rootip;
-       rvp = XFS_ITOV(rip);
-
-#ifdef HAVE_DMAPI
-       if (mp->m_flags & XFS_MOUNT_DMAPI) {
-               error = XFS_SEND_PREUNMOUNT(mp,
-                               rip, DM_RIGHT_NULL, rip, DM_RIGHT_NULL,
-                               NULL, NULL, 0, 0,
-                               (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
-                                       0:DM_FLAGS_UNWANTED);
-                       if (error)
-                               return XFS_ERROR(error);
-               unmount_event_wanted = 1;
-               unmount_event_flags = (mp->m_dmevmask & (1<<DM_EVENT_UNMOUNT))?
-                                       0 : DM_FLAGS_UNWANTED;
-       }
-#endif
-
-       /*
-        * Blow away any referenced inode in the filestreams cache.
-        * This can and will cause log traffic as inodes go inactive
-        * here.
-        */
-       xfs_filestream_unmount(mp);
-
-       XFS_bflush(mp->m_ddev_targp);
-       error = xfs_unmount_flush(mp, 0);
-       if (error)
-               goto out;
-
-       ASSERT(vn_count(rvp) == 1);
-
-       /*
-        * Drop the reference count
-        */
-       IRELE(rip);
-
-       /*
-        * If we're forcing a shutdown, typically because of a media error,
-        * we want to make sure we invalidate dirty pages that belong to
-        * referenced vnodes as well.
-        */
-       if (XFS_FORCED_SHUTDOWN(mp)) {
-               error = xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE);
-               ASSERT(error != EFSCORRUPTED);
-       }
-       xfs_unmountfs_needed = 1;
-
-out:
-       /*      Send DMAPI event, if required.
-        *      Then do xfs_unmountfs() if needed.
-        *      Then return error (or zero).
-        */
-       if (unmount_event_wanted) {
-               /* Note: mp structure must still exist for
-                * XFS_SEND_UNMOUNT() call.
-                */
-               XFS_SEND_UNMOUNT(mp, error == 0 ? rip : NULL,
-                       DM_RIGHT_NULL, 0, error, unmount_event_flags);
-       }
-       if (xfs_unmountfs_needed) {
-               /*
-                * Call common unmount function to flush to disk
-                * and free the super block buffer & mount structures.
-                */
-               xfs_unmountfs(mp, credp);
-               xfs_qmops_put(mp);
-               xfs_dmops_put(mp);
-               kmem_free(mp, sizeof(xfs_mount_t));
-       }
-
-       return XFS_ERROR(error);
-}
-
 STATIC void
 xfs_quiesce_fs(
        xfs_mount_t             *mp)
@@ -694,30 +114,6 @@ xfs_attr_quiesce(
        xfs_unmountfs_writesb(mp);
 }
 
-int
-xfs_mntupdate(
-       struct xfs_mount                *mp,
-       int                             *flags,
-       struct xfs_mount_args           *args)
-{
-       if (!(*flags & MS_RDONLY)) {                    /* rw/ro -> rw */
-               if (mp->m_flags & XFS_MOUNT_RDONLY)
-                       mp->m_flags &= ~XFS_MOUNT_RDONLY;
-               if (args->flags & XFSMNT_BARRIER) {
-                       mp->m_flags |= XFS_MOUNT_BARRIER;
-                       xfs_mountfs_check_barriers(mp);
-               } else {
-                       mp->m_flags &= ~XFS_MOUNT_BARRIER;
-               }
-       } else if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */
-               xfs_filestream_flush(mp);
-               xfs_sync(mp, SYNC_DATA_QUIESCE);
-               xfs_attr_quiesce(mp);
-               mp->m_flags |= XFS_MOUNT_RDONLY;
-       }
-       return 0;
-}
-
 /*
  * xfs_unmount_flush implements a set of flush operation on special
  * inodes, which are needed as a separate set of operations so that
@@ -1048,7 +444,7 @@ xfs_sync_inodes(
 
                if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) {
                        XFS_MOUNT_IUNLOCK(mp);
-                       kmem_free(ipointer, sizeof(xfs_iptr_t));
+                       kmem_free(ipointer);
                        return 0;
                }
 
@@ -1194,7 +590,7 @@ xfs_sync_inodes(
                        }
                        XFS_MOUNT_IUNLOCK(mp);
                        ASSERT(ipointer_in == B_FALSE);
-                       kmem_free(ipointer, sizeof(xfs_iptr_t));
+                       kmem_free(ipointer);
                        return XFS_ERROR(error);
                }
 
@@ -1224,7 +620,7 @@ xfs_sync_inodes(
 
        ASSERT(ipointer_in == B_FALSE);
 
-       kmem_free(ipointer, sizeof(xfs_iptr_t));
+       kmem_free(ipointer);
        return XFS_ERROR(last_error);
 }
 
index 1688817c55ed358adeb13a31a04acf05486040a5..a74b05087da480244620fdd512102eee02976c7c 100644 (file)
@@ -8,11 +8,6 @@ struct kstatfs;
 struct xfs_mount;
 struct xfs_mount_args;
 
-int xfs_mount(struct xfs_mount *mp, struct xfs_mount_args *args,
-               struct cred *credp);
-int xfs_unmount(struct xfs_mount *mp, int flags, struct cred *credp);
-int xfs_mntupdate(struct xfs_mount *mp, int *flags,
-               struct xfs_mount_args *args);
 int xfs_sync(struct xfs_mount *mp, int flags);
 void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
                int lnnum);
index e475e3717eb3cf114a61a6cbbe4f2339df5d4a7d..76a1166af8227ac0b45715986bcad98daa469c87 100644 (file)
@@ -75,26 +75,23 @@ xfs_open(
        return 0;
 }
 
-/*
- * xfs_setattr
- */
 int
 xfs_setattr(
-       xfs_inode_t             *ip,
-       bhv_vattr_t             *vap,
+       struct xfs_inode        *ip,
+       struct iattr            *iattr,
        int                     flags,
        cred_t                  *credp)
 {
        xfs_mount_t             *mp = ip->i_mount;
+       struct inode            *inode = XFS_ITOV(ip);
+       int                     mask = iattr->ia_valid;
        xfs_trans_t             *tp;
-       int                     mask;
        int                     code;
        uint                    lock_flags;
        uint                    commit_flags=0;
        uid_t                   uid=0, iuid=0;
        gid_t                   gid=0, igid=0;
        int                     timeflags = 0;
-       xfs_prid_t              projid=0, iprojid=0;
        struct xfs_dquot        *udqp, *gdqp, *olddquot1, *olddquot2;
        int                     file_owner;
        int                     need_iolock = 1;
@@ -104,30 +101,9 @@ xfs_setattr(
        if (mp->m_flags & XFS_MOUNT_RDONLY)
                return XFS_ERROR(EROFS);
 
-       /*
-        * Cannot set certain attributes.
-        */
-       mask = vap->va_mask;
-       if (mask & XFS_AT_NOSET) {
-               return XFS_ERROR(EINVAL);
-       }
-
        if (XFS_FORCED_SHUTDOWN(mp))
                return XFS_ERROR(EIO);
 
-       /*
-        * Timestamps do not need to be logged and hence do not
-        * need to be done within a transaction.
-        */
-       if (mask & XFS_AT_UPDTIMES) {
-               ASSERT((mask & ~XFS_AT_UPDTIMES) == 0);
-               timeflags = ((mask & XFS_AT_UPDATIME) ? XFS_ICHGTIME_ACC : 0) |
-                           ((mask & XFS_AT_UPDCTIME) ? XFS_ICHGTIME_CHG : 0) |
-                           ((mask & XFS_AT_UPDMTIME) ? XFS_ICHGTIME_MOD : 0);
-               xfs_ichgtime(ip, timeflags);
-               return 0;
-       }
-
        olddquot1 = olddquot2 = NULL;
        udqp = gdqp = NULL;
 
@@ -139,28 +115,22 @@ xfs_setattr(
         * If the IDs do change before we take the ilock, we're covered
         * because the i_*dquot fields will get updated anyway.
         */
-       if (XFS_IS_QUOTA_ON(mp) &&
-           (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID))) {
+       if (XFS_IS_QUOTA_ON(mp) && (mask & (ATTR_UID|ATTR_GID))) {
                uint    qflags = 0;
 
-               if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) {
-                       uid = vap->va_uid;
+               if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp)) {
+                       uid = iattr->ia_uid;
                        qflags |= XFS_QMOPT_UQUOTA;
                } else {
                        uid = ip->i_d.di_uid;
                }
-               if ((mask & XFS_AT_GID) && XFS_IS_GQUOTA_ON(mp)) {
-                       gid = vap->va_gid;
+               if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp)) {
+                       gid = iattr->ia_gid;
                        qflags |= XFS_QMOPT_GQUOTA;
                }  else {
                        gid = ip->i_d.di_gid;
                }
-               if ((mask & XFS_AT_PROJID) && XFS_IS_PQUOTA_ON(mp)) {
-                       projid = vap->va_projid;
-                       qflags |= XFS_QMOPT_PQUOTA;
-               }  else {
-                       projid = ip->i_d.di_projid;
-               }
+
                /*
                 * We take a reference when we initialize udqp and gdqp,
                 * so it is important that we never blindly double trip on
@@ -168,8 +138,8 @@ xfs_setattr(
                 */
                ASSERT(udqp == NULL);
                ASSERT(gdqp == NULL);
-               code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, projid, qflags,
-                                        &udqp, &gdqp);
+               code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, ip->i_d.di_projid,
+                                        qflags, &udqp, &gdqp);
                if (code)
                        return code;
        }
@@ -180,10 +150,10 @@ xfs_setattr(
         */
        tp = NULL;
        lock_flags = XFS_ILOCK_EXCL;
-       if (flags & ATTR_NOLOCK)
+       if (flags & XFS_ATTR_NOLOCK)
                need_iolock = 0;
-       if (!(mask & XFS_AT_SIZE)) {
-               if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) ||
+       if (!(mask & ATTR_SIZE)) {
+               if ((mask != (ATTR_CTIME|ATTR_ATIME|ATTR_MTIME)) ||
                    (mp->m_flags & XFS_MOUNT_WSYNC)) {
                        tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE);
                        commit_flags = 0;
@@ -196,10 +166,10 @@ xfs_setattr(
                }
        } else {
                if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) &&
-                   !(flags & ATTR_DMI)) {
+                   !(flags & XFS_ATTR_DMI)) {
                        int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR;
                        code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, ip,
-                               vap->va_size, 0, dmflags, NULL);
+                               iattr->ia_size, 0, dmflags, NULL);
                        if (code) {
                                lock_flags = 0;
                                goto error_return;
@@ -219,9 +189,7 @@ xfs_setattr(
         * Only the owner or users with CAP_FOWNER
         * capability may do these things.
         */
-       if (mask &
-           (XFS_AT_MODE|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_UID|
-            XFS_AT_GID|XFS_AT_PROJID)) {
+       if (mask & (ATTR_MODE|ATTR_UID|ATTR_GID)) {
                /*
                 * CAP_FOWNER overrides the following restrictions:
                 *
@@ -245,21 +213,21 @@ xfs_setattr(
                 * IDs of the calling process shall match the group owner of
                 * the file when setting the set-group-ID bit on that file
                 */
-               if (mask & XFS_AT_MODE) {
+               if (mask & ATTR_MODE) {
                        mode_t m = 0;
 
-                       if ((vap->va_mode & S_ISUID) && !file_owner)
+                       if ((iattr->ia_mode & S_ISUID) && !file_owner)
                                m |= S_ISUID;
-                       if ((vap->va_mode & S_ISGID) &&
+                       if ((iattr->ia_mode & S_ISGID) &&
                            !in_group_p((gid_t)ip->i_d.di_gid))
                                m |= S_ISGID;
 #if 0
                        /* Linux allows this, Irix doesn't. */
-                       if ((vap->va_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode))
+                       if ((iattr->ia_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode))
                                m |= S_ISVTX;
 #endif
                        if (m && !capable(CAP_FSETID))
-                               vap->va_mode &= ~m;
+                               iattr->ia_mode &= ~m;
                }
        }
 
@@ -270,7 +238,7 @@ xfs_setattr(
         * and can change the group id only to a group of which he
         * or she is a member.
         */
-       if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) {
+       if (mask & (ATTR_UID|ATTR_GID)) {
                /*
                 * These IDs could have changed since we last looked at them.
                 * But, we're assured that if the ownership did change
@@ -278,12 +246,9 @@ xfs_setattr(
                 * would have changed also.
                 */
                iuid = ip->i_d.di_uid;
-               iprojid = ip->i_d.di_projid;
                igid = ip->i_d.di_gid;
-               gid = (mask & XFS_AT_GID) ? vap->va_gid : igid;
-               uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid;
-               projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid :
-                        iprojid;
+               gid = (mask & ATTR_GID) ? iattr->ia_gid : igid;
+               uid = (mask & ATTR_UID) ? iattr->ia_uid : iuid;
 
                /*
                 * CAP_CHOWN overrides the following restrictions:
@@ -303,11 +268,10 @@ xfs_setattr(
                        goto error_return;
                }
                /*
-                * Do a quota reservation only if uid/projid/gid is actually
+                * Do a quota reservation only if uid/gid is actually
                 * going to change.
                 */
                if ((XFS_IS_UQUOTA_ON(mp) && iuid != uid) ||
-                   (XFS_IS_PQUOTA_ON(mp) && iprojid != projid) ||
                    (XFS_IS_GQUOTA_ON(mp) && igid != gid)) {
                        ASSERT(tp);
                        code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp,
@@ -321,13 +285,13 @@ xfs_setattr(
        /*
         * Truncate file.  Must have write permission and not be a directory.
         */
-       if (mask & XFS_AT_SIZE) {
+       if (mask & ATTR_SIZE) {
                /* Short circuit the truncate case for zero length files */
-               if ((vap->va_size == 0) &&
-                  (ip->i_size == 0) && (ip->i_d.di_nextents == 0)) {
+               if (iattr->ia_size == 0 &&
+                   ip->i_size == 0 && ip->i_d.di_nextents == 0) {
                        xfs_iunlock(ip, XFS_ILOCK_EXCL);
                        lock_flags &= ~XFS_ILOCK_EXCL;
-                       if (mask & XFS_AT_CTIME)
+                       if (mask & ATTR_CTIME)
                                xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
                        code = 0;
                        goto error_return;
@@ -350,9 +314,9 @@ xfs_setattr(
        /*
         * Change file access or modified times.
         */
-       if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) {
+       if (mask & (ATTR_ATIME|ATTR_MTIME)) {
                if (!file_owner) {
-                       if ((flags & ATTR_UTIME) &&
+                       if ((mask & (ATTR_MTIME_SET|ATTR_ATIME_SET)) &&
                            !capable(CAP_FOWNER)) {
                                code = XFS_ERROR(EPERM);
                                goto error_return;
@@ -360,91 +324,24 @@ xfs_setattr(
                }
        }
 
-       /*
-        * Change extent size or realtime flag.
-        */
-       if (mask & (XFS_AT_EXTSIZE|XFS_AT_XFLAGS)) {
-               /*
-                * Can't change extent size if any extents are allocated.
-                */
-               if (ip->i_d.di_nextents && (mask & XFS_AT_EXTSIZE) &&
-                   ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) !=
-                    vap->va_extsize) ) {
-                       code = XFS_ERROR(EINVAL);       /* EFBIG? */
-                       goto error_return;
-               }
-
-               /*
-                * Can't change realtime flag if any extents are allocated.
-                */
-               if ((ip->i_d.di_nextents || ip->i_delayed_blks) &&
-                   (mask & XFS_AT_XFLAGS) &&
-                   (XFS_IS_REALTIME_INODE(ip)) !=
-                   (vap->va_xflags & XFS_XFLAG_REALTIME)) {
-                       code = XFS_ERROR(EINVAL);       /* EFBIG? */
-                       goto error_return;
-               }
-               /*
-                * Extent size must be a multiple of the appropriate block
-                * size, if set at all.
-                */
-               if ((mask & XFS_AT_EXTSIZE) && vap->va_extsize != 0) {
-                       xfs_extlen_t    size;
-
-                       if (XFS_IS_REALTIME_INODE(ip) ||
-                           ((mask & XFS_AT_XFLAGS) &&
-                           (vap->va_xflags & XFS_XFLAG_REALTIME))) {
-                               size = mp->m_sb.sb_rextsize <<
-                                      mp->m_sb.sb_blocklog;
-                       } else {
-                               size = mp->m_sb.sb_blocksize;
-                       }
-                       if (vap->va_extsize % size) {
-                               code = XFS_ERROR(EINVAL);
-                               goto error_return;
-                       }
-               }
-               /*
-                * If realtime flag is set then must have realtime data.
-                */
-               if ((mask & XFS_AT_XFLAGS) &&
-                   (vap->va_xflags & XFS_XFLAG_REALTIME)) {
-                       if ((mp->m_sb.sb_rblocks == 0) ||
-                           (mp->m_sb.sb_rextsize == 0) ||
-                           (ip->i_d.di_extsize % mp->m_sb.sb_rextsize)) {
-                               code = XFS_ERROR(EINVAL);
-                               goto error_return;
-                       }
-               }
-
-               /*
-                * Can't modify an immutable/append-only file unless
-                * we have appropriate permission.
-                */
-               if ((mask & XFS_AT_XFLAGS) &&
-                   (ip->i_d.di_flags &
-                               (XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) ||
-                    (vap->va_xflags &
-                               (XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) &&
-                   !capable(CAP_LINUX_IMMUTABLE)) {
-                       code = XFS_ERROR(EPERM);
-                       goto error_return;
-               }
-       }
-
        /*
         * Now we can make the changes.  Before we join the inode
-        * to the transaction, if XFS_AT_SIZE is set then take care of
+        * to the transaction, if ATTR_SIZE is set then take care of
         * the part of the truncation that must be done without the
         * inode lock.  This needs to be done before joining the inode
         * to the transaction, because the inode cannot be unlocked
         * once it is a part of the transaction.
         */
-       if (mask & XFS_AT_SIZE) {
+       if (mask & ATTR_SIZE) {
                code = 0;
-               if ((vap->va_size > ip->i_size) &&
-                   (flags & ATTR_NOSIZETOK) == 0) {
-                       code = xfs_igrow_start(ip, vap->va_size, credp);
+               if (iattr->ia_size > ip->i_size) {
+                       /*
+                        * Do the first part of growing a file: zero any data
+                        * in the last block that is beyond the old EOF.  We
+                        * need to do this before the inode is joined to the
+                        * transaction to modify the i_size.
+                        */
+                       code = xfs_zero_eof(ip, iattr->ia_size, ip->i_size);
                }
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
@@ -461,10 +358,10 @@ xfs_setattr(
                 * not within the range we care about here.
                 */
                if (!code &&
-                   (ip->i_size != ip->i_d.di_size) &&
-                   (vap->va_size > ip->i_d.di_size)) {
+                   ip->i_size != ip->i_d.di_size &&
+                   iattr->ia_size > ip->i_d.di_size) {
                        code = xfs_flush_pages(ip,
-                                       ip->i_d.di_size, vap->va_size,
+                                       ip->i_d.di_size, iattr->ia_size,
                                        XFS_B_ASYNC, FI_NONE);
                }
 
@@ -472,7 +369,7 @@ xfs_setattr(
                vn_iowait(ip);
 
                if (!code)
-                       code = xfs_itruncate_data(ip, vap->va_size);
+                       code = xfs_itruncate_data(ip, iattr->ia_size);
                if (code) {
                        ASSERT(tp == NULL);
                        lock_flags &= ~XFS_ILOCK_EXCL;
@@ -501,28 +398,30 @@ xfs_setattr(
        /*
         * Truncate file.  Must have write permission and not be a directory.
         */
-       if (mask & XFS_AT_SIZE) {
+       if (mask & ATTR_SIZE) {
                /*
                 * Only change the c/mtime if we are changing the size
                 * or we are explicitly asked to change it. This handles
                 * the semantic difference between truncate() and ftruncate()
                 * as implemented in the VFS.
                 */
-               if (vap->va_size != ip->i_size || (mask & XFS_AT_CTIME))
+               if (iattr->ia_size != ip->i_size || (mask & ATTR_CTIME))
                        timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG;
 
-               if (vap->va_size > ip->i_size) {
-                       xfs_igrow_finish(tp, ip, vap->va_size,
-                           !(flags & ATTR_DMI));
-               } else if ((vap->va_size <= ip->i_size) ||
-                          ((vap->va_size == 0) && ip->i_d.di_nextents)) {
+               if (iattr->ia_size > ip->i_size) {
+                       ip->i_d.di_size = iattr->ia_size;
+                       ip->i_size = iattr->ia_size;
+                       if (!(flags & XFS_ATTR_DMI))
+                               xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
+                       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+               } else if (iattr->ia_size <= ip->i_size ||
+                          (iattr->ia_size == 0 && ip->i_d.di_nextents)) {
                        /*
                         * signal a sync transaction unless
                         * we're truncating an already unlinked
                         * file on a wsync filesystem
                         */
-                       code = xfs_itruncate_finish(&tp, ip,
-                                           (xfs_fsize_t)vap->va_size,
+                       code = xfs_itruncate_finish(&tp, ip, iattr->ia_size,
                                            XFS_DATA_FORK,
                                            ((ip->i_d.di_nlink != 0 ||
                                              !(mp->m_flags & XFS_MOUNT_WSYNC))
@@ -544,9 +443,12 @@ xfs_setattr(
        /*
         * Change file access modes.
         */
-       if (mask & XFS_AT_MODE) {
+       if (mask & ATTR_MODE) {
                ip->i_d.di_mode &= S_IFMT;
-               ip->i_d.di_mode |= vap->va_mode & ~S_IFMT;
+               ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT;
+
+               inode->i_mode &= S_IFMT;
+               inode->i_mode |= iattr->ia_mode & ~S_IFMT;
 
                xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE);
                timeflags |= XFS_ICHGTIME_CHG;
@@ -559,7 +461,7 @@ xfs_setattr(
         * and can change the group id only to a group of which he
         * or she is a member.
         */
-       if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) {
+       if (mask & (ATTR_UID|ATTR_GID)) {
                /*
                 * CAP_FSETID overrides the following restrictions:
                 *
@@ -577,39 +479,24 @@ xfs_setattr(
                 */
                if (iuid != uid) {
                        if (XFS_IS_UQUOTA_ON(mp)) {
-                               ASSERT(mask & XFS_AT_UID);
+                               ASSERT(mask & ATTR_UID);
                                ASSERT(udqp);
                                olddquot1 = XFS_QM_DQVOPCHOWN(mp, tp, ip,
                                                        &ip->i_udquot, udqp);
                        }
                        ip->i_d.di_uid = uid;
+                       inode->i_uid = uid;
                }
                if (igid != gid) {
                        if (XFS_IS_GQUOTA_ON(mp)) {
                                ASSERT(!XFS_IS_PQUOTA_ON(mp));
-                               ASSERT(mask & XFS_AT_GID);
+                               ASSERT(mask & ATTR_GID);
                                ASSERT(gdqp);
                                olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip,
                                                        &ip->i_gdquot, gdqp);
                        }
                        ip->i_d.di_gid = gid;
-               }
-               if (iprojid != projid) {
-                       if (XFS_IS_PQUOTA_ON(mp)) {
-                               ASSERT(!XFS_IS_GQUOTA_ON(mp));
-                               ASSERT(mask & XFS_AT_PROJID);
-                               ASSERT(gdqp);
-                               olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip,
-                                                       &ip->i_gdquot, gdqp);
-                       }
-                       ip->i_d.di_projid = projid;
-                       /*
-                        * We may have to rev the inode as well as
-                        * the superblock version number since projids didn't
-                        * exist before DINODE_VERSION_2 and SB_VERSION_NLINK.
-                        */
-                       if (ip->i_d.di_version == XFS_DINODE_VERSION_1)
-                               xfs_bump_ino_vers2(tp, ip);
+                       inode->i_gid = gid;
                }
 
                xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE);
@@ -620,82 +507,34 @@ xfs_setattr(
        /*
         * Change file access or modified times.
         */
-       if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) {
-               if (mask & XFS_AT_ATIME) {
-                       ip->i_d.di_atime.t_sec = vap->va_atime.tv_sec;
-                       ip->i_d.di_atime.t_nsec = vap->va_atime.tv_nsec;
+       if (mask & (ATTR_ATIME|ATTR_MTIME)) {
+               if (mask & ATTR_ATIME) {
+                       inode->i_atime = iattr->ia_atime;
+                       ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec;
+                       ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec;
                        ip->i_update_core = 1;
                        timeflags &= ~XFS_ICHGTIME_ACC;
                }
-               if (mask & XFS_AT_MTIME) {
-                       ip->i_d.di_mtime.t_sec = vap->va_mtime.tv_sec;
-                       ip->i_d.di_mtime.t_nsec = vap->va_mtime.tv_nsec;
+               if (mask & ATTR_MTIME) {
+                       inode->i_mtime = iattr->ia_mtime;
+                       ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec;
+                       ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec;
                        timeflags &= ~XFS_ICHGTIME_MOD;
                        timeflags |= XFS_ICHGTIME_CHG;
                }
-               if (tp && (flags & ATTR_UTIME))
+               if (tp && (mask & (ATTR_MTIME_SET|ATTR_ATIME_SET)))
                        xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE);
        }
 
        /*
-        * Change XFS-added attributes.
-        */
-       if (mask & (XFS_AT_EXTSIZE|XFS_AT_XFLAGS)) {
-               if (mask & XFS_AT_EXTSIZE) {
-                       /*
-                        * Converting bytes to fs blocks.
-                        */
-                       ip->i_d.di_extsize = vap->va_extsize >>
-                               mp->m_sb.sb_blocklog;
-               }
-               if (mask & XFS_AT_XFLAGS) {
-                       uint    di_flags;
-
-                       /* can't set PREALLOC this way, just preserve it */
-                       di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
-                       if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)
-                               di_flags |= XFS_DIFLAG_IMMUTABLE;
-                       if (vap->va_xflags & XFS_XFLAG_APPEND)
-                               di_flags |= XFS_DIFLAG_APPEND;
-                       if (vap->va_xflags & XFS_XFLAG_SYNC)
-                               di_flags |= XFS_DIFLAG_SYNC;
-                       if (vap->va_xflags & XFS_XFLAG_NOATIME)
-                               di_flags |= XFS_DIFLAG_NOATIME;
-                       if (vap->va_xflags & XFS_XFLAG_NODUMP)
-                               di_flags |= XFS_DIFLAG_NODUMP;
-                       if (vap->va_xflags & XFS_XFLAG_PROJINHERIT)
-                               di_flags |= XFS_DIFLAG_PROJINHERIT;
-                       if (vap->va_xflags & XFS_XFLAG_NODEFRAG)
-                               di_flags |= XFS_DIFLAG_NODEFRAG;
-                       if (vap->va_xflags & XFS_XFLAG_FILESTREAM)
-                               di_flags |= XFS_DIFLAG_FILESTREAM;
-                       if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
-                               if (vap->va_xflags & XFS_XFLAG_RTINHERIT)
-                                       di_flags |= XFS_DIFLAG_RTINHERIT;
-                               if (vap->va_xflags & XFS_XFLAG_NOSYMLINKS)
-                                       di_flags |= XFS_DIFLAG_NOSYMLINKS;
-                               if (vap->va_xflags & XFS_XFLAG_EXTSZINHERIT)
-                                       di_flags |= XFS_DIFLAG_EXTSZINHERIT;
-                       } else if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) {
-                               if (vap->va_xflags & XFS_XFLAG_REALTIME)
-                                       di_flags |= XFS_DIFLAG_REALTIME;
-                               if (vap->va_xflags & XFS_XFLAG_EXTSIZE)
-                                       di_flags |= XFS_DIFLAG_EXTSIZE;
-                       }
-                       ip->i_d.di_flags = di_flags;
-               }
-               xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-               timeflags |= XFS_ICHGTIME_CHG;
-       }
-
-       /*
-        * Change file inode change time only if XFS_AT_CTIME set
+        * Change file inode change time only if ATTR_CTIME set
         * AND we have been called by a DMI function.
         */
 
-       if ( (flags & ATTR_DMI) && (mask & XFS_AT_CTIME) ) {
-               ip->i_d.di_ctime.t_sec = vap->va_ctime.tv_sec;
-               ip->i_d.di_ctime.t_nsec = vap->va_ctime.tv_nsec;
+       if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) {
+               inode->i_ctime = iattr->ia_ctime;
+               ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec;
+               ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec;
                ip->i_update_core = 1;
                timeflags &= ~XFS_ICHGTIME_CHG;
        }
@@ -704,7 +543,7 @@ xfs_setattr(
         * Send out timestamp changes that need to be set to the
         * current time.  Not done when called by a DMI function.
         */
-       if (timeflags && !(flags & ATTR_DMI))
+       if (timeflags && !(flags & XFS_ATTR_DMI))
                xfs_ichgtime(ip, timeflags);
 
        XFS_STATS_INC(xs_ig_attrchg);
@@ -742,7 +581,7 @@ xfs_setattr(
        }
 
        if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) &&
-           !(flags & ATTR_DMI)) {
+           !(flags & XFS_ATTR_DMI)) {
                (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL,
                                        NULL, DM_RIGHT_NULL, NULL, NULL,
                                        0, 0, AT_DELAY_FLAG(flags));
@@ -1601,12 +1440,18 @@ xfs_inactive(
        return VN_INACTIVE_CACHE;
 }
 
-
+/*
+ * Lookups up an inode from "name". If ci_name is not NULL, then a CI match
+ * is allowed, otherwise it has to be an exact match. If a CI match is found,
+ * ci_name->name will point to a the actual name (caller must free) or
+ * will be set to NULL if an exact match is found.
+ */
 int
 xfs_lookup(
        xfs_inode_t             *dp,
        struct xfs_name         *name,
-       xfs_inode_t             **ipp)
+       xfs_inode_t             **ipp,
+       struct xfs_name         *ci_name)
 {
        xfs_ino_t               inum;
        int                     error;
@@ -1618,7 +1463,7 @@ xfs_lookup(
                return XFS_ERROR(EIO);
 
        lock_mode = xfs_ilock_map_shared(dp);
-       error = xfs_dir_lookup(NULL, dp, name, &inum);
+       error = xfs_dir_lookup(NULL, dp, name, &inum, ci_name);
        xfs_iunlock_map_shared(dp, lock_mode);
 
        if (error)
@@ -1626,12 +1471,15 @@ xfs_lookup(
 
        error = xfs_iget(dp->i_mount, NULL, inum, 0, 0, ipp, 0);
        if (error)
-               goto out;
+               goto out_free_name;
 
        xfs_itrace_ref(*ipp);
        return 0;
 
- out:
+out_free_name:
+       if (ci_name)
+               kmem_free(ci_name->name);
+out:
        *ipp = NULL;
        return error;
 }
@@ -2098,13 +1946,6 @@ again:
 #endif
 }
 
-#ifdef DEBUG
-#define        REMOVE_DEBUG_TRACE(x)   {remove_which_error_return = (x);}
-int remove_which_error_return = 0;
-#else /* ! DEBUG */
-#define        REMOVE_DEBUG_TRACE(x)
-#endif /* ! DEBUG */
-
 int
 xfs_remove(
        xfs_inode_t             *dp,
@@ -2113,6 +1954,7 @@ xfs_remove(
 {
        xfs_mount_t             *mp = dp->i_mount;
        xfs_trans_t             *tp = NULL;
+       int                     is_dir = S_ISDIR(ip->i_d.di_mode);
        int                     error = 0;
        xfs_bmap_free_t         free_list;
        xfs_fsblock_t           first_block;
@@ -2120,8 +1962,10 @@ xfs_remove(
        int                     committed;
        int                     link_zero;
        uint                    resblks;
+       uint                    log_count;
 
        xfs_itrace_entry(dp);
+       xfs_itrace_entry(ip);
 
        if (XFS_FORCED_SHUTDOWN(mp))
                return XFS_ERROR(EIO);
@@ -2134,19 +1978,23 @@ xfs_remove(
                        return error;
        }
 
-       xfs_itrace_entry(ip);
-       xfs_itrace_ref(ip);
-
        error = XFS_QM_DQATTACH(mp, dp, 0);
-       if (!error)
-               error = XFS_QM_DQATTACH(mp, ip, 0);
-       if (error) {
-               REMOVE_DEBUG_TRACE(__LINE__);
+       if (error)
+               goto std_return;
+
+       error = XFS_QM_DQATTACH(mp, ip, 0);
+       if (error)
                goto std_return;
-       }
 
-       tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE);
+       if (is_dir) {
+               tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR);
+               log_count = XFS_DEFAULT_LOG_COUNT;
+       } else {
+               tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE);
+               log_count = XFS_REMOVE_LOG_COUNT;
+       }
        cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
+
        /*
         * We try to get the real space reservation first,
         * allowing for directory btree deletion(s) implying
@@ -2158,25 +2006,21 @@ xfs_remove(
         */
        resblks = XFS_REMOVE_SPACE_RES(mp);
        error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0,
-                       XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT);
+                                 XFS_TRANS_PERM_LOG_RES, log_count);
        if (error == ENOSPC) {
                resblks = 0;
                error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0,
-                               XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT);
+                                         XFS_TRANS_PERM_LOG_RES, log_count);
        }
        if (error) {
                ASSERT(error != ENOSPC);
-               REMOVE_DEBUG_TRACE(__LINE__);
-               xfs_trans_cancel(tp, 0);
-               return error;
+               cancel_flags = 0;
+               goto out_trans_cancel;
        }
 
        error = xfs_lock_dir_and_entry(dp, ip);
-       if (error) {
-               REMOVE_DEBUG_TRACE(__LINE__);
-               xfs_trans_cancel(tp, cancel_flags);
-               goto std_return;
-       }
+       if (error)
+               goto out_trans_cancel;
 
        /*
         * At this point, we've gotten both the directory and the entry
@@ -2188,6 +2032,21 @@ xfs_remove(
        IHOLD(dp);
        xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 
+       /*
+        * If we're removing a directory perform some additional validation.
+        */
+       if (is_dir) {
+               ASSERT(ip->i_d.di_nlink >= 2);
+               if (ip->i_d.di_nlink != 2) {
+                       error = XFS_ERROR(ENOTEMPTY);
+                       goto out_trans_cancel;
+               }
+               if (!xfs_dir_isempty(ip)) {
+                       error = XFS_ERROR(ENOTEMPTY);
+                       goto out_trans_cancel;
+               }
+       }
+
        /*
         * Entry must exist since we did a lookup in xfs_lock_dir_and_entry.
         */
@@ -2196,39 +2055,64 @@ xfs_remove(
                                        &first_block, &free_list, resblks);
        if (error) {
                ASSERT(error != ENOENT);
-               REMOVE_DEBUG_TRACE(__LINE__);
-               goto error1;
+               goto out_bmap_cancel;
        }
        xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
 
+       /*
+        * Bump the in memory generation count on the parent
+        * directory so that other can know that it has changed.
+        */
        dp->i_gen++;
        xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
 
-       error = xfs_droplink(tp, ip);
-       if (error) {
-               REMOVE_DEBUG_TRACE(__LINE__);
-               goto error1;
+       if (is_dir) {
+               /*
+                * Drop the link from ip's "..".
+                */
+               error = xfs_droplink(tp, dp);
+               if (error)
+                       goto out_bmap_cancel;
+
+               /*
+                * Drop the link from dp to ip.
+                */
+               error = xfs_droplink(tp, ip);
+               if (error)
+                       goto out_bmap_cancel;
+       } else {
+               /*
+                * When removing a non-directory we need to log the parent
+                * inode here for the i_gen update.  For a directory this is
+                * done implicitly by the xfs_droplink call for the ".." entry.
+                */
+               xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
        }
 
-       /* Determine if this is the last link while
+       /*
+        * Drop the "." link from ip to self.
+        */
+       error = xfs_droplink(tp, ip);
+       if (error)
+               goto out_bmap_cancel;
+
+       /*
+        * Determine if this is the last link while
         * we are in the transaction.
         */
-       link_zero = (ip)->i_d.di_nlink==0;
+       link_zero = (ip->i_d.di_nlink == 0);
 
        /*
         * If this is a synchronous mount, make sure that the
         * remove transaction goes to disk before returning to
         * the user.
         */
-       if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) {
+       if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
                xfs_trans_set_sync(tp);
-       }
 
        error = xfs_bmap_finish(&tp, &free_list, &committed);
-       if (error) {
-               REMOVE_DEBUG_TRACE(__LINE__);
-               goto error_rele;
-       }
+       if (error)
+               goto out_bmap_cancel;
 
        error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
        if (error)
@@ -2240,38 +2124,26 @@ xfs_remove(
         * will get killed on last close in xfs_close() so we don't
         * have to worry about that.
         */
-       if (link_zero && xfs_inode_is_filestream(ip))
+       if (!is_dir && link_zero && xfs_inode_is_filestream(ip))
                xfs_filestream_deassociate(ip);
 
        xfs_itrace_exit(ip);
+       xfs_itrace_exit(dp);
 
-/*     Fall through to std_return with error = 0 */
  std_return:
        if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) {
-               (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE,
-                               dp, DM_RIGHT_NULL,
-                               NULL, DM_RIGHT_NULL,
-                               name->name, NULL, ip->i_d.di_mode, error, 0);
+               XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dp, DM_RIGHT_NULL,
+                               NULL, DM_RIGHT_NULL, name->name, NULL,
+                               ip->i_d.di_mode, error, 0);
        }
-       return error;
 
- error1:
-       xfs_bmap_cancel(&free_list);
-       cancel_flags |= XFS_TRANS_ABORT;
-       xfs_trans_cancel(tp, cancel_flags);
-       goto std_return;
+       return error;
 
- error_rele:
-       /*
-        * In this case make sure to not release the inode until after
-        * the current transaction is aborted.  Releasing it beforehand
-        * can cause us to go to xfs_inactive and start a recursive
-        * transaction which can easily deadlock with the current one.
-        */
+ out_bmap_cancel:
        xfs_bmap_cancel(&free_list);
        cancel_flags |= XFS_TRANS_ABORT;
+ out_trans_cancel:
        xfs_trans_cancel(tp, cancel_flags);
-
        goto std_return;
 }
 
@@ -2637,186 +2509,6 @@ std_return:
        goto std_return;
 }
 
-int
-xfs_rmdir(
-       xfs_inode_t             *dp,
-       struct xfs_name         *name,
-       xfs_inode_t             *cdp)
-{
-       xfs_mount_t             *mp = dp->i_mount;
-       xfs_trans_t             *tp;
-       int                     error;
-       xfs_bmap_free_t         free_list;
-       xfs_fsblock_t           first_block;
-       int                     cancel_flags;
-       int                     committed;
-       int                     last_cdp_link;
-       uint                    resblks;
-
-       xfs_itrace_entry(dp);
-
-       if (XFS_FORCED_SHUTDOWN(mp))
-               return XFS_ERROR(EIO);
-
-       if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) {
-               error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE,
-                                       dp, DM_RIGHT_NULL,
-                                       NULL, DM_RIGHT_NULL, name->name,
-                                       NULL, cdp->i_d.di_mode, 0, 0);
-               if (error)
-                       return XFS_ERROR(error);
-       }
-
-       /*
-        * Get the dquots for the inodes.
-        */
-       error = XFS_QM_DQATTACH(mp, dp, 0);
-       if (!error)
-               error = XFS_QM_DQATTACH(mp, cdp, 0);
-       if (error) {
-               REMOVE_DEBUG_TRACE(__LINE__);
-               goto std_return;
-       }
-
-       tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR);
-       cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
-       /*
-        * We try to get the real space reservation first,
-        * allowing for directory btree deletion(s) implying
-        * possible bmap insert(s).  If we can't get the space
-        * reservation then we use 0 instead, and avoid the bmap
-        * btree insert(s) in the directory code by, if the bmap
-        * insert tries to happen, instead trimming the LAST
-        * block from the directory.
-        */
-       resblks = XFS_REMOVE_SPACE_RES(mp);
-       error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0,
-                       XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT);
-       if (error == ENOSPC) {
-               resblks = 0;
-               error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0,
-                               XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT);
-       }
-       if (error) {
-               ASSERT(error != ENOSPC);
-               cancel_flags = 0;
-               goto error_return;
-       }
-       XFS_BMAP_INIT(&free_list, &first_block);
-
-       /*
-        * Now lock the child directory inode and the parent directory
-        * inode in the proper order.  This will take care of validating
-        * that the directory entry for the child directory inode has
-        * not changed while we were obtaining a log reservation.
-        */
-       error = xfs_lock_dir_and_entry(dp, cdp);
-       if (error) {
-               xfs_trans_cancel(tp, cancel_flags);
-               goto std_return;
-       }
-
-       IHOLD(dp);
-       xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
-
-       IHOLD(cdp);
-       xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL);
-
-       ASSERT(cdp->i_d.di_nlink >= 2);
-       if (cdp->i_d.di_nlink != 2) {
-               error = XFS_ERROR(ENOTEMPTY);
-               goto error_return;
-       }
-       if (!xfs_dir_isempty(cdp)) {
-               error = XFS_ERROR(ENOTEMPTY);
-               goto error_return;
-       }
-
-       error = xfs_dir_removename(tp, dp, name, cdp->i_ino,
-                                       &first_block, &free_list, resblks);
-       if (error)
-               goto error1;
-
-       xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-
-       /*
-        * Bump the in memory generation count on the parent
-        * directory so that other can know that it has changed.
-        */
-       dp->i_gen++;
-
-       /*
-        * Drop the link from cdp's "..".
-        */
-       error = xfs_droplink(tp, dp);
-       if (error) {
-               goto error1;
-       }
-
-       /*
-        * Drop the link from dp to cdp.
-        */
-       error = xfs_droplink(tp, cdp);
-       if (error) {
-               goto error1;
-       }
-
-       /*
-        * Drop the "." link from cdp to self.
-        */
-       error = xfs_droplink(tp, cdp);
-       if (error) {
-               goto error1;
-       }
-
-       /* Determine these before committing transaction */
-       last_cdp_link = (cdp)->i_d.di_nlink==0;
-
-       /*
-        * If this is a synchronous mount, make sure that the
-        * rmdir transaction goes to disk before returning to
-        * the user.
-        */
-       if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) {
-               xfs_trans_set_sync(tp);
-       }
-
-       error = xfs_bmap_finish (&tp, &free_list, &committed);
-       if (error) {
-               xfs_bmap_cancel(&free_list);
-               xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES |
-                                XFS_TRANS_ABORT));
-               goto std_return;
-       }
-
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
-       if (error) {
-               goto std_return;
-       }
-
-
-       /* Fall through to std_return with error = 0 or the errno
-        * from xfs_trans_commit. */
- std_return:
-       if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) {
-               (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE,
-                                       dp, DM_RIGHT_NULL,
-                                       NULL, DM_RIGHT_NULL,
-                                       name->name, NULL, cdp->i_d.di_mode,
-                                       error, 0);
-       }
-       return error;
-
- error1:
-       xfs_bmap_cancel(&free_list);
-       cancel_flags |= XFS_TRANS_ABORT;
-       /* FALLTHROUGH */
-
- error_return:
-       xfs_trans_cancel(tp, cancel_flags);
-       goto std_return;
-}
-
 int
 xfs_symlink(
        xfs_inode_t             *dp,
@@ -3242,7 +2934,6 @@ xfs_finish_reclaim(
 {
        xfs_perag_t     *pag = xfs_get_perag(ip->i_mount, ip->i_ino);
        bhv_vnode_t     *vp = XFS_ITOV_NULL(ip);
-       int             error;
 
        if (vp && VN_BAD(vp))
                goto reclaim;
@@ -3285,29 +2976,16 @@ xfs_finish_reclaim(
                xfs_iflock(ip);
        }
 
-       if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
-               if (ip->i_update_core ||
-                   ((ip->i_itemp != NULL) &&
-                    (ip->i_itemp->ili_format.ilf_fields != 0))) {
-                       error = xfs_iflush(ip, sync_mode);
-                       /*
-                        * If we hit an error, typically because of filesystem
-                        * shutdown, we don't need to let vn_reclaim to know
-                        * because we're gonna reclaim the inode anyway.
-                        */
-                       if (error) {
-                               xfs_iunlock(ip, XFS_ILOCK_EXCL);
-                               goto reclaim;
-                       }
-                       xfs_iflock(ip); /* synchronize with xfs_iflush_done */
-               }
-
-               ASSERT(ip->i_update_core == 0);
-               ASSERT(ip->i_itemp == NULL ||
-                      ip->i_itemp->ili_format.ilf_fields == 0);
+       /*
+        * In the case of a forced shutdown we rely on xfs_iflush() to
+        * wait for the inode to be unpinned before returning an error.
+        */
+       if (xfs_iflush(ip, sync_mode) == 0) {
+               /* synchronize with xfs_iflush_done */
+               xfs_iflock(ip);
+               xfs_ifunlock(ip);
        }
 
-       xfs_ifunlock(ip);
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
  reclaim:
@@ -3418,7 +3096,7 @@ xfs_alloc_file_space(
 
        /*      Generate a DMAPI event if needed.       */
        if (alloc_type != 0 && offset < ip->i_size &&
-                       (attr_flags&ATTR_DMI) == 0  &&
+                       (attr_flags & XFS_ATTR_DMI) == 0  &&
                        DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) {
                xfs_off_t           end_dmi_offset;
 
@@ -3532,7 +3210,7 @@ retry:
                allocatesize_fsb -= allocated_fsb;
        }
 dmapi_enospc_check:
-       if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 &&
+       if (error == ENOSPC && (attr_flags & XFS_ATTR_DMI) == 0 &&
            DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) {
                error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE,
                                ip, DM_RIGHT_NULL,
@@ -3679,7 +3357,7 @@ xfs_free_file_space(
        end_dmi_offset = offset + len;
        endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset);
 
-       if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 &&
+       if (offset < ip->i_size && (attr_flags & XFS_ATTR_DMI) == 0 &&
            DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) {
                if (end_dmi_offset > ip->i_size)
                        end_dmi_offset = ip->i_size;
@@ -3690,7 +3368,7 @@ xfs_free_file_space(
                        return error;
        }
 
-       if (attr_flags & ATTR_NOLOCK)
+       if (attr_flags & XFS_ATTR_NOLOCK)
                need_iolock = 0;
        if (need_iolock) {
                xfs_ilock(ip, XFS_IOLOCK_EXCL);
@@ -3867,7 +3545,7 @@ xfs_change_file_space(
        xfs_off_t       startoffset;
        xfs_off_t       llen;
        xfs_trans_t     *tp;
-       bhv_vattr_t     va;
+       struct iattr    iattr;
 
        xfs_itrace_entry(ip);
 
@@ -3941,10 +3619,10 @@ xfs_change_file_space(
                                break;
                }
 
-               va.va_mask = XFS_AT_SIZE;
-               va.va_size = startoffset;
+               iattr.ia_valid = ATTR_SIZE;
+               iattr.ia_size = startoffset;
 
-               error = xfs_setattr(ip, &va, attr_flags, credp);
+               error = xfs_setattr(ip, &iattr, attr_flags, credp);
 
                if (error)
                        return error;
@@ -3974,7 +3652,7 @@ xfs_change_file_space(
        xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
        xfs_trans_ihold(tp, ip);
 
-       if ((attr_flags & ATTR_DMI) == 0) {
+       if ((attr_flags & XFS_ATTR_DMI) == 0) {
                ip->i_d.di_mode &= ~S_ISUID;
 
                /*
index 57335ba4ce53b7e975b3accb0c5876ce464cc940..e932a96bec54994615819245a277fb7ca4cfe8fb 100644 (file)
@@ -2,9 +2,9 @@
 #define _XFS_VNODEOPS_H 1
 
 struct attrlist_cursor_kern;
-struct bhv_vattr;
 struct cred;
 struct file;
+struct iattr;
 struct inode;
 struct iovec;
 struct kiocb;
@@ -15,14 +15,18 @@ struct xfs_iomap;
 
 
 int xfs_open(struct xfs_inode *ip);
-int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags,
+int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags,
                struct cred *credp);
+#define        XFS_ATTR_DMI            0x01    /* invocation from a DMI function */
+#define        XFS_ATTR_NONBLOCK       0x02    /* return EAGAIN if operation would block */
+#define XFS_ATTR_NOLOCK                0x04    /* Don't grab any conflicting locks */
+
 int xfs_readlink(struct xfs_inode *ip, char *link);
 int xfs_fsync(struct xfs_inode *ip);
 int xfs_release(struct xfs_inode *ip);
 int xfs_inactive(struct xfs_inode *ip);
 int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name,
-               struct xfs_inode **ipp);
+               struct xfs_inode **ipp, struct xfs_name *ci_name);
 int xfs_create(struct xfs_inode *dp, struct xfs_name *name, mode_t mode,
                xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp);
 int xfs_remove(struct xfs_inode *dp, struct xfs_name *name,
@@ -31,8 +35,6 @@ int xfs_link(struct xfs_inode *tdp, struct xfs_inode *sip,
                struct xfs_name *target_name);
 int xfs_mkdir(struct xfs_inode *dp, struct xfs_name *dir_name,
                mode_t mode, struct xfs_inode **ipp, struct cred *credp);
-int xfs_rmdir(struct xfs_inode *dp, struct xfs_name *name,
-               struct xfs_inode *cdp);
 int xfs_readdir(struct xfs_inode       *dp, void *dirent, size_t bufsize,
                       xfs_off_t *offset, filldir_t filldir);
 int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name,
diff --git a/include/asm-arm/Kbuild b/include/asm-arm/Kbuild
deleted file mode 100644 (file)
index 73237bd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-include include/asm-generic/Kbuild.asm
-
-unifdef-y += hwcap.h
diff --git a/include/asm-arm/a.out-core.h b/include/asm-arm/a.out-core.h
deleted file mode 100644 (file)
index 93d04ac..0000000
+++ /dev/null
@@ -1,49 +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>
-#include <linux/elfcore.h>
-
-/*
- * fill in the user structure for an a.out core dump
- */
-static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
-{
-       struct task_struct *tsk = current;
-
-       dump->magic = CMAGIC;
-       dump->start_code = tsk->mm->start_code;
-       dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
-
-       dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
-       dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       dump->u_ssize = 0;
-
-       dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;
-       dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
-       dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
-       dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
-       dump->u_debugreg[4] = tsk->thread.debug.nsaved;
-
-       if (dump->start_stack < 0x04000000)
-               dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
-
-       dump->regs = *regs;
-       dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
deleted file mode 100644 (file)
index 79489fd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __ARM_A_OUT_H__
-#define __ARM_A_OUT_H__
-
-#include <linux/personality.h>
-#include <asm/types.h>
-
-struct exec
-{
-  __u32 a_info;                /* Use macros N_MAGIC, etc for access */
-  __u32 a_text;                /* length of text, in bytes */
-  __u32 a_data;                /* length of data, in bytes */
-  __u32 a_bss;         /* length of uninitialized data area for file, in bytes */
-  __u32 a_syms;                /* length of symbol table data in file, in bytes */
-  __u32 a_entry;       /* start address */
-  __u32 a_trsize;      /* length of relocation info for text, in bytes */
-  __u32 a_drsize;      /* length of relocation info for data, in bytes */
-};
-
-/*
- * This is always the same
- */
-#define N_TXTADDR(a)   (0x00008000)
-
-#define N_TRSIZE(a)    ((a).a_trsize)
-#define N_DRSIZE(a)    ((a).a_drsize)
-#define N_SYMSIZE(a)   ((a).a_syms)
-
-#define M_ARM 103
-
-#ifndef LIBRARY_START_TEXT
-#define LIBRARY_START_TEXT     (0x00c00000)
-#endif
-
-#endif /* __A_OUT_GNU_H__ */
index b21b93eb2dbca21e20a42ba6ef447bc3a8b0ceb4..94680950ee6744ec78b68087d4861d62324e2da4 100644 (file)
@@ -9,7 +9,7 @@
  */
 #include <asm/hardware.h>
 
-#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
+#include <asm/arch/regs-board-a9m9750dev.h>
 
                .macro  addruart,rx
                mrc     p15, 0, \rx, c1, c0
index 89a21c530468a4773916d92727ae4401fc501bd1..2f6c89ddf958cf60d152274cd551f6f4158bc5ec 100644 (file)
@@ -9,7 +9,7 @@
  * the Free Software Foundation.
  */
 #include <asm/hardware.h>
-#include <asm/arch-ns9xxx/regs-sys-common.h>
+#include <asm/arch/regs-sys-common.h>
 
                .macro  get_irqnr_preamble, base, tmp
                ldr     \base, =SYS_ISRADDR
index f7b53b65de8199af284734422138bf2aa076ab5c..3137e5ba01a9fa9501ec95a8744b8a288878d186 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __ASM_ARCH_PROCESSOR_H
 #define __ASM_ARCH_PROCESSOR_H
 
-#include <asm/arch-ns9xxx/module.h>
+#include <asm/arch/module.h>
 
 #define processor_is_ns9210()  (0                      \
                || module_is_cc7ucamry()                \
index 1348073afe48f0258331170f77df724eec02c6d5..c2941684d667b7db97233dbcb589bb593883bee6 100644 (file)
@@ -12,8 +12,8 @@
 #define __ASM_ARCH_SYSTEM_H
 
 #include <asm/proc-fns.h>
-#include <asm/arch-ns9xxx/processor.h>
-#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch/processor.h>
+#include <asm/arch/processor-ns9360.h>
 
 static inline void arch_idle(void)
 {
index db44c5d1f1a0490d8f309530553c22685c20c897..99564c70f128e1c20f942c5152527a4d528218af 100644 (file)
@@ -154,7 +154,7 @@ struct omap_version_config {
 };
 
 
-#include <asm-arm/arch-omap/board-nokia.h>
+#include <asm/arch/board-nokia.h>
 
 struct omap_board_config_entry {
        u16 tag;
diff --git a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h
deleted file mode 100644 (file)
index 911393b..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *  linux/include/asm-arm/assembler.h
- *
- *  Copyright (C) 1996-2000 Russell King
- *
- * 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.
- *
- *  This file contains arm architecture specific defines
- *  for the different processors.
- *
- *  Do not include any C declarations in this file - it is included by
- *  assembler source.
- */
-#ifndef __ASSEMBLY__
-#error "Only include this from assembly code"
-#endif
-
-#include <asm/ptrace.h>
-
-/*
- * Endian independent macros for shifting bytes within registers.
- */
-#ifndef __ARMEB__
-#define pull            lsr
-#define push            lsl
-#define get_byte_0      lsl #0
-#define get_byte_1     lsr #8
-#define get_byte_2     lsr #16
-#define get_byte_3     lsr #24
-#define put_byte_0      lsl #0
-#define put_byte_1     lsl #8
-#define put_byte_2     lsl #16
-#define put_byte_3     lsl #24
-#else
-#define pull            lsl
-#define push            lsr
-#define get_byte_0     lsr #24
-#define get_byte_1     lsr #16
-#define get_byte_2     lsr #8
-#define get_byte_3      lsl #0
-#define put_byte_0     lsl #24
-#define put_byte_1     lsl #16
-#define put_byte_2     lsl #8
-#define put_byte_3      lsl #0
-#endif
-
-/*
- * Data preload for architectures that support it
- */
-#if __LINUX_ARM_ARCH__ >= 5
-#define PLD(code...)   code
-#else
-#define PLD(code...)
-#endif
-
-/*
- * This can be used to enable code to cacheline align the destination
- * pointer when bulk writing to memory.  Experiments on StrongARM and
- * XScale didn't show this a worthwhile thing to do when the cache is not
- * set to write-allocate (this would need further testing on XScale when WA
- * is used).
- *
- * On Feroceon there is much to gain however, regardless of cache mode.
- */
-#ifdef CONFIG_CPU_FEROCEON
-#define CALGN(code...) code
-#else
-#define CALGN(code...)
-#endif
-
-/*
- * Enable and disable interrupts
- */
-#if __LINUX_ARM_ARCH__ >= 6
-       .macro  disable_irq
-       cpsid   i
-       .endm
-
-       .macro  enable_irq
-       cpsie   i
-       .endm
-#else
-       .macro  disable_irq
-       msr     cpsr_c, #PSR_I_BIT | SVC_MODE
-       .endm
-
-       .macro  enable_irq
-       msr     cpsr_c, #SVC_MODE
-       .endm
-#endif
-
-/*
- * Save the current IRQ state and disable IRQs.  Note that this macro
- * assumes FIQs are enabled, and that the processor is in SVC mode.
- */
-       .macro  save_and_disable_irqs, oldcpsr
-       mrs     \oldcpsr, cpsr
-       disable_irq
-       .endm
-
-/*
- * Restore interrupt state previously stored in a register.  We don't
- * guarantee that this will preserve the flags.
- */
-       .macro  restore_irqs, oldcpsr
-       msr     cpsr_c, \oldcpsr
-       .endm
-
-#define USER(x...)                             \
-9999:  x;                                      \
-       .section __ex_table,"a";                \
-       .align  3;                              \
-       .long   9999b,9001f;                    \
-       .previous
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
deleted file mode 100644 (file)
index 3b59f94..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *  linux/include/asm-arm/atomic.h
- *
- *  Copyright (C) 1996 Russell King.
- *  Copyright (C) 2002 Deep Blue Solutions Ltd.
- *
- * 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.
- */
-#ifndef __ASM_ARM_ATOMIC_H
-#define __ASM_ARM_ATOMIC_H
-
-#include <linux/compiler.h>
-#include <asm/system.h>
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-#ifdef __KERNEL__
-
-#define atomic_read(v) ((v)->counter)
-
-#if __LINUX_ARM_ARCH__ >= 6
-
-/*
- * ARMv6 UP and SMP safe atomic ops.  We use load exclusive and
- * store exclusive to ensure that these are atomic.  We may loop
- * to ensure that the update happens.  Writing to 'v->counter'
- * without using the following operations WILL break the atomic
- * nature of these ops.
- */
-static inline void atomic_set(atomic_t *v, int i)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__("@ atomic_set\n"
-"1:    ldrex   %0, [%1]\n"
-"      strex   %0, %2, [%1]\n"
-"      teq     %0, #0\n"
-"      bne     1b"
-       : "=&r" (tmp)
-       : "r" (&v->counter), "r" (i)
-       : "cc");
-}
-
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       unsigned long tmp;
-       int result;
-
-       __asm__ __volatile__("@ atomic_add_return\n"
-"1:    ldrex   %0, [%2]\n"
-"      add     %0, %0, %3\n"
-"      strex   %1, %0, [%2]\n"
-"      teq     %1, #0\n"
-"      bne     1b"
-       : "=&r" (result), "=&r" (tmp)
-       : "r" (&v->counter), "Ir" (i)
-       : "cc");
-
-       return result;
-}
-
-static inline int atomic_sub_return(int i, atomic_t *v)
-{
-       unsigned long tmp;
-       int result;
-
-       __asm__ __volatile__("@ atomic_sub_return\n"
-"1:    ldrex   %0, [%2]\n"
-"      sub     %0, %0, %3\n"
-"      strex   %1, %0, [%2]\n"
-"      teq     %1, #0\n"
-"      bne     1b"
-       : "=&r" (result), "=&r" (tmp)
-       : "r" (&v->counter), "Ir" (i)
-       : "cc");
-
-       return result;
-}
-
-static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
-{
-       unsigned long oldval, res;
-
-       do {
-               __asm__ __volatile__("@ atomic_cmpxchg\n"
-               "ldrex  %1, [%2]\n"
-               "mov    %0, #0\n"
-               "teq    %1, %3\n"
-               "strexeq %0, %4, [%2]\n"
-                   : "=&r" (res), "=&r" (oldval)
-                   : "r" (&ptr->counter), "Ir" (old), "r" (new)
-                   : "cc");
-       } while (res);
-
-       return oldval;
-}
-
-static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
-{
-       unsigned long tmp, tmp2;
-
-       __asm__ __volatile__("@ atomic_clear_mask\n"
-"1:    ldrex   %0, [%2]\n"
-"      bic     %0, %0, %3\n"
-"      strex   %1, %0, [%2]\n"
-"      teq     %1, #0\n"
-"      bne     1b"
-       : "=&r" (tmp), "=&r" (tmp2)
-       : "r" (addr), "Ir" (mask)
-       : "cc");
-}
-
-#else /* ARM_ARCH_6 */
-
-#include <asm/system.h>
-
-#ifdef CONFIG_SMP
-#error SMP not supported on pre-ARMv6 CPUs
-#endif
-
-#define atomic_set(v,i)        (((v)->counter) = (i))
-
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       unsigned long flags;
-       int val;
-
-       raw_local_irq_save(flags);
-       val = v->counter;
-       v->counter = val += i;
-       raw_local_irq_restore(flags);
-
-       return val;
-}
-
-static inline int atomic_sub_return(int i, atomic_t *v)
-{
-       unsigned long flags;
-       int val;
-
-       raw_local_irq_save(flags);
-       val = v->counter;
-       v->counter = val -= i;
-       raw_local_irq_restore(flags);
-
-       return val;
-}
-
-static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-{
-       int ret;
-       unsigned long flags;
-
-       raw_local_irq_save(flags);
-       ret = v->counter;
-       if (likely(ret == old))
-               v->counter = new;
-       raw_local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
-{
-       unsigned long flags;
-
-       raw_local_irq_save(flags);
-       *addr &= ~mask;
-       raw_local_irq_restore(flags);
-}
-
-#endif /* __LINUX_ARM_ARCH__ */
-
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int c, old;
-
-       c = atomic_read(v);
-       while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
-               c = old;
-       return c != u;
-}
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
-#define atomic_add(i, v)       (void) atomic_add_return(i, v)
-#define atomic_inc(v)          (void) atomic_add_return(1, v)
-#define atomic_sub(i, v)       (void) atomic_sub_return(i, v)
-#define atomic_dec(v)          (void) atomic_sub_return(1, v)
-
-#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
-#define atomic_inc_return(v)    (atomic_add_return(1, v))
-#define atomic_dec_return(v)    (atomic_sub_return(1, v))
-#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
-
-#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
-
-/* Atomic operations are already serializing on ARM */
-#define smp_mb__before_atomic_dec()    barrier()
-#define smp_mb__after_atomic_dec()     barrier()
-#define smp_mb__before_atomic_inc()    barrier()
-#define smp_mb__after_atomic_inc()     barrier()
-
-#include <asm-generic/atomic.h>
-#endif
-#endif
diff --git a/include/asm-arm/auxvec.h b/include/asm-arm/auxvec.h
deleted file mode 100644 (file)
index c0536f6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_AUXVEC_H
-#define __ASMARM_AUXVEC_H
-
-#endif
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
deleted file mode 100644 (file)
index 9a1db20..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright 1995, Russell King.
- * Various bits and pieces copyrights include:
- *  Linus Torvalds (test_bit).
- * Big endian support: Copyright 2001, Nicolas Pitre
- *  reworked by rmk.
- *
- * bit 0 is the LSB of an "unsigned long" quantity.
- *
- * Please note that the code in this file should never be included
- * from user space.  Many of these are not implemented in assembler
- * since they would be too costly.  Also, they require privileged
- * instructions (which are not available from user mode) to ensure
- * that they are atomic.
- */
-
-#ifndef __ASM_ARM_BITOPS_H
-#define __ASM_ARM_BITOPS_H
-
-#ifdef __KERNEL__
-
-#ifndef _LINUX_BITOPS_H
-#error only <linux/bitops.h> can be included directly
-#endif
-
-#include <linux/compiler.h>
-#include <asm/system.h>
-
-#define smp_mb__before_clear_bit()     mb()
-#define smp_mb__after_clear_bit()      mb()
-
-/*
- * These functions are the basis of our bit ops.
- *
- * First, the atomic bitops. These use native endian.
- */
-static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       *p |= mask;
-       raw_local_irq_restore(flags);
-}
-
-static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       *p &= ~mask;
-       raw_local_irq_restore(flags);
-}
-
-static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       *p ^= mask;
-       raw_local_irq_restore(flags);
-}
-
-static inline int
-____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned int res;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       res = *p;
-       *p = res | mask;
-       raw_local_irq_restore(flags);
-
-       return res & mask;
-}
-
-static inline int
-____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned int res;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       res = *p;
-       *p = res & ~mask;
-       raw_local_irq_restore(flags);
-
-       return res & mask;
-}
-
-static inline int
-____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
-{
-       unsigned long flags;
-       unsigned int res;
-       unsigned long mask = 1UL << (bit & 31);
-
-       p += bit >> 5;
-
-       raw_local_irq_save(flags);
-       res = *p;
-       *p = res ^ mask;
-       raw_local_irq_restore(flags);
-
-       return res & mask;
-}
-
-#include <asm-generic/bitops/non-atomic.h>
-
-/*
- *  A note about Endian-ness.
- *  -------------------------
- *
- * When the ARM is put into big endian mode via CR15, the processor
- * merely swaps the order of bytes within words, thus:
- *
- *          ------------ physical data bus bits -----------
- *          D31 ... D24  D23 ... D16  D15 ... D8  D7 ... D0
- * little     byte 3       byte 2       byte 1      byte 0
- * big        byte 0       byte 1       byte 2      byte 3
- *
- * This means that reading a 32-bit word at address 0 returns the same
- * value irrespective of the endian mode bit.
- *
- * Peripheral devices should be connected with the data bus reversed in
- * "Big Endian" mode.  ARM Application Note 61 is applicable, and is
- * available from http://www.arm.com/.
- *
- * The following assumes that the data bus connectivity for big endian
- * mode has been followed.
- *
- * Note that bit 0 is defined to be 32-bit word bit 0, not byte 0 bit 0.
- */
-
-/*
- * Little endian assembly bitops.  nr = 0 -> byte 0 bit 0.
- */
-extern void _set_bit_le(int nr, volatile unsigned long * p);
-extern void _clear_bit_le(int nr, volatile unsigned long * p);
-extern void _change_bit_le(int nr, volatile unsigned long * p);
-extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
-extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
-extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
-extern int _find_first_zero_bit_le(const void * p, unsigned size);
-extern int _find_next_zero_bit_le(const void * p, int size, int offset);
-extern int _find_first_bit_le(const unsigned long *p, unsigned size);
-extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
-
-/*
- * Big endian assembly bitops.  nr = 0 -> byte 3 bit 0.
- */
-extern void _set_bit_be(int nr, volatile unsigned long * p);
-extern void _clear_bit_be(int nr, volatile unsigned long * p);
-extern void _change_bit_be(int nr, volatile unsigned long * p);
-extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
-extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
-extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
-extern int _find_first_zero_bit_be(const void * p, unsigned size);
-extern int _find_next_zero_bit_be(const void * p, int size, int offset);
-extern int _find_first_bit_be(const unsigned long *p, unsigned size);
-extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
-
-#ifndef CONFIG_SMP
-/*
- * The __* form of bitops are non-atomic and may be reordered.
- */
-#define        ATOMIC_BITOP_LE(name,nr,p)              \
-       (__builtin_constant_p(nr) ?             \
-        ____atomic_##name(nr, p) :             \
-        _##name##_le(nr,p))
-
-#define        ATOMIC_BITOP_BE(name,nr,p)              \
-       (__builtin_constant_p(nr) ?             \
-        ____atomic_##name(nr, p) :             \
-        _##name##_be(nr,p))
-#else
-#define ATOMIC_BITOP_LE(name,nr,p)     _##name##_le(nr,p)
-#define ATOMIC_BITOP_BE(name,nr,p)     _##name##_be(nr,p)
-#endif
-
-#define NONATOMIC_BITOP(name,nr,p)             \
-       (____nonatomic_##name(nr, p))
-
-#ifndef __ARMEB__
-/*
- * These are the little endian, atomic definitions.
- */
-#define set_bit(nr,p)                  ATOMIC_BITOP_LE(set_bit,nr,p)
-#define clear_bit(nr,p)                        ATOMIC_BITOP_LE(clear_bit,nr,p)
-#define change_bit(nr,p)               ATOMIC_BITOP_LE(change_bit,nr,p)
-#define test_and_set_bit(nr,p)         ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
-#define test_and_clear_bit(nr,p)       ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
-#define test_and_change_bit(nr,p)      ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
-#define find_first_zero_bit(p,sz)      _find_first_zero_bit_le(p,sz)
-#define find_next_zero_bit(p,sz,off)   _find_next_zero_bit_le(p,sz,off)
-#define find_first_bit(p,sz)           _find_first_bit_le(p,sz)
-#define find_next_bit(p,sz,off)                _find_next_bit_le(p,sz,off)
-
-#define WORD_BITOFF_TO_LE(x)           ((x))
-
-#else
-
-/*
- * These are the big endian, atomic definitions.
- */
-#define set_bit(nr,p)                  ATOMIC_BITOP_BE(set_bit,nr,p)
-#define clear_bit(nr,p)                        ATOMIC_BITOP_BE(clear_bit,nr,p)
-#define change_bit(nr,p)               ATOMIC_BITOP_BE(change_bit,nr,p)
-#define test_and_set_bit(nr,p)         ATOMIC_BITOP_BE(test_and_set_bit,nr,p)
-#define test_and_clear_bit(nr,p)       ATOMIC_BITOP_BE(test_and_clear_bit,nr,p)
-#define test_and_change_bit(nr,p)      ATOMIC_BITOP_BE(test_and_change_bit,nr,p)
-#define find_first_zero_bit(p,sz)      _find_first_zero_bit_be(p,sz)
-#define find_next_zero_bit(p,sz,off)   _find_next_zero_bit_be(p,sz,off)
-#define find_first_bit(p,sz)           _find_first_bit_be(p,sz)
-#define find_next_bit(p,sz,off)                _find_next_bit_be(p,sz,off)
-
-#define WORD_BITOFF_TO_LE(x)           ((x) ^ 0x18)
-
-#endif
-
-#if __LINUX_ARM_ARCH__ < 5
-
-#include <asm-generic/bitops/ffz.h>
-#include <asm-generic/bitops/__ffs.h>
-#include <asm-generic/bitops/fls.h>
-#include <asm-generic/bitops/ffs.h>
-
-#else
-
-static inline int constant_fls(int x)
-{
-       int r = 32;
-
-       if (!x)
-               return 0;
-       if (!(x & 0xffff0000u)) {
-               x <<= 16;
-               r -= 16;
-       }
-       if (!(x & 0xff000000u)) {
-               x <<= 8;
-               r -= 8;
-       }
-       if (!(x & 0xf0000000u)) {
-               x <<= 4;
-               r -= 4;
-       }
-       if (!(x & 0xc0000000u)) {
-               x <<= 2;
-               r -= 2;
-       }
-       if (!(x & 0x80000000u)) {
-               x <<= 1;
-               r -= 1;
-       }
-       return r;
-}
-
-/*
- * On ARMv5 and above those functions can be implemented around
- * the clz instruction for much better code efficiency.
- */
-
-#define __fls(x) \
-       ( __builtin_constant_p(x) ? constant_fls(x) : \
-         ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
-
-/* Implement fls() in C so that 64-bit args are suitably truncated */
-static inline int fls(int x)
-{
-       return __fls(x);
-}
-
-#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
-#define __ffs(x) (ffs(x) - 1)
-#define ffz(x) __ffs( ~(x) )
-
-#endif
-
-#include <asm-generic/bitops/fls64.h>
-
-#include <asm-generic/bitops/sched.h>
-#include <asm-generic/bitops/hweight.h>
-#include <asm-generic/bitops/lock.h>
-
-/*
- * Ext2 is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define ext2_set_bit(nr,p)                     \
-               __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_set_bit_atomic(lock,nr,p)          \
-                test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_clear_bit(nr,p)                   \
-               __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_clear_bit_atomic(lock,nr,p)        \
-                test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_test_bit(nr,p)                    \
-               test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_find_first_zero_bit(p,sz)         \
-               _find_first_zero_bit_le(p,sz)
-#define ext2_find_next_zero_bit(p,sz,off)      \
-               _find_next_zero_bit_le(p,sz,off)
-#define ext2_find_next_bit(p, sz, off) \
-               _find_next_bit_le(p, sz, off)
-
-/*
- * Minix is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define minix_set_bit(nr,p)                    \
-               __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_bit(nr,p)                   \
-               test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_and_set_bit(nr,p)           \
-               __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_and_clear_bit(nr,p)         \
-               __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_find_first_zero_bit(p,sz)                \
-               _find_first_zero_bit_le(p,sz)
-
-#endif /* __KERNEL__ */
-
-#endif /* _ARM_BITOPS_H */
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
deleted file mode 100644 (file)
index 7b62351..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASMARM_BUG_H
-#define _ASMARM_BUG_H
-
-
-#ifdef CONFIG_BUG
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-extern void __bug(const char *file, int line) __attribute__((noreturn));
-
-/* give file/line information */
-#define BUG()          __bug(__FILE__, __LINE__)
-
-#else
-
-/* this just causes an oops */
-#define BUG()          (*(int *)0 = 0)
-
-#endif
-
-#define HAVE_ARCH_BUG
-#endif
-
-#include <asm-generic/bug.h>
-
-#endif
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h
deleted file mode 100644 (file)
index ca54eb0..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  linux/include/asm-arm/bugs.h
- *
- *  Copyright (C) 1995-2003 Russell King
- *
- * 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.
- */
-#ifndef __ASM_BUGS_H
-#define __ASM_BUGS_H
-
-#ifdef CONFIG_MMU
-extern void check_writebuffer_bugs(void);
-
-#define check_bugs() check_writebuffer_bugs()
-#else
-#define check_bugs() do { } while (0)
-#endif
-
-#endif
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
deleted file mode 100644 (file)
index e6f7fcd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *  linux/include/asm-arm/byteorder.h
- *
- * ARM Endian-ness.  In little endian mode, the data bus is connected such
- * that byte accesses appear as:
- *  0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
- * and word accesses (data or instruction) appear as:
- *  d0...d31
- *
- * When in big endian mode, byte accesses appear as:
- *  0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
- * and word accesses (data or instruction) appear as:
- *  d0...d31
- */
-#ifndef __ASM_ARM_BYTEORDER_H
-#define __ASM_ARM_BYTEORDER_H
-
-#include <linux/compiler.h>
-#include <asm/types.h>
-
-static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
-{
-       __u32 t;
-
-#ifndef __thumb__
-       if (!__builtin_constant_p(x)) {
-               /*
-                * The compiler needs a bit of a hint here to always do the
-                * right thing and not screw it up to different degrees
-                * depending on the gcc version.
-                */
-               asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
-       } else
-#endif
-               t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
-
-       x = (x << 24) | (x >> 8);               /* mov r0,r0,ror #8      */
-       t &= ~0x00FF0000;                       /* bic r1,r1,#0x00FF0000 */
-       x ^= (t >> 8);                          /* eor r0,r0,r1,lsr #8   */
-
-       return x;
-}
-
-#define __arch__swab32(x) ___arch__swab32(x)
-
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
-
-#ifdef __ARMEB__
-#include <linux/byteorder/big_endian.h>
-#else
-#include <linux/byteorder/little_endian.h>
-#endif
-
-#endif
-
diff --git a/include/asm-arm/cache.h b/include/asm-arm/cache.h
deleted file mode 100644 (file)
index 31332c8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  linux/include/asm-arm/cache.h
- */
-#ifndef __ASMARM_CACHE_H
-#define __ASMARM_CACHE_H
-
-#define L1_CACHE_SHIFT         5
-#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
-
-#endif
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
deleted file mode 100644 (file)
index e68a1cb..0000000
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- *  linux/include/asm-arm/cacheflush.h
- *
- *  Copyright (C) 1999-2002 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_CACHEFLUSH_H
-#define _ASMARM_CACHEFLUSH_H
-
-#include <linux/sched.h>
-#include <linux/mm.h>
-
-#include <asm/glue.h>
-#include <asm/shmparam.h>
-
-#define CACHE_COLOUR(vaddr)    ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
-
-/*
- *     Cache Model
- *     ===========
- */
-#undef _CACHE
-#undef MULTI_CACHE
-
-#if defined(CONFIG_CPU_CACHE_V3)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE v3
-# endif
-#endif
-
-#if defined(CONFIG_CPU_CACHE_V4)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE v4
-# endif
-#endif
-
-#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
-    defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020)
-# define MULTI_CACHE 1
-#endif
-
-#if defined(CONFIG_CPU_ARM926T)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE arm926
-# endif
-#endif
-
-#if defined(CONFIG_CPU_ARM940T)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE arm940
-# endif
-#endif
-
-#if defined(CONFIG_CPU_ARM946E)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE arm946
-# endif
-#endif
-
-#if defined(CONFIG_CPU_CACHE_V4WB)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE v4wb
-# endif
-#endif
-
-#if defined(CONFIG_CPU_XSCALE)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE xscale
-# endif
-#endif
-
-#if defined(CONFIG_CPU_XSC3)
-# ifdef _CACHE
-#  define MULTI_CACHE 1
-# else
-#  define _CACHE xsc3
-# endif
-#endif
-
-#if defined(CONFIG_CPU_FEROCEON)
-# define MULTI_CACHE 1
-#endif
-
-#if defined(CONFIG_CPU_V6)
-//# ifdef _CACHE
-#  define MULTI_CACHE 1
-//# else
-//#  define _CACHE v6
-//# endif
-#endif
-
-#if defined(CONFIG_CPU_V7)
-//# ifdef _CACHE
-#  define MULTI_CACHE 1
-//# else
-//#  define _CACHE v7
-//# endif
-#endif
-
-#if !defined(_CACHE) && !defined(MULTI_CACHE)
-#error Unknown cache maintainence model
-#endif
-
-/*
- * This flag is used to indicate that the page pointed to by a pte
- * is dirty and requires cleaning before returning it to the user.
- */
-#define PG_dcache_dirty PG_arch_1
-
-/*
- *     MM Cache Management
- *     ===================
- *
- *     The arch/arm/mm/cache-*.S and arch/arm/mm/proc-*.S files
- *     implement these methods.
- *
- *     Start addresses are inclusive and end addresses are exclusive;
- *     start addresses should be rounded down, end addresses up.
- *
- *     See Documentation/cachetlb.txt for more information.
- *     Please note that the implementation of these, and the required
- *     effects are cache-type (VIVT/VIPT/PIPT) specific.
- *
- *     flush_cache_kern_all()
- *
- *             Unconditionally clean and invalidate the entire cache.
- *
- *     flush_cache_user_mm(mm)
- *
- *             Clean and invalidate all user space cache entries
- *             before a change of page tables.
- *
- *     flush_cache_user_range(start, end, flags)
- *
- *             Clean and invalidate a range of cache entries in the
- *             specified address space before a change of page tables.
- *             - start - user start address (inclusive, page aligned)
- *             - end   - user end address   (exclusive, page aligned)
- *             - flags - vma->vm_flags field
- *
- *     coherent_kern_range(start, end)
- *
- *             Ensure coherency between the Icache and the Dcache in the
- *             region described by start, end.  If you have non-snooping
- *             Harvard caches, you need to implement this function.
- *             - start  - virtual start address
- *             - end    - virtual end address
- *
- *     DMA Cache Coherency
- *     ===================
- *
- *     dma_inv_range(start, end)
- *
- *             Invalidate (discard) the specified virtual address range.
- *             May not write back any entries.  If 'start' or 'end'
- *             are not cache line aligned, those lines must be written
- *             back.
- *             - start  - virtual start address
- *             - end    - virtual end address
- *
- *     dma_clean_range(start, end)
- *
- *             Clean (write back) the specified virtual address range.
- *             - start  - virtual start address
- *             - end    - virtual end address
- *
- *     dma_flush_range(start, end)
- *
- *             Clean and invalidate the specified virtual address range.
- *             - start  - virtual start address
- *             - end    - virtual end address
- */
-
-struct cpu_cache_fns {
-       void (*flush_kern_all)(void);
-       void (*flush_user_all)(void);
-       void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
-
-       void (*coherent_kern_range)(unsigned long, unsigned long);
-       void (*coherent_user_range)(unsigned long, unsigned long);
-       void (*flush_kern_dcache_page)(void *);
-
-       void (*dma_inv_range)(const void *, const void *);
-       void (*dma_clean_range)(const void *, const void *);
-       void (*dma_flush_range)(const void *, const void *);
-};
-
-struct outer_cache_fns {
-       void (*inv_range)(unsigned long, unsigned long);
-       void (*clean_range)(unsigned long, unsigned long);
-       void (*flush_range)(unsigned long, unsigned long);
-};
-
-/*
- * Select the calling method
- */
-#ifdef MULTI_CACHE
-
-extern struct cpu_cache_fns cpu_cache;
-
-#define __cpuc_flush_kern_all          cpu_cache.flush_kern_all
-#define __cpuc_flush_user_all          cpu_cache.flush_user_all
-#define __cpuc_flush_user_range                cpu_cache.flush_user_range
-#define __cpuc_coherent_kern_range     cpu_cache.coherent_kern_range
-#define __cpuc_coherent_user_range     cpu_cache.coherent_user_range
-#define __cpuc_flush_dcache_page       cpu_cache.flush_kern_dcache_page
-
-/*
- * These are private to the dma-mapping API.  Do not use directly.
- * Their sole purpose is to ensure that data held in the cache
- * is visible to DMA, or data written by DMA to system memory is
- * visible to the CPU.
- */
-#define dmac_inv_range                 cpu_cache.dma_inv_range
-#define dmac_clean_range               cpu_cache.dma_clean_range
-#define dmac_flush_range               cpu_cache.dma_flush_range
-
-#else
-
-#define __cpuc_flush_kern_all          __glue(_CACHE,_flush_kern_cache_all)
-#define __cpuc_flush_user_all          __glue(_CACHE,_flush_user_cache_all)
-#define __cpuc_flush_user_range                __glue(_CACHE,_flush_user_cache_range)
-#define __cpuc_coherent_kern_range     __glue(_CACHE,_coherent_kern_range)
-#define __cpuc_coherent_user_range     __glue(_CACHE,_coherent_user_range)
-#define __cpuc_flush_dcache_page       __glue(_CACHE,_flush_kern_dcache_page)
-
-extern void __cpuc_flush_kern_all(void);
-extern void __cpuc_flush_user_all(void);
-extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int);
-extern void __cpuc_coherent_kern_range(unsigned long, unsigned long);
-extern void __cpuc_coherent_user_range(unsigned long, unsigned long);
-extern void __cpuc_flush_dcache_page(void *);
-
-/*
- * These are private to the dma-mapping API.  Do not use directly.
- * Their sole purpose is to ensure that data held in the cache
- * is visible to DMA, or data written by DMA to system memory is
- * visible to the CPU.
- */
-#define dmac_inv_range                 __glue(_CACHE,_dma_inv_range)
-#define dmac_clean_range               __glue(_CACHE,_dma_clean_range)
-#define dmac_flush_range               __glue(_CACHE,_dma_flush_range)
-
-extern void dmac_inv_range(const void *, const void *);
-extern void dmac_clean_range(const void *, const void *);
-extern void dmac_flush_range(const void *, const void *);
-
-#endif
-
-#ifdef CONFIG_OUTER_CACHE
-
-extern struct outer_cache_fns outer_cache;
-
-static inline void outer_inv_range(unsigned long start, unsigned long end)
-{
-       if (outer_cache.inv_range)
-               outer_cache.inv_range(start, end);
-}
-static inline void outer_clean_range(unsigned long start, unsigned long end)
-{
-       if (outer_cache.clean_range)
-               outer_cache.clean_range(start, end);
-}
-static inline void outer_flush_range(unsigned long start, unsigned long end)
-{
-       if (outer_cache.flush_range)
-               outer_cache.flush_range(start, end);
-}
-
-#else
-
-static inline void outer_inv_range(unsigned long start, unsigned long end)
-{ }
-static inline void outer_clean_range(unsigned long start, unsigned long end)
-{ }
-static inline void outer_flush_range(unsigned long start, unsigned long end)
-{ }
-
-#endif
-
-/*
- * flush_cache_vmap() is used when creating mappings (eg, via vmap,
- * vmalloc, ioremap etc) in kernel space for pages.  Since the
- * direct-mappings of these pages may contain cached data, we need
- * to do a full cache flush to ensure that writebacks don't corrupt
- * data placed into these pages via the new mappings.
- */
-#define flush_cache_vmap(start, end)           flush_cache_all()
-#define flush_cache_vunmap(start, end)         flush_cache_all()
-
-/*
- * Copy user data from/to a page which is mapped into a different
- * processes address space.  Really, we want to allow our "user
- * space" model to handle this.
- */
-#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
-       do {                                                    \
-               memcpy(dst, src, len);                          \
-               flush_ptrace_access(vma, page, vaddr, dst, len, 1);\
-       } while (0)
-
-#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
-       do {                                                    \
-               memcpy(dst, src, len);                          \
-       } while (0)
-
-/*
- * Convert calls to our calling convention.
- */
-#define flush_cache_all()              __cpuc_flush_kern_all()
-#ifndef CONFIG_CPU_CACHE_VIPT
-static inline void flush_cache_mm(struct mm_struct *mm)
-{
-       if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
-               __cpuc_flush_user_all();
-}
-
-static inline void
-flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
-{
-       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask))
-               __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
-                                       vma->vm_flags);
-}
-
-static inline void
-flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
-{
-       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
-               unsigned long addr = user_addr & PAGE_MASK;
-               __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
-       }
-}
-
-static inline void
-flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
-                        unsigned long uaddr, void *kaddr,
-                        unsigned long len, int write)
-{
-       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
-               unsigned long addr = (unsigned long)kaddr;
-               __cpuc_coherent_kern_range(addr, addr + len);
-       }
-}
-#else
-extern void flush_cache_mm(struct mm_struct *mm);
-extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
-extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
-extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
-                               unsigned long uaddr, void *kaddr,
-                               unsigned long len, int write);
-#endif
-
-#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
-
-/*
- * flush_cache_user_range is used when we want to ensure that the
- * Harvard caches are synchronised for the user space address range.
- * This is used for the ARM private sys_cacheflush system call.
- */
-#define flush_cache_user_range(vma,start,end) \
-       __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
-
-/*
- * Perform necessary cache operations to ensure that data previously
- * stored within this range of addresses can be executed by the CPU.
- */
-#define flush_icache_range(s,e)                __cpuc_coherent_kern_range(s,e)
-
-/*
- * Perform necessary cache operations to ensure that the TLB will
- * see data written in the specified area.
- */
-#define clean_dcache_area(start,size)  cpu_dcache_clean_area(start, size)
-
-/*
- * flush_dcache_page is used when the kernel has written to the page
- * cache page at virtual address page->virtual.
- *
- * If this page isn't mapped (ie, page_mapping == NULL), or it might
- * have userspace mappings, then we _must_ always clean + invalidate
- * the dcache entries associated with the kernel mapping.
- *
- * Otherwise we can defer the operation, and clean the cache when we are
- * about to change to user space.  This is the same method as used on SPARC64.
- * See update_mmu_cache for the user space part.
- */
-extern void flush_dcache_page(struct page *);
-
-extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
-
-static inline void __flush_icache_all(void)
-{
-       asm("mcr        p15, 0, %0, c7, c5, 0   @ invalidate I-cache\n"
-           :
-           : "r" (0));
-}
-
-#define ARCH_HAS_FLUSH_ANON_PAGE
-static inline void flush_anon_page(struct vm_area_struct *vma,
-                        struct page *page, unsigned long vmaddr)
-{
-       extern void __flush_anon_page(struct vm_area_struct *vma,
-                               struct page *, unsigned long);
-       if (PageAnon(page))
-               __flush_anon_page(vma, page, vmaddr);
-}
-
-#define flush_dcache_mmap_lock(mapping) \
-       spin_lock_irq(&(mapping)->tree_lock)
-#define flush_dcache_mmap_unlock(mapping) \
-       spin_unlock_irq(&(mapping)->tree_lock)
-
-#define flush_icache_user_range(vma,page,addr,len) \
-       flush_dcache_page(page)
-
-/*
- * We don't appear to need to do anything here.  In fact, if we did, we'd
- * duplicate cache flushing elsewhere performed by flush_dcache_page().
- */
-#define flush_icache_page(vma,page)    do { } while (0)
-
-static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
-       unsigned offset, size_t size)
-{
-       const void *start = (void __force *)virt + offset;
-       dmac_inv_range(start, start + size);
-}
-
-#define __cacheid_present(val)                 (val != read_cpuid(CPUID_ID))
-#define __cacheid_type_v7(val)                 ((val & (7 << 29)) == (4 << 29))
-
-#define __cacheid_vivt_prev7(val)              ((val & (15 << 25)) != (14 << 25))
-#define __cacheid_vipt_prev7(val)              ((val & (15 << 25)) == (14 << 25))
-#define __cacheid_vipt_nonaliasing_prev7(val)  ((val & (15 << 25 | 1 << 23)) == (14 << 25))
-#define __cacheid_vipt_aliasing_prev7(val)     ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23))
-
-#define __cacheid_vivt(val)                    (__cacheid_type_v7(val) ? 0 : __cacheid_vivt_prev7(val))
-#define __cacheid_vipt(val)                    (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_prev7(val))
-#define __cacheid_vipt_nonaliasing(val)                (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_nonaliasing_prev7(val))
-#define __cacheid_vipt_aliasing(val)           (__cacheid_type_v7(val) ? 0 : __cacheid_vipt_aliasing_prev7(val))
-#define __cacheid_vivt_asid_tagged_instr(val)  (__cacheid_type_v7(val) ? ((val & (3 << 14)) == (1 << 14)) : 0)
-
-#if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT)
-/*
- * VIVT caches only
- */
-#define cache_is_vivt()                        1
-#define cache_is_vipt()                        0
-#define cache_is_vipt_nonaliasing()    0
-#define cache_is_vipt_aliasing()       0
-#define icache_is_vivt_asid_tagged()   0
-
-#elif !defined(CONFIG_CPU_CACHE_VIVT) && defined(CONFIG_CPU_CACHE_VIPT)
-/*
- * VIPT caches only
- */
-#define cache_is_vivt()                        0
-#define cache_is_vipt()                        1
-#define cache_is_vipt_nonaliasing()                                    \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_vipt_nonaliasing(__val);                      \
-       })
-
-#define cache_is_vipt_aliasing()                                       \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_vipt_aliasing(__val);                         \
-       })
-
-#define icache_is_vivt_asid_tagged()                                   \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_vivt_asid_tagged_instr(__val);                \
-       })
-
-#else
-/*
- * VIVT or VIPT caches.  Note that this is unreliable since ARM926
- * and V6 CPUs satisfy the "(val & (15 << 25)) == (14 << 25)" test.
- * There's no way to tell from the CacheType register what type (!)
- * the cache is.
- */
-#define cache_is_vivt()                                                        \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               (!__cacheid_present(__val)) || __cacheid_vivt(__val);   \
-       })
-               
-#define cache_is_vipt()                                                        \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_present(__val) && __cacheid_vipt(__val);      \
-       })
-
-#define cache_is_vipt_nonaliasing()                                    \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_present(__val) &&                             \
-                __cacheid_vipt_nonaliasing(__val);                     \
-       })
-
-#define cache_is_vipt_aliasing()                                       \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_present(__val) &&                             \
-                __cacheid_vipt_aliasing(__val);                        \
-       })
-
-#define icache_is_vivt_asid_tagged()                                   \
-       ({                                                              \
-               unsigned int __val = read_cpuid(CPUID_CACHETYPE);       \
-               __cacheid_present(__val) &&                             \
-                __cacheid_vivt_asid_tagged_instr(__val);               \
-       })
-
-#endif
-
-#endif
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
deleted file mode 100644 (file)
index eaa0efd..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *  linux/include/asm-arm/checksum.h
- *
- * IP checksum routines
- *
- * Copyright (C) Original authors of ../asm-i386/checksum.h
- * Copyright (C) 1996-1999 Russell King
- */
-#ifndef __ASM_ARM_CHECKSUM_H
-#define __ASM_ARM_CHECKSUM_H
-
-#include <linux/in6.h>
-
-/*
- * 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
- */
-__wsum csum_partial(const void *buff, int len, __wsum sum);
-
-/*
- * the same as csum_partial, but copies from src while it
- * checksums, and handles user-space pointer exceptions correctly, when needed.
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- */
-
-__wsum
-csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
-
-__wsum
-csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
-
-/*
- *     Fold a partial checksum without adding pseudo headers
- */
-static inline __sum16 csum_fold(__wsum sum)
-{
-       __asm__(
-       "add    %0, %1, %1, ror #16     @ csum_fold"
-       : "=r" (sum)
-       : "r" (sum)
-       : "cc");
-       return (__force __sum16)(~(__force u32)sum >> 16);
-}
-
-/*
- *     This is a version of ip_compute_csum() optimized for IP headers,
- *     which always checksum on 4 octet boundaries.
- */
-static inline __sum16
-ip_fast_csum(const void *iph, unsigned int ihl)
-{
-       unsigned int tmp1;
-       __wsum sum;
-
-       __asm__ __volatile__(
-       "ldr    %0, [%1], #4            @ ip_fast_csum          \n\
-       ldr     %3, [%1], #4                                    \n\
-       sub     %2, %2, #5                                      \n\
-       adds    %0, %0, %3                                      \n\
-       ldr     %3, [%1], #4                                    \n\
-       adcs    %0, %0, %3                                      \n\
-       ldr     %3, [%1], #4                                    \n\
-1:     adcs    %0, %0, %3                                      \n\
-       ldr     %3, [%1], #4                                    \n\
-       tst     %2, #15                 @ do this carefully     \n\
-       subne   %2, %2, #1              @ without destroying    \n\
-       bne     1b                      @ the carry flag        \n\
-       adcs    %0, %0, %3                                      \n\
-       adc     %0, %0, #0"
-       : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
-       : "1" (iph), "2" (ihl)
-       : "cc", "memory");
-       return csum_fold(sum);
-}
-
-static inline __wsum
-csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
-                  unsigned short proto, __wsum sum)
-{
-       __asm__(
-       "adds   %0, %1, %2              @ csum_tcpudp_nofold    \n\
-       adcs    %0, %0, %3                                      \n"
-#ifdef __ARMEB__
-       "adcs   %0, %0, %4                                      \n"
-#else
-       "adcs   %0, %0, %4, lsl #8                              \n"
-#endif
-       "adcs   %0, %0, %5                                      \n\
-       adc     %0, %0, #0"
-       : "=&r"(sum)
-       : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
-       : "cc");
-       return sum;
-}      
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-static inline __sum16
-csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
-                 unsigned short proto, __wsum sum)
-{
-       return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
-}
-
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline __sum16
-ip_compute_csum(const void *buff, int len)
-{
-       return csum_fold(csum_partial(buff, len, 0));
-}
-
-#define _HAVE_ARCH_IPV6_CSUM
-extern __wsum
-__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
-               __be32 proto, __wsum sum);
-
-static inline __sum16
-csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
-               unsigned short proto, __wsum sum)
-{
-       return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
-                                          htonl(proto), sum));
-}
-#endif
diff --git a/include/asm-arm/cnt32_to_63.h b/include/asm-arm/cnt32_to_63.h
deleted file mode 100644 (file)
index 480c873..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *  include/asm/cnt32_to_63.h -- extend a 32-bit counter to 63 bits
- *
- *  Author:    Nicolas Pitre
- *  Created:   December 3, 2006
- *  Copyright: MontaVista Software, Inc.
- *
- * 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.
- */
-
-#ifndef __INCLUDE_CNT32_TO_63_H__
-#define __INCLUDE_CNT32_TO_63_H__
-
-#include <linux/compiler.h>
-#include <asm/types.h>
-#include <asm/byteorder.h>
-
-/*
- * Prototype: u64 cnt32_to_63(u32 cnt)
- * Many hardware clock counters are only 32 bits wide and therefore have
- * a relatively short period making wrap-arounds rather frequent.  This
- * is a problem when implementing sched_clock() for example, where a 64-bit
- * non-wrapping monotonic value is expected to be returned.
- *
- * To overcome that limitation, let's extend a 32-bit counter to 63 bits
- * in a completely lock free fashion. Bits 0 to 31 of the clock are provided
- * by the hardware while bits 32 to 62 are stored in memory.  The top bit in
- * memory is used to synchronize with the hardware clock half-period.  When
- * the top bit of both counters (hardware and in memory) differ then the
- * memory is updated with a new value, incrementing it when the hardware
- * counter wraps around.
- *
- * Because a word store in memory is atomic then the incremented value will
- * always be in synch with the top bit indicating to any potential concurrent
- * reader if the value in memory is up to date or not with regards to the
- * needed increment.  And any race in updating the value in memory is harmless
- * as the same value would simply be stored more than once.
- *
- * The only restriction for the algorithm to work properly is that this
- * code must be executed at least once per each half period of the 32-bit
- * counter to properly update the state bit in memory. This is usually not a
- * problem in practice, but if it is then a kernel timer could be scheduled
- * to manage for this code to be executed often enough.
- *
- * Note that the top bit (bit 63) in the returned value should be considered
- * as garbage.  It is not cleared here because callers are likely to use a
- * multiplier on the returned value which can get rid of the top bit
- * implicitly by making the multiplier even, therefore saving on a runtime
- * clear-bit instruction. Otherwise caller must remember to clear the top
- * bit explicitly.
- */
-
-/* this is used only to give gcc a clue about good code generation */
-typedef union {
-       struct {
-#if defined(__LITTLE_ENDIAN)
-               u32 lo, hi;
-#elif defined(__BIG_ENDIAN)
-               u32 hi, lo;
-#endif
-       };
-       u64 val;
-} cnt32_to_63_t;
-
-#define cnt32_to_63(cnt_lo) \
-({ \
-       static volatile u32 __m_cnt_hi = 0; \
-       cnt32_to_63_t __x; \
-       __x.hi = __m_cnt_hi; \
-       __x.lo = (cnt_lo); \
-       if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \
-               __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \
-       __x.val; \
-})
-
-#endif
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
deleted file mode 100644 (file)
index 3479de9..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  linux/include/asm-arm/cpu-multi32.h
- *
- *  Copyright (C) 2000 Russell King
- *
- * 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.
- */
-#include <asm/page.h>
-
-struct mm_struct;
-
-/*
- * Don't change this structure - ASM code
- * relies on it.
- */
-extern struct processor {
-       /* MISC
-        * get data abort address/flags
-        */
-       void (*_data_abort)(unsigned long pc);
-       /*
-        * Retrieve prefetch fault address
-        */
-       unsigned long (*_prefetch_abort)(unsigned long lr);
-       /*
-        * Set up any processor specifics
-        */
-       void (*_proc_init)(void);
-       /*
-        * Disable any processor specifics
-        */
-       void (*_proc_fin)(void);
-       /*
-        * Special stuff for a reset
-        */
-       void (*reset)(unsigned long addr) __attribute__((noreturn));
-       /*
-        * Idle the processor
-        */
-       int (*_do_idle)(void);
-       /*
-        * Processor architecture specific
-        */
-       /*
-        * clean a virtual address range from the
-        * D-cache without flushing the cache.
-        */
-       void (*dcache_clean_area)(void *addr, int size);
-
-       /*
-        * Set the page table
-        */
-       void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
-       /*
-        * Set a possibly extended PTE.  Non-extended PTEs should
-        * ignore 'ext'.
-        */
-       void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
-} processor;
-
-#define cpu_proc_init()                        processor._proc_init()
-#define cpu_proc_fin()                 processor._proc_fin()
-#define cpu_reset(addr)                        processor.reset(addr)
-#define cpu_do_idle()                  processor._do_idle()
-#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
-#define cpu_set_pte_ext(ptep,pte,ext)  processor.set_pte_ext(ptep,pte,ext)
-#define cpu_do_switch_mm(pgd,mm)       processor.switch_mm(pgd,mm)
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
deleted file mode 100644 (file)
index 0b120ee..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  linux/include/asm-arm/cpu-single.h
- *
- *  Copyright (C) 2000 Russell King
- *
- * 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.
- */
-/*
- * Single CPU
- */
-#ifdef __STDC__
-#define __catify_fn(name,x)    name##x
-#else
-#define __catify_fn(name,x)    name/**/x
-#endif
-#define __cpu_fn(name,x)       __catify_fn(name,x)
-
-/*
- * If we are supporting multiple CPUs, then we must use a table of
- * function pointers for this lot.  Otherwise, we can optimise the
- * table away.
- */
-#define cpu_proc_init                  __cpu_fn(CPU_NAME,_proc_init)
-#define cpu_proc_fin                   __cpu_fn(CPU_NAME,_proc_fin)
-#define cpu_reset                      __cpu_fn(CPU_NAME,_reset)
-#define cpu_do_idle                    __cpu_fn(CPU_NAME,_do_idle)
-#define cpu_dcache_clean_area          __cpu_fn(CPU_NAME,_dcache_clean_area)
-#define cpu_do_switch_mm               __cpu_fn(CPU_NAME,_switch_mm)
-#define cpu_set_pte_ext                        __cpu_fn(CPU_NAME,_set_pte_ext)
-
-#include <asm/page.h>
-
-struct mm_struct;
-
-/* declare all the functions as extern */
-extern void cpu_proc_init(void);
-extern void cpu_proc_fin(void);
-extern int cpu_do_idle(void);
-extern void cpu_dcache_clean_area(void *, int);
-extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
-extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
-extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h
deleted file mode 100644 (file)
index 715426b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  linux/include/asm-arm/cpu.h
- *
- *  Copyright (C) 2004-2005 ARM Ltd.
- *
- * 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.
- */
-#ifndef __ASM_ARM_CPU_H
-#define __ASM_ARM_CPU_H
-
-#include <linux/percpu.h>
-
-struct cpuinfo_arm {
-       struct cpu      cpu;
-#ifdef CONFIG_SMP
-       struct task_struct *idle;
-       unsigned int    loops_per_jiffy;
-#endif
-};
-
-DECLARE_PER_CPU(struct cpuinfo_arm, cpu_data);
-
-#endif
diff --git a/include/asm-arm/cputime.h b/include/asm-arm/cputime.h
deleted file mode 100644 (file)
index 3a8002a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ARM_CPUTIME_H
-#define __ARM_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* __ARM_CPUTIME_H */
diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h
deleted file mode 100644 (file)
index 75d21e2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASMARM_CURRENT_H
-#define _ASMARM_CURRENT_H
-
-#include <linux/thread_info.h>
-
-static inline struct task_struct *get_current(void) __attribute_const__;
-
-static inline struct task_struct *get_current(void)
-{
-       return current_thread_info()->task;
-}
-
-#define current (get_current())
-
-#endif /* _ASMARM_CURRENT_H */
diff --git a/include/asm-arm/delay.h b/include/asm-arm/delay.h
deleted file mode 100644 (file)
index b2deda1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 1995-2004 Russell King
- *
- * Delay routines, using a pre-computed "loops_per_second" value.
- */
-#ifndef __ASM_ARM_DELAY_H
-#define __ASM_ARM_DELAY_H
-
-#include <asm/param.h> /* HZ */
-
-extern void __delay(int loops);
-
-/*
- * This function intentionally does not exist; if you see references to
- * it, it means that you're calling udelay() with an out of range value.
- *
- * With currently imposed limits, this means that we support a max delay
- * of 2000us. Further limits: HZ<=1000 and bogomips<=3355
- */
-extern void __bad_udelay(void);
-
-/*
- * division by multiplication: you don't have to worry about
- * loss of precision.
- *
- * Use only for very small delays ( < 1 msec).  Should probably use a
- * lookup table, really, as the multiplications take much too long with
- * short delays.  This is a "reasonable" implementation, though (and the
- * first constant multiplications gets optimized away if the delay is
- * a constant)
- */
-extern void __udelay(unsigned long usecs);
-extern void __const_udelay(unsigned long);
-
-#define MAX_UDELAY_MS 2
-
-#define udelay(n)                                                      \
-       (__builtin_constant_p(n) ?                                      \
-         ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() :              \
-                       __const_udelay((n) * ((2199023U*HZ)>>11))) :    \
-         __udelay(n))
-
-#endif /* defined(_ARM_DELAY_H) */
-
diff --git a/include/asm-arm/device.h b/include/asm-arm/device.h
deleted file mode 100644 (file)
index c61642b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#ifndef ASMARM_DEVICE_H
-#define ASMARM_DEVICE_H
-
-struct dev_archdata {
-#ifdef CONFIG_DMABOUNCE
-       struct dmabounce_device_info *dmabounce;
-#endif
-};
-
-#endif
diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h
deleted file mode 100644 (file)
index 5001390..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-#ifndef __ASM_ARM_DIV64
-#define __ASM_ARM_DIV64
-
-#include <asm/system.h>
-#include <linux/types.h>
-
-/*
- * The semantics of do_div() are:
- *
- * uint32_t do_div(uint64_t *n, uint32_t base)
- * {
- *     uint32_t remainder = *n % base;
- *     *n = *n / base;
- *     return remainder;
- * }
- *
- * In other words, a 64-bit dividend with a 32-bit divisor producing
- * a 64-bit result and a 32-bit remainder.  To accomplish this optimally
- * we call a special __do_div64 helper with completely non standard
- * calling convention for arguments and results (beware).
- */
-
-#ifdef __ARMEB__
-#define __xh "r0"
-#define __xl "r1"
-#else
-#define __xl "r0"
-#define __xh "r1"
-#endif
-
-#define __do_div_asm(n, base)                                  \
-({                                                             \
-       register unsigned int __base      asm("r4") = base;     \
-       register unsigned long long __n   asm("r0") = n;        \
-       register unsigned long long __res asm("r2");            \
-       register unsigned int __rem       asm(__xh);            \
-       asm(    __asmeq("%0", __xh)                             \
-               __asmeq("%1", "r2")                             \
-               __asmeq("%2", "r0")                             \
-               __asmeq("%3", "r4")                             \
-               "bl     __do_div64"                             \
-               : "=r" (__rem), "=r" (__res)                    \
-               : "r" (__n), "r" (__base)                       \
-               : "ip", "lr", "cc");                            \
-       n = __res;                                              \
-       __rem;                                                  \
-})
-
-#if __GNUC__ < 4
-
-/*
- * gcc versions earlier than 4.0 are simply too problematic for the
- * optimized implementation below. First there is gcc PR 15089 that
- * tend to trig on more complex constructs, spurious .global __udivsi3
- * are inserted even if none of those symbols are referenced in the
- * generated code, and those gcc versions are not able to do constant
- * propagation on long long values anyway.
- */
-#define do_div(n, base) __do_div_asm(n, base)
-
-#elif __GNUC__ >= 4
-
-#include <asm/bug.h>
-
-/*
- * If the divisor happens to be constant, we determine the appropriate
- * inverse at compile time to turn the division into a few inline
- * multiplications instead which is much faster. And yet only if compiling
- * for ARMv4 or higher (we need umull/umlal) and if the gcc version is
- * sufficiently recent to perform proper long long constant propagation.
- * (It is unfortunate that gcc doesn't perform all this internally.)
- */
-#define do_div(n, base)                                                        \
-({                                                                     \
-       unsigned int __r, __b = (base);                                 \
-       if (!__builtin_constant_p(__b) || __b == 0 ||                   \
-           (__LINUX_ARM_ARCH__ < 4 && (__b & (__b - 1)) != 0)) {       \
-               /* non-constant divisor (or zero): slow path */         \
-               __r = __do_div_asm(n, __b);                             \
-       } else if ((__b & (__b - 1)) == 0) {                            \
-               /* Trivial: __b is constant and a power of 2 */         \
-               /* gcc does the right thing with this code.  */         \
-               __r = n;                                                \
-               __r &= (__b - 1);                                       \
-               n /= __b;                                               \
-       } else {                                                        \
-               /* Multiply by inverse of __b: n/b = n*(p/b)/p       */ \
-               /* We rely on the fact that most of this code gets   */ \
-               /* optimized away at compile time due to constant    */ \
-               /* propagation and only a couple inline assembly     */ \
-               /* instructions should remain. Better avoid any      */ \
-               /* code construct that might prevent that.           */ \
-               unsigned long long __res, __x, __t, __m, __n = n;       \
-               unsigned int __c, __p, __z = 0;                         \
-               /* preserve low part of n for reminder computation */   \
-               __r = __n;                                              \
-               /* determine number of bits to represent __b */         \
-               __p = 1 << __div64_fls(__b);                            \
-               /* compute __m = ((__p << 64) + __b - 1) / __b */       \
-               __m = (~0ULL / __b) * __p;                              \
-               __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b;     \
-               /* compute __res = __m*(~0ULL/__b*__b-1)/(__p << 64) */ \
-               __x = ~0ULL / __b * __b - 1;                            \
-               __res = (__m & 0xffffffff) * (__x & 0xffffffff);        \
-               __res >>= 32;                                           \
-               __res += (__m & 0xffffffff) * (__x >> 32);              \
-               __t = __res;                                            \
-               __res += (__x & 0xffffffff) * (__m >> 32);              \
-               __t = (__res < __t) ? (1ULL << 32) : 0;                 \
-               __res = (__res >> 32) + __t;                            \
-               __res += (__m >> 32) * (__x >> 32);                     \
-               __res /= __p;                                           \
-               /* Now sanitize and optimize what we've got. */         \
-               if (~0ULL % (__b / (__b & -__b)) == 0) {                \
-                       /* those cases can be simplified with: */       \
-                       __n /= (__b & -__b);                            \
-                       __m = ~0ULL / (__b / (__b & -__b));             \
-                       __p = 1;                                        \
-                       __c = 1;                                        \
-               } else if (__res != __x / __b) {                        \
-                       /* We can't get away without a correction    */ \
-                       /* to compensate for bit truncation errors.  */ \
-                       /* To avoid it we'd need an additional bit   */ \
-                       /* to represent __m which would overflow it. */ \
-                       /* Instead we do m=p/b and n/b=(n*m+m)/p.    */ \
-                       __c = 1;                                        \
-                       /* Compute __m = (__p << 64) / __b */           \
-                       __m = (~0ULL / __b) * __p;                      \
-                       __m += ((~0ULL % __b + 1) * __p) / __b;         \
-               } else {                                                \
-                       /* Reduce __m/__p, and try to clear bit 31   */ \
-                       /* of __m when possible otherwise that'll    */ \
-                       /* need extra overflow handling later.       */ \
-                       unsigned int __bits = -(__m & -__m);            \
-                       __bits |= __m >> 32;                            \
-                       __bits = (~__bits) << 1;                        \
-                       /* If __bits == 0 then setting bit 31 is     */ \
-                       /* unavoidable.  Simply apply the maximum    */ \
-                       /* possible reduction in that case.          */ \
-                       /* Otherwise the MSB of __bits indicates the */ \
-                       /* best reduction we should apply.           */ \
-                       if (!__bits) {                                  \
-                               __p /= (__m & -__m);                    \
-                               __m /= (__m & -__m);                    \
-                       } else {                                        \
-                               __p >>= __div64_fls(__bits);            \
-                               __m >>= __div64_fls(__bits);            \
-                       }                                               \
-                       /* No correction needed. */                     \
-                       __c = 0;                                        \
-               }                                                       \
-               /* Now we have a combination of 2 conditions:        */ \
-               /* 1) whether or not we need a correction (__c), and */ \
-               /* 2) whether or not there might be an overflow in   */ \
-               /*    the cross product (__m & ((1<<63) | (1<<31)))  */ \
-               /* Select the best insn combination to perform the   */ \
-               /* actual __m * __n / (__p << 64) operation.         */ \
-               if (!__c) {                                             \
-                       asm (   "umull  %Q0, %R0, %1, %Q2\n\t"          \
-                               "mov    %Q0, #0"                        \
-                               : "=&r" (__res)                         \
-                               : "r" (__m), "r" (__n)                  \
-                               : "cc" );                               \
-               } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) {    \
-                       __res = __m;                                    \
-                       asm (   "umlal  %Q0, %R0, %Q1, %Q2\n\t"         \
-                               "mov    %Q0, #0"                        \
-                               : "+r" (__res)                          \
-                               : "r" (__m), "r" (__n)                  \
-                               : "cc" );                               \
-               } else {                                                \
-                       asm (   "umull  %Q0, %R0, %Q1, %Q2\n\t"         \
-                               "cmn    %Q0, %Q1\n\t"                   \
-                               "adcs   %R0, %R0, %R1\n\t"              \
-                               "adc    %Q0, %3, #0"                    \
-                               : "=&r" (__res)                         \
-                               : "r" (__m), "r" (__n), "r" (__z)       \
-                               : "cc" );                               \
-               }                                                       \
-               if (!(__m & ((1ULL << 63) | (1ULL << 31)))) {           \
-                       asm (   "umlal  %R0, %Q0, %R1, %Q2\n\t"         \
-                               "umlal  %R0, %Q0, %Q1, %R2\n\t"         \
-                               "mov    %R0, #0\n\t"                    \
-                               "umlal  %Q0, %R0, %R1, %R2"             \
-                               : "+r" (__res)                          \
-                               : "r" (__m), "r" (__n)                  \
-                               : "cc" );                               \
-               } else {                                                \
-                       asm (   "umlal  %R0, %Q0, %R2, %Q3\n\t"         \
-                               "umlal  %R0, %1, %Q2, %R3\n\t"          \
-                               "mov    %R0, #0\n\t"                    \
-                               "adds   %Q0, %1, %Q0\n\t"               \
-                               "adc    %R0, %R0, #0\n\t"               \
-                               "umlal  %Q0, %R0, %R2, %R3"             \
-                               : "+r" (__res), "+r" (__z)              \
-                               : "r" (__m), "r" (__n)                  \
-                               : "cc" );                               \
-               }                                                       \
-               __res /= __p;                                           \
-               /* The reminder can be computed with 32-bit regs     */ \
-               /* only, and gcc is good at that.                    */ \
-               {                                                       \
-                       unsigned int __res0 = __res;                    \
-                       unsigned int __b0 = __b;                        \
-                       __r -= __res0 * __b0;                           \
-               }                                                       \
-               /* BUG_ON(__r >= __b || __res * __b + __r != n); */     \
-               n = __res;                                              \
-       }                                                               \
-       __r;                                                            \
-})
-
-/* our own fls implementation to make sure constant propagation is fine */
-#define __div64_fls(bits)                                              \
-({                                                                     \
-       unsigned int __left = (bits), __nr = 0;                         \
-       if (__left & 0xffff0000) __nr += 16, __left >>= 16;             \
-       if (__left & 0x0000ff00) __nr +=  8, __left >>=  8;             \
-       if (__left & 0x000000f0) __nr +=  4, __left >>=  4;             \
-       if (__left & 0x0000000c) __nr +=  2, __left >>=  2;             \
-       if (__left & 0x00000002) __nr +=  1;                            \
-       __nr;                                                           \
-})
-
-#endif
-
-#endif
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
deleted file mode 100644 (file)
index 45329fc..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-#ifndef ASMARM_DMA_MAPPING_H
-#define ASMARM_DMA_MAPPING_H
-
-#ifdef __KERNEL__
-
-#include <linux/mm.h> /* need struct page */
-
-#include <linux/scatterlist.h>
-
-#include <asm-generic/dma-coherent.h>
-
-/*
- * DMA-consistent mapping functions.  These allocate/free a region of
- * uncached, unwrite-buffered mapped memory space for use with DMA
- * devices.  This is the "generic" version.  The PCI specific version
- * is in pci.h
- *
- * Note: Drivers should NOT use this function directly, as it will break
- * platforms with CONFIG_DMABOUNCE.
- * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
- */
-extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
-
-/*
- * Return whether the given device DMA address mask can be supported
- * properly.  For example, if your device can only drive the low 24-bits
- * during bus mastering, then you would pass 0x00ffffff as the mask
- * to this function.
- *
- * FIXME: This should really be a platform specific issue - we should
- * return false if GFP_DMA allocations may not satisfy the supplied 'mask'.
- */
-static inline int dma_supported(struct device *dev, u64 mask)
-{
-       return dev->dma_mask && *dev->dma_mask != 0;
-}
-
-static inline int dma_set_mask(struct device *dev, u64 dma_mask)
-{
-       if (!dev->dma_mask || !dma_supported(dev, dma_mask))
-               return -EIO;
-
-       *dev->dma_mask = dma_mask;
-
-       return 0;
-}
-
-static inline int dma_get_cache_alignment(void)
-{
-       return 32;
-}
-
-static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
-{
-       return !!arch_is_coherent();
-}
-
-/*
- * DMA errors are defined by all-bits-set in the DMA address.
- */
-static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-{
-       return dma_addr == ~0;
-}
-
-/*
- * Dummy noncoherent implementation.  We don't provide a dma_cache_sync
- * function so drivers using this API are highlighted with build warnings.
- */
-static inline void *
-dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
-{
-       return NULL;
-}
-
-static inline void
-dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
-                    dma_addr_t handle)
-{
-}
-
-/**
- * dma_alloc_coherent - allocate consistent memory for DMA
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @size: required memory size
- * @handle: bus-specific DMA address
- *
- * Allocate some uncached, unbuffered memory for a device for
- * performing DMA.  This function allocates pages, and will
- * return the CPU-viewed address, and sets @handle to be the
- * device-viewed address.
- */
-extern void *
-dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
-
-/**
- * dma_free_coherent - free memory allocated by dma_alloc_coherent
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @size: size of memory originally requested in dma_alloc_coherent
- * @cpu_addr: CPU-view address returned from dma_alloc_coherent
- * @handle: device-view address returned from dma_alloc_coherent
- *
- * Free (and unmap) a DMA buffer previously allocated by
- * dma_alloc_coherent().
- *
- * References to memory and mappings associated with cpu_addr/handle
- * during and after this call executing are illegal.
- */
-extern void
-dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
-                 dma_addr_t handle);
-
-/**
- * dma_mmap_coherent - map a coherent DMA allocation into user space
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @vma: vm_area_struct describing requested user mapping
- * @cpu_addr: kernel CPU-view address returned from dma_alloc_coherent
- * @handle: device-view address returned from dma_alloc_coherent
- * @size: size of memory originally requested in dma_alloc_coherent
- *
- * Map a coherent DMA buffer previously allocated by dma_alloc_coherent
- * into user space.  The coherent DMA buffer must not be freed by the
- * driver until the user space mapping has been released.
- */
-int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
-                     void *cpu_addr, dma_addr_t handle, size_t size);
-
-
-/**
- * dma_alloc_writecombine - allocate writecombining memory for DMA
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @size: required memory size
- * @handle: bus-specific DMA address
- *
- * Allocate some uncached, buffered memory for a device for
- * performing DMA.  This function allocates pages, and will
- * return the CPU-viewed address, and sets @handle to be the
- * device-viewed address.
- */
-extern void *
-dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp);
-
-#define dma_free_writecombine(dev,size,cpu_addr,handle) \
-       dma_free_coherent(dev,size,cpu_addr,handle)
-
-int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma,
-                         void *cpu_addr, dma_addr_t handle, size_t size);
-
-
-/**
- * dma_map_single - map a single buffer for streaming DMA
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @cpu_addr: CPU direct mapped address of buffer
- * @size: size of buffer to map
- * @dir: DMA transfer direction
- *
- * Ensure that any data held in the cache is appropriately discarded
- * or written back.
- *
- * The device owns this memory once this call has completed.  The CPU
- * can regain ownership by calling dma_unmap_single() or
- * dma_sync_single_for_cpu().
- */
-#ifndef CONFIG_DMABOUNCE
-static inline dma_addr_t
-dma_map_single(struct device *dev, void *cpu_addr, size_t size,
-              enum dma_data_direction dir)
-{
-       if (!arch_is_coherent())
-               dma_cache_maint(cpu_addr, size, dir);
-
-       return virt_to_dma(dev, (unsigned long)cpu_addr);
-}
-#else
-extern dma_addr_t dma_map_single(struct device *,void *, size_t, enum dma_data_direction);
-#endif
-
-/**
- * dma_map_page - map a portion of a page for streaming DMA
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @page: page that buffer resides in
- * @offset: offset into page for start of buffer
- * @size: size of buffer to map
- * @dir: DMA transfer direction
- *
- * Ensure that any data held in the cache is appropriately discarded
- * or written back.
- *
- * The device owns this memory once this call has completed.  The CPU
- * can regain ownership by calling dma_unmap_page() or
- * dma_sync_single_for_cpu().
- */
-static inline dma_addr_t
-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);
-}
-
-/**
- * dma_unmap_single - unmap a single buffer previously mapped
- * @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
- *
- * Unmap a single streaming mode DMA translation.  The handle and size
- * must match what was provided in the previous dma_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.
- */
-#ifndef CONFIG_DMABOUNCE
-static inline void
-dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
-                enum dma_data_direction dir)
-{
-       /* nothing to do */
-}
-#else
-extern void dma_unmap_single(struct device *, dma_addr_t, size_t, enum dma_data_direction);
-#endif
-
-/**
- * dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
- * @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
- *
- * Unmap a single streaming mode DMA translation.  The handle and size
- * must match what was provided in the previous dma_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.
- */
-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_map_sg - map a set of SG buffers for streaming mode DMA
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @sg: list of buffers
- * @nents: number of buffers to map
- * @dir: DMA transfer direction
- *
- * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scatter-gather version of the
- * above dma_map_single interface.  Here the scatter gather list
- * elements are each tagged with the appropriate 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 dma_map_single are
- * the same here.
- */
-#ifndef CONFIG_DMABOUNCE
-static inline int
-dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
-          enum dma_data_direction dir)
-{
-       int i;
-
-       for (i = 0; i < nents; i++, sg++) {
-               char *virt;
-
-               sg->dma_address = page_to_dma(dev, sg_page(sg)) + sg->offset;
-               virt = sg_virt(sg);
-
-               if (!arch_is_coherent())
-                       dma_cache_maint(virt, sg->length, dir);
-       }
-
-       return nents;
-}
-#else
-extern int dma_map_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
-#endif
-
-/**
- * dma_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @sg: list of buffers
- * @nents: number of buffers to map
- * @dir: DMA transfer direction
- *
- * Unmap a set of streaming mode DMA translations.
- * Again, CPU read rules concerning calls here are the same as for
- * dma_unmap_single() above.
- */
-#ifndef CONFIG_DMABOUNCE
-static inline void
-dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
-            enum dma_data_direction dir)
-{
-
-       /* nothing to do */
-}
-#else
-extern void dma_unmap_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
-#endif
-
-
-/**
- * dma_sync_single_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
- *
- * Make physical memory consistent for a single streaming mode DMA
- * translation after a transfer.
- *
- * If you perform a dma_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 the perform a dma_sync_for_device, and then the
- * device again owns the buffer.
- */
-#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)
-{
-       if (!arch_is_coherent())
-               dma_cache_maint((void *)dma_to_virt(dev, handle), 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)
-{
-       if (!arch_is_coherent())
-               dma_cache_maint((void *)dma_to_virt(dev, handle), 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);
-#endif
-
-
-/**
- * dma_sync_sg_for_cpu
- * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
- * @sg: list of buffers
- * @nents: number of buffers to map
- * @dir: DMA transfer direction
- *
- * Make physical memory consistent for a set of streaming
- * mode DMA translations after a transfer.
- *
- * The same as dma_sync_single_for_* but for a scatter-gather list,
- * same rules and usage.
- */
-#ifndef CONFIG_DMABOUNCE
-static inline void
-dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
-                   enum dma_data_direction dir)
-{
-       int i;
-
-       for (i = 0; i < nents; i++, sg++) {
-               char *virt = sg_virt(sg);
-               if (!arch_is_coherent())
-                       dma_cache_maint(virt, sg->length, dir);
-       }
-}
-
-static inline void
-dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
-                      enum dma_data_direction dir)
-{
-       int i;
-
-       for (i = 0; i < nents; i++, sg++) {
-               char *virt = sg_virt(sg);
-               if (!arch_is_coherent())
-                       dma_cache_maint(virt, sg->length, dir);
-       }
-}
-#else
-extern void dma_sync_sg_for_cpu(struct device*, struct scatterlist*, int, enum dma_data_direction);
-extern void dma_sync_sg_for_device(struct device*, struct scatterlist*, int, enum dma_data_direction);
-#endif
-
-#ifdef CONFIG_DMABOUNCE
-/*
- * For SA-1111, IXP425, and ADI systems  the dma-mapping functions are "magic"
- * and utilize bounce buffers as needed to work around limited DMA windows.
- *
- * On the SA-1111, a bug limits DMA to only certain regions of RAM.
- * On the IXP425, the PCI inbound window is 64MB (256MB total RAM)
- * On some ADI engineering systems, PCI inbound window is 32MB (12MB total RAM)
- *
- * The following are helper functions used by the dmabounce subystem
- *
- */
-
-/**
- * dmabounce_register_dev
- *
- * @dev: valid struct device pointer
- * @small_buf_size: size of buffers to use with small buffer pool
- * @large_buf_size: size of buffers to use with large buffer pool (can be 0)
- *
- * This function should be called by low-level platform code to register
- * a device as requireing DMA buffer bouncing. The function will allocate
- * appropriate DMA pools for the device.
- *
- */
-extern int dmabounce_register_dev(struct device *, unsigned long, unsigned long);
-
-/**
- * dmabounce_unregister_dev
- *
- * @dev: valid struct device pointer
- *
- * This function should be called by low-level platform code when device
- * that was previously registered with dmabounce_register_dev is removed
- * from the system.
- *
- */
-extern void dmabounce_unregister_dev(struct device *);
-
-/**
- * dma_needs_bounce
- *
- * @dev: valid struct device pointer
- * @dma_handle: dma_handle of unbounced buffer
- * @size: size of region being mapped
- *
- * Platforms that utilize the dmabounce mechanism must implement
- * this function.
- *
- * The dmabounce routines call this function whenever a dma-mapping
- * is requested to determine whether a given buffer needs to be bounced
- * or not. The function must return 0 if the buffer is OK for
- * DMA access and 1 if the buffer needs to be bounced.
- *
- */
-extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
-#endif /* CONFIG_DMABOUNCE */
-
-#endif /* __KERNEL__ */
-#endif
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
deleted file mode 100644 (file)
index 9f2c530..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#ifndef __ASM_ARM_DMA_H
-#define __ASM_ARM_DMA_H
-
-typedef unsigned int dmach_t;
-
-#include <linux/spinlock.h>
-#include <asm/system.h>
-#include <asm/scatterlist.h>
-#include <asm/arch/dma.h>
-
-/*
- * This is the maximum virtual address which can be DMA'd from.
- */
-#ifndef MAX_DMA_ADDRESS
-#define MAX_DMA_ADDRESS        0xffffffff
-#endif
-
-/*
- * DMA modes
- */
-typedef unsigned int dmamode_t;
-
-#define DMA_MODE_MASK  3
-
-#define DMA_MODE_READ   0
-#define DMA_MODE_WRITE  1
-#define DMA_MODE_CASCADE 2
-#define DMA_AUTOINIT    4
-
-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);
-}
-
-/* Clear the 'DMA Pointer Flip Flop'.
- * Write 0 for LSB/MSB, 1 for MSB/LSB access.
- */
-#define clear_dma_ff(channel)
-
-/* Set only the page register bits of the transfer address.
- *
- * NOTE: This is an architecture specific function, and should
- *       be hidden from the drivers
- */
-extern void set_dma_page(dmach_t channel, char pagenr);
-
-/* Request a DMA channel
- *
- * Some architectures may need to do allocate an interrupt
- */
-extern int  request_dma(dmach_t channel, const char * device_id);
-
-/* Free a DMA channel
- *
- * Some architectures may need to do free an interrupt
- */
-extern void free_dma(dmach_t channel);
-
-/* Enable DMA for this channel
- *
- * On some architectures, this may have other side effects like
- * enabling an interrupt and setting the DMA registers.
- */
-extern void enable_dma(dmach_t channel);
-
-/* Disable DMA for this channel
- *
- * On some architectures, this may have other side effects like
- * disabling an interrupt or whatever.
- */
-extern void disable_dma(dmach_t channel);
-
-/* Test whether the specified channel has an active DMA transfer
- */
-extern int dma_channel_active(dmach_t channel);
-
-/* Set the DMA scatter gather list for this channel
- *
- * This should not be called if a DMA channel is enabled,
- * especially since some DMA architectures don't update the
- * DMA address immediately, but defer it to the enable_dma().
- */
-extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
-
-/* Set the DMA address for this channel
- *
- * This should not be called if a DMA channel is enabled,
- * especially since some DMA architectures don't update the
- * DMA address immediately, but defer it to the enable_dma().
- */
-extern void __set_dma_addr(dmach_t channel, void *addr);
-#define set_dma_addr(channel, addr)                            \
-       __set_dma_addr(channel, bus_to_virt(addr))
-
-/* Set the DMA byte count for this channel
- *
- * This should not be called if a DMA channel is enabled,
- * especially since some DMA architectures don't update the
- * DMA count immediately, but defer it to the enable_dma().
- */
-extern void set_dma_count(dmach_t channel, unsigned long count);
-
-/* Set the transfer direction for this channel
- *
- * This should not be called if a DMA channel is enabled,
- * especially since some DMA architectures don't update the
- * DMA transfer direction immediately, but defer it to the
- * enable_dma().
- */
-extern void set_dma_mode(dmach_t channel, dmamode_t mode);
-
-/* Set the transfer speed for this channel
- */
-extern void set_dma_speed(dmach_t channel, int cycle_ns);
-
-/* 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.
- */
-extern int  get_dma_residue(dmach_t channel);
-
-#ifndef NO_DMA
-#define NO_DMA 255
-#endif
-
-#ifdef CONFIG_PCI
-extern int isa_dma_bridge_buggy;
-#else
-#define isa_dma_bridge_buggy    (0)
-#endif
-
-#endif /* _ARM_DMA_H */
diff --git a/include/asm-arm/domain.h b/include/asm-arm/domain.h
deleted file mode 100644 (file)
index 3c12a76..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *  linux/include/asm-arm/domain.h
- *
- *  Copyright (C) 1999 Russell King.
- *
- * 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.
- */
-#ifndef __ASM_PROC_DOMAIN_H
-#define __ASM_PROC_DOMAIN_H
-
-/*
- * Domain numbers
- *
- *  DOMAIN_IO     - domain 2 includes all IO only
- *  DOMAIN_USER   - domain 1 includes all user memory only
- *  DOMAIN_KERNEL - domain 0 includes all kernel memory only
- *
- * The domain numbering depends on whether we support 36 physical
- * address for I/O or not.  Addresses above the 32 bit boundary can
- * only be mapped using supersections and supersections can only
- * be set for domain 0.  We could just default to DOMAIN_IO as zero,
- * but there may be systems with supersection support and no 36-bit
- * addressing.  In such cases, we want to map system memory with
- * supersections to reduce TLB misses and footprint.
- *
- * 36-bit addressing and supersections are only available on
- * CPUs based on ARMv6+ or the Intel XSC3 core.
- */
-#ifndef CONFIG_IO_36
-#define DOMAIN_KERNEL  0
-#define DOMAIN_TABLE   0
-#define DOMAIN_USER    1
-#define DOMAIN_IO      2
-#else
-#define DOMAIN_KERNEL  2
-#define DOMAIN_TABLE   2
-#define DOMAIN_USER    1
-#define DOMAIN_IO      0
-#endif
-
-/*
- * Domain types
- */
-#define DOMAIN_NOACCESS        0
-#define DOMAIN_CLIENT  1
-#define DOMAIN_MANAGER 3
-
-#define domain_val(dom,type)   ((type) << (2*(dom)))
-
-#ifndef __ASSEMBLY__
-
-#ifdef CONFIG_MMU
-#define set_domain(x)                                  \
-       do {                                            \
-       __asm__ __volatile__(                           \
-       "mcr    p15, 0, %0, c3, c0      @ set domain"   \
-         : : "r" (x));                                 \
-       isb();                                          \
-       } while (0)
-
-#define modify_domain(dom,type)                                        \
-       do {                                                    \
-       struct thread_info *thread = current_thread_info();     \
-       unsigned int domain = thread->cpu_domain;               \
-       domain &= ~domain_val(dom, DOMAIN_MANAGER);             \
-       thread->cpu_domain = domain | domain_val(dom, type);    \
-       set_domain(thread->cpu_domain);                         \
-       } while (0)
-
-#else
-#define set_domain(x)          do { } while (0)
-#define modify_domain(dom,type)        do { } while (0)
-#endif
-
-#endif
-#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
deleted file mode 100644 (file)
index 5e22881..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * linux/include/asm-arm/ecard.h
- *
- * definitions for expansion cards
- *
- * This is a new system as from Linux 1.2.3
- *
- * Changelog:
- *  11-12-1996 RMK     Further minor improvements
- *  12-09-1997 RMK     Added interrupt enable/disable for card level
- *
- * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
- */
-
-#ifndef __ASM_ECARD_H
-#define __ASM_ECARD_H
-
-/*
- * Currently understood cards (but not necessarily
- * supported):
- *                        Manufacturer  Product ID
- */
-#define MANU_ACORN             0x0000
-#define PROD_ACORN_SCSI                        0x0002
-#define PROD_ACORN_ETHER1              0x0003
-#define PROD_ACORN_MFM                 0x000b
-
-#define MANU_ANT2              0x0011
-#define PROD_ANT_ETHER3                        0x00a4
-
-#define MANU_ATOMWIDE          0x0017
-#define PROD_ATOMWIDE_3PSERIAL         0x0090
-
-#define MANU_IRLAM_INSTRUMENTS 0x001f
-#define MANU_IRLAM_INSTRUMENTS_ETHERN  0x5678
-
-#define MANU_OAK               0x0021
-#define PROD_OAK_SCSI                  0x0058
-
-#define MANU_MORLEY            0x002b
-#define PROD_MORLEY_SCSI_UNCACHED      0x0067
-
-#define MANU_CUMANA            0x003a
-#define PROD_CUMANA_SCSI_2             0x003a
-#define PROD_CUMANA_SCSI_1             0x00a0
-
-#define MANU_ICS               0x003c
-#define PROD_ICS_IDE                   0x00ae
-
-#define MANU_ICS2              0x003d
-#define PROD_ICS2_IDE                  0x00ae
-
-#define MANU_SERPORT           0x003f
-#define PROD_SERPORT_DSPORT            0x00b9
-
-#define MANU_ARXE              0x0041
-#define PROD_ARXE_SCSI                 0x00be
-
-#define MANU_I3                        0x0046
-#define PROD_I3_ETHERLAN500            0x00d4
-#define PROD_I3_ETHERLAN600            0x00ec
-#define PROD_I3_ETHERLAN600A           0x011e
-
-#define MANU_ANT               0x0053
-#define PROD_ANT_ETHERM                        0x00d8
-#define PROD_ANT_ETHERB                        0x00e4
-
-#define MANU_ALSYSTEMS         0x005b
-#define PROD_ALSYS_SCSIATAPI           0x0107
-
-#define MANU_MCS               0x0063
-#define PROD_MCS_CONNECT32             0x0125
-
-#define MANU_EESOX             0x0064
-#define PROD_EESOX_SCSI2               0x008c
-
-#define MANU_YELLOWSTONE       0x0096
-#define PROD_YELLOWSTONE_RAPIDE32      0x0120
-
-#ifdef ECARD_C
-#define CONST
-#else
-#define CONST const
-#endif
-
-#define MAX_ECARDS     9
-
-struct ecard_id {                      /* Card ID structure            */
-       unsigned short  manufacturer;
-       unsigned short  product;
-       void            *data;
-};
-
-struct in_ecid {                       /* Packed card ID information   */
-       unsigned short  product;        /* Product code                 */
-       unsigned short  manufacturer;   /* Manufacturer code            */
-       unsigned char   id:4;           /* Simple ID                    */
-       unsigned char   cd:1;           /* Chunk dir present            */
-       unsigned char   is:1;           /* Interrupt status pointers    */
-       unsigned char   w:2;            /* Width                        */
-       unsigned char   country;        /* Country                      */
-       unsigned char   irqmask;        /* IRQ mask                     */
-       unsigned char   fiqmask;        /* FIQ mask                     */
-       unsigned long   irqoff;         /* IRQ offset                   */
-       unsigned long   fiqoff;         /* FIQ offset                   */
-};
-
-typedef struct expansion_card ecard_t;
-typedef unsigned long *loader_t;
-
-typedef struct expansion_card_ops {    /* Card handler routines        */
-       void (*irqenable)(ecard_t *ec, int irqnr);
-       void (*irqdisable)(ecard_t *ec, int irqnr);
-       int  (*irqpending)(ecard_t *ec);
-       void (*fiqenable)(ecard_t *ec, int fiqnr);
-       void (*fiqdisable)(ecard_t *ec, int fiqnr);
-       int  (*fiqpending)(ecard_t *ec);
-} expansioncard_ops_t;
-
-#define ECARD_NUM_RESOURCES    (6)
-
-#define ECARD_RES_IOCSLOW      (0)
-#define ECARD_RES_IOCMEDIUM    (1)
-#define ECARD_RES_IOCFAST      (2)
-#define ECARD_RES_IOCSYNC      (3)
-#define ECARD_RES_MEMC         (4)
-#define ECARD_RES_EASI         (5)
-
-#define ecard_resource_start(ec,nr)    ((ec)->resource[nr].start)
-#define ecard_resource_end(ec,nr)      ((ec)->resource[nr].end)
-#define ecard_resource_len(ec,nr)      ((ec)->resource[nr].end - \
-                                        (ec)->resource[nr].start + 1)
-#define ecard_resource_flags(ec,nr)    ((ec)->resource[nr].flags)
-
-/*
- * This contains all the info needed on an expansion card
- */
-struct expansion_card {
-       struct expansion_card  *next;
-
-       struct device           dev;
-       struct resource         resource[ECARD_NUM_RESOURCES];
-
-       /* Public data */
-       void __iomem            *irqaddr;       /* address of IRQ register      */
-       void __iomem            *fiqaddr;       /* address of FIQ register      */
-       unsigned char           irqmask;        /* IRQ mask                     */
-       unsigned char           fiqmask;        /* FIQ mask                     */
-       unsigned char           claimed;        /* Card claimed?                */
-       unsigned char           easi;           /* EASI card                    */
-
-       void                    *irq_data;      /* Data for use for IRQ by card */
-       void                    *fiq_data;      /* Data for use for FIQ by card */
-       const expansioncard_ops_t *ops;         /* Enable/Disable Ops for card  */
-
-       CONST unsigned int      slot_no;        /* Slot number                  */
-       CONST unsigned int      dma;            /* DMA number (for request_dma) */
-       CONST unsigned int      irq;            /* IRQ number (for request_irq) */
-       CONST unsigned int      fiq;            /* FIQ number (for request_irq) */
-       CONST struct in_ecid    cid;            /* Card Identification          */
-
-       /* Private internal data */
-       const char              *card_desc;     /* Card description             */
-       CONST unsigned int      podaddr;        /* Base Linux address for card  */
-       CONST loader_t          loader;         /* loader program */
-       u64                     dma_mask;
-};
-
-void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *ops, void *irq_data);
-
-struct in_chunk_dir {
-       unsigned int start_offset;
-       union {
-               unsigned char string[256];
-               unsigned char data[1];
-       } d;
-};
-
-/*
- * Read a chunk from an expansion card
- * cd : where to put read data
- * ec : expansion card info struct
- * id : id number to find
- * num: (n+1)'th id to find.
- */
-extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
-
-/*
- * Request and release ecard resources
- */
-extern int ecard_request_resources(struct expansion_card *ec);
-extern void ecard_release_resources(struct expansion_card *ec);
-
-void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
-                          unsigned long offset, unsigned long maxsize);
-#define ecardm_iounmap(__ec, __addr)   devm_iounmap(&(__ec)->dev, __addr)
-
-extern struct bus_type ecard_bus_type;
-
-#define ECARD_DEV(_d)  container_of((_d), struct expansion_card, dev)
-
-struct ecard_driver {
-       int                     (*probe)(struct expansion_card *, const struct ecard_id *id);
-       void                    (*remove)(struct expansion_card *);
-       void                    (*shutdown)(struct expansion_card *);
-       const struct ecard_id   *id_table;
-       unsigned int            id;
-       struct device_driver    drv;
-};
-
-#define ECARD_DRV(_d)  container_of((_d), struct ecard_driver, drv)
-
-#define ecard_set_drvdata(ec,data)     dev_set_drvdata(&(ec)->dev, (data))
-#define ecard_get_drvdata(ec)          dev_get_drvdata(&(ec)->dev)
-
-int ecard_register_driver(struct ecard_driver *);
-void ecard_remove_driver(struct ecard_driver *);
-
-#endif
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
deleted file mode 100644 (file)
index 4ca7516..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef __ASMARM_ELF_H
-#define __ASMARM_ELF_H
-
-#include <asm/hwcap.h>
-
-#ifndef __ASSEMBLY__
-/*
- * ELF register definitions..
- */
-#include <asm/ptrace.h>
-#include <asm/user.h>
-
-typedef unsigned long elf_greg_t;
-typedef unsigned long elf_freg_t[3];
-
-#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-typedef struct user_fp elf_fpregset_t;
-#endif
-
-#define EM_ARM 40
-#define EF_ARM_APCS26 0x08
-#define EF_ARM_SOFT_FLOAT 0x200
-#define EF_ARM_EABI_MASK 0xFF000000
-
-#define R_ARM_NONE     0
-#define R_ARM_PC24     1
-#define R_ARM_ABS32    2
-#define R_ARM_CALL     28
-#define R_ARM_JUMP24   29
-
-/*
- * These are used to set parameters in the core dumps.
- */
-#define ELF_CLASS      ELFCLASS32
-#ifdef __ARMEB__
-#define ELF_DATA       ELFDATA2MSB
-#else
-#define ELF_DATA       ELFDATA2LSB
-#endif
-#define ELF_ARCH       EM_ARM
-
-#ifndef __ASSEMBLY__
-/*
- * 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.
- *
- * For now we just provide a fairly general string that describes the
- * processor family.  This could be made more specific later if someone
- * implemented optimisations that require it.  26-bit CPUs give you
- * "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
- * supported).  32-bit CPUs give you "v3[lb]" for anything based on an
- * ARM6 or ARM7 core and "armv4[lb]" for anything based on a StrongARM-1
- * core.
- */
-#define ELF_PLATFORM_SIZE 8
-#define ELF_PLATFORM   (elf_platform)
-
-extern char elf_platform[];
-#endif
-
-/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x) ((x)->e_machine == EM_ARM && ELF_PROC_OK(x))
-
-/*
- * 32-bit code is always OK.  Some cpus can do 26-bit, some can't.
- */
-#define ELF_PROC_OK(x) (ELF_THUMB_OK(x) && ELF_26BIT_OK(x))
-
-#define ELF_THUMB_OK(x) \
-       ((elf_hwcap & HWCAP_THUMB && ((x)->e_entry & 1) == 1) || \
-        ((x)->e_entry & 3) == 0)
-
-#define ELF_26BIT_OK(x) \
-       ((elf_hwcap & HWCAP_26BIT && (x)->e_flags & EF_ARM_APCS26) || \
-         ((x)->e_flags & EF_ARM_APCS26) == 0)
-
-#define USE_ELF_CORE_DUMP
-#define ELF_EXEC_PAGESIZE      4096
-
-/* 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        (2 * TASK_SIZE / 3)
-
-/* When the program starts, a1 contains a pointer to a function to be 
-   registered with atexit, as per the SVR4 ABI.  A value of 0 means we 
-   have no such handler.  */
-#define ELF_PLAT_INIT(_r, load_addr)   (_r)->ARM_r0 = 0
-
-/*
- * Since the FPA coprocessor uses CP1 and CP2, and iWMMXt uses CP0
- * and CP1, we only enable access to the iWMMXt coprocessor if the
- * binary is EABI or softfloat (and thus, guaranteed not to use
- * FPA instructions.)
- */
-#define SET_PERSONALITY(ex, ibcs2)                                     \
-       do {                                                            \
-               if ((ex).e_flags & EF_ARM_APCS26) {                     \
-                       set_personality(PER_LINUX);                     \
-               } else {                                                \
-                       set_personality(PER_LINUX_32BIT);               \
-                       if (elf_hwcap & HWCAP_IWMMXT && (ex).e_flags & (EF_ARM_EABI_MASK | EF_ARM_SOFT_FLOAT)) \
-                               set_thread_flag(TIF_USING_IWMMXT);      \
-                       else                                            \
-                               clear_thread_flag(TIF_USING_IWMMXT);    \
-               }                                                       \
-       } while (0)
-
-#endif
diff --git a/include/asm-arm/emergency-restart.h b/include/asm-arm/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-arm/errno.h b/include/asm-arm/errno.h
deleted file mode 100644 (file)
index 6e60f06..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ARM_ERRNO_H
-#define _ARM_ERRNO_H
-
-#include <asm-generic/errno.h>
-
-#endif
diff --git a/include/asm-arm/fb.h b/include/asm-arm/fb.h
deleted file mode 100644 (file)
index d92e99c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
-
-#include <linux/fb.h>
-#include <linux/fs.h>
-#include <asm/page.h>
-
-static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
-                               unsigned long off)
-{
-       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
-}
-
-static inline int fb_is_primary_device(struct fb_info *info)
-{
-       return 0;
-}
-
-#endif /* _ASM_FB_H_ */
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
deleted file mode 100644 (file)
index a80b660..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ARM_FCNTL_H
-#define _ARM_FCNTL_H
-
-#define O_DIRECTORY     040000 /* must be a directory */
-#define O_NOFOLLOW     0100000 /* don't follow links */
-#define O_DIRECT       0200000 /* direct disk access hint - currently ignored */
-#define O_LARGEFILE    0400000
-
-#include <asm-generic/fcntl.h>
-
-#endif
diff --git a/include/asm-arm/fiq.h b/include/asm-arm/fiq.h
deleted file mode 100644 (file)
index a3bad09..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  linux/include/asm-arm/fiq.h
- *
- * Support for FIQ on ARM architectures.
- * Written by Philip Blundell <philb@gnu.org>, 1998
- * Re-written by Russell King
- */
-
-#ifndef __ASM_FIQ_H
-#define __ASM_FIQ_H
-
-#include <asm/ptrace.h>
-
-struct fiq_handler {
-       struct fiq_handler *next;
-       /* Name
-        */
-       const char *name;
-       /* Called to ask driver to relinquish/
-        * reacquire FIQ
-        * return zero to accept, or -<errno>
-        */
-       int (*fiq_op)(void *, int relinquish);
-       /* data for the relinquish/reacquire functions
-        */
-       void *dev_id;
-};
-
-extern int claim_fiq(struct fiq_handler *f);
-extern void release_fiq(struct fiq_handler *f);
-extern void set_fiq_handler(void *start, unsigned int length);
-extern void set_fiq_regs(struct pt_regs *regs);
-extern void get_fiq_regs(struct pt_regs *regs);
-extern void enable_fiq(int fiq);
-extern void disable_fiq(int fiq);
-
-#endif
diff --git a/include/asm-arm/flat.h b/include/asm-arm/flat.h
deleted file mode 100644 (file)
index 9918aa4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * include/asm-arm/flat.h -- uClinux flat-format executables
- */
-
-#ifndef __ARM_FLAT_H__
-#define __ARM_FLAT_H__
-
-/* An odd number of words will be pushed after this alignment, so
-   deliberately misalign the value.  */
-#define        flat_stack_align(sp)    sp = (void *)(((unsigned long)(sp) - 4) | 4)
-#define        flat_argvp_envp_on_stack()              1
-#define        flat_old_ram_flag(flags)                (flags)
-#define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
-#define        flat_get_addr_from_rp(rp, relval, flags, persistent) get_unaligned(rp)
-#define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
-#define        flat_get_relocate_addr(rel)             (rel)
-#define        flat_set_persistent(relval, p)          0
-
-#endif /* __ARM_FLAT_H__ */
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
deleted file mode 100644 (file)
index 41a5e9d..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *  linux/include/asm-arm/floppy.h
- *
- *  Copyright (C) 1996-2000 Russell King
- *
- * 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.
- *
- *  Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
- */
-#ifndef __ASM_ARM_FLOPPY_H
-#define __ASM_ARM_FLOPPY_H
-#if 0
-#include <asm/arch/floppy.h>
-#endif
-
-#define fd_outb(val,port)                      \
-       do {                                    \
-               if ((port) == FD_DOR)           \
-                       fd_setdor((val));       \
-               else                            \
-                       outb((val),(port));     \
-       } while(0)
-
-#define fd_inb(port)           inb((port))
-#define fd_request_irq()       request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
-                                           IRQF_DISABLED,"floppy",NULL)
-#define fd_free_irq()          free_irq(IRQ_FLOPPYDISK,NULL)
-#define fd_disable_irq()       disable_irq(IRQ_FLOPPYDISK)
-#define fd_enable_irq()                enable_irq(IRQ_FLOPPYDISK)
-
-static inline int fd_dma_setup(void *data, unsigned int length,
-                              unsigned int mode, unsigned long addr)
-{
-       set_dma_mode(DMA_FLOPPY, mode);
-       __set_dma_addr(DMA_FLOPPY, data);
-       set_dma_count(DMA_FLOPPY, length);
-       virtual_dma_port = addr;
-       enable_dma(DMA_FLOPPY);
-       return 0;
-}
-#define fd_dma_setup           fd_dma_setup
-
-#define fd_request_dma()       request_dma(DMA_FLOPPY,"floppy")
-#define fd_free_dma()          free_dma(DMA_FLOPPY)
-#define fd_disable_dma()       disable_dma(DMA_FLOPPY)
-
-/* need to clean up dma.h */
-#define DMA_FLOPPYDISK         DMA_FLOPPY
-
-/* Floppy_selects is the list of DOR's to select drive fd
- *
- * On initialisation, the floppy list is scanned, and the drives allocated
- * in the order that they are found.  This is done by seeking the drive
- * to a non-zero track, and then restoring it to track 0.  If an error occurs,
- * then there is no floppy drive present.       [to be put back in again]
- */
-static unsigned char floppy_selects[2][4] =
-{
-       { 0x10, 0x21, 0x23, 0x33 },
-       { 0x10, 0x21, 0x23, 0x33 }
-};
-
-#define fd_setdor(dor)                                                         \
-do {                                                                           \
-       int new_dor = (dor);                                                    \
-       if (new_dor & 0xf0)                                                     \
-               new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3];  \
-       else                                                                    \
-               new_dor &= 0x0c;                                                \
-       outb(new_dor, FD_DOR);                                                  \
-} while (0)
-
-/*
- * Someday, we'll automatically detect which drives are present...
- */
-static inline void fd_scandrives (void)
-{
-#if 0
-       int floppy, drive_count;
-
-       fd_disable_irq();
-       raw_cmd = &default_raw_cmd;
-       raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
-       raw_cmd->track = 0;
-       raw_cmd->rate = ?;
-       drive_count = 0;
-       for (floppy = 0; floppy < 4; floppy ++) {
-               current_drive = drive_count;
-               /*
-                * Turn on floppy motor
-                */
-               if (start_motor(redo_fd_request))
-                       continue;
-               /*
-                * Set up FDC
-                */
-               fdc_specify();
-               /*
-                * Tell FDC to recalibrate
-                */
-               output_byte(FD_RECALIBRATE);
-               LAST_OUT(UNIT(floppy));
-               /* wait for command to complete */
-               if (!successful) {
-                       int i;
-                       for (i = drive_count; i < 3; i--)
-                               floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
-                       floppy_selects[fdc][3] = 0;
-                       floppy -= 1;
-               } else
-                       drive_count++;
-       }
-#else
-       floppy_selects[0][0] = 0x10;
-       floppy_selects[0][1] = 0x21;
-       floppy_selects[0][2] = 0x23;
-       floppy_selects[0][3] = 0x33;
-#endif
-}
-
-#define FDC1 (0x3f0)
-
-#define FLOPPY0_TYPE 4
-#define FLOPPY1_TYPE 4
-
-#define N_FDC 1
-#define N_DRIVE 4
-
-#define CROSS_64KB(a,s) (0)
-
-/*
- * This allows people to reverse the order of
- * fd0 and fd1, in case their hardware is
- * strangely connected (as some RiscPCs
- * and A5000s seem to be).
- */
-static void driveswap(int *ints, int dummy, int dummy2)
-{
-       floppy_selects[0][0] ^= floppy_selects[0][1];
-       floppy_selects[0][1] ^= floppy_selects[0][0];
-       floppy_selects[0][0] ^= floppy_selects[0][1];
-}
-
-#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
-       
-#endif
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
deleted file mode 100644 (file)
index 392eb53..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *  linux/include/asm-arm/fpstate.h
- *
- *  Copyright (C) 1995 Russell King
- *
- * 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.
- */
-
-#ifndef __ASM_ARM_FPSTATE_H
-#define __ASM_ARM_FPSTATE_H
-
-
-#ifndef __ASSEMBLY__
-
-/*
- * VFP storage area has:
- *  - FPEXC, FPSCR, FPINST and FPINST2.
- *  - 16 or 32 double precision data registers
- *  - an implementation-dependant word of state for FLDMX/FSTMX (pre-ARMv6)
- * 
- *  FPEXC will always be non-zero once the VFP has been used in this process.
- */
-
-struct vfp_hard_struct {
-#ifdef CONFIG_VFPv3
-       __u64 fpregs[32];
-#else
-       __u64 fpregs[16];
-#endif
-#if __LINUX_ARM_ARCH__ < 6
-       __u32 fpmx_state;
-#endif
-       __u32 fpexc;
-       __u32 fpscr;
-       /*
-        * VFP implementation specific state
-        */
-       __u32 fpinst;
-       __u32 fpinst2;
-
-#ifdef CONFIG_SMP
-       __u32 cpu;
-#endif
-};
-
-union vfp_state {
-       struct vfp_hard_struct  hard;
-};
-
-extern void vfp_flush_thread(union vfp_state *);
-extern void vfp_release_thread(union vfp_state *);
-
-#define FP_HARD_SIZE 35
-
-struct fp_hard_struct {
-       unsigned int save[FP_HARD_SIZE];                /* as yet undefined */
-};
-
-#define FP_SOFT_SIZE 35
-
-struct fp_soft_struct {
-       unsigned int save[FP_SOFT_SIZE];                /* undefined information */
-};
-
-#define IWMMXT_SIZE    0x98
-
-struct iwmmxt_struct {
-       unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
-};
-
-union fp_state {
-       struct fp_hard_struct   hard;
-       struct fp_soft_struct   soft;
-#ifdef CONFIG_IWMMXT
-       struct iwmmxt_struct    iwmmxt;
-#endif
-};
-
-#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
-
-struct crunch_state {
-       unsigned int    mvdx[16][2];
-       unsigned int    mvax[4][3];
-       unsigned int    dspsc[2];
-};
-
-#define CRUNCH_SIZE    sizeof(struct crunch_state)
-
-#endif
-
-#endif
diff --git a/include/asm-arm/ftrace.h b/include/asm-arm/ftrace.h
deleted file mode 100644 (file)
index 584ef9a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _ASM_ARM_FTRACE
-#define _ASM_ARM_FTRACE
-
-#ifdef CONFIG_FTRACE
-#define MCOUNT_ADDR            ((long)(mcount))
-#define MCOUNT_INSN_SIZE       4 /* sizeof mcount call */
-
-#ifndef __ASSEMBLY__
-extern void mcount(void);
-#endif
-
-#endif
-
-#endif /* _ASM_ARM_FTRACE */
diff --git a/include/asm-arm/futex.h b/include/asm-arm/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-arm/glue.h b/include/asm-arm/glue.h
deleted file mode 100644 (file)
index a97a182..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- *  linux/include/asm-arm/glue.h
- *
- *  Copyright (C) 1997-1999 Russell King
- *  Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
- *
- * 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.
- *
- *  This file provides the glue to stick the processor-specific bits
- *  into the kernel in an efficient manner.  The idea is to use branches
- *  when we're only targetting one class of TLB, or indirect calls
- *  when we're targetting multiple classes of TLBs.
- */
-#ifdef __KERNEL__
-
-
-#ifdef __STDC__
-#define ____glue(name,fn)      name##fn
-#else
-#define ____glue(name,fn)      name/**/fn
-#endif
-#define __glue(name,fn)                ____glue(name,fn)
-
-
-
-/*
- *     Data Abort Model
- *     ================
- *
- *     We have the following to choose from:
- *       arm6          - ARM6 style
- *       arm7          - ARM7 style
- *       v4_early      - ARMv4 without Thumb early abort handler
- *       v4t_late      - ARMv4 with Thumb late abort handler
- *       v4t_early     - ARMv4 with Thumb early abort handler
- *       v5tej_early   - ARMv5 with Thumb and Java early abort handler
- *       xscale        - ARMv5 with Thumb with Xscale extensions
- *       v6_early      - ARMv6 generic early abort handler
- *       v7_early      - ARMv7 generic early abort handler
- */
-#undef CPU_DABORT_HANDLER
-#undef MULTI_DABORT
-
-#if defined(CONFIG_CPU_ARM610)
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER cpu_arm6_data_abort
-# endif
-#endif
-
-#if defined(CONFIG_CPU_ARM710)
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER cpu_arm7_data_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_LV4T
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v4t_late_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV4
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v4_early_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV4T
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v4t_early_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV5TJ
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v5tj_early_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV5T
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v5t_early_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV6
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v6_early_abort
-# endif
-#endif
-
-#ifdef CONFIG_CPU_ABRT_EV7
-# ifdef CPU_DABORT_HANDLER
-#  define MULTI_DABORT 1
-# else
-#  define CPU_DABORT_HANDLER v7_early_abort
-# endif
-#endif
-
-#ifndef CPU_DABORT_HANDLER
-#error Unknown data abort handler type
-#endif
-
-/*
- * Prefetch abort handler.  If the CPU has an IFAR use that, otherwise
- * use the address of the aborted instruction
- */
-#undef CPU_PABORT_HANDLER
-#undef MULTI_PABORT
-
-#ifdef CONFIG_CPU_PABRT_IFAR
-# ifdef CPU_PABORT_HANDLER
-#  define MULTI_PABORT 1
-# else
-#  define CPU_PABORT_HANDLER(reg, insn)        mrc p15, 0, reg, cr6, cr0, 2
-# endif
-#endif
-
-#ifdef CONFIG_CPU_PABRT_NOIFAR
-# ifdef CPU_PABORT_HANDLER
-#  define MULTI_PABORT 1
-# else
-#  define CPU_PABORT_HANDLER(reg, insn)        mov reg, insn
-# endif
-#endif
-
-#ifndef CPU_PABORT_HANDLER
-#error Unknown prefetch abort handler type
-#endif
-
-#endif
diff --git a/include/asm-arm/gpio.h b/include/asm-arm/gpio.h
deleted file mode 100644 (file)
index fff4f80..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ARCH_ARM_GPIO_H
-#define _ARCH_ARM_GPIO_H
-
-/* not all ARM platforms necessarily support this API ... */
-#include <asm/arch/gpio.h>
-
-#endif /* _ARCH_ARM_GPIO_H */
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h
deleted file mode 100644 (file)
index 182310b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-#include <linux/cache.h>
-#include <linux/threads.h>
-#include <asm/irq.h>
-
-typedef struct {
-       unsigned int __softirq_pending;
-       unsigned int local_timer_irqs;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
-
-#if NR_IRQS > 256
-#define HARDIRQ_BITS   9
-#else
-#define HARDIRQ_BITS   8
-#endif
-
-/*
- * The hardirq mask has to be large enough to have space
- * for potentially all IRQ sources in the system nesting
- * on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
-#define __ARCH_IRQ_EXIT_IRQS_DISABLED  1
-
-#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
deleted file mode 100644 (file)
index 1fd1a5b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware.h
- *
- *  Copyright (C) 1996 Russell King
- *
- * 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.
- *
- *  Common hardware definitions
- */
-
-#ifndef __ASM_HARDWARE_H
-#define __ASM_HARDWARE_H
-
-#include <asm/arch/hardware.h>
-
-#endif
diff --git a/include/asm-arm/hardware/arm_timer.h b/include/asm-arm/hardware/arm_timer.h
deleted file mode 100644 (file)
index 04be3bd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
-#define __ASM_ARM_HARDWARE_ARM_TIMER_H
-
-#define TIMER_LOAD     0x00
-#define TIMER_VALUE    0x04
-#define TIMER_CTRL     0x08
-#define TIMER_CTRL_ONESHOT     (1 << 0)
-#define TIMER_CTRL_32BIT       (1 << 1)
-#define TIMER_CTRL_DIV1                (0 << 2)
-#define TIMER_CTRL_DIV16       (1 << 2)
-#define TIMER_CTRL_DIV256      (2 << 2)
-#define TIMER_CTRL_IE          (1 << 5)        /* Interrupt Enable (versatile only) */
-#define TIMER_CTRL_PERIODIC    (1 << 6)
-#define TIMER_CTRL_ENABLE      (1 << 7)
-
-#define TIMER_INTCLR   0x0c
-#define TIMER_RIS      0x10
-#define TIMER_MIS      0x14
-#define TIMER_BGLOAD   0x18
-
-#endif
diff --git a/include/asm-arm/hardware/arm_twd.h b/include/asm-arm/hardware/arm_twd.h
deleted file mode 100644 (file)
index e521b70..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __ASM_HARDWARE_TWD_H
-#define __ASM_HARDWARE_TWD_H
-
-#define TWD_TIMER_LOAD                         0x00
-#define TWD_TIMER_COUNTER              0x04
-#define TWD_TIMER_CONTROL              0x08
-#define TWD_TIMER_INTSTAT              0x0C
-
-#define TWD_WDOG_LOAD                  0x20
-#define TWD_WDOG_COUNTER               0x24
-#define TWD_WDOG_CONTROL               0x28
-#define TWD_WDOG_INTSTAT               0x2C
-#define TWD_WDOG_RESETSTAT             0x30
-#define TWD_WDOG_DISABLE               0x34
-
-#define TWD_TIMER_CONTROL_ENABLE       (1 << 0)
-#define TWD_TIMER_CONTROL_ONESHOT      (0 << 1)
-#define TWD_TIMER_CONTROL_PERIODIC     (1 << 1)
-#define TWD_TIMER_CONTROL_IT_ENABLE    (1 << 2)
-
-#endif
diff --git a/include/asm-arm/hardware/cache-l2x0.h b/include/asm-arm/hardware/cache-l2x0.h
deleted file mode 100644 (file)
index 54029a7..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * include/asm-arm/hardware/cache-l2x0.h
- *
- * Copyright (C) 2007 ARM Limited
- *
- * 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.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __ASM_ARM_HARDWARE_L2X0_H
-#define __ASM_ARM_HARDWARE_L2X0_H
-
-#define L2X0_CACHE_ID                  0x000
-#define L2X0_CACHE_TYPE                        0x004
-#define L2X0_CTRL                      0x100
-#define L2X0_AUX_CTRL                  0x104
-#define L2X0_EVENT_CNT_CTRL            0x200
-#define L2X0_EVENT_CNT1_CFG            0x204
-#define L2X0_EVENT_CNT0_CFG            0x208
-#define L2X0_EVENT_CNT1_VAL            0x20C
-#define L2X0_EVENT_CNT0_VAL            0x210
-#define L2X0_INTR_MASK                 0x214
-#define L2X0_MASKED_INTR_STAT          0x218
-#define L2X0_RAW_INTR_STAT             0x21C
-#define L2X0_INTR_CLEAR                        0x220
-#define L2X0_CACHE_SYNC                        0x730
-#define L2X0_INV_LINE_PA               0x770
-#define L2X0_INV_WAY                   0x77C
-#define L2X0_CLEAN_LINE_PA             0x7B0
-#define L2X0_CLEAN_LINE_IDX            0x7B8
-#define L2X0_CLEAN_WAY                 0x7BC
-#define L2X0_CLEAN_INV_LINE_PA         0x7F0
-#define L2X0_CLEAN_INV_LINE_IDX                0x7F8
-#define L2X0_CLEAN_INV_WAY             0x7FC
-#define L2X0_LOCKDOWN_WAY_D            0x900
-#define L2X0_LOCKDOWN_WAY_I            0x904
-#define L2X0_TEST_OPERATION            0xF00
-#define L2X0_LINE_DATA                 0xF10
-#define L2X0_LINE_TAG                  0xF30
-#define L2X0_DEBUG_CTRL                        0xF40
-
-#ifndef __ASSEMBLY__
-extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
-#endif
-
-#endif
diff --git a/include/asm-arm/hardware/clps7111.h b/include/asm-arm/hardware/clps7111.h
deleted file mode 100644 (file)
index 8d3228d..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/clps7111.h
- *
- *  This file contains the hardware definitions of the CLPS7111 internal
- *  registers.
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_HARDWARE_CLPS7111_H
-#define __ASM_HARDWARE_CLPS7111_H
-
-#define CLPS7111_PHYS_BASE     (0x80000000)
-
-#ifndef __ASSEMBLY__
-#define clps_readb(off)                __raw_readb(CLPS7111_BASE + (off))
-#define clps_readw(off)                __raw_readw(CLPS7111_BASE + (off))
-#define clps_readl(off)                __raw_readl(CLPS7111_BASE + (off))
-#define clps_writeb(val,off)   __raw_writeb(val, CLPS7111_BASE + (off))
-#define clps_writew(val,off)   __raw_writew(val, CLPS7111_BASE + (off))
-#define clps_writel(val,off)   __raw_writel(val, CLPS7111_BASE + (off))
-#endif
-
-#define PADR           (0x0000)
-#define PBDR           (0x0001)
-#define PDDR           (0x0003)
-#define PADDR          (0x0040)
-#define PBDDR          (0x0041)
-#define PDDDR          (0x0043)
-#define PEDR           (0x0080)
-#define PEDDR          (0x00c0)
-#define SYSCON1                (0x0100)
-#define SYSFLG1                (0x0140)
-#define MEMCFG1                (0x0180)
-#define MEMCFG2                (0x01c0)
-#define DRFPR          (0x0200)
-#define INTSR1         (0x0240)
-#define INTMR1         (0x0280)
-#define LCDCON         (0x02c0)
-#define TC1D            (0x0300)
-#define TC2D           (0x0340)
-#define RTCDR          (0x0380)
-#define RTCMR          (0x03c0)
-#define PMPCON         (0x0400)
-#define CODR           (0x0440)
-#define UARTDR1                (0x0480)
-#define UBRLCR1                (0x04c0)
-#define SYNCIO         (0x0500)
-#define PALLSW         (0x0540)
-#define PALMSW         (0x0580)
-#define STFCLR         (0x05c0)
-#define BLEOI          (0x0600)
-#define MCEOI          (0x0640)
-#define TEOI           (0x0680)
-#define TC1EOI         (0x06c0)
-#define TC2EOI         (0x0700)
-#define RTCEOI         (0x0740)
-#define UMSEOI         (0x0780)
-#define COEOI          (0x07c0)
-#define HALT           (0x0800)
-#define STDBY          (0x0840)
-
-#define FBADDR         (0x1000)
-#define SYSCON2                (0x1100)
-#define SYSFLG2                (0x1140)
-#define INTSR2         (0x1240)
-#define INTMR2         (0x1280)
-#define UARTDR2                (0x1480)
-#define UBRLCR2                (0x14c0)
-#define SS2DR          (0x1500)
-#define SRXEOF         (0x1600)
-#define SS2POP         (0x16c0)
-#define KBDEOI         (0x1700)
-
-/* common bits: SYSCON1 / SYSCON2 */
-#define SYSCON_UARTEN          (1 << 8)
-
-#define SYSCON1_KBDSCAN(x)     ((x) & 15)
-#define SYSCON1_KBDSCANMASK    (15)
-#define SYSCON1_TC1M           (1 << 4)
-#define SYSCON1_TC1S           (1 << 5)
-#define SYSCON1_TC2M           (1 << 6)
-#define SYSCON1_TC2S           (1 << 7)
-#define SYSCON1_UART1EN                SYSCON_UARTEN
-#define SYSCON1_BZTOG          (1 << 9)
-#define SYSCON1_BZMOD          (1 << 10)
-#define SYSCON1_DBGEN          (1 << 11)
-#define SYSCON1_LCDEN          (1 << 12)
-#define SYSCON1_CDENTX         (1 << 13)
-#define SYSCON1_CDENRX         (1 << 14)
-#define SYSCON1_SIREN          (1 << 15)
-#define SYSCON1_ADCKSEL(x)     (((x) & 3) << 16)
-#define SYSCON1_ADCKSEL_MASK   (3 << 16)
-#define SYSCON1_EXCKEN         (1 << 18)
-#define SYSCON1_WAKEDIS                (1 << 19)
-#define SYSCON1_IRTXM          (1 << 20)
-
-/* common bits: SYSFLG1 / SYSFLG2 */
-#define SYSFLG_UBUSY           (1 << 11)
-#define SYSFLG_URXFE           (1 << 22)
-#define SYSFLG_UTXFF           (1 << 23)
-
-#define SYSFLG1_MCDR           (1 << 0)
-#define SYSFLG1_DCDET          (1 << 1)
-#define SYSFLG1_WUDR           (1 << 2)
-#define SYSFLG1_WUON           (1 << 3)
-#define SYSFLG1_CTS            (1 << 8)
-#define SYSFLG1_DSR            (1 << 9)
-#define SYSFLG1_DCD            (1 << 10)
-#define SYSFLG1_UBUSY          SYSFLG_UBUSY
-#define SYSFLG1_NBFLG          (1 << 12)
-#define SYSFLG1_RSTFLG         (1 << 13)
-#define SYSFLG1_PFFLG          (1 << 14)
-#define SYSFLG1_CLDFLG         (1 << 15)
-#define SYSFLG1_URXFE          SYSFLG_URXFE
-#define SYSFLG1_UTXFF          SYSFLG_UTXFF
-#define SYSFLG1_CRXFE          (1 << 24)
-#define SYSFLG1_CTXFF          (1 << 25)
-#define SYSFLG1_SSIBUSY                (1 << 26)
-#define SYSFLG1_ID             (1 << 29)
-
-#define SYSFLG2_SSRXOF         (1 << 0)
-#define SYSFLG2_RESVAL         (1 << 1)
-#define SYSFLG2_RESFRM         (1 << 2)
-#define SYSFLG2_SS2RXFE                (1 << 3)
-#define SYSFLG2_SS2TXFF                (1 << 4)
-#define SYSFLG2_SS2TXUF                (1 << 5)
-#define SYSFLG2_CKMODE         (1 << 6)
-#define SYSFLG2_UBUSY          SYSFLG_UBUSY
-#define SYSFLG2_URXFE          SYSFLG_URXFE
-#define SYSFLG2_UTXFF          SYSFLG_UTXFF
-
-#define LCDCON_GSEN            (1 << 30)
-#define LCDCON_GSMD            (1 << 31)
-
-#define SYSCON2_SERSEL         (1 << 0)
-#define SYSCON2_KBD6           (1 << 1)
-#define SYSCON2_DRAMZ          (1 << 2)
-#define SYSCON2_KBWEN          (1 << 3)
-#define SYSCON2_SS2TXEN                (1 << 4)
-#define SYSCON2_PCCARD1                (1 << 5)
-#define SYSCON2_PCCARD2                (1 << 6)
-#define SYSCON2_SS2RXEN                (1 << 7)
-#define SYSCON2_UART2EN                SYSCON_UARTEN
-#define SYSCON2_SS2MAEN                (1 << 9)
-#define SYSCON2_OSTB           (1 << 12)
-#define SYSCON2_CLKENSL                (1 << 13)
-#define SYSCON2_BUZFREQ                (1 << 14)
-
-/* common bits: UARTDR1 / UARTDR2 */
-#define UARTDR_FRMERR          (1 << 8)
-#define UARTDR_PARERR          (1 << 9)
-#define UARTDR_OVERR           (1 << 10)
-
-/* common bits: UBRLCR1 / UBRLCR2 */
-#define UBRLCR_BAUD_MASK       ((1 << 12) - 1)
-#define UBRLCR_BREAK           (1 << 12)
-#define UBRLCR_PRTEN           (1 << 13)
-#define UBRLCR_EVENPRT         (1 << 14)
-#define UBRLCR_XSTOP           (1 << 15)
-#define UBRLCR_FIFOEN          (1 << 16)
-#define UBRLCR_WRDLEN5         (0 << 17)
-#define UBRLCR_WRDLEN6         (1 << 17)
-#define UBRLCR_WRDLEN7         (2 << 17)
-#define UBRLCR_WRDLEN8         (3 << 17)
-#define UBRLCR_WRDLEN_MASK     (3 << 17)
-
-#define SYNCIO_SMCKEN          (1 << 13)
-#define SYNCIO_TXFRMEN         (1 << 14)
-
-#endif /* __ASM_HARDWARE_CLPS7111_H */
diff --git a/include/asm-arm/hardware/cs89712.h b/include/asm-arm/hardware/cs89712.h
deleted file mode 100644 (file)
index ad99a3e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/cs89712.h
- *
- *  This file contains the hardware definitions of the CS89712
- *  additional internal registers.
- *
- *  Copyright (C) 2001 Thomas Gleixner autronix automation <gleixner@autronix.de>
- *                     
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_HARDWARE_CS89712_H
-#define __ASM_HARDWARE_CS89712_H
-
-/*
-*      CS89712 additional registers
-*/
-                                  
-#define PCDR                   0x0002  /* Port C Data register ---------------------------- */
-#define PCDDR                  0x0042  /* Port C Data Direction register ------------------ */
-#define SDCONF                 0x2300  /* SDRAM Configuration register ---------------------*/
-#define SDRFPR                 0x2340  /* SDRAM Refresh period register --------------------*/
-
-#define SDCONF_ACTIVE          (1 << 10)
-#define SDCONF_CLKCTL          (1 << 9)
-#define SDCONF_WIDTH_4         (0 << 7)
-#define SDCONF_WIDTH_8         (1 << 7)
-#define SDCONF_WIDTH_16                (2 << 7)
-#define SDCONF_WIDTH_32                (3 << 7)
-#define SDCONF_SIZE_16         (0 << 5)
-#define SDCONF_SIZE_64         (1 << 5)
-#define SDCONF_SIZE_128                (2 << 5)
-#define SDCONF_SIZE_256                (3 << 5)
-#define SDCONF_CASLAT_2                (2)
-#define SDCONF_CASLAT_3                (3)
-
-#endif /* __ASM_HARDWARE_CS89712_H */
diff --git a/include/asm-arm/hardware/debug-8250.S b/include/asm-arm/hardware/debug-8250.S
deleted file mode 100644 (file)
index 07c97fb..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * linux/include/asm-arm/hardware/debug-8250.S
- *
- *  Copyright (C) 1994-1999 Russell King
- *
- * 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.
- */
-#include <linux/serial_reg.h>
-
-               .macro  senduart,rd,rx
-               strb    \rd, [\rx, #UART_TX << UART_SHIFT]
-               .endm
-
-               .macro  busyuart,rd,rx
-1002:          ldrb    \rd, [\rx, #UART_LSR << UART_SHIFT]
-               and     \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
-               teq     \rd, #UART_LSR_TEMT | UART_LSR_THRE
-               bne     1002b
-               .endm
-
-               .macro  waituart,rd,rx
-#ifdef FLOW_CONTROL
-1001:          ldrb    \rd, [\rx, #UART_MSR << UART_SHIFT]
-               tst     \rd, #UART_MSR_CTS
-               beq     1001b
-#endif
-               .endm
diff --git a/include/asm-arm/hardware/debug-pl01x.S b/include/asm-arm/hardware/debug-pl01x.S
deleted file mode 100644 (file)
index 23c541a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* linux/include/asm-arm/hardware/debug-pl01x.S
- *
- * Debugging macro include header
- *
- *  Copyright (C) 1994-1999 Russell King
- *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
- *
- * 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.
- *
-*/
-#include <linux/amba/serial.h>
-
-               .macro  senduart,rd,rx
-               strb    \rd, [\rx, #UART01x_DR]
-               .endm
-
-               .macro  waituart,rd,rx
-1001:          ldr     \rd, [\rx, #UART01x_FR]
-               tst     \rd, #UART01x_FR_TXFF
-               bne     1001b
-               .endm
-
-               .macro  busyuart,rd,rx
-1001:          ldr     \rd, [\rx, #UART01x_FR]
-               tst     \rd, #UART01x_FR_BUSY
-               bne     1001b
-               .endm
diff --git a/include/asm-arm/hardware/dec21285.h b/include/asm-arm/hardware/dec21285.h
deleted file mode 100644 (file)
index 546f707..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/dec21285.h
- *
- *  Copyright (C) 1998 Russell King
- *
- * 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.
- *
- *  DC21285 registers
- */
-#define DC21285_PCI_IACK               0x79000000
-#define DC21285_ARMCSR_BASE            0x42000000
-#define DC21285_PCI_TYPE_0_CONFIG      0x7b000000
-#define DC21285_PCI_TYPE_1_CONFIG      0x7a000000
-#define DC21285_OUTBOUND_WRITE_FLUSH   0x78000000
-#define DC21285_FLASH                  0x41000000
-#define DC21285_PCI_IO                 0x7c000000
-#define DC21285_PCI_MEM                        0x80000000
-
-#ifndef __ASSEMBLY__
-#include <asm/hardware.h>
-#define DC21285_IO(x)          ((volatile unsigned long *)(ARMCSR_BASE+(x)))
-#else
-#define DC21285_IO(x)          (x)
-#endif
-
-#define CSR_PCICMD             DC21285_IO(0x0004)
-#define CSR_CLASSREV           DC21285_IO(0x0008)
-#define CSR_PCICACHELINESIZE   DC21285_IO(0x000c)
-#define CSR_PCICSRBASE         DC21285_IO(0x0010)
-#define CSR_PCICSRIOBASE       DC21285_IO(0x0014)
-#define CSR_PCISDRAMBASE       DC21285_IO(0x0018)
-#define CSR_PCIROMBASE         DC21285_IO(0x0030)
-#define CSR_MBOX0              DC21285_IO(0x0050)
-#define CSR_MBOX1              DC21285_IO(0x0054)
-#define CSR_MBOX2              DC21285_IO(0x0058)
-#define CSR_MBOX3              DC21285_IO(0x005c)
-#define CSR_DOORBELL           DC21285_IO(0x0060)
-#define CSR_DOORBELL_SETUP     DC21285_IO(0x0064)
-#define CSR_ROMWRITEREG                DC21285_IO(0x0068)
-#define CSR_CSRBASEMASK                DC21285_IO(0x00f8)
-#define CSR_CSRBASEOFFSET      DC21285_IO(0x00fc)
-#define CSR_SDRAMBASEMASK      DC21285_IO(0x0100)
-#define CSR_SDRAMBASEOFFSET    DC21285_IO(0x0104)
-#define CSR_ROMBASEMASK                DC21285_IO(0x0108)
-#define CSR_SDRAMTIMING                DC21285_IO(0x010c)
-#define CSR_SDRAMADDRSIZE0     DC21285_IO(0x0110)
-#define CSR_SDRAMADDRSIZE1     DC21285_IO(0x0114)
-#define CSR_SDRAMADDRSIZE2     DC21285_IO(0x0118)
-#define CSR_SDRAMADDRSIZE3     DC21285_IO(0x011c)
-#define CSR_I2O_INFREEHEAD     DC21285_IO(0x0120)
-#define CSR_I2O_INPOSTTAIL     DC21285_IO(0x0124)
-#define CSR_I2O_OUTPOSTHEAD    DC21285_IO(0x0128)
-#define CSR_I2O_OUTFREETAIL    DC21285_IO(0x012c)
-#define CSR_I2O_INFREECOUNT    DC21285_IO(0x0130)
-#define CSR_I2O_OUTPOSTCOUNT   DC21285_IO(0x0134)
-#define CSR_I2O_INPOSTCOUNT    DC21285_IO(0x0138)
-#define CSR_SA110_CNTL         DC21285_IO(0x013c)
-#define SA110_CNTL_INITCMPLETE         (1 << 0)
-#define SA110_CNTL_ASSERTSERR          (1 << 1)
-#define SA110_CNTL_RXSERR              (1 << 3)
-#define SA110_CNTL_SA110DRAMPARITY     (1 << 4)
-#define SA110_CNTL_PCISDRAMPARITY      (1 << 5)
-#define SA110_CNTL_DMASDRAMPARITY      (1 << 6)
-#define SA110_CNTL_DISCARDTIMER                (1 << 8)
-#define SA110_CNTL_PCINRESET           (1 << 9)
-#define SA110_CNTL_I2O_256             (0 << 10)
-#define SA110_CNTL_I20_512             (1 << 10)
-#define SA110_CNTL_I2O_1024            (2 << 10)
-#define SA110_CNTL_I2O_2048            (3 << 10)
-#define SA110_CNTL_I2O_4096            (4 << 10)
-#define SA110_CNTL_I2O_8192            (5 << 10)
-#define SA110_CNTL_I2O_16384           (6 << 10)
-#define SA110_CNTL_I2O_32768           (7 << 10)
-#define SA110_CNTL_WATCHDOG            (1 << 13)
-#define SA110_CNTL_ROMWIDTH_UNDEF      (0 << 14)
-#define SA110_CNTL_ROMWIDTH_16         (1 << 14)
-#define SA110_CNTL_ROMWIDTH_32         (2 << 14)
-#define SA110_CNTL_ROMWIDTH_8          (3 << 14)
-#define SA110_CNTL_ROMACCESSTIME(x)    ((x)<<16)
-#define SA110_CNTL_ROMBURSTTIME(x)     ((x)<<20)
-#define SA110_CNTL_ROMTRISTATETIME(x)  ((x)<<24)
-#define SA110_CNTL_XCSDIR(x)           ((x)<<28)
-#define SA110_CNTL_PCICFN              (1 << 31)
-
-/*
- * footbridge_cfn_mode() is used when we want
- * to check whether we are the central function
- */
-#define __footbridge_cfn_mode() (*CSR_SA110_CNTL & SA110_CNTL_PCICFN)
-#if defined(CONFIG_FOOTBRIDGE_HOST) && defined(CONFIG_FOOTBRIDGE_ADDIN)
-#define footbridge_cfn_mode() __footbridge_cfn_mode()
-#elif defined(CONFIG_FOOTBRIDGE_HOST)
-#define footbridge_cfn_mode() (1)
-#else
-#define footbridge_cfn_mode() (0)
-#endif
-
-#define CSR_PCIADDR_EXTN       DC21285_IO(0x0140)
-#define CSR_PREFETCHMEMRANGE   DC21285_IO(0x0144)
-#define CSR_XBUS_CYCLE         DC21285_IO(0x0148)
-#define CSR_XBUS_IOSTROBE      DC21285_IO(0x014c)
-#define CSR_DOORBELL_PCI       DC21285_IO(0x0150)
-#define CSR_DOORBELL_SA110     DC21285_IO(0x0154)
-#define CSR_UARTDR             DC21285_IO(0x0160)
-#define CSR_RXSTAT             DC21285_IO(0x0164)
-#define CSR_H_UBRLCR           DC21285_IO(0x0168)
-#define CSR_M_UBRLCR           DC21285_IO(0x016c)
-#define CSR_L_UBRLCR           DC21285_IO(0x0170)
-#define CSR_UARTCON            DC21285_IO(0x0174)
-#define CSR_UARTFLG            DC21285_IO(0x0178)
-#define CSR_IRQ_STATUS         DC21285_IO(0x0180)
-#define CSR_IRQ_RAWSTATUS      DC21285_IO(0x0184)
-#define CSR_IRQ_ENABLE         DC21285_IO(0x0188)
-#define CSR_IRQ_DISABLE                DC21285_IO(0x018c)
-#define CSR_IRQ_SOFT           DC21285_IO(0x0190)
-#define CSR_FIQ_STATUS         DC21285_IO(0x0280)
-#define CSR_FIQ_RAWSTATUS      DC21285_IO(0x0284)
-#define CSR_FIQ_ENABLE         DC21285_IO(0x0288)
-#define CSR_FIQ_DISABLE                DC21285_IO(0x028c)
-#define CSR_FIQ_SOFT           DC21285_IO(0x0290)
-#define CSR_TIMER1_LOAD                DC21285_IO(0x0300)
-#define CSR_TIMER1_VALUE       DC21285_IO(0x0304)
-#define CSR_TIMER1_CNTL                DC21285_IO(0x0308)
-#define CSR_TIMER1_CLR         DC21285_IO(0x030c)
-#define CSR_TIMER2_LOAD                DC21285_IO(0x0320)
-#define CSR_TIMER2_VALUE       DC21285_IO(0x0324)
-#define CSR_TIMER2_CNTL                DC21285_IO(0x0328)
-#define CSR_TIMER2_CLR         DC21285_IO(0x032c)
-#define CSR_TIMER3_LOAD                DC21285_IO(0x0340)
-#define CSR_TIMER3_VALUE       DC21285_IO(0x0344)
-#define CSR_TIMER3_CNTL                DC21285_IO(0x0348)
-#define CSR_TIMER3_CLR         DC21285_IO(0x034c)
-#define CSR_TIMER4_LOAD                DC21285_IO(0x0360)
-#define CSR_TIMER4_VALUE       DC21285_IO(0x0364)
-#define CSR_TIMER4_CNTL                DC21285_IO(0x0368)
-#define CSR_TIMER4_CLR         DC21285_IO(0x036c)
-
-#define TIMER_CNTL_ENABLE      (1 << 7)
-#define TIMER_CNTL_AUTORELOAD  (1 << 6)
-#define TIMER_CNTL_DIV1                (0)
-#define TIMER_CNTL_DIV16       (1 << 2)
-#define TIMER_CNTL_DIV256      (2 << 2)
-#define TIMER_CNTL_CNTEXT      (3 << 2)
-
-
diff --git a/include/asm-arm/hardware/entry-macro-iomd.S b/include/asm-arm/hardware/entry-macro-iomd.S
deleted file mode 100644 (file)
index 9bb580a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * include/asm-arm/hardware/entry-macro-iomd.S
- *
- * Low-level IRQ helper macros for IOC/IOMD based platforms
- *
- * 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.
- */
-
-/* IOC / IOMD based hardware */
-#include <asm/hardware/iomd.h>
-
-               .macro  disable_fiq
-               mov     r12, #ioc_base_high
-               .if     ioc_base_low
-               orr     r12, r12, #ioc_base_low
-               .endif
-               strb    r12, [r12, #0x38]       @ Disable FIQ register
-               .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldrb    \irqstat, [\base, #IOMD_IRQREQB]        @ get high priority first
-               ldr     \tmp, =irq_prio_h
-               teq     \irqstat, #0
-#ifdef IOMD_BASE
-               ldreqb  \irqstat, [\base, #IOMD_DMAREQ] @ get dma
-               addeq   \tmp, \tmp, #256                @ irq_prio_h table size
-               teqeq   \irqstat, #0
-               bne     2406f
-#endif
-               ldreqb  \irqstat, [\base, #IOMD_IRQREQA]        @ get low priority
-               addeq   \tmp, \tmp, #256                @ irq_prio_d table size
-               teqeq   \irqstat, #0
-#ifdef IOMD_IRQREQC
-               ldreqb  \irqstat, [\base, #IOMD_IRQREQC]
-               addeq   \tmp, \tmp, #256                @ irq_prio_l table size
-               teqeq   \irqstat, #0
-#endif
-#ifdef IOMD_IRQREQD
-               ldreqb  \irqstat, [\base, #IOMD_IRQREQD]
-               addeq   \tmp, \tmp, #256                @ irq_prio_lc table size
-               teqeq   \irqstat, #0
-#endif
-2406:          ldrneb  \irqnr, [\tmp, \irqstat]        @ get IRQ number
-               .endm
-
-/*
- * Interrupt table (incorporates priority).  Please note that we
- * rely on the order of these tables (see above code).
- */
-               .align  5
-irq_prio_h:    .byte    0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-               .byte   13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
-#ifdef IOMD_BASE
-irq_prio_d:    .byte    0,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   20,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-               .byte   21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
-#endif
-irq_prio_l:    .byte    0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
-               .byte    4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
-               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
-               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
-               .byte    6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
-               .byte    6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
-               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
-               .byte    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-               .byte    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
-#ifdef IOMD_IRQREQC
-irq_prio_lc:   .byte   24,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
-               .byte   28,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
-               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
-               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
-               .byte   30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
-               .byte   30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
-               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
-               .byte   29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-               .byte   31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
-#endif
-#ifdef IOMD_IRQREQD
-irq_prio_ld:   .byte   40,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
-               .byte   44,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
-               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
-               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
-               .byte   46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
-               .byte   46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
-               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
-               .byte   45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-               .byte   47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
-#endif
-
diff --git a/include/asm-arm/hardware/ep7211.h b/include/asm-arm/hardware/ep7211.h
deleted file mode 100644 (file)
index 017aa68..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/ep7211.h
- *
- *  This file contains the hardware definitions of the EP7211 internal
- *  registers.
- *
- *  Copyright (C) 2001 Blue Mug, Inc.  All Rights Reserved.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_HARDWARE_EP7211_H
-#define __ASM_HARDWARE_EP7211_H
-
-#include <asm/hardware/clps7111.h>
-
-/*
- * define EP7211_BASE to be the base address of the region
- * you want to access.
- */
-
-#define EP7211_PHYS_BASE       (0x80000000)
-
-/*
- * XXX miket@bluemug.com: need to introduce EP7211 registers (those not
- * present in 7212) here.
- */
-
-#endif /* __ASM_HARDWARE_EP7211_H */
diff --git a/include/asm-arm/hardware/ep7212.h b/include/asm-arm/hardware/ep7212.h
deleted file mode 100644 (file)
index 0e952e7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/ep7212.h
- *
- *  This file contains the hardware definitions of the EP7212 internal
- *  registers.
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_HARDWARE_EP7212_H
-#define __ASM_HARDWARE_EP7212_H
-
-/*
- * define EP7212_BASE to be the base address of the region
- * you want to access.
- */
-
-#define EP7212_PHYS_BASE       (0x80000000)
-
-#ifndef __ASSEMBLY__
-#define ep_readl(off)          __raw_readl(EP7212_BASE + (off))
-#define ep_writel(val,off)     __raw_writel(val, EP7212_BASE + (off))
-#endif
-
-/*
- * These registers are specific to the EP7212 only
- */
-#define DAIR                   0x2000
-#define DAIR0                  0x2040
-#define DAIDR1                 0x2080
-#define DAIDR2                 0x20c0
-#define DAISR                  0x2100
-#define SYSCON3                        0x2200
-#define INTSR3                 0x2240
-#define INTMR3                 0x2280
-#define LEDFLSH                        0x22c0
-
-#define DAIR_DAIEN             (1 << 16)
-#define DAIR_ECS               (1 << 17)
-#define DAIR_LCTM              (1 << 19)
-#define DAIR_LCRM              (1 << 20)
-#define DAIR_RCTM              (1 << 21)
-#define DAIR_RCRM              (1 << 22)
-#define DAIR_LBM               (1 << 23)
-
-#define DAIDR2_FIFOEN          (1 << 15)
-#define DAIDR2_FIFOLEFT                (0x0d << 16)
-#define DAIDR2_FIFORIGHT       (0x11 << 16)
-
-#define DAISR_RCTS             (1 << 0)
-#define DAISR_RCRS             (1 << 1)
-#define DAISR_LCTS             (1 << 2)
-#define DAISR_LCRS             (1 << 3)
-#define DAISR_RCTU             (1 << 4)
-#define DAISR_RCRO             (1 << 5)
-#define DAISR_LCTU             (1 << 6)
-#define DAISR_LCRO             (1 << 7)
-#define DAISR_RCNF             (1 << 8)
-#define DAISR_RCNE             (1 << 9)
-#define DAISR_LCNF             (1 << 10)
-#define DAISR_LCNE             (1 << 11)
-#define DAISR_FIFO             (1 << 12)
-
-#define SYSCON3_ADCCON         (1 << 0)
-#define SYSCON3_DAISEL         (1 << 3)
-#define SYSCON3_ADCCKNSEN      (1 << 4)
-#define SYSCON3_FASTWAKE       (1 << 8)
-#define SYSCON3_DAIEN          (1 << 9)
-
-#endif /* __ASM_HARDWARE_EP7212_H */
diff --git a/include/asm-arm/hardware/gic.h b/include/asm-arm/hardware/gic.h
deleted file mode 100644 (file)
index 966e428..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/gic.h
- *
- *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
- *
- * 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.
- */
-#ifndef __ASM_ARM_HARDWARE_GIC_H
-#define __ASM_ARM_HARDWARE_GIC_H
-
-#include <linux/compiler.h>
-
-#define GIC_CPU_CTRL                   0x00
-#define GIC_CPU_PRIMASK                        0x04
-#define GIC_CPU_BINPOINT               0x08
-#define GIC_CPU_INTACK                 0x0c
-#define GIC_CPU_EOI                    0x10
-#define GIC_CPU_RUNNINGPRI             0x14
-#define GIC_CPU_HIGHPRI                        0x18
-
-#define GIC_DIST_CTRL                  0x000
-#define GIC_DIST_CTR                   0x004
-#define GIC_DIST_ENABLE_SET            0x100
-#define GIC_DIST_ENABLE_CLEAR          0x180
-#define GIC_DIST_PENDING_SET           0x200
-#define GIC_DIST_PENDING_CLEAR         0x280
-#define GIC_DIST_ACTIVE_BIT            0x300
-#define GIC_DIST_PRI                   0x400
-#define GIC_DIST_TARGET                        0x800
-#define GIC_DIST_CONFIG                        0xc00
-#define GIC_DIST_SOFTINT               0xf00
-
-#ifndef __ASSEMBLY__
-void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start);
-void gic_cpu_init(unsigned int gic_nr, void __iomem *base);
-void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
-void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
-#endif
-
-#endif
diff --git a/include/asm-arm/hardware/icst307.h b/include/asm-arm/hardware/icst307.h
deleted file mode 100644 (file)
index ff8618a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/icst307.h
- *
- *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
- *
- * 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.
- *
- *  Support functions for calculating clocks/divisors for the ICS307
- *  clock generators.  See http://www.icst.com/ for more information
- *  on these devices.
- *
- *  This file is similar to the icst525.h file
- */
-#ifndef ASMARM_HARDWARE_ICST307_H
-#define ASMARM_HARDWARE_ICST307_H
-
-struct icst307_params {
-       unsigned long   ref;
-       unsigned long   vco_max;        /* inclusive */
-       unsigned short  vd_min;         /* inclusive */
-       unsigned short  vd_max;         /* inclusive */
-       unsigned char   rd_min;         /* inclusive */
-       unsigned char   rd_max;         /* inclusive */
-};
-
-struct icst307_vco {
-       unsigned short  v;
-       unsigned char   r;
-       unsigned char   s;
-};
-
-unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco);
-struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq);
-struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period);
-
-#endif
diff --git a/include/asm-arm/hardware/icst525.h b/include/asm-arm/hardware/icst525.h
deleted file mode 100644 (file)
index edd5a57..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/icst525.h
- *
- *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
- *
- * 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.
- *
- *  Support functions for calculating clocks/divisors for the ICST525
- *  clock generators.  See http://www.icst.com/ for more information
- *  on these devices.
- */
-#ifndef ASMARM_HARDWARE_ICST525_H
-#define ASMARM_HARDWARE_ICST525_H
-
-struct icst525_params {
-       unsigned long   ref;
-       unsigned long   vco_max;        /* inclusive */
-       unsigned short  vd_min;         /* inclusive */
-       unsigned short  vd_max;         /* inclusive */
-       unsigned char   rd_min;         /* inclusive */
-       unsigned char   rd_max;         /* inclusive */
-};
-
-struct icst525_vco {
-       unsigned short  v;
-       unsigned char   r;
-       unsigned char   s;
-};
-
-unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco);
-struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq);
-struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period);
-
-#endif
diff --git a/include/asm-arm/hardware/ioc.h b/include/asm-arm/hardware/ioc.h
deleted file mode 100644 (file)
index b3b46ef..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/ioc.h
- *
- *  Copyright (C) Russell King
- *
- * 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.
- *
- *  Use these macros to read/write the IOC.  All it does is perform the actual
- *  read/write.
- */
-#ifndef __ASMARM_HARDWARE_IOC_H
-#define __ASMARM_HARDWARE_IOC_H
-
-#ifndef __ASSEMBLY__
-
-/*
- * We use __raw_base variants here so that we give the compiler the
- * chance to keep IOC_BASE in a register.
- */
-#define ioc_readb(off)         __raw_readb(IOC_BASE + (off))
-#define ioc_writeb(val,off)    __raw_writeb(val, IOC_BASE + (off))
-
-#endif
-
-#define IOC_CONTROL    (0x00)
-#define IOC_KARTTX     (0x04)
-#define IOC_KARTRX     (0x04)
-
-#define IOC_IRQSTATA   (0x10)
-#define IOC_IRQREQA    (0x14)
-#define IOC_IRQCLRA    (0x14)
-#define IOC_IRQMASKA   (0x18)
-
-#define IOC_IRQSTATB   (0x20)
-#define IOC_IRQREQB    (0x24)
-#define IOC_IRQMASKB   (0x28)
-
-#define IOC_FIQSTAT    (0x30)
-#define IOC_FIQREQ     (0x34)
-#define IOC_FIQMASK    (0x38)
-
-#define IOC_T0CNTL     (0x40)
-#define IOC_T0LTCHL    (0x40)
-#define IOC_T0CNTH     (0x44)
-#define IOC_T0LTCHH    (0x44)
-#define IOC_T0GO       (0x48)
-#define IOC_T0LATCH    (0x4c)
-
-#define IOC_T1CNTL     (0x50)
-#define IOC_T1LTCHL    (0x50)
-#define IOC_T1CNTH     (0x54)
-#define IOC_T1LTCHH    (0x54)
-#define IOC_T1GO       (0x58)
-#define IOC_T1LATCH    (0x5c)
-
-#define IOC_T2CNTL     (0x60)
-#define IOC_T2LTCHL    (0x60)
-#define IOC_T2CNTH     (0x64)
-#define IOC_T2LTCHH    (0x64)
-#define IOC_T2GO       (0x68)
-#define IOC_T2LATCH    (0x6c)
-
-#define IOC_T3CNTL     (0x70)
-#define IOC_T3LTCHL    (0x70)
-#define IOC_T3CNTH     (0x74)
-#define IOC_T3LTCHH    (0x74)
-#define IOC_T3GO       (0x78)
-#define IOC_T3LATCH    (0x7c)
-
-#endif
diff --git a/include/asm-arm/hardware/iomd.h b/include/asm-arm/hardware/iomd.h
deleted file mode 100644 (file)
index 396e55a..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/iomd.h
- *
- *  Copyright (C) 1999 Russell King
- *
- * 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.
- *
- *  This file contains information out the IOMD ASIC used in the
- *  Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
- */
-#ifndef __ASMARM_HARDWARE_IOMD_H
-#define __ASMARM_HARDWARE_IOMD_H
-
-
-#ifndef __ASSEMBLY__
-
-/*
- * We use __raw_base variants here so that we give the compiler the
- * chance to keep IOC_BASE in a register.
- */
-#define iomd_readb(off)                __raw_readb(IOMD_BASE + (off))
-#define iomd_readl(off)                __raw_readl(IOMD_BASE + (off))
-#define iomd_writeb(val,off)   __raw_writeb(val, IOMD_BASE + (off))
-#define iomd_writel(val,off)   __raw_writel(val, IOMD_BASE + (off))
-
-#endif
-
-#define IOMD_CONTROL   (0x000)
-#define IOMD_KARTTX    (0x004)
-#define IOMD_KARTRX    (0x004)
-#define IOMD_KCTRL     (0x008)
-
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_IOLINES   (0x00C)
-#endif
-
-#define IOMD_IRQSTATA  (0x010)
-#define IOMD_IRQREQA   (0x014)
-#define IOMD_IRQCLRA   (0x014)
-#define IOMD_IRQMASKA  (0x018)
-
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_SUSMODE   (0x01C)
-#endif
-
-#define IOMD_IRQSTATB  (0x020)
-#define IOMD_IRQREQB   (0x024)
-#define IOMD_IRQMASKB  (0x028)
-
-#define IOMD_FIQSTAT   (0x030)
-#define IOMD_FIQREQ    (0x034)
-#define IOMD_FIQMASK   (0x038)
-
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_CLKCTL    (0x03C)
-#endif
-
-#define IOMD_T0CNTL    (0x040)
-#define IOMD_T0LTCHL   (0x040)
-#define IOMD_T0CNTH    (0x044)
-#define IOMD_T0LTCHH   (0x044)
-#define IOMD_T0GO      (0x048)
-#define IOMD_T0LATCH   (0x04c)
-
-#define IOMD_T1CNTL    (0x050)
-#define IOMD_T1LTCHL   (0x050)
-#define IOMD_T1CNTH    (0x054)
-#define IOMD_T1LTCHH   (0x054)
-#define IOMD_T1GO      (0x058)
-#define IOMD_T1LATCH   (0x05c)
-
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_IRQSTATC  (0x060)
-#define IOMD_IRQREQC   (0x064)
-#define IOMD_IRQMASKC  (0x068)
-
-#define IOMD_VIDMUX    (0x06c)
-
-#define IOMD_IRQSTATD  (0x070)
-#define IOMD_IRQREQD   (0x074)
-#define IOMD_IRQMASKD  (0x078)
-#endif
-
-#define IOMD_ROMCR0    (0x080)
-#define IOMD_ROMCR1    (0x084)
-#ifdef CONFIG_ARCH_RPC
-#define IOMD_DRAMCR    (0x088)
-#endif
-#define IOMD_REFCR     (0x08C)
-
-#define IOMD_FSIZE     (0x090)
-#define IOMD_ID0       (0x094)
-#define IOMD_ID1       (0x098)
-#define IOMD_VERSION   (0x09C)
-
-#ifdef CONFIG_ARCH_RPC
-#define IOMD_MOUSEX    (0x0A0)
-#define IOMD_MOUSEY    (0x0A4)
-#endif
-
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_MSEDAT    (0x0A8)
-#define IOMD_MSECTL    (0x0Ac)
-#endif
-
-#ifdef CONFIG_ARCH_RPC
-#define IOMD_DMATCR    (0x0C0)
-#endif
-#define IOMD_IOTCR     (0x0C4)
-#define IOMD_ECTCR     (0x0C8)
-#ifdef CONFIG_ARCH_RPC
-#define IOMD_DMAEXT    (0x0CC)
-#endif
-#ifdef CONFIG_ARCH_CLPS7500
-#define IOMD_ASTCR     (0x0CC)
-#define IOMD_DRAMCR    (0x0D0)
-#define IOMD_SELFREF   (0x0D4)
-#define IOMD_ATODICR   (0x0E0)
-#define IOMD_ATODSR    (0x0E4)
-#define IOMD_ATODCC    (0x0E8)
-#define IOMD_ATODCNT1  (0x0EC)
-#define IOMD_ATODCNT2  (0x0F0)
-#define IOMD_ATODCNT3  (0x0F4)
-#define IOMD_ATODCNT4  (0x0F8)
-#endif
-
-#ifdef CONFIG_ARCH_RPC
-#define DMA_EXT_IO0    1
-#define DMA_EXT_IO1    2
-#define DMA_EXT_IO2    4
-#define DMA_EXT_IO3    8
-
-#define IOMD_IO0CURA   (0x100)
-#define IOMD_IO0ENDA   (0x104)
-#define IOMD_IO0CURB   (0x108)
-#define IOMD_IO0ENDB   (0x10C)
-#define IOMD_IO0CR     (0x110)
-#define IOMD_IO0ST     (0x114)
-
-#define IOMD_IO1CURA   (0x120)
-#define IOMD_IO1ENDA   (0x124)
-#define IOMD_IO1CURB   (0x128)
-#define IOMD_IO1ENDB   (0x12C)
-#define IOMD_IO1CR     (0x130)
-#define IOMD_IO1ST     (0x134)
-
-#define IOMD_IO2CURA   (0x140)
-#define IOMD_IO2ENDA   (0x144)
-#define IOMD_IO2CURB   (0x148)
-#define IOMD_IO2ENDB   (0x14C)
-#define IOMD_IO2CR     (0x150)
-#define IOMD_IO2ST     (0x154)
-
-#define IOMD_IO3CURA   (0x160)
-#define IOMD_IO3ENDA   (0x164)
-#define IOMD_IO3CURB   (0x168)
-#define IOMD_IO3ENDB   (0x16C)
-#define IOMD_IO3CR     (0x170)
-#define IOMD_IO3ST     (0x174)
-#endif
-
-#define IOMD_SD0CURA   (0x180)
-#define IOMD_SD0ENDA   (0x184)
-#define IOMD_SD0CURB   (0x188)
-#define IOMD_SD0ENDB   (0x18C)
-#define IOMD_SD0CR     (0x190)
-#define IOMD_SD0ST     (0x194)
-
-#ifdef CONFIG_ARCH_RPC
-#define IOMD_SD1CURA   (0x1A0)
-#define IOMD_SD1ENDA   (0x1A4)
-#define IOMD_SD1CURB   (0x1A8)
-#define IOMD_SD1ENDB   (0x1AC)
-#define IOMD_SD1CR     (0x1B0)
-#define IOMD_SD1ST     (0x1B4)
-#endif
-
-#define IOMD_CURSCUR   (0x1C0)
-#define IOMD_CURSINIT  (0x1C4)
-
-#define IOMD_VIDCUR    (0x1D0)
-#define IOMD_VIDEND    (0x1D4)
-#define IOMD_VIDSTART  (0x1D8)
-#define IOMD_VIDINIT   (0x1DC)
-#define IOMD_VIDCR     (0x1E0)
-
-#define IOMD_DMASTAT   (0x1F0)
-#define IOMD_DMAREQ    (0x1F4)
-#define IOMD_DMAMASK   (0x1F8)
-
-#define DMA_END_S      (1 << 31)
-#define DMA_END_L      (1 << 30)
-
-#define DMA_CR_C       0x80
-#define DMA_CR_D       0x40
-#define DMA_CR_E       0x20
-
-#define DMA_ST_OFL     4
-#define DMA_ST_INT     2
-#define DMA_ST_AB      1
-
-/*
- * DMA (MEMC) compatibility
- */
-#define HALF_SAM       vram_half_sam
-#define VDMA_ALIGNMENT (HALF_SAM * 2)
-#define VDMA_XFERSIZE  (HALF_SAM)
-#define VDMA_INIT      IOMD_VIDINIT
-#define VDMA_START     IOMD_VIDSTART
-#define VDMA_END       IOMD_VIDEND
-
-#ifndef __ASSEMBLY__
-extern unsigned int vram_half_sam;
-#define video_set_dma(start,end,offset)                                \
-do {                                                           \
-       outl (SCREEN_START + start, VDMA_START);                \
-       outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END);    \
-       if (offset >= end - VDMA_XFERSIZE)                      \
-               offset |= 0x40000000;                           \
-       outl (SCREEN_START + offset, VDMA_INIT);                \
-} while (0)
-#endif
-
-#endif
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h
deleted file mode 100644 (file)
index af64676..0000000
+++ /dev/null
@@ -1,888 +0,0 @@
-/*
- * Copyright Â© 2006, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#ifndef _ADMA_H
-#define _ADMA_H
-#include <linux/types.h>
-#include <linux/io.h>
-#include <asm/hardware.h>
-#include <asm/hardware/iop_adma.h>
-
-/* Memory copy units */
-#define DMA_CCR(chan)          (chan->mmr_base + 0x0)
-#define DMA_CSR(chan)          (chan->mmr_base + 0x4)
-#define DMA_DAR(chan)          (chan->mmr_base + 0xc)
-#define DMA_NDAR(chan)         (chan->mmr_base + 0x10)
-#define DMA_PADR(chan)         (chan->mmr_base + 0x14)
-#define DMA_PUADR(chan)        (chan->mmr_base + 0x18)
-#define DMA_LADR(chan)         (chan->mmr_base + 0x1c)
-#define DMA_BCR(chan)          (chan->mmr_base + 0x20)
-#define DMA_DCR(chan)          (chan->mmr_base + 0x24)
-
-/* Application accelerator unit  */
-#define AAU_ACR(chan)          (chan->mmr_base + 0x0)
-#define AAU_ASR(chan)          (chan->mmr_base + 0x4)
-#define AAU_ADAR(chan)         (chan->mmr_base + 0x8)
-#define AAU_ANDAR(chan)        (chan->mmr_base + 0xc)
-#define AAU_SAR(src, chan)     (chan->mmr_base + (0x10 + ((src) << 2)))
-#define AAU_DAR(chan)          (chan->mmr_base + 0x20)
-#define AAU_ABCR(chan)         (chan->mmr_base + 0x24)
-#define AAU_ADCR(chan)         (chan->mmr_base + 0x28)
-#define AAU_SAR_EDCR(src_edc)  (chan->mmr_base + (0x02c + ((src_edc-4) << 2)))
-#define AAU_EDCR0_IDX  8
-#define AAU_EDCR1_IDX  17
-#define AAU_EDCR2_IDX  26
-
-#define DMA0_ID 0
-#define DMA1_ID 1
-#define AAU_ID 2
-
-struct iop3xx_aau_desc_ctrl {
-       unsigned int int_en:1;
-       unsigned int blk1_cmd_ctrl:3;
-       unsigned int blk2_cmd_ctrl:3;
-       unsigned int blk3_cmd_ctrl:3;
-       unsigned int blk4_cmd_ctrl:3;
-       unsigned int blk5_cmd_ctrl:3;
-       unsigned int blk6_cmd_ctrl:3;
-       unsigned int blk7_cmd_ctrl:3;
-       unsigned int blk8_cmd_ctrl:3;
-       unsigned int blk_ctrl:2;
-       unsigned int dual_xor_en:1;
-       unsigned int tx_complete:1;
-       unsigned int zero_result_err:1;
-       unsigned int zero_result_en:1;
-       unsigned int dest_write_en:1;
-};
-
-struct iop3xx_aau_e_desc_ctrl {
-       unsigned int reserved:1;
-       unsigned int blk1_cmd_ctrl:3;
-       unsigned int blk2_cmd_ctrl:3;
-       unsigned int blk3_cmd_ctrl:3;
-       unsigned int blk4_cmd_ctrl:3;
-       unsigned int blk5_cmd_ctrl:3;
-       unsigned int blk6_cmd_ctrl:3;
-       unsigned int blk7_cmd_ctrl:3;
-       unsigned int blk8_cmd_ctrl:3;
-       unsigned int reserved2:7;
-};
-
-struct iop3xx_dma_desc_ctrl {
-       unsigned int pci_transaction:4;
-       unsigned int int_en:1;
-       unsigned int dac_cycle_en:1;
-       unsigned int mem_to_mem_en:1;
-       unsigned int crc_data_tx_en:1;
-       unsigned int crc_gen_en:1;
-       unsigned int crc_seed_dis:1;
-       unsigned int reserved:21;
-       unsigned int crc_tx_complete:1;
-};
-
-struct iop3xx_desc_dma {
-       u32 next_desc;
-       union {
-               u32 pci_src_addr;
-               u32 pci_dest_addr;
-               u32 src_addr;
-       };
-       union {
-               u32 upper_pci_src_addr;
-               u32 upper_pci_dest_addr;
-       };
-       union {
-               u32 local_pci_src_addr;
-               u32 local_pci_dest_addr;
-               u32 dest_addr;
-       };
-       u32 byte_count;
-       union {
-               u32 desc_ctrl;
-               struct iop3xx_dma_desc_ctrl desc_ctrl_field;
-       };
-       u32 crc_addr;
-};
-
-struct iop3xx_desc_aau {
-       u32 next_desc;
-       u32 src[4];
-       u32 dest_addr;
-       u32 byte_count;
-       union {
-               u32 desc_ctrl;
-               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
-       };
-       union {
-               u32 src_addr;
-               u32 e_desc_ctrl;
-               struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
-       } src_edc[31];
-};
-
-struct iop3xx_aau_gfmr {
-       unsigned int gfmr1:8;
-       unsigned int gfmr2:8;
-       unsigned int gfmr3:8;
-       unsigned int gfmr4:8;
-};
-
-struct iop3xx_desc_pq_xor {
-       u32 next_desc;
-       u32 src[3];
-       union {
-               u32 data_mult1;
-               struct iop3xx_aau_gfmr data_mult1_field;
-       };
-       u32 dest_addr;
-       u32 byte_count;
-       union {
-               u32 desc_ctrl;
-               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
-       };
-       union {
-               u32 src_addr;
-               u32 e_desc_ctrl;
-               struct iop3xx_aau_e_desc_ctrl e_desc_ctrl_field;
-               u32 data_multiplier;
-               struct iop3xx_aau_gfmr data_mult_field;
-               u32 reserved;
-       } src_edc_gfmr[19];
-};
-
-struct iop3xx_desc_dual_xor {
-       u32 next_desc;
-       u32 src0_addr;
-       u32 src1_addr;
-       u32 h_src_addr;
-       u32 d_src_addr;
-       u32 h_dest_addr;
-       u32 byte_count;
-       union {
-               u32 desc_ctrl;
-               struct iop3xx_aau_desc_ctrl desc_ctrl_field;
-       };
-       u32 d_dest_addr;
-};
-
-union iop3xx_desc {
-       struct iop3xx_desc_aau *aau;
-       struct iop3xx_desc_dma *dma;
-       struct iop3xx_desc_pq_xor *pq_xor;
-       struct iop3xx_desc_dual_xor *dual_xor;
-       void *ptr;
-};
-
-static inline int iop_adma_get_max_xor(void)
-{
-       return 32;
-}
-
-static inline u32 iop_chan_get_current_descriptor(struct iop_adma_chan *chan)
-{
-       int id = chan->device->id;
-
-       switch (id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return __raw_readl(DMA_DAR(chan));
-       case AAU_ID:
-               return __raw_readl(AAU_ADAR(chan));
-       default:
-               BUG();
-       }
-       return 0;
-}
-
-static inline void iop_chan_set_next_descriptor(struct iop_adma_chan *chan,
-                                               u32 next_desc_addr)
-{
-       int id = chan->device->id;
-
-       switch (id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               __raw_writel(next_desc_addr, DMA_NDAR(chan));
-               break;
-       case AAU_ID:
-               __raw_writel(next_desc_addr, AAU_ANDAR(chan));
-               break;
-       }
-
-}
-
-#define IOP_ADMA_STATUS_BUSY (1 << 10)
-#define IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT (1024)
-#define IOP_ADMA_XOR_MAX_BYTE_COUNT (16 * 1024 * 1024)
-#define IOP_ADMA_MAX_BYTE_COUNT (16 * 1024 * 1024)
-
-static inline int iop_chan_is_busy(struct iop_adma_chan *chan)
-{
-       u32 status = __raw_readl(DMA_CSR(chan));
-       return (status & IOP_ADMA_STATUS_BUSY) ? 1 : 0;
-}
-
-static inline int iop_desc_is_aligned(struct iop_adma_desc_slot *desc,
-                                       int num_slots)
-{
-       /* num_slots will only ever be 1, 2, 4, or 8 */
-       return (desc->idx & (num_slots - 1)) ? 0 : 1;
-}
-
-/* to do: support large (i.e. > hw max) buffer sizes */
-static inline int iop_chan_memcpy_slot_count(size_t len, int *slots_per_op)
-{
-       *slots_per_op = 1;
-       return 1;
-}
-
-/* to do: support large (i.e. > hw max) buffer sizes */
-static inline int iop_chan_memset_slot_count(size_t len, int *slots_per_op)
-{
-       *slots_per_op = 1;
-       return 1;
-}
-
-static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt,
-                                       int *slots_per_op)
-{
-       static const char slot_count_table[] = {
-                                               1, 1, 1, 1, /* 01 - 04 */
-                                               2, 2, 2, 2, /* 05 - 08 */
-                                               4, 4, 4, 4, /* 09 - 12 */
-                                               4, 4, 4, 4, /* 13 - 16 */
-                                               8, 8, 8, 8, /* 17 - 20 */
-                                               8, 8, 8, 8, /* 21 - 24 */
-                                               8, 8, 8, 8, /* 25 - 28 */
-                                               8, 8, 8, 8, /* 29 - 32 */
-                                             };
-       *slots_per_op = slot_count_table[src_cnt - 1];
-       return *slots_per_op;
-}
-
-static inline int
-iop_chan_interrupt_slot_count(int *slots_per_op, struct iop_adma_chan *chan)
-{
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return iop_chan_memcpy_slot_count(0, slots_per_op);
-       case AAU_ID:
-               return iop3xx_aau_xor_slot_count(0, 2, slots_per_op);
-       default:
-               BUG();
-       }
-       return 0;
-}
-
-static inline int iop_chan_xor_slot_count(size_t len, int src_cnt,
-                                               int *slots_per_op)
-{
-       int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
-
-       if (len <= IOP_ADMA_XOR_MAX_BYTE_COUNT)
-               return slot_cnt;
-
-       len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
-       while (len > IOP_ADMA_XOR_MAX_BYTE_COUNT) {
-               len -= IOP_ADMA_XOR_MAX_BYTE_COUNT;
-               slot_cnt += *slots_per_op;
-       }
-
-       if (len)
-               slot_cnt += *slots_per_op;
-
-       return slot_cnt;
-}
-
-/* zero sum on iop3xx is limited to 1k at a time so it requires multiple
- * descriptors
- */
-static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
-                                               int *slots_per_op)
-{
-       int slot_cnt = iop3xx_aau_xor_slot_count(len, src_cnt, slots_per_op);
-
-       if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT)
-               return slot_cnt;
-
-       len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
-       while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
-               len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
-               slot_cnt += *slots_per_op;
-       }
-
-       if (len)
-               slot_cnt += *slots_per_op;
-
-       return slot_cnt;
-}
-
-static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
-                                       struct iop_adma_chan *chan)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return hw_desc.dma->dest_addr;
-       case AAU_ID:
-               return hw_desc.aau->dest_addr;
-       default:
-               BUG();
-       }
-       return 0;
-}
-
-static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
-                                       struct iop_adma_chan *chan)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return hw_desc.dma->byte_count;
-       case AAU_ID:
-               return hw_desc.aau->byte_count;
-       default:
-               BUG();
-       }
-       return 0;
-}
-
-/* translate the src_idx to a descriptor word index */
-static inline int __desc_idx(int src_idx)
-{
-       static const int desc_idx_table[] = { 0, 0, 0, 0,
-                                             0, 1, 2, 3,
-                                             5, 6, 7, 8,
-                                             9, 10, 11, 12,
-                                             14, 15, 16, 17,
-                                             18, 19, 20, 21,
-                                             23, 24, 25, 26,
-                                             27, 28, 29, 30,
-                                           };
-
-       return desc_idx_table[src_idx];
-}
-
-static inline u32 iop_desc_get_src_addr(struct iop_adma_desc_slot *desc,
-                                       struct iop_adma_chan *chan,
-                                       int src_idx)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return hw_desc.dma->src_addr;
-       case AAU_ID:
-               break;
-       default:
-               BUG();
-       }
-
-       if (src_idx < 4)
-               return hw_desc.aau->src[src_idx];
-       else
-               return hw_desc.aau->src_edc[__desc_idx(src_idx)].src_addr;
-}
-
-static inline void iop3xx_aau_desc_set_src_addr(struct iop3xx_desc_aau *hw_desc,
-                                       int src_idx, dma_addr_t addr)
-{
-       if (src_idx < 4)
-               hw_desc->src[src_idx] = addr;
-       else
-               hw_desc->src_edc[__desc_idx(src_idx)].src_addr = addr;
-}
-
-static inline void
-iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, unsigned long flags)
-{
-       struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
-       union {
-               u32 value;
-               struct iop3xx_dma_desc_ctrl field;
-       } u_desc_ctrl;
-
-       u_desc_ctrl.value = 0;
-       u_desc_ctrl.field.mem_to_mem_en = 1;
-       u_desc_ctrl.field.pci_transaction = 0xe; /* memory read block */
-       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
-       hw_desc->desc_ctrl = u_desc_ctrl.value;
-       hw_desc->upper_pci_src_addr = 0;
-       hw_desc->crc_addr = 0;
-}
-
-static inline void
-iop_desc_init_memset(struct iop_adma_desc_slot *desc, unsigned long flags)
-{
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
-       union {
-               u32 value;
-               struct iop3xx_aau_desc_ctrl field;
-       } u_desc_ctrl;
-
-       u_desc_ctrl.value = 0;
-       u_desc_ctrl.field.blk1_cmd_ctrl = 0x2; /* memory block fill */
-       u_desc_ctrl.field.dest_write_en = 1;
-       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
-       hw_desc->desc_ctrl = u_desc_ctrl.value;
-}
-
-static inline u32
-iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt,
-                    unsigned long flags)
-{
-       int i, shift;
-       u32 edcr;
-       union {
-               u32 value;
-               struct iop3xx_aau_desc_ctrl field;
-       } u_desc_ctrl;
-
-       u_desc_ctrl.value = 0;
-       switch (src_cnt) {
-       case 25 ... 32:
-               u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
-               edcr = 0;
-               shift = 1;
-               for (i = 24; i < src_cnt; i++) {
-                       edcr |= (1 << shift);
-                       shift += 3;
-               }
-               hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = edcr;
-               src_cnt = 24;
-               /* fall through */
-       case 17 ... 24:
-               if (!u_desc_ctrl.field.blk_ctrl) {
-                       hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
-                       u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
-               }
-               edcr = 0;
-               shift = 1;
-               for (i = 16; i < src_cnt; i++) {
-                       edcr |= (1 << shift);
-                       shift += 3;
-               }
-               hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = edcr;
-               src_cnt = 16;
-               /* fall through */
-       case 9 ... 16:
-               if (!u_desc_ctrl.field.blk_ctrl)
-                       u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
-               edcr = 0;
-               shift = 1;
-               for (i = 8; i < src_cnt; i++) {
-                       edcr |= (1 << shift);
-                       shift += 3;
-               }
-               hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = edcr;
-               src_cnt = 8;
-               /* fall through */
-       case 2 ... 8:
-               shift = 1;
-               for (i = 0; i < src_cnt; i++) {
-                       u_desc_ctrl.value |= (1 << shift);
-                       shift += 3;
-               }
-
-               if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
-                       u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
-       }
-
-       u_desc_ctrl.field.dest_write_en = 1;
-       u_desc_ctrl.field.blk1_cmd_ctrl = 0x7; /* direct fill */
-       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
-       hw_desc->desc_ctrl = u_desc_ctrl.value;
-
-       return u_desc_ctrl.value;
-}
-
-static inline void
-iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt,
-                 unsigned long flags)
-{
-       iop3xx_desc_init_xor(desc->hw_desc, src_cnt, flags);
-}
-
-/* return the number of operations */
-static inline int
-iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
-                      unsigned long flags)
-{
-       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
-       struct iop3xx_desc_aau *hw_desc, *prev_hw_desc, *iter;
-       union {
-               u32 value;
-               struct iop3xx_aau_desc_ctrl field;
-       } u_desc_ctrl;
-       int i, j;
-
-       hw_desc = desc->hw_desc;
-
-       for (i = 0, j = 0; (slot_cnt -= slots_per_op) >= 0;
-               i += slots_per_op, j++) {
-               iter = iop_hw_desc_slot_idx(hw_desc, i);
-               u_desc_ctrl.value = iop3xx_desc_init_xor(iter, src_cnt, flags);
-               u_desc_ctrl.field.dest_write_en = 0;
-               u_desc_ctrl.field.zero_result_en = 1;
-               u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
-               iter->desc_ctrl = u_desc_ctrl.value;
-
-               /* for the subsequent descriptors preserve the store queue
-                * and chain them together
-                */
-               if (i) {
-                       prev_hw_desc =
-                               iop_hw_desc_slot_idx(hw_desc, i - slots_per_op);
-                       prev_hw_desc->next_desc =
-                               (u32) (desc->async_tx.phys + (i << 5));
-               }
-       }
-
-       return j;
-}
-
-static inline void
-iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt,
-                      unsigned long flags)
-{
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
-       union {
-               u32 value;
-               struct iop3xx_aau_desc_ctrl field;
-       } u_desc_ctrl;
-
-       u_desc_ctrl.value = 0;
-       switch (src_cnt) {
-       case 25 ... 32:
-               u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
-               hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
-               /* fall through */
-       case 17 ... 24:
-               if (!u_desc_ctrl.field.blk_ctrl) {
-                       hw_desc->src_edc[AAU_EDCR2_IDX].e_desc_ctrl = 0;
-                       u_desc_ctrl.field.blk_ctrl = 0x3; /* use EDCR[2:0] */
-               }
-               hw_desc->src_edc[AAU_EDCR1_IDX].e_desc_ctrl = 0;
-               /* fall through */
-       case 9 ... 16:
-               if (!u_desc_ctrl.field.blk_ctrl)
-                       u_desc_ctrl.field.blk_ctrl = 0x2; /* use EDCR0 */
-               hw_desc->src_edc[AAU_EDCR0_IDX].e_desc_ctrl = 0;
-               /* fall through */
-       case 1 ... 8:
-               if (!u_desc_ctrl.field.blk_ctrl && src_cnt > 4)
-                       u_desc_ctrl.field.blk_ctrl = 0x1; /* use mini-desc */
-       }
-
-       u_desc_ctrl.field.dest_write_en = 0;
-       u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
-       hw_desc->desc_ctrl = u_desc_ctrl.value;
-}
-
-static inline void iop_desc_set_byte_count(struct iop_adma_desc_slot *desc,
-                                       struct iop_adma_chan *chan,
-                                       u32 byte_count)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               hw_desc.dma->byte_count = byte_count;
-               break;
-       case AAU_ID:
-               hw_desc.aau->byte_count = byte_count;
-               break;
-       default:
-               BUG();
-       }
-}
-
-static inline void
-iop_desc_init_interrupt(struct iop_adma_desc_slot *desc,
-                       struct iop_adma_chan *chan)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               iop_desc_init_memcpy(desc, 1);
-               hw_desc.dma->byte_count = 0;
-               hw_desc.dma->dest_addr = 0;
-               hw_desc.dma->src_addr = 0;
-               break;
-       case AAU_ID:
-               iop_desc_init_null_xor(desc, 2, 1);
-               hw_desc.aau->byte_count = 0;
-               hw_desc.aau->dest_addr = 0;
-               hw_desc.aau->src[0] = 0;
-               hw_desc.aau->src[1] = 0;
-               break;
-       default:
-               BUG();
-       }
-}
-
-static inline void
-iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
-{
-       int slots_per_op = desc->slots_per_op;
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
-       int i = 0;
-
-       if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
-               hw_desc->byte_count = len;
-       } else {
-               do {
-                       iter = iop_hw_desc_slot_idx(hw_desc, i);
-                       iter->byte_count = IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
-                       len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
-                       i += slots_per_op;
-               } while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
-
-               if (len) {
-                       iter = iop_hw_desc_slot_idx(hw_desc, i);
-                       iter->byte_count = len;
-               }
-       }
-}
-
-static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
-                                       struct iop_adma_chan *chan,
-                                       dma_addr_t addr)
-{
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               hw_desc.dma->dest_addr = addr;
-               break;
-       case AAU_ID:
-               hw_desc.aau->dest_addr = addr;
-               break;
-       default:
-               BUG();
-       }
-}
-
-static inline void iop_desc_set_memcpy_src_addr(struct iop_adma_desc_slot *desc,
-                                       dma_addr_t addr)
-{
-       struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
-       hw_desc->src_addr = addr;
-}
-
-static inline void
-iop_desc_set_zero_sum_src_addr(struct iop_adma_desc_slot *desc, int src_idx,
-                               dma_addr_t addr)
-{
-
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
-       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
-       int i;
-
-       for (i = 0; (slot_cnt -= slots_per_op) >= 0;
-               i += slots_per_op, addr += IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
-               iter = iop_hw_desc_slot_idx(hw_desc, i);
-               iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
-       }
-}
-
-static inline void iop_desc_set_xor_src_addr(struct iop_adma_desc_slot *desc,
-                                       int src_idx, dma_addr_t addr)
-{
-
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc, *iter;
-       int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
-       int i;
-
-       for (i = 0; (slot_cnt -= slots_per_op) >= 0;
-               i += slots_per_op, addr += IOP_ADMA_XOR_MAX_BYTE_COUNT) {
-               iter = iop_hw_desc_slot_idx(hw_desc, i);
-               iop3xx_aau_desc_set_src_addr(iter, src_idx, addr);
-       }
-}
-
-static inline void iop_desc_set_next_desc(struct iop_adma_desc_slot *desc,
-                                       u32 next_desc_addr)
-{
-       /* hw_desc->next_desc is the same location for all channels */
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-       BUG_ON(hw_desc.dma->next_desc);
-       hw_desc.dma->next_desc = next_desc_addr;
-}
-
-static inline u32 iop_desc_get_next_desc(struct iop_adma_desc_slot *desc)
-{
-       /* hw_desc->next_desc is the same location for all channels */
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-       return hw_desc.dma->next_desc;
-}
-
-static inline void iop_desc_clear_next_desc(struct iop_adma_desc_slot *desc)
-{
-       /* hw_desc->next_desc is the same location for all channels */
-       union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
-       hw_desc.dma->next_desc = 0;
-}
-
-static inline void iop_desc_set_block_fill_val(struct iop_adma_desc_slot *desc,
-                                               u32 val)
-{
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
-       hw_desc->src[0] = val;
-}
-
-static inline int iop_desc_get_zero_result(struct iop_adma_desc_slot *desc)
-{
-       struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
-       struct iop3xx_aau_desc_ctrl desc_ctrl = hw_desc->desc_ctrl_field;
-
-       BUG_ON(!(desc_ctrl.tx_complete && desc_ctrl.zero_result_en));
-       return desc_ctrl.zero_result_err;
-}
-
-static inline void iop_chan_append(struct iop_adma_chan *chan)
-{
-       u32 dma_chan_ctrl;
-
-       dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
-       dma_chan_ctrl |= 0x2;
-       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
-}
-
-static inline u32 iop_chan_get_status(struct iop_adma_chan *chan)
-{
-       return __raw_readl(DMA_CSR(chan));
-}
-
-static inline void iop_chan_disable(struct iop_adma_chan *chan)
-{
-       u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
-       dma_chan_ctrl &= ~1;
-       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
-}
-
-static inline void iop_chan_enable(struct iop_adma_chan *chan)
-{
-       u32 dma_chan_ctrl = __raw_readl(DMA_CCR(chan));
-
-       dma_chan_ctrl |= 1;
-       __raw_writel(dma_chan_ctrl, DMA_CCR(chan));
-}
-
-static inline void iop_adma_device_clear_eot_status(struct iop_adma_chan *chan)
-{
-       u32 status = __raw_readl(DMA_CSR(chan));
-       status &= (1 << 9);
-       __raw_writel(status, DMA_CSR(chan));
-}
-
-static inline void iop_adma_device_clear_eoc_status(struct iop_adma_chan *chan)
-{
-       u32 status = __raw_readl(DMA_CSR(chan));
-       status &= (1 << 8);
-       __raw_writel(status, DMA_CSR(chan));
-}
-
-static inline void iop_adma_device_clear_err_status(struct iop_adma_chan *chan)
-{
-       u32 status = __raw_readl(DMA_CSR(chan));
-
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               status &= (1 << 5) | (1 << 3) | (1 << 2) | (1 << 1);
-               break;
-       case AAU_ID:
-               status &= (1 << 5);
-               break;
-       default:
-               BUG();
-       }
-
-       __raw_writel(status, DMA_CSR(chan));
-}
-
-static inline int
-iop_is_err_int_parity(unsigned long status, struct iop_adma_chan *chan)
-{
-       return 0;
-}
-
-static inline int
-iop_is_err_mcu_abort(unsigned long status, struct iop_adma_chan *chan)
-{
-       return 0;
-}
-
-static inline int
-iop_is_err_int_tabort(unsigned long status, struct iop_adma_chan *chan)
-{
-       return 0;
-}
-
-static inline int
-iop_is_err_int_mabort(unsigned long status, struct iop_adma_chan *chan)
-{
-       return test_bit(5, &status);
-}
-
-static inline int
-iop_is_err_pci_tabort(unsigned long status, struct iop_adma_chan *chan)
-{
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return test_bit(2, &status);
-       default:
-               return 0;
-       }
-}
-
-static inline int
-iop_is_err_pci_mabort(unsigned long status, struct iop_adma_chan *chan)
-{
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return test_bit(3, &status);
-       default:
-               return 0;
-       }
-}
-
-static inline int
-iop_is_err_split_tx(unsigned long status, struct iop_adma_chan *chan)
-{
-       switch (chan->device->id) {
-       case DMA0_ID:
-       case DMA1_ID:
-               return test_bit(1, &status);
-       default:
-               return 0;
-       }
-}
-#endif /* _ADMA_H */
diff --git a/include/asm-arm/hardware/iop3xx-gpio.h b/include/asm-arm/hardware/iop3xx-gpio.h
deleted file mode 100644 (file)
index 0c9331f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * linux/include/asm-arm/hardware/iop3xx-gpio.h
- *
- * IOP3xx GPIO wrappers
- *
- * Copyright (c) 2008 Arnaud Patard <arnaud.patard@rtp-net.org>
- * Based on IXP4XX gpio.h file
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
-#define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
-
-#include <asm/hardware.h>
-#include <asm-generic/gpio.h>
-
-#define IOP3XX_N_GPIOS 8
-
-static inline int gpio_get_value(unsigned gpio)
-{
-       if (gpio > IOP3XX_N_GPIOS)
-               return __gpio_get_value(gpio);
-
-       return gpio_line_get(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
-       if (gpio > IOP3XX_N_GPIOS) {
-               __gpio_set_value(gpio, value);
-               return;
-       }
-       gpio_line_set(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
-       if (gpio < IOP3XX_N_GPIOS)
-               return 0;
-       else
-               return __gpio_cansleep(gpio);
-}
-
-/*
- * The GPIOs are not generating any interrupt
- * Note : manuals are not clear about this
- */
-static inline int gpio_to_irq(int gpio)
-{
-       return -EINVAL;
-}
-
-static inline int irq_to_gpio(int gpio)
-{
-       return -EINVAL;
-}
-
-#endif
-
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
deleted file mode 100644 (file)
index 18f6937..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * include/asm-arm/hardware/iop3xx.h
- *
- * Intel IOP32X and IOP33X register definitions
- *
- * Author: Rory Bolt <rorybolt@pacbell.net>
- * Copyright (C) 2002 Rory Bolt
- * Copyright (C) 2004 Intel Corp.
- *
- * 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.
- */
-
-#ifndef __IOP3XX_H
-#define __IOP3XX_H
-
-/*
- * IOP3XX GPIO handling
- */
-#define GPIO_IN                        0
-#define GPIO_OUT               1
-#define GPIO_LOW               0
-#define GPIO_HIGH              1
-#define IOP3XX_GPIO_LINE(x)    (x)
-
-#ifndef __ASSEMBLY__
-extern void gpio_line_config(int line, int direction);
-extern int  gpio_line_get(int line);
-extern void gpio_line_set(int line, int value);
-extern int init_atu;
-extern int iop3xx_get_init_atu(void);
-#endif
-
-
-/*
- * IOP3XX processor registers
- */
-#define IOP3XX_PERIPHERAL_PHYS_BASE    0xffffe000
-#define IOP3XX_PERIPHERAL_VIRT_BASE    0xfeffe000
-#define IOP3XX_PERIPHERAL_SIZE         0x00002000
-#define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\
-                                       IOP3XX_PERIPHERAL_SIZE - 1)
-#define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\
-                                       IOP3XX_PERIPHERAL_SIZE - 1)
-#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) (addr) -\
-                                       (IOP3XX_PERIPHERAL_PHYS_BASE\
-                                       - IOP3XX_PERIPHERAL_VIRT_BASE))
-#define IOP3XX_REG_ADDR(reg)           (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
-
-/* Address Translation Unit  */
-#define IOP3XX_ATUVID          (volatile u16 *)IOP3XX_REG_ADDR(0x0100)
-#define IOP3XX_ATUDID          (volatile u16 *)IOP3XX_REG_ADDR(0x0102)
-#define IOP3XX_ATUCMD          (volatile u16 *)IOP3XX_REG_ADDR(0x0104)
-#define IOP3XX_ATUSR           (volatile u16 *)IOP3XX_REG_ADDR(0x0106)
-#define IOP3XX_ATURID          (volatile u8  *)IOP3XX_REG_ADDR(0x0108)
-#define IOP3XX_ATUCCR          (volatile u32 *)IOP3XX_REG_ADDR(0x0109)
-#define IOP3XX_ATUCLSR         (volatile u8  *)IOP3XX_REG_ADDR(0x010c)
-#define IOP3XX_ATULT           (volatile u8  *)IOP3XX_REG_ADDR(0x010d)
-#define IOP3XX_ATUHTR          (volatile u8  *)IOP3XX_REG_ADDR(0x010e)
-#define IOP3XX_ATUBIST         (volatile u8  *)IOP3XX_REG_ADDR(0x010f)
-#define IOP3XX_IABAR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0110)
-#define IOP3XX_IAUBAR0         (volatile u32 *)IOP3XX_REG_ADDR(0x0114)
-#define IOP3XX_IABAR1          (volatile u32 *)IOP3XX_REG_ADDR(0x0118)
-#define IOP3XX_IAUBAR1         (volatile u32 *)IOP3XX_REG_ADDR(0x011c)
-#define IOP3XX_IABAR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0120)
-#define IOP3XX_IAUBAR2         (volatile u32 *)IOP3XX_REG_ADDR(0x0124)
-#define IOP3XX_ASVIR           (volatile u16 *)IOP3XX_REG_ADDR(0x012c)
-#define IOP3XX_ASIR            (volatile u16 *)IOP3XX_REG_ADDR(0x012e)
-#define IOP3XX_ERBAR           (volatile u32 *)IOP3XX_REG_ADDR(0x0130)
-#define IOP3XX_ATUILR          (volatile u8  *)IOP3XX_REG_ADDR(0x013c)
-#define IOP3XX_ATUIPR          (volatile u8  *)IOP3XX_REG_ADDR(0x013d)
-#define IOP3XX_ATUMGNT         (volatile u8  *)IOP3XX_REG_ADDR(0x013e)
-#define IOP3XX_ATUMLAT         (volatile u8  *)IOP3XX_REG_ADDR(0x013f)
-#define IOP3XX_IALR0           (volatile u32 *)IOP3XX_REG_ADDR(0x0140)
-#define IOP3XX_IATVR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0144)
-#define IOP3XX_ERLR            (volatile u32 *)IOP3XX_REG_ADDR(0x0148)
-#define IOP3XX_ERTVR           (volatile u32 *)IOP3XX_REG_ADDR(0x014c)
-#define IOP3XX_IALR1           (volatile u32 *)IOP3XX_REG_ADDR(0x0150)
-#define IOP3XX_IALR2           (volatile u32 *)IOP3XX_REG_ADDR(0x0154)
-#define IOP3XX_IATVR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0158)
-#define IOP3XX_OIOWTVR         (volatile u32 *)IOP3XX_REG_ADDR(0x015c)
-#define IOP3XX_OMWTVR0         (volatile u32 *)IOP3XX_REG_ADDR(0x0160)
-#define IOP3XX_OUMWTVR0                (volatile u32 *)IOP3XX_REG_ADDR(0x0164)
-#define IOP3XX_OMWTVR1         (volatile u32 *)IOP3XX_REG_ADDR(0x0168)
-#define IOP3XX_OUMWTVR1                (volatile u32 *)IOP3XX_REG_ADDR(0x016c)
-#define IOP3XX_OUDWTVR         (volatile u32 *)IOP3XX_REG_ADDR(0x0178)
-#define IOP3XX_ATUCR           (volatile u32 *)IOP3XX_REG_ADDR(0x0180)
-#define IOP3XX_PCSR            (volatile u32 *)IOP3XX_REG_ADDR(0x0184)
-#define IOP3XX_ATUISR          (volatile u32 *)IOP3XX_REG_ADDR(0x0188)
-#define IOP3XX_ATUIMR          (volatile u32 *)IOP3XX_REG_ADDR(0x018c)
-#define IOP3XX_IABAR3          (volatile u32 *)IOP3XX_REG_ADDR(0x0190)
-#define IOP3XX_IAUBAR3         (volatile u32 *)IOP3XX_REG_ADDR(0x0194)
-#define IOP3XX_IALR3           (volatile u32 *)IOP3XX_REG_ADDR(0x0198)
-#define IOP3XX_IATVR3          (volatile u32 *)IOP3XX_REG_ADDR(0x019c)
-#define IOP3XX_OCCAR           (volatile u32 *)IOP3XX_REG_ADDR(0x01a4)
-#define IOP3XX_OCCDR           (volatile u32 *)IOP3XX_REG_ADDR(0x01ac)
-#define IOP3XX_PDSCR           (volatile u32 *)IOP3XX_REG_ADDR(0x01bc)
-#define IOP3XX_PMCAPID         (volatile u8  *)IOP3XX_REG_ADDR(0x01c0)
-#define IOP3XX_PMNEXT          (volatile u8  *)IOP3XX_REG_ADDR(0x01c1)
-#define IOP3XX_APMCR           (volatile u16 *)IOP3XX_REG_ADDR(0x01c2)
-#define IOP3XX_APMCSR          (volatile u16 *)IOP3XX_REG_ADDR(0x01c4)
-#define IOP3XX_PCIXCAPID       (volatile u8  *)IOP3XX_REG_ADDR(0x01e0)
-#define IOP3XX_PCIXNEXT                (volatile u8  *)IOP3XX_REG_ADDR(0x01e1)
-#define IOP3XX_PCIXCMD         (volatile u16 *)IOP3XX_REG_ADDR(0x01e2)
-#define IOP3XX_PCIXSR          (volatile u32 *)IOP3XX_REG_ADDR(0x01e4)
-#define IOP3XX_PCIIRSR         (volatile u32 *)IOP3XX_REG_ADDR(0x01ec)
-#define IOP3XX_PCSR_OUT_Q_BUSY (1 << 15)
-#define IOP3XX_PCSR_IN_Q_BUSY  (1 << 14)
-#define IOP3XX_ATUCR_OUT_EN    (1 << 1)
-
-#define IOP3XX_INIT_ATU_DEFAULT 0
-#define IOP3XX_INIT_ATU_DISABLE -1
-#define IOP3XX_INIT_ATU_ENABLE  1
-
-/* Messaging Unit  */
-#define IOP3XX_IMR0            (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
-#define IOP3XX_IMR1            (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
-#define IOP3XX_OMR0            (volatile u32 *)IOP3XX_REG_ADDR(0x0318)
-#define IOP3XX_OMR1            (volatile u32 *)IOP3XX_REG_ADDR(0x031c)
-#define IOP3XX_IDR             (volatile u32 *)IOP3XX_REG_ADDR(0x0320)
-#define IOP3XX_IISR            (volatile u32 *)IOP3XX_REG_ADDR(0x0324)
-#define IOP3XX_IIMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0328)
-#define IOP3XX_ODR             (volatile u32 *)IOP3XX_REG_ADDR(0x032c)
-#define IOP3XX_OISR            (volatile u32 *)IOP3XX_REG_ADDR(0x0330)
-#define IOP3XX_OIMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0334)
-#define IOP3XX_MUCR            (volatile u32 *)IOP3XX_REG_ADDR(0x0350)
-#define IOP3XX_QBAR            (volatile u32 *)IOP3XX_REG_ADDR(0x0354)
-#define IOP3XX_IFHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0360)
-#define IOP3XX_IFTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0364)
-#define IOP3XX_IPHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0368)
-#define IOP3XX_IPTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x036c)
-#define IOP3XX_OFHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0370)
-#define IOP3XX_OFTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0374)
-#define IOP3XX_OPHPR           (volatile u32 *)IOP3XX_REG_ADDR(0x0378)
-#define IOP3XX_OPTPR           (volatile u32 *)IOP3XX_REG_ADDR(0x037c)
-#define IOP3XX_IAR             (volatile u32 *)IOP3XX_REG_ADDR(0x0380)
-
-/* DMA Controller  */
-#define IOP3XX_DMA_PHYS_BASE(chan) (IOP3XX_PERIPHERAL_PHYS_BASE + \
-                                       (0x400 + (chan << 6)))
-#define IOP3XX_DMA_UPPER_PA(chan)  (IOP3XX_DMA_PHYS_BASE(chan) + 0x27)
-
-/* Peripheral bus interface  */
-#define IOP3XX_PBCR            (volatile u32 *)IOP3XX_REG_ADDR(0x0680)
-#define IOP3XX_PBISR           (volatile u32 *)IOP3XX_REG_ADDR(0x0684)
-#define IOP3XX_PBBAR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0688)
-#define IOP3XX_PBLR0           (volatile u32 *)IOP3XX_REG_ADDR(0x068c)
-#define IOP3XX_PBBAR1          (volatile u32 *)IOP3XX_REG_ADDR(0x0690)
-#define IOP3XX_PBLR1           (volatile u32 *)IOP3XX_REG_ADDR(0x0694)
-#define IOP3XX_PBBAR2          (volatile u32 *)IOP3XX_REG_ADDR(0x0698)
-#define IOP3XX_PBLR2           (volatile u32 *)IOP3XX_REG_ADDR(0x069c)
-#define IOP3XX_PBBAR3          (volatile u32 *)IOP3XX_REG_ADDR(0x06a0)
-#define IOP3XX_PBLR3           (volatile u32 *)IOP3XX_REG_ADDR(0x06a4)
-#define IOP3XX_PBBAR4          (volatile u32 *)IOP3XX_REG_ADDR(0x06a8)
-#define IOP3XX_PBLR4           (volatile u32 *)IOP3XX_REG_ADDR(0x06ac)
-#define IOP3XX_PBBAR5          (volatile u32 *)IOP3XX_REG_ADDR(0x06b0)
-#define IOP3XX_PBLR5           (volatile u32 *)IOP3XX_REG_ADDR(0x06b4)
-#define IOP3XX_PMBR0           (volatile u32 *)IOP3XX_REG_ADDR(0x06c0)
-#define IOP3XX_PMBR1           (volatile u32 *)IOP3XX_REG_ADDR(0x06e0)
-#define IOP3XX_PMBR2           (volatile u32 *)IOP3XX_REG_ADDR(0x06e4)
-
-/* Peripheral performance monitoring unit  */
-#define IOP3XX_GTMR            (volatile u32 *)IOP3XX_REG_ADDR(0x0700)
-#define IOP3XX_ESR             (volatile u32 *)IOP3XX_REG_ADDR(0x0704)
-#define IOP3XX_EMISR           (volatile u32 *)IOP3XX_REG_ADDR(0x0708)
-#define IOP3XX_GTSR            (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
-/* PERCR0 DOESN'T EXIST - index from 1! */
-#define IOP3XX_PERCR0          (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
-
-/* General Purpose I/O  */
-#define IOP3XX_GPOE            (volatile u32 *)IOP3XX_GPIO_REG(0x0000)
-#define IOP3XX_GPID            (volatile u32 *)IOP3XX_GPIO_REG(0x0004)
-#define IOP3XX_GPOD            (volatile u32 *)IOP3XX_GPIO_REG(0x0008)
-
-/* Timers  */
-#define IOP3XX_TU_TMR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0000)
-#define IOP3XX_TU_TMR1         (volatile u32 *)IOP3XX_TIMER_REG(0x0004)
-#define IOP3XX_TU_TCR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0008)
-#define IOP3XX_TU_TCR1         (volatile u32 *)IOP3XX_TIMER_REG(0x000c)
-#define IOP3XX_TU_TRR0         (volatile u32 *)IOP3XX_TIMER_REG(0x0010)
-#define IOP3XX_TU_TRR1         (volatile u32 *)IOP3XX_TIMER_REG(0x0014)
-#define IOP3XX_TU_TISR         (volatile u32 *)IOP3XX_TIMER_REG(0x0018)
-#define IOP3XX_TU_WDTCR                (volatile u32 *)IOP3XX_TIMER_REG(0x001c)
-#define IOP_TMR_EN         0x02
-#define IOP_TMR_RELOAD     0x04
-#define IOP_TMR_PRIVILEGED 0x08
-#define IOP_TMR_RATIO_1_1  0x00
-
-/* Watchdog timer definitions */
-#define IOP_WDTCR_EN_ARM        0x1e1e1e1e
-#define IOP_WDTCR_EN            0xe1e1e1e1
-/* iop3xx does not support stopping the watchdog, so we just re-arm */
-#define IOP_WDTCR_DIS_ARM      (IOP_WDTCR_EN_ARM)
-#define IOP_WDTCR_DIS          (IOP_WDTCR_EN)
-
-/* Application accelerator unit  */
-#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
-#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
-
-/* I2C bus interface unit  */
-#define IOP3XX_ICR0            (volatile u32 *)IOP3XX_REG_ADDR(0x1680)
-#define IOP3XX_ISR0            (volatile u32 *)IOP3XX_REG_ADDR(0x1684)
-#define IOP3XX_ISAR0           (volatile u32 *)IOP3XX_REG_ADDR(0x1688)
-#define IOP3XX_IDBR0           (volatile u32 *)IOP3XX_REG_ADDR(0x168c)
-#define IOP3XX_IBMR0           (volatile u32 *)IOP3XX_REG_ADDR(0x1694)
-#define IOP3XX_ICR1            (volatile u32 *)IOP3XX_REG_ADDR(0x16a0)
-#define IOP3XX_ISR1            (volatile u32 *)IOP3XX_REG_ADDR(0x16a4)
-#define IOP3XX_ISAR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16a8)
-#define IOP3XX_IDBR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16ac)
-#define IOP3XX_IBMR1           (volatile u32 *)IOP3XX_REG_ADDR(0x16b4)
-
-
-/*
- * IOP3XX I/O and Mem space regions for PCI autoconfiguration
- */
-#define IOP3XX_PCI_LOWER_MEM_PA        0x80000000
-
-#define IOP3XX_PCI_IO_WINDOW_SIZE      0x00010000
-#define IOP3XX_PCI_LOWER_IO_PA         0x90000000
-#define IOP3XX_PCI_LOWER_IO_VA         0xfe000000
-#define IOP3XX_PCI_LOWER_IO_BA         0x90000000
-#define IOP3XX_PCI_UPPER_IO_PA         (IOP3XX_PCI_LOWER_IO_PA +\
-                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
-#define IOP3XX_PCI_UPPER_IO_VA         (IOP3XX_PCI_LOWER_IO_VA +\
-                                       IOP3XX_PCI_IO_WINDOW_SIZE - 1)
-#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\
-                                       IOP3XX_PCI_LOWER_IO_PA) +\
-                                       IOP3XX_PCI_LOWER_IO_VA)
-
-
-#ifndef __ASSEMBLY__
-void iop3xx_map_io(void);
-void iop_init_cp6_handler(void);
-void iop_init_time(unsigned long tickrate);
-unsigned long iop_gettimeoffset(void);
-
-static inline void write_tmr0(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (val));
-}
-
-static inline void write_tmr1(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (val));
-}
-
-static inline u32 read_tcr0(void)
-{
-       u32 val;
-       asm volatile("mrc p6, 0, %0, c2, c1, 0" : "=r" (val));
-       return val;
-}
-
-static inline u32 read_tcr1(void)
-{
-       u32 val;
-       asm volatile("mrc p6, 0, %0, c3, c1, 0" : "=r" (val));
-       return val;
-}
-
-static inline void write_trr0(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val));
-}
-
-static inline void write_trr1(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c5, c1, 0" : : "r" (val));
-}
-
-static inline void write_tisr(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
-}
-
-static inline u32 read_wdtcr(void)
-{
-       u32 val;
-       asm volatile("mrc p6, 0, %0, c7, c1, 0":"=r" (val));
-       return val;
-}
-static inline void write_wdtcr(u32 val)
-{
-       asm volatile("mcr p6, 0, %0, c7, c1, 0"::"r" (val));
-}
-
-extern unsigned long get_iop_tick_rate(void);
-
-/* only iop13xx has these registers, we define these to present a
- * common register interface for the iop_wdt driver.
- */
-#define IOP_RCSR_WDT   (0)
-static inline u32 read_rcsr(void)
-{
-       return 0;
-}
-static inline void write_wdtsr(u32 val)
-{
-       do { } while (0);
-}
-
-extern struct platform_device iop3xx_dma_0_channel;
-extern struct platform_device iop3xx_dma_1_channel;
-extern struct platform_device iop3xx_aau_channel;
-extern struct platform_device iop3xx_i2c0_device;
-extern struct platform_device iop3xx_i2c1_device;
-
-#endif
-
-
-#endif
diff --git a/include/asm-arm/hardware/iop_adma.h b/include/asm-arm/hardware/iop_adma.h
deleted file mode 100644 (file)
index cb7e361..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright Â© 2006, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#ifndef IOP_ADMA_H
-#define IOP_ADMA_H
-#include <linux/types.h>
-#include <linux/dmaengine.h>
-#include <linux/interrupt.h>
-
-#define IOP_ADMA_SLOT_SIZE 32
-#define IOP_ADMA_THRESHOLD 4
-
-/**
- * struct iop_adma_device - internal representation of an ADMA device
- * @pdev: Platform device
- * @id: HW ADMA Device selector
- * @dma_desc_pool: base of DMA descriptor region (DMA address)
- * @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
- * @common: embedded struct dma_device
- */
-struct iop_adma_device {
-       struct platform_device *pdev;
-       int id;
-       dma_addr_t dma_desc_pool;
-       void *dma_desc_pool_virt;
-       struct dma_device common;
-};
-
-/**
- * struct iop_adma_chan - internal representation of an ADMA device
- * @pending: allows batching of hardware operations
- * @completed_cookie: identifier for the most recently completed operation
- * @lock: serializes enqueue/dequeue operations to the slot pool
- * @mmr_base: memory mapped register base
- * @chain: device chain view of the descriptors
- * @device: parent device
- * @common: common dmaengine channel object members
- * @last_used: place holder for allocation to continue from where it left off
- * @all_slots: complete domain of slots usable by the channel
- * @slots_allocated: records the actual size of the descriptor slot pool
- * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs
- */
-struct iop_adma_chan {
-       int pending;
-       dma_cookie_t completed_cookie;
-       spinlock_t lock; /* protects the descriptor slot pool */
-       void __iomem *mmr_base;
-       struct list_head chain;
-       struct iop_adma_device *device;
-       struct dma_chan common;
-       struct iop_adma_desc_slot *last_used;
-       struct list_head all_slots;
-       int slots_allocated;
-       struct tasklet_struct irq_tasklet;
-};
-
-/**
- * struct iop_adma_desc_slot - IOP-ADMA software descriptor
- * @slot_node: node on the iop_adma_chan.all_slots list
- * @chain_node: node on the op_adma_chan.chain list
- * @hw_desc: virtual address of the hardware descriptor chain
- * @phys: hardware address of the hardware descriptor chain
- * @group_head: first operation in a transaction
- * @slot_cnt: total slots used in an transaction (group of operations)
- * @slots_per_op: number of slots per operation
- * @idx: pool index
- * @unmap_src_cnt: number of xor sources
- * @unmap_len: transaction bytecount
- * @async_tx: support for the async_tx api
- * @group_list: list of slots that make up a multi-descriptor transaction
- *     for example transfer lengths larger than the supported hw max
- * @xor_check_result: result of zero sum
- * @crc32_result: result crc calculation
- */
-struct iop_adma_desc_slot {
-       struct list_head slot_node;
-       struct list_head chain_node;
-       void *hw_desc;
-       struct iop_adma_desc_slot *group_head;
-       u16 slot_cnt;
-       u16 slots_per_op;
-       u16 idx;
-       u16 unmap_src_cnt;
-       size_t unmap_len;
-       struct dma_async_tx_descriptor async_tx;
-       union {
-               u32 *xor_check_result;
-               u32 *crc32_result;
-       };
-};
-
-struct iop_adma_platform_data {
-       int hw_id;
-       dma_cap_mask_t cap_mask;
-       size_t pool_size;
-};
-
-#define to_iop_sw_desc(addr_hw_desc) \
-       container_of(addr_hw_desc, struct iop_adma_desc_slot, hw_desc)
-#define iop_hw_desc_slot_idx(hw_desc, idx) \
-       ( (void *) (((unsigned long) hw_desc) + ((idx) << 5)) )
-#endif
diff --git a/include/asm-arm/hardware/it8152.h b/include/asm-arm/hardware/it8152.h
deleted file mode 100644 (file)
index 74b5fff..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * linux/include/arm/hardware/it8152.h
- *
- * Copyright Compulab Ltd., 2006,2007
- * Mike Rapoport <mike@compulab.co.il>
- *
- * ITE 8152 companion chip register definitions
- */
-
-#ifndef __ASM_HARDWARE_IT8152_H
-#define __ASM_HARDWARE_IT8152_H
-extern unsigned long it8152_base_address;
-
-#define IT8152_IO_BASE                 (it8152_base_address + 0x03e00000)
-#define IT8152_CFGREG_BASE             (it8152_base_address + 0x03f00000)
-
-#define __REG_IT8152(x)                        (it8152_base_address + (x))
-
-#define IT8152_PCI_CFG_ADDR            __REG_IT8152(0x3f00800)
-#define IT8152_PCI_CFG_DATA            __REG_IT8152(0x3f00804)
-
-#define IT8152_INTC_LDCNIRR            __REG_IT8152(0x3f00300)
-#define IT8152_INTC_LDPNIRR            __REG_IT8152(0x3f00304)
-#define IT8152_INTC_LDCNIMR            __REG_IT8152(0x3f00308)
-#define IT8152_INTC_LDPNIMR            __REG_IT8152(0x3f0030C)
-#define IT8152_INTC_LDNITR             __REG_IT8152(0x3f00310)
-#define IT8152_INTC_LDNIAR             __REG_IT8152(0x3f00314)
-#define IT8152_INTC_LPCNIRR            __REG_IT8152(0x3f00320)
-#define IT8152_INTC_LPPNIRR            __REG_IT8152(0x3f00324)
-#define IT8152_INTC_LPCNIMR            __REG_IT8152(0x3f00328)
-#define IT8152_INTC_LPPNIMR            __REG_IT8152(0x3f0032C)
-#define IT8152_INTC_LPNITR             __REG_IT8152(0x3f00330)
-#define IT8152_INTC_LPNIAR             __REG_IT8152(0x3f00334)
-#define IT8152_INTC_PDCNIRR            __REG_IT8152(0x3f00340)
-#define IT8152_INTC_PDPNIRR            __REG_IT8152(0x3f00344)
-#define IT8152_INTC_PDCNIMR            __REG_IT8152(0x3f00348)
-#define IT8152_INTC_PDPNIMR            __REG_IT8152(0x3f0034C)
-#define IT8152_INTC_PDNITR             __REG_IT8152(0x3f00350)
-#define IT8152_INTC_PDNIAR             __REG_IT8152(0x3f00354)
-#define IT8152_INTC_INTC_TYPER         __REG_IT8152(0x3f003FC)
-
-#define IT8152_GPIO_GPDR               __REG_IT8152(0x3f00500)
-
-/*
-  Interrupt controller per register summary:
-  ---------------------------------------
-  LCDNIRR:
-  IT8152_LD_IRQ(8) PCICLK stop
-  IT8152_LD_IRQ(7) MCLK ready
-  IT8152_LD_IRQ(6) s/w
-  IT8152_LD_IRQ(5) UART
-  IT8152_LD_IRQ(4) GPIO
-  IT8152_LD_IRQ(3) TIMER 4
-  IT8152_LD_IRQ(2) TIMER 3
-  IT8152_LD_IRQ(1) TIMER 2
-  IT8152_LD_IRQ(0) TIMER 1
-
-  LPCNIRR:
-  IT8152_LP_IRQ(x) serial IRQ x
-
-  PCIDNIRR:
-  IT8152_PD_IRQ(14) PCISERR
-  IT8152_PD_IRQ(13) CPU/PCI bridge target abort (h2pTADR)
-  IT8152_PD_IRQ(12) CPU/PCI bridge master abort (h2pMADR)
-  IT8152_PD_IRQ(11) PCI INTD
-  IT8152_PD_IRQ(10) PCI INTC
-  IT8152_PD_IRQ(9)  PCI INTB
-  IT8152_PD_IRQ(8)  PCI INTA
-  IT8152_PD_IRQ(7)  serial INTD
-  IT8152_PD_IRQ(6)  serial INTC
-  IT8152_PD_IRQ(5)  serial INTB
-  IT8152_PD_IRQ(4)  serial INTA
-  IT8152_PD_IRQ(3)  serial IRQ IOCHK (IOCHKR)
-  IT8152_PD_IRQ(2)  chaining DMA (CDMAR)
-  IT8152_PD_IRQ(1)  USB (USBR)
-  IT8152_PD_IRQ(0)  Audio controller (ACR)
- */
-/* frequently used interrupts */
-#define IT8152_PCISERR         IT8152_PD_IRQ(14)
-#define IT8152_H2PTADR         IT8152_PD_IRQ(13)
-#define IT8152_H2PMAR          IT8152_PD_IRQ(12)
-#define IT8152_PCI_INTD                IT8152_PD_IRQ(11)
-#define IT8152_PCI_INTC                IT8152_PD_IRQ(10)
-#define IT8152_PCI_INTB                IT8152_PD_IRQ(9)
-#define IT8152_PCI_INTA                IT8152_PD_IRQ(8)
-#define IT8152_CDMA_INT                IT8152_PD_IRQ(2)
-#define IT8152_USB_INT         IT8152_PD_IRQ(1)
-#define IT8152_AUDIO_INT       IT8152_PD_IRQ(0)
-
-struct pci_dev;
-struct pci_sys_data;
-
-extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc);
-extern void it8152_init_irq(void);
-extern int it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
-extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
-extern struct pci_bus *it8152_pci_scan_bus(int nr, struct pci_sys_data *sys);
-
-#endif /* __ASM_HARDWARE_IT8152_H */
diff --git a/include/asm-arm/hardware/linkup-l1110.h b/include/asm-arm/hardware/linkup-l1110.h
deleted file mode 100644 (file)
index 7ec9116..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-*
-* Definitions for H3600 Handheld Computer
-*
-* Copyright 2001 Compaq Computer Corporation.
-*
-* Use consistent with the GNU GPL is permitted,
-* provided that this copyright notice is
-* preserved in its entirety in all copies and derived works.
-*
-* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
-* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
-* FITNESS FOR ANY PARTICULAR PURPOSE.
-*
-* Author: Jamey Hicks.
-*
-*/
-
-/* LinkUp Systems PCCard/CompactFlash Interface for SA-1100 */
-
-/* PC Card Status Register */
-#define LINKUP_PRS_S1  (1 << 0) /* voltage control bits S1-S4 */
-#define LINKUP_PRS_S2  (1 << 1)
-#define LINKUP_PRS_S3  (1 << 2)
-#define LINKUP_PRS_S4  (1 << 3)
-#define LINKUP_PRS_BVD1        (1 << 4)
-#define LINKUP_PRS_BVD2        (1 << 5)
-#define LINKUP_PRS_VS1 (1 << 6)
-#define LINKUP_PRS_VS2 (1 << 7)
-#define LINKUP_PRS_RDY (1 << 8)
-#define LINKUP_PRS_CD1 (1 << 9)
-#define LINKUP_PRS_CD2 (1 << 10)
-
-/* PC Card Command Register */
-#define LINKUP_PRC_S1  (1 << 0)
-#define LINKUP_PRC_S2  (1 << 1)
-#define LINKUP_PRC_S3  (1 << 2)
-#define LINKUP_PRC_S4  (1 << 3)
-#define LINKUP_PRC_RESET (1 << 4)
-#define LINKUP_PRC_APOE        (1 << 5) /* Auto Power Off Enable: clears S1-S4 when either nCD goes high */
-#define LINKUP_PRC_CFE (1 << 6) /* CompactFlash mode Enable: addresses A[10:0] only, A[25:11] high */
-#define LINKUP_PRC_SOE (1 << 7) /* signal output driver enable */
-#define LINKUP_PRC_SSP (1 << 8) /* sock select polarity: 0 for socket 0, 1 for socket 1 */
-#define LINKUP_PRC_MBZ (1 << 15) /* must be zero */
-
-struct linkup_l1110 {
-       volatile short prc;
-};
diff --git a/include/asm-arm/hardware/locomo.h b/include/asm-arm/hardware/locomo.h
deleted file mode 100644 (file)
index fb0645d..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * linux/include/asm-arm/hardware/locomo.h
- *
- * This file contains the definitions for the LoCoMo G/A Chip
- *
- * (C) Copyright 2004 John Lenz
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Based on sa1111.h
- */
-#ifndef _ASM_ARCH_LOCOMO
-#define _ASM_ARCH_LOCOMO
-
-#define locomo_writel(val,addr)        ({ *(volatile u16 *)(addr) = (val); })
-#define locomo_readl(addr)     (*(volatile u16 *)(addr))
-
-/* LOCOMO version */
-#define LOCOMO_VER     0x00
-
-/* Pin status */
-#define LOCOMO_ST      0x04
-
-/* Pin status */
-#define LOCOMO_C32K    0x08
-
-/* Interrupt controller */
-#define LOCOMO_ICR     0x0C
-
-/* MCS decoder for boot selecting */
-#define LOCOMO_MCSX0   0x10
-#define LOCOMO_MCSX1   0x14
-#define LOCOMO_MCSX2   0x18
-#define LOCOMO_MCSX3   0x1c
-
-/* Touch panel controller */
-#define LOCOMO_ASD     0x20            /* AD start delay */
-#define LOCOMO_HSD     0x28            /* HSYS delay */
-#define LOCOMO_HSC     0x2c            /* HSYS period */
-#define LOCOMO_TADC    0x30            /* tablet ADC clock */
-
-
-/* Long time timer */
-#define LOCOMO_LTC     0xd8            /* LTC interrupt setting */
-#define LOCOMO_LTINT   0xdc            /* LTC interrupt */
-
-/* DAC control signal for LCD (COMADJ ) */
-#define LOCOMO_DAC             0xe0
-/* DAC control */
-#define        LOCOMO_DAC_SCLOEB       0x08    /* SCL pin output data       */
-#define        LOCOMO_DAC_TEST         0x04    /* Test bit                  */
-#define        LOCOMO_DAC_SDA          0x02    /* SDA pin level (read-only) */
-#define        LOCOMO_DAC_SDAOEB       0x01    /* SDA pin output data       */
-
-/* SPI interface */
-#define LOCOMO_SPI     0x60
-#define LOCOMO_SPIMD   0x00            /* SPI mode setting */
-#define LOCOMO_SPICT   0x04            /* SPI mode control */
-#define LOCOMO_SPIST   0x08            /* SPI status */
-#define        LOCOMO_SPI_TEND (1 << 3)        /* Transfer end bit */
-#define        LOCOMO_SPI_REND (1 << 2)        /* Receive end bit */
-#define        LOCOMO_SPI_RFW  (1 << 1)        /* write buffer bit */
-#define        LOCOMO_SPI_RFR  (1)             /* read buffer bit */
-
-#define LOCOMO_SPIIS   0x10            /* SPI interrupt status */
-#define LOCOMO_SPIWE   0x14            /* SPI interrupt status write enable */
-#define LOCOMO_SPIIE   0x18            /* SPI interrupt enable */
-#define LOCOMO_SPIIR   0x1c            /* SPI interrupt request */
-#define LOCOMO_SPITD   0x20            /* SPI transfer data write */
-#define LOCOMO_SPIRD   0x24            /* SPI receive data read */
-#define LOCOMO_SPITS   0x28            /* SPI transfer data shift */
-#define LOCOMO_SPIRS   0x2C            /* SPI receive data shift */
-
-/* GPIO */
-#define LOCOMO_GPD             0x90    /* GPIO direction */
-#define LOCOMO_GPE             0x94    /* GPIO input enable */
-#define LOCOMO_GPL             0x98    /* GPIO level */
-#define LOCOMO_GPO             0x9c    /* GPIO out data setting */
-#define LOCOMO_GRIE            0xa0    /* GPIO rise detection */
-#define LOCOMO_GFIE            0xa4    /* GPIO fall detection */
-#define LOCOMO_GIS             0xa8    /* GPIO edge detection status */
-#define LOCOMO_GWE             0xac    /* GPIO status write enable */
-#define LOCOMO_GIE             0xb0    /* GPIO interrupt enable */
-#define LOCOMO_GIR             0xb4    /* GPIO interrupt request */
-#define        LOCOMO_GPIO(Nb)         (0x01 << (Nb))
-#define LOCOMO_GPIO_RTS                LOCOMO_GPIO(0)
-#define LOCOMO_GPIO_CTS                LOCOMO_GPIO(1)
-#define LOCOMO_GPIO_DSR                LOCOMO_GPIO(2)
-#define LOCOMO_GPIO_DTR                LOCOMO_GPIO(3)
-#define LOCOMO_GPIO_LCD_VSHA_ON        LOCOMO_GPIO(4)
-#define LOCOMO_GPIO_LCD_VSHD_ON        LOCOMO_GPIO(5)
-#define LOCOMO_GPIO_LCD_VEE_ON LOCOMO_GPIO(6)
-#define LOCOMO_GPIO_LCD_MOD    LOCOMO_GPIO(7)
-#define LOCOMO_GPIO_DAC_ON     LOCOMO_GPIO(8)
-#define LOCOMO_GPIO_FL_VR      LOCOMO_GPIO(9)
-#define LOCOMO_GPIO_DAC_SDATA  LOCOMO_GPIO(10)
-#define LOCOMO_GPIO_DAC_SCK    LOCOMO_GPIO(11)
-#define LOCOMO_GPIO_DAC_SLOAD  LOCOMO_GPIO(12)
-#define LOCOMO_GPIO_CARD_DETECT LOCOMO_GPIO(13)
-#define LOCOMO_GPIO_WRITE_PROT  LOCOMO_GPIO(14)
-#define LOCOMO_GPIO_CARD_POWER  LOCOMO_GPIO(15)
-
-/* Start the definitions of the devices.  Each device has an initial
- * base address and a series of offsets from that base address. */
-
-/* Keyboard controller */
-#define LOCOMO_KEYBOARD                0x40
-#define LOCOMO_KIB             0x00    /* KIB level */
-#define LOCOMO_KSC             0x04    /* KSTRB control */
-#define LOCOMO_KCMD            0x08    /* KSTRB command */
-#define LOCOMO_KIC             0x0c    /* Key interrupt */
-
-/* Front light adjustment controller */
-#define LOCOMO_FRONTLIGHT      0xc8
-#define LOCOMO_ALS             0x00    /* Adjust light cycle */
-#define LOCOMO_ALD             0x04    /* Adjust light duty */
-
-#define LOCOMO_ALC_EN          0x8000
-
-/* Backlight controller: TFT signal */
-#define LOCOMO_BACKLIGHT       0x38
-#define LOCOMO_TC              0x00            /* TFT control signal */
-#define LOCOMO_CPSD            0x04            /* CPS delay */
-
-/* Audio controller */
-#define LOCOMO_AUDIO           0x54
-#define LOCOMO_ACC             0x00    /* Audio clock */
-#define LOCOMO_PAIF            0xD0    /* PCM audio interface */
-/* Audio clock */
-#define        LOCOMO_ACC_XON          0x80
-#define        LOCOMO_ACC_XEN          0x40
-#define        LOCOMO_ACC_XSEL0        0x00
-#define        LOCOMO_ACC_XSEL1        0x20
-#define        LOCOMO_ACC_MCLKEN       0x10
-#define        LOCOMO_ACC_64FSEN       0x08
-#define        LOCOMO_ACC_CLKSEL000    0x00    /* mclk  2 */
-#define        LOCOMO_ACC_CLKSEL001    0x01    /* mclk  3 */
-#define        LOCOMO_ACC_CLKSEL010    0x02    /* mclk  4 */
-#define        LOCOMO_ACC_CLKSEL011    0x03    /* mclk  6 */
-#define        LOCOMO_ACC_CLKSEL100    0x04    /* mclk  8 */
-#define        LOCOMO_ACC_CLKSEL101    0x05    /* mclk 12 */
-/* PCM audio interface */
-#define        LOCOMO_PAIF_SCINV       0x20
-#define        LOCOMO_PAIF_SCEN        0x10
-#define        LOCOMO_PAIF_LRCRST      0x08
-#define        LOCOMO_PAIF_LRCEVE      0x04
-#define        LOCOMO_PAIF_LRCINV      0x02
-#define        LOCOMO_PAIF_LRCEN       0x01
-
-/* LED controller */
-#define LOCOMO_LED             0xe8
-#define LOCOMO_LPT0            0x00
-#define LOCOMO_LPT1            0x04
-/* LED control */
-#define LOCOMO_LPT_TOFH                0x80
-#define LOCOMO_LPT_TOFL                0x08
-#define LOCOMO_LPT_TOH(TOH)    ((TOH & 0x7) << 4)
-#define LOCOMO_LPT_TOL(TOL)    ((TOL & 0x7))
-
-extern struct bus_type locomo_bus_type;
-
-#define LOCOMO_DEVID_KEYBOARD  0
-#define LOCOMO_DEVID_FRONTLIGHT        1
-#define LOCOMO_DEVID_BACKLIGHT 2
-#define LOCOMO_DEVID_AUDIO     3
-#define LOCOMO_DEVID_LED       4
-#define LOCOMO_DEVID_UART      5
-#define LOCOMO_DEVID_SPI       6
-
-struct locomo_dev {
-       struct device   dev;
-       unsigned int    devid;
-       unsigned int    irq[1];
-
-       void            *mapbase;
-       unsigned long   length;
-
-       u64             dma_mask;
-};
-
-#define LOCOMO_DEV(_d) container_of((_d), struct locomo_dev, dev)
-
-#define locomo_get_drvdata(d)  dev_get_drvdata(&(d)->dev)
-#define locomo_set_drvdata(d,p)        dev_set_drvdata(&(d)->dev, p)
-
-struct locomo_driver {
-       struct device_driver    drv;
-       unsigned int            devid;
-       int (*probe)(struct locomo_dev *);
-       int (*remove)(struct locomo_dev *);
-       int (*suspend)(struct locomo_dev *, pm_message_t);
-       int (*resume)(struct locomo_dev *);
-};
-
-#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
-
-#define LOCOMO_DRIVER_NAME(_ldev) ((_ldev)->dev.driver->name)
-
-void locomo_lcd_power(struct locomo_dev *, int, unsigned int);
-
-int locomo_driver_register(struct locomo_driver *);
-void locomo_driver_unregister(struct locomo_driver *);
-
-/* GPIO control functions */
-void locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir);
-int locomo_gpio_read_level(struct device *dev, unsigned int bits);
-int locomo_gpio_read_output(struct device *dev, unsigned int bits);
-void locomo_gpio_write(struct device *dev, unsigned int bits, unsigned int set);
-
-/* M62332 control function */
-void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
-
-/* Frontlight control */
-void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
-
-#endif
diff --git a/include/asm-arm/hardware/memc.h b/include/asm-arm/hardware/memc.h
deleted file mode 100644 (file)
index 8aef5aa..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/memc.h
- *
- *  Copyright (C) Russell King.
- *
- * 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.
- */
-#define VDMA_ALIGNMENT PAGE_SIZE
-#define VDMA_XFERSIZE  16
-#define VDMA_INIT      0
-#define VDMA_START     1
-#define VDMA_END       2
-
-#ifndef __ASSEMBLY__
-extern void memc_write(unsigned int reg, unsigned long val);
-
-#define video_set_dma(start,end,offset)                                \
-do {                                                           \
-       memc_write (VDMA_START, (start >> 2));                  \
-       memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2);      \
-       memc_write (VDMA_INIT, (offset >> 2));                  \
-} while (0)
-
-#endif
diff --git a/include/asm-arm/hardware/pci_v3.h b/include/asm-arm/hardware/pci_v3.h
deleted file mode 100644 (file)
index 4d497bd..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/pci_v3.h
- *
- *  Internal header file PCI V3 chip
- *
- *  Copyright (C) ARM Limited
- *  Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef ASM_ARM_HARDWARE_PCI_V3_H
-#define ASM_ARM_HARDWARE_PCI_V3_H
-
-/* -------------------------------------------------------------------------------
- *  V3 Local Bus to PCI Bridge definitions
- * -------------------------------------------------------------------------------
- *  Registers (these are taken from page 129 of the EPC User's Manual Rev 1.04
- *  All V3 register names are prefaced by V3_ to avoid clashing with any other
- *  PCI definitions.  Their names match the user's manual.
- * 
- *  I'm assuming that I20 is disabled.
- * 
- */
-#define V3_PCI_VENDOR                   0x00000000
-#define V3_PCI_DEVICE                   0x00000002
-#define V3_PCI_CMD                      0x00000004
-#define V3_PCI_STAT                     0x00000006
-#define V3_PCI_CC_REV                   0x00000008
-#define V3_PCI_HDR_CFG                  0x0000000C
-#define V3_PCI_IO_BASE                  0x00000010
-#define V3_PCI_BASE0                    0x00000014
-#define V3_PCI_BASE1                    0x00000018
-#define V3_PCI_SUB_VENDOR               0x0000002C
-#define V3_PCI_SUB_ID                   0x0000002E
-#define V3_PCI_ROM                      0x00000030
-#define V3_PCI_BPARAM                   0x0000003C
-#define V3_PCI_MAP0                     0x00000040
-#define V3_PCI_MAP1                     0x00000044
-#define V3_PCI_INT_STAT                 0x00000048
-#define V3_PCI_INT_CFG                  0x0000004C 
-#define V3_LB_BASE0                     0x00000054
-#define V3_LB_BASE1                     0x00000058
-#define V3_LB_MAP0                      0x0000005E
-#define V3_LB_MAP1                      0x00000062
-#define V3_LB_BASE2                     0x00000064
-#define V3_LB_MAP2                      0x00000066
-#define V3_LB_SIZE                      0x00000068
-#define V3_LB_IO_BASE                   0x0000006E
-#define V3_FIFO_CFG                     0x00000070
-#define V3_FIFO_PRIORITY                0x00000072
-#define V3_FIFO_STAT                    0x00000074
-#define V3_LB_ISTAT                     0x00000076
-#define V3_LB_IMASK                     0x00000077
-#define V3_SYSTEM                       0x00000078
-#define V3_LB_CFG                       0x0000007A
-#define V3_PCI_CFG                      0x0000007C
-#define V3_DMA_PCI_ADR0                 0x00000080
-#define V3_DMA_PCI_ADR1                 0x00000090
-#define V3_DMA_LOCAL_ADR0               0x00000084
-#define V3_DMA_LOCAL_ADR1               0x00000094
-#define V3_DMA_LENGTH0                  0x00000088
-#define V3_DMA_LENGTH1                  0x00000098
-#define V3_DMA_CSR0                     0x0000008B
-#define V3_DMA_CSR1                     0x0000009B
-#define V3_DMA_CTLB_ADR0                0x0000008C
-#define V3_DMA_CTLB_ADR1                0x0000009C
-#define V3_DMA_DELAY                    0x000000E0
-#define V3_MAIL_DATA                    0x000000C0
-#define V3_PCI_MAIL_IEWR                0x000000D0
-#define V3_PCI_MAIL_IERD                0x000000D2
-#define V3_LB_MAIL_IEWR                 0x000000D4
-#define V3_LB_MAIL_IERD                 0x000000D6
-#define V3_MAIL_WR_STAT                 0x000000D8
-#define V3_MAIL_RD_STAT                 0x000000DA
-#define V3_QBA_MAP                      0x000000DC
-
-/*  PCI COMMAND REGISTER bits
- */
-#define V3_COMMAND_M_FBB_EN             (1 << 9)
-#define V3_COMMAND_M_SERR_EN            (1 << 8)
-#define V3_COMMAND_M_PAR_EN             (1 << 6)
-#define V3_COMMAND_M_MASTER_EN          (1 << 2)
-#define V3_COMMAND_M_MEM_EN             (1 << 1)
-#define V3_COMMAND_M_IO_EN              (1 << 0)
-
-/*  SYSTEM REGISTER bits
- */
-#define V3_SYSTEM_M_RST_OUT             (1 << 15)
-#define V3_SYSTEM_M_LOCK                (1 << 14)
-
-/*  PCI_CFG bits
- */
-#define V3_PCI_CFG_M_I2O_EN            (1 << 15)
-#define V3_PCI_CFG_M_IO_REG_DIS                (1 << 14)
-#define V3_PCI_CFG_M_IO_DIS            (1 << 13)
-#define V3_PCI_CFG_M_EN3V              (1 << 12)
-#define V3_PCI_CFG_M_RETRY_EN           (1 << 10)
-#define V3_PCI_CFG_M_AD_LOW1            (1 << 9)
-#define V3_PCI_CFG_M_AD_LOW0            (1 << 8)
-
-/*  PCI_BASE register bits (PCI -> Local Bus)
- */
-#define V3_PCI_BASE_M_ADR_BASE          0xFFF00000
-#define V3_PCI_BASE_M_ADR_BASEL         0x000FFF00
-#define V3_PCI_BASE_M_PREFETCH          (1 << 3)
-#define V3_PCI_BASE_M_TYPE              (3 << 1)
-#define V3_PCI_BASE_M_IO                (1 << 0)
-
-/*  PCI MAP register bits (PCI -> Local bus)
- */
-#define V3_PCI_MAP_M_MAP_ADR            0xFFF00000
-#define V3_PCI_MAP_M_RD_POST_INH        (1 << 15)
-#define V3_PCI_MAP_M_ROM_SIZE           (3 << 10)
-#define V3_PCI_MAP_M_SWAP               (3 << 8)
-#define V3_PCI_MAP_M_ADR_SIZE           0x000000F0
-#define V3_PCI_MAP_M_REG_EN             (1 << 1)
-#define V3_PCI_MAP_M_ENABLE             (1 << 0)
-
-/*
- *  LB_BASE0,1 register bits (Local bus -> PCI)
- */
-#define V3_LB_BASE_ADR_BASE            0xfff00000
-#define V3_LB_BASE_SWAP                        (3 << 8)
-#define V3_LB_BASE_ADR_SIZE            (15 << 4)
-#define V3_LB_BASE_PREFETCH            (1 << 3)
-#define V3_LB_BASE_ENABLE              (1 << 0)
-
-#define V3_LB_BASE_ADR_SIZE_1MB                (0 << 4)
-#define V3_LB_BASE_ADR_SIZE_2MB                (1 << 4)
-#define V3_LB_BASE_ADR_SIZE_4MB                (2 << 4)
-#define V3_LB_BASE_ADR_SIZE_8MB                (3 << 4)
-#define V3_LB_BASE_ADR_SIZE_16MB       (4 << 4)
-#define V3_LB_BASE_ADR_SIZE_32MB       (5 << 4)
-#define V3_LB_BASE_ADR_SIZE_64MB       (6 << 4)
-#define V3_LB_BASE_ADR_SIZE_128MB      (7 << 4)
-#define V3_LB_BASE_ADR_SIZE_256MB      (8 << 4)
-#define V3_LB_BASE_ADR_SIZE_512MB      (9 << 4)
-#define V3_LB_BASE_ADR_SIZE_1GB                (10 << 4)
-#define V3_LB_BASE_ADR_SIZE_2GB                (11 << 4)
-
-#define v3_addr_to_lb_base(a)  ((a) & V3_LB_BASE_ADR_BASE)
-
-/*
- *  LB_MAP0,1 register bits (Local bus -> PCI)
- */
-#define V3_LB_MAP_MAP_ADR              0xfff0
-#define V3_LB_MAP_TYPE                 (7 << 1)
-#define V3_LB_MAP_AD_LOW_EN            (1 << 0)
-
-#define V3_LB_MAP_TYPE_IACK            (0 << 1)
-#define V3_LB_MAP_TYPE_IO              (1 << 1)
-#define V3_LB_MAP_TYPE_MEM             (3 << 1)
-#define V3_LB_MAP_TYPE_CONFIG          (5 << 1)
-#define V3_LB_MAP_TYPE_MEM_MULTIPLE    (6 << 1)
-
-#define v3_addr_to_lb_map(a)   (((a) >> 16) & V3_LB_MAP_MAP_ADR)
-
-/*
- *  LB_BASE2 register bits (Local bus -> PCI IO)
- */
-#define V3_LB_BASE2_ADR_BASE           0xff00
-#define V3_LB_BASE2_SWAP               (3 << 6)
-#define V3_LB_BASE2_ENABLE             (1 << 0)
-
-#define v3_addr_to_lb_base2(a) (((a) >> 16) & V3_LB_BASE2_ADR_BASE)
-
-/*
- *  LB_MAP2 register bits (Local bus -> PCI IO)
- */
-#define V3_LB_MAP2_MAP_ADR             0xff00
-
-#define v3_addr_to_lb_map2(a)  (((a) >> 16) & V3_LB_MAP2_MAP_ADR)
-
-#endif
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
deleted file mode 100644 (file)
index 61b1d05..0000000
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * linux/include/asm-arm/hardware/sa1111.h
- *
- * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
- *
- * This file contains definitions for the SA-1111 Companion Chip.
- * (Structure and naming borrowed from SA-1101.h, by Peter Danielsson.)
- *
- * Macro that calculates real address for registers in the SA-1111
- */
-
-#ifndef _ASM_ARCH_SA1111
-#define _ASM_ARCH_SA1111
-
-#include <asm/arch/bitfield.h>
-
-/*
- * The SA1111 is always located at virtual 0xf4000000, and is always
- * "native" endian.
- */
-
-#define SA1111_VBASE           0xf4000000
-
-/* Don't use these! */
-#define SA1111_p2v( x )         ((x) - SA1111_BASE + SA1111_VBASE)
-#define SA1111_v2p( x )         ((x) - SA1111_VBASE + SA1111_BASE)
-
-#ifndef __ASSEMBLY__
-#define _SA1111(x)     ((x) + sa1111->resource.start)
-#endif
-
-#define sa1111_writel(val,addr)        __raw_writel(val, addr)
-#define sa1111_readl(addr)     __raw_readl(addr)
-
-/*
- * 26 bits of the SA-1110 address bus are available to the SA-1111.
- * Use these when feeding target addresses to the DMA engines.
- */
-
-#define SA1111_ADDR_WIDTH      (26)
-#define SA1111_ADDR_MASK       ((1<<SA1111_ADDR_WIDTH)-1)
-#define SA1111_DMA_ADDR(x)     ((x)&SA1111_ADDR_MASK)
-
-/*
- * Don't ask the (SAC) DMA engines to move less than this amount.
- */
-
-#define SA1111_SAC_DMA_MIN_XFER        (0x800)
-
-/*
- * System Bus Interface (SBI)
- *
- * Registers
- *    SKCR     Control Register
- *    SMCR     Shared Memory Controller Register
- *    SKID     ID Register
- */
-#define SA1111_SKCR    0x0000
-#define SA1111_SMCR    0x0004
-#define SA1111_SKID    0x0008
-
-#define SKCR_PLL_BYPASS        (1<<0)
-#define SKCR_RCLKEN    (1<<1)
-#define SKCR_SLEEP     (1<<2)
-#define SKCR_DOZE      (1<<3)
-#define SKCR_VCO_OFF   (1<<4)
-#define SKCR_SCANTSTEN (1<<5)
-#define SKCR_CLKTSTEN  (1<<6)
-#define SKCR_RDYEN     (1<<7)
-#define SKCR_SELAC     (1<<8)
-#define SKCR_OPPC      (1<<9)
-#define SKCR_PLLTSTEN  (1<<10)
-#define SKCR_USBIOTSTEN        (1<<11)
-/*
- * Don't believe the specs!  Take them, throw them outside.  Leave them
- * there for a week.  Spit on them.  Walk on them.  Stamp on them.
- * Pour gasoline over them and finally burn them.  Now think about coding.
- *  - The October 1999 errata (278260-007) says its bit 13, 1 to enable.
- *  - The Feb 2001 errata (278260-010) says that the previous errata
- *    (278260-009) is wrong, and its bit actually 12, fixed in spec
- *    278242-003.
- *  - The SA1111 manual (278242) says bit 12, but 0 to enable.
- *  - Reality is bit 13, 1 to enable.
- *      -- rmk
- */
-#define SKCR_OE_EN     (1<<13)
-
-#define SMCR_DTIM      (1<<0)
-#define SMCR_MBGE      (1<<1)
-#define SMCR_DRAC_0    (1<<2)
-#define SMCR_DRAC_1    (1<<3)
-#define SMCR_DRAC_2    (1<<4)
-#define SMCR_DRAC      Fld(3, 2)
-#define SMCR_CLAT      (1<<5)
-
-#define SKID_SIREV_MASK        (0x000000f0)
-#define SKID_MTREV_MASK (0x0000000f)
-#define SKID_ID_MASK   (0xffffff00)
-#define SKID_SA1111_ID (0x690cc200)
-
-/*
- * System Controller
- *
- * Registers
- *    SKPCR    Power Control Register
- *    SKCDR    Clock Divider Register
- *    SKAUD    Audio Clock Divider Register
- *    SKPMC    PS/2 Mouse Clock Divider Register
- *    SKPTC    PS/2 Track Pad Clock Divider Register
- *    SKPEN0   PWM0 Enable Register
- *    SKPWM0   PWM0 Clock Register
- *    SKPEN1   PWM1 Enable Register
- *    SKPWM1   PWM1 Clock Register
- */
-#define SA1111_SKPCR   0x0200
-#define SA1111_SKCDR   0x0204
-#define SA1111_SKAUD   0x0208
-#define SA1111_SKPMC   0x020c
-#define SA1111_SKPTC   0x0210
-#define SA1111_SKPEN0  0x0214
-#define SA1111_SKPWM0  0x0218
-#define SA1111_SKPEN1  0x021c
-#define SA1111_SKPWM1  0x0220
-
-#define SKPCR_UCLKEN   (1<<0)
-#define SKPCR_ACCLKEN  (1<<1)
-#define SKPCR_I2SCLKEN (1<<2)
-#define SKPCR_L3CLKEN  (1<<3)
-#define SKPCR_SCLKEN   (1<<4)
-#define SKPCR_PMCLKEN  (1<<5)
-#define SKPCR_PTCLKEN  (1<<6)
-#define SKPCR_DCLKEN   (1<<7)
-#define SKPCR_PWMCLKEN (1<<8)
-
-/*
- * USB Host controller
- */
-#define SA1111_USB             0x0400
-
-/*
- * Offsets from SA1111_USB_BASE
- */
-#define SA1111_USB_STATUS      0x0118
-#define SA1111_USB_RESET       0x011c
-#define SA1111_USB_IRQTEST     0x0120
-
-#define USB_RESET_FORCEIFRESET (1 << 0)
-#define USB_RESET_FORCEHCRESET (1 << 1)
-#define USB_RESET_CLKGENRESET  (1 << 2)
-#define USB_RESET_SIMSCALEDOWN (1 << 3)
-#define USB_RESET_USBINTTEST   (1 << 4)
-#define USB_RESET_SLEEPSTBYEN  (1 << 5)
-#define USB_RESET_PWRSENSELOW  (1 << 6)
-#define USB_RESET_PWRCTRLLOW   (1 << 7)
-
-#define USB_STATUS_IRQHCIRMTWKUP  (1 <<  7)
-#define USB_STATUS_IRQHCIBUFFACC  (1 <<  8)
-#define USB_STATUS_NIRQHCIM       (1 <<  9)
-#define USB_STATUS_NHCIMFCLR      (1 << 10)
-#define USB_STATUS_USBPWRSENSE    (1 << 11)
-
-/*
- * Serial Audio Controller
- *
- * Registers
- *    SACR0             Serial Audio Common Control Register
- *    SACR1             Serial Audio Alternate Mode (I2C/MSB) Control Register
- *    SACR2             Serial Audio AC-link Control Register
- *    SASR0             Serial Audio I2S/MSB Interface & FIFO Status Register
- *    SASR1             Serial Audio AC-link Interface & FIFO Status Register
- *    SASCR             Serial Audio Status Clear Register
- *    L3_CAR            L3 Control Bus Address Register
- *    L3_CDR            L3 Control Bus Data Register
- *    ACCAR             AC-link Command Address Register
- *    ACCDR             AC-link Command Data Register
- *    ACSAR             AC-link Status Address Register
- *    ACSDR             AC-link Status Data Register
- *    SADTCS            Serial Audio DMA Transmit Control/Status Register
- *    SADTSA            Serial Audio DMA Transmit Buffer Start Address A
- *    SADTCA            Serial Audio DMA Transmit Buffer Count Register A
- *    SADTSB            Serial Audio DMA Transmit Buffer Start Address B
- *    SADTCB            Serial Audio DMA Transmit Buffer Count Register B
- *    SADRCS            Serial Audio DMA Receive Control/Status Register
- *    SADRSA            Serial Audio DMA Receive Buffer Start Address A
- *    SADRCA            Serial Audio DMA Receive Buffer Count Register A
- *    SADRSB            Serial Audio DMA Receive Buffer Start Address B
- *    SADRCB            Serial Audio DMA Receive Buffer Count Register B
- *    SAITR             Serial Audio Interrupt Test Register
- *    SADR              Serial Audio Data Register (16 x 32-bit)
- */
-
-#define SA1111_SERAUDIO                0x0600
-
-/*
- * These are offsets from the above base.
- */
-#define SA1111_SACR0           0x00
-#define SA1111_SACR1           0x04
-#define SA1111_SACR2           0x08
-#define SA1111_SASR0           0x0c
-#define SA1111_SASR1           0x10
-#define SA1111_SASCR           0x18
-#define SA1111_L3_CAR          0x1c
-#define SA1111_L3_CDR          0x20
-#define SA1111_ACCAR           0x24
-#define SA1111_ACCDR           0x28
-#define SA1111_ACSAR           0x2c
-#define SA1111_ACSDR           0x30
-#define SA1111_SADTCS          0x34
-#define SA1111_SADTSA          0x38
-#define SA1111_SADTCA          0x3c
-#define SA1111_SADTSB          0x40
-#define SA1111_SADTCB          0x44
-#define SA1111_SADRCS          0x48
-#define SA1111_SADRSA          0x4c
-#define SA1111_SADRCA          0x50
-#define SA1111_SADRSB          0x54
-#define SA1111_SADRCB          0x58
-#define SA1111_SAITR           0x5c
-#define SA1111_SADR            0x80
-
-#ifndef CONFIG_ARCH_PXA
-
-#define SACR0_ENB      (1<<0)
-#define SACR0_BCKD     (1<<2)
-#define SACR0_RST      (1<<3)
-
-#define SACR1_AMSL     (1<<0)
-#define SACR1_L3EN     (1<<1)
-#define SACR1_L3MB     (1<<2)
-#define SACR1_DREC     (1<<3)
-#define SACR1_DRPL     (1<<4)
-#define SACR1_ENLBF    (1<<5)
-
-#define SACR2_TS3V     (1<<0)
-#define SACR2_TS4V     (1<<1)
-#define SACR2_WKUP     (1<<2)
-#define SACR2_DREC     (1<<3)
-#define SACR2_DRPL     (1<<4)
-#define SACR2_ENLBF    (1<<5)
-#define SACR2_RESET    (1<<6)
-
-#define SASR0_TNF      (1<<0)
-#define SASR0_RNE      (1<<1)
-#define SASR0_BSY      (1<<2)
-#define SASR0_TFS      (1<<3)
-#define SASR0_RFS      (1<<4)
-#define SASR0_TUR      (1<<5)
-#define SASR0_ROR      (1<<6)
-#define SASR0_L3WD     (1<<16)
-#define SASR0_L3RD     (1<<17)
-
-#define SASR1_TNF      (1<<0)
-#define SASR1_RNE      (1<<1)
-#define SASR1_BSY      (1<<2)
-#define SASR1_TFS      (1<<3)
-#define SASR1_RFS      (1<<4)
-#define SASR1_TUR      (1<<5)
-#define SASR1_ROR      (1<<6)
-#define SASR1_CADT     (1<<16)
-#define SASR1_SADR     (1<<17)
-#define SASR1_RSTO     (1<<18)
-#define SASR1_CLPM     (1<<19)
-#define SASR1_CRDY     (1<<20)
-#define SASR1_RS3V     (1<<21)
-#define SASR1_RS4V     (1<<22)
-
-#define SASCR_TUR      (1<<5)
-#define SASCR_ROR      (1<<6)
-#define SASCR_DTS      (1<<16)
-#define SASCR_RDD      (1<<17)
-#define SASCR_STO      (1<<18)
-
-#define SADTCS_TDEN    (1<<0)
-#define SADTCS_TDIE    (1<<1)
-#define SADTCS_TDBDA   (1<<3)
-#define SADTCS_TDSTA   (1<<4)
-#define SADTCS_TDBDB   (1<<5)
-#define SADTCS_TDSTB   (1<<6)
-#define SADTCS_TBIU    (1<<7)
-
-#define SADRCS_RDEN    (1<<0)
-#define SADRCS_RDIE    (1<<1)
-#define SADRCS_RDBDA   (1<<3)
-#define SADRCS_RDSTA   (1<<4)
-#define SADRCS_RDBDB   (1<<5)
-#define SADRCS_RDSTB   (1<<6)
-#define SADRCS_RBIU    (1<<7)
-
-#define SAD_CS_DEN     (1<<0)
-#define SAD_CS_DIE     (1<<1)  /* Not functional on metal 1 */
-#define SAD_CS_DBDA    (1<<3)  /* Not functional on metal 1 */
-#define SAD_CS_DSTA    (1<<4)
-#define SAD_CS_DBDB    (1<<5)  /* Not functional on metal 1 */
-#define SAD_CS_DSTB    (1<<6)
-#define SAD_CS_BIU     (1<<7)  /* Not functional on metal 1 */
-
-#define SAITR_TFS      (1<<0)
-#define SAITR_RFS      (1<<1)
-#define SAITR_TUR      (1<<2)
-#define SAITR_ROR      (1<<3)
-#define SAITR_CADT     (1<<4)
-#define SAITR_SADR     (1<<5)
-#define SAITR_RSTO     (1<<6)
-#define SAITR_TDBDA    (1<<8)
-#define SAITR_TDBDB    (1<<9)
-#define SAITR_RDBDA    (1<<10)
-#define SAITR_RDBDB    (1<<11)
-
-#endif  /* !CONFIG_ARCH_PXA */
-
-/*
- * General-Purpose I/O Interface
- *
- * Registers
- *    PA_DDR           GPIO Block A Data Direction
- *    PA_DRR/PA_DWR    GPIO Block A Data Value Register (read/write)
- *    PA_SDR           GPIO Block A Sleep Direction
- *    PA_SSR           GPIO Block A Sleep State
- *    PB_DDR           GPIO Block B Data Direction
- *    PB_DRR/PB_DWR    GPIO Block B Data Value Register (read/write)
- *    PB_SDR           GPIO Block B Sleep Direction
- *    PB_SSR           GPIO Block B Sleep State
- *    PC_DDR           GPIO Block C Data Direction
- *    PC_DRR/PC_DWR    GPIO Block C Data Value Register (read/write)
- *    PC_SDR           GPIO Block C Sleep Direction
- *    PC_SSR           GPIO Block C Sleep State
- */
-
-#define _PA_DDR                _SA1111( 0x1000 )
-#define _PA_DRR                _SA1111( 0x1004 )
-#define _PA_DWR                _SA1111( 0x1004 )
-#define _PA_SDR                _SA1111( 0x1008 )
-#define _PA_SSR                _SA1111( 0x100c )
-#define _PB_DDR                _SA1111( 0x1010 )
-#define _PB_DRR                _SA1111( 0x1014 )
-#define _PB_DWR                _SA1111( 0x1014 )
-#define _PB_SDR                _SA1111( 0x1018 )
-#define _PB_SSR                _SA1111( 0x101c )
-#define _PC_DDR                _SA1111( 0x1020 )
-#define _PC_DRR                _SA1111( 0x1024 )
-#define _PC_DWR                _SA1111( 0x1024 )
-#define _PC_SDR                _SA1111( 0x1028 )
-#define _PC_SSR                _SA1111( 0x102c )
-
-#define SA1111_GPIO    0x1000
-
-#define SA1111_GPIO_PADDR      (0x000)
-#define SA1111_GPIO_PADRR      (0x004)
-#define SA1111_GPIO_PADWR      (0x004)
-#define SA1111_GPIO_PASDR      (0x008)
-#define SA1111_GPIO_PASSR      (0x00c)
-#define SA1111_GPIO_PBDDR      (0x010)
-#define SA1111_GPIO_PBDRR      (0x014)
-#define SA1111_GPIO_PBDWR      (0x014)
-#define SA1111_GPIO_PBSDR      (0x018)
-#define SA1111_GPIO_PBSSR      (0x01c)
-#define SA1111_GPIO_PCDDR      (0x020)
-#define SA1111_GPIO_PCDRR      (0x024)
-#define SA1111_GPIO_PCDWR      (0x024)
-#define SA1111_GPIO_PCSDR      (0x028)
-#define SA1111_GPIO_PCSSR      (0x02c)
-
-#define GPIO_A0                (1 << 0)
-#define GPIO_A1                (1 << 1)
-#define GPIO_A2                (1 << 2)
-#define GPIO_A3                (1 << 3)
-
-#define GPIO_B0                (1 << 8)
-#define GPIO_B1                (1 << 9)
-#define GPIO_B2                (1 << 10)
-#define GPIO_B3                (1 << 11)
-#define GPIO_B4                (1 << 12)
-#define GPIO_B5                (1 << 13)
-#define GPIO_B6                (1 << 14)
-#define GPIO_B7                (1 << 15)
-
-#define GPIO_C0                (1 << 16)
-#define GPIO_C1                (1 << 17)
-#define GPIO_C2                (1 << 18)
-#define GPIO_C3                (1 << 19)
-#define GPIO_C4                (1 << 20)
-#define GPIO_C5                (1 << 21)
-#define GPIO_C6                (1 << 22)
-#define GPIO_C7                (1 << 23)
-
-/*
- * Interrupt Controller
- *
- * Registers
- *    INTTEST0         Test register 0
- *    INTTEST1         Test register 1
- *    INTEN0           Interrupt Enable register 0
- *    INTEN1           Interrupt Enable register 1
- *    INTPOL0          Interrupt Polarity selection 0
- *    INTPOL1          Interrupt Polarity selection 1
- *    INTTSTSEL                Interrupt source selection
- *    INTSTATCLR0      Interrupt Status/Clear 0
- *    INTSTATCLR1      Interrupt Status/Clear 1
- *    INTSET0          Interrupt source set 0
- *    INTSET1          Interrupt source set 1
- *    WAKE_EN0         Wake-up source enable 0
- *    WAKE_EN1         Wake-up source enable 1
- *    WAKE_POL0                Wake-up polarity selection 0
- *    WAKE_POL1                Wake-up polarity selection 1
- */
-#define SA1111_INTC            0x1600
-
-/*
- * These are offsets from the above base.
- */
-#define SA1111_INTTEST0                0x0000
-#define SA1111_INTTEST1                0x0004
-#define SA1111_INTEN0          0x0008
-#define SA1111_INTEN1          0x000c
-#define SA1111_INTPOL0         0x0010
-#define SA1111_INTPOL1         0x0014
-#define SA1111_INTTSTSEL       0x0018
-#define SA1111_INTSTATCLR0     0x001c
-#define SA1111_INTSTATCLR1     0x0020
-#define SA1111_INTSET0         0x0024
-#define SA1111_INTSET1         0x0028
-#define SA1111_WAKEEN0         0x002c
-#define SA1111_WAKEEN1         0x0030
-#define SA1111_WAKEPOL0                0x0034
-#define SA1111_WAKEPOL1                0x0038
-
-/*
- * PS/2 Trackpad and Mouse Interfaces
- *
- * Registers
- *    PS2CR            Control Register
- *    PS2STAT          Status Register
- *    PS2DATA          Transmit/Receive Data register
- *    PS2CLKDIV                Clock Division Register
- *    PS2PRECNT                Clock Precount Register
- *    PS2TEST1         Test register 1
- *    PS2TEST2         Test register 2
- *    PS2TEST3         Test register 3
- *    PS2TEST4         Test register 4
- */
-
-#define SA1111_KBD             0x0a00
-#define SA1111_MSE             0x0c00
-
-/*
- * These are offsets from the above bases.
- */
-#define SA1111_PS2CR           0x0000
-#define SA1111_PS2STAT         0x0004
-#define SA1111_PS2DATA         0x0008
-#define SA1111_PS2CLKDIV       0x000c
-#define SA1111_PS2PRECNT       0x0010
-
-#define PS2CR_ENA              0x08
-#define PS2CR_FKD              0x02
-#define PS2CR_FKC              0x01
-
-#define PS2STAT_STP            0x0100
-#define PS2STAT_TXE            0x0080
-#define PS2STAT_TXB            0x0040
-#define PS2STAT_RXF            0x0020
-#define PS2STAT_RXB            0x0010
-#define PS2STAT_ENA            0x0008
-#define PS2STAT_RXP            0x0004
-#define PS2STAT_KBD            0x0002
-#define PS2STAT_KBC            0x0001
-
-/*
- * PCMCIA Interface
- *
- * Registers
- *    PCSR     Status Register
- *    PCCR     Control Register
- *    PCSSR    Sleep State Register
- */
-
-#define SA1111_PCMCIA  0x1600
-
-/*
- * These are offsets from the above base.
- */
-#define SA1111_PCCR    0x0000
-#define SA1111_PCSSR   0x0004
-#define SA1111_PCSR    0x0008
-
-#define PCSR_S0_READY  (1<<0)
-#define PCSR_S1_READY  (1<<1)
-#define PCSR_S0_DETECT (1<<2)
-#define PCSR_S1_DETECT (1<<3)
-#define PCSR_S0_VS1    (1<<4)
-#define PCSR_S0_VS2    (1<<5)
-#define PCSR_S1_VS1    (1<<6)
-#define PCSR_S1_VS2    (1<<7)
-#define PCSR_S0_WP     (1<<8)
-#define PCSR_S1_WP     (1<<9)
-#define PCSR_S0_BVD1   (1<<10)
-#define PCSR_S0_BVD2   (1<<11)
-#define PCSR_S1_BVD1   (1<<12)
-#define PCSR_S1_BVD2   (1<<13)
-
-#define PCCR_S0_RST    (1<<0)
-#define PCCR_S1_RST    (1<<1)
-#define PCCR_S0_FLT    (1<<2)
-#define PCCR_S1_FLT    (1<<3)
-#define PCCR_S0_PWAITEN        (1<<4)
-#define PCCR_S1_PWAITEN        (1<<5)
-#define PCCR_S0_PSE    (1<<6)
-#define PCCR_S1_PSE    (1<<7)
-
-#define PCSSR_S0_SLEEP (1<<0)
-#define PCSSR_S1_SLEEP (1<<1)
-
-
-
-
-extern struct bus_type sa1111_bus_type;
-
-#define SA1111_DEVID_SBI       0
-#define SA1111_DEVID_SK                1
-#define SA1111_DEVID_USB       2
-#define SA1111_DEVID_SAC       3
-#define SA1111_DEVID_SSP       4
-#define SA1111_DEVID_PS2       5
-#define SA1111_DEVID_GPIO      6
-#define SA1111_DEVID_INT       7
-#define SA1111_DEVID_PCMCIA    8
-
-struct sa1111_dev {
-       struct device   dev;
-       unsigned int    devid;
-       struct resource res;
-       void __iomem    *mapbase;
-       unsigned int    skpcr_mask;
-       unsigned int    irq[6];
-       u64             dma_mask;
-};
-
-#define SA1111_DEV(_d) container_of((_d), struct sa1111_dev, dev)
-
-#define sa1111_get_drvdata(d)  dev_get_drvdata(&(d)->dev)
-#define sa1111_set_drvdata(d,p)        dev_set_drvdata(&(d)->dev, p)
-
-struct sa1111_driver {
-       struct device_driver    drv;
-       unsigned int            devid;
-       int (*probe)(struct sa1111_dev *);
-       int (*remove)(struct sa1111_dev *);
-       int (*suspend)(struct sa1111_dev *, pm_message_t);
-       int (*resume)(struct sa1111_dev *);
-};
-
-#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
-
-#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
-
-/*
- * These frob the SKPCR register.
- */
-void sa1111_enable_device(struct sa1111_dev *);
-void sa1111_disable_device(struct sa1111_dev *);
-
-unsigned int sa1111_pll_clock(struct sa1111_dev *);
-
-#define SA1111_AUDIO_ACLINK    0
-#define SA1111_AUDIO_I2S       1
-
-void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode);
-int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate);
-int sa1111_get_audio_rate(struct sa1111_dev *sadev);
-
-int sa1111_check_dma_bug(dma_addr_t addr);
-
-int sa1111_driver_register(struct sa1111_driver *);
-void sa1111_driver_unregister(struct sa1111_driver *);
-
-void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir);
-void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
-void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
-
-#endif  /* _ASM_ARCH_SA1111 */
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h
deleted file mode 100644 (file)
index dfb8330..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Definitions for the SCOOP interface found on various Sharp PDAs
- *
- *  Copyright (c) 2004 Richard Purdie
- *
- *  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.
- *
- */
-
-#define SCOOP_MCR  0x00
-#define SCOOP_CDR  0x04
-#define SCOOP_CSR  0x08
-#define SCOOP_CPR  0x0C
-#define SCOOP_CCR  0x10
-#define SCOOP_IRR  0x14
-#define SCOOP_IRM  0x14
-#define SCOOP_IMR  0x18
-#define SCOOP_ISR  0x1C
-#define SCOOP_GPCR 0x20
-#define SCOOP_GPWR 0x24
-#define SCOOP_GPRR 0x28
-
-#define SCOOP_GPCR_PA22        ( 1 << 12 )
-#define SCOOP_GPCR_PA21        ( 1 << 11 )
-#define SCOOP_GPCR_PA20        ( 1 << 10 )
-#define SCOOP_GPCR_PA19        ( 1 << 9 )
-#define SCOOP_GPCR_PA18        ( 1 << 8 )
-#define SCOOP_GPCR_PA17        ( 1 << 7 )
-#define SCOOP_GPCR_PA16        ( 1 << 6 )
-#define SCOOP_GPCR_PA15        ( 1 << 5 )
-#define SCOOP_GPCR_PA14        ( 1 << 4 )
-#define SCOOP_GPCR_PA13        ( 1 << 3 )
-#define SCOOP_GPCR_PA12        ( 1 << 2 )
-#define SCOOP_GPCR_PA11        ( 1 << 1 )
-
-struct scoop_config {
-       unsigned short io_out;
-       unsigned short io_dir;
-       unsigned short suspend_clr;
-       unsigned short suspend_set;
-       int gpio_base;
-};
-
-/* Structure for linking scoop devices to PCMCIA sockets */
-struct scoop_pcmcia_dev {
-       struct device *dev;     /* Pointer to this socket's scoop device */
-       int     irq;                /* irq for socket */
-       int cd_irq;
-       const char *cd_irq_str;
-       unsigned char keep_vs;
-       unsigned char keep_rd;
-};
-
-struct scoop_pcmcia_config {
-       struct scoop_pcmcia_dev *devs;
-       int num_devs;
-       void (*pcmcia_init)(void);
-       void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
-};
-
-extern struct scoop_pcmcia_config *platform_scoop_config;
-
-void reset_scoop(struct device *dev);
-unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
-unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
-unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
-void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h
deleted file mode 100644 (file)
index 2d00db2..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * SharpSL Battery/PM Driver
- *
- * Copyright (c) 2004-2005 Richard Purdie
- *
- * 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.
- *
- */
-
-#include <linux/interrupt.h>
-
-struct sharpsl_charger_machinfo {
-       void (*init)(void);
-       void (*exit)(void);
-       int gpio_acin;
-       int gpio_batfull;
-       int batfull_irq;
-       int gpio_batlock;
-       int gpio_fatal;
-       void (*discharge)(int);
-       void (*discharge1)(int);
-       void (*charge)(int);
-       void (*measure_temp)(int);
-       void (*presuspend)(void);
-       void (*postsuspend)(void);
-       void (*earlyresume)(void);
-       unsigned long (*read_devdata)(int);
-#define SHARPSL_BATT_VOLT       1
-#define SHARPSL_BATT_TEMP       2
-#define SHARPSL_ACIN_VOLT       3
-#define SHARPSL_STATUS_ACIN     4
-#define SHARPSL_STATUS_LOCK     5
-#define SHARPSL_STATUS_CHRGFULL 6
-#define SHARPSL_STATUS_FATAL    7
-       unsigned long (*charger_wakeup)(void);
-       int (*should_wakeup)(unsigned int resume_on_alarm);
-       void (*backlight_limit)(int);
-       int (*backlight_get_status) (void);
-       int charge_on_volt;
-       int charge_on_temp;
-       int charge_acin_high;
-       int charge_acin_low;
-       int fatal_acin_volt;
-       int fatal_noacin_volt;
-       int bat_levels;
-       struct battery_thresh *bat_levels_noac;
-       struct battery_thresh *bat_levels_acin;
-       struct battery_thresh *bat_levels_noac_bl;
-       struct battery_thresh *bat_levels_acin_bl;
-       int status_high_acin;
-       int status_low_acin;
-       int status_high_noac;
-       int status_low_noac;
-};
-
-struct battery_thresh {
-       int voltage;
-       int percentage;
-};
-
-struct battery_stat {
-       int ac_status;         /* APM AC Present/Not Present */
-       int mainbat_status;    /* APM Main Battery Status */
-       int mainbat_percent;   /* Main Battery Percentage Charge */
-       int mainbat_voltage;   /* Main Battery Voltage */
-};
-
-struct sharpsl_pm_status {
-       struct device *dev;
-       struct timer_list ac_timer;
-       struct timer_list chrg_full_timer;
-
-       int charge_mode;
-#define CHRG_ERROR    (-1)
-#define CHRG_OFF      (0)
-#define CHRG_ON       (1)
-#define CHRG_DONE     (2)
-
-       unsigned int flags;
-#define SHARPSL_SUSPENDED       (1 << 0)  /* Device is Suspended */
-#define SHARPSL_ALARM_ACTIVE    (1 << 1)  /* Alarm is for charging event (not user) */
-#define SHARPSL_BL_LIMIT        (1 << 2)  /* Backlight Intensity Limited */
-#define SHARPSL_APM_QUEUED      (1 << 3)  /* APM Event Queued */
-#define SHARPSL_DO_OFFLINE_CHRG (1 << 4)  /* Trigger the offline charger */
-
-       int full_count;
-       unsigned long charge_start_time;
-       struct sharpsl_charger_machinfo *machinfo;
-       struct battery_stat battstat;
-};
-
-extern struct sharpsl_pm_status sharpsl_pm;
-
-
-#define SHARPSL_LED_ERROR  2
-#define SHARPSL_LED_ON     1
-#define SHARPSL_LED_OFF    0
-
-void sharpsl_battery_kick(void);
-void sharpsl_pm_led(int val);
-irqreturn_t sharpsl_ac_isr(int irq, void *dev_id);
-irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id);
-irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id);
-
diff --git a/include/asm-arm/hardware/ssp.h b/include/asm-arm/hardware/ssp.h
deleted file mode 100644 (file)
index 3b42e18..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  ssp.h
- *
- *  Copyright (C) 2003 Russell King, All Rights Reserved.
- *
- * 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.
- */
-#ifndef SSP_H
-#define SSP_H
-
-struct ssp_state {
-       unsigned int    cr0;
-       unsigned int    cr1;
-};
-
-int ssp_write_word(u16 data);
-int ssp_read_word(u16 *data);
-int ssp_flush(void);
-void ssp_enable(void);
-void ssp_disable(void);
-void ssp_save_state(struct ssp_state *ssp);
-void ssp_restore_state(struct ssp_state *ssp);
-int ssp_init(void);
-void ssp_exit(void);
-
-#endif
diff --git a/include/asm-arm/hardware/uengine.h b/include/asm-arm/hardware/uengine.h
deleted file mode 100644 (file)
index b442d65..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Generic library functions for the microengines found on the Intel
- * IXP2000 series of network processors.
- *
- * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org>
- * Dedicated to Marija Kulikova.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of the
- * License, or (at your option) any later version.
- */
-
-#ifndef __IXP2000_UENGINE_H
-#define __IXP2000_UENGINE_H
-
-extern u32 ixp2000_uengine_mask;
-
-struct ixp2000_uengine_code
-{
-       u32     cpu_model_bitmask;
-       u8      cpu_min_revision;
-       u8      cpu_max_revision;
-
-       u32     uengine_parameters;
-
-       struct ixp2000_reg_value {
-               int     reg;
-               u32     value;
-       } *initial_reg_values;
-
-       int     num_insns;
-       u8      *insns;
-};
-
-u32 ixp2000_uengine_csr_read(int uengine, int offset);
-void ixp2000_uengine_csr_write(int uengine, int offset, u32 value);
-void ixp2000_uengine_reset(u32 uengine_mask);
-void ixp2000_uengine_set_mode(int uengine, u32 mode);
-void ixp2000_uengine_load_microcode(int uengine, u8 *ucode, int insns);
-void ixp2000_uengine_init_context(int uengine, int context, int pc);
-void ixp2000_uengine_start_contexts(int uengine, u8 ctx_mask);
-void ixp2000_uengine_stop_contexts(int uengine, u8 ctx_mask);
-int ixp2000_uengine_load(int uengine, struct ixp2000_uengine_code *c);
-
-#define IXP2000_UENGINE_8_CONTEXTS             0x00000000
-#define IXP2000_UENGINE_4_CONTEXTS             0x80000000
-#define IXP2000_UENGINE_PRN_UPDATE_EVERY       0x40000000
-#define IXP2000_UENGINE_PRN_UPDATE_ON_ACCESS   0x00000000
-#define IXP2000_UENGINE_NN_FROM_SELF           0x00100000
-#define IXP2000_UENGINE_NN_FROM_PREVIOUS       0x00000000
-#define IXP2000_UENGINE_ASSERT_EMPTY_AT_3      0x000c0000
-#define IXP2000_UENGINE_ASSERT_EMPTY_AT_2      0x00080000
-#define IXP2000_UENGINE_ASSERT_EMPTY_AT_1      0x00040000
-#define IXP2000_UENGINE_ASSERT_EMPTY_AT_0      0x00000000
-#define IXP2000_UENGINE_LM_ADDR1_GLOBAL                0x00020000
-#define IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT   0x00000000
-#define IXP2000_UENGINE_LM_ADDR0_GLOBAL                0x00010000
-#define IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT   0x00000000
-
-
-#endif
diff --git a/include/asm-arm/hardware/vic.h b/include/asm-arm/hardware/vic.h
deleted file mode 100644 (file)
index ed9ca37..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/vic.h
- *
- *  Copyright (c) ARM Limited 2003.  All rights reserved.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_HARDWARE_VIC_H
-#define __ASM_ARM_HARDWARE_VIC_H
-
-#define VIC_IRQ_STATUS                 0x00
-#define VIC_FIQ_STATUS                 0x04
-#define VIC_RAW_STATUS                 0x08
-#define VIC_INT_SELECT                 0x0c    /* 1 = FIQ, 0 = IRQ */
-#define VIC_INT_ENABLE                 0x10    /* 1 = enable, 0 = disable */
-#define VIC_INT_ENABLE_CLEAR           0x14
-#define VIC_INT_SOFT                   0x18
-#define VIC_INT_SOFT_CLEAR             0x1c
-#define VIC_PROTECT                    0x20
-#define VIC_VECT_ADDR                  0x30
-#define VIC_DEF_VECT_ADDR              0x34
-
-#define VIC_VECT_ADDR0                 0x100   /* 0 to 15 */
-#define VIC_VECT_CNTL0                 0x200   /* 0 to 15 */
-#define VIC_ITCR                       0x300   /* VIC test control register */
-
-#define VIC_VECT_CNTL_ENABLE           (1 << 5)
-
-#ifndef __ASSEMBLY__
-void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources);
-#endif
-
-#endif
diff --git a/include/asm-arm/hw_irq.h b/include/asm-arm/hw_irq.h
deleted file mode 100644 (file)
index f1a08a5..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Nothing to see here yet
- */
-#ifndef _ARCH_ARM_HW_IRQ_H
-#define _ARCH_ARM_HW_IRQ_H
-
-#include <asm/mach/irq.h>
-
-#endif
diff --git a/include/asm-arm/hwcap.h b/include/asm-arm/hwcap.h
deleted file mode 100644 (file)
index 81f4c89..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __ASMARM_HWCAP_H
-#define __ASMARM_HWCAP_H
-
-/*
- * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
- */
-#define HWCAP_SWP      1
-#define HWCAP_HALF     2
-#define HWCAP_THUMB    4
-#define HWCAP_26BIT    8       /* Play it safe */
-#define HWCAP_FAST_MULT        16
-#define HWCAP_FPA      32
-#define HWCAP_VFP      64
-#define HWCAP_EDSP     128
-#define HWCAP_JAVA     256
-#define HWCAP_IWMMXT   512
-#define HWCAP_CRUNCH   1024
-#define HWCAP_THUMBEE  2048
-
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
-/*
- * This yields a mask that user programs can use to figure out what
- * instruction set this cpu supports.
- */
-#define ELF_HWCAP      (elf_hwcap)
-extern unsigned int elf_hwcap;
-#endif
-
-#endif
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
deleted file mode 100644 (file)
index a48019f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *  linux/include/asm-arm/ide.h
- *
- *  Copyright (C) 1994-1996  Linus Torvalds & authors
- */
-
-/*
- *  This file contains the ARM architecture specific IDE code.
- */
-
-#ifndef __ASMARM_IDE_H
-#define __ASMARM_IDE_H
-
-#ifdef __KERNEL__
-
-#define __ide_mm_insw(port,addr,len)   readsw(port,addr,len)
-#define __ide_mm_insl(port,addr,len)   readsl(port,addr,len)
-#define __ide_mm_outsw(port,addr,len)  writesw(port,addr,len)
-#define __ide_mm_outsl(port,addr,len)  writesl(port,addr,len)
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASMARM_IDE_H */
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
deleted file mode 100644 (file)
index eebe56e..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- *  linux/include/asm-arm/io.h
- *
- *  Copyright (C) 1996-2000 Russell King
- *
- * 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.
- *
- * Modifications:
- *  16-Sep-1996        RMK     Inlined the inx/outx functions & optimised for both
- *                     constant addresses and variable addresses.
- *  04-Dec-1997        RMK     Moved a lot of this stuff to the new architecture
- *                     specific IO header files.
- *  27-Mar-1999        PJB     Second parameter of memcpy_toio is const..
- *  04-Apr-1999        PJB     Added check_signature.
- *  12-Dec-1999        RMK     More cleanups
- *  18-Jun-2000 RMK    Removed virt_to_* and friends definitions
- *  05-Oct-2004 BJD     Moved memory string functions to use void __iomem
- */
-#ifndef __ASM_ARM_IO_H
-#define __ASM_ARM_IO_H
-
-#ifdef __KERNEL__
-
-#include <linux/types.h>
-#include <asm/byteorder.h>
-#include <asm/memory.h>
-
-/*
- * ISA I/O bus memory addresses are 1:1 with the physical address.
- */
-#define isa_virt_to_bus virt_to_phys
-#define isa_page_to_bus page_to_phys
-#define isa_bus_to_virt phys_to_virt
-
-/*
- * Generic IO read/write.  These perform native-endian accesses.  Note
- * that some architectures will want to re-define __raw_{read,write}w.
- */
-extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen);
-extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen);
-extern void __raw_writesl(void __iomem *addr, const void *data, int longlen);
-
-extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen);
-extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen);
-extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
-
-#define __raw_writeb(v,a)      (__chk_io_ptr(a), *(volatile unsigned char __force  *)(a) = (v))
-#define __raw_writew(v,a)      (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))
-#define __raw_writel(v,a)      (__chk_io_ptr(a), *(volatile unsigned int __force   *)(a) = (v))
-
-#define __raw_readb(a)         (__chk_io_ptr(a), *(volatile unsigned char __force  *)(a))
-#define __raw_readw(a)         (__chk_io_ptr(a), *(volatile unsigned short __force *)(a))
-#define __raw_readl(a)         (__chk_io_ptr(a), *(volatile unsigned int __force   *)(a))
-
-/*
- * Architecture ioremap implementation.
- */
-#define MT_DEVICE              0
-#define MT_DEVICE_NONSHARED    1
-#define MT_DEVICE_CACHED       2
-#define MT_DEVICE_IXP2000      3
-/*
- * types 4 onwards can be found in asm/mach/map.h and are undefined
- * for ioremap
- */
-
-/*
- * __arm_ioremap takes CPU physical address.
- * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
- */
-extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
-extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int);
-extern void __iounmap(volatile void __iomem *addr);
-
-/*
- * Bad read/write accesses...
- */
-extern void __readwrite_bug(const char *fn);
-
-/*
- * Now, pick up the machine-defined IO definitions
- */
-#include <asm/arch/io.h>
-
-/*
- *  IO port access primitives
- *  -------------------------
- *
- * The ARM doesn't have special IO access instructions; all IO is memory
- * mapped.  Note that these are defined to perform little endian accesses
- * only.  Their primary purpose is to access PCI and ISA peripherals.
- *
- * Note that for a big endian machine, this implies that the following
- * big endian mode connectivity is in place, as described by numerous
- * ARM documents:
- *
- *    PCI:  D0-D7   D8-D15 D16-D23 D24-D31
- *    ARM: D24-D31 D16-D23  D8-D15  D0-D7
- *
- * The machine specific io.h include defines __io to translate an "IO"
- * address to a memory address.
- *
- * Note that we prevent GCC re-ordering or caching values in expressions
- * by introducing sequence points into the in*() definitions.  Note that
- * __raw_* do not guarantee this behaviour.
- *
- * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space.
- */
-#ifdef __io
-#define outb(v,p)              __raw_writeb(v,__io(p))
-#define outw(v,p)              __raw_writew((__force __u16) \
-                                       cpu_to_le16(v),__io(p))
-#define outl(v,p)              __raw_writel((__force __u32) \
-                                       cpu_to_le32(v),__io(p))
-
-#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __v; })
-#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \
-                       __raw_readw(__io(p))); __v; })
-#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \
-                       __raw_readl(__io(p))); __v; })
-
-#define outsb(p,d,l)           __raw_writesb(__io(p),d,l)
-#define outsw(p,d,l)           __raw_writesw(__io(p),d,l)
-#define outsl(p,d,l)           __raw_writesl(__io(p),d,l)
-
-#define insb(p,d,l)            __raw_readsb(__io(p),d,l)
-#define insw(p,d,l)            __raw_readsw(__io(p),d,l)
-#define insl(p,d,l)            __raw_readsl(__io(p),d,l)
-#endif
-
-#define outb_p(val,port)       outb((val),(port))
-#define outw_p(val,port)       outw((val),(port))
-#define outl_p(val,port)       outl((val),(port))
-#define inb_p(port)            inb((port))
-#define inw_p(port)            inw((port))
-#define inl_p(port)            inl((port))
-
-#define outsb_p(port,from,len) outsb(port,from,len)
-#define outsw_p(port,from,len) outsw(port,from,len)
-#define outsl_p(port,from,len) outsl(port,from,len)
-#define insb_p(port,to,len)    insb(port,to,len)
-#define insw_p(port,to,len)    insw(port,to,len)
-#define insl_p(port,to,len)    insl(port,to,len)
-
-/*
- * String version of IO memory access ops:
- */
-extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t);
-extern void _memcpy_toio(volatile void __iomem *, const void *, size_t);
-extern void _memset_io(volatile void __iomem *, int, size_t);
-
-#define mmiowb()
-
-/*
- *  Memory access primitives
- *  ------------------------
- *
- * These perform PCI memory accesses via an ioremap region.  They don't
- * take an address as such, but a cookie.
- *
- * Again, this are defined to perform little endian accesses.  See the
- * IO port primitives for more information.
- */
-#ifdef __mem_pci
-#define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
-#define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \
-                                       __raw_readw(__mem_pci(c))); __v; })
-#define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \
-                                       __raw_readl(__mem_pci(c))); __v; })
-#define readb_relaxed(addr) readb(addr)
-#define readw_relaxed(addr) readw(addr)
-#define readl_relaxed(addr) readl(addr)
-
-#define readsb(p,d,l)          __raw_readsb(__mem_pci(p),d,l)
-#define readsw(p,d,l)          __raw_readsw(__mem_pci(p),d,l)
-#define readsl(p,d,l)          __raw_readsl(__mem_pci(p),d,l)
-
-#define writeb(v,c)            __raw_writeb(v,__mem_pci(c))
-#define writew(v,c)            __raw_writew((__force __u16) \
-                                       cpu_to_le16(v),__mem_pci(c))
-#define writel(v,c)            __raw_writel((__force __u32) \
-                                       cpu_to_le32(v),__mem_pci(c))
-
-#define writesb(p,d,l)         __raw_writesb(__mem_pci(p),d,l)
-#define writesw(p,d,l)         __raw_writesw(__mem_pci(p),d,l)
-#define writesl(p,d,l)         __raw_writesl(__mem_pci(p),d,l)
-
-#define memset_io(c,v,l)       _memset_io(__mem_pci(c),(v),(l))
-#define memcpy_fromio(a,c,l)   _memcpy_fromio((a),__mem_pci(c),(l))
-#define memcpy_toio(c,a,l)     _memcpy_toio(__mem_pci(c),(a),(l))
-
-#elif !defined(readb)
-
-#define readb(c)                       (__readwrite_bug("readb"),0)
-#define readw(c)                       (__readwrite_bug("readw"),0)
-#define readl(c)                       (__readwrite_bug("readl"),0)
-#define writeb(v,c)                    __readwrite_bug("writeb")
-#define writew(v,c)                    __readwrite_bug("writew")
-#define writel(v,c)                    __readwrite_bug("writel")
-
-#define check_signature(io,sig,len)    (0)
-
-#endif /* __mem_pci */
-
-/*
- * ioremap and friends.
- *
- * ioremap takes a PCI memory address, as specified in
- * Documentation/IO-mapping.txt.
- *
- */
-#ifndef __arch_ioremap
-#define ioremap(cookie,size)           __arm_ioremap(cookie, size, MT_DEVICE)
-#define ioremap_nocache(cookie,size)   __arm_ioremap(cookie, size, MT_DEVICE)
-#define ioremap_cached(cookie,size)    __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
-#define iounmap(cookie)                        __iounmap(cookie)
-#else
-#define ioremap(cookie,size)           __arch_ioremap((cookie), (size), MT_DEVICE)
-#define ioremap_nocache(cookie,size)   __arch_ioremap((cookie), (size), MT_DEVICE)
-#define ioremap_cached(cookie,size)    __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
-#define iounmap(cookie)                        __arch_iounmap(cookie)
-#endif
-
-/*
- * io{read,write}{8,16,32} macros
- */
-#ifndef ioread8
-#define ioread8(p)     ({ unsigned int __v = __raw_readb(p); __v; })
-#define ioread16(p)    ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; })
-#define ioread32(p)    ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; })
-
-#define iowrite8(v,p)  __raw_writeb(v, p)
-#define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p)
-#define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p)
-
-#define ioread8_rep(p,d,c)     __raw_readsb(p,d,c)
-#define ioread16_rep(p,d,c)    __raw_readsw(p,d,c)
-#define ioread32_rep(p,d,c)    __raw_readsl(p,d,c)
-
-#define iowrite8_rep(p,s,c)    __raw_writesb(p,s,c)
-#define iowrite16_rep(p,s,c)   __raw_writesw(p,s,c)
-#define iowrite32_rep(p,s,c)   __raw_writesl(p,s,c)
-
-extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
-extern void ioport_unmap(void __iomem *addr);
-#endif
-
-struct pci_dev;
-
-extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen);
-extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
-
-/*
- * can the hardware map this into one segment or not, given no other
- * constraints.
- */
-#define BIOVEC_MERGEABLE(vec1, vec2)   \
-       ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
-
-#ifdef CONFIG_MMU
-#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
-extern int valid_phys_addr_range(unsigned long addr, size_t size);
-extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
-#endif
-
-/*
- * 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
-
-/*
- * Register ISA memory and port locations for glibc iopl/inb/outb
- * emulation.
- */
-extern void register_isa_ports(unsigned int mmio, unsigned int io,
-                              unsigned int io_shift);
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_ARM_IO_H */
diff --git a/include/asm-arm/ioctl.h b/include/asm-arm/ioctl.h
deleted file mode 100644 (file)
index b279fe0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/ioctl.h>
diff --git a/include/asm-arm/ioctls.h b/include/asm-arm/ioctls.h
deleted file mode 100644 (file)
index a91d8a1..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef __ASM_ARM_IOCTLS_H
-#define __ASM_ARM_IOCTLS_H
-
-#include <asm/ioctl.h>
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS         0x5401
-#define TCSETS         0x5402
-#define TCSETSW                0x5403
-#define TCSETSF                0x5404
-#define TCGETA         0x5405
-#define TCSETA         0x5406
-#define TCSETAW                0x5407
-#define TCSETAF                0x5408
-#define TCSBRK         0x5409
-#define TCXONC         0x540A
-#define TCFLSH         0x540B
-#define TIOCEXCL       0x540C
-#define TIOCNXCL       0x540D
-#define TIOCSCTTY      0x540E
-#define TIOCGPGRP      0x540F
-#define TIOCSPGRP      0x5410
-#define TIOCOUTQ       0x5411
-#define TIOCSTI                0x5412
-#define TIOCGWINSZ     0x5413
-#define TIOCSWINSZ     0x5414
-#define TIOCMGET       0x5415
-#define TIOCMBIS       0x5416
-#define TIOCMBIC       0x5417
-#define TIOCMSET       0x5418
-#define TIOCGSOFTCAR   0x5419
-#define TIOCSSOFTCAR   0x541A
-#define FIONREAD       0x541B
-#define TIOCINQ                FIONREAD
-#define TIOCLINUX      0x541C
-#define TIOCCONS       0x541D
-#define TIOCGSERIAL    0x541E
-#define TIOCSSERIAL    0x541F
-#define TIOCPKT                0x5420
-#define FIONBIO                0x5421
-#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 TCGETS2                _IOR('T',0x2A, struct termios2)
-#define TCSETS2                _IOW('T',0x2B, struct termios2)
-#define TCSETSW2       _IOW('T',0x2C, struct termios2)
-#define TCSETSF2       _IOW('T',0x2D, struct termios2)
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-
-#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
-#define FIOCLEX                0x5451
-#define FIOASYNC       0x5452
-#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 */
-#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 FIOQSIZE       0x545E
-
-/* Used for packet mode */
-#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 TIOCSER_TEMT   0x01    /* Transmitter physically empty */
-
-#endif
diff --git a/include/asm-arm/ipcbuf.h b/include/asm-arm/ipcbuf.h
deleted file mode 100644 (file)
index 9768397..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __ASMARM_IPCBUF_H
-#define __ASMARM_IPCBUF_H
-
-/*
- * The ipc64_perm structure for arm architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 32-bit mode_t and seq
- * - 2 miscellaneous 32-bit values
- */
-
-struct ipc64_perm
-{
-       __kernel_key_t          key;
-       __kernel_uid32_t        uid;
-       __kernel_gid32_t        gid;
-       __kernel_uid32_t        cuid;
-       __kernel_gid32_t        cgid;
-       __kernel_mode_t         mode;
-       unsigned short          __pad1;
-       unsigned short          seq;
-       unsigned short          __pad2;
-       unsigned long           __unused1;
-       unsigned long           __unused2;
-};
-
-#endif /* __ASMARM_IPCBUF_H */
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
deleted file mode 100644 (file)
index 9cb0190..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __ASM_ARM_IRQ_H
-#define __ASM_ARM_IRQ_H
-
-#include <asm/arch/irqs.h>
-
-#ifndef irq_canonicalize
-#define irq_canonicalize(i)    (i)
-#endif
-
-#ifndef NR_IRQS
-#define NR_IRQS        128
-#endif
-
-/*
- * Use this value to indicate lack of interrupt
- * capability
- */
-#ifndef NO_IRQ
-#define NO_IRQ ((unsigned int)(-1))
-#endif
-
-#ifndef __ASSEMBLY__
-struct irqaction;
-extern void migrate_irqs(void);
-#endif
-
-#endif
-
diff --git a/include/asm-arm/irq_regs.h b/include/asm-arm/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-arm/irqflags.h b/include/asm-arm/irqflags.h
deleted file mode 100644 (file)
index 6d09974..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#ifndef __ASM_ARM_IRQFLAGS_H
-#define __ASM_ARM_IRQFLAGS_H
-
-#ifdef __KERNEL__
-
-#include <asm/ptrace.h>
-
-/*
- * CPU interrupt mask handling.
- */
-#if __LINUX_ARM_ARCH__ >= 6
-
-#define raw_local_irq_save(x)                                  \
-       ({                                                      \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ local_irq_save\n"     \
-       "cpsid  i"                                              \
-       : "=r" (x) : : "memory", "cc");                         \
-       })
-
-#define raw_local_irq_enable()  __asm__("cpsie i       @ __sti" : : : "memory", "cc")
-#define raw_local_irq_disable() __asm__("cpsid i       @ __cli" : : : "memory", "cc")
-#define local_fiq_enable()  __asm__("cpsie f   @ __stf" : : : "memory", "cc")
-#define local_fiq_disable() __asm__("cpsid f   @ __clf" : : : "memory", "cc")
-
-#else
-
-/*
- * Save the current interrupt enable state & disable IRQs
- */
-#define raw_local_irq_save(x)                                  \
-       ({                                                      \
-               unsigned long temp;                             \
-               (void) (&temp == &x);                           \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ local_irq_save\n"     \
-"      orr     %1, %0, #128\n"                                 \
-"      msr     cpsr_c, %1"                                     \
-       : "=r" (x), "=r" (temp)                                 \
-       :                                                       \
-       : "memory", "cc");                                      \
-       })
-       
-/*
- * Enable IRQs
- */
-#define raw_local_irq_enable()                                 \
-       ({                                                      \
-               unsigned long temp;                             \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ local_irq_enable\n"   \
-"      bic     %0, %0, #128\n"                                 \
-"      msr     cpsr_c, %0"                                     \
-       : "=r" (temp)                                           \
-       :                                                       \
-       : "memory", "cc");                                      \
-       })
-
-/*
- * Disable IRQs
- */
-#define raw_local_irq_disable()                                        \
-       ({                                                      \
-               unsigned long temp;                             \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ local_irq_disable\n"  \
-"      orr     %0, %0, #128\n"                                 \
-"      msr     cpsr_c, %0"                                     \
-       : "=r" (temp)                                           \
-       :                                                       \
-       : "memory", "cc");                                      \
-       })
-
-/*
- * Enable FIQs
- */
-#define local_fiq_enable()                                     \
-       ({                                                      \
-               unsigned long temp;                             \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ stf\n"                \
-"      bic     %0, %0, #64\n"                                  \
-"      msr     cpsr_c, %0"                                     \
-       : "=r" (temp)                                           \
-       :                                                       \
-       : "memory", "cc");                                      \
-       })
-
-/*
- * Disable FIQs
- */
-#define local_fiq_disable()                                    \
-       ({                                                      \
-               unsigned long temp;                             \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ clf\n"                \
-"      orr     %0, %0, #64\n"                                  \
-"      msr     cpsr_c, %0"                                     \
-       : "=r" (temp)                                           \
-       :                                                       \
-       : "memory", "cc");                                      \
-       })
-
-#endif
-
-/*
- * Save the current interrupt enable state.
- */
-#define raw_local_save_flags(x)                                        \
-       ({                                                      \
-       __asm__ __volatile__(                                   \
-       "mrs    %0, cpsr                @ local_save_flags"     \
-       : "=r" (x) : : "memory", "cc");                         \
-       })
-
-/*
- * restore saved IRQ & FIQ state
- */
-#define raw_local_irq_restore(x)                               \
-       __asm__ __volatile__(                                   \
-       "msr    cpsr_c, %0              @ local_irq_restore\n"  \
-       :                                                       \
-       : "r" (x)                                               \
-       : "memory", "cc")
-
-#define raw_irqs_disabled_flags(flags) \
-({                                     \
-       (int)((flags) & PSR_I_BIT);     \
-})
-
-#endif
-#endif
diff --git a/include/asm-arm/kdebug.h b/include/asm-arm/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-arm/kexec.h b/include/asm-arm/kexec.h
deleted file mode 100644 (file)
index c8986bb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _ARM_KEXEC_H
-#define _ARM_KEXEC_H
-
-#ifdef CONFIG_KEXEC
-
-/* Maximum physical address we can use pages from */
-#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
-/* Maximum address we can reach in physical address mode */
-#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
-/* Maximum address we can use for the control code buffer */
-#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
-
-#define KEXEC_CONTROL_CODE_SIZE        4096
-
-#define KEXEC_ARCH KEXEC_ARCH_ARM
-
-#define KEXEC_ARM_ATAGS_OFFSET  0x1000
-#define KEXEC_ARM_ZIMAGE_OFFSET 0x8000
-
-#ifndef __ASSEMBLY__
-
-struct kimage;
-/* Provide a dummy definition to avoid build failures. */
-static inline void crash_setup_regs(struct pt_regs *newregs,
-                                        struct pt_regs *oldregs) { }
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* CONFIG_KEXEC */
-
-#endif /* _ARM_KEXEC_H */
diff --git a/include/asm-arm/kgdb.h b/include/asm-arm/kgdb.h
deleted file mode 100644 (file)
index 67af4b8..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * ARM KGDB support
- *
- * Author: Deepak Saxena <dsaxena@mvista.com>
- *
- * Copyright (C) 2002 MontaVista Software Inc.
- *
- */
-
-#ifndef __ARM_KGDB_H__
-#define __ARM_KGDB_H__
-
-#include <linux/ptrace.h>
-
-/*
- * GDB assumes that we're a user process being debugged, so
- * it will send us an SWI command to write into memory as the
- * debug trap. When an SWI occurs, the next instruction addr is
- * placed into R14_svc before jumping to the vector trap.
- * This doesn't work for kernel debugging as we are already in SVC
- * we would loose the kernel's LR, which is a bad thing. This
- * is  bad thing.
- *
- * By doing this as an undefined instruction trap, we force a mode
- * switch from SVC to UND mode, allowing us to save full kernel state.
- *
- * We also define a KGDB_COMPILED_BREAK which can be used to compile
- * in breakpoints. This is important for things like sysrq-G and for
- * the initial breakpoint from trap_init().
- *
- * Note to ARM HW designers: Add real trap support like SH && PPC to
- * make our lives much much simpler. :)
- */
-#define BREAK_INSTR_SIZE       4
-#define GDB_BREAKINST          0xef9f0001
-#define KGDB_BREAKINST         0xe7ffdefe
-#define KGDB_COMPILED_BREAK    0xe7ffdeff
-#define CACHE_FLUSH_IS_SAFE    1
-
-#ifndef        __ASSEMBLY__
-
-static inline void arch_kgdb_breakpoint(void)
-{
-       asm(".word 0xe7ffdeff");
-}
-
-extern void kgdb_handle_bus_error(void);
-extern int kgdb_fault_expected;
-
-#endif /* !__ASSEMBLY__ */
-
-/*
- * From Kevin Hilman:
- *
- * gdb is expecting the following registers layout.
- *
- * r0-r15: 1 long word each
- * f0-f7:  unused, 3 long words each !!
- * fps:    unused, 1 long word
- * cpsr:   1 long word
- *
- * Even though f0-f7 and fps are not used, they need to be
- * present in the registers sent for correct processing in
- * the host-side gdb.
- *
- * In particular, it is crucial that CPSR is in the right place,
- * otherwise gdb will not be able to correctly interpret stepping over
- * conditional branches.
- */
-#define _GP_REGS               16
-#define _FP_REGS               8
-#define _EXTRA_REGS            2
-#define GDB_MAX_REGS           (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
-
-#define KGDB_MAX_NO_CPUS       1
-#define BUFMAX                 400
-#define NUMREGBYTES            (GDB_MAX_REGS << 2)
-#define NUMCRITREGBYTES                (32 << 2)
-
-#define _R0                    0
-#define _R1                    1
-#define _R2                    2
-#define _R3                    3
-#define _R4                    4
-#define _R5                    5
-#define _R6                    6
-#define _R7                    7
-#define _R8                    8
-#define _R9                    9
-#define _R10                   10
-#define _FP                    11
-#define _IP                    12
-#define _SPT                   13
-#define _LR                    14
-#define _PC                    15
-#define _CPSR                  (GDB_MAX_REGS - 1)
-
-/*
- * So that we can denote the end of a frame for tracing,
- * in the simple case:
- */
-#define CFI_END_FRAME(func)    __CFI_END_FRAME(_PC, _SPT, func)
-
-#endif /* __ASM_KGDB_H__ */
diff --git a/include/asm-arm/kmap_types.h b/include/asm-arm/kmap_types.h
deleted file mode 100644 (file)
index 45def13..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __ARM_KMAP_TYPES_H
-#define __ARM_KMAP_TYPES_H
-
-/*
- * This is the "bare minimum".  AIO seems to require this.
- */
-enum km_type {
-       KM_BOUNCE_READ,
-       KM_SKB_SUNRPC_DATA,
-       KM_SKB_DATA_SOFTIRQ,
-       KM_USER0,
-       KM_USER1,
-       KM_BIO_SRC_IRQ,
-       KM_BIO_DST_IRQ,
-       KM_PTE0,
-       KM_PTE1,
-       KM_IRQ0,
-       KM_IRQ1,
-       KM_SOFTIRQ0,
-       KM_SOFTIRQ1,
-       KM_TYPE_NR
-};
-
-#endif
diff --git a/include/asm-arm/kprobes.h b/include/asm-arm/kprobes.h
deleted file mode 100644 (file)
index b1a3787..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * include/asm-arm/kprobes.h
- *
- * Copyright (C) 2006, 2007 Motorola Inc.
- *
- * 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.
- *
- * 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.
- */
-
-#ifndef _ARM_KPROBES_H
-#define _ARM_KPROBES_H
-
-#include <linux/types.h>
-#include <linux/ptrace.h>
-#include <linux/percpu.h>
-
-#define __ARCH_WANT_KPROBES_INSN_SLOT
-#define MAX_INSN_SIZE                  2
-#define MAX_STACK_SIZE                 64      /* 32 would probably be OK */
-
-/*
- * This undefined instruction must be unique and
- * reserved solely for kprobes' use.
- */
-#define KPROBE_BREAKPOINT_INSTRUCTION  0xe7f001f8
-
-#define regs_return_value(regs)                ((regs)->ARM_r0)
-#define flush_insn_slot(p)             do { } while (0)
-#define kretprobe_blacklist_size       0
-
-typedef u32 kprobe_opcode_t;
-
-struct kprobe;
-typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *);
-
-/* Architecture specific copy of original instruction. */
-struct arch_specific_insn {
-       kprobe_opcode_t         *insn;
-       kprobe_insn_handler_t   *insn_handler;
-};
-
-struct prev_kprobe {
-       struct kprobe *kp;
-       unsigned int status;
-};
-
-/* per-cpu kprobe control block */
-struct kprobe_ctlblk {
-       unsigned int kprobe_status;
-       struct prev_kprobe prev_kprobe;
-       struct pt_regs jprobe_saved_regs;
-       char jprobes_stack[MAX_STACK_SIZE];
-};
-
-void arch_remove_kprobe(struct kprobe *);
-void kretprobe_trampoline(void);
-
-int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr);
-int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-                            unsigned long val, void *data);
-
-enum kprobe_insn {
-       INSN_REJECTED,
-       INSN_GOOD,
-       INSN_GOOD_NO_SLOT
-};
-
-enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
-                                       struct arch_specific_insn *);
-void __init arm_kprobe_decode_init(void);
-
-#endif /* _ARM_KPROBES_H */
diff --git a/include/asm-arm/leds.h b/include/asm-arm/leds.h
deleted file mode 100644 (file)
index 12290ea..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  linux/include/asm-arm/leds.h
- *
- *  Copyright (C) 1998 Russell King
- *
- * 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.
- *
- *  Event-driven interface for LEDs on machines
- *  Added led_start and led_stop- Alex Holden, 28th Dec 1998.
- */
-#ifndef ASM_ARM_LEDS_H
-#define ASM_ARM_LEDS_H
-
-
-typedef enum {
-       led_idle_start,
-       led_idle_end,
-       led_timer,
-       led_start,
-       led_stop,
-       led_claim,              /* override idle & timer leds */
-       led_release,            /* restore idle & timer leds */
-       led_start_timer_mode,
-       led_stop_timer_mode,
-       led_green_on,
-       led_green_off,
-       led_amber_on,
-       led_amber_off,
-       led_red_on,
-       led_red_off,
-       led_blue_on,
-       led_blue_off,
-       /*
-        * I want this between led_timer and led_start, but
-        * someone has decided to export this to user space
-        */
-       led_halted
-} led_event_t;
-
-/* Use this routine to handle LEDs */
-
-#ifdef CONFIG_LEDS
-extern void (*leds_event)(led_event_t);
-#else
-#define leds_event(e)
-#endif
-
-#endif
diff --git a/include/asm-arm/limits.h b/include/asm-arm/limits.h
deleted file mode 100644 (file)
index 08d8c66..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_PIPE_H
-#define __ASM_PIPE_H
-
-#ifndef PAGE_SIZE
-#include <asm/page.h>
-#endif
-
-#define PIPE_BUF       PAGE_SIZE
-
-#endif
-
diff --git a/include/asm-arm/linkage.h b/include/asm-arm/linkage.h
deleted file mode 100644 (file)
index 5a25632..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
-
-#define __ALIGN .align 0
-#define __ALIGN_STR ".align 0"
-
-#define ENDPROC(name) \
-  .type name, %function; \
-  END(name)
-
-#endif
diff --git a/include/asm-arm/local.h b/include/asm-arm/local.h
deleted file mode 100644 (file)
index c11c530..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/local.h>
diff --git a/include/asm-arm/locks.h b/include/asm-arm/locks.h
deleted file mode 100644 (file)
index 852220e..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- *  linux/include/asm-arm/locks.h
- *
- *  Copyright (C) 2000 Russell King
- *
- * 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.
- *
- *  Interrupt safe locking assembler. 
- */
-#ifndef __ASM_PROC_LOCKS_H
-#define __ASM_PROC_LOCKS_H
-
-#if __LINUX_ARM_ARCH__ >= 6
-
-#define __down_op(ptr,fail)                    \
-       ({                                      \
-       __asm__ __volatile__(                   \
-       "@ down_op\n"                           \
-"1:    ldrex   lr, [%0]\n"                     \
-"      sub     lr, lr, %1\n"                   \
-"      strex   ip, lr, [%0]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      teq     lr, #0\n"                       \
-"      movmi   ip, %0\n"                       \
-"      blmi    " #fail                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       })
-
-#define __down_op_ret(ptr,fail)                        \
-       ({                                      \
-               unsigned int ret;               \
-       __asm__ __volatile__(                   \
-       "@ down_op_ret\n"                       \
-"1:    ldrex   lr, [%1]\n"                     \
-"      sub     lr, lr, %2\n"                   \
-"      strex   ip, lr, [%1]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      teq     lr, #0\n"                       \
-"      movmi   ip, %1\n"                       \
-"      movpl   ip, #0\n"                       \
-"      blmi    " #fail "\n"                    \
-"      mov     %0, ip"                         \
-       : "=&r" (ret)                           \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       ret;                                    \
-       })
-
-#define __up_op(ptr,wake)                      \
-       ({                                      \
-       smp_mb();                               \
-       __asm__ __volatile__(                   \
-       "@ up_op\n"                             \
-"1:    ldrex   lr, [%0]\n"                     \
-"      add     lr, lr, %1\n"                   \
-"      strex   ip, lr, [%0]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      cmp     lr, #0\n"                       \
-"      movle   ip, %0\n"                       \
-"      blle    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       })
-
-/*
- * The value 0x01000000 supports up to 128 processors and
- * lots of processes.  BIAS must be chosen such that sub'ing
- * BIAS once per CPU will result in the long remaining
- * negative.
- */
-#define RW_LOCK_BIAS      0x01000000
-#define RW_LOCK_BIAS_STR "0x01000000"
-
-#define __down_op_write(ptr,fail)              \
-       ({                                      \
-       __asm__ __volatile__(                   \
-       "@ down_op_write\n"                     \
-"1:    ldrex   lr, [%0]\n"                     \
-"      sub     lr, lr, %1\n"                   \
-"      strex   ip, lr, [%0]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      teq     lr, #0\n"                       \
-"      movne   ip, %0\n"                       \
-"      blne    " #fail                         \
-       :                                       \
-       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       })
-
-#define __up_op_write(ptr,wake)                        \
-       ({                                      \
-       smp_mb();                               \
-       __asm__ __volatile__(                   \
-       "@ up_op_write\n"                       \
-"1:    ldrex   lr, [%0]\n"                     \
-"      adds    lr, lr, %1\n"                   \
-"      strex   ip, lr, [%0]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      movcs   ip, %0\n"                       \
-"      blcs    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
-       : "ip", "lr", "cc");                    \
-       })
-
-#define __down_op_read(ptr,fail)               \
-       __down_op(ptr, fail)
-
-#define __up_op_read(ptr,wake)                 \
-       ({                                      \
-       smp_mb();                               \
-       __asm__ __volatile__(                   \
-       "@ up_op_read\n"                        \
-"1:    ldrex   lr, [%0]\n"                     \
-"      add     lr, lr, %1\n"                   \
-"      strex   ip, lr, [%0]\n"                 \
-"      teq     ip, #0\n"                       \
-"      bne     1b\n"                           \
-"      teq     lr, #0\n"                       \
-"      moveq   ip, %0\n"                       \
-"      bleq    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       })
-
-#else
-
-#define __down_op(ptr,fail)                    \
-       ({                                      \
-       __asm__ __volatile__(                   \
-       "@ down_op\n"                           \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%0]\n"                     \
-"      subs    lr, lr, %1\n"                   \
-"      str     lr, [%0]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      movmi   ip, %0\n"                       \
-"      blmi    " #fail                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       })
-
-#define __down_op_ret(ptr,fail)                        \
-       ({                                      \
-               unsigned int ret;               \
-       __asm__ __volatile__(                   \
-       "@ down_op_ret\n"                       \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%1]\n"                     \
-"      subs    lr, lr, %2\n"                   \
-"      str     lr, [%1]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      movmi   ip, %1\n"                       \
-"      movpl   ip, #0\n"                       \
-"      blmi    " #fail "\n"                    \
-"      mov     %0, ip"                         \
-       : "=&r" (ret)                           \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       ret;                                    \
-       })
-
-#define __up_op(ptr,wake)                      \
-       ({                                      \
-       smp_mb();                               \
-       __asm__ __volatile__(                   \
-       "@ up_op\n"                             \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%0]\n"                     \
-"      adds    lr, lr, %1\n"                   \
-"      str     lr, [%0]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      movle   ip, %0\n"                       \
-"      blle    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       })
-
-/*
- * The value 0x01000000 supports up to 128 processors and
- * lots of processes.  BIAS must be chosen such that sub'ing
- * BIAS once per CPU will result in the long remaining
- * negative.
- */
-#define RW_LOCK_BIAS      0x01000000
-#define RW_LOCK_BIAS_STR "0x01000000"
-
-#define __down_op_write(ptr,fail)              \
-       ({                                      \
-       __asm__ __volatile__(                   \
-       "@ down_op_write\n"                     \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%0]\n"                     \
-"      subs    lr, lr, %1\n"                   \
-"      str     lr, [%0]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      movne   ip, %0\n"                       \
-"      blne    " #fail                         \
-       :                                       \
-       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       })
-
-#define __up_op_write(ptr,wake)                        \
-       ({                                      \
-       __asm__ __volatile__(                   \
-       "@ up_op_write\n"                       \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%0]\n"                     \
-"      adds    lr, lr, %1\n"                   \
-"      str     lr, [%0]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      movcs   ip, %0\n"                       \
-"      blcs    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (RW_LOCK_BIAS)         \
-       : "ip", "lr", "cc");                    \
-       smp_mb();                               \
-       })
-
-#define __down_op_read(ptr,fail)               \
-       __down_op(ptr, fail)
-
-#define __up_op_read(ptr,wake)                 \
-       ({                                      \
-       smp_mb();                               \
-       __asm__ __volatile__(                   \
-       "@ up_op_read\n"                        \
-"      mrs     ip, cpsr\n"                     \
-"      orr     lr, ip, #128\n"                 \
-"      msr     cpsr_c, lr\n"                   \
-"      ldr     lr, [%0]\n"                     \
-"      adds    lr, lr, %1\n"                   \
-"      str     lr, [%0]\n"                     \
-"      msr     cpsr_c, ip\n"                   \
-"      moveq   ip, %0\n"                       \
-"      bleq    " #wake                         \
-       :                                       \
-       : "r" (ptr), "I" (1)                    \
-       : "ip", "lr", "cc");                    \
-       })
-
-#endif
-
-#endif
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
deleted file mode 100644 (file)
index bcc8aed..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/arch.h
- *
- *  Copyright (C) 2000 Russell King
- *
- * 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.
- */
-
-#ifndef __ASSEMBLY__
-
-struct tag;
-struct meminfo;
-struct sys_timer;
-
-struct machine_desc {
-       /*
-        * Note! The first four elements are used
-        * by assembler code in head.S, head-common.S
-        */
-       unsigned int            nr;             /* architecture number  */
-       unsigned int            phys_io;        /* start of physical io */
-       unsigned int            io_pg_offst;    /* byte offset for io 
-                                                * page tabe entry      */
-
-       const char              *name;          /* architecture name    */
-       unsigned long           boot_params;    /* tagged list          */
-
-       unsigned int            video_start;    /* start of video RAM   */
-       unsigned int            video_end;      /* end of video RAM     */
-
-       unsigned int            reserve_lp0 :1; /* never has lp0        */
-       unsigned int            reserve_lp1 :1; /* never has lp1        */
-       unsigned int            reserve_lp2 :1; /* never has lp2        */
-       unsigned int            soft_reboot :1; /* soft reboot          */
-       void                    (*fixup)(struct machine_desc *,
-                                        struct tag *, char **,
-                                        struct meminfo *);
-       void                    (*map_io)(void);/* IO mapping function  */
-       void                    (*init_irq)(void);
-       struct sys_timer        *timer;         /* system tick timer    */
-       void                    (*init_machine)(void);
-};
-
-/*
- * Set of macros to define architecture features.  This is built into
- * a table by the linker.
- */
-#define MACHINE_START(_type,_name)                     \
-static const struct machine_desc __mach_desc_##_type   \
- __used                                                        \
- __attribute__((__section__(".arch.info.init"))) = {   \
-       .nr             = MACH_TYPE_##_type,            \
-       .name           = _name,
-
-#define MACHINE_END                            \
-};
-
-#endif
diff --git a/include/asm-arm/mach/dma.h b/include/asm-arm/mach/dma.h
deleted file mode 100644 (file)
index e7c4a20..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/dma.h
- *
- *  Copyright (C) 1998-2000 Russell King
- *
- * 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.
- *
- *  This header file describes the interface between the generic DMA handler
- *  (dma.c) and the architecture-specific DMA backends (dma-*.c)
- */
-
-struct dma_struct;
-typedef struct dma_struct dma_t;
-
-struct dma_ops {
-       int     (*request)(dmach_t, dma_t *);           /* optional */
-       void    (*free)(dmach_t, dma_t *);              /* optional */
-       void    (*enable)(dmach_t, dma_t *);            /* mandatory */
-       void    (*disable)(dmach_t, dma_t *);           /* mandatory */
-       int     (*residue)(dmach_t, dma_t *);           /* optional */
-       int     (*setspeed)(dmach_t, dma_t *, int);     /* optional */
-       char    *type;
-};
-
-struct dma_struct {
-       void            *addr;          /* single DMA address           */
-       unsigned long   count;          /* single DMA size              */
-       struct scatterlist buf;         /* single DMA                   */
-       int             sgcount;        /* number of DMA SG             */
-       struct scatterlist *sg;         /* DMA Scatter-Gather List      */
-
-       unsigned int    active:1;       /* Transfer active              */
-       unsigned int    invalid:1;      /* Address/Count changed        */
-
-       dmamode_t       dma_mode;       /* DMA mode                     */
-       int             speed;          /* DMA speed                    */
-
-       unsigned int    lock;           /* Device is allocated          */
-       const char      *device_id;     /* Device name                  */
-
-       unsigned int    dma_base;       /* Controller base address      */
-       int             dma_irq;        /* Controller IRQ               */
-       struct scatterlist cur_sg;      /* Current controller buffer    */
-       unsigned int    state;
-
-       struct dma_ops  *d_ops;
-};
-
-/* Prototype: void arch_dma_init(dma)
- * Purpose  : Initialise architecture specific DMA
- * Params   : dma - pointer to array of DMA structures
- */
-extern void arch_dma_init(dma_t *dma);
-
-extern void isa_init_dma(dma_t *dma);
diff --git a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h
deleted file mode 100644 (file)
index 05b029e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/flash.h
- *
- *  Copyright (C) 2003 Russell King, All Rights Reserved.
- *
- * 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.
- */
-#ifndef ASMARM_MACH_FLASH_H
-#define ASMARM_MACH_FLASH_H
-
-struct mtd_partition;
-struct mtd_info;
-
-/*
- * map_name:   the map probe function name
- * name:       flash device name (eg, as used with mtdparts=)
- * width:      width of mapped device
- * init:       method called at driver/device initialisation
- * exit:       method called at driver/device removal
- * set_vpp:    method called to enable or disable VPP
- * mmcontrol:  method called to enable or disable Sync. Burst Read in OneNAND
- * parts:      optional array of mtd_partitions for static partitioning
- * nr_parts:   number of mtd_partitions for static partitoning
- */
-struct flash_platform_data {
-       const char      *map_name;
-       const char      *name;
-       unsigned int    width;
-       int             (*init)(void);
-       void            (*exit)(void);
-       void            (*set_vpp)(int on);
-       void            (*mmcontrol)(struct mtd_info *mtd, int sync_read);
-       struct mtd_partition *parts;
-       unsigned int    nr_parts;
-};
-
-#endif
diff --git a/include/asm-arm/mach/irda.h b/include/asm-arm/mach/irda.h
deleted file mode 100644 (file)
index 58984d9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/irda.h
- *
- *  Copyright (C) 2004 Russell King.
- *
- * 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.
- */
-#ifndef __ASM_ARM_MACH_IRDA_H
-#define __ASM_ARM_MACH_IRDA_H
-
-struct irda_platform_data {
-       int (*startup)(struct device *);
-       void (*shutdown)(struct device *);
-       int (*set_power)(struct device *, unsigned int state);
-       void (*set_speed)(struct device *, unsigned int speed);
-};
-
-#endif
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h
deleted file mode 100644 (file)
index eb0bfba..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/irq.h
- *
- *  Copyright (C) 1995-2000 Russell King.
- *
- * 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.
- */
-#ifndef __ASM_ARM_MACH_IRQ_H
-#define __ASM_ARM_MACH_IRQ_H
-
-#include <linux/irq.h>
-
-struct seq_file;
-
-/*
- * This is internal.  Do not use it.
- */
-extern void (*init_arch_irq)(void);
-extern void init_FIQ(void);
-extern int show_fiq_list(struct seq_file *, void *);
-
-/*
- * Obsolete inline function for calling irq descriptor handlers.
- */
-static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc)
-{
-       desc->handle_irq(irq, desc);
-}
-
-void set_irq_flags(unsigned int irq, unsigned int flags);
-
-#define IRQF_VALID     (1 << 0)
-#define IRQF_PROBE     (1 << 1)
-#define IRQF_NOAUTOEN  (1 << 2)
-
-/*
- * This is for easy migration, but should be changed in the source
- */
-#define do_bad_IRQ(irq,desc)                           \
-do {                                                   \
-       spin_lock(&desc->lock);                         \
-       handle_bad_irq(irq, desc);                      \
-       spin_unlock(&desc->lock);                       \
-} while(0)
-
-extern unsigned long irq_err_count;
-static inline void ack_bad_irq(int irq)
-{
-       irq_err_count++;
-}
-
-#endif
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
deleted file mode 100644 (file)
index 7ef3c83..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  linux/include/asm-arm/map.h
- *
- *  Copyright (C) 1999-2000 Russell King
- *
- * 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.
- *
- *  Page table mapping constructs and function prototypes
- */
-#include <asm/io.h>
-
-struct map_desc {
-       unsigned long virtual;
-       unsigned long pfn;
-       unsigned long length;
-       unsigned int type;
-};
-
-/* types 0-3 are defined in asm/io.h */
-#define MT_CACHECLEAN          4
-#define MT_MINICLEAN           5
-#define MT_LOW_VECTORS         6
-#define MT_HIGH_VECTORS                7
-#define MT_MEMORY              8
-#define MT_ROM                 9
-
-#define MT_NONSHARED_DEVICE    MT_DEVICE_NONSHARED
-#define MT_IXP2000_DEVICE      MT_DEVICE_IXP2000
-
-#ifdef CONFIG_MMU
-extern void iotable_init(struct map_desc *, int);
-#else
-#define iotable_init(map,num)  do { } while (0)
-#endif
diff --git a/include/asm-arm/mach/mmc.h b/include/asm-arm/mach/mmc.h
deleted file mode 100644 (file)
index eb91145..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/mmc.h
- */
-#ifndef ASMARM_MACH_MMC_H
-#define ASMARM_MACH_MMC_H
-
-#include <linux/mmc/host.h>
-
-struct mmc_platform_data {
-       unsigned int ocr_mask;                  /* available voltages */
-       u32 (*translate_vdd)(struct device *, unsigned int);
-       unsigned int (*status)(struct device *);
-};
-
-#endif
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
deleted file mode 100644 (file)
index 9d4f6b5..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/pci.h
- *
- *  Copyright (C) 2000 Russell King
- *
- * 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.
- */
-
-struct pci_sys_data;
-struct pci_bus;
-
-struct hw_pci {
-       struct list_head buses;
-       int             nr_controllers;
-       int             (*setup)(int nr, struct pci_sys_data *);
-       struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
-       void            (*preinit)(void);
-       void            (*postinit)(void);
-       u8              (*swizzle)(struct pci_dev *dev, u8 *pin);
-       int             (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
-};
-
-/*
- * Per-controller structure
- */
-struct pci_sys_data {
-       struct list_head node;
-       int             busnr;          /* primary bus number                   */
-       u64             mem_offset;     /* bus->cpu memory mapping offset       */
-       unsigned long   io_offset;      /* bus->cpu IO mapping offset           */
-       struct pci_bus  *bus;           /* PCI bus                              */
-       struct resource *resource[3];   /* Primary PCI bus resources            */
-                                       /* Bridge swizzling                     */
-       u8              (*swizzle)(struct pci_dev *, u8 *);
-                                       /* IRQ mapping                          */
-       int             (*map_irq)(struct pci_dev *, u8, u8);
-       struct hw_pci   *hw;
-};
-
-/*
- * This is the standard PCI-PCI bridge swizzling algorithm.
- */
-u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp);
-
-/*
- * Call this with your hw_pci struct to initialise the PCI system.
- */
-void pci_common_init(struct hw_pci *);
-
-/*
- * PCI controllers
- */
-extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
-extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
-extern void iop3xx_pci_preinit(void);
-extern void iop3xx_pci_preinit_cond(void);
-
-extern int dc21285_setup(int nr, struct pci_sys_data *);
-extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
-extern void dc21285_preinit(void);
-extern void dc21285_postinit(void);
-
-extern int via82c505_setup(int nr, struct pci_sys_data *);
-extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
-extern void via82c505_init(void *sysdata);
-
-extern int pci_v3_setup(int nr, struct pci_sys_data *);
-extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
-extern void pci_v3_preinit(void);
-extern void pci_v3_postinit(void);
diff --git a/include/asm-arm/mach/serial_at91.h b/include/asm-arm/mach/serial_at91.h
deleted file mode 100644 (file)
index 55b317a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/serial_at91.h
- *
- *  Based on serial_sa1100.h  by Nicolas Pitre
- *
- *  Copyright (C) 2002 ATMEL Rousset
- *
- *  Low level machine dependent UART functions.
- */
-
-struct uart_port;
-
-/*
- * This is a temporary structure for registering these
- * functions; it is intended to be discarded after boot.
- */
-struct atmel_port_fns {
-       void    (*set_mctrl)(struct uart_port *, u_int);
-       u_int   (*get_mctrl)(struct uart_port *);
-       void    (*enable_ms)(struct uart_port *);
-       void    (*pm)(struct uart_port *, u_int, u_int);
-       int     (*set_wake)(struct uart_port *, u_int);
-       int     (*open)(struct uart_port *);
-       void    (*close)(struct uart_port *);
-};
-
-#if defined(CONFIG_SERIAL_ATMEL)
-void atmel_register_uart_fns(struct atmel_port_fns *fns);
-#else
-#define atmel_register_uart_fns(fns) do { } while (0)
-#endif
-
-
diff --git a/include/asm-arm/mach/serial_sa1100.h b/include/asm-arm/mach/serial_sa1100.h
deleted file mode 100644 (file)
index 20c22bb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  linux/include/asm-arm/mach/serial_sa1100.h
- *
- *  Author: Nicolas Pitre
- *
- * Moved to include/asm-arm/mach and changed lots, Russell King
- *
- * Low level machine dependent UART functions.
- */
-
-struct uart_port;
-struct uart_info;
-
-/*
- * This is a temporary structure for registering these
- * functions; it is intended to be discarded after boot.
- */
-struct sa1100_port_fns {
-       void    (*set_mctrl)(struct uart_port *, u_int);
-       u_int   (*get_mctrl)(struct uart_port *);
-       void    (*pm)(struct uart_port *, u_int, u_int);
-       int     (*set_wake)(struct uart_port *, u_int);
-};
-
-#ifdef CONFIG_SERIAL_SA1100
-void sa1100_register_uart_fns(struct sa1100_port_fns *fns);
-void sa1100_register_uart(int idx, int port);
-#else
-#define sa1100_register_uart_fns(fns) do { } while (0)
-#define sa1100_register_uart(idx,port) do { } while (0)
-#endif
diff --git a/include/asm-arm/mach/sharpsl_param.h b/include/asm-arm/mach/sharpsl_param.h
deleted file mode 100644 (file)
index 7a24ecf..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Hardware parameter area specific to Sharp SL series devices
- *
- * Copyright (c) 2005 Richard Purdie
- *
- * Based on Sharp's 2.4 kernel patches
- *
- * 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.
- *
- */
-
-struct sharpsl_param_info {
-  unsigned int comadj_keyword;
-  unsigned int comadj;
-
-  unsigned int uuid_keyword;
-  unsigned char uuid[16];
-
-  unsigned int touch_keyword;
-  unsigned int touch_xp;
-  unsigned int touch_yp;
-  unsigned int touch_xd;
-  unsigned int touch_yd;
-
-  unsigned int adadj_keyword;
-  unsigned int adadj;
-
-  unsigned int phad_keyword;
-  unsigned int phadadj;
-} __attribute__((packed));
-
-
-extern struct sharpsl_param_info sharpsl_param;
-extern void sharpsl_save_param(void);
-
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
deleted file mode 100644 (file)
index 2fd36ea..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * linux/include/asm-arm/mach/time.h
- *
- * Copyright (C) 2004 MontaVista Software, Inc.
- *
- * 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.
- */
-#ifndef __ASM_ARM_MACH_TIME_H
-#define __ASM_ARM_MACH_TIME_H
-
-#include <linux/sysdev.h>
-
-/*
- * This is our kernel timer structure.
- *
- * - init
- *   Initialise the kernels jiffy timer source, claim interrupt
- *   using setup_irq.  This is called early on during initialisation
- *   while interrupts are still disabled on the local CPU.
- * - suspend
- *   Suspend the kernel jiffy timer source, if necessary.  This
- *   is called with interrupts disabled, after all normal devices
- *   have been suspended.  If no action is required, set this to
- *   NULL.
- * - resume
- *   Resume the kernel jiffy timer source, if necessary.  This
- *   is called with interrupts disabled before any normal devices
- *   are resumed.  If no action is required, set this to NULL.
- * - offset
- *   Return the timer offset in microseconds since the last timer
- *   interrupt.  Note: this must take account of any unprocessed
- *   timer interrupt which may be pending.
- */
-struct sys_timer {
-       struct sys_device       dev;
-       void                    (*init)(void);
-       void                    (*suspend)(void);
-       void                    (*resume)(void);
-#ifndef CONFIG_GENERIC_TIME
-       unsigned long           (*offset)(void);
-#endif
-};
-
-extern struct sys_timer *system_timer;
-extern void timer_tick(void);
-
-/*
- * Kernel time keeping support.
- */
-struct timespec;
-extern int (*set_rtc)(void);
-extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
-extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);
-
-#endif
diff --git a/include/asm-arm/mach/udc_pxa2xx.h b/include/asm-arm/mach/udc_pxa2xx.h
deleted file mode 100644 (file)
index 9e5ed7c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * linux/include/asm-arm/mach/udc_pxa2xx.h
- *
- * This supports machine-specific differences in how the PXA2xx
- * USB Device Controller (UDC) is wired.
- *
- * It is set in linux/arch/arm/mach-pxa/<machine>.c or in
- * linux/arch/mach-ixp4xx/<machine>.c and used in
- * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
- */
-
-struct pxa2xx_udc_mach_info {
-        int  (*udc_is_connected)(void);                /* do we see host? */
-        void (*udc_command)(int cmd);
-#define        PXA2XX_UDC_CMD_CONNECT          0       /* let host see us */
-#define        PXA2XX_UDC_CMD_DISCONNECT       1       /* so host won't see us */
-
-       /* Boards following the design guidelines in the developer's manual,
-        * with on-chip GPIOs not Lubbock's weird hardware, can have a sane
-        * VBUS IRQ and omit the methods above.  Store the GPIO number
-        * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
-        * Note that sometimes the signals go through inverters...
-        */
-       bool    gpio_vbus_inverted;
-       u16     gpio_vbus;                      /* high == vbus present */
-       bool    gpio_pullup_inverted;
-       u16     gpio_pullup;                    /* high == pullup activated */
-};
-
diff --git a/include/asm-arm/mc146818rtc.h b/include/asm-arm/mc146818rtc.h
deleted file mode 100644 (file)
index 7b81e0c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Machine dependent access functions for RTC registers.
- */
-#ifndef _ASM_MC146818RTC_H
-#define _ASM_MC146818RTC_H
-
-#include <asm/arch/irqs.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_MC146818RTC_H */
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
deleted file mode 100644 (file)
index 9ba4d71..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- *  linux/include/asm-arm/memory.h
- *
- *  Copyright (C) 2000-2002 Russell King
- *  modification for nommu, Hyok S. Choi, 2004
- *
- * 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.
- *
- *  Note: this file should not be included by non-asm/.h files
- */
-#ifndef __ASM_ARM_MEMORY_H
-#define __ASM_ARM_MEMORY_H
-
-/*
- * Allow for constants defined here to be used from assembly code
- * by prepending the UL suffix only with actual C code compilation.
- */
-#ifndef __ASSEMBLY__
-#define UL(x) (x##UL)
-#else
-#define UL(x) (x)
-#endif
-
-#include <linux/compiler.h>
-#include <asm/arch/memory.h>
-#include <asm/sizes.h>
-
-#ifdef CONFIG_MMU
-
-#ifndef TASK_SIZE
-/*
- * TASK_SIZE - the maximum size of a user space task.
- * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
- */
-#define TASK_SIZE              UL(0xbf000000)
-#define TASK_UNMAPPED_BASE     UL(0x40000000)
-#endif
-
-/*
- * The maximum size of a 26-bit user space task.
- */
-#define TASK_SIZE_26           UL(0x04000000)
-
-/*
- * Page offset: 3GB
- */
-#ifndef PAGE_OFFSET
-#define PAGE_OFFSET            UL(0xc0000000)
-#endif
-
-/*
- * The module space lives between the addresses given by TASK_SIZE
- * and PAGE_OFFSET - it must be within 32MB of the kernel text.
- */
-#define MODULE_END             (PAGE_OFFSET)
-#define MODULE_START           (MODULE_END - 16*1048576)
-
-#if TASK_SIZE > MODULE_START
-#error Top of user space clashes with start of module space
-#endif
-
-/*
- * The XIP kernel gets mapped at the bottom of the module vm area.
- * Since we use sections to map it, this macro replaces the physical address
- * with its virtual address while keeping offset from the base section.
- */
-#define XIP_VIRT_ADDR(physaddr)  (MODULE_START + ((physaddr) & 0x000fffff))
-
-/*
- * Allow 16MB-aligned ioremap pages
- */
-#define IOREMAP_MAX_ORDER      24
-
-#else /* CONFIG_MMU */
-
-/*
- * The limitation of user task size can grow up to the end of free ram region.
- * It is difficult to define and perhaps will never meet the original meaning
- * of this define that was meant to.
- * Fortunately, there is no reference for this in noMMU mode, for now.
- */
-#ifndef TASK_SIZE
-#define TASK_SIZE              (CONFIG_DRAM_SIZE)
-#endif
-
-#ifndef TASK_UNMAPPED_BASE
-#define TASK_UNMAPPED_BASE     UL(0x00000000)
-#endif
-
-#ifndef PHYS_OFFSET
-#define PHYS_OFFSET            (CONFIG_DRAM_BASE)
-#endif
-
-#ifndef END_MEM
-#define END_MEM                (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
-#endif
-
-#ifndef PAGE_OFFSET
-#define PAGE_OFFSET            (PHYS_OFFSET)
-#endif
-
-/*
- * The module can be at any place in ram in nommu mode.
- */
-#define MODULE_END             (END_MEM)
-#define MODULE_START           (PHYS_OFFSET)
-
-#endif /* !CONFIG_MMU */
-
-/*
- * Size of DMA-consistent memory region.  Must be multiple of 2M,
- * between 2MB and 14MB inclusive.
- */
-#ifndef CONSISTENT_DMA_SIZE
-#define CONSISTENT_DMA_SIZE SZ_2M
-#endif
-
-/*
- * Physical vs virtual RAM address space conversion.  These are
- * private definitions which should NOT be used outside memory.h
- * files.  Use virt_to_phys/phys_to_virt/__pa/__va instead.
- */
-#ifndef __virt_to_phys
-#define __virt_to_phys(x)      ((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(x)      ((x) - PHYS_OFFSET + PAGE_OFFSET)
-#endif
-
-/*
- * Convert a physical address to a Page Frame Number and back
- */
-#define        __phys_to_pfn(paddr)    ((paddr) >> PAGE_SHIFT)
-#define        __pfn_to_phys(pfn)      ((pfn) << PAGE_SHIFT)
-
-#ifndef __ASSEMBLY__
-
-/*
- * The DMA mask corresponding to the maximum bus address allocatable
- * using GFP_DMA.  The default here places no restriction on DMA
- * allocations.  This must be the smallest DMA mask in the system,
- * so a successful GFP_DMA allocation will always satisfy this.
- */
-#ifndef ISA_DMA_THRESHOLD
-#define ISA_DMA_THRESHOLD      (0xffffffffULL)
-#endif
-
-#ifndef arch_adjust_zones
-#define arch_adjust_zones(node,size,holes) do { } while (0)
-#endif
-
-/*
- * PFNs are used to describe any physical page; this means
- * PFN 0 == physical address 0.
- *
- * This is the PFN of the first RAM page in the kernel
- * direct-mapped view.  We assume this is the first page
- * of RAM in the mem_map as well.
- */
-#define PHYS_PFN_OFFSET        (PHYS_OFFSET >> PAGE_SHIFT)
-
-/*
- * These are *only* valid on the kernel direct mapped RAM memory.
- * Note: Drivers should NOT use these.  They are the wrong
- * translation for translating DMA addresses.  Use the driver
- * DMA support - see dma-mapping.h.
- */
-static inline unsigned long virt_to_phys(void *x)
-{
-       return __virt_to_phys((unsigned long)(x));
-}
-
-static inline void *phys_to_virt(unsigned long x)
-{
-       return (void *)(__phys_to_virt((unsigned long)(x)));
-}
-
-/*
- * Drivers should NOT use these either.
- */
-#define __pa(x)                        __virt_to_phys((unsigned long)(x))
-#define __va(x)                        ((void *)__phys_to_virt((unsigned long)(x)))
-#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
-
-/*
- * Virtual <-> DMA view memory address translations
- * Again, these are *only* valid on the kernel direct mapped RAM
- * memory.  Use of these is *deprecated* (and that doesn't mean
- * use the __ prefixed forms instead.)  See dma-mapping.h.
- */
-static inline __deprecated unsigned long virt_to_bus(void *x)
-{
-       return __virt_to_bus((unsigned long)x);
-}
-
-static inline __deprecated void *bus_to_virt(unsigned long x)
-{
-       return (void *)__bus_to_virt(x);
-}
-
-/*
- * Conversion between a struct page and a physical address.
- *
- * Note: when converting an unknown physical address to a
- * struct page, the resulting pointer must be validated
- * using VALID_PAGE().  It must return an invalid struct page
- * for any physical address not corresponding to a system
- * RAM address.
- *
- *  page_to_pfn(page)  convert a struct page * to a PFN number
- *  pfn_to_page(pfn)   convert a _valid_ PFN number to struct page *
- *  pfn_valid(pfn)     indicates whether a PFN number is valid
- *
- *  virt_to_page(k)    convert a _valid_ virtual address to struct page *
- *  virt_addr_valid(k) indicates whether a virtual address is valid
- */
-#ifndef CONFIG_DISCONTIGMEM
-
-#define ARCH_PFN_OFFSET                PHYS_PFN_OFFSET
-
-#ifndef CONFIG_SPARSEMEM
-#define pfn_valid(pfn)         ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
-#endif
-
-#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
-
-#define PHYS_TO_NID(addr)      (0)
-
-#else /* CONFIG_DISCONTIGMEM */
-
-/*
- * This is more complex.  We have a set of mem_map arrays spread
- * around in memory.
- */
-#include <linux/numa.h>
-
-#define arch_pfn_to_nid(pfn)   PFN_TO_NID(pfn)
-#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
-
-#define pfn_valid(pfn)                                         \
-       ({                                                      \
-               unsigned int nid = PFN_TO_NID(pfn);             \
-               int valid = nid < MAX_NUMNODES;                 \
-               if (valid) {                                    \
-                       pg_data_t *node = NODE_DATA(nid);       \
-                       valid = (pfn - node->node_start_pfn) <  \
-                               node->node_spanned_pages;       \
-               }                                               \
-               valid;                                          \
-       })
-
-#define virt_to_page(kaddr)                                    \
-       (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
-
-#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
-
-/*
- * Common discontigmem stuff.
- *  PHYS_TO_NID is used by the ARM kernel/setup.c
- */
-#define PHYS_TO_NID(addr)      PFN_TO_NID((addr) >> PAGE_SHIFT)
-
-/*
- * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
- * and returns the mem_map of that node.
- */
-#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
-
-/*
- * Given a page frame number, find the owning node of the memory
- * and returns the mem_map of that node.
- */
-#define PFN_TO_MAPBASE(pfn)    NODE_MEM_MAP(PFN_TO_NID(pfn))
-
-#ifdef NODE_MEM_SIZE_BITS
-#define NODE_MEM_SIZE_MASK     ((1 << NODE_MEM_SIZE_BITS) - 1)
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-#define KVADDR_TO_NID(addr) \
-       (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS)
-
-/*
- * Given a page frame number, convert it to a node id.
- */
-#define PFN_TO_NID(pfn) \
-       (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT))
-
-/*
- * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
- * and returns the index corresponding to the appropriate page in the
- * node's mem_map.
- */
-#define LOCAL_MAP_NR(addr) \
-       (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT)
-
-#endif /* NODE_MEM_SIZE_BITS */
-
-#endif /* !CONFIG_DISCONTIGMEM */
-
-/*
- * For BIO.  "will die".  Kill me when bio_to_phys() and bvec_to_phys() die.
- */
-#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.
- */
-#ifndef arch_is_coherent
-#define arch_is_coherent()             0
-#endif
-
-#endif
-
-#include <asm-generic/memory_model.h>
-
-#endif
diff --git a/include/asm-arm/mman.h b/include/asm-arm/mman.h
deleted file mode 100644 (file)
index 54570d2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ARM_MMAN_H__
-#define __ARM_MMAN_H__
-
-#include <asm-generic/mman.h>
-
-#define MAP_GROWSDOWN  0x0100          /* stack-like segment */
-#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
-#define MAP_LOCKED     0x2000          /* pages are locked */
-#define MAP_NORESERVE  0x4000          /* don't check for reservations */
-#define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
-#define MAP_NONBLOCK   0x10000         /* do not block on IO */
-
-#define MCL_CURRENT    1               /* lock all current mappings */
-#define MCL_FUTURE     2               /* lock all future mappings */
-
-#endif /* __ARM_MMAN_H__ */
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h
deleted file mode 100644 (file)
index 53099d4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __ARM_MMU_H
-#define __ARM_MMU_H
-
-#ifdef CONFIG_MMU
-
-typedef struct {
-#ifdef CONFIG_CPU_HAS_ASID
-       unsigned int id;
-#endif
-       unsigned int kvm_seq;
-} mm_context_t;
-
-#ifdef CONFIG_CPU_HAS_ASID
-#define ASID(mm)       ((mm)->context.id & 255)
-#else
-#define ASID(mm)       (0)
-#endif
-
-#else
-
-/*
- * From nommu.h:
- *  Copyright (C) 2002, David McCullough <davidm@snapgear.com>
- *  modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
- */
-typedef struct {
-       struct vm_list_struct   *vmlist;
-       unsigned long           end_brk;
-} mm_context_t;
-
-#endif
-
-#endif
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
deleted file mode 100644 (file)
index 91b9dfd..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *  linux/include/asm-arm/mmu_context.h
- *
- *  Copyright (C) 1996 Russell King.
- *
- * 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.
- *
- *  Changelog:
- *   27-06-1996        RMK     Created
- */
-#ifndef __ASM_ARM_MMU_CONTEXT_H
-#define __ASM_ARM_MMU_CONTEXT_H
-
-#include <linux/compiler.h>
-#include <asm/cacheflush.h>
-#include <asm/proc-fns.h>
-#include <asm-generic/mm_hooks.h>
-
-void __check_kvm_seq(struct mm_struct *mm);
-
-#ifdef CONFIG_CPU_HAS_ASID
-
-/*
- * On ARMv6, we have the following structure in the Context ID:
- *
- * 31                         7          0
- * +-------------------------+-----------+
- * |      process ID         |   ASID    |
- * +-------------------------+-----------+
- * |              context ID             |
- * +-------------------------------------+
- *
- * The ASID is used to tag entries in the CPU caches and TLBs.
- * The context ID is used by debuggers and trace logic, and
- * should be unique within all running processes.
- */
-#define ASID_BITS              8
-#define ASID_MASK              ((~0) << ASID_BITS)
-#define ASID_FIRST_VERSION     (1 << ASID_BITS)
-
-extern unsigned int cpu_last_asid;
-
-void __init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-void __new_context(struct mm_struct *mm);
-
-static inline void check_context(struct mm_struct *mm)
-{
-       if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
-               __new_context(mm);
-
-       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
-               __check_kvm_seq(mm);
-}
-
-#define init_new_context(tsk,mm)       (__init_new_context(tsk,mm),0)
-
-#else
-
-static inline void check_context(struct mm_struct *mm)
-{
-       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
-               __check_kvm_seq(mm);
-}
-
-#define init_new_context(tsk,mm)       0
-
-#endif
-
-#define destroy_context(mm)            do { } while(0)
-
-/*
- * This is called when "tsk" is about to enter lazy TLB mode.
- *
- * mm:  describes the currently active mm context
- * tsk: task which is entering lazy tlb
- * cpu: cpu number which is entering lazy tlb
- *
- * tsk->mm will be NULL
- */
-static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
-/*
- * This is the actual mm switch as far as the scheduler
- * is concerned.  No registers are touched.  We avoid
- * calling the CPU specific function when the mm hasn't
- * actually changed.
- */
-static inline void
-switch_mm(struct mm_struct *prev, struct mm_struct *next,
-         struct task_struct *tsk)
-{
-#ifdef CONFIG_MMU
-       unsigned int cpu = smp_processor_id();
-
-#ifdef CONFIG_SMP
-       /* check for possible thread migration */
-       if (!cpus_empty(next->cpu_vm_mask) && !cpu_isset(cpu, next->cpu_vm_mask))
-               __flush_icache_all();
-#endif
-       if (!cpu_test_and_set(cpu, next->cpu_vm_mask) || prev != next) {
-               check_context(next);
-               cpu_switch_mm(next->pgd, next);
-               if (cache_is_vivt())
-                       cpu_clear(cpu, prev->cpu_vm_mask);
-       }
-#endif
-}
-
-#define deactivate_mm(tsk,mm)  do { } while (0)
-#define activate_mm(prev,next) switch_mm(prev, next, NULL)
-
-#endif
diff --git a/include/asm-arm/mmzone.h b/include/asm-arm/mmzone.h
deleted file mode 100644 (file)
index b87de15..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  linux/include/asm-arm/mmzone.h
- *
- *  1999-12-29 Nicolas Pitre           Created
- *
- * 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.
- */
-#ifndef __ASM_MMZONE_H
-#define __ASM_MMZONE_H
-
-/*
- * Currently defined in arch/arm/mm/discontig.c
- */
-extern pg_data_t discontig_node_data[];
-
-/*
- * Return a pointer to the node data for node n.
- */
-#define NODE_DATA(nid)         (&discontig_node_data[nid])
-
-/*
- * NODE_MEM_MAP gives the kaddr for the mem_map of the node.
- */
-#define NODE_MEM_MAP(nid)      (NODE_DATA(nid)->node_mem_map)
-
-#include <asm/arch/memory.h>
-
-#endif
diff --git a/include/asm-arm/module.h b/include/asm-arm/module.h
deleted file mode 100644 (file)
index 24b168d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _ASM_ARM_MODULE_H
-#define _ASM_ARM_MODULE_H
-
-struct mod_arch_specific
-{
-       int foo;
-};
-
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
-
-/*
- * Include the ARM architecture version.
- */
-#define MODULE_ARCH_VERMAGIC   "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
-
-#endif /* _ASM_ARM_MODULE_H */
diff --git a/include/asm-arm/msgbuf.h b/include/asm-arm/msgbuf.h
deleted file mode 100644 (file)
index 33b35b9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _ASMARM_MSGBUF_H
-#define _ASMARM_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for arm architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       unsigned long   __unused1;
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       unsigned long   __unused2;
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned long   __unused3;
-       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  __unused4;
-       unsigned long  __unused5;
-};
-
-#endif /* _ASMARM_MSGBUF_H */
diff --git a/include/asm-arm/mtd-xip.h b/include/asm-arm/mtd-xip.h
deleted file mode 100644 (file)
index 9eb127c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * MTD primitives for XIP support. Architecture specific functions
- *
- * Do not include this file directly. It's included from linux/mtd/xip.h
- * 
- * Author:     Nicolas Pitre
- * Created:    Nov 2, 2004
- * Copyright:  (C) 2004 MontaVista Software, Inc.
- *
- * 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__
-#define __ARM_MTD_XIP_H__
-
-#include <asm/hardware.h>
-#include <asm/arch/mtd-xip.h>
-
-/* fill instruction prefetch */
-#define xip_iprefetch()        do { asm volatile (".rep 8; nop; .endr"); } while (0)
-
-#endif /* __ARM_MTD_XIP_H__ */
diff --git a/include/asm-arm/mutex.h b/include/asm-arm/mutex.h
deleted file mode 100644 (file)
index 020bd98..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * include/asm-arm/mutex.h
- *
- * ARM optimized mutex locking primitives
- *
- * Please look into asm-generic/mutex-xchg.h for a formal definition.
- */
-#ifndef _ASM_MUTEX_H
-#define _ASM_MUTEX_H
-
-#if __LINUX_ARM_ARCH__ < 6
-/* On pre-ARMv6 hardware the swp based implementation is the most efficient. */
-# include <asm-generic/mutex-xchg.h>
-#else
-
-/*
- * Attempting to lock a mutex on ARMv6+ can be done with a bastardized
- * atomic decrement (it is not a reliable atomic decrement but it satisfies
- * the defined semantics for our purpose, while being smaller and faster
- * than a real atomic decrement or atomic swap.  The idea is to attempt
- * decrementing the lock value only once.  If once decremented it isn't zero,
- * or if its store-back fails due to a dispute on the exclusive store, we
- * simply bail out immediately through the slow path where the lock will be
- * reattempted until it succeeds.
- */
-static inline void
-__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
-       int __ex_flag, __res;
-
-       __asm__ (
-
-               "ldrex  %0, [%2]        \n\t"
-               "sub    %0, %0, #1      \n\t"
-               "strex  %1, %0, [%2]    "
-
-               : "=&r" (__res), "=&r" (__ex_flag)
-               : "r" (&(count)->counter)
-               : "cc","memory" );
-
-       __res |= __ex_flag;
-       if (unlikely(__res != 0))
-               fail_fn(count);
-}
-
-static inline int
-__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
-{
-       int __ex_flag, __res;
-
-       __asm__ (
-
-               "ldrex  %0, [%2]        \n\t"
-               "sub    %0, %0, #1      \n\t"
-               "strex  %1, %0, [%2]    "
-
-               : "=&r" (__res), "=&r" (__ex_flag)
-               : "r" (&(count)->counter)
-               : "cc","memory" );
-
-       __res |= __ex_flag;
-       if (unlikely(__res != 0))
-               __res = fail_fn(count);
-       return __res;
-}
-
-/*
- * Same trick is used for the unlock fast path. However the original value,
- * rather than the result, is used to test for success in order to have
- * better generated assembly.
- */
-static inline void
-__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
-       int __ex_flag, __res, __orig;
-
-       __asm__ (
-
-               "ldrex  %0, [%3]        \n\t"
-               "add    %1, %0, #1      \n\t"
-               "strex  %2, %1, [%3]    "
-
-               : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
-               : "r" (&(count)->counter)
-               : "cc","memory" );
-
-       __orig |= __ex_flag;
-       if (unlikely(__orig != 0))
-               fail_fn(count);
-}
-
-/*
- * If the unlock was done on a contended lock, or if the unlock simply fails
- * then the mutex remains locked.
- */
-#define __mutex_slowpath_needs_to_unlock()     1
-
-/*
- * For __mutex_fastpath_trylock we use another construct which could be
- * described as a "single value cmpxchg".
- *
- * This provides the needed trylock semantics like cmpxchg would, but it is
- * lighter and less generic than a true cmpxchg implementation.
- */
-static inline int
-__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
-{
-       int __ex_flag, __res, __orig;
-
-       __asm__ (
-
-               "1: ldrex       %0, [%3]        \n\t"
-               "subs           %1, %0, #1      \n\t"
-               "strexeq        %2, %1, [%3]    \n\t"
-               "movlt          %0, #0          \n\t"
-               "cmpeq          %2, #0          \n\t"
-               "bgt            1b              "
-
-               : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
-               : "r" (&count->counter)
-               : "cc", "memory" );
-
-       return __orig;
-}
-
-#endif
-#endif
diff --git a/include/asm-arm/nwflash.h b/include/asm-arm/nwflash.h
deleted file mode 100644 (file)
index 04e5a55..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _FLASH_H
-#define _FLASH_H
-
-#define FLASH_MINOR             160    /* MAJOR is 10 - miscdevice */
-#define CMD_WRITE_DISABLE       0
-#define CMD_WRITE_ENABLE        0x28
-#define CMD_WRITE_BASE64K_ENABLE 0x47
-
-#endif /* _FLASH_H */
diff --git a/include/asm-arm/page-nommu.h b/include/asm-arm/page-nommu.h
deleted file mode 100644 (file)
index ea1cde8..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *  linux/include/asm-arm/page-nommu.h
- *
- *  Copyright (C) 2004 Hyok S. Choi
- *
- * 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.
- */
-
-#ifndef _ASMARM_PAGE_NOMMU_H
-#define _ASMARM_PAGE_NOMMU_H
-
-#if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13
-#define KTHREAD_SIZE (8192)
-#else
-#define KTHREAD_SIZE PAGE_SIZE
-#endif
-#define get_user_page(vaddr)           __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr)     free_page(addr)
-
-#define clear_page(page)       memset((page), 0, PAGE_SIZE)
-#define copy_page(to,from)     memcpy((to), (from), PAGE_SIZE)
-
-#define clear_user_page(page, vaddr, pg)       clear_page(page)
-#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
-
-/*
- * These are used to make use of C type-checking..
- */
-typedef unsigned long pte_t;
-typedef unsigned long pmd_t;
-typedef unsigned long pgd_t[2];
-typedef unsigned long pgprot_t;
-
-#define pte_val(x)      (x)
-#define pmd_val(x)      (x)
-#define pgd_val(x)     ((x)[0])
-#define pgprot_val(x)   (x)
-
-#define __pte(x)        (x)
-#define __pmd(x)        (x)
-#define __pgprot(x)     (x)
-
-extern unsigned long memory_start;
-extern unsigned long memory_end;
-
-#endif
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
deleted file mode 100644 (file)
index 7c5fc55..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *  linux/include/asm-arm/page.h
- *
- *  Copyright (C) 1995-2003 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_PAGE_H
-#define _ASMARM_PAGE_H
-
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT             12
-#define PAGE_SIZE              (1UL << PAGE_SHIFT)
-#define PAGE_MASK              (~(PAGE_SIZE-1))
-
-#ifndef __ASSEMBLY__
-
-#ifndef CONFIG_MMU
-
-#include "page-nommu.h"
-
-#else
-
-#include <asm/glue.h>
-
-/*
- *     User Space Model
- *     ================
- *
- *     This section selects the correct set of functions for dealing with
- *     page-based copying and clearing for user space for the particular
- *     processor(s) we're building for.
- *
- *     We have the following to choose from:
- *       v3            - ARMv3
- *       v4wt          - ARMv4 with writethrough cache, without minicache
- *       v4wb          - ARMv4 with writeback cache, without minicache
- *       v4_mc         - ARMv4 with minicache
- *       xscale        - Xscale
- *       xsc3          - XScalev3
- */
-#undef _USER
-#undef MULTI_USER
-
-#ifdef CONFIG_CPU_COPY_V3
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER v3
-# endif
-#endif
-
-#ifdef CONFIG_CPU_COPY_V4WT
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER v4wt
-# endif
-#endif
-
-#ifdef CONFIG_CPU_COPY_V4WB
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER v4wb
-# endif
-#endif
-
-#ifdef CONFIG_CPU_COPY_FEROCEON
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER feroceon
-# endif
-#endif
-
-#ifdef CONFIG_CPU_SA1100
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER v4_mc
-# endif
-#endif
-
-#ifdef CONFIG_CPU_XSCALE
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER xscale_mc
-# endif
-#endif
-
-#ifdef CONFIG_CPU_XSC3
-# ifdef _USER
-#  define MULTI_USER 1
-# else
-#  define _USER xsc3_mc
-# endif
-#endif
-
-#ifdef CONFIG_CPU_COPY_V6
-# define MULTI_USER 1
-#endif
-
-#if !defined(_USER) && !defined(MULTI_USER)
-#error Unknown user operations model
-#endif
-
-struct cpu_user_fns {
-       void (*cpu_clear_user_page)(void *p, unsigned long user);
-       void (*cpu_copy_user_page)(void *to, const void *from,
-                                  unsigned long user);
-};
-
-#ifdef MULTI_USER
-extern struct cpu_user_fns cpu_user;
-
-#define __cpu_clear_user_page  cpu_user.cpu_clear_user_page
-#define __cpu_copy_user_page   cpu_user.cpu_copy_user_page
-
-#else
-
-#define __cpu_clear_user_page  __glue(_USER,_clear_user_page)
-#define __cpu_copy_user_page   __glue(_USER,_copy_user_page)
-
-extern void __cpu_clear_user_page(void *p, unsigned long user);
-extern void __cpu_copy_user_page(void *to, const void *from,
-                                unsigned long user);
-#endif
-
-#define clear_user_page(addr,vaddr,pg)  __cpu_clear_user_page(addr, vaddr)
-#define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr)
-
-#define clear_page(page)       memzero((void *)(page), PAGE_SIZE)
-extern void copy_page(void *to, const void *from);
-
-#undef STRICT_MM_TYPECHECKS
-
-#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[2]; } 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[0])
-#define pgprot_val(x)   ((x).pgprot)
-
-#define __pte(x)        ((pte_t) { (x) } )
-#define __pmd(x)        ((pmd_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[2];
-typedef unsigned long pgprot_t;
-
-#define pte_val(x)      (x)
-#define pmd_val(x)      (x)
-#define pgd_val(x)     ((x)[0])
-#define pgprot_val(x)   (x)
-
-#define __pte(x)        (x)
-#define __pmd(x)        (x)
-#define __pgprot(x)     (x)
-
-#endif /* STRICT_MM_TYPECHECKS */
-
-#endif /* CONFIG_MMU */
-
-typedef struct page *pgtable_t;
-
-#include <asm/memory.h>
-
-#endif /* !__ASSEMBLY__ */
-
-#define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
-                                VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-
-/*
- * With EABI on ARMv5 and above we must have 64-bit aligned slab pointers.
- */
-#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
-#define ARCH_SLAB_MINALIGN 8
-#endif
-
-#include <asm-generic/page.h>
-
-#endif
diff --git a/include/asm-arm/param.h b/include/asm-arm/param.h
deleted file mode 100644 (file)
index 1580646..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  linux/include/asm-arm/param.h
- *
- *  Copyright (C) 1995-1999 Russell King
- *
- * 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.
- */
-#ifndef __ASM_PARAM_H
-#define __ASM_PARAM_H
-
-#ifdef __KERNEL__
-# define HZ            CONFIG_HZ       /* Internal kernel timer frequency */
-# define USER_HZ       100             /* User interfaces are in "ticks" */
-# define CLOCKS_PER_SEC        (USER_HZ)       /* like times() */
-#else
-# define HZ            100
-#endif
-
-#define EXEC_PAGESIZE  4096
-
-#ifndef NOGROUP
-#define NOGROUP         (-1)
-#endif
-
-/* max length of hostname */
-#define MAXHOSTNAMELEN  64
-
-#endif
-
diff --git a/include/asm-arm/parport.h b/include/asm-arm/parport.h
deleted file mode 100644 (file)
index f2f90c7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *  linux/include/asm-arm/parport.h: ARM-specific 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 __ASMARM_PARPORT_H
-#define __ASMARM_PARPORT_H
-
-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 /* !(_ASMARM_PARPORT_H) */
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
deleted file mode 100644 (file)
index 2d84792..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef ASMARM_PCI_H
-#define ASMARM_PCI_H
-
-#ifdef __KERNEL__
-#include <asm-generic/pci-dma-compat.h>
-
-#include <asm/hardware.h> /* for PCIBIOS_MIN_* */
-
-#define pcibios_scan_all_fns(a, b)     0
-
-#ifdef CONFIG_PCI_HOST_ITE8152
-/* ITE bridge requires setting latency timer to avoid early bus access
-   termination by PIC bus mater devices
-*/
-extern void pcibios_set_master(struct pci_dev *dev);
-#else
-static inline void pcibios_set_master(struct pci_dev *dev)
-{
-       /* No special bus mastering setup handling */
-}
-#endif
-
-static inline void pcibios_penalize_isa_irq(int irq, int active)
-{
-       /* We don't do dynamic PCI IRQ allocation */
-}
-
-/*
- * The PCI address space does 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)
-
-/*
- * Whether pci_unmap_{single,page} is a nop depends upon the
- * configuration.
- */
-#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))
-
-#ifdef CONFIG_PCI
-static inline void pci_dma_burst_advice(struct pci_dev *pdev,
-                                       enum pci_dma_burst_strategy *strat,
-                                       unsigned long *strategy_parameter)
-{
-       *strat = PCI_DMA_BURST_INFINITY;
-       *strategy_parameter = ~0UL;
-}
-#endif
-
-#define HAVE_PCI_MMAP
-extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
-                               enum pci_mmap_state mmap_state, int write_combine);
-
-extern void
-pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
-                        struct resource *res);
-
-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;
-}
-
-/*
- * Dummy implementation; always return 0.
- */
-static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
-{
-       return 0;
-}
-
-#endif /* __KERNEL__ */
-#endif
diff --git a/include/asm-arm/percpu.h b/include/asm-arm/percpu.h
deleted file mode 100644 (file)
index b4e32d8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ARM_PERCPU
-#define __ARM_PERCPU
-
-#include <asm-generic/percpu.h>
-
-#endif
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
deleted file mode 100644 (file)
index 163b030..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *  linux/include/asm-arm/pgalloc.h
- *
- *  Copyright (C) 2000-2001 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_PGALLOC_H
-#define _ASMARM_PGALLOC_H
-
-#include <asm/domain.h>
-#include <asm/pgtable-hwdef.h>
-#include <asm/processor.h>
-#include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
-
-#define check_pgt_cache()              do { } while (0)
-
-#ifdef CONFIG_MMU
-
-#define _PAGE_USER_TABLE       (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
-#define _PAGE_KERNEL_TABLE     (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
-
-/*
- * Since we have only two-level page tables, these are trivial
- */
-#define pmd_alloc_one(mm,addr)         ({ BUG(); ((pmd_t *)2); })
-#define pmd_free(mm, pmd)              do { } while (0)
-#define pgd_populate(mm,pmd,pte)       BUG()
-
-extern pgd_t *get_pgd_slow(struct mm_struct *mm);
-extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd);
-
-#define pgd_alloc(mm)                  get_pgd_slow(mm)
-#define pgd_free(mm, pgd)              free_pgd_slow(mm, pgd)
-
-/*
- * Allocate one PTE table.
- *
- * This actually allocates two hardware PTE tables, but we wrap this up
- * into one table thus:
- *
- *  +------------+
- *  |  h/w pt 0  |
- *  +------------+
- *  |  h/w pt 1  |
- *  +------------+
- *  | Linux pt 0 |
- *  +------------+
- *  | Linux pt 1 |
- *  +------------+
- */
-static inline pte_t *
-pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
-{
-       pte_t *pte;
-
-       pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-       if (pte) {
-               clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE);
-               pte += PTRS_PER_PTE;
-       }
-
-       return pte;
-}
-
-static inline pgtable_t
-pte_alloc_one(struct mm_struct *mm, unsigned long addr)
-{
-       struct page *pte;
-
-       pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
-       if (pte) {
-               void *page = page_address(pte);
-               clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE);
-               pgtable_page_ctor(pte);
-       }
-
-       return pte;
-}
-
-/*
- * Free one PTE table.
- */
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
-{
-       if (pte) {
-               pte -= PTRS_PER_PTE;
-               free_page((unsigned long)pte);
-       }
-}
-
-static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
-{
-       pgtable_page_dtor(pte);
-       __free_page(pte);
-}
-
-static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval)
-{
-       pmdp[0] = __pmd(pmdval);
-       pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
-       flush_pmd_entry(pmdp);
-}
-
-/*
- * Populate the pmdp entry with a pointer to the pte.  This pmd is part
- * of the mm address space.
- *
- * Ensure that we always set both PMD entries.
- */
-static inline void
-pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
-{
-       unsigned long pte_ptr = (unsigned long)ptep;
-
-       /*
-        * The pmd must be loaded with the physical
-        * address of the PTE table
-        */
-       pte_ptr -= PTRS_PER_PTE * sizeof(void *);
-       __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE);
-}
-
-static inline void
-pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep)
-{
-       __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);
-}
-#define pmd_pgtable(pmd) pmd_page(pmd)
-
-#endif /* CONFIG_MMU */
-
-#endif
diff --git a/include/asm-arm/pgtable-hwdef.h b/include/asm-arm/pgtable-hwdef.h
deleted file mode 100644 (file)
index f3b5120..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *  linux/include/asm-arm/pgtable-hwdef.h
- *
- *  Copyright (C) 1995-2002 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_PGTABLE_HWDEF_H
-#define _ASMARM_PGTABLE_HWDEF_H
-
-/*
- * Hardware page table definitions.
- *
- * + Level 1 descriptor (PMD)
- *   - common
- */
-#define PMD_TYPE_MASK          (3 << 0)
-#define PMD_TYPE_FAULT         (0 << 0)
-#define PMD_TYPE_TABLE         (1 << 0)
-#define PMD_TYPE_SECT          (2 << 0)
-#define PMD_BIT4               (1 << 4)
-#define PMD_DOMAIN(x)          ((x) << 5)
-#define PMD_PROTECTION         (1 << 9)        /* v5 */
-/*
- *   - section
- */
-#define PMD_SECT_BUFFERABLE    (1 << 2)
-#define PMD_SECT_CACHEABLE     (1 << 3)
-#define PMD_SECT_XN            (1 << 4)        /* v6 */
-#define PMD_SECT_AP_WRITE      (1 << 10)
-#define PMD_SECT_AP_READ       (1 << 11)
-#define PMD_SECT_TEX(x)                ((x) << 12)     /* v5 */
-#define PMD_SECT_APX           (1 << 15)       /* v6 */
-#define PMD_SECT_S             (1 << 16)       /* v6 */
-#define PMD_SECT_nG            (1 << 17)       /* v6 */
-#define PMD_SECT_SUPER         (1 << 18)       /* v6 */
-
-#define PMD_SECT_UNCACHED      (0)
-#define PMD_SECT_BUFFERED      (PMD_SECT_BUFFERABLE)
-#define PMD_SECT_WT            (PMD_SECT_CACHEABLE)
-#define PMD_SECT_WB            (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
-#define PMD_SECT_MINICACHE     (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
-#define PMD_SECT_WBWA          (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
-#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
-
-/*
- *   - coarse table (not used)
- */
-
-/*
- * + Level 2 descriptor (PTE)
- *   - common
- */
-#define PTE_TYPE_MASK          (3 << 0)
-#define PTE_TYPE_FAULT         (0 << 0)
-#define PTE_TYPE_LARGE         (1 << 0)
-#define PTE_TYPE_SMALL         (2 << 0)
-#define PTE_TYPE_EXT           (3 << 0)        /* v5 */
-#define PTE_BUFFERABLE         (1 << 2)
-#define PTE_CACHEABLE          (1 << 3)
-
-/*
- *   - extended small page/tiny page
- */
-#define PTE_EXT_XN             (1 << 0)        /* v6 */
-#define PTE_EXT_AP_MASK                (3 << 4)
-#define PTE_EXT_AP0            (1 << 4)
-#define PTE_EXT_AP1            (2 << 4)
-#define PTE_EXT_AP_UNO_SRO     (0 << 4)
-#define PTE_EXT_AP_UNO_SRW     (PTE_EXT_AP0)
-#define PTE_EXT_AP_URO_SRW     (PTE_EXT_AP1)
-#define PTE_EXT_AP_URW_SRW     (PTE_EXT_AP1|PTE_EXT_AP0)
-#define PTE_EXT_TEX(x)         ((x) << 6)      /* v5 */
-#define PTE_EXT_APX            (1 << 9)        /* v6 */
-#define PTE_EXT_COHERENT       (1 << 9)        /* XScale3 */
-#define PTE_EXT_SHARED         (1 << 10)       /* v6 */
-#define PTE_EXT_NG             (1 << 11)       /* v6 */
-
-/*
- *   - small page
- */
-#define PTE_SMALL_AP_MASK      (0xff << 4)
-#define PTE_SMALL_AP_UNO_SRO   (0x00 << 4)
-#define PTE_SMALL_AP_UNO_SRW   (0x55 << 4)
-#define PTE_SMALL_AP_URO_SRW   (0xaa << 4)
-#define PTE_SMALL_AP_URW_SRW   (0xff << 4)
-
-#endif
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
deleted file mode 100644 (file)
index 386fcc1..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *  linux/include/asm-arm/pgtable-nommu.h
- *
- *  Copyright (C) 1995-2002 Russell King
- *  Copyright (C) 2004  Hyok S. Choi
- *
- * 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.
- */
-#ifndef _ASMARM_PGTABLE_NOMMU_H
-#define _ASMARM_PGTABLE_NOMMU_H
-
-#ifndef __ASSEMBLY__
-
-#include <linux/slab.h>
-#include <asm/processor.h>
-#include <asm/page.h>
-
-/*
- * Trivial page table functions.
- */
-#define pgd_present(pgd)       (1)
-#define pgd_none(pgd)          (0)
-#define pgd_bad(pgd)           (0)
-#define pgd_clear(pgdp)
-#define kern_addr_valid(addr)  (1)
-#define        pmd_offset(a, b)        ((void *)0)
-/* FIXME */
-/*
- * PMD_SHIFT determines the size of the area a second-level page table can map
- * PGDIR_SHIFT determines what a third-level page table entry can map
- */
-#define PGDIR_SHIFT            21
-
-#define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
-#define PGDIR_MASK             (~(PGDIR_SIZE-1))
-/* FIXME */
-
-#define PAGE_NONE      __pgprot(0)
-#define PAGE_SHARED    __pgprot(0)
-#define PAGE_COPY      __pgprot(0)
-#define PAGE_READONLY  __pgprot(0)
-#define PAGE_KERNEL    __pgprot(0)
-
-#define swapper_pg_dir ((pgd_t *) 0)
-
-#define __swp_type(x)          (0)
-#define __swp_offset(x)                (0)
-#define __swp_entry(typ,off)   ((swp_entry_t) { ((typ) | ((off) << 7)) })
-#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
-
-
-typedef pte_t *pte_addr_t;
-
-static inline int pte_file(pte_t pte) { return 0; }
-
-/*
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-#define ZERO_PAGE(vaddr)       (virt_to_page(0))
-
-/*
- * Mark the prot value as uncacheable and unbufferable.
- */
-#define pgprot_noncached(prot) __pgprot(0)
-#define pgprot_writecombine(prot) __pgprot(0)
-
-
-/*
- * These would be in other places but having them here reduces the diffs.
- */
-extern unsigned int kobjsize(const void *objp);
-
-/*
- * No page table caches to initialise.
- */
-#define pgtable_cache_init()   do { } while (0)
-#define io_remap_page_range    remap_page_range
-#define io_remap_pfn_range     remap_pfn_range
-
-
-/*
- * All 32bit addresses are effectively valid for vmalloc...
- * Sort of meaningless for non-VM targets.
- */
-#define        VMALLOC_START   0
-#define        VMALLOC_END     0xffffffff
-
-#define FIRST_USER_ADDRESS      (0)
-
-#include <asm-generic/pgtable.h>
-
-#else 
-
-/*
- * dummy tlb and user structures.
- */
-#define v3_tlb_fns     (0)
-#define v4_tlb_fns     (0)
-#define v4wb_tlb_fns   (0)
-#define v4wbi_tlb_fns  (0)
-#define v6wbi_tlb_fns  (0)
-#define v7wbi_tlb_fns  (0)
-
-#define v3_user_fns    (0)
-#define v4_user_fns    (0)
-#define v4_mc_user_fns (0)
-#define v4wb_user_fns  (0)
-#define v4wt_user_fns  (0)
-#define v6_user_fns    (0)
-#define xscale_mc_user_fns (0)
-
-#endif /*__ASSEMBLY__*/
-
-#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
deleted file mode 100644 (file)
index 5571c13..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- *  linux/include/asm-arm/pgtable.h
- *
- *  Copyright (C) 1995-2002 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_PGTABLE_H
-#define _ASMARM_PGTABLE_H
-
-#include <asm-generic/4level-fixup.h>
-#include <asm/proc-fns.h>
-
-#ifndef CONFIG_MMU
-
-#include "pgtable-nommu.h"
-
-#else
-
-#include <asm/memory.h>
-#include <asm/arch/vmalloc.h>
-#include <asm/pgtable-hwdef.h>
-
-/*
- * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 8MB value just means that there will be a 8MB "hole" after the
- * physical memory until the kernel virtual memory starts.  That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- *
- * Note that platforms may override VMALLOC_START, but they must provide
- * VMALLOC_END.  VMALLOC_END defines the (exclusive) limit of this space,
- * which may not overlap IO space.
- */
-#ifndef VMALLOC_START
-#define VMALLOC_OFFSET         (8*1024*1024)
-#define VMALLOC_START          (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
-#endif
-
-/*
- * Hardware-wise, we have a two level page table structure, where the first
- * level has 4096 entries, and the second level has 256 entries.  Each entry
- * is one 32-bit word.  Most of the bits in the second level entry are used
- * by hardware, and there aren't any "accessed" and "dirty" bits.
- *
- * Linux on the other hand has a three level page table structure, which can
- * be wrapped to fit a two level page table structure easily - using the PGD
- * and PTE only.  However, Linux also expects one "PTE" table per page, and
- * at least a "dirty" bit.
- *
- * Therefore, we tweak the implementation slightly - we tell Linux that we
- * have 2048 entries in the first level, each of which is 8 bytes (iow, two
- * hardware pointers to the second level.)  The second level contains two
- * hardware PTE tables arranged contiguously, followed by Linux versions
- * which contain the state information Linux needs.  We, therefore, end up
- * with 512 entries in the "PTE" level.
- *
- * This leads to the page tables having the following layout:
- *
- *    pgd             pte
- * |        |
- * +--------+ +0
- * |        |-----> +------------+ +0
- * +- - - - + +4    |  h/w pt 0  |
- * |        |-----> +------------+ +1024
- * +--------+ +8    |  h/w pt 1  |
- * |        |       +------------+ +2048
- * +- - - - +       | Linux pt 0 |
- * |        |       +------------+ +3072
- * +--------+       | Linux pt 1 |
- * |        |       +------------+ +4096
- *
- * See L_PTE_xxx below for definitions of bits in the "Linux pt", and
- * PTE_xxx for definitions of bits appearing in the "h/w pt".
- *
- * PMD_xxx definitions refer to bits in the first level page table.
- *
- * The "dirty" bit is emulated by only granting hardware write permission
- * iff the page is marked "writable" and "dirty" in the Linux PTE.  This
- * means that a write to a clean page will cause a permission fault, and
- * the Linux MM layer will mark the page dirty via handle_pte_fault().
- * For the hardware to notice the permission change, the TLB entry must
- * be flushed, and ptep_set_access_flags() does that for us.
- *
- * The "accessed" or "young" bit is emulated by a similar method; we only
- * allow accesses to the page if the "young" bit is set.  Accesses to the
- * page will cause a fault, and handle_pte_fault() will set the young bit
- * for us as long as the page is marked present in the corresponding Linux
- * PTE entry.  Again, ptep_set_access_flags() will ensure that the TLB is
- * up to date.
- *
- * However, when the "young" bit is cleared, we deny access to the page
- * by clearing the hardware PTE.  Currently Linux does not flush the TLB
- * for us in this case, which means the TLB will retain the transation
- * until either the TLB entry is evicted under pressure, or a context
- * switch which changes the user space mapping occurs.
- */
-#define PTRS_PER_PTE           512
-#define PTRS_PER_PMD           1
-#define PTRS_PER_PGD           2048
-
-/*
- * PMD_SHIFT determines the size of the area a second-level page table can map
- * PGDIR_SHIFT determines what a third-level page table entry can map
- */
-#define PMD_SHIFT              21
-#define PGDIR_SHIFT            21
-
-#define LIBRARY_TEXT_START     0x0c000000
-
-#ifndef __ASSEMBLY__
-extern void __pte_error(const char *file, int line, unsigned long val);
-extern void __pmd_error(const char *file, int line, unsigned long val);
-extern void __pgd_error(const char *file, int line, unsigned long val);
-
-#define pte_ERROR(pte)         __pte_error(__FILE__, __LINE__, pte_val(pte))
-#define pmd_ERROR(pmd)         __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
-#define pgd_ERROR(pgd)         __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
-#endif /* !__ASSEMBLY__ */
-
-#define PMD_SIZE               (1UL << PMD_SHIFT)
-#define PMD_MASK               (~(PMD_SIZE-1))
-#define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
-#define PGDIR_MASK             (~(PGDIR_SIZE-1))
-
-/*
- * This is the lowest virtual address we can permit any user space
- * mapping to be mapped at.  This is particularly important for
- * non-high vector CPUs.
- */
-#define FIRST_USER_ADDRESS     PAGE_SIZE
-
-#define FIRST_USER_PGD_NR      1
-#define USER_PTRS_PER_PGD      ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR)
-
-/*
- * section address mask and size definitions.
- */
-#define SECTION_SHIFT          20
-#define SECTION_SIZE           (1UL << SECTION_SHIFT)
-#define SECTION_MASK           (~(SECTION_SIZE-1))
-
-/*
- * ARMv6 supersection address mask and size definitions.
- */
-#define SUPERSECTION_SHIFT     24
-#define SUPERSECTION_SIZE      (1UL << SUPERSECTION_SHIFT)
-#define SUPERSECTION_MASK      (~(SUPERSECTION_SIZE-1))
-
-/*
- * "Linux" PTE definitions.
- *
- * We keep two sets of PTEs - the hardware and the linux version.
- * This allows greater flexibility in the way we map the Linux bits
- * onto the hardware tables, and allows us to have YOUNG and DIRTY
- * bits.
- *
- * The PTE table pointer refers to the hardware entries; the "Linux"
- * entries are stored 1024 bytes below.
- */
-#define L_PTE_PRESENT          (1 << 0)
-#define L_PTE_FILE             (1 << 1)        /* only when !PRESENT */
-#define L_PTE_YOUNG            (1 << 1)
-#define L_PTE_BUFFERABLE       (1 << 2)        /* matches PTE */
-#define L_PTE_CACHEABLE                (1 << 3)        /* matches PTE */
-#define L_PTE_USER             (1 << 4)
-#define L_PTE_WRITE            (1 << 5)
-#define L_PTE_EXEC             (1 << 6)
-#define L_PTE_DIRTY            (1 << 7)
-#define L_PTE_SHARED           (1 << 10)       /* shared(v6), coherent(xsc3) */
-
-#ifndef __ASSEMBLY__
-
-/*
- * The pgprot_* and protection_map entries will be fixed up in runtime
- * to include the cachable and bufferable bits based on memory policy,
- * as well as any architecture dependent bits like global/ASID and SMP
- * shared mapping bits.
- */
-#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE
-#define _L_PTE_READ    L_PTE_USER | L_PTE_EXEC
-
-extern pgprot_t                pgprot_user;
-extern pgprot_t                pgprot_kernel;
-
-#define PAGE_NONE      pgprot_user
-#define PAGE_COPY      __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
-#define PAGE_SHARED    __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ | \
-                                L_PTE_WRITE)
-#define PAGE_READONLY  __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ)
-#define PAGE_KERNEL    pgprot_kernel
-
-#define __PAGE_NONE    __pgprot(_L_PTE_DEFAULT)
-#define __PAGE_COPY    __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
-#define __PAGE_SHARED  __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE)
-#define __PAGE_READONLY        __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * The table below defines the page protection levels that we insert into our
- * Linux page table version.  These get translated into the best that the
- * architecture can perform.  Note that on most ARM hardware:
- *  1) We cannot do execute protection
- *  2) If we could do execute protection, then read is implied
- *  3) write implies read permissions
- */
-#define __P000  __PAGE_NONE
-#define __P001  __PAGE_READONLY
-#define __P010  __PAGE_COPY
-#define __P011  __PAGE_COPY
-#define __P100  __PAGE_READONLY
-#define __P101  __PAGE_READONLY
-#define __P110  __PAGE_COPY
-#define __P111  __PAGE_COPY
-
-#define __S000  __PAGE_NONE
-#define __S001  __PAGE_READONLY
-#define __S010  __PAGE_SHARED
-#define __S011  __PAGE_SHARED
-#define __S100  __PAGE_READONLY
-#define __S101  __PAGE_READONLY
-#define __S110  __PAGE_SHARED
-#define __S111  __PAGE_SHARED
-
-#ifndef __ASSEMBLY__
-/*
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-extern struct page *empty_zero_page;
-#define ZERO_PAGE(vaddr)       (empty_zero_page)
-
-#define pte_pfn(pte)           (pte_val(pte) >> PAGE_SHIFT)
-#define pfn_pte(pfn,prot)      (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
-
-#define pte_none(pte)          (!pte_val(pte))
-#define pte_clear(mm,addr,ptep)        set_pte_ext(ptep, __pte(0), 0)
-#define pte_page(pte)          (pfn_to_page(pte_pfn(pte)))
-#define pte_offset_kernel(dir,addr)    (pmd_page_vaddr(*(dir)) + __pte_index(addr))
-#define pte_offset_map(dir,addr)       (pmd_page_vaddr(*(dir)) + __pte_index(addr))
-#define pte_offset_map_nested(dir,addr)        (pmd_page_vaddr(*(dir)) + __pte_index(addr))
-#define pte_unmap(pte)         do { } while (0)
-#define pte_unmap_nested(pte)  do { } while (0)
-
-#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
-
-#define set_pte_at(mm,addr,ptep,pteval) do { \
-       set_pte_ext(ptep, pteval, (addr) >= TASK_SIZE ? 0 : PTE_EXT_NG); \
- } while (0)
-
-/*
- * The following only work if pte_present() is true.
- * Undefined behaviour if not..
- */
-#define pte_present(pte)       (pte_val(pte) & L_PTE_PRESENT)
-#define pte_write(pte)         (pte_val(pte) & L_PTE_WRITE)
-#define pte_dirty(pte)         (pte_val(pte) & L_PTE_DIRTY)
-#define pte_young(pte)         (pte_val(pte) & L_PTE_YOUNG)
-#define pte_special(pte)       (0)
-
-/*
- * The following only works if pte_present() is not true.
- */
-#define pte_file(pte)          (pte_val(pte) & L_PTE_FILE)
-#define pte_to_pgoff(x)                (pte_val(x) >> 2)
-#define pgoff_to_pte(x)                __pte(((x) << 2) | L_PTE_FILE)
-
-#define PTE_FILE_MAX_BITS      30
-
-#define PTE_BIT_FUNC(fn,op) \
-static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
-
-PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE);
-PTE_BIT_FUNC(mkwrite,   |= L_PTE_WRITE);
-PTE_BIT_FUNC(mkclean,   &= ~L_PTE_DIRTY);
-PTE_BIT_FUNC(mkdirty,   |= L_PTE_DIRTY);
-PTE_BIT_FUNC(mkold,     &= ~L_PTE_YOUNG);
-PTE_BIT_FUNC(mkyoung,   |= L_PTE_YOUNG);
-
-static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
-
-/*
- * Mark the prot value as uncacheable and unbufferable.
- */
-#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE))
-#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE)
-
-#define pmd_none(pmd)          (!pmd_val(pmd))
-#define pmd_present(pmd)       (pmd_val(pmd))
-#define pmd_bad(pmd)           (pmd_val(pmd) & 2)
-
-#define copy_pmd(pmdpd,pmdps)          \
-       do {                            \
-               pmdpd[0] = pmdps[0];    \
-               pmdpd[1] = pmdps[1];    \
-               flush_pmd_entry(pmdpd); \
-       } while (0)
-
-#define pmd_clear(pmdp)                        \
-       do {                            \
-               pmdp[0] = __pmd(0);     \
-               pmdp[1] = __pmd(0);     \
-               clean_pmd_entry(pmdp);  \
-       } while (0)
-
-static inline pte_t *pmd_page_vaddr(pmd_t pmd)
-{
-       unsigned long ptr;
-
-       ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1);
-       ptr += PTRS_PER_PTE * sizeof(void *);
-
-       return __va(ptr);
-}
-
-#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
-
-/*
- * Permanent address of a page. We never have highmem, so this is trivial.
- */
-#define pages_to_mb(x)         ((x) >> (20 - PAGE_SHIFT))
-
-/*
- * Conversion functions: convert a page and protection to a page entry,
- * and a page entry and page directory to the page they refer to.
- */
-#define mk_pte(page,prot)      pfn_pte(page_to_pfn(page),prot)
-
-/*
- * The "pgd_xxx()" functions here are trivial for a folded two-level
- * setup: the pgd is never bad, and a pmd always exists (as it's folded
- * into the pgd entry)
- */
-#define pgd_none(pgd)          (0)
-#define pgd_bad(pgd)           (0)
-#define pgd_present(pgd)       (1)
-#define pgd_clear(pgdp)                do { } while (0)
-#define set_pgd(pgd,pgdp)      do { } while (0)
-
-/* to find an entry in a page-table-directory */
-#define pgd_index(addr)                ((addr) >> PGDIR_SHIFT)
-
-#define pgd_offset(mm, addr)   ((mm)->pgd+pgd_index(addr))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(addr)     pgd_offset(&init_mm, addr)
-
-/* Find an entry in the second-level page table.. */
-#define pmd_offset(dir, addr)  ((pmd_t *)(dir))
-
-/* Find an entry in the third-level page table.. */
-#define __pte_index(addr)      (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
-static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{
-       const unsigned long mask = L_PTE_EXEC | L_PTE_WRITE | L_PTE_USER;
-       pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
-       return pte;
-}
-
-extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-
-/* Encode and decode a swap entry.
- *
- * We support up to 32GB of swap on 4k machines
- */
-#define __swp_type(x)          (((x).val >> 2) & 0x7f)
-#define __swp_offset(x)                ((x).val >> 9)
-#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) })
-#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(swp)        ((pte_t) { (swp).val })
-
-/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
-/* FIXME: this is not correct */
-#define kern_addr_valid(addr)  (1)
-
-#include <asm-generic/pgtable.h>
-
-/*
- * We provide our own arch_get_unmapped_area to cope with VIPT caches.
- */
-#define HAVE_ARCH_UNMAPPED_AREA
-
-/*
- * remap a physical page `pfn' of size `size' with page protection `prot'
- * into virtual address `from'
- */
-#define io_remap_pfn_range(vma,from,pfn,size,prot) \
-               remap_pfn_range(vma, from, pfn, size, prot)
-
-#define pgtable_cache_init() do { } while (0)
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* CONFIG_MMU */
-
-#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/poll.h b/include/asm-arm/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-arm/posix_types.h b/include/asm-arm/posix_types.h
deleted file mode 100644 (file)
index c37379d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *  linux/include/asm-arm/posix_types.h
- *
- *  Copyright (C) 1996-1998 Russell King.
- *
- * 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.
- *
- *  Changelog:
- *   27-06-1996        RMK     Created
- */
-#ifndef __ARCH_ARM_POSIX_TYPES_H
-#define __ARCH_ARM_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 long          __kernel_ino_t;
-typedef unsigned short         __kernel_mode_t;
-typedef unsigned short         __kernel_nlink_t;
-typedef long                   __kernel_off_t;
-typedef int                    __kernel_pid_t;
-typedef unsigned short         __kernel_ipc_pid_t;
-typedef unsigned short         __kernel_uid_t;
-typedef unsigned short         __kernel_gid_t;
-typedef unsigned int           __kernel_size_t;
-typedef int                    __kernel_ssize_t;
-typedef int                    __kernel_ptrdiff_t;
-typedef long                   __kernel_time_t;
-typedef long                   __kernel_suseconds_t;
-typedef long                   __kernel_clock_t;
-typedef int                    __kernel_timer_t;
-typedef int                    __kernel_clockid_t;
-typedef int                    __kernel_daddr_t;
-typedef char *                 __kernel_caddr_t;
-typedef unsigned short         __kernel_uid16_t;
-typedef unsigned short         __kernel_gid16_t;
-typedef unsigned int           __kernel_uid32_t;
-typedef unsigned int           __kernel_gid32_t;
-
-typedef unsigned short         __kernel_old_uid_t;
-typedef unsigned short         __kernel_old_gid_t;
-typedef unsigned short         __kernel_old_dev_t;
-
-#ifdef __GNUC__
-typedef long long              __kernel_loff_t;
-#endif
-
-typedef struct {
-       int     val[2];
-} __kernel_fsid_t;
-
-#if defined(__KERNEL__)
-
-#undef __FD_SET
-#define __FD_SET(fd, fdsetp) \
-               (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
-
-#undef __FD_CLR
-#define __FD_CLR(fd, fdsetp) \
-               (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
-
-#undef __FD_ISSET
-#define __FD_ISSET(fd, fdsetp) \
-               ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
-
-#undef __FD_ZERO
-#define __FD_ZERO(fdsetp) \
-               (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
-
-#endif
-
-#endif
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
deleted file mode 100644 (file)
index 75ec760..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- *  linux/include/asm-arm/proc-fns.h
- *
- *  Copyright (C) 1997-1999 Russell King
- *  Copyright (C) 2000 Deep Blue Solutions Ltd
- *
- * 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.
- */
-#ifndef __ASM_PROCFNS_H
-#define __ASM_PROCFNS_H
-
-#ifdef __KERNEL__
-
-
-/*
- * Work out if we need multiple CPU support
- */
-#undef MULTI_CPU
-#undef CPU_NAME
-
-/*
- * CPU_NAME - the prefix for CPU related functions
- */
-
-#ifdef CONFIG_CPU_32
-# ifdef CONFIG_CPU_ARM610
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm6
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM7TDMI
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm7tdmi
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM710
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm7
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM720T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm720
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM740T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm740
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM9TDMI
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm9tdmi
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM920T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm920
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM922T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm922
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM925T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm925
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM926T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm926
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM940T
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm940
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM946E
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm946
-#  endif
-# endif
-# ifdef CONFIG_CPU_SA110
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_sa110
-#  endif
-# endif
-# ifdef CONFIG_CPU_SA1100
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_sa1100
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM1020
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm1020
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM1020E
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm1020e
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM1022
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm1022
-#  endif
-# endif
-# ifdef CONFIG_CPU_ARM1026
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_arm1026
-#  endif
-# endif
-# ifdef CONFIG_CPU_XSCALE
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_xscale
-#  endif
-# endif
-# ifdef CONFIG_CPU_XSC3
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_xsc3
-#  endif
-# endif
-# ifdef CONFIG_CPU_FEROCEON
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_feroceon
-#  endif
-# endif
-# ifdef CONFIG_CPU_V6
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_v6
-#  endif
-# endif
-# ifdef CONFIG_CPU_V7
-#  ifdef CPU_NAME
-#   undef  MULTI_CPU
-#   define MULTI_CPU
-#  else
-#   define CPU_NAME cpu_v7
-#  endif
-# endif
-#endif
-
-#ifndef __ASSEMBLY__
-
-#ifndef MULTI_CPU
-#include <asm/cpu-single.h>
-#else
-#include <asm/cpu-multi32.h>
-#endif
-
-#include <asm/memory.h>
-
-#ifdef CONFIG_MMU
-
-#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
-
-#define cpu_get_pgd()  \
-       ({                                              \
-               unsigned long pg;                       \
-               __asm__("mrc    p15, 0, %0, c2, c0, 0"  \
-                        : "=r" (pg) : : "cc");         \
-               pg &= ~0x3fff;                          \
-               (pgd_t *)phys_to_virt(pg);              \
-       })
-
-#endif
-
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-#endif /* __ASM_PROCFNS_H */
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
deleted file mode 100644 (file)
index bd8029e..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *  linux/include/asm-arm/processor.h
- *
- *  Copyright (C) 1995-1999 Russell King
- *
- * 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.
- */
-
-#ifndef __ASM_ARM_PROCESSOR_H
-#define __ASM_ARM_PROCESSOR_H
-
-/*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ __label__ _l; _l: &&_l;})
-
-#ifdef __KERNEL__
-
-#include <asm/ptrace.h>
-#include <asm/types.h>
-
-#ifdef __KERNEL__
-#define STACK_TOP      ((current->personality == PER_LINUX_32BIT) ? \
-                        TASK_SIZE : TASK_SIZE_26)
-#define STACK_TOP_MAX  TASK_SIZE
-#endif
-
-union debug_insn {
-       u32     arm;
-       u16     thumb;
-};
-
-struct debug_entry {
-       u32                     address;
-       union debug_insn        insn;
-};
-
-struct debug_info {
-       int                     nsaved;
-       struct debug_entry      bp[2];
-};
-
-struct thread_struct {
-                                                       /* fault info     */
-       unsigned long           address;
-       unsigned long           trap_no;
-       unsigned long           error_code;
-                                                       /* debugging      */
-       struct debug_info       debug;
-};
-
-#define INIT_THREAD  { }
-
-#ifdef CONFIG_MMU
-#define nommu_start_thread(regs) do { } while (0)
-#else
-#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data
-#endif
-
-#define start_thread(regs,pc,sp)                                       \
-({                                                                     \
-       unsigned long *stack = (unsigned long *)sp;                     \
-       set_fs(USER_DS);                                                \
-       memzero(regs->uregs, sizeof(regs->uregs));                      \
-       if (current->personality & ADDR_LIMIT_32BIT)                    \
-               regs->ARM_cpsr = USR_MODE;                              \
-       else                                                            \
-               regs->ARM_cpsr = USR26_MODE;                            \
-       if (elf_hwcap & HWCAP_THUMB && pc & 1)                          \
-               regs->ARM_cpsr |= PSR_T_BIT;                            \
-       regs->ARM_pc = pc & ~1;         /* pc */                        \
-       regs->ARM_sp = sp;              /* sp */                        \
-       regs->ARM_r2 = stack[2];        /* r2 (envp) */                 \
-       regs->ARM_r1 = stack[1];        /* r1 (argv) */                 \
-       regs->ARM_r0 = stack[0];        /* r0 (argc) */                 \
-       nommu_start_thread(regs);                                       \
-})
-
-/* Forward declaration, a strange C thing */
-struct task_struct;
-
-/* 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)
-
-unsigned long get_wchan(struct task_struct *p);
-
-#define cpu_relax()                    barrier()
-
-/*
- * Create a new kernel thread
- */
-extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
-
-#define task_pt_regs(p) \
-       ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
-
-#define KSTK_EIP(tsk)  task_pt_regs(tsk)->ARM_pc
-#define KSTK_ESP(tsk)  task_pt_regs(tsk)->ARM_sp
-
-/*
- * Prefetching support - only ARMv5.
- */
-#if __LINUX_ARM_ARCH__ >= 5
-
-#define ARCH_HAS_PREFETCH
-static inline void prefetch(const void *ptr)
-{
-       __asm__ __volatile__(
-               "pld\t%0"
-               :
-               : "o" (*(char *)ptr)
-               : "cc");
-}
-
-#define ARCH_HAS_PREFETCHW
-#define prefetchw(ptr) prefetch(ptr)
-
-#define ARCH_HAS_SPINLOCK_PREFETCH
-#define spin_lock_prefetch(x) do { } while (0)
-
-#endif
-
-#endif
-
-#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
deleted file mode 100644 (file)
index 4d3c685..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *  linux/include/asm-arm/procinfo.h
- *
- *  Copyright (C) 1996-1999 Russell King
- *
- * 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.
- */
-#ifndef __ASM_PROCINFO_H
-#define __ASM_PROCINFO_H
-
-#ifdef __KERNEL__
-
-struct cpu_tlb_fns;
-struct cpu_user_fns;
-struct cpu_cache_fns;
-struct processor;
-
-/*
- * Note!  struct processor is always defined if we're
- * using MULTI_CPU, otherwise this entry is unused,
- * but still exists.
- *
- * NOTE! The following structure is defined by assembly
- * language, NOT C code.  For more information, check:
- *  arch/arm/mm/proc-*.S and arch/arm/kernel/head.S
- */
-struct proc_info_list {
-       unsigned int            cpu_val;
-       unsigned int            cpu_mask;
-       unsigned long           __cpu_mm_mmu_flags;     /* used by head.S */
-       unsigned long           __cpu_io_mmu_flags;     /* used by head.S */
-       unsigned long           __cpu_flush;            /* used by head.S */
-       const char              *arch_name;
-       const char              *elf_name;
-       unsigned int            elf_hwcap;
-       const char              *cpu_name;
-       struct processor        *proc;
-       struct cpu_tlb_fns      *tlb;
-       struct cpu_user_fns     *user;
-       struct cpu_cache_fns    *cache;
-};
-
-#else  /* __KERNEL__ */
-#include <asm/elf.h>
-#warning "Please include asm/elf.h instead"
-#endif /* __KERNEL__ */
-#endif
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
deleted file mode 100644 (file)
index 8382b75..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *  linux/include/asm-arm/ptrace.h
- *
- *  Copyright (C) 1996-2003 Russell King
- *
- * 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.
- */
-#ifndef __ASM_ARM_PTRACE_H
-#define __ASM_ARM_PTRACE_H
-
-#include <asm/hwcap.h>
-
-#define PTRACE_GETREGS         12
-#define PTRACE_SETREGS         13
-#define PTRACE_GETFPREGS       14
-#define PTRACE_SETFPREGS       15
-/* PTRACE_ATTACH is 16 */
-/* PTRACE_DETACH is 17 */
-#define PTRACE_GETWMMXREGS     18
-#define PTRACE_SETWMMXREGS     19
-/* 20 is unused */
-#define PTRACE_OLDSETOPTIONS   21
-#define PTRACE_GET_THREAD_AREA 22
-#define PTRACE_SET_SYSCALL     23
-/* PTRACE_SYSCALL is 24 */
-#define PTRACE_GETCRUNCHREGS   25
-#define PTRACE_SETCRUNCHREGS   26
-
-/*
- * PSR bits
- */
-#define USR26_MODE     0x00000000
-#define FIQ26_MODE     0x00000001
-#define IRQ26_MODE     0x00000002
-#define SVC26_MODE     0x00000003
-#define USR_MODE       0x00000010
-#define FIQ_MODE       0x00000011
-#define IRQ_MODE       0x00000012
-#define SVC_MODE       0x00000013
-#define ABT_MODE       0x00000017
-#define UND_MODE       0x0000001b
-#define SYSTEM_MODE    0x0000001f
-#define MODE32_BIT     0x00000010
-#define MODE_MASK      0x0000001f
-#define PSR_T_BIT      0x00000020
-#define PSR_F_BIT      0x00000040
-#define PSR_I_BIT      0x00000080
-#define PSR_A_BIT      0x00000100
-#define PSR_J_BIT      0x01000000
-#define PSR_Q_BIT      0x08000000
-#define PSR_V_BIT      0x10000000
-#define PSR_C_BIT      0x20000000
-#define PSR_Z_BIT      0x40000000
-#define PSR_N_BIT      0x80000000
-#define PCMASK         0
-
-/*
- * Groups of PSR bits
- */
-#define PSR_f          0xff000000      /* Flags                */
-#define PSR_s          0x00ff0000      /* Status               */
-#define PSR_x          0x0000ff00      /* Extension            */
-#define PSR_c          0x000000ff      /* Control              */
-
-#ifndef __ASSEMBLY__
-
-/*
- * This struct defines the way the registers are stored on the
- * stack during a system call.  Note that sizeof(struct pt_regs)
- * has to be a multiple of 8.
- */
-struct pt_regs {
-       long uregs[18];
-};
-
-#define ARM_cpsr       uregs[16]
-#define ARM_pc         uregs[15]
-#define ARM_lr         uregs[14]
-#define ARM_sp         uregs[13]
-#define ARM_ip         uregs[12]
-#define ARM_fp         uregs[11]
-#define ARM_r10                uregs[10]
-#define ARM_r9         uregs[9]
-#define ARM_r8         uregs[8]
-#define ARM_r7         uregs[7]
-#define ARM_r6         uregs[6]
-#define ARM_r5         uregs[5]
-#define ARM_r4         uregs[4]
-#define ARM_r3         uregs[3]
-#define ARM_r2         uregs[2]
-#define ARM_r1         uregs[1]
-#define ARM_r0         uregs[0]
-#define ARM_ORIG_r0    uregs[17]
-
-#ifdef __KERNEL__
-
-#define user_mode(regs)        \
-       (((regs)->ARM_cpsr & 0xf) == 0)
-
-#ifdef CONFIG_ARM_THUMB
-#define thumb_mode(regs) \
-       (((regs)->ARM_cpsr & PSR_T_BIT))
-#else
-#define thumb_mode(regs) (0)
-#endif
-
-#define isa_mode(regs) \
-       ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
-        (((regs)->ARM_cpsr & PSR_T_BIT) >> 5))
-
-#define processor_mode(regs) \
-       ((regs)->ARM_cpsr & MODE_MASK)
-
-#define interrupts_enabled(regs) \
-       (!((regs)->ARM_cpsr & PSR_I_BIT))
-
-#define fast_interrupts_enabled(regs) \
-       (!((regs)->ARM_cpsr & PSR_F_BIT))
-
-/* Are the current registers suitable for user mode?
- * (used to maintain security in signal handlers)
- */
-static inline int valid_user_regs(struct pt_regs *regs)
-{
-       if (user_mode(regs) && (regs->ARM_cpsr & PSR_I_BIT) == 0) {
-               regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
-               return 1;
-       }
-
-       /*
-        * Force CPSR to something logical...
-        */
-       regs->ARM_cpsr &= PSR_f | PSR_s | (PSR_x & ~PSR_A_BIT) | PSR_T_BIT | MODE32_BIT;
-       if (!(elf_hwcap & HWCAP_26BIT))
-               regs->ARM_cpsr |= USR_MODE;
-
-       return 0;
-}
-
-#define pc_pointer(v) \
-       ((v) & ~PCMASK)
-
-#define instruction_pointer(regs) \
-       (pc_pointer((regs)->ARM_pc))
-
-#ifdef CONFIG_SMP
-extern unsigned long profile_pc(struct pt_regs *regs);
-#else
-#define profile_pc(regs) instruction_pointer(regs)
-#endif
-
-#define predicate(x)           ((x) & 0xf0000000)
-#define PREDICATE_ALWAYS       0xe0000000
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASSEMBLY__ */
-
-#endif
-
diff --git a/include/asm-arm/resource.h b/include/asm-arm/resource.h
deleted file mode 100644 (file)
index 734b581..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ARM_RESOURCE_H
-#define _ARM_RESOURCE_H
-
-#include <asm-generic/resource.h>
-
-#endif
diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h
deleted file mode 100644 (file)
index ca0a37d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ASMARM_SCATTERLIST_H
-#define _ASMARM_SCATTERLIST_H
-
-#include <asm/memory.h>
-#include <asm/types.h>
-
-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
-       unsigned long   sg_magic;
-#endif
-       unsigned long   page_link;
-       unsigned int    offset;         /* buffer offset                 */
-       dma_addr_t      dma_address;    /* dma address                   */
-       unsigned int    length;         /* length                        */
-};
-
-/*
- * These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg)      ((sg)->dma_address)
-#define sg_dma_len(sg)          ((sg)->length)
-
-#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm/sections.h b/include/asm-arm/sections.h
deleted file mode 100644 (file)
index 2b8c516..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/sections.h>
diff --git a/include/asm-arm/segment.h b/include/asm-arm/segment.h
deleted file mode 100644 (file)
index 9e24c21..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_ARM_SEGMENT_H
-#define __ASM_ARM_SEGMENT_H
-
-#define __KERNEL_CS   0x0
-#define __KERNEL_DS   0x0
-
-#define __USER_CS     0x1
-#define __USER_DS     0x1
-
-#endif /* __ASM_ARM_SEGMENT_H */
-
diff --git a/include/asm-arm/sembuf.h b/include/asm-arm/sembuf.h
deleted file mode 100644 (file)
index 1c02839..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ASMARM_SEMBUF_H
-#define _ASMARM_SEMBUF_H
-
-/* 
- * The semid64_ds structure for arm architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct semid64_ds {
-       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
-       __kernel_time_t sem_otime;              /* last semop time */
-       unsigned long   __unused1;
-       __kernel_time_t sem_ctime;              /* last change time */
-       unsigned long   __unused2;
-       unsigned long   sem_nsems;              /* no. of semaphores in array */
-       unsigned long   __unused3;
-       unsigned long   __unused4;
-};
-
-#endif /* _ASMARM_SEMBUF_H */
diff --git a/include/asm-arm/serial.h b/include/asm-arm/serial.h
deleted file mode 100644 (file)
index 015b262..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- *  linux/include/asm-arm/serial.h
- *
- *  Copyright (C) 1996 Russell King.
- *
- * 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.
- *
- *  Changelog:
- *   15-10-1996        RMK     Created
- */
-
-#ifndef __ASM_SERIAL_H
-#define __ASM_SERIAL_H
-
-#define BASE_BAUD      (1843200 / 16)
-
-#endif
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
deleted file mode 100644 (file)
index 7bbf105..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *  linux/include/asm/setup.h
- *
- *  Copyright (C) 1997-1999 Russell King
- *
- * 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.
- *
- *  Structure passed to kernel to tell it about the
- *  hardware it's running on.  See Documentation/arm/Setup
- *  for more info.
- */
-#ifndef __ASMARM_SETUP_H
-#define __ASMARM_SETUP_H
-
-#include <asm/types.h>
-
-#define COMMAND_LINE_SIZE 1024
-
-/* The list ends with an ATAG_NONE node. */
-#define ATAG_NONE      0x00000000
-
-struct tag_header {
-       __u32 size;
-       __u32 tag;
-};
-
-/* The list must start with an ATAG_CORE node */
-#define ATAG_CORE      0x54410001
-
-struct tag_core {
-       __u32 flags;            /* bit 0 = read-only */
-       __u32 pagesize;
-       __u32 rootdev;
-};
-
-/* it is allowed to have multiple ATAG_MEM nodes */
-#define ATAG_MEM       0x54410002
-
-struct tag_mem32 {
-       __u32   size;
-       __u32   start;  /* physical start address */
-};
-
-/* VGA text type displays */
-#define ATAG_VIDEOTEXT 0x54410003
-
-struct tag_videotext {
-       __u8            x;
-       __u8            y;
-       __u16           video_page;
-       __u8            video_mode;
-       __u8            video_cols;
-       __u16           video_ega_bx;
-       __u8            video_lines;
-       __u8            video_isvga;
-       __u16           video_points;
-};
-
-/* describes how the ramdisk will be used in kernel */
-#define ATAG_RAMDISK   0x54410004
-
-struct tag_ramdisk {
-       __u32 flags;    /* bit 0 = load, bit 1 = prompt */
-       __u32 size;     /* decompressed ramdisk size in _kilo_ bytes */
-       __u32 start;    /* starting block of floppy-based RAM disk image */
-};
-
-/* describes where the compressed ramdisk image lives (virtual address) */
-/*
- * this one accidentally used virtual addresses - as such,
- * it's deprecated.
- */
-#define ATAG_INITRD    0x54410005
-
-/* describes where the compressed ramdisk image lives (physical address) */
-#define ATAG_INITRD2   0x54420005
-
-struct tag_initrd {
-       __u32 start;    /* physical start address */
-       __u32 size;     /* size of compressed ramdisk image in bytes */
-};
-
-/* board serial number. "64 bits should be enough for everybody" */
-#define ATAG_SERIAL    0x54410006
-
-struct tag_serialnr {
-       __u32 low;
-       __u32 high;
-};
-
-/* board revision */
-#define ATAG_REVISION  0x54410007
-
-struct tag_revision {
-       __u32 rev;
-};
-
-/* initial values for vesafb-type framebuffers. see struct screen_info
- * in include/linux/tty.h
- */
-#define ATAG_VIDEOLFB  0x54410008
-
-struct tag_videolfb {
-       __u16           lfb_width;
-       __u16           lfb_height;
-       __u16           lfb_depth;
-       __u16           lfb_linelength;
-       __u32           lfb_base;
-       __u32           lfb_size;
-       __u8            red_size;
-       __u8            red_pos;
-       __u8            green_size;
-       __u8            green_pos;
-       __u8            blue_size;
-       __u8            blue_pos;
-       __u8            rsvd_size;
-       __u8            rsvd_pos;
-};
-
-/* command line: \0 terminated string */
-#define ATAG_CMDLINE   0x54410009
-
-struct tag_cmdline {
-       char    cmdline[1];     /* this is the minimum size */
-};
-
-/* acorn RiscPC specific information */
-#define ATAG_ACORN     0x41000101
-
-struct tag_acorn {
-       __u32 memc_control_reg;
-       __u32 vram_pages;
-       __u8 sounddefault;
-       __u8 adfsdrives;
-};
-
-/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
-#define ATAG_MEMCLK    0x41000402
-
-struct tag_memclk {
-       __u32 fmemclk;
-};
-
-struct tag {
-       struct tag_header hdr;
-       union {
-               struct tag_core         core;
-               struct tag_mem32        mem;
-               struct tag_videotext    videotext;
-               struct tag_ramdisk      ramdisk;
-               struct tag_initrd       initrd;
-               struct tag_serialnr     serialnr;
-               struct tag_revision     revision;
-               struct tag_videolfb     videolfb;
-               struct tag_cmdline      cmdline;
-
-               /*
-                * Acorn specific
-                */
-               struct tag_acorn        acorn;
-
-               /*
-                * DC21285 specific
-                */
-               struct tag_memclk       memclk;
-       } u;
-};
-
-struct tagtable {
-       __u32 tag;
-       int (*parse)(const struct tag *);
-};
-
-#define tag_member_present(tag,member)                         \
-       ((unsigned long)(&((struct tag *)0L)->member + 1)       \
-               <= (tag)->hdr.size * 4)
-
-#define tag_next(t)    ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
-#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
-
-#define for_each_tag(t,base)           \
-       for (t = base; t->hdr.size; t = tag_next(t))
-
-#ifdef __KERNEL__
-
-#define __tag __used __attribute__((__section__(".taglist.init")))
-#define __tagtable(tag, fn) \
-static struct tagtable __tagtable_##fn __tag = { tag, fn }
-
-/*
- * Memory map description
- */
-#ifdef CONFIG_ARCH_LH7A40X
-# define NR_BANKS 16
-#else
-# define NR_BANKS 8
-#endif
-
-struct membank {
-       unsigned long start;
-       unsigned long size;
-       int           node;
-};
-
-struct meminfo {
-       int nr_banks;
-       struct membank bank[NR_BANKS];
-};
-
-/*
- * Early command line parameters.
- */
-struct early_params {
-       const char *arg;
-       void (*fn)(char **p);
-};
-
-#define __early_param(name,fn)                                 \
-static struct early_params __early_##fn __used                 \
-__attribute__((__section__(".early_param.init"))) = { name, fn }
-
-#endif  /*  __KERNEL__  */
-
-#endif
diff --git a/include/asm-arm/shmbuf.h b/include/asm-arm/shmbuf.h
deleted file mode 100644 (file)
index 2e5c67b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ASMARM_SHMBUF_H
-#define _ASMARM_SHMBUF_H
-
-/* 
- * The shmid64_ds structure for arm architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-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 */
-       unsigned long           __unused1;
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       unsigned long           __unused2;
-       __kernel_time_t         shm_ctime;      /* last change time */
-       unsigned long           __unused3;
-       __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           __unused4;
-       unsigned long           __unused5;
-};
-
-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 /* _ASMARM_SHMBUF_H */
diff --git a/include/asm-arm/shmparam.h b/include/asm-arm/shmparam.h
deleted file mode 100644 (file)
index a5223b3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASMARM_SHMPARAM_H
-#define _ASMARM_SHMPARAM_H
-
-/*
- * This should be the size of the virtually indexed cache/ways,
- * or page size, whichever is greater since the cache aliases
- * every size/ways bytes.
- */
-#define        SHMLBA  (4 * PAGE_SIZE)          /* attach addr a multiple of this */
-
-/*
- * Enforce SHMLBA in shmat
- */
-#define __ARCH_FORCE_SHMLBA
-
-#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm/sigcontext.h b/include/asm-arm/sigcontext.h
deleted file mode 100644 (file)
index fc0b80b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _ASMARM_SIGCONTEXT_H
-#define _ASMARM_SIGCONTEXT_H
-
-/*
- * Signal context structure - contains all info to do with the state
- * before the signal handler was invoked.  Note: only add new entries
- * to the end of the structure.
- */
-struct sigcontext {
-       unsigned long trap_no;
-       unsigned long error_code;
-       unsigned long oldmask;
-       unsigned long arm_r0;
-       unsigned long arm_r1;
-       unsigned long arm_r2;
-       unsigned long arm_r3;
-       unsigned long arm_r4;
-       unsigned long arm_r5;
-       unsigned long arm_r6;
-       unsigned long arm_r7;
-       unsigned long arm_r8;
-       unsigned long arm_r9;
-       unsigned long arm_r10;
-       unsigned long arm_fp;
-       unsigned long arm_ip;
-       unsigned long arm_sp;
-       unsigned long arm_lr;
-       unsigned long arm_pc;
-       unsigned long arm_cpsr;
-       unsigned long fault_address;
-};
-
-
-#endif
diff --git a/include/asm-arm/siginfo.h b/include/asm-arm/siginfo.h
deleted file mode 100644 (file)
index 5e21852..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASMARM_SIGINFO_H
-#define _ASMARM_SIGINFO_H
-
-#include <asm-generic/siginfo.h>
-
-#endif
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
deleted file mode 100644 (file)
index d0fb487..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef _ASMARM_SIGNAL_H
-#define _ASMARM_SIGNAL_H
-
-#include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-
-#ifdef __KERNEL__
-/* 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      32
-#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__ */
-
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGBUS          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGUSR1                10
-#define SIGSEGV                11
-#define SIGUSR2                12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGSTKFLT      16
-#define SIGCHLD                17
-#define SIGCONT                18
-#define SIGSTOP                19
-#define SIGTSTP                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGURG         23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGIO          29
-#define SIGPOLL                SIGIO
-/*
-#define SIGLOST                29
-*/
-#define SIGPWR         30
-#define SIGSYS         31
-#define        SIGUNUSED       31
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       32
-#define SIGRTMAX       _NSIG
-
-#define SIGSWI         32
-
-/*
- * SA_FLAGS values:
- *
- * SA_NOCLDSTOP                flag to turn off SIGCHLD when children stop.
- * SA_NOCLDWAIT                flag on SIGCHLD to inhibit zombies.
- * SA_SIGINFO          deliver the signal with SIGINFO structs
- * SA_THIRTYTWO                delivers the signal in 32-bit mode, even if the task 
- *                     is running in 26-bit.
- * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
- * SA_RESTART          flag to get restarting signals (which were the default long ago)
- * SA_NODEFER          prevents the current signal from being masked in the handler.
- * SA_RESETHAND                clears the handler when the signal is delivered.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-#define SA_NOCLDSTOP   0x00000001
-#define SA_NOCLDWAIT   0x00000002
-#define SA_SIGINFO     0x00000004
-#define SA_THIRTYTWO   0x02000000
-#define SA_RESTORER    0x04000000
-#define SA_ONSTACK     0x08000000
-#define SA_RESTART     0x10000000
-#define SA_NODEFER     0x40000000
-#define SA_RESETHAND   0x80000000
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-
-/* 
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
-
-#include <asm-generic/signal.h>
-
-#ifdef __KERNEL__
-struct old_sigaction {
-       __sighandler_t sa_handler;
-       old_sigset_t sa_mask;
-       unsigned long sa_flags;
-       __sigrestore_t sa_restorer;
-};
-
-struct sigaction {
-       __sighandler_t sa_handler;
-       unsigned long sa_flags;
-       __sigrestore_t sa_restorer;
-       sigset_t sa_mask;               /* mask last for extensibility */
-};
-
-struct k_sigaction {
-       struct sigaction sa;
-};
-
-#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;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-#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;
-
-#ifdef __KERNEL__
-#include <asm/sigcontext.h>
-#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#endif
-
-#endif
diff --git a/include/asm-arm/sizes.h b/include/asm-arm/sizes.h
deleted file mode 100644 (file)
index 503843d..0000000
+++ /dev/null
@@ -1,56 +0,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-/* DO NOT EDIT!! - this file automatically generated
- *                 from .s file by awk -f s2h.awk
- */
-/*  Size definitions
- *  Copyright (C) ARM Limited 1998. All rights reserved.
- */
-
-#ifndef __sizes_h
-#define __sizes_h                       1
-
-/* handy sizes */
-#define SZ_16                          0x00000010
-#define SZ_256                         0x00000100
-#define SZ_512                         0x00000200
-
-#define SZ_1K                           0x00000400
-#define SZ_4K                           0x00001000
-#define SZ_8K                           0x00002000
-#define SZ_16K                          0x00004000
-#define SZ_64K                          0x00010000
-#define SZ_128K                         0x00020000
-#define SZ_256K                         0x00040000
-#define SZ_512K                         0x00080000
-
-#define SZ_1M                           0x00100000
-#define SZ_2M                           0x00200000
-#define SZ_4M                           0x00400000
-#define SZ_8M                           0x00800000
-#define SZ_16M                          0x01000000
-#define SZ_32M                          0x02000000
-#define SZ_64M                          0x04000000
-#define SZ_128M                         0x08000000
-#define SZ_256M                         0x10000000
-#define SZ_512M                         0x20000000
-
-#define SZ_1G                           0x40000000
-#define SZ_2G                           0x80000000
-
-#endif
-
-/*         END */
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
deleted file mode 100644 (file)
index 7fffa24..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *  linux/include/asm-arm/smp.h
- *
- *  Copyright (C) 2004-2005 ARM Ltd.
- *
- * 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.
- */
-#ifndef __ASM_ARM_SMP_H
-#define __ASM_ARM_SMP_H
-
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <linux/thread_info.h>
-
-#include <asm/arch/smp.h>
-
-#ifndef CONFIG_SMP
-# error "<asm-arm/smp.h> included in non-SMP build"
-#endif
-
-#define raw_smp_processor_id() (current_thread_info()->cpu)
-
-/*
- * at the moment, there's not a big penalty for changing CPUs
- * (the >big< penalty is running SMP in the first place)
- */
-#define PROC_CHANGE_PENALTY            15
-
-struct seq_file;
-
-/*
- * generate IPI list text
- */
-extern void show_ipi_list(struct seq_file *p);
-
-/*
- * Called from assembly code, this handles an IPI.
- */
-asmlinkage void do_IPI(struct pt_regs *regs);
-
-/*
- * Setup the SMP cpu_possible_map
- */
-extern void smp_init_cpus(void);
-
-/*
- * Move global data into per-processor storage.
- */
-extern void smp_store_cpu_info(unsigned int cpuid);
-
-/*
- * Raise an IPI cross call on CPUs in callmap.
- */
-extern void smp_cross_call(cpumask_t callmap);
-
-/*
- * Broadcast a timer interrupt to the other CPUs.
- */
-extern void smp_send_timer(void);
-
-/*
- * Broadcast a clock event to other CPUs.
- */
-extern void smp_timer_broadcast(cpumask_t mask);
-
-/*
- * Boot a secondary CPU, and assign it the specified idle task.
- * This also gives us the initial stack to use for this CPU.
- */
-extern int boot_secondary(unsigned int cpu, struct task_struct *);
-
-/*
- * Called from platform specific assembly code, this is the
- * secondary CPU entry point.
- */
-asmlinkage void secondary_start_kernel(void);
-
-/*
- * Perform platform specific initialisation of the specified CPU.
- */
-extern void platform_secondary_init(unsigned int cpu);
-
-/*
- * Initial data for bringing up a secondary CPU.
- */
-struct secondary_data {
-       unsigned long pgdir;
-       void *stack;
-};
-extern struct secondary_data secondary_data;
-
-extern int __cpu_disable(void);
-extern int mach_cpu_disable(unsigned int cpu);
-
-extern void __cpu_die(unsigned int cpu);
-extern void cpu_die(void);
-
-extern void platform_cpu_die(unsigned int cpu);
-extern int platform_cpu_kill(unsigned int cpu);
-extern void platform_cpu_enable(unsigned int cpu);
-
-extern void arch_send_call_function_single_ipi(int cpu);
-extern void arch_send_call_function_ipi(cpumask_t mask);
-
-/*
- * Local timer interrupt handling function (can be IPI'ed).
- */
-extern void local_timer_interrupt(void);
-
-#ifdef CONFIG_LOCAL_TIMERS
-
-/*
- * Stop a local timer interrupt.
- */
-extern void local_timer_stop(unsigned int cpu);
-
-/*
- * Platform provides this to acknowledge a local timer IRQ
- */
-extern int local_timer_ack(void);
-
-#else
-
-static inline void local_timer_stop(unsigned int cpu)
-{
-}
-
-#endif
-
-/*
- * Setup a local timer interrupt for a CPU.
- */
-extern void local_timer_setup(unsigned int cpu);
-
-/*
- * show local interrupt info
- */
-extern void show_local_irqs(struct seq_file *);
-
-/*
- * Called from assembly, this is the local timer IRQ handler
- */
-asmlinkage void do_local_timer(struct pt_regs *);
-
-#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h
deleted file mode 100644 (file)
index 6817be9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef _ASMARM_SOCKET_H
-#define _ASMARM_SOCKET_H
-
-#include <asm/sockios.h>
-
-/* For setsockopt(2) */
-#define SOL_SOCKET     1
-
-#define SO_DEBUG       1
-#define SO_REUSEADDR   2
-#define SO_TYPE                3
-#define SO_ERROR       4
-#define SO_DONTROUTE   5
-#define SO_BROADCAST   6
-#define SO_SNDBUF      7
-#define SO_RCVBUF      8
-#define SO_SNDBUFFORCE 32
-#define SO_RCVBUFFORCE 33
-#define SO_KEEPALIVE   9
-#define SO_OOBINLINE   10
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_LINGER      13
-#define SO_BSDCOMPAT   14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED    16
-#define SO_PEERCRED    17
-#define SO_RCVLOWAT    18
-#define SO_SNDLOWAT    19
-#define SO_RCVTIMEO    20
-#define SO_SNDTIMEO    21
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
-#define SO_SECURITY_ENCRYPTION_NETWORK         24
-
-#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_ACCEPTCONN          30
-
-#define SO_PEERSEC             31
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-#define SO_MARK                        36
-
-#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm/sockios.h b/include/asm-arm/sockios.h
deleted file mode 100644 (file)
index a2588a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ARCH_ARM_SOCKIOS_H
-#define __ARCH_ARM_SOCKIOS_H
-
-/* Socket-level I/O control calls. */
-#define FIOSETOWN      0x8901
-#define SIOCSPGRP      0x8902
-#define FIOGETOWN      0x8903
-#define SIOCGPGRP      0x8904
-#define SIOCATMARK     0x8905
-#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
-
-#endif
diff --git a/include/asm-arm/sparsemem.h b/include/asm-arm/sparsemem.h
deleted file mode 100644 (file)
index 2771581..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef ASMARM_SPARSEMEM_H
-#define ASMARM_SPARSEMEM_H
-
-#include <asm/memory.h>
-
-#define MAX_PHYSADDR_BITS      32
-#define MAX_PHYSMEM_BITS       32
-#define SECTION_SIZE_BITS      NODE_MEM_SIZE_BITS
-
-#endif
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
deleted file mode 100644 (file)
index 2b41ebb..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-#ifndef __ASM_SPINLOCK_H
-#define __ASM_SPINLOCK_H
-
-#if __LINUX_ARM_ARCH__ < 6
-#error SMP not supported on pre-ARMv6 CPUs
-#endif
-
-/*
- * ARMv6 Spin-locking.
- *
- * We exclusively read the old value.  If it is zero, we may have
- * won the lock, so we try exclusively storing it.  A memory barrier
- * is required after we get a lock, and before we release it, because
- * V6 CPUs are assumed to have weakly ordered memory.
- *
- * Unlocked value: 0
- * Locked value: 1
- */
-
-#define __raw_spin_is_locked(x)                ((x)->lock != 0)
-#define __raw_spin_unlock_wait(lock) \
-       do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
-
-#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
-
-static inline void __raw_spin_lock(raw_spinlock_t *lock)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%1]\n"
-"      teq     %0, #0\n"
-#ifdef CONFIG_CPU_32v6K
-"      wfene\n"
-#endif
-"      strexeq %0, %2, [%1]\n"
-"      teqeq   %0, #0\n"
-"      bne     1b"
-       : "=&r" (tmp)
-       : "r" (&lock->lock), "r" (1)
-       : "cc");
-
-       smp_mb();
-}
-
-static inline int __raw_spin_trylock(raw_spinlock_t *lock)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__(
-"      ldrex   %0, [%1]\n"
-"      teq     %0, #0\n"
-"      strexeq %0, %2, [%1]"
-       : "=&r" (tmp)
-       : "r" (&lock->lock), "r" (1)
-       : "cc");
-
-       if (tmp == 0) {
-               smp_mb();
-               return 1;
-       } else {
-               return 0;
-       }
-}
-
-static inline void __raw_spin_unlock(raw_spinlock_t *lock)
-{
-       smp_mb();
-
-       __asm__ __volatile__(
-"      str     %1, [%0]\n"
-#ifdef CONFIG_CPU_32v6K
-"      mcr     p15, 0, %1, c7, c10, 4\n" /* DSB */
-"      sev"
-#endif
-       :
-       : "r" (&lock->lock), "r" (0)
-       : "cc");
-}
-
-/*
- * RWLOCKS
- *
- *
- * Write locks are easy - we just set bit 31.  When unlocking, we can
- * just write zero since the lock is exclusively held.
- */
-
-static inline void __raw_write_lock(raw_rwlock_t *rw)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%1]\n"
-"      teq     %0, #0\n"
-#ifdef CONFIG_CPU_32v6K
-"      wfene\n"
-#endif
-"      strexeq %0, %2, [%1]\n"
-"      teq     %0, #0\n"
-"      bne     1b"
-       : "=&r" (tmp)
-       : "r" (&rw->lock), "r" (0x80000000)
-       : "cc");
-
-       smp_mb();
-}
-
-static inline int __raw_write_trylock(raw_rwlock_t *rw)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%1]\n"
-"      teq     %0, #0\n"
-"      strexeq %0, %2, [%1]"
-       : "=&r" (tmp)
-       : "r" (&rw->lock), "r" (0x80000000)
-       : "cc");
-
-       if (tmp == 0) {
-               smp_mb();
-               return 1;
-       } else {
-               return 0;
-       }
-}
-
-static inline void __raw_write_unlock(raw_rwlock_t *rw)
-{
-       smp_mb();
-
-       __asm__ __volatile__(
-       "str    %1, [%0]\n"
-#ifdef CONFIG_CPU_32v6K
-"      mcr     p15, 0, %1, c7, c10, 4\n" /* DSB */
-"      sev\n"
-#endif
-       :
-       : "r" (&rw->lock), "r" (0)
-       : "cc");
-}
-
-/* write_can_lock - would write_trylock() succeed? */
-#define __raw_write_can_lock(x)                ((x)->lock == 0)
-
-/*
- * Read locks are a bit more hairy:
- *  - Exclusively load the lock value.
- *  - Increment it.
- *  - Store new lock value if positive, and we still own this location.
- *    If the value is negative, we've already failed.
- *  - If we failed to store the value, we want a negative result.
- *  - If we failed, try again.
- * Unlocking is similarly hairy.  We may have multiple read locks
- * currently active.  However, we know we won't have any write
- * locks.
- */
-static inline void __raw_read_lock(raw_rwlock_t *rw)
-{
-       unsigned long tmp, tmp2;
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%2]\n"
-"      adds    %0, %0, #1\n"
-"      strexpl %1, %0, [%2]\n"
-#ifdef CONFIG_CPU_32v6K
-"      wfemi\n"
-#endif
-"      rsbpls  %0, %1, #0\n"
-"      bmi     1b"
-       : "=&r" (tmp), "=&r" (tmp2)
-       : "r" (&rw->lock)
-       : "cc");
-
-       smp_mb();
-}
-
-static inline void __raw_read_unlock(raw_rwlock_t *rw)
-{
-       unsigned long tmp, tmp2;
-
-       smp_mb();
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%2]\n"
-"      sub     %0, %0, #1\n"
-"      strex   %1, %0, [%2]\n"
-"      teq     %1, #0\n"
-"      bne     1b"
-#ifdef CONFIG_CPU_32v6K
-"\n    cmp     %0, #0\n"
-"      mcreq   p15, 0, %0, c7, c10, 4\n"
-"      seveq"
-#endif
-       : "=&r" (tmp), "=&r" (tmp2)
-       : "r" (&rw->lock)
-       : "cc");
-}
-
-static inline int __raw_read_trylock(raw_rwlock_t *rw)
-{
-       unsigned long tmp, tmp2 = 1;
-
-       __asm__ __volatile__(
-"1:    ldrex   %0, [%2]\n"
-"      adds    %0, %0, #1\n"
-"      strexpl %1, %0, [%2]\n"
-       : "=&r" (tmp), "+r" (tmp2)
-       : "r" (&rw->lock)
-       : "cc");
-
-       smp_mb();
-       return tmp2 == 0;
-}
-
-/* read_can_lock - would read_trylock() succeed? */
-#define __raw_read_can_lock(x)         ((x)->lock < 0x80000000)
-
-#define _raw_spin_relax(lock)  cpu_relax()
-#define _raw_read_relax(lock)  cpu_relax()
-#define _raw_write_relax(lock) cpu_relax()
-
-#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/spinlock_types.h b/include/asm-arm/spinlock_types.h
deleted file mode 100644 (file)
index 43e83f6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SPINLOCK_TYPES_H
-#define __ASM_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-arm/stat.h b/include/asm-arm/stat.h
deleted file mode 100644 (file)
index 42c0c13..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef _ASMARM_STAT_H
-#define _ASMARM_STAT_H
-
-struct __old_kernel_stat {
-       unsigned short st_dev;
-       unsigned short st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned short st_rdev;
-       unsigned long  st_size;
-       unsigned long  st_atime;
-       unsigned long  st_mtime;
-       unsigned long  st_ctime;
-};
-
-#define STAT_HAVE_NSEC 
-
-struct stat {
-#if defined(__ARMEB__)
-       unsigned short st_dev;
-       unsigned short __pad1;
-#else
-       unsigned long  st_dev;
-#endif
-       unsigned long  st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-#if defined(__ARMEB__)
-       unsigned short st_rdev;
-       unsigned short __pad2;
-#else
-       unsigned long  st_rdev;
-#endif
-       unsigned long  st_size;
-       unsigned long  st_blksize;
-       unsigned long  st_blocks;
-       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;
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- * Note: The kernel zero's the padded region because glibc might read them
- * in the hope that the kernel has stretched to using larger sizes.
- */
-struct stat64 {
-       unsigned long long      st_dev;
-       unsigned char   __pad0[4];
-
-#define STAT64_HAS_BROKEN_ST_INO       1
-       unsigned long   __st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-
-       unsigned long   st_uid;
-       unsigned long   st_gid;
-
-       unsigned long long      st_rdev;
-       unsigned char   __pad3[4];
-
-       long long       st_size;
-       unsigned long   st_blksize;
-       unsigned long long st_blocks;   /* Number 512-byte blocks allocated. */
-
-       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;
-
-       unsigned long long      st_ino;
-};
-
-#endif
diff --git a/include/asm-arm/statfs.h b/include/asm-arm/statfs.h
deleted file mode 100644 (file)
index a02e6a8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ASMARM_STATFS_H
-#define _ASMARM_STATFS_H
-
-#ifndef __KERNEL_STRICT_NAMES
-# include <linux/types.h>
-typedef __kernel_fsid_t        fsid_t;
-#endif
-
-struct statfs {
-       __u32 f_type;
-       __u32 f_bsize;
-       __u32 f_blocks;
-       __u32 f_bfree;
-       __u32 f_bavail;
-       __u32 f_files;
-       __u32 f_ffree;
-       __kernel_fsid_t f_fsid;
-       __u32 f_namelen;
-       __u32 f_frsize;
-       __u32 f_spare[5];
-};
-
-/*
- * With EABI there is 4 bytes of padding added to this structure.
- * Let's pack it so the padding goes away to simplify dual ABI support.
- * Note that user space does NOT have to pack this structure.
- */
-struct statfs64 {
-       __u32 f_type;
-       __u32 f_bsize;
-       __u64 f_blocks;
-       __u64 f_bfree;
-       __u64 f_bavail;
-       __u64 f_files;
-       __u64 f_ffree;
-       __kernel_fsid_t f_fsid;
-       __u32 f_namelen;
-       __u32 f_frsize;
-       __u32 f_spare[5];
-} __attribute__ ((packed,aligned(4)));
-
-#endif
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
deleted file mode 100644 (file)
index e50c4a3..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef __ASM_ARM_STRING_H
-#define __ASM_ARM_STRING_H
-
-/*
- * We don't do inline string functions, since the
- * optimised inline asm versions are not small.
- */
-
-#define __HAVE_ARCH_STRRCHR
-extern char * strrchr(const char * s, int c);
-
-#define __HAVE_ARCH_STRCHR
-extern char * strchr(const char * s, int c);
-
-#define __HAVE_ARCH_MEMCPY
-extern void * memcpy(void *, const void *, __kernel_size_t);
-
-#define __HAVE_ARCH_MEMMOVE
-extern void * memmove(void *, const void *, __kernel_size_t);
-
-#define __HAVE_ARCH_MEMCHR
-extern void * memchr(const void *, int, __kernel_size_t);
-
-#define __HAVE_ARCH_MEMZERO
-#define __HAVE_ARCH_MEMSET
-extern void * memset(void *, int, __kernel_size_t);
-
-extern void __memzero(void *ptr, __kernel_size_t n);
-
-#define memset(p,v,n)                                                  \
-       ({                                                              \
-               void *__p = (p); size_t __n = n;                        \
-               if ((__n) != 0) {                                       \
-                       if (__builtin_constant_p((v)) && (v) == 0)      \
-                               __memzero((__p),(__n));                 \
-                       else                                            \
-                               memset((__p),(v),(__n));                \
-               }                                                       \
-               (__p);                                                  \
-       })
-
-#define memzero(p,n)                                                   \
-       ({                                                              \
-               void *__p = (p); size_t __n = n;                        \
-               if ((__n) != 0)                                         \
-                       __memzero((__p),(__n));                         \
-               (__p);                                                  \
-        })
-
-#endif
diff --git a/include/asm-arm/suspend.h b/include/asm-arm/suspend.h
deleted file mode 100644 (file)
index cf0d0bd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef _ASMARM_SUSPEND_H
-#define _ASMARM_SUSPEND_H
-
-#endif
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
deleted file mode 100644 (file)
index 514af79..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-#ifndef __ASM_ARM_SYSTEM_H
-#define __ASM_ARM_SYSTEM_H
-
-#ifdef __KERNEL__
-
-#include <asm/memory.h>
-
-#define CPU_ARCH_UNKNOWN       0
-#define CPU_ARCH_ARMv3         1
-#define CPU_ARCH_ARMv4         2
-#define CPU_ARCH_ARMv4T                3
-#define CPU_ARCH_ARMv5         4
-#define CPU_ARCH_ARMv5T                5
-#define CPU_ARCH_ARMv5TE       6
-#define CPU_ARCH_ARMv5TEJ      7
-#define CPU_ARCH_ARMv6         8
-#define CPU_ARCH_ARMv7         9
-
-/*
- * CR1 bits (CP#15 CR1)
- */
-#define CR_M   (1 << 0)        /* MMU enable                           */
-#define CR_A   (1 << 1)        /* Alignment abort enable               */
-#define CR_C   (1 << 2)        /* Dcache enable                        */
-#define CR_W   (1 << 3)        /* Write buffer enable                  */
-#define CR_P   (1 << 4)        /* 32-bit exception handler             */
-#define CR_D   (1 << 5)        /* 32-bit data address range            */
-#define CR_L   (1 << 6)        /* Implementation defined               */
-#define CR_B   (1 << 7)        /* Big endian                           */
-#define CR_S   (1 << 8)        /* System MMU protection                */
-#define CR_R   (1 << 9)        /* ROM MMU protection                   */
-#define CR_F   (1 << 10)       /* Implementation defined               */
-#define CR_Z   (1 << 11)       /* Implementation defined               */
-#define CR_I   (1 << 12)       /* Icache enable                        */
-#define CR_V   (1 << 13)       /* Vectors relocated to 0xffff0000      */
-#define CR_RR  (1 << 14)       /* Round Robin cache replacement        */
-#define CR_L4  (1 << 15)       /* LDR pc can set T bit                 */
-#define CR_DT  (1 << 16)
-#define CR_IT  (1 << 18)
-#define CR_ST  (1 << 19)
-#define CR_FI  (1 << 21)       /* Fast interrupt (lower latency mode)  */
-#define CR_U   (1 << 22)       /* Unaligned access operation           */
-#define CR_XP  (1 << 23)       /* Extended page tables                 */
-#define CR_VE  (1 << 24)       /* Vectored interrupts                  */
-
-#define CPUID_ID       0
-#define CPUID_CACHETYPE        1
-#define CPUID_TCM      2
-#define CPUID_TLBTYPE  3
-
-/*
- * This is used to ensure the compiler did actually allocate the register we
- * asked it for some inline assembly sequences.  Apparently we can't trust
- * the compiler from one version to another so a bit of paranoia won't hurt.
- * This string is meant to be concatenated with the inline asm string and
- * will cause compilation to stop on mismatch.
- * (for details, see gcc PR 15089)
- */
-#define __asmeq(x, y)  ".ifnc " x "," y " ; .err ; .endif\n\t"
-
-#ifndef __ASSEMBLY__
-
-#include <linux/linkage.h>
-#include <linux/stringify.h>
-#include <linux/irqflags.h>
-
-#ifdef CONFIG_CPU_CP15
-#define read_cpuid(reg)                                                        \
-       ({                                                              \
-               unsigned int __val;                                     \
-               asm("mrc        p15, 0, %0, c0, c0, " __stringify(reg)  \
-                   : "=r" (__val)                                      \
-                   :                                                   \
-                   : "cc");                                            \
-               __val;                                                  \
-       })
-#else
-extern unsigned int processor_id;
-#define read_cpuid(reg) (processor_id)
-#endif
-
-/*
- * The CPU ID never changes at run time, so we might as well tell the
- * compiler that it's constant.  Use this function to read the CPU ID
- * rather than directly reading processor_id or read_cpuid() directly.
- */
-static inline unsigned int read_cpuid_id(void) __attribute_const__;
-
-static inline unsigned int read_cpuid_id(void)
-{
-       return read_cpuid(CPUID_ID);
-}
-
-#define __exception    __attribute__((section(".exception.text")))
-
-struct thread_info;
-struct task_struct;
-
-/* information about the system we're running on */
-extern unsigned int system_rev;
-extern unsigned int system_serial_low;
-extern unsigned int system_serial_high;
-extern unsigned int mem_fclk_21285;
-
-struct pt_regs;
-
-void die(const char *msg, struct pt_regs *regs, int err)
-               __attribute__((noreturn));
-
-struct siginfo;
-void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
-               unsigned long err, unsigned long trap);
-
-void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
-                                      struct pt_regs *),
-                    int sig, const char *name);
-
-#define xchg(ptr,x) \
-       ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
-
-extern asmlinkage void __backtrace(void);
-extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
-
-struct mm_struct;
-extern void show_pte(struct mm_struct *mm, unsigned long addr);
-extern void __show_regs(struct pt_regs *);
-
-extern int cpu_architecture(void);
-extern void cpu_init(void);
-
-void arm_machine_restart(char mode);
-extern void (*arm_pm_restart)(char str);
-
-/*
- * Intel's XScale3 core supports some v6 features (supersections, L2)
- * but advertises itself as v5 as it does not support the v6 ISA.  For
- * this reason, we need a way to explicitly test for this type of CPU.
- */
-#ifndef CONFIG_CPU_XSC3
-#define cpu_is_xsc3()  0
-#else
-static inline int cpu_is_xsc3(void)
-{
-       extern unsigned int processor_id;
-
-       if ((processor_id & 0xffffe000) == 0x69056000)
-               return 1;
-
-       return 0;
-}
-#endif
-
-#if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3)
-#define        cpu_is_xscale() 0
-#else
-#define        cpu_is_xscale() 1
-#endif
-
-#define UDBG_UNDEFINED (1 << 0)
-#define UDBG_SYSCALL   (1 << 1)
-#define UDBG_BADABORT  (1 << 2)
-#define UDBG_SEGV      (1 << 3)
-#define UDBG_BUS       (1 << 4)
-
-extern unsigned int user_debug;
-
-#if __LINUX_ARM_ARCH__ >= 4
-#define vectors_high() (cr_alignment & CR_V)
-#else
-#define vectors_high() (0)
-#endif
-
-#if __LINUX_ARM_ARCH__ >= 7
-#define isb() __asm__ __volatile__ ("isb" : : : "memory")
-#define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
-#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
-#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
-#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
-                                   : : "r" (0) : "memory")
-#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
-                                   : : "r" (0) : "memory")
-#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
-                                   : : "r" (0) : "memory")
-#else
-#define isb() __asm__ __volatile__ ("" : : : "memory")
-#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
-                                   : : "r" (0) : "memory")
-#define dmb() __asm__ __volatile__ ("" : : : "memory")
-#endif
-
-#ifndef CONFIG_SMP
-#define mb()   do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
-#define rmb()  do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
-#define wmb()  do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
-#define smp_mb()       barrier()
-#define smp_rmb()      barrier()
-#define smp_wmb()      barrier()
-#else
-#define mb()           dmb()
-#define rmb()          dmb()
-#define wmb()          dmb()
-#define smp_mb()       dmb()
-#define smp_rmb()      dmb()
-#define smp_wmb()      dmb()
-#endif
-#define read_barrier_depends()         do { } while(0)
-#define smp_read_barrier_depends()     do { } while(0)
-
-#define set_mb(var, value)     do { var = value; smp_mb(); } while (0)
-#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
-
-extern unsigned long cr_no_alignment;  /* defined in entry-armv.S */
-extern unsigned long cr_alignment;     /* defined in entry-armv.S */
-
-static inline unsigned int get_cr(void)
-{
-       unsigned int val;
-       asm("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
-       return val;
-}
-
-static inline void set_cr(unsigned int val)
-{
-       asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
-         : : "r" (val) : "cc");
-       isb();
-}
-
-#ifndef CONFIG_SMP
-extern void adjust_cr(unsigned long mask, unsigned long set);
-#endif
-
-#define CPACC_FULL(n)          (3 << (n * 2))
-#define CPACC_SVC(n)           (1 << (n * 2))
-#define CPACC_DISABLE(n)       (0 << (n * 2))
-
-static inline unsigned int get_copro_access(void)
-{
-       unsigned int val;
-       asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
-         : "=r" (val) : : "cc");
-       return val;
-}
-
-static inline void set_copro_access(unsigned int val)
-{
-       asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
-         : : "r" (val) : "cc");
-       isb();
-}
-
-/*
- * switch_mm() may do a full cache flush over the context switch,
- * so enable interrupts over the context switch to avoid high
- * latency.
- */
-#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
-
-/*
- * switch_to(prev, next) should switch from task `prev' to `next'
- * `prev' will never be the same as `next'.  schedule() itself
- * contains the memory barrier to tell GCC not to cache `current'.
- */
-extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
-
-#define switch_to(prev,next,last)                                      \
-do {                                                                   \
-       last = __switch_to(prev,task_thread_info(prev), task_thread_info(next));        \
-} while (0)
-
-#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
-/*
- * On the StrongARM, "swp" is terminally broken since it bypasses the
- * cache totally.  This means that the cache becomes inconsistent, and,
- * since we use normal loads/stores as well, this is really bad.
- * Typically, this causes oopsen in filp_close, but could have other,
- * more disasterous effects.  There are two work-arounds:
- *  1. Disable interrupts and emulate the atomic swap
- *  2. Clean the cache, perform atomic swap, flush the cache
- *
- * We choose (1) since its the "easiest" to achieve here and is not
- * dependent on the processor type.
- *
- * NOTE that this solution won't work on an SMP system, so explcitly
- * forbid it here.
- */
-#define swp_is_buggy
-#endif
-
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
-{
-       extern void __bad_xchg(volatile void *, int);
-       unsigned long ret;
-#ifdef swp_is_buggy
-       unsigned long flags;
-#endif
-#if __LINUX_ARM_ARCH__ >= 6
-       unsigned int tmp;
-#endif
-
-       switch (size) {
-#if __LINUX_ARM_ARCH__ >= 6
-       case 1:
-               asm volatile("@ __xchg1\n"
-               "1:     ldrexb  %0, [%3]\n"
-               "       strexb  %1, %2, [%3]\n"
-               "       teq     %1, #0\n"
-               "       bne     1b"
-                       : "=&r" (ret), "=&r" (tmp)
-                       : "r" (x), "r" (ptr)
-                       : "memory", "cc");
-               break;
-       case 4:
-               asm volatile("@ __xchg4\n"
-               "1:     ldrex   %0, [%3]\n"
-               "       strex   %1, %2, [%3]\n"
-               "       teq     %1, #0\n"
-               "       bne     1b"
-                       : "=&r" (ret), "=&r" (tmp)
-                       : "r" (x), "r" (ptr)
-                       : "memory", "cc");
-               break;
-#elif defined(swp_is_buggy)
-#ifdef CONFIG_SMP
-#error SMP is not supported on this platform
-#endif
-       case 1:
-               raw_local_irq_save(flags);
-               ret = *(volatile unsigned char *)ptr;
-               *(volatile unsigned char *)ptr = x;
-               raw_local_irq_restore(flags);
-               break;
-
-       case 4:
-               raw_local_irq_save(flags);
-               ret = *(volatile unsigned long *)ptr;
-               *(volatile unsigned long *)ptr = x;
-               raw_local_irq_restore(flags);
-               break;
-#else
-       case 1:
-               asm volatile("@ __xchg1\n"
-               "       swpb    %0, %1, [%2]"
-                       : "=&r" (ret)
-                       : "r" (x), "r" (ptr)
-                       : "memory", "cc");
-               break;
-       case 4:
-               asm volatile("@ __xchg4\n"
-               "       swp     %0, %1, [%2]"
-                       : "=&r" (ret)
-                       : "r" (x), "r" (ptr)
-                       : "memory", "cc");
-               break;
-#endif
-       default:
-               __bad_xchg(ptr, size), ret = 0;
-               break;
-       }
-
-       return ret;
-}
-
-extern void disable_hlt(void);
-extern void enable_hlt(void);
-
-#include <asm-generic/cmpxchg-local.h>
-
-/*
- * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
- * them available.
- */
-#define cmpxchg_local(ptr, o, n)                                              \
-       ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
-                       (unsigned long)(n), sizeof(*(ptr))))
-#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
-
-#ifndef CONFIG_SMP
-#include <asm-generic/cmpxchg.h>
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#define arch_align_stack(x) (x)
-
-#endif /* __KERNEL__ */
-
-#endif
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
deleted file mode 100644 (file)
index f784d11..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-#ifndef __ASM_ARM_TERMBITS_H
-#define __ASM_ARM_TERMBITS_H
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-};
-
-struct termios2 {
-       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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* 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 IUCLC  0001000
-#define IXON   0002000
-#define IXANY  0004000
-#define IXOFF  0010000
-#define IMAXBEL        0020000
-#define IUTF8  0040000
-
-/* c_oflag bits */
-#define OPOST  0000001
-#define OLCUC  0000002
-#define ONLCR  0000004
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-#define OFILL  0000100
-#define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
-#define VTDLY  0040000
-#define   VT0  0000000
-#define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
-
-/* c_cflag bit meaning */
-#define CBAUD  0010017
-#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 CSIZE  0000060
-#define   CS5  0000000
-#define   CS6  0000020
-#define   CS7  0000040
-#define   CS8  0000060
-#define CSTOPB 0000100
-#define CREAD  0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL  0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define    BOTHER 0010000
-#define    B57600 0010001
-#define   B115200 0010002
-#define   B230400 0010003
-#define   B460800 0010004
-#define   B500000 0010005
-#define   B576000 0010006
-#define   B921600 0010007
-#define  B1000000 0010010
-#define  B1152000 0010011
-#define  B1500000 0010012
-#define  B2000000 0010013
-#define  B2500000 0010014
-#define  B3000000 0010015
-#define  B3500000 0010016
-#define  B4000000 0010017
-#define CIBAUD   002003600000          /* input baud rate */
-#define CMSPAR    010000000000         /* mark or space (stick) parity */
-#define CRTSCTS          020000000000          /* flow control */
-
-#define IBSHIFT           16
-
-/* c_lflag bits */
-#define ISIG   0000001
-#define ICANON 0000002
-#define XCASE  0000004
-#define ECHO   0000010
-#define ECHOE  0000020
-#define ECHOK  0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL        0001000
-#define ECHOPRT        0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
deleted file mode 100644 (file)
index 293e3f1..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef __ASM_ARM_TERMIOS_H
-#define __ASM_ARM_TERMIOS_H
-
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
-
-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 */
-};
-
-#ifdef __KERNEL__
-/*     intr=^C         quit=^|         erase=del       kill=^U
-       eof=^D          vtime=\0        vmin=\1         sxtc=\0
-       start=^Q        stop=^S         susp=^Z         eol=\0
-       reprint=^R      discard=^U      werase=^W       lnext=^V
-       eol2=\0
-*/
-#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
-#endif
-
-/* modem lines */
-#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
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-#ifdef __KERNEL__
-
-/*
- * Translate a "termio" structure into a "termios". Ugh.
- */
-#define SET_LOW_TERMIOS_BITS(termios, termio, x) {             \
-       unsigned short __tmp;                                   \
-       get_user(__tmp,&(termio)->x);                           \
-       *(unsigned short *) &(termios)->x = __tmp;              \
-}
-
-#define user_termio_to_kernel_termios(termios, termio) \
-({ \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
-       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
-})
-
-/*
- * Translate a "termios" structure into a "termio". Ugh.
- */
-#define kernel_termios_to_user_termio(termio, termios) \
-({ \
-       put_user((termios)->c_iflag, &(termio)->c_iflag); \
-       put_user((termios)->c_oflag, &(termio)->c_oflag); \
-       put_user((termios)->c_cflag, &(termio)->c_cflag); \
-       put_user((termios)->c_lflag, &(termio)->c_lflag); \
-       put_user((termios)->c_line,  &(termio)->c_line); \
-       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
-})
-
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
-#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/include/asm-arm/therm.h b/include/asm-arm/therm.h
deleted file mode 100644 (file)
index e51c923..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * linux/include/asm-arm/therm.h: Definitions for Dallas Semiconductor
- *  DS1620 thermometer driver (as used in the Rebel.com NetWinder)
- */
-#ifndef __ASM_THERM_H
-#define __ASM_THERM_H
-
-/* ioctl numbers for /dev/therm */
-#define CMD_SET_THERMOSTATE    0x53
-#define CMD_GET_THERMOSTATE    0x54
-#define CMD_GET_STATUS         0x56
-#define CMD_GET_TEMPERATURE    0x57
-#define CMD_SET_THERMOSTATE2   0x58
-#define CMD_GET_THERMOSTATE2   0x59
-#define CMD_GET_TEMPERATURE2   0x5a
-#define CMD_GET_FAN            0x5b
-#define CMD_SET_FAN            0x5c
-
-#define FAN_OFF                        0
-#define FAN_ON                 1
-#define FAN_ALWAYS_ON          2
-
-struct therm {
-       int hi;
-       int lo;
-};
-
-#endif
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
deleted file mode 100644 (file)
index d4be2d6..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *  linux/include/asm-arm/thread_info.h
- *
- *  Copyright (C) 2002 Russell King.
- *
- * 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.
- */
-#ifndef __ASM_ARM_THREAD_INFO_H
-#define __ASM_ARM_THREAD_INFO_H
-
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-#include <asm/fpstate.h>
-
-#define THREAD_SIZE_ORDER      1
-#define THREAD_SIZE            8192
-#define THREAD_START_SP                (THREAD_SIZE - 8)
-
-#ifndef __ASSEMBLY__
-
-struct task_struct;
-struct exec_domain;
-
-#include <asm/types.h>
-#include <asm/domain.h>
-
-typedef unsigned long mm_segment_t;
-
-struct cpu_context_save {
-       __u32   r4;
-       __u32   r5;
-       __u32   r6;
-       __u32   r7;
-       __u32   r8;
-       __u32   r9;
-       __u32   sl;
-       __u32   fp;
-       __u32   sp;
-       __u32   pc;
-       __u32   extra[2];               /* Xscale 'acc' register, etc */
-};
-
-/*
- * low level task data that entry.S needs immediate access to.
- * __switch_to() assumes cpu_context follows immediately after cpu_domain.
- */
-struct thread_info {
-       unsigned long           flags;          /* low level flags */
-       int                     preempt_count;  /* 0 => preemptable, <0 => bug */
-       mm_segment_t            addr_limit;     /* address limit */
-       struct task_struct      *task;          /* main task structure */
-       struct exec_domain      *exec_domain;   /* execution domain */
-       __u32                   cpu;            /* cpu */
-       __u32                   cpu_domain;     /* cpu domain */
-       struct cpu_context_save cpu_context;    /* cpu context */
-       __u32                   syscall;        /* syscall number */
-       __u8                    used_cp[16];    /* thread used copro */
-       unsigned long           tp_value;
-       struct crunch_state     crunchstate;
-       union fp_state          fpstate __attribute__((aligned(8)));
-       union vfp_state         vfpstate;
-#ifdef CONFIG_ARM_THUMBEE
-       unsigned long           thumbee_state;  /* ThumbEE Handler Base register */
-#endif
-       struct restart_block    restart_block;
-};
-
-#define INIT_THREAD_INFO(tsk)                                          \
-{                                                                      \
-       .task           = &tsk,                                         \
-       .exec_domain    = &default_exec_domain,                         \
-       .flags          = 0,                                            \
-       .preempt_count  = 1,                                            \
-       .addr_limit     = KERNEL_DS,                                    \
-       .cpu_domain     = domain_val(DOMAIN_USER, DOMAIN_MANAGER) |     \
-                         domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) |   \
-                         domain_val(DOMAIN_IO, DOMAIN_CLIENT),         \
-       .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
- */
-static inline struct thread_info *current_thread_info(void) __attribute_const__;
-
-static inline struct thread_info *current_thread_info(void)
-{
-       register unsigned long sp asm ("sp");
-       return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
-}
-
-#define thread_saved_pc(tsk)   \
-       ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc)))
-#define thread_saved_fp(tsk)   \
-       ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
-
-extern void crunch_task_disable(struct thread_info *);
-extern void crunch_task_copy(struct thread_info *, void *);
-extern void crunch_task_restore(struct thread_info *, void *);
-extern void crunch_task_release(struct thread_info *);
-
-extern void iwmmxt_task_disable(struct thread_info *);
-extern void iwmmxt_task_copy(struct thread_info *, void *);
-extern void iwmmxt_task_restore(struct thread_info *, void *);
-extern void iwmmxt_task_release(struct thread_info *);
-extern void iwmmxt_task_switch(struct thread_info *);
-
-#endif
-
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See include/asm-arm/hardirq.h.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
-/*
- * thread information flags:
- *  TIF_SYSCALL_TRACE  - syscall trace active
- *  TIF_SIGPENDING     - signal pending
- *  TIF_NEED_RESCHED   - rescheduling necessary
- *  TIF_USEDFPU                - FPU was used by this task this quantum (SMP)
- *  TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
- */
-#define TIF_SIGPENDING         0
-#define TIF_NEED_RESCHED       1
-#define TIF_SYSCALL_TRACE      8
-#define TIF_POLLING_NRFLAG     16
-#define TIF_USING_IWMMXT       17
-#define TIF_MEMDIE             18
-#define TIF_FREEZE             19
-
-#define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
-#define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
-#define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
-#define _TIF_POLLING_NRFLAG    (1 << TIF_POLLING_NRFLAG)
-#define _TIF_USING_IWMMXT      (1 << TIF_USING_IWMMXT)
-#define _TIF_FREEZE            (1 << TIF_FREEZE)
-
-/*
- * Change these and you break ASM code in entry-common.S
- */
-#define _TIF_WORK_MASK         0x000000ff
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/include/asm-arm/thread_notify.h b/include/asm-arm/thread_notify.h
deleted file mode 100644 (file)
index 8866e52..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *  linux/include/asm-arm/thread_notify.h
- *
- *  Copyright (C) 2006 Russell King.
- *
- * 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.
- */
-#ifndef ASMARM_THREAD_NOTIFY_H
-#define ASMARM_THREAD_NOTIFY_H
-
-#ifdef __KERNEL__
-
-#ifndef __ASSEMBLY__
-
-#include <linux/notifier.h>
-#include <asm/thread_info.h>
-
-static inline int thread_register_notifier(struct notifier_block *n)
-{
-       extern struct atomic_notifier_head thread_notify_head;
-       return atomic_notifier_chain_register(&thread_notify_head, n);
-}
-
-static inline void thread_unregister_notifier(struct notifier_block *n)
-{
-       extern struct atomic_notifier_head thread_notify_head;
-       atomic_notifier_chain_unregister(&thread_notify_head, n);
-}
-
-static inline void thread_notify(unsigned long rc, struct thread_info *thread)
-{
-       extern struct atomic_notifier_head thread_notify_head;
-       atomic_notifier_call_chain(&thread_notify_head, rc, thread);
-}
-
-#endif
-
-/*
- * These are the reason codes for the thread notifier.
- */
-#define THREAD_NOTIFY_FLUSH    0
-#define THREAD_NOTIFY_RELEASE  1
-#define THREAD_NOTIFY_SWITCH   2
-
-#endif
-#endif
diff --git a/include/asm-arm/timex.h b/include/asm-arm/timex.h
deleted file mode 100644 (file)
index 7b8d4cb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  linux/include/asm-arm/timex.h
- *
- *  Copyright (C) 1997,1998 Russell King
- *
- * 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.
- *
- *  Architecture Specific TIME specifications
- */
-#ifndef _ASMARM_TIMEX_H
-#define _ASMARM_TIMEX_H
-
-#include <asm/arch/timex.h>
-
-typedef unsigned long cycles_t;
-
-static inline cycles_t get_cycles (void)
-{
-       return 0;
-}
-
-#endif
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h
deleted file mode 100644 (file)
index 36bd402..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *  linux/include/asm-arm/tlb.h
- *
- *  Copyright (C) 2002 Russell King
- *
- * 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.
- *
- *  Experimentation shows that on a StrongARM, it appears to be faster
- *  to use the "invalidate whole tlb" rather than "invalidate single
- *  tlb" for this.
- *
- *  This appears true for both the process fork+exit case, as well as
- *  the munmap-large-area case.
- */
-#ifndef __ASMARM_TLB_H
-#define __ASMARM_TLB_H
-
-#include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
-
-#ifndef CONFIG_MMU
-
-#include <linux/pagemap.h>
-#include <asm-generic/tlb.h>
-
-#else /* !CONFIG_MMU */
-
-#include <asm/pgalloc.h>
-
-/*
- * TLB handling.  This allows us to remove pages from the page
- * tables, and efficiently handle the TLB issues.
- */
-struct mmu_gather {
-       struct mm_struct        *mm;
-       unsigned int            fullmm;
-};
-
-DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
-
-static inline struct mmu_gather *
-tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
-{
-       struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
-
-       tlb->mm = mm;
-       tlb->fullmm = full_mm_flush;
-
-       return tlb;
-}
-
-static inline void
-tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
-{
-       if (tlb->fullmm)
-               flush_tlb_mm(tlb->mm);
-
-       /* keep the page table cache within bounds */
-       check_pgt_cache();
-
-       put_cpu_var(mmu_gathers);
-}
-
-#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
-
-/*
- * In the case of tlb vma handling, we can optimise these away in the
- * case where we're doing a full MM flush.  When we're doing a munmap,
- * the vmas are adjusted to only cover the region to be torn down.
- */
-static inline void
-tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
-{
-       if (!tlb->fullmm)
-               flush_cache_range(vma, vma->vm_start, vma->vm_end);
-}
-
-static inline void
-tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
-{
-       if (!tlb->fullmm)
-               flush_tlb_range(vma, vma->vm_start, vma->vm_end);
-}
-
-#define tlb_remove_page(tlb,page)      free_page_and_swap_cache(page)
-#define pte_free_tlb(tlb, ptep)                pte_free((tlb)->mm, ptep)
-#define pmd_free_tlb(tlb, pmdp)                pmd_free((tlb)->mm, pmdp)
-
-#define tlb_migrate_finish(mm)         do { } while (0)
-
-#endif /* CONFIG_MMU */
-#endif
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
deleted file mode 100644 (file)
index 909656c..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- *  linux/include/asm-arm/tlbflush.h
- *
- *  Copyright (C) 1999-2003 Russell King
- *
- * 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.
- */
-#ifndef _ASMARM_TLBFLUSH_H
-#define _ASMARM_TLBFLUSH_H
-
-
-#ifndef CONFIG_MMU
-
-#define tlb_flush(tlb) ((void) tlb)
-
-#else /* CONFIG_MMU */
-
-#include <asm/glue.h>
-
-#define TLB_V3_PAGE    (1 << 0)
-#define TLB_V4_U_PAGE  (1 << 1)
-#define TLB_V4_D_PAGE  (1 << 2)
-#define TLB_V4_I_PAGE  (1 << 3)
-#define TLB_V6_U_PAGE  (1 << 4)
-#define TLB_V6_D_PAGE  (1 << 5)
-#define TLB_V6_I_PAGE  (1 << 6)
-
-#define TLB_V3_FULL    (1 << 8)
-#define TLB_V4_U_FULL  (1 << 9)
-#define TLB_V4_D_FULL  (1 << 10)
-#define TLB_V4_I_FULL  (1 << 11)
-#define TLB_V6_U_FULL  (1 << 12)
-#define TLB_V6_D_FULL  (1 << 13)
-#define TLB_V6_I_FULL  (1 << 14)
-
-#define TLB_V6_U_ASID  (1 << 16)
-#define TLB_V6_D_ASID  (1 << 17)
-#define TLB_V6_I_ASID  (1 << 18)
-
-#define TLB_L2CLEAN_FR (1 << 29)               /* Feroceon */
-#define TLB_DCLEAN     (1 << 30)
-#define TLB_WB         (1 << 31)
-
-/*
- *     MMU TLB Model
- *     =============
- *
- *     We have the following to choose from:
- *       v3    - ARMv3
- *       v4    - ARMv4 without write buffer
- *       v4wb  - ARMv4 with write buffer without I TLB flush entry instruction
- *       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
- */
-#undef _TLB
-#undef MULTI_TLB
-
-#define v3_tlb_flags   (TLB_V3_FULL | TLB_V3_PAGE)
-
-#ifdef CONFIG_CPU_TLB_V3
-# define v3_possible_flags     v3_tlb_flags
-# define v3_always_flags       v3_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v3
-# endif
-#else
-# define v3_possible_flags     0
-# define v3_always_flags       (-1UL)
-#endif
-
-#define v4_tlb_flags   (TLB_V4_U_FULL | TLB_V4_U_PAGE)
-
-#ifdef CONFIG_CPU_TLB_V4WT
-# define v4_possible_flags     v4_tlb_flags
-# define v4_always_flags       v4_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v4
-# endif
-#else
-# define v4_possible_flags     0
-# define v4_always_flags       (-1UL)
-#endif
-
-#define v4wbi_tlb_flags        (TLB_WB | TLB_DCLEAN | \
-                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
-                        TLB_V4_I_PAGE | TLB_V4_D_PAGE)
-
-#ifdef CONFIG_CPU_TLB_V4WBI
-# define v4wbi_possible_flags  v4wbi_tlb_flags
-# define v4wbi_always_flags    v4wbi_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v4wbi
-# endif
-#else
-# define v4wbi_possible_flags  0
-# define v4wbi_always_flags    (-1UL)
-#endif
-
-#define fr_tlb_flags   (TLB_WB | TLB_DCLEAN | TLB_L2CLEAN_FR | \
-                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
-                        TLB_V4_I_PAGE | TLB_V4_D_PAGE)
-
-#ifdef CONFIG_CPU_TLB_FEROCEON
-# define fr_possible_flags     fr_tlb_flags
-# define fr_always_flags       fr_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v4wbi
-# endif
-#else
-# define fr_possible_flags     0
-# define fr_always_flags       (-1UL)
-#endif
-
-#define v4wb_tlb_flags (TLB_WB | TLB_DCLEAN | \
-                        TLB_V4_I_FULL | TLB_V4_D_FULL | \
-                        TLB_V4_D_PAGE)
-
-#ifdef CONFIG_CPU_TLB_V4WB
-# define v4wb_possible_flags   v4wb_tlb_flags
-# define v4wb_always_flags     v4wb_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v4wb
-# endif
-#else
-# define v4wb_possible_flags   0
-# define v4wb_always_flags     (-1UL)
-#endif
-
-#define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
-                        TLB_V6_I_FULL | TLB_V6_D_FULL | \
-                        TLB_V6_I_PAGE | TLB_V6_D_PAGE | \
-                        TLB_V6_I_ASID | TLB_V6_D_ASID)
-
-#ifdef CONFIG_CPU_TLB_V6
-# define v6wbi_possible_flags  v6wbi_tlb_flags
-# define v6wbi_always_flags    v6wbi_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v6wbi
-# endif
-#else
-# define v6wbi_possible_flags  0
-# define v6wbi_always_flags    (-1UL)
-#endif
-
-#ifdef CONFIG_CPU_TLB_V7
-# define v7wbi_possible_flags  v6wbi_tlb_flags
-# define v7wbi_always_flags    v6wbi_tlb_flags
-# ifdef _TLB
-#  define MULTI_TLB 1
-# else
-#  define _TLB v7wbi
-# endif
-#else
-# define v7wbi_possible_flags  0
-# define v7wbi_always_flags    (-1UL)
-#endif
-
-#ifndef _TLB
-#error Unknown TLB model
-#endif
-
-#ifndef __ASSEMBLY__
-
-#include <linux/sched.h>
-
-struct cpu_tlb_fns {
-       void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
-       void (*flush_kern_range)(unsigned long, unsigned long);
-       unsigned long tlb_flags;
-};
-
-/*
- * Select the calling method
- */
-#ifdef MULTI_TLB
-
-#define __cpu_flush_user_tlb_range     cpu_tlb.flush_user_range
-#define __cpu_flush_kern_tlb_range     cpu_tlb.flush_kern_range
-
-#else
-
-#define __cpu_flush_user_tlb_range     __glue(_TLB,_flush_user_tlb_range)
-#define __cpu_flush_kern_tlb_range     __glue(_TLB,_flush_kern_tlb_range)
-
-extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long, struct vm_area_struct *);
-extern void __cpu_flush_kern_tlb_range(unsigned long, unsigned long);
-
-#endif
-
-extern struct cpu_tlb_fns cpu_tlb;
-
-#define __cpu_tlb_flags                        cpu_tlb.tlb_flags
-
-/*
- *     TLB Management
- *     ==============
- *
- *     The arch/arm/mm/tlb-*.S files implement these methods.
- *
- *     The TLB specific code is expected to perform whatever tests it
- *     needs to determine if it should invalidate the TLB for each
- *     call.  Start addresses are inclusive and end addresses are
- *     exclusive; it is safe to round these addresses down.
- *
- *     flush_tlb_all()
- *
- *             Invalidate the entire TLB.
- *
- *     flush_tlb_mm(mm)
- *
- *             Invalidate all TLB entries in a particular address
- *             space.
- *             - mm    - mm_struct describing address space
- *
- *     flush_tlb_range(mm,start,end)
- *
- *             Invalidate a range of TLB entries in the specified
- *             address space.
- *             - mm    - mm_struct describing address space
- *             - start - start address (may not be aligned)
- *             - end   - end address (exclusive, may not be aligned)
- *
- *     flush_tlb_page(vaddr,vma)
- *
- *             Invalidate the specified page in the specified address range.
- *             - vaddr - virtual address (may not be aligned)
- *             - vma   - vma_struct describing address range
- *
- *     flush_kern_tlb_page(kaddr)
- *
- *             Invalidate the TLB entry for the specified page.  The address
- *             will be in the kernels virtual memory space.  Current uses
- *             only require the D-TLB to be invalidated.
- *             - kaddr - Kernel virtual memory address
- */
-
-/*
- * We optimise the code below by:
- *  - building a set of TLB flags that might be set in __cpu_tlb_flags
- *  - building a set of TLB flags that will always be set in __cpu_tlb_flags
- *  - if we're going to need __cpu_tlb_flags, access it once and only once
- *
- * This allows us to build optimal assembly for the single-CPU type case,
- * and as close to optimal given the compiler constrants for multi-CPU
- * case.  We could do better for the multi-CPU case if the compiler
- * implemented the "%?" method, but this has been discontinued due to too
- * many people getting it wrong.
- */
-#define possible_tlb_flags     (v3_possible_flags | \
-                                v4_possible_flags | \
-                                v4wbi_possible_flags | \
-                                fr_possible_flags | \
-                                v4wb_possible_flags | \
-                                v6wbi_possible_flags)
-
-#define always_tlb_flags       (v3_always_flags & \
-                                v4_always_flags & \
-                                v4wbi_always_flags & \
-                                fr_always_flags & \
-                                v4wb_always_flags & \
-                                v6wbi_always_flags)
-
-#define tlb_flag(f)    ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
-
-static inline void local_flush_tlb_all(void)
-{
-       const int zero = 0;
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       if (tlb_flag(TLB_WB))
-               dsb();
-
-       if (tlb_flag(TLB_V3_FULL))
-               asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
-       if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL))
-               asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
-       if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL))
-               asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
-       if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
-               asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
-
-       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
-                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
-                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
-               /* flush the branch target cache */
-               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
-               dsb();
-               isb();
-       }
-}
-
-static inline void local_flush_tlb_mm(struct mm_struct *mm)
-{
-       const int zero = 0;
-       const int asid = ASID(mm);
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       if (tlb_flag(TLB_WB))
-               dsb();
-
-       if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) {
-               if (tlb_flag(TLB_V3_FULL))
-                       asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
-               if (tlb_flag(TLB_V4_U_FULL))
-                       asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
-               if (tlb_flag(TLB_V4_D_FULL))
-                       asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
-               if (tlb_flag(TLB_V4_I_FULL))
-                       asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
-       }
-
-       if (tlb_flag(TLB_V6_U_ASID))
-               asm("mcr p15, 0, %0, c8, c7, 2" : : "r" (asid) : "cc");
-       if (tlb_flag(TLB_V6_D_ASID))
-               asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
-       if (tlb_flag(TLB_V6_I_ASID))
-               asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
-
-       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
-                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
-                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
-               /* flush the branch target cache */
-               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
-               dsb();
-       }
-}
-
-static inline void
-local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
-{
-       const int zero = 0;
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
-
-       if (tlb_flag(TLB_WB))
-               dsb();
-
-       if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
-               if (tlb_flag(TLB_V3_PAGE))
-                       asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc");
-               if (tlb_flag(TLB_V4_U_PAGE))
-                       asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
-               if (tlb_flag(TLB_V4_D_PAGE))
-                       asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
-               if (tlb_flag(TLB_V4_I_PAGE))
-                       asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
-               if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
-                       asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
-       }
-
-       if (tlb_flag(TLB_V6_U_PAGE))
-               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
-       if (tlb_flag(TLB_V6_D_PAGE))
-               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
-       if (tlb_flag(TLB_V6_I_PAGE))
-               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
-
-       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
-                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
-                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
-               /* flush the branch target cache */
-               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
-               dsb();
-       }
-}
-
-static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
-{
-       const int zero = 0;
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       kaddr &= PAGE_MASK;
-
-       if (tlb_flag(TLB_WB))
-               dsb();
-
-       if (tlb_flag(TLB_V3_PAGE))
-               asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc");
-       if (tlb_flag(TLB_V4_U_PAGE))
-               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
-       if (tlb_flag(TLB_V4_D_PAGE))
-               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
-       if (tlb_flag(TLB_V4_I_PAGE))
-               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
-       if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
-               asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
-
-       if (tlb_flag(TLB_V6_U_PAGE))
-               asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
-       if (tlb_flag(TLB_V6_D_PAGE))
-               asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
-       if (tlb_flag(TLB_V6_I_PAGE))
-               asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
-
-       if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL |
-                    TLB_V6_I_PAGE | TLB_V6_D_PAGE |
-                    TLB_V6_I_ASID | TLB_V6_D_ASID)) {
-               /* flush the branch target cache */
-               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
-               dsb();
-               isb();
-       }
-}
-
-/*
- *     flush_pmd_entry
- *
- *     Flush a PMD entry (word aligned, or double-word aligned) to
- *     RAM if the TLB for the CPU we are running on requires this.
- *     This is typically used when we are creating PMD entries.
- *
- *     clean_pmd_entry
- *
- *     Clean (but don't drain the write buffer) if the CPU requires
- *     these operations.  This is typically used when we are removing
- *     PMD entries.
- */
-static inline void flush_pmd_entry(pmd_t *pmd)
-{
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       if (tlb_flag(TLB_DCLEAN))
-               asm("mcr        p15, 0, %0, c7, c10, 1  @ flush_pmd"
-                       : : "r" (pmd) : "cc");
-
-       if (tlb_flag(TLB_L2CLEAN_FR))
-               asm("mcr        p15, 1, %0, c15, c9, 1  @ L2 flush_pmd"
-                       : : "r" (pmd) : "cc");
-
-       if (tlb_flag(TLB_WB))
-               dsb();
-}
-
-static inline void clean_pmd_entry(pmd_t *pmd)
-{
-       const unsigned int __tlb_flag = __cpu_tlb_flags;
-
-       if (tlb_flag(TLB_DCLEAN))
-               asm("mcr        p15, 0, %0, c7, c10, 1  @ flush_pmd"
-                       : : "r" (pmd) : "cc");
-
-       if (tlb_flag(TLB_L2CLEAN_FR))
-               asm("mcr        p15, 1, %0, c15, c9, 1  @ L2 flush_pmd"
-                       : : "r" (pmd) : "cc");
-}
-
-#undef tlb_flag
-#undef always_tlb_flags
-#undef possible_tlb_flags
-
-/*
- * Convert calls to our calling convention.
- */
-#define local_flush_tlb_range(vma,start,end)   __cpu_flush_user_tlb_range(start,end,vma)
-#define local_flush_tlb_kernel_range(s,e)      __cpu_flush_kern_tlb_range(s,e)
-
-#ifndef CONFIG_SMP
-#define flush_tlb_all          local_flush_tlb_all
-#define flush_tlb_mm           local_flush_tlb_mm
-#define flush_tlb_page         local_flush_tlb_page
-#define flush_tlb_kernel_page  local_flush_tlb_kernel_page
-#define flush_tlb_range                local_flush_tlb_range
-#define flush_tlb_kernel_range local_flush_tlb_kernel_range
-#else
-extern void flush_tlb_all(void);
-extern void flush_tlb_mm(struct mm_struct *mm);
-extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr);
-extern void flush_tlb_kernel_page(unsigned long kaddr);
-extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
-extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
-#endif
-
-/*
- * if PG_dcache_dirty is set for the page, we need to ensure that any
- * cache entries for the kernels virtual memory range are written
- * back to the page.
- */
-extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte);
-
-#endif
-
-#endif /* CONFIG_MMU */
-
-#endif
diff --git a/include/asm-arm/topology.h b/include/asm-arm/topology.h
deleted file mode 100644 (file)
index accbd7c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_ARM_TOPOLOGY_H
-#define _ASM_ARM_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/include/asm-arm/traps.h b/include/asm-arm/traps.h
deleted file mode 100644 (file)
index aa399ae..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _ASMARM_TRAP_H
-#define _ASMARM_TRAP_H
-
-#include <linux/list.h>
-
-struct undef_hook {
-       struct list_head node;
-       u32 instr_mask;
-       u32 instr_val;
-       u32 cpsr_mask;
-       u32 cpsr_val;
-       int (*fn)(struct pt_regs *regs, unsigned int instr);
-};
-
-void register_undef_hook(struct undef_hook *hook);
-void unregister_undef_hook(struct undef_hook *hook);
-
-static inline int in_exception_text(unsigned long ptr)
-{
-       extern char __exception_text_start[];
-       extern char __exception_text_end[];
-
-       return ptr >= (unsigned long)&__exception_text_start &&
-              ptr < (unsigned long)&__exception_text_end;
-}
-
-extern void __init early_trap_init(void);
-
-#endif
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
deleted file mode 100644 (file)
index 345df01..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __ASM_ARM_TYPES_H
-#define __ASM_ARM_TYPES_H
-
-#include <asm-generic/int-ll64.h>
-
-#ifndef __ASSEMBLY__
-
-typedef unsigned short umode_t;
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#ifdef __KERNEL__
-
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-typedef u32 dma64_addr_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif
-
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
deleted file mode 100644 (file)
index 4c1a3fa..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- *  linux/include/asm-arm/uaccess.h
- *
- * 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.
- */
-#ifndef _ASMARM_UACCESS_H
-#define _ASMARM_UACCESS_H
-
-/*
- * User space memory access functions
- */
-#include <linux/sched.h>
-#include <asm/errno.h>
-#include <asm/memory.h>
-#include <asm/domain.h>
-#include <asm/system.h>
-
-#define VERIFY_READ 0
-#define VERIFY_WRITE 1
-
-/*
- * The exception table consists of pairs of addresses: the first is the
- * address of an instruction that is allowed to fault, and the second is
- * the address at which the program should continue.  No registers are
- * modified, so it is entirely up to the continuation code to figure out
- * what to do.
- *
- * All the routines below use bits of fixup code that are out of line
- * with the main instruction path.  This means when everything is well,
- * we don't even have to jump over them.  Further, they do not intrude
- * on our cache or tlb entries.
- */
-
-struct exception_table_entry
-{
-       unsigned long insn, fixup;
-};
-
-extern int fixup_exception(struct pt_regs *regs);
-
-/*
- * These two are intentionally not defined anywhere - if the kernel
- * code generates any references to them, that's a bug.
- */
-extern int __get_user_bad(void);
-extern int __put_user_bad(void);
-
-/*
- * Note that this is actually 0x1,0000,0000
- */
-#define KERNEL_DS      0x00000000
-#define get_ds()       (KERNEL_DS)
-
-#ifdef CONFIG_MMU
-
-#define USER_DS                TASK_SIZE
-#define get_fs()       (current_thread_info()->addr_limit)
-
-static inline void set_fs(mm_segment_t fs)
-{
-       current_thread_info()->addr_limit = fs;
-       modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
-}
-
-#define segment_eq(a,b)        ((a) == (b))
-
-#define __addr_ok(addr) ({ \
-       unsigned long flag; \
-       __asm__("cmp %2, %0; movlo %0, #0" \
-               : "=&r" (flag) \
-               : "0" (current_thread_info()->addr_limit), "r" (addr) \
-               : "cc"); \
-       (flag == 0); })
-
-/* We use 33-bit arithmetic here... */
-#define __range_ok(addr,size) ({ \
-       unsigned long flag, roksum; \
-       __chk_user_ptr(addr);   \
-       __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
-               : "=&r" (flag), "=&r" (roksum) \
-               : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
-               : "cc"); \
-       flag; })
-
-/*
- * Single-value transfer routines.  They automatically use the right
- * size if we just have the right pointer type.  Note that the functions
- * which read from user space (*get_*) need to take care not to leak
- * kernel data even if the calling code is buggy and fails to check
- * the return value.  This means zeroing out the destination variable
- * or buffer on error.  Normally this is done out of line by the
- * fixup code, but there are a few places where it intrudes on the
- * main code path.  When we only write to user space, there is no
- * problem.
- */
-extern int __get_user_1(void *);
-extern int __get_user_2(void *);
-extern int __get_user_4(void *);
-
-#define __get_user_x(__r2,__p,__e,__s,__i...)                          \
-          __asm__ __volatile__ (                                       \
-               __asmeq("%0", "r0") __asmeq("%1", "r2")                 \
-               "bl     __get_user_" #__s                               \
-               : "=&r" (__e), "=r" (__r2)                              \
-               : "0" (__p)                                             \
-               : __i, "cc")
-
-#define get_user(x,p)                                                  \
-       ({                                                              \
-               register const typeof(*(p)) __user *__p asm("r0") = (p);\
-               register unsigned long __r2 asm("r2");                  \
-               register int __e asm("r0");                             \
-               switch (sizeof(*(__p))) {                               \
-               case 1:                                                 \
-                       __get_user_x(__r2, __p, __e, 1, "lr");          \
-                       break;                                          \
-               case 2:                                                 \
-                       __get_user_x(__r2, __p, __e, 2, "r3", "lr");    \
-                       break;                                          \
-               case 4:                                                 \
-                       __get_user_x(__r2, __p, __e, 4, "lr");          \
-                       break;                                          \
-               default: __e = __get_user_bad(); break;                 \
-               }                                                       \
-               x = (typeof(*(p))) __r2;                                \
-               __e;                                                    \
-       })
-
-extern int __put_user_1(void *, unsigned int);
-extern int __put_user_2(void *, unsigned int);
-extern int __put_user_4(void *, unsigned int);
-extern int __put_user_8(void *, unsigned long long);
-
-#define __put_user_x(__r2,__p,__e,__s)                                 \
-          __asm__ __volatile__ (                                       \
-               __asmeq("%0", "r0") __asmeq("%2", "r2")                 \
-               "bl     __put_user_" #__s                               \
-               : "=&r" (__e)                                           \
-               : "0" (__p), "r" (__r2)                                 \
-               : "ip", "lr", "cc")
-
-#define put_user(x,p)                                                  \
-       ({                                                              \
-               register const typeof(*(p)) __r2 asm("r2") = (x);       \
-               register const typeof(*(p)) __user *__p asm("r0") = (p);\
-               register int __e asm("r0");                             \
-               switch (sizeof(*(__p))) {                               \
-               case 1:                                                 \
-                       __put_user_x(__r2, __p, __e, 1);                \
-                       break;                                          \
-               case 2:                                                 \
-                       __put_user_x(__r2, __p, __e, 2);                \
-                       break;                                          \
-               case 4:                                                 \
-                       __put_user_x(__r2, __p, __e, 4);                \
-                       break;                                          \
-               case 8:                                                 \
-                       __put_user_x(__r2, __p, __e, 8);                \
-                       break;                                          \
-               default: __e = __put_user_bad(); break;                 \
-               }                                                       \
-               __e;                                                    \
-       })
-
-#else /* CONFIG_MMU */
-
-/*
- * uClinux has only one addr space, so has simplified address limits.
- */
-#define USER_DS                        KERNEL_DS
-
-#define segment_eq(a,b)                (1)
-#define __addr_ok(addr)                (1)
-#define __range_ok(addr,size)  (0)
-#define get_fs()               (KERNEL_DS)
-
-static inline void set_fs(mm_segment_t fs)
-{
-}
-
-#define get_user(x,p)  __get_user(x,p)
-#define put_user(x,p)  __put_user(x,p)
-
-#endif /* CONFIG_MMU */
-
-#define access_ok(type,addr,size)      (__range_ok(addr,size) == 0)
-
-/*
- * The "__xxx" versions of the user access functions do not verify the
- * address space - it must have been done previously with a separate
- * "access_ok()" call.
- *
- * The "xxx_error" versions set the third argument to EFAULT if an
- * error occurs, and leave it unchanged on success.  Note that these
- * versions are void (ie, don't return a value as such).
- */
-#define __get_user(x,ptr)                                              \
-({                                                                     \
-       long __gu_err = 0;                                              \
-       __get_user_err((x),(ptr),__gu_err);                             \
-       __gu_err;                                                       \
-})
-
-#define __get_user_error(x,ptr,err)                                    \
-({                                                                     \
-       __get_user_err((x),(ptr),err);                                  \
-       (void) 0;                                                       \
-})
-
-#define __get_user_err(x,ptr,err)                                      \
-do {                                                                   \
-       unsigned long __gu_addr = (unsigned long)(ptr);                 \
-       unsigned long __gu_val;                                         \
-       __chk_user_ptr(ptr);                                            \
-       switch (sizeof(*(ptr))) {                                       \
-       case 1: __get_user_asm_byte(__gu_val,__gu_addr,err);    break;  \
-       case 2: __get_user_asm_half(__gu_val,__gu_addr,err);    break;  \
-       case 4: __get_user_asm_word(__gu_val,__gu_addr,err);    break;  \
-       default: (__gu_val) = __get_user_bad();                         \
-       }                                                               \
-       (x) = (__typeof__(*(ptr)))__gu_val;                             \
-} while (0)
-
-#define __get_user_asm_byte(x,addr,err)                                \
-       __asm__ __volatile__(                                   \
-       "1:     ldrbt   %1,[%2],#0\n"                           \
-       "2:\n"                                                  \
-       "       .section .fixup,\"ax\"\n"                       \
-       "       .align  2\n"                                    \
-       "3:     mov     %0, %3\n"                               \
-       "       mov     %1, #0\n"                               \
-       "       b       2b\n"                                   \
-       "       .previous\n"                                    \
-       "       .section __ex_table,\"a\"\n"                    \
-       "       .align  3\n"                                    \
-       "       .long   1b, 3b\n"                               \
-       "       .previous"                                      \
-       : "+r" (err), "=&r" (x)                                 \
-       : "r" (addr), "i" (-EFAULT)                             \
-       : "cc")
-
-#ifndef __ARMEB__
-#define __get_user_asm_half(x,__gu_addr,err)                   \
-({                                                             \
-       unsigned long __b1, __b2;                               \
-       __get_user_asm_byte(__b1, __gu_addr, err);              \
-       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
-       (x) = __b1 | (__b2 << 8);                               \
-})
-#else
-#define __get_user_asm_half(x,__gu_addr,err)                   \
-({                                                             \
-       unsigned long __b1, __b2;                               \
-       __get_user_asm_byte(__b1, __gu_addr, err);              \
-       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
-       (x) = (__b1 << 8) | __b2;                               \
-})
-#endif
-
-#define __get_user_asm_word(x,addr,err)                                \
-       __asm__ __volatile__(                                   \
-       "1:     ldrt    %1,[%2],#0\n"                           \
-       "2:\n"                                                  \
-       "       .section .fixup,\"ax\"\n"                       \
-       "       .align  2\n"                                    \
-       "3:     mov     %0, %3\n"                               \
-       "       mov     %1, #0\n"                               \
-       "       b       2b\n"                                   \
-       "       .previous\n"                                    \
-       "       .section __ex_table,\"a\"\n"                    \
-       "       .align  3\n"                                    \
-       "       .long   1b, 3b\n"                               \
-       "       .previous"                                      \
-       : "+r" (err), "=&r" (x)                                 \
-       : "r" (addr), "i" (-EFAULT)                             \
-       : "cc")
-
-#define __put_user(x,ptr)                                              \
-({                                                                     \
-       long __pu_err = 0;                                              \
-       __put_user_err((x),(ptr),__pu_err);                             \
-       __pu_err;                                                       \
-})
-
-#define __put_user_error(x,ptr,err)                                    \
-({                                                                     \
-       __put_user_err((x),(ptr),err);                                  \
-       (void) 0;                                                       \
-})
-
-#define __put_user_err(x,ptr,err)                                      \
-do {                                                                   \
-       unsigned long __pu_addr = (unsigned long)(ptr);                 \
-       __typeof__(*(ptr)) __pu_val = (x);                              \
-       __chk_user_ptr(ptr);                                            \
-       switch (sizeof(*(ptr))) {                                       \
-       case 1: __put_user_asm_byte(__pu_val,__pu_addr,err);    break;  \
-       case 2: __put_user_asm_half(__pu_val,__pu_addr,err);    break;  \
-       case 4: __put_user_asm_word(__pu_val,__pu_addr,err);    break;  \
-       case 8: __put_user_asm_dword(__pu_val,__pu_addr,err);   break;  \
-       default: __put_user_bad();                                      \
-       }                                                               \
-} while (0)
-
-#define __put_user_asm_byte(x,__pu_addr,err)                   \
-       __asm__ __volatile__(                                   \
-       "1:     strbt   %1,[%2],#0\n"                           \
-       "2:\n"                                                  \
-       "       .section .fixup,\"ax\"\n"                       \
-       "       .align  2\n"                                    \
-       "3:     mov     %0, %3\n"                               \
-       "       b       2b\n"                                   \
-       "       .previous\n"                                    \
-       "       .section __ex_table,\"a\"\n"                    \
-       "       .align  3\n"                                    \
-       "       .long   1b, 3b\n"                               \
-       "       .previous"                                      \
-       : "+r" (err)                                            \
-       : "r" (x), "r" (__pu_addr), "i" (-EFAULT)               \
-       : "cc")
-
-#ifndef __ARMEB__
-#define __put_user_asm_half(x,__pu_addr,err)                   \
-({                                                             \
-       unsigned long __temp = (unsigned long)(x);              \
-       __put_user_asm_byte(__temp, __pu_addr, err);            \
-       __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err);   \
-})
-#else
-#define __put_user_asm_half(x,__pu_addr,err)                   \
-({                                                             \
-       unsigned long __temp = (unsigned long)(x);              \
-       __put_user_asm_byte(__temp >> 8, __pu_addr, err);       \
-       __put_user_asm_byte(__temp, __pu_addr + 1, err);        \
-})
-#endif
-
-#define __put_user_asm_word(x,__pu_addr,err)                   \
-       __asm__ __volatile__(                                   \
-       "1:     strt    %1,[%2],#0\n"                           \
-       "2:\n"                                                  \
-       "       .section .fixup,\"ax\"\n"                       \
-       "       .align  2\n"                                    \
-       "3:     mov     %0, %3\n"                               \
-       "       b       2b\n"                                   \
-       "       .previous\n"                                    \
-       "       .section __ex_table,\"a\"\n"                    \
-       "       .align  3\n"                                    \
-       "       .long   1b, 3b\n"                               \
-       "       .previous"                                      \
-       : "+r" (err)                                            \
-       : "r" (x), "r" (__pu_addr), "i" (-EFAULT)               \
-       : "cc")
-
-#ifndef __ARMEB__
-#define        __reg_oper0     "%R2"
-#define        __reg_oper1     "%Q2"
-#else
-#define        __reg_oper0     "%Q2"
-#define        __reg_oper1     "%R2"
-#endif
-
-#define __put_user_asm_dword(x,__pu_addr,err)                  \
-       __asm__ __volatile__(                                   \
-       "1:     strt    " __reg_oper1 ", [%1], #4\n"            \
-       "2:     strt    " __reg_oper0 ", [%1], #0\n"            \
-       "3:\n"                                                  \
-       "       .section .fixup,\"ax\"\n"                       \
-       "       .align  2\n"                                    \
-       "4:     mov     %0, %3\n"                               \
-       "       b       3b\n"                                   \
-       "       .previous\n"                                    \
-       "       .section __ex_table,\"a\"\n"                    \
-       "       .align  3\n"                                    \
-       "       .long   1b, 4b\n"                               \
-       "       .long   2b, 4b\n"                               \
-       "       .previous"                                      \
-       : "+r" (err), "+r" (__pu_addr)                          \
-       : "r" (x), "i" (-EFAULT)                                \
-       : "cc")
-
-
-#ifdef CONFIG_MMU
-extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
-extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
-extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
-#else
-#define __copy_from_user(to,from,n)    (memcpy(to, (void __force *)from, n), 0)
-#define __copy_to_user(to,from,n)      (memcpy((void __force *)to, from, n), 0)
-#define __clear_user(addr,n)           (memset((void __force *)addr, 0, n), 0)
-#endif
-
-extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count);
-extern unsigned long __must_check __strnlen_user(const char __user *s, long n);
-
-static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-       if (access_ok(VERIFY_READ, from, n))
-               n = __copy_from_user(to, from, n);
-       else /* security hole - plug it */
-               memzero(to, n);
-       return n;
-}
-
-static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-       if (access_ok(VERIFY_WRITE, to, n))
-               n = __copy_to_user(to, from, n);
-       return n;
-}
-
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
-
-static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
-{
-       if (access_ok(VERIFY_WRITE, to, n))
-               n = __clear_user(to, n);
-       return n;
-}
-
-static inline long __must_check strncpy_from_user(char *dst, const char __user *src, long count)
-{
-       long res = -EFAULT;
-       if (access_ok(VERIFY_READ, src, 1))
-               res = __strncpy_from_user(dst, src, count);
-       return res;
-}
-
-#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
-
-static inline long __must_check strnlen_user(const char __user *s, long n)
-{
-       unsigned long res = 0;
-
-       if (__addr_ok(s))
-               res = __strnlen_user(s, n);
-
-       return res;
-}
-
-#endif /* _ASMARM_UACCESS_H */
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h
deleted file mode 100644 (file)
index bf65e9f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef _ASMARM_UCONTEXT_H
-#define _ASMARM_UCONTEXT_H
-
-#include <asm/fpstate.h>
-
-/*
- * struct sigcontext only has room for the basic registers, but struct
- * ucontext now has room for all registers which need to be saved and
- * restored.  Coprocessor registers are stored in uc_regspace.  Each
- * coprocessor's saved state should start with a documented 32-bit magic
- * number, followed by a 32-bit word giving the coproccesor's saved size.
- * uc_regspace may be expanded if necessary, although this takes some
- * coordination with glibc.
- */
-
-struct ucontext {
-       unsigned long     uc_flags;
-       struct ucontext  *uc_link;
-       stack_t           uc_stack;
-       struct sigcontext uc_mcontext;
-       sigset_t          uc_sigmask;
-       /* Allow for uc_sigmask growth.  Glibc uses a 1024-bit sigset_t.  */
-       int               __unused[32 - (sizeof (sigset_t) / sizeof (int))];
-       /* Last for extensibility.  Eight byte aligned because some
-          coprocessors require eight byte alignment.  */
-       unsigned long     uc_regspace[128] __attribute__((__aligned__(8)));
-};
-
-#ifdef __KERNEL__
-
-/*
- * Coprocessor save state.  The magic values and specific
- * coprocessor's layouts are part of the userspace ABI.  Each one of
- * these should be a multiple of eight bytes and aligned to eight
- * bytes, to prevent unpredictable padding in the signal frame.
- */
-
-#ifdef CONFIG_CRUNCH
-#define CRUNCH_MAGIC           0x5065cf03
-#define CRUNCH_STORAGE_SIZE    (CRUNCH_SIZE + 8)
-
-struct crunch_sigframe {
-       unsigned long   magic;
-       unsigned long   size;
-       struct crunch_state     storage;
-} __attribute__((__aligned__(8)));
-#endif
-
-#ifdef CONFIG_IWMMXT
-/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
-#define IWMMXT_MAGIC           0x12ef842a
-#define IWMMXT_STORAGE_SIZE    (IWMMXT_SIZE + 8)
-
-struct iwmmxt_sigframe {
-       unsigned long   magic;
-       unsigned long   size;
-       struct iwmmxt_struct storage;
-} __attribute__((__aligned__(8)));
-#endif /* CONFIG_IWMMXT */
-
-#ifdef CONFIG_VFP
-#if __LINUX_ARM_ARCH__ < 6
-/* For ARM pre-v6, we use fstmiax and fldmiax.  This adds one extra
- * word after the registers, and a word of padding at the end for
- * alignment.  */
-#define VFP_MAGIC              0x56465001
-#define VFP_STORAGE_SIZE       152
-#else
-#define VFP_MAGIC              0x56465002
-#define VFP_STORAGE_SIZE       144
-#endif
-
-struct vfp_sigframe
-{
-       unsigned long           magic;
-       unsigned long           size;
-       union vfp_state         storage;
-};
-#endif /* CONFIG_VFP */
-
-/*
- * Auxiliary signal frame.  This saves stuff like FP state.
- * The layout of this structure is not part of the user ABI,
- * because the config options aren't.  uc_regspace is really
- * one of these.
- */
-struct aux_sigframe {
-#ifdef CONFIG_CRUNCH
-       struct crunch_sigframe  crunch;
-#endif
-#ifdef CONFIG_IWMMXT
-       struct iwmmxt_sigframe  iwmmxt;
-#endif
-#if 0 && defined CONFIG_VFP /* Not yet saved.  */
-       struct vfp_sigframe     vfp;
-#endif
-       /* Something that isn't a valid magic number for any coprocessor.  */
-       unsigned long           end_magic;
-} __attribute__((__aligned__(8)));
-
-#endif
-
-#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
deleted file mode 100644 (file)
index 44593a8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_ARM_UNALIGNED_H
-#define _ASM_ARM_UNALIGNED_H
-
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-/*
- * Select endianness
- */
-#ifndef __ARMEB__
-#define get_unaligned  __get_unaligned_le
-#define put_unaligned  __put_unaligned_le
-#else
-#define get_unaligned  __get_unaligned_be
-#define put_unaligned  __put_unaligned_be
-#endif
-
-#endif /* _ASM_ARM_UNALIGNED_H */
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
deleted file mode 100644 (file)
index 7c57008..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- *  linux/include/asm-arm/unistd.h
- *
- *  Copyright (C) 2001-2005 Russell King
- *
- * 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.
- *
- * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
- * no matter what the change is.  Thanks!
- */
-#ifndef __ASM_ARM_UNISTD_H
-#define __ASM_ARM_UNISTD_H
-
-#define __NR_OABI_SYSCALL_BASE 0x900000
-
-#if defined(__thumb__) || defined(__ARM_EABI__)
-#define __NR_SYSCALL_BASE      0
-#else
-#define __NR_SYSCALL_BASE      __NR_OABI_SYSCALL_BASE
-#endif
-
-/*
- * This file contains the system call numbers.
- */
-
-#define __NR_restart_syscall           (__NR_SYSCALL_BASE+  0)
-#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
-#define __NR_fork                      (__NR_SYSCALL_BASE+  2)
-#define __NR_read                      (__NR_SYSCALL_BASE+  3)
-#define __NR_write                     (__NR_SYSCALL_BASE+  4)
-#define __NR_open                      (__NR_SYSCALL_BASE+  5)
-#define __NR_close                     (__NR_SYSCALL_BASE+  6)
-                                       /* 7 was sys_waitpid */
-#define __NR_creat                     (__NR_SYSCALL_BASE+  8)
-#define __NR_link                      (__NR_SYSCALL_BASE+  9)
-#define __NR_unlink                    (__NR_SYSCALL_BASE+ 10)
-#define __NR_execve                    (__NR_SYSCALL_BASE+ 11)
-#define __NR_chdir                     (__NR_SYSCALL_BASE+ 12)
-#define __NR_time                      (__NR_SYSCALL_BASE+ 13)
-#define __NR_mknod                     (__NR_SYSCALL_BASE+ 14)
-#define __NR_chmod                     (__NR_SYSCALL_BASE+ 15)
-#define __NR_lchown                    (__NR_SYSCALL_BASE+ 16)
-                                       /* 17 was sys_break */
-                                       /* 18 was sys_stat */
-#define __NR_lseek                     (__NR_SYSCALL_BASE+ 19)
-#define __NR_getpid                    (__NR_SYSCALL_BASE+ 20)
-#define __NR_mount                     (__NR_SYSCALL_BASE+ 21)
-#define __NR_umount                    (__NR_SYSCALL_BASE+ 22)
-#define __NR_setuid                    (__NR_SYSCALL_BASE+ 23)
-#define __NR_getuid                    (__NR_SYSCALL_BASE+ 24)
-#define __NR_stime                     (__NR_SYSCALL_BASE+ 25)
-#define __NR_ptrace                    (__NR_SYSCALL_BASE+ 26)
-#define __NR_alarm                     (__NR_SYSCALL_BASE+ 27)
-                                       /* 28 was sys_fstat */
-#define __NR_pause                     (__NR_SYSCALL_BASE+ 29)
-#define __NR_utime                     (__NR_SYSCALL_BASE+ 30)
-                                       /* 31 was sys_stty */
-                                       /* 32 was sys_gtty */
-#define __NR_access                    (__NR_SYSCALL_BASE+ 33)
-#define __NR_nice                      (__NR_SYSCALL_BASE+ 34)
-                                       /* 35 was sys_ftime */
-#define __NR_sync                      (__NR_SYSCALL_BASE+ 36)
-#define __NR_kill                      (__NR_SYSCALL_BASE+ 37)
-#define __NR_rename                    (__NR_SYSCALL_BASE+ 38)
-#define __NR_mkdir                     (__NR_SYSCALL_BASE+ 39)
-#define __NR_rmdir                     (__NR_SYSCALL_BASE+ 40)
-#define __NR_dup                       (__NR_SYSCALL_BASE+ 41)
-#define __NR_pipe                      (__NR_SYSCALL_BASE+ 42)
-#define __NR_times                     (__NR_SYSCALL_BASE+ 43)
-                                       /* 44 was sys_prof */
-#define __NR_brk                       (__NR_SYSCALL_BASE+ 45)
-#define __NR_setgid                    (__NR_SYSCALL_BASE+ 46)
-#define __NR_getgid                    (__NR_SYSCALL_BASE+ 47)
-                                       /* 48 was sys_signal */
-#define __NR_geteuid                   (__NR_SYSCALL_BASE+ 49)
-#define __NR_getegid                   (__NR_SYSCALL_BASE+ 50)
-#define __NR_acct                      (__NR_SYSCALL_BASE+ 51)
-#define __NR_umount2                   (__NR_SYSCALL_BASE+ 52)
-                                       /* 53 was sys_lock */
-#define __NR_ioctl                     (__NR_SYSCALL_BASE+ 54)
-#define __NR_fcntl                     (__NR_SYSCALL_BASE+ 55)
-                                       /* 56 was sys_mpx */
-#define __NR_setpgid                   (__NR_SYSCALL_BASE+ 57)
-                                       /* 58 was sys_ulimit */
-                                       /* 59 was sys_olduname */
-#define __NR_umask                     (__NR_SYSCALL_BASE+ 60)
-#define __NR_chroot                    (__NR_SYSCALL_BASE+ 61)
-#define __NR_ustat                     (__NR_SYSCALL_BASE+ 62)
-#define __NR_dup2                      (__NR_SYSCALL_BASE+ 63)
-#define __NR_getppid                   (__NR_SYSCALL_BASE+ 64)
-#define __NR_getpgrp                   (__NR_SYSCALL_BASE+ 65)
-#define __NR_setsid                    (__NR_SYSCALL_BASE+ 66)
-#define __NR_sigaction                 (__NR_SYSCALL_BASE+ 67)
-                                       /* 68 was sys_sgetmask */
-                                       /* 69 was sys_ssetmask */
-#define __NR_setreuid                  (__NR_SYSCALL_BASE+ 70)
-#define __NR_setregid                  (__NR_SYSCALL_BASE+ 71)
-#define __NR_sigsuspend                        (__NR_SYSCALL_BASE+ 72)
-#define __NR_sigpending                        (__NR_SYSCALL_BASE+ 73)
-#define __NR_sethostname               (__NR_SYSCALL_BASE+ 74)
-#define __NR_setrlimit                 (__NR_SYSCALL_BASE+ 75)
-#define __NR_getrlimit                 (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
-#define __NR_getrusage                 (__NR_SYSCALL_BASE+ 77)
-#define __NR_gettimeofday              (__NR_SYSCALL_BASE+ 78)
-#define __NR_settimeofday              (__NR_SYSCALL_BASE+ 79)
-#define __NR_getgroups                 (__NR_SYSCALL_BASE+ 80)
-#define __NR_setgroups                 (__NR_SYSCALL_BASE+ 81)
-#define __NR_select                    (__NR_SYSCALL_BASE+ 82)
-#define __NR_symlink                   (__NR_SYSCALL_BASE+ 83)
-                                       /* 84 was sys_lstat */
-#define __NR_readlink                  (__NR_SYSCALL_BASE+ 85)
-#define __NR_uselib                    (__NR_SYSCALL_BASE+ 86)
-#define __NR_swapon                    (__NR_SYSCALL_BASE+ 87)
-#define __NR_reboot                    (__NR_SYSCALL_BASE+ 88)
-#define __NR_readdir                   (__NR_SYSCALL_BASE+ 89)
-#define __NR_mmap                      (__NR_SYSCALL_BASE+ 90)
-#define __NR_munmap                    (__NR_SYSCALL_BASE+ 91)
-#define __NR_truncate                  (__NR_SYSCALL_BASE+ 92)
-#define __NR_ftruncate                 (__NR_SYSCALL_BASE+ 93)
-#define __NR_fchmod                    (__NR_SYSCALL_BASE+ 94)
-#define __NR_fchown                    (__NR_SYSCALL_BASE+ 95)
-#define __NR_getpriority               (__NR_SYSCALL_BASE+ 96)
-#define __NR_setpriority               (__NR_SYSCALL_BASE+ 97)
-                                       /* 98 was sys_profil */
-#define __NR_statfs                    (__NR_SYSCALL_BASE+ 99)
-#define __NR_fstatfs                   (__NR_SYSCALL_BASE+100)
-                                       /* 101 was sys_ioperm */
-#define __NR_socketcall                        (__NR_SYSCALL_BASE+102)
-#define __NR_syslog                    (__NR_SYSCALL_BASE+103)
-#define __NR_setitimer                 (__NR_SYSCALL_BASE+104)
-#define __NR_getitimer                 (__NR_SYSCALL_BASE+105)
-#define __NR_stat                      (__NR_SYSCALL_BASE+106)
-#define __NR_lstat                     (__NR_SYSCALL_BASE+107)
-#define __NR_fstat                     (__NR_SYSCALL_BASE+108)
-                                       /* 109 was sys_uname */
-                                       /* 110 was sys_iopl */
-#define __NR_vhangup                   (__NR_SYSCALL_BASE+111)
-                                       /* 112 was sys_idle */
-#define __NR_syscall                   (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
-#define __NR_wait4                     (__NR_SYSCALL_BASE+114)
-#define __NR_swapoff                   (__NR_SYSCALL_BASE+115)
-#define __NR_sysinfo                   (__NR_SYSCALL_BASE+116)
-#define __NR_ipc                       (__NR_SYSCALL_BASE+117)
-#define __NR_fsync                     (__NR_SYSCALL_BASE+118)
-#define __NR_sigreturn                 (__NR_SYSCALL_BASE+119)
-#define __NR_clone                     (__NR_SYSCALL_BASE+120)
-#define __NR_setdomainname             (__NR_SYSCALL_BASE+121)
-#define __NR_uname                     (__NR_SYSCALL_BASE+122)
-                                       /* 123 was sys_modify_ldt */
-#define __NR_adjtimex                  (__NR_SYSCALL_BASE+124)
-#define __NR_mprotect                  (__NR_SYSCALL_BASE+125)
-#define __NR_sigprocmask               (__NR_SYSCALL_BASE+126)
-                                       /* 127 was sys_create_module */
-#define __NR_init_module               (__NR_SYSCALL_BASE+128)
-#define __NR_delete_module             (__NR_SYSCALL_BASE+129)
-                                       /* 130 was sys_get_kernel_syms */
-#define __NR_quotactl                  (__NR_SYSCALL_BASE+131)
-#define __NR_getpgid                   (__NR_SYSCALL_BASE+132)
-#define __NR_fchdir                    (__NR_SYSCALL_BASE+133)
-#define __NR_bdflush                   (__NR_SYSCALL_BASE+134)
-#define __NR_sysfs                     (__NR_SYSCALL_BASE+135)
-#define __NR_personality               (__NR_SYSCALL_BASE+136)
-                                       /* 137 was sys_afs_syscall */
-#define __NR_setfsuid                  (__NR_SYSCALL_BASE+138)
-#define __NR_setfsgid                  (__NR_SYSCALL_BASE+139)
-#define __NR__llseek                   (__NR_SYSCALL_BASE+140)
-#define __NR_getdents                  (__NR_SYSCALL_BASE+141)
-#define __NR__newselect                        (__NR_SYSCALL_BASE+142)
-#define __NR_flock                     (__NR_SYSCALL_BASE+143)
-#define __NR_msync                     (__NR_SYSCALL_BASE+144)
-#define __NR_readv                     (__NR_SYSCALL_BASE+145)
-#define __NR_writev                    (__NR_SYSCALL_BASE+146)
-#define __NR_getsid                    (__NR_SYSCALL_BASE+147)
-#define __NR_fdatasync                 (__NR_SYSCALL_BASE+148)
-#define __NR__sysctl                   (__NR_SYSCALL_BASE+149)
-#define __NR_mlock                     (__NR_SYSCALL_BASE+150)
-#define __NR_munlock                   (__NR_SYSCALL_BASE+151)
-#define __NR_mlockall                  (__NR_SYSCALL_BASE+152)
-#define __NR_munlockall                        (__NR_SYSCALL_BASE+153)
-#define __NR_sched_setparam            (__NR_SYSCALL_BASE+154)
-#define __NR_sched_getparam            (__NR_SYSCALL_BASE+155)
-#define __NR_sched_setscheduler                (__NR_SYSCALL_BASE+156)
-#define __NR_sched_getscheduler                (__NR_SYSCALL_BASE+157)
-#define __NR_sched_yield               (__NR_SYSCALL_BASE+158)
-#define __NR_sched_get_priority_max    (__NR_SYSCALL_BASE+159)
-#define __NR_sched_get_priority_min    (__NR_SYSCALL_BASE+160)
-#define __NR_sched_rr_get_interval     (__NR_SYSCALL_BASE+161)
-#define __NR_nanosleep                 (__NR_SYSCALL_BASE+162)
-#define __NR_mremap                    (__NR_SYSCALL_BASE+163)
-#define __NR_setresuid                 (__NR_SYSCALL_BASE+164)
-#define __NR_getresuid                 (__NR_SYSCALL_BASE+165)
-                                       /* 166 was sys_vm86 */
-                                       /* 167 was sys_query_module */
-#define __NR_poll                      (__NR_SYSCALL_BASE+168)
-#define __NR_nfsservctl                        (__NR_SYSCALL_BASE+169)
-#define __NR_setresgid                 (__NR_SYSCALL_BASE+170)
-#define __NR_getresgid                 (__NR_SYSCALL_BASE+171)
-#define __NR_prctl                     (__NR_SYSCALL_BASE+172)
-#define __NR_rt_sigreturn              (__NR_SYSCALL_BASE+173)
-#define __NR_rt_sigaction              (__NR_SYSCALL_BASE+174)
-#define __NR_rt_sigprocmask            (__NR_SYSCALL_BASE+175)
-#define __NR_rt_sigpending             (__NR_SYSCALL_BASE+176)
-#define __NR_rt_sigtimedwait           (__NR_SYSCALL_BASE+177)
-#define __NR_rt_sigqueueinfo           (__NR_SYSCALL_BASE+178)
-#define __NR_rt_sigsuspend             (__NR_SYSCALL_BASE+179)
-#define __NR_pread64                   (__NR_SYSCALL_BASE+180)
-#define __NR_pwrite64                  (__NR_SYSCALL_BASE+181)
-#define __NR_chown                     (__NR_SYSCALL_BASE+182)
-#define __NR_getcwd                    (__NR_SYSCALL_BASE+183)
-#define __NR_capget                    (__NR_SYSCALL_BASE+184)
-#define __NR_capset                    (__NR_SYSCALL_BASE+185)
-#define __NR_sigaltstack               (__NR_SYSCALL_BASE+186)
-#define __NR_sendfile                  (__NR_SYSCALL_BASE+187)
-                                       /* 188 reserved */
-                                       /* 189 reserved */
-#define __NR_vfork                     (__NR_SYSCALL_BASE+190)
-#define __NR_ugetrlimit                        (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
-#define __NR_mmap2                     (__NR_SYSCALL_BASE+192)
-#define __NR_truncate64                        (__NR_SYSCALL_BASE+193)
-#define __NR_ftruncate64               (__NR_SYSCALL_BASE+194)
-#define __NR_stat64                    (__NR_SYSCALL_BASE+195)
-#define __NR_lstat64                   (__NR_SYSCALL_BASE+196)
-#define __NR_fstat64                   (__NR_SYSCALL_BASE+197)
-#define __NR_lchown32                  (__NR_SYSCALL_BASE+198)
-#define __NR_getuid32                  (__NR_SYSCALL_BASE+199)
-#define __NR_getgid32                  (__NR_SYSCALL_BASE+200)
-#define __NR_geteuid32                 (__NR_SYSCALL_BASE+201)
-#define __NR_getegid32                 (__NR_SYSCALL_BASE+202)
-#define __NR_setreuid32                        (__NR_SYSCALL_BASE+203)
-#define __NR_setregid32                        (__NR_SYSCALL_BASE+204)
-#define __NR_getgroups32               (__NR_SYSCALL_BASE+205)
-#define __NR_setgroups32               (__NR_SYSCALL_BASE+206)
-#define __NR_fchown32                  (__NR_SYSCALL_BASE+207)
-#define __NR_setresuid32               (__NR_SYSCALL_BASE+208)
-#define __NR_getresuid32               (__NR_SYSCALL_BASE+209)
-#define __NR_setresgid32               (__NR_SYSCALL_BASE+210)
-#define __NR_getresgid32               (__NR_SYSCALL_BASE+211)
-#define __NR_chown32                   (__NR_SYSCALL_BASE+212)
-#define __NR_setuid32                  (__NR_SYSCALL_BASE+213)
-#define __NR_setgid32                  (__NR_SYSCALL_BASE+214)
-#define __NR_setfsuid32                        (__NR_SYSCALL_BASE+215)
-#define __NR_setfsgid32                        (__NR_SYSCALL_BASE+216)
-#define __NR_getdents64                        (__NR_SYSCALL_BASE+217)
-#define __NR_pivot_root                        (__NR_SYSCALL_BASE+218)
-#define __NR_mincore                   (__NR_SYSCALL_BASE+219)
-#define __NR_madvise                   (__NR_SYSCALL_BASE+220)
-#define __NR_fcntl64                   (__NR_SYSCALL_BASE+221)
-                                       /* 222 for tux */
-                                       /* 223 is unused */
-#define __NR_gettid                    (__NR_SYSCALL_BASE+224)
-#define __NR_readahead                 (__NR_SYSCALL_BASE+225)
-#define __NR_setxattr                  (__NR_SYSCALL_BASE+226)
-#define __NR_lsetxattr                 (__NR_SYSCALL_BASE+227)
-#define __NR_fsetxattr                 (__NR_SYSCALL_BASE+228)
-#define __NR_getxattr                  (__NR_SYSCALL_BASE+229)
-#define __NR_lgetxattr                 (__NR_SYSCALL_BASE+230)
-#define __NR_fgetxattr                 (__NR_SYSCALL_BASE+231)
-#define __NR_listxattr                 (__NR_SYSCALL_BASE+232)
-#define __NR_llistxattr                        (__NR_SYSCALL_BASE+233)
-#define __NR_flistxattr                        (__NR_SYSCALL_BASE+234)
-#define __NR_removexattr               (__NR_SYSCALL_BASE+235)
-#define __NR_lremovexattr              (__NR_SYSCALL_BASE+236)
-#define __NR_fremovexattr              (__NR_SYSCALL_BASE+237)
-#define __NR_tkill                     (__NR_SYSCALL_BASE+238)
-#define __NR_sendfile64                        (__NR_SYSCALL_BASE+239)
-#define __NR_futex                     (__NR_SYSCALL_BASE+240)
-#define __NR_sched_setaffinity         (__NR_SYSCALL_BASE+241)
-#define __NR_sched_getaffinity         (__NR_SYSCALL_BASE+242)
-#define __NR_io_setup                  (__NR_SYSCALL_BASE+243)
-#define __NR_io_destroy                        (__NR_SYSCALL_BASE+244)
-#define __NR_io_getevents              (__NR_SYSCALL_BASE+245)
-#define __NR_io_submit                 (__NR_SYSCALL_BASE+246)
-#define __NR_io_cancel                 (__NR_SYSCALL_BASE+247)
-#define __NR_exit_group                        (__NR_SYSCALL_BASE+248)
-#define __NR_lookup_dcookie            (__NR_SYSCALL_BASE+249)
-#define __NR_epoll_create              (__NR_SYSCALL_BASE+250)
-#define __NR_epoll_ctl                 (__NR_SYSCALL_BASE+251)
-#define __NR_epoll_wait                        (__NR_SYSCALL_BASE+252)
-#define __NR_remap_file_pages          (__NR_SYSCALL_BASE+253)
-                                       /* 254 for set_thread_area */
-                                       /* 255 for get_thread_area */
-#define __NR_set_tid_address           (__NR_SYSCALL_BASE+256)
-#define __NR_timer_create              (__NR_SYSCALL_BASE+257)
-#define __NR_timer_settime             (__NR_SYSCALL_BASE+258)
-#define __NR_timer_gettime             (__NR_SYSCALL_BASE+259)
-#define __NR_timer_getoverrun          (__NR_SYSCALL_BASE+260)
-#define __NR_timer_delete              (__NR_SYSCALL_BASE+261)
-#define __NR_clock_settime             (__NR_SYSCALL_BASE+262)
-#define __NR_clock_gettime             (__NR_SYSCALL_BASE+263)
-#define __NR_clock_getres              (__NR_SYSCALL_BASE+264)
-#define __NR_clock_nanosleep           (__NR_SYSCALL_BASE+265)
-#define __NR_statfs64                  (__NR_SYSCALL_BASE+266)
-#define __NR_fstatfs64                 (__NR_SYSCALL_BASE+267)
-#define __NR_tgkill                    (__NR_SYSCALL_BASE+268)
-#define __NR_utimes                    (__NR_SYSCALL_BASE+269)
-#define __NR_arm_fadvise64_64          (__NR_SYSCALL_BASE+270)
-#define __NR_pciconfig_iobase          (__NR_SYSCALL_BASE+271)
-#define __NR_pciconfig_read            (__NR_SYSCALL_BASE+272)
-#define __NR_pciconfig_write           (__NR_SYSCALL_BASE+273)
-#define __NR_mq_open                   (__NR_SYSCALL_BASE+274)
-#define __NR_mq_unlink                 (__NR_SYSCALL_BASE+275)
-#define __NR_mq_timedsend              (__NR_SYSCALL_BASE+276)
-#define __NR_mq_timedreceive           (__NR_SYSCALL_BASE+277)
-#define __NR_mq_notify                 (__NR_SYSCALL_BASE+278)
-#define __NR_mq_getsetattr             (__NR_SYSCALL_BASE+279)
-#define __NR_waitid                    (__NR_SYSCALL_BASE+280)
-#define __NR_socket                    (__NR_SYSCALL_BASE+281)
-#define __NR_bind                      (__NR_SYSCALL_BASE+282)
-#define __NR_connect                   (__NR_SYSCALL_BASE+283)
-#define __NR_listen                    (__NR_SYSCALL_BASE+284)
-#define __NR_accept                    (__NR_SYSCALL_BASE+285)
-#define __NR_getsockname               (__NR_SYSCALL_BASE+286)
-#define __NR_getpeername               (__NR_SYSCALL_BASE+287)
-#define __NR_socketpair                        (__NR_SYSCALL_BASE+288)
-#define __NR_send                      (__NR_SYSCALL_BASE+289)
-#define __NR_sendto                    (__NR_SYSCALL_BASE+290)
-#define __NR_recv                      (__NR_SYSCALL_BASE+291)
-#define __NR_recvfrom                  (__NR_SYSCALL_BASE+292)
-#define __NR_shutdown                  (__NR_SYSCALL_BASE+293)
-#define __NR_setsockopt                        (__NR_SYSCALL_BASE+294)
-#define __NR_getsockopt                        (__NR_SYSCALL_BASE+295)
-#define __NR_sendmsg                   (__NR_SYSCALL_BASE+296)
-#define __NR_recvmsg                   (__NR_SYSCALL_BASE+297)
-#define __NR_semop                     (__NR_SYSCALL_BASE+298)
-#define __NR_semget                    (__NR_SYSCALL_BASE+299)
-#define __NR_semctl                    (__NR_SYSCALL_BASE+300)
-#define __NR_msgsnd                    (__NR_SYSCALL_BASE+301)
-#define __NR_msgrcv                    (__NR_SYSCALL_BASE+302)
-#define __NR_msgget                    (__NR_SYSCALL_BASE+303)
-#define __NR_msgctl                    (__NR_SYSCALL_BASE+304)
-#define __NR_shmat                     (__NR_SYSCALL_BASE+305)
-#define __NR_shmdt                     (__NR_SYSCALL_BASE+306)
-#define __NR_shmget                    (__NR_SYSCALL_BASE+307)
-#define __NR_shmctl                    (__NR_SYSCALL_BASE+308)
-#define __NR_add_key                   (__NR_SYSCALL_BASE+309)
-#define __NR_request_key               (__NR_SYSCALL_BASE+310)
-#define __NR_keyctl                    (__NR_SYSCALL_BASE+311)
-#define __NR_semtimedop                        (__NR_SYSCALL_BASE+312)
-#define __NR_vserver                   (__NR_SYSCALL_BASE+313)
-#define __NR_ioprio_set                        (__NR_SYSCALL_BASE+314)
-#define __NR_ioprio_get                        (__NR_SYSCALL_BASE+315)
-#define __NR_inotify_init              (__NR_SYSCALL_BASE+316)
-#define __NR_inotify_add_watch         (__NR_SYSCALL_BASE+317)
-#define __NR_inotify_rm_watch          (__NR_SYSCALL_BASE+318)
-#define __NR_mbind                     (__NR_SYSCALL_BASE+319)
-#define __NR_get_mempolicy             (__NR_SYSCALL_BASE+320)
-#define __NR_set_mempolicy             (__NR_SYSCALL_BASE+321)
-#define __NR_openat                    (__NR_SYSCALL_BASE+322)
-#define __NR_mkdirat                   (__NR_SYSCALL_BASE+323)
-#define __NR_mknodat                   (__NR_SYSCALL_BASE+324)
-#define __NR_fchownat                  (__NR_SYSCALL_BASE+325)
-#define __NR_futimesat                 (__NR_SYSCALL_BASE+326)
-#define __NR_fstatat64                 (__NR_SYSCALL_BASE+327)
-#define __NR_unlinkat                  (__NR_SYSCALL_BASE+328)
-#define __NR_renameat                  (__NR_SYSCALL_BASE+329)
-#define __NR_linkat                    (__NR_SYSCALL_BASE+330)
-#define __NR_symlinkat                 (__NR_SYSCALL_BASE+331)
-#define __NR_readlinkat                        (__NR_SYSCALL_BASE+332)
-#define __NR_fchmodat                  (__NR_SYSCALL_BASE+333)
-#define __NR_faccessat                 (__NR_SYSCALL_BASE+334)
-                                       /* 335 for pselect6 */
-                                       /* 336 for ppoll */
-#define __NR_unshare                   (__NR_SYSCALL_BASE+337)
-#define __NR_set_robust_list           (__NR_SYSCALL_BASE+338)
-#define __NR_get_robust_list           (__NR_SYSCALL_BASE+339)
-#define __NR_splice                    (__NR_SYSCALL_BASE+340)
-#define __NR_arm_sync_file_range       (__NR_SYSCALL_BASE+341)
-#define __NR_sync_file_range2          __NR_arm_sync_file_range
-#define __NR_tee                       (__NR_SYSCALL_BASE+342)
-#define __NR_vmsplice                  (__NR_SYSCALL_BASE+343)
-#define __NR_move_pages                        (__NR_SYSCALL_BASE+344)
-#define __NR_getcpu                    (__NR_SYSCALL_BASE+345)
-                                       /* 346 for epoll_pwait */
-#define __NR_kexec_load                        (__NR_SYSCALL_BASE+347)
-#define __NR_utimensat                 (__NR_SYSCALL_BASE+348)
-#define __NR_signalfd                  (__NR_SYSCALL_BASE+349)
-#define __NR_timerfd_create            (__NR_SYSCALL_BASE+350)
-#define __NR_eventfd                   (__NR_SYSCALL_BASE+351)
-#define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
-#define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
-#define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
-
-/*
- * The following SWIs are ARM private.
- */
-#define __ARM_NR_BASE                  (__NR_SYSCALL_BASE+0x0f0000)
-#define __ARM_NR_breakpoint            (__ARM_NR_BASE+1)
-#define __ARM_NR_cacheflush            (__ARM_NR_BASE+2)
-#define __ARM_NR_usr26                 (__ARM_NR_BASE+3)
-#define __ARM_NR_usr32                 (__ARM_NR_BASE+4)
-#define __ARM_NR_set_tls               (__ARM_NR_BASE+5)
-
-/*
- * The following syscalls are obsolete and no longer available for EABI.
- */
-#if defined(__ARM_EABI__) && !defined(__KERNEL__)
-#undef __NR_time
-#undef __NR_umount
-#undef __NR_stime
-#undef __NR_alarm
-#undef __NR_utime
-#undef __NR_getrlimit
-#undef __NR_select
-#undef __NR_readdir
-#undef __NR_mmap
-#undef __NR_socketcall
-#undef __NR_syscall
-#undef __NR_ipc
-#endif
-
-#ifdef __KERNEL__
-
-#define __ARCH_WANT_IPC_PARSE_VERSION
-#define __ARCH_WANT_STAT64
-#define __ARCH_WANT_SYS_GETHOSTNAME
-#define __ARCH_WANT_SYS_PAUSE
-#define __ARCH_WANT_SYS_GETPGRP
-#define __ARCH_WANT_SYS_LLSEEK
-#define __ARCH_WANT_SYS_NICE
-#define __ARCH_WANT_SYS_SIGPENDING
-#define __ARCH_WANT_SYS_SIGPROCMASK
-#define __ARCH_WANT_SYS_RT_SIGACTION
-
-#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
-#define __ARCH_WANT_SYS_TIME
-#define __ARCH_WANT_SYS_OLDUMOUNT
-#define __ARCH_WANT_SYS_ALARM
-#define __ARCH_WANT_SYS_UTIME
-#define __ARCH_WANT_SYS_OLD_GETRLIMIT
-#define __ARCH_WANT_OLD_READDIR
-#define __ARCH_WANT_SYS_SOCKETCALL
-#endif
-
-/*
- * "Conditional" syscalls
- *
- * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
- * but it doesn't work on all toolchains, so we just do it by hand
- */
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
-
-/*
- * Unimplemented (or alternatively implemented) syscalls
- */
-#define __IGNORE_fadvise64_64          1
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm/user.h b/include/asm-arm/user.h
deleted file mode 100644 (file)
index 825c1e7..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef _ARM_USER_H
-#define _ARM_USER_H
-
-#include <asm/page.h>
-#include <asm/ptrace.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).  There are quite a number of
-   obstacles to being able to view the contents of the floating point
-   registers, and until these are solved you will not be able to view the
-   contents of them.  Actually, you can read in the core file and look at
-   the contents of the user struct to find out what the floating point
-   registers contain.
-   The actual 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 useful at some point.
-   All of the registers are stored as part of the upage.  The upage should
-   always be only one page.
-   DATA: The data area is stored.  We use current->end_text to
-   current->brk to pick up all of the user variables, plus any memory
-   that may have been malloced.  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 (esp) to
-   current->start_stack, so we round each of these off in order to be able
-   to write an integer number of pages.
-   The minimum core file size is 3 pages, or 12288 bytes.
-*/
-
-struct user_fp {
-       struct fp_reg {
-               unsigned int sign1:1;
-               unsigned int unused:15;
-               unsigned int sign2:1;
-               unsigned int exponent:14;
-               unsigned int j:1;
-               unsigned int mantissa1:31;
-               unsigned int mantissa0:32;
-       } fpregs[8];
-       unsigned int fpsr:32;
-       unsigned int fpcr:32;
-       unsigned char ftype[8];
-       unsigned int init_flag;
-};
-
-/* When the kernel dumps core, it starts by dumping the user struct -
-   this will be used by gdb to figure out where the data and stack segments
-   are within the file, and what virtual addresses to use. */
-struct user{
-/* We start with the registers, to mimic the way that "memory" is returned
-   from the ptrace(3,...) function.  */
-  struct pt_regs regs;         /* Where the registers are actually stored */
-/* ptrace does not yet supply these.  Someday.... */
-  int u_fpvalid;               /* True if math co-processor being used. */
-                                /* for this mess. Not yet used. */
-/* The rest of this junk is to help gdb figure out what goes where */
-  unsigned long int u_tsize;   /* Text segment size (pages). */
-  unsigned long int u_dsize;   /* Data segment size (pages). */
-  unsigned long int u_ssize;   /* Stack segment size (pages). */
-  unsigned long start_code;     /* Starting virtual address of text. */
-  unsigned long start_stack;   /* Starting virtual address of stack area.
-                                  This is actually the bottom of the stack,
-                                  the top of the stack is always found in the
-                                  esp register.  */
-  long int signal;                     /* Signal that caused the core dump. */
-  int reserved;                        /* No longer used */
-  unsigned long u_ar0;         /* Used by gdb to help find the values for */
-                               /* the registers. */
-  unsigned long magic;         /* To uniquely identify a core file */
-  char u_comm[32];             /* User command that was responsible */
-  int u_debugreg[8];
-  struct user_fp u_fp;         /* FP state */
-  struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
-                               /* the FP registers. */
-};
-#define NBPG PAGE_SIZE
-#define UPAGES 1
-#define HOST_TEXT_START_ADDR (u.start_code)
-#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-
-#endif /* _ARM_USER_H */
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h
deleted file mode 100644 (file)
index 5f9a2cb..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * linux/include/asm-arm/vfp.h
- *
- * VFP register definitions.
- * First, the standard VFP set.
- */
-
-#define FPSID                  cr0
-#define FPSCR                  cr1
-#define MVFR1                  cr6
-#define MVFR0                  cr7
-#define FPEXC                  cr8
-#define FPINST                 cr9
-#define FPINST2                        cr10
-
-/* FPSID bits */
-#define FPSID_IMPLEMENTER_BIT  (24)
-#define FPSID_IMPLEMENTER_MASK (0xff << FPSID_IMPLEMENTER_BIT)
-#define FPSID_SOFTWARE         (1<<23)
-#define FPSID_FORMAT_BIT       (21)
-#define FPSID_FORMAT_MASK      (0x3  << FPSID_FORMAT_BIT)
-#define FPSID_NODOUBLE         (1<<20)
-#define FPSID_ARCH_BIT         (16)
-#define FPSID_ARCH_MASK                (0xF  << FPSID_ARCH_BIT)
-#define FPSID_PART_BIT         (8)
-#define FPSID_PART_MASK                (0xFF << FPSID_PART_BIT)
-#define FPSID_VARIANT_BIT      (4)
-#define FPSID_VARIANT_MASK     (0xF  << FPSID_VARIANT_BIT)
-#define FPSID_REV_BIT          (0)
-#define FPSID_REV_MASK         (0xF  << FPSID_REV_BIT)
-
-/* FPEXC bits */
-#define FPEXC_EX               (1 << 31)
-#define FPEXC_EN               (1 << 30)
-#define FPEXC_DEX              (1 << 29)
-#define FPEXC_FP2V             (1 << 28)
-#define FPEXC_VV               (1 << 27)
-#define FPEXC_TFV              (1 << 26)
-#define FPEXC_LENGTH_BIT       (8)
-#define FPEXC_LENGTH_MASK      (7 << FPEXC_LENGTH_BIT)
-#define FPEXC_IDF              (1 << 7)
-#define FPEXC_IXF              (1 << 4)
-#define FPEXC_UFF              (1 << 3)
-#define FPEXC_OFF              (1 << 2)
-#define FPEXC_DZF              (1 << 1)
-#define FPEXC_IOF              (1 << 0)
-#define FPEXC_TRAP_MASK                (FPEXC_IDF|FPEXC_IXF|FPEXC_UFF|FPEXC_OFF|FPEXC_DZF|FPEXC_IOF)
-
-/* FPSCR bits */
-#define FPSCR_DEFAULT_NAN      (1<<25)
-#define FPSCR_FLUSHTOZERO      (1<<24)
-#define FPSCR_ROUND_NEAREST    (0<<22)
-#define FPSCR_ROUND_PLUSINF    (1<<22)
-#define FPSCR_ROUND_MINUSINF   (2<<22)
-#define FPSCR_ROUND_TOZERO     (3<<22)
-#define FPSCR_RMODE_BIT                (22)
-#define FPSCR_RMODE_MASK       (3 << FPSCR_RMODE_BIT)
-#define FPSCR_STRIDE_BIT       (20)
-#define FPSCR_STRIDE_MASK      (3 << FPSCR_STRIDE_BIT)
-#define FPSCR_LENGTH_BIT       (16)
-#define FPSCR_LENGTH_MASK      (7 << FPSCR_LENGTH_BIT)
-#define FPSCR_IOE              (1<<8)
-#define FPSCR_DZE              (1<<9)
-#define FPSCR_OFE              (1<<10)
-#define FPSCR_UFE              (1<<11)
-#define FPSCR_IXE              (1<<12)
-#define FPSCR_IDE              (1<<15)
-#define FPSCR_IOC              (1<<0)
-#define FPSCR_DZC              (1<<1)
-#define FPSCR_OFC              (1<<2)
-#define FPSCR_UFC              (1<<3)
-#define FPSCR_IXC              (1<<4)
-#define FPSCR_IDC              (1<<7)
-
-/* MVFR0 bits */
-#define MVFR0_A_SIMD_BIT       (0)
-#define MVFR0_A_SIMD_MASK      (0xf << MVFR0_A_SIMD_BIT)
-
-/* Bit patterns for decoding the packaged operation descriptors */
-#define VFPOPDESC_LENGTH_BIT   (9)
-#define VFPOPDESC_LENGTH_MASK  (0x07 << VFPOPDESC_LENGTH_BIT)
-#define VFPOPDESC_UNUSED_BIT   (24)
-#define VFPOPDESC_UNUSED_MASK  (0xFF << VFPOPDESC_UNUSED_BIT)
-#define VFPOPDESC_OPDESC_MASK  (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h
deleted file mode 100644 (file)
index cccb389..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * linux/include/asm-arm/vfpmacros.h
- *
- * Assembler-only file containing VFP macros and register definitions.
- */
-#include "vfp.h"
-
-@ Macros to allow building with old toolkits (with no VFP support)
-       .macro  VFPFMRX, rd, sysreg, cond
-       MRC\cond        p10, 7, \rd, \sysreg, cr0, 0    @ FMRX  \rd, \sysreg
-       .endm
-
-       .macro  VFPFMXR, sysreg, rd, cond
-       MCR\cond        p10, 7, \rd, \sysreg, cr0, 0    @ FMXR  \sysreg, \rd
-       .endm
-
-       @ read all the working registers back into the VFP
-       .macro  VFPFLDMIA, base, tmp
-#if __LINUX_ARM_ARCH__ < 6
-       LDC     p11, cr0, [\base],#33*4             @ FLDMIAX \base!, {d0-d15}
-#else
-       LDC     p11, cr0, [\base],#32*4             @ FLDMIAD \base!, {d0-d15}
-#endif
-#ifdef CONFIG_VFPv3
-       VFPFMRX \tmp, MVFR0                         @ Media and VFP Feature Register 0
-       and     \tmp, \tmp, #MVFR0_A_SIMD_MASK      @ A_SIMD field
-       cmp     \tmp, #2                            @ 32 x 64bit registers?
-       ldceql  p11, cr0, [\base],#32*4             @ FLDMIAD \base!, {d16-d31}
-       addne   \base, \base, #32*4                 @ step over unused register space
-#endif
-       .endm
-
-       @ write all the working registers out of the VFP
-       .macro  VFPFSTMIA, base, tmp
-#if __LINUX_ARM_ARCH__ < 6
-       STC     p11, cr0, [\base],#33*4             @ FSTMIAX \base!, {d0-d15}
-#else
-       STC     p11, cr0, [\base],#32*4             @ FSTMIAD \base!, {d0-d15}
-#endif
-#ifdef CONFIG_VFPv3
-       VFPFMRX \tmp, MVFR0                         @ Media and VFP Feature Register 0
-       and     \tmp, \tmp, #MVFR0_A_SIMD_MASK      @ A_SIMD field
-       cmp     \tmp, #2                            @ 32 x 64bit registers?
-       stceql  p11, cr0, [\base],#32*4             @ FSTMIAD \base!, {d16-d31}
-       addne   \base, \base, #32*4                 @ step over unused register space
-#endif
-       .endm
diff --git a/include/asm-arm/vga.h b/include/asm-arm/vga.h
deleted file mode 100644 (file)
index 1e0b913..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef ASMARM_VGA_H
-#define ASMARM_VGA_H
-
-#include <asm/hardware.h>
-#include <asm/io.h>
-
-#define VGA_MAP_MEM(x,s)       (PCIMEM_BASE + (x))
-
-#define vga_readb(x)   (*((volatile unsigned char *)x))
-#define vga_writeb(x,y)        (*((volatile unsigned char *)y) = (x))
-
-#endif
diff --git a/include/asm-arm/xor.h b/include/asm-arm/xor.h
deleted file mode 100644 (file)
index e7c4cf5..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *  linux/include/asm-arm/xor.h
- *
- *  Copyright (C) 2001 Russell King
- *
- * 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.
- */
-#include <asm-generic/xor.h>
-
-#define __XOR(a1, a2) a1 ^= a2
-
-#define GET_BLOCK_2(dst) \
-       __asm__("ldmia  %0, {%1, %2}" \
-               : "=r" (dst), "=r" (a1), "=r" (a2) \
-               : "0" (dst))
-
-#define GET_BLOCK_4(dst) \
-       __asm__("ldmia  %0, {%1, %2, %3, %4}" \
-               : "=r" (dst), "=r" (a1), "=r" (a2), "=r" (a3), "=r" (a4) \
-               : "0" (dst))
-
-#define XOR_BLOCK_2(src) \
-       __asm__("ldmia  %0!, {%1, %2}" \
-               : "=r" (src), "=r" (b1), "=r" (b2) \
-               : "0" (src)); \
-       __XOR(a1, b1); __XOR(a2, b2);
-
-#define XOR_BLOCK_4(src) \
-       __asm__("ldmia  %0!, {%1, %2, %3, %4}" \
-               : "=r" (src), "=r" (b1), "=r" (b2), "=r" (b3), "=r" (b4) \
-               : "0" (src)); \
-       __XOR(a1, b1); __XOR(a2, b2); __XOR(a3, b3); __XOR(a4, b4)
-
-#define PUT_BLOCK_2(dst) \
-       __asm__ __volatile__("stmia     %0!, {%2, %3}" \
-               : "=r" (dst) \
-               : "0" (dst), "r" (a1), "r" (a2))
-
-#define PUT_BLOCK_4(dst) \
-       __asm__ __volatile__("stmia     %0!, {%2, %3, %4, %5}" \
-               : "=r" (dst) \
-               : "0" (dst), "r" (a1), "r" (a2), "r" (a3), "r" (a4))
-
-static void
-xor_arm4regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
-{
-       unsigned int lines = bytes / sizeof(unsigned long) / 4;
-       register unsigned int a1 __asm__("r4");
-       register unsigned int a2 __asm__("r5");
-       register unsigned int a3 __asm__("r6");
-       register unsigned int a4 __asm__("r7");
-       register unsigned int b1 __asm__("r8");
-       register unsigned int b2 __asm__("r9");
-       register unsigned int b3 __asm__("ip");
-       register unsigned int b4 __asm__("lr");
-
-       do {
-               GET_BLOCK_4(p1);
-               XOR_BLOCK_4(p2);
-               PUT_BLOCK_4(p1);
-       } while (--lines);
-}
-
-static void
-xor_arm4regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-               unsigned long *p3)
-{
-       unsigned int lines = bytes / sizeof(unsigned long) / 4;
-       register unsigned int a1 __asm__("r4");
-       register unsigned int a2 __asm__("r5");
-       register unsigned int a3 __asm__("r6");
-       register unsigned int a4 __asm__("r7");
-       register unsigned int b1 __asm__("r8");
-       register unsigned int b2 __asm__("r9");
-       register unsigned int b3 __asm__("ip");
-       register unsigned int b4 __asm__("lr");
-
-       do {
-               GET_BLOCK_4(p1);
-               XOR_BLOCK_4(p2);
-               XOR_BLOCK_4(p3);
-               PUT_BLOCK_4(p1);
-       } while (--lines);
-}
-
-static void
-xor_arm4regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-               unsigned long *p3, unsigned long *p4)
-{
-       unsigned int lines = bytes / sizeof(unsigned long) / 2;
-       register unsigned int a1 __asm__("r8");
-       register unsigned int a2 __asm__("r9");
-       register unsigned int b1 __asm__("ip");
-       register unsigned int b2 __asm__("lr");
-
-       do {
-               GET_BLOCK_2(p1);
-               XOR_BLOCK_2(p2);
-               XOR_BLOCK_2(p3);
-               XOR_BLOCK_2(p4);
-               PUT_BLOCK_2(p1);
-       } while (--lines);
-}
-
-static void
-xor_arm4regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-               unsigned long *p3, unsigned long *p4, unsigned long *p5)
-{
-       unsigned int lines = bytes / sizeof(unsigned long) / 2;
-       register unsigned int a1 __asm__("r8");
-       register unsigned int a2 __asm__("r9");
-       register unsigned int b1 __asm__("ip");
-       register unsigned int b2 __asm__("lr");
-
-       do {
-               GET_BLOCK_2(p1);
-               XOR_BLOCK_2(p2);
-               XOR_BLOCK_2(p3);
-               XOR_BLOCK_2(p4);
-               XOR_BLOCK_2(p5);
-               PUT_BLOCK_2(p1);
-       } while (--lines);
-}
-
-static struct xor_block_template xor_block_arm4regs = {
-       .name   = "arm4regs",
-       .do_2   = xor_arm4regs_2,
-       .do_3   = xor_arm4regs_3,
-       .do_4   = xor_arm4regs_4,
-       .do_5   = xor_arm4regs_5,
-};
-
-#undef XOR_TRY_TEMPLATES
-#define XOR_TRY_TEMPLATES                      \
-       do {                                    \
-               xor_speed(&xor_block_arm4regs); \
-               xor_speed(&xor_block_8regs);    \
-               xor_speed(&xor_block_32regs);   \
-       } while (0)
index f184eb8c047c112151781673709154587c63f938..edcfaf5f04140bebdd30386b230346a5f85ae469 100644 (file)
 #define __NR_fallocate         324
 #define __NR_timerfd_settime   325
 #define __NR_timerfd_gettime   326
+#define __NR_signalfd4         327
+#define __NR_eventfd2          328
+#define __NR_epoll_create1     329
+#define __NR_dup3              330
+#define __NR_pipe2             331
+#define __NR_inotify_init1     332
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 325
+#define NR_syscalls 333
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 /* #define __ARCH_WANT_OLD_READDIR */
index 6d88a923c945cea5b860bb8dc8051c236740f771..cb752ba7246611d7f326af760bfbe96a1e4b2592 100644 (file)
 #define BUG_TABLE                                                      \
        . = ALIGN(8);                                                   \
        __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {             \
-               __start___bug_table = .;                                \
+               VMLINUX_SYMBOL(__start___bug_table) = .;                \
                *(__bug_table)                                          \
-               __stop___bug_table = .;                                 \
+               VMLINUX_SYMBOL(__stop___bug_table) = .;                 \
        }
 #else
 #define BUG_TABLE
 #define TRACEDATA                                                      \
        . = ALIGN(4);                                                   \
        .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {               \
-               __tracedata_start = .;                                  \
+               VMLINUX_SYMBOL(__tracedata_start) = .;                  \
                *(.tracedata)                                           \
-               __tracedata_end = .;                                    \
+               VMLINUX_SYMBOL(__tracedata_end) = .;                    \
        }
 #else
 #define TRACEDATA
 
 #define INITCALLS                                                      \
        *(.initcallearly.init)                                          \
-       __early_initcall_end = .;                                       \
+       VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
        *(.initcall0.init)                                              \
        *(.initcall0s.init)                                             \
        *(.initcall1.init)                                              \
 
 #define PERCPU(align)                                                  \
        . = ALIGN(align);                                               \
-       __per_cpu_start = .;                                            \
+       VMLINUX_SYMBOL(__per_cpu_start) = .;                            \
        .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {          \
                *(.data.percpu)                                         \
                *(.data.percpu.shared_aligned)                          \
        }                                                               \
-       __per_cpu_end = .;
+       VMLINUX_SYMBOL(__per_cpu_end) = .;
diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild
deleted file mode 100644 (file)
index ccbe8ae..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-include include/asm-generic/Kbuild.asm
-
-header-y += break.h
-header-y += fpu.h
-header-y += fpswa.h
-header-y += ia64regs.h
-header-y += intel_intrin.h
-header-y += perfmon_default_smpl.h
-header-y += ptrace_offsets.h
-header-y += rse.h
-header-y += ucontext.h
-
-unifdef-y += gcc_intrin.h
-unifdef-y += intrinsics.h
-unifdef-y += perfmon.h
-unifdef-y += ustack.h
diff --git a/include/asm-ia64/a.out.h b/include/asm-ia64/a.out.h
deleted file mode 100644 (file)
index 193dcfb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _ASM_IA64_A_OUT_H
-#define _ASM_IA64_A_OUT_H
-
-/*
- * No a.out format has been (or should be) defined so this file is
- * just a dummy that allows us to get binfmt_elf compiled.  It
- * probably would be better to clean up binfmt_elf.c so it does not
- * necessarily depend on there being a.out support.
- *
- * Modified 1998-2002
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
- */
-
-#include <linux/types.h>
-
-struct exec {
-       unsigned long a_info;
-       unsigned long a_text;
-       unsigned long a_data;
-       unsigned long a_bss;
-       unsigned long a_entry;
-};
-
-#define N_TXTADDR(x)   0
-#define N_DATADDR(x)   0
-#define N_BSSADDR(x)   0
-#define N_DRSIZE(x)    0
-#define N_TRSIZE(x)    0
-#define N_SYMSIZE(x)   0
-#define N_TXTOFF(x)    0
-
-#endif /* _ASM_IA64_A_OUT_H */
diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h
deleted file mode 100644 (file)
index 734d137..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P.
- *     Alex Williamson <alex.williamson@hp.com>
- *     Bjorn Helgaas <bjorn.helgaas@hp.com>
- *
- * 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.
- *
- * Vendor specific extensions to ACPI.
- */
-
-#ifndef _ASM_IA64_ACPI_EXT_H
-#define _ASM_IA64_ACPI_EXT_H
-
-#include <linux/types.h>
-#include <acpi/actypes.h>
-
-extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
-
-#endif /* _ASM_IA64_ACPI_EXT_H */
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
deleted file mode 100644 (file)
index fcfad32..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *  asm-ia64/acpi.h
- *
- *  Copyright (C) 1999 VA Linux Systems
- *  Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- *  Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
- *  Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.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 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-#ifndef _ASM_ACPI_H
-#define _ASM_ACPI_H
-
-#ifdef __KERNEL__
-
-#include <acpi/pdc_intel.h>
-
-#include <linux/init.h>
-#include <linux/numa.h>
-#include <asm/system.h>
-#include <asm/numa.h>
-
-#define COMPILER_DEPENDENT_INT64       long
-#define COMPILER_DEPENDENT_UINT64      unsigned long
-
-/*
- * Calling conventions:
- *
- * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
- * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
- * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
- * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
- */
-#define ACPI_SYSTEM_XFACE
-#define ACPI_EXTERNAL_XFACE
-#define ACPI_INTERNAL_XFACE
-#define ACPI_INTERNAL_VAR_XFACE
-
-/* Asm macros */
-
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS() local_irq_disable()
-#define ACPI_ENABLE_IRQS()  local_irq_enable()
-#define ACPI_FLUSH_CPU_CACHE()
-
-static inline int
-ia64_acpi_acquire_global_lock (unsigned int *lock)
-{
-       unsigned int old, new, val;
-       do {
-               old = *lock;
-               new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
-               val = ia64_cmpxchg4_acq(lock, new, old);
-       } while (unlikely (val != old));
-       return (new < 3) ? -1 : 0;
-}
-
-static inline int
-ia64_acpi_release_global_lock (unsigned int *lock)
-{
-       unsigned int old, new, val;
-       do {
-               old = *lock;
-               new = old & ~0x3;
-               val = ia64_cmpxchg4_acq(lock, new, old);
-       } while (unlikely (val != old));
-       return old & 0x1;
-}
-
-#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq)                            \
-       ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
-
-#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq)                            \
-       ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
-
-#define acpi_disabled 0        /* ACPI always enabled on IA64 */
-#define acpi_noirq 0   /* ACPI always enabled on IA64 */
-#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
-#define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
-#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
-static inline void disable_acpi(void) { }
-
-const char *acpi_get_sysname (void);
-int acpi_request_vector (u32 int_type);
-int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
-
-/* routines for saving/restoring kernel state */
-extern int acpi_save_state_mem(void);
-extern void acpi_restore_state_mem(void);
-extern unsigned long acpi_wakeup_address;
-
-/*
- * Record the cpei override flag and current logical cpu. This is
- * useful for CPU removal.
- */
-extern unsigned int can_cpei_retarget(void);
-extern unsigned int is_cpu_cpei_target(unsigned int cpu);
-extern void set_cpei_target_cpu(unsigned int cpu);
-extern unsigned int get_cpei_target_cpu(void);
-extern void prefill_possible_map(void);
-#ifdef CONFIG_ACPI_HOTPLUG_CPU
-extern int additional_cpus;
-#else
-#define additional_cpus 0
-#endif
-
-#ifdef CONFIG_ACPI_NUMA
-#if MAX_NUMNODES > 256
-#define MAX_PXM_DOMAINS MAX_NUMNODES
-#else
-#define MAX_PXM_DOMAINS (256)
-#endif
-extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
-extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
-#endif
-
-#define acpi_unlazy_tlb(x)
-
-#ifdef CONFIG_ACPI_NUMA
-extern cpumask_t early_cpu_possible_map;
-#define for_each_possible_early_cpu(cpu)  \
-       for_each_cpu_mask((cpu), early_cpu_possible_map)
-
-static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
-{
-       int low_cpu, high_cpu;
-       int cpu;
-       int next_nid = 0;
-
-       low_cpu = cpus_weight(early_cpu_possible_map);
-
-       high_cpu = max(low_cpu, min_cpus);
-       high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
-
-       for (cpu = low_cpu; cpu < high_cpu; cpu++) {
-               cpu_set(cpu, early_cpu_possible_map);
-               if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
-                       node_cpuid[cpu].nid = next_nid;
-                       next_nid++;
-                       if (next_nid >= num_online_nodes())
-                               next_nid = 0;
-               }
-       }
-}
-#endif /* CONFIG_ACPI_NUMA */
-
-#endif /*__KERNEL__*/
-
-#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-ia64/agp.h b/include/asm-ia64/agp.h
deleted file mode 100644 (file)
index c11fdd8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _ASM_IA64_AGP_H
-#define _ASM_IA64_AGP_H
-
-/*
- * IA-64 specific AGP definitions.
- *
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-/*
- * To avoid memory-attribute aliasing issues, we require that the AGPGART engine operate
- * in coherent mode, which lets us map the AGP memory as normal (write-back) memory
- * (unlike x86, where it gets mapped "write-coalescing").
- */
-#define map_page_into_agp(page)                /* nothing */
-#define unmap_page_from_agp(page)      /* nothing */
-#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 /* _ASM_IA64_AGP_H */
diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h
deleted file mode 100644 (file)
index c1642fd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef _ASM_IA64_ASMMACRO_H
-#define _ASM_IA64_ASMMACRO_H
-
-/*
- * Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#define ENTRY(name)                            \
-       .align 32;                              \
-       .proc name;                             \
-name:
-
-#define ENTRY_MIN_ALIGN(name)                  \
-       .align 16;                              \
-       .proc name;                             \
-name:
-
-#define GLOBAL_ENTRY(name)                     \
-       .global name;                           \
-       ENTRY(name)
-
-#define END(name)                              \
-       .endp name
-
-/*
- * Helper macros to make unwind directives more readable:
- */
-
-/* prologue_gr: */
-#define ASM_UNW_PRLG_RP                        0x8
-#define ASM_UNW_PRLG_PFS               0x4
-#define ASM_UNW_PRLG_PSP               0x2
-#define ASM_UNW_PRLG_PR                        0x1
-#define ASM_UNW_PRLG_GRSAVE(ninputs)   (32+(ninputs))
-
-/*
- * Helper macros for accessing user memory.
- *
- * When adding any new .section/.previous entries here, make sure to
- * also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or
- * unpleasant things will happen.
- */
-
-       .section "__ex_table", "a"              // declare section & section attributes
-       .previous
-
-# define EX(y,x...)                            \
-       .xdata4 "__ex_table", 99f-., y-.;       \
-  [99:]        x
-# define EXCLR(y,x...)                         \
-       .xdata4 "__ex_table", 99f-., y-.+4;     \
-  [99:]        x
-
-/*
- * Tag MCA recoverable instruction ranges.
- */
-
-       .section "__mca_table", "a"             // declare section & section attributes
-       .previous
-
-# define MCA_RECOVER_RANGE(y)                  \
-       .xdata4 "__mca_table", y-., 99f-.;      \
-  [99:]
-
-/*
- * Mark instructions that need a load of a virtual address patched to be
- * a load of a physical address.  We use this either in critical performance
- * path (ivt.S - TLB miss processing) or in places where it might not be
- * safe to use a "tpa" instruction (mca_asm.S - error recovery).
- */
-       .section ".data.patch.vtop", "a"        // declare section & section attributes
-       .previous
-
-#define        LOAD_PHYSICAL(pr, reg, obj)             \
-[1:](pr)movl reg = obj;                                \
-       .xdata4 ".data.patch.vtop", 1b-.
-
-/*
- * For now, we always put in the McKinley E9 workaround.  On CPUs that don't need it,
- * we'll patch out the work-around bundles with NOPs, so their impact is minimal.
- */
-#define DO_MCKINLEY_E9_WORKAROUND
-
-#ifdef DO_MCKINLEY_E9_WORKAROUND
-       .section ".data.patch.mckinley_e9", "a"
-       .previous
-/* workaround for Itanium 2 Errata 9: */
-# define FSYS_RETURN                                   \
-       .xdata4 ".data.patch.mckinley_e9", 1f-.;        \
-1:{ .mib;                                              \
-       nop.m 0;                                        \
-       mov r16=ar.pfs;                                 \
-       br.call.sptk.many b7=2f;;                       \
-  };                                                   \
-2:{ .mib;                                              \
-       nop.m 0;                                        \
-       mov ar.pfs=r16;                                 \
-       br.ret.sptk.many b6;;                           \
-  }
-#else
-# define FSYS_RETURN   br.ret.sptk.many b6
-#endif
-
-/*
- * If physical stack register size is different from DEF_NUM_STACK_REG,
- * dynamically patch the kernel for correct size.
- */
-       .section ".data.patch.phys_stack_reg", "a"
-       .previous
-#define LOAD_PHYS_STACK_REG_SIZE(reg)                  \
-[1:]   adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0;        \
-       .xdata4 ".data.patch.phys_stack_reg", 1b-.
-
-/*
- * Up until early 2004, use of .align within a function caused bad unwind info.
- * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
- * otherwise.
- */
-#ifdef HAVE_WORKING_TEXT_ALIGN
-# define TEXT_ALIGN(n) .align n
-#else
-# define TEXT_ALIGN(n)
-#endif
-
-#ifdef HAVE_SERIALIZE_DIRECTIVE
-# define dv_serialize_data             .serialize.data
-# define dv_serialize_instruction      .serialize.instruction
-#else
-# define dv_serialize_data
-# define dv_serialize_instruction
-#endif
-
-#endif /* _ASM_IA64_ASMMACRO_H */
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
deleted file mode 100644 (file)
index 50c2b83..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#ifndef _ASM_IA64_ATOMIC_H
-#define _ASM_IA64_ATOMIC_H
-
-/*
- * Atomic operations that C can't guarantee us.  Useful for
- * resource counting etc..
- *
- * NOTE: don't mess with the types below!  The "unsigned long" and
- * "int" types were carefully placed so as to ensure proper operation
- * of the macros.
- *
- * Copyright (C) 1998, 1999, 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-#include <linux/types.h>
-
-#include <asm/intrinsics.h>
-#include <asm/system.h>
-
-/*
- * On IA-64, counter must always be volatile to ensure that that the
- * memory accesses are ordered.
- */
-typedef struct { volatile __s32 counter; } atomic_t;
-typedef struct { volatile __s64 counter; } atomic64_t;
-
-#define ATOMIC_INIT(i)         ((atomic_t) { (i) })
-#define ATOMIC64_INIT(i)       ((atomic64_t) { (i) })
-
-#define atomic_read(v)         ((v)->counter)
-#define atomic64_read(v)       ((v)->counter)
-
-#define atomic_set(v,i)                (((v)->counter) = (i))
-#define atomic64_set(v,i)      (((v)->counter) = (i))
-
-static __inline__ int
-ia64_atomic_add (int i, atomic_t *v)
-{
-       __s32 old, new;
-       CMPXCHG_BUGCHECK_DECL
-
-       do {
-               CMPXCHG_BUGCHECK(v);
-               old = atomic_read(v);
-               new = old + i;
-       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
-       return new;
-}
-
-static __inline__ int
-ia64_atomic64_add (__s64 i, atomic64_t *v)
-{
-       __s64 old, new;
-       CMPXCHG_BUGCHECK_DECL
-
-       do {
-               CMPXCHG_BUGCHECK(v);
-               old = atomic64_read(v);
-               new = old + i;
-       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
-       return new;
-}
-
-static __inline__ int
-ia64_atomic_sub (int i, atomic_t *v)
-{
-       __s32 old, new;
-       CMPXCHG_BUGCHECK_DECL
-
-       do {
-               CMPXCHG_BUGCHECK(v);
-               old = atomic_read(v);
-               new = old - i;
-       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
-       return new;
-}
-
-static __inline__ int
-ia64_atomic64_sub (__s64 i, atomic64_t *v)
-{
-       __s64 old, new;
-       CMPXCHG_BUGCHECK_DECL
-
-       do {
-               CMPXCHG_BUGCHECK(v);
-               old = atomic64_read(v);
-               new = old - i;
-       } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
-       return new;
-}
-
-#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
-#define atomic64_cmpxchg(v, old, new) \
-       (cmpxchg(&((v)->counter), old, new))
-#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
-
-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)
-
-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_return(i,v)                                         \
-({                                                                     \
-       int __ia64_aar_i = (i);                                         \
-       (__builtin_constant_p(i)                                        \
-        && (   (__ia64_aar_i ==  1) || (__ia64_aar_i ==   4)           \
-            || (__ia64_aar_i ==  8) || (__ia64_aar_i ==  16)           \
-            || (__ia64_aar_i == -1) || (__ia64_aar_i ==  -4)           \
-            || (__ia64_aar_i == -8) || (__ia64_aar_i == -16)))         \
-               ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter)       \
-               : ia64_atomic_add(__ia64_aar_i, v);                     \
-})
-
-#define atomic64_add_return(i,v)                                       \
-({                                                                     \
-       long __ia64_aar_i = (i);                                        \
-       (__builtin_constant_p(i)                                        \
-        && (   (__ia64_aar_i ==  1) || (__ia64_aar_i ==   4)           \
-            || (__ia64_aar_i ==  8) || (__ia64_aar_i ==  16)           \
-            || (__ia64_aar_i == -1) || (__ia64_aar_i ==  -4)           \
-            || (__ia64_aar_i == -8) || (__ia64_aar_i == -16)))         \
-               ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter)       \
-               : ia64_atomic64_add(__ia64_aar_i, v);                   \
-})
-
-/*
- * Atomically add I to V and return TRUE if the resulting value is
- * negative.
- */
-static __inline__ int
-atomic_add_negative (int i, atomic_t *v)
-{
-       return atomic_add_return(i, v) < 0;
-}
-
-static __inline__ int
-atomic64_add_negative (__s64 i, atomic64_t *v)
-{
-       return atomic64_add_return(i, v) < 0;
-}
-
-#define atomic_sub_return(i,v)                                         \
-({                                                                     \
-       int __ia64_asr_i = (i);                                         \
-       (__builtin_constant_p(i)                                        \
-        && (   (__ia64_asr_i ==   1) || (__ia64_asr_i ==   4)          \
-            || (__ia64_asr_i ==   8) || (__ia64_asr_i ==  16)          \
-            || (__ia64_asr_i ==  -1) || (__ia64_asr_i ==  -4)          \
-            || (__ia64_asr_i ==  -8) || (__ia64_asr_i == -16)))        \
-               ? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter)      \
-               : ia64_atomic_sub(__ia64_asr_i, v);                     \
-})
-
-#define atomic64_sub_return(i,v)                                       \
-({                                                                     \
-       long __ia64_asr_i = (i);                                        \
-       (__builtin_constant_p(i)                                        \
-        && (   (__ia64_asr_i ==   1) || (__ia64_asr_i ==   4)          \
-            || (__ia64_asr_i ==   8) || (__ia64_asr_i ==  16)          \
-            || (__ia64_asr_i ==  -1) || (__ia64_asr_i ==  -4)          \
-            || (__ia64_asr_i ==  -8) || (__ia64_asr_i == -16)))        \
-               ? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter)      \
-               : ia64_atomic64_sub(__ia64_asr_i, v);                   \
-})
-
-#define atomic_dec_return(v)           atomic_sub_return(1, (v))
-#define atomic_inc_return(v)           atomic_add_return(1, (v))
-#define atomic64_dec_return(v)         atomic64_sub_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 atomic_dec_and_test(v)         (atomic_sub_return(1, (v)) == 0)
-#define atomic_inc_and_test(v)         (atomic_add_return(1, (v)) == 0)
-#define atomic64_sub_and_test(i,v)     (atomic64_sub_return((i), (v)) == 0)
-#define atomic64_dec_and_test(v)       (atomic64_sub_return(1, (v)) == 0)
-#define atomic64_inc_and_test(v)       (atomic64_add_return(1, (v)) == 0)
-
-#define atomic_add(i,v)                        atomic_add_return((i), (v))
-#define atomic_sub(i,v)                        atomic_sub_return((i), (v))
-#define atomic_inc(v)                  atomic_add(1, (v))
-#define atomic_dec(v)                  atomic_sub(1, (v))
-
-#define atomic64_add(i,v)              atomic64_add_return((i), (v))
-#define atomic64_sub(i,v)              atomic64_sub_return((i), (v))
-#define atomic64_inc(v)                        atomic64_add(1, (v))
-#define atomic64_dec(v)                        atomic64_sub(1, (v))
-
-/* Atomic operations are already serializing */
-#define smp_mb__before_atomic_dec()    barrier()
-#define smp_mb__after_atomic_dec()     barrier()
-#define smp_mb__before_atomic_inc()    barrier()
-#define smp_mb__after_atomic_inc()     barrier()
-
-#include <asm-generic/atomic.h>
-#endif /* _ASM_IA64_ATOMIC_H */
diff --git a/include/asm-ia64/auxvec.h b/include/asm-ia64/auxvec.h
deleted file mode 100644 (file)
index 23cebe5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_IA64_AUXVEC_H
-#define _ASM_IA64_AUXVEC_H
-
-/*
- * Architecture-neutral AT_ values are in the range 0-17.  Leave some room for more of
- * them, start the architecture-specific ones at 32.
- */
-#define AT_SYSINFO     32
-#define AT_SYSINFO_EHDR        33
-
-#endif /* _ASM_IA64_AUXVEC_H */
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
deleted file mode 100644 (file)
index e2ca800..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-#ifndef _ASM_IA64_BITOPS_H
-#define _ASM_IA64_BITOPS_H
-
-/*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * 02/06/02 find_next_bit() and find_first_bit() added from Erich Focht's ia64
- * O(1) scheduler patch
- */
-
-#ifndef _LINUX_BITOPS_H
-#error only <linux/bitops.h> can be included directly
-#endif
-
-#include <linux/compiler.h>
-#include <linux/types.h>
-#include <asm/intrinsics.h>
-
-/**
- * set_bit - Atomically set a bit in memory
- * @nr: the bit to set
- * @addr: the address to start counting from
- *
- * This function is atomic and may not be reordered.  See __set_bit()
- * if you do not require the atomic guarantees.
- * Note that @nr may be almost arbitrarily large; this function is not
- * restricted to acting on a single-word quantity.
- *
- * The address must be (at least) "long" aligned.
- * Note that there are driver (e.g., eepro100) which use these operations to
- * operate on hw-defined data-structures, so we can't easily change these
- * operations to force a bigger alignment.
- *
- * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
- */
-static __inline__ void
-set_bit (int nr, volatile void *addr)
-{
-       __u32 bit, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       bit = 1 << (nr & 31);
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old | bit;
-       } while (cmpxchg_acq(m, old, new) != old);
-}
-
-/**
- * __set_bit - Set a bit in memory
- * @nr: the bit to set
- * @addr: the address to start counting from
- *
- * Unlike set_bit(), this function is non-atomic and may be reordered.
- * If it's called on the same region of memory simultaneously, the effect
- * may be that only one operation succeeds.
- */
-static __inline__ void
-__set_bit (int nr, volatile void *addr)
-{
-       *((__u32 *) addr + (nr >> 5)) |= (1 << (nr & 31));
-}
-
-/*
- * clear_bit() has "acquire" semantics.
- */
-#define smp_mb__before_clear_bit()     smp_mb()
-#define smp_mb__after_clear_bit()      do { /* skip */; } while (0)
-
-/**
- * clear_bit - Clears a bit in memory
- * @nr: Bit to clear
- * @addr: Address to start counting from
- *
- * clear_bit() is atomic and may not be reordered.  However, it does
- * not contain a memory barrier, so if it is used for locking purposes,
- * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
- * in order to ensure changes are visible on other processors.
- */
-static __inline__ void
-clear_bit (int nr, volatile void *addr)
-{
-       __u32 mask, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       mask = ~(1 << (nr & 31));
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old & mask;
-       } while (cmpxchg_acq(m, old, new) != old);
-}
-
-/**
- * clear_bit_unlock - Clears a bit in memory with release
- * @nr: Bit to clear
- * @addr: Address to start counting from
- *
- * clear_bit_unlock() is atomic and may not be reordered.  It does
- * contain a memory barrier suitable for unlock type operations.
- */
-static __inline__ void
-clear_bit_unlock (int nr, volatile void *addr)
-{
-       __u32 mask, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       mask = ~(1 << (nr & 31));
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old & mask;
-       } while (cmpxchg_rel(m, old, new) != old);
-}
-
-/**
- * __clear_bit_unlock - Non-atomically clears a bit in memory with release
- * @nr: Bit to clear
- * @addr: Address to start counting from
- *
- * Similarly to clear_bit_unlock, the implementation uses a store
- * with release semantics. See also __raw_spin_unlock().
- */
-static __inline__ void
-__clear_bit_unlock(int nr, void *addr)
-{
-       __u32 * const m = (__u32 *) addr + (nr >> 5);
-       __u32 const new = *m & ~(1 << (nr & 31));
-
-       ia64_st4_rel_nta(m, new);
-}
-
-/**
- * __clear_bit - Clears a bit in memory (non-atomic version)
- * @nr: the bit to clear
- * @addr: the address to start counting from
- *
- * Unlike clear_bit(), this function is non-atomic and may be reordered.
- * If it's called on the same region of memory simultaneously, the effect
- * may be that only one operation succeeds.
- */
-static __inline__ void
-__clear_bit (int nr, volatile void *addr)
-{
-       *((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
-}
-
-/**
- * change_bit - Toggle a bit in memory
- * @nr: Bit to toggle
- * @addr: Address to start counting from
- *
- * change_bit() is atomic and may not be reordered.
- * Note that @nr may be almost arbitrarily large; this function is not
- * restricted to acting on a single-word quantity.
- */
-static __inline__ void
-change_bit (int nr, volatile void *addr)
-{
-       __u32 bit, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       bit = (1 << (nr & 31));
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old ^ bit;
-       } while (cmpxchg_acq(m, old, new) != old);
-}
-
-/**
- * __change_bit - Toggle a bit in memory
- * @nr: the bit to toggle
- * @addr: the address to start counting from
- *
- * Unlike change_bit(), this function is non-atomic and may be reordered.
- * If it's called on the same region of memory simultaneously, the effect
- * may be that only one operation succeeds.
- */
-static __inline__ void
-__change_bit (int nr, volatile void *addr)
-{
-       *((__u32 *) addr + (nr >> 5)) ^= (1 << (nr & 31));
-}
-
-/**
- * test_and_set_bit - Set a bit and return its old value
- * @nr: Bit to set
- * @addr: Address to count from
- *
- * This operation is atomic and cannot be reordered.  
- * It also implies the acquisition side of the memory barrier.
- */
-static __inline__ int
-test_and_set_bit (int nr, volatile void *addr)
-{
-       __u32 bit, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       bit = 1 << (nr & 31);
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old | bit;
-       } while (cmpxchg_acq(m, old, new) != old);
-       return (old & bit) != 0;
-}
-
-/**
- * test_and_set_bit_lock - Set a bit and return its old value for lock
- * @nr: Bit to set
- * @addr: Address to count from
- *
- * This is the same as test_and_set_bit on ia64
- */
-#define test_and_set_bit_lock test_and_set_bit
-
-/**
- * __test_and_set_bit - Set a bit and return its old value
- * @nr: Bit to set
- * @addr: Address to count from
- *
- * This operation is non-atomic and can be reordered.  
- * If two examples of this operation race, one can appear to succeed
- * but actually fail.  You must protect multiple accesses with a lock.
- */
-static __inline__ int
-__test_and_set_bit (int nr, volatile void *addr)
-{
-       __u32 *p = (__u32 *) addr + (nr >> 5);
-       __u32 m = 1 << (nr & 31);
-       int oldbitset = (*p & m) != 0;
-
-       *p |= m;
-       return oldbitset;
-}
-
-/**
- * test_and_clear_bit - Clear a bit and return its old value
- * @nr: Bit to clear
- * @addr: Address to count from
- *
- * This operation is atomic and cannot be reordered.  
- * It also implies the acquisition side of the memory barrier.
- */
-static __inline__ int
-test_and_clear_bit (int nr, volatile void *addr)
-{
-       __u32 mask, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       mask = ~(1 << (nr & 31));
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old & mask;
-       } while (cmpxchg_acq(m, old, new) != old);
-       return (old & ~mask) != 0;
-}
-
-/**
- * __test_and_clear_bit - Clear a bit and return its old value
- * @nr: Bit to clear
- * @addr: Address to count from
- *
- * This operation is non-atomic and can be reordered.  
- * If two examples of this operation race, one can appear to succeed
- * but actually fail.  You must protect multiple accesses with a lock.
- */
-static __inline__ int
-__test_and_clear_bit(int nr, volatile void * addr)
-{
-       __u32 *p = (__u32 *) addr + (nr >> 5);
-       __u32 m = 1 << (nr & 31);
-       int oldbitset = *p & m;
-
-       *p &= ~m;
-       return oldbitset;
-}
-
-/**
- * test_and_change_bit - Change a bit and return its old value
- * @nr: Bit to change
- * @addr: Address to count from
- *
- * This operation is atomic and cannot be reordered.  
- * It also implies the acquisition side of the memory barrier.
- */
-static __inline__ int
-test_and_change_bit (int nr, volatile void *addr)
-{
-       __u32 bit, old, new;
-       volatile __u32 *m;
-       CMPXCHG_BUGCHECK_DECL
-
-       m = (volatile __u32 *) addr + (nr >> 5);
-       bit = (1 << (nr & 31));
-       do {
-               CMPXCHG_BUGCHECK(m);
-               old = *m;
-               new = old ^ bit;
-       } while (cmpxchg_acq(m, old, new) != old);
-       return (old & bit) != 0;
-}
-
-/**
- * __test_and_change_bit - Change a bit and return its old value
- * @nr: Bit to change
- * @addr: Address to count from
- *
- * This operation is non-atomic and can be reordered.
- */
-static __inline__ int
-__test_and_change_bit (int nr, void *addr)
-{
-       __u32 old, bit = (1 << (nr & 31));
-       __u32 *m = (__u32 *) addr + (nr >> 5);
-
-       old = *m;
-       *m = old ^ bit;
-       return (old & bit) != 0;
-}
-
-static __inline__ int
-test_bit (int nr, const volatile void *addr)
-{
-       return 1 & (((const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
-}
-
-/**
- * ffz - find the first zero bit in a long word
- * @x: The long word to find the bit in
- *
- * Returns the bit-number (0..63) of the first (least significant) zero bit.
- * Undefined if no zero exists, so code should check against ~0UL first...
- */
-static inline unsigned long
-ffz (unsigned long x)
-{
-       unsigned long result;
-
-       result = ia64_popcnt(x & (~x - 1));
-       return result;
-}
-
-/**
- * __ffs - find first bit in word.
- * @x: The word to search
- *
- * Undefined if no bit exists, so code should check against 0 first.
- */
-static __inline__ unsigned long
-__ffs (unsigned long x)
-{
-       unsigned long result;
-
-       result = ia64_popcnt((x-1) & ~x);
-       return result;
-}
-
-#ifdef __KERNEL__
-
-/*
- * Return bit number of last (most-significant) bit set.  Undefined
- * for x==0.  Bits are numbered from 0..63 (e.g., ia64_fls(9) == 3).
- */
-static inline unsigned long
-ia64_fls (unsigned long x)
-{
-       long double d = x;
-       long exp;
-
-       exp = ia64_getf_exp(d);
-       return exp - 0xffff;
-}
-
-/*
- * Find the last (most significant) bit set.  Returns 0 for x==0 and
- * bits are numbered from 1..32 (e.g., fls(9) == 4).
- */
-static inline int
-fls (int t)
-{
-       unsigned long x = t & 0xffffffffu;
-
-       if (!x)
-               return 0;
-       x |= x >> 1;
-       x |= x >> 2;
-       x |= x >> 4;
-       x |= x >> 8;
-       x |= x >> 16;
-       return ia64_popcnt(x);
-}
-
-/*
- * Find the last (most significant) bit set.  Undefined for x==0.
- * Bits are numbered from 0..63 (e.g., __fls(9) == 3).
- */
-static inline unsigned long
-__fls (unsigned long x)
-{
-       x |= x >> 1;
-       x |= x >> 2;
-       x |= x >> 4;
-       x |= x >> 8;
-       x |= x >> 16;
-       x |= x >> 32;
-       return ia64_popcnt(x) - 1;
-}
-
-#include <asm-generic/bitops/fls64.h>
-
-/*
- * 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
- * ffz (man ffs): it operates on "int" values only and the result value is the
- * bit number + 1.  ffs(0) is defined to return zero.
- */
-#define ffs(x) __builtin_ffs(x)
-
-/*
- * hweightN: returns the hamming weight (i.e. the number
- * of bits set) of a N-bit word
- */
-static __inline__ unsigned long
-hweight64 (unsigned long x)
-{
-       unsigned long result;
-       result = ia64_popcnt(x);
-       return result;
-}
-
-#define hweight32(x)   (unsigned int) hweight64((x) & 0xfffffffful)
-#define hweight16(x)   (unsigned int) hweight64((x) & 0xfffful)
-#define hweight8(x)    (unsigned int) hweight64((x) & 0xfful)
-
-#endif /* __KERNEL__ */
-
-#include <asm-generic/bitops/find.h>
-
-#ifdef __KERNEL__
-
-#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>
-#include <asm-generic/bitops/sched.h>
-
-#endif /* __KERNEL__ */
-
-#endif /* _ASM_IA64_BITOPS_H */
diff --git a/include/asm-ia64/break.h b/include/asm-ia64/break.h
deleted file mode 100644 (file)
index f034020..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _ASM_IA64_BREAK_H
-#define _ASM_IA64_BREAK_H
-
-/*
- * IA-64 Linux break numbers.
- *
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-/*
- * OS-specific debug break numbers:
- */
-#define __IA64_BREAK_KDB               0x80100
-#define __IA64_BREAK_KPROBE            0x81000 /* .. 0x81fff */
-#define __IA64_BREAK_JPROBE            0x82000
-
-/*
- * OS-specific break numbers:
- */
-#define __IA64_BREAK_SYSCALL           0x100000
-
-#endif /* _ASM_IA64_BREAK_H */
diff --git a/include/asm-ia64/bug.h b/include/asm-ia64/bug.h
deleted file mode 100644 (file)
index 823616b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _ASM_IA64_BUG_H
-#define _ASM_IA64_BUG_H
-
-#ifdef CONFIG_BUG
-#define ia64_abort()   __builtin_trap()
-#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
-
-/* should this BUG be made generic? */
-#define HAVE_ARCH_BUG
-#endif
-
-#include <asm-generic/bug.h>
-
-#endif
diff --git a/include/asm-ia64/bugs.h b/include/asm-ia64/bugs.h
deleted file mode 100644 (file)
index 433523e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * This is included by init/main.c to check for architecture-dependent bugs.
- *
- * Needs:
- *     void check_bugs(void);
- *
- * Based on <asm-alpha/bugs.h>.
- *
- * Modified 1998, 1999, 2003
- *     David Mosberger-Tang <davidm@hpl.hp.com>,  Hewlett-Packard Co.
- */
-#ifndef _ASM_IA64_BUGS_H
-#define _ASM_IA64_BUGS_H
-
-#include <asm/processor.h>
-
-extern void check_bugs (void);
-
-#endif /* _ASM_IA64_BUGS_H */
diff --git a/include/asm-ia64/byteorder.h b/include/asm-ia64/byteorder.h
deleted file mode 100644 (file)
index 69bd41d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ASM_IA64_BYTEORDER_H
-#define _ASM_IA64_BYTEORDER_H
-
-/*
- * Modified 1998, 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
- */
-
-#include <asm/types.h>
-#include <asm/intrinsics.h>
-#include <linux/compiler.h>
-
-static __inline__ __attribute_const__ __u64
-__ia64_swab64 (__u64 x)
-{
-       __u64 result;
-
-       result = ia64_mux1(x, ia64_mux1_rev);
-       return result;
-}
-
-static __inline__ __attribute_const__ __u32
-__ia64_swab32 (__u32 x)
-{
-       return __ia64_swab64(x) >> 32;
-}
-
-static __inline__ __attribute_const__ __u16
-__ia64_swab16(__u16 x)
-{
-       return __ia64_swab64(x) >> 48;
-}
-
-#define __arch__swab64(x) __ia64_swab64(x)
-#define __arch__swab32(x) __ia64_swab32(x)
-#define __arch__swab16(x) __ia64_swab16(x)
-
-#define __BYTEORDER_HAS_U64__
-
-#include <linux/byteorder/little_endian.h>
-
-#endif /* _ASM_IA64_BYTEORDER_H */
diff --git a/include/asm-ia64/cache.h b/include/asm-ia64/cache.h
deleted file mode 100644 (file)
index e7482bd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _ASM_IA64_CACHE_H
-#define _ASM_IA64_CACHE_H
-
-
-/*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-/* Bytes per L1 (data) cache line.  */
-#define L1_CACHE_SHIFT         CONFIG_IA64_L1_CACHE_SHIFT
-#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
-
-#ifdef CONFIG_SMP
-# define SMP_CACHE_SHIFT       L1_CACHE_SHIFT
-# define SMP_CACHE_BYTES       L1_CACHE_BYTES
-#else
-  /*
-   * The "aligned" directive can only _increase_ alignment, so this is
-   * safe and provides an easy way to avoid wasting space on a
-   * uni-processor:
-   */
-# define SMP_CACHE_SHIFT       3
-# define SMP_CACHE_BYTES       (1 << 3)
-#endif
-
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
-#endif /* _ASM_IA64_CACHE_H */
diff --git a/include/asm-ia64/cacheflush.h b/include/asm-ia64/cacheflush.h
deleted file mode 100644 (file)
index afcfbda..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _ASM_IA64_CACHEFLUSH_H
-#define _ASM_IA64_CACHEFLUSH_H
-
-/*
- * Copyright (C) 2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <linux/page-flags.h>
-#include <linux/bitops.h>
-
-#include <asm/page.h>
-
-/*
- * Cache flushing routines.  This is the kind of stuff that can be very expensive, so try
- * to avoid them whenever possible.
- */
-
-#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_icache_page(vma,page)            do { } while (0)
-#define flush_cache_vmap(start, end)           do { } while (0)
-#define flush_cache_vunmap(start, end)         do { } while (0)
-
-#define flush_dcache_page(page)                        \
-do {                                           \
-       clear_bit(PG_arch_1, &(page)->flags);   \
-} while (0)
-
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-
-extern void flush_icache_range (unsigned long start, unsigned long end);
-
-#define flush_icache_user_range(vma, page, user_addr, len)                                     \
-do {                                                                                           \
-       unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK);  \
-       flush_icache_range(_addr, _addr + (len));                                               \
-} while (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 /* _ASM_IA64_CACHEFLUSH_H */
diff --git a/include/asm-ia64/checksum.h b/include/asm-ia64/checksum.h
deleted file mode 100644 (file)
index 97af155..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef _ASM_IA64_CHECKSUM_H
-#define _ASM_IA64_CHECKSUM_H
-
-/*
- * Modified 1998, 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-/*
- * 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);
-
-extern __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);
-
-/*
- * Same as csum_partial, but copies from src while it checksums.
- *
- * Here it is even more important to align src and dst on a 32-bit (or
- * even better 64-bit) boundary.
- */
-extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
-                                                int len, __wsum sum,
-                                                int *errp);
-
-extern __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   1
-struct in6_addr;
-extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
-       const struct in6_addr *daddr, __u32 len, unsigned short proto,
-       __wsum csum);
-
-#endif /* _ASM_IA64_CHECKSUM_H */
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
deleted file mode 100644 (file)
index dfcf75b..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-#ifndef _ASM_IA64_COMPAT_H
-#define _ASM_IA64_COMPAT_H
-/*
- * Architecture specific compatibility types
- */
-#include <linux/types.h>
-
-#define COMPAT_USER_HZ 100
-
-typedef u32            compat_size_t;
-typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
-typedef s32            compat_clock_t;
-typedef s32            compat_key_t;
-typedef s32            compat_pid_t;
-typedef u16            __compat_uid_t;
-typedef u16            __compat_gid_t;
-typedef u32            __compat_uid32_t;
-typedef u32            __compat_gid32_t;
-typedef u16            compat_mode_t;
-typedef u32            compat_ino_t;
-typedef u16            compat_dev_t;
-typedef s32            compat_off_t;
-typedef s64            compat_loff_t;
-typedef u16            compat_nlink_t;
-typedef u16            compat_ipc_pid_t;
-typedef s32            compat_daddr_t;
-typedef u32            compat_caddr_t;
-typedef __kernel_fsid_t        compat_fsid_t;
-typedef s32            compat_timer_t;
-
-typedef s32            compat_int_t;
-typedef s32            compat_long_t;
-typedef s64 __attribute__((aligned(4))) compat_s64;
-typedef u32            compat_uint_t;
-typedef u32            compat_ulong_t;
-typedef u64 __attribute__((aligned(4))) compat_u64;
-
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
-struct compat_stat {
-       compat_dev_t    st_dev;
-       u16             __pad1;
-       compat_ino_t    st_ino;
-       compat_mode_t   st_mode;
-       compat_nlink_t  st_nlink;
-       __compat_uid_t  st_uid;
-       __compat_gid_t  st_gid;
-       compat_dev_t    st_rdev;
-       u16             __pad2;
-       u32             st_size;
-       u32             st_blksize;
-       u32             st_blocks;
-       u32             st_atime;
-       u32             st_atime_nsec;
-       u32             st_mtime;
-       u32             st_mtime_nsec;
-       u32             st_ctime;
-       u32             st_ctime_nsec;
-       u32             __unused4;
-       u32             __unused5;
-};
-
-struct compat_flock {
-       short           l_type;
-       short           l_whence;
-       compat_off_t    l_start;
-       compat_off_t    l_len;
-       compat_pid_t    l_pid;
-};
-
-#define F_GETLK64      12
-#define F_SETLK64      13
-#define F_SETLKW64     14
-
-/*
- * IA32 uses 4 byte alignment for 64 bit quantities,
- * so we need to pack this structure.
- */
-struct compat_flock64 {
-       short           l_type;
-       short           l_whence;
-       compat_loff_t   l_start;
-       compat_loff_t   l_len;
-       compat_pid_t    l_pid;
-} __attribute__((packed));
-
-struct compat_statfs {
-       int             f_type;
-       int             f_bsize;
-       int             f_blocks;
-       int             f_bfree;
-       int             f_bavail;
-       int             f_files;
-       int             f_ffree;
-       compat_fsid_t   f_fsid;
-       int             f_namelen;      /* SunOS ignores this field. */
-       int             f_frsize;
-       int             f_spare[5];
-};
-
-#define COMPAT_RLIM_OLD_INFINITY       0x7fffffff
-#define COMPAT_RLIM_INFINITY           0xffffffff
-
-typedef u32            compat_old_sigset_t;    /* at least 32 bits */
-
-#define _COMPAT_NSIG           64
-#define _COMPAT_NSIG_BPW       32
-
-typedef u32            compat_sigset_word;
-
-#define COMPAT_OFF_T_MAX       0x7fffffff
-#define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
-
-struct compat_ipc64_perm {
-       compat_key_t key;
-       __compat_uid32_t uid;
-       __compat_gid32_t gid;
-       __compat_uid32_t cuid;
-       __compat_gid32_t cgid;
-       unsigned short mode;
-       unsigned short __pad1;
-       unsigned short seq;
-       unsigned short __pad2;
-       compat_ulong_t unused1;
-       compat_ulong_t unused2;
-};
-
-struct compat_semid64_ds {
-       struct compat_ipc64_perm sem_perm;
-       compat_time_t  sem_otime;
-       compat_ulong_t __unused1;
-       compat_time_t  sem_ctime;
-       compat_ulong_t __unused2;
-       compat_ulong_t sem_nsems;
-       compat_ulong_t __unused3;
-       compat_ulong_t __unused4;
-};
-
-struct compat_msqid64_ds {
-       struct compat_ipc64_perm msg_perm;
-       compat_time_t  msg_stime;
-       compat_ulong_t __unused1;
-       compat_time_t  msg_rtime;
-       compat_ulong_t __unused2;
-       compat_time_t  msg_ctime;
-       compat_ulong_t __unused3;
-       compat_ulong_t msg_cbytes;
-       compat_ulong_t msg_qnum;
-       compat_ulong_t msg_qbytes;
-       compat_pid_t   msg_lspid;
-       compat_pid_t   msg_lrpid;
-       compat_ulong_t __unused4;
-       compat_ulong_t __unused5;
-};
-
-struct compat_shmid64_ds {
-       struct compat_ipc64_perm shm_perm;
-       compat_size_t  shm_segsz;
-       compat_time_t  shm_atime;
-       compat_ulong_t __unused1;
-       compat_time_t  shm_dtime;
-       compat_ulong_t __unused2;
-       compat_time_t  shm_ctime;
-       compat_ulong_t __unused3;
-       compat_pid_t   shm_cpid;
-       compat_pid_t   shm_lpid;
-       compat_ulong_t shm_nattch;
-       compat_ulong_t __unused4;
-       compat_ulong_t __unused5;
-};
-
-/*
- * A pointer passed in from user mode. This should not be used for syscall parameters,
- * just declare them as pointers because the syscall entry code will have appropriately
- * converted them already.
- */
-typedef        u32             compat_uptr_t;
-
-static inline void __user *
-compat_ptr (compat_uptr_t uptr)
-{
-       return (void __user *) (unsigned long) uptr;
-}
-
-static inline compat_uptr_t
-ptr_to_compat(void __user *uptr)
-{
-       return (u32)(unsigned long)uptr;
-}
-
-static __inline__ void __user *
-compat_alloc_user_space (long len)
-{
-       struct pt_regs *regs = task_pt_regs(current);
-       return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);
-}
-
-#endif /* _ASM_IA64_COMPAT_H */
diff --git a/include/asm-ia64/cpu.h b/include/asm-ia64/cpu.h
deleted file mode 100644 (file)
index fcca30b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _ASM_IA64_CPU_H_
-#define _ASM_IA64_CPU_H_
-
-#include <linux/device.h>
-#include <linux/cpu.h>
-#include <linux/topology.h>
-#include <linux/percpu.h>
-
-struct ia64_cpu {
-       struct cpu cpu;
-};
-
-DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
-
-DECLARE_PER_CPU(int, cpu_state);
-
-#ifdef CONFIG_HOTPLUG_CPU
-extern int arch_register_cpu(int num);
-extern void arch_unregister_cpu(int);
-#endif
-
-#endif /* _ASM_IA64_CPU_H_ */
diff --git a/include/asm-ia64/cputime.h b/include/asm-ia64/cputime.h
deleted file mode 100644 (file)
index f9abdec..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * include/asm-ia64/cputime.h:
- *             Definitions for measuring cputime on ia64 machines.
- *
- * Based on <asm-powerpc/cputime.h>.
- *
- * Copyright (C) 2007 FUJITSU LIMITED
- * Copyright (C) 2007 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.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
- * 2 of the License, or (at your option) any later version.
- *
- * If we have CONFIG_VIRT_CPU_ACCOUNTING, we measure cpu time in nsec.
- * Otherwise we measure cpu time in jiffies using the generic definitions.
- */
-
-#ifndef __IA64_CPUTIME_H
-#define __IA64_CPUTIME_H
-
-#ifndef CONFIG_VIRT_CPU_ACCOUNTING
-#include <asm-generic/cputime.h>
-#else
-
-#include <linux/time.h>
-#include <linux/jiffies.h>
-#include <asm/processor.h>
-
-typedef u64 cputime_t;
-typedef u64 cputime64_t;
-
-#define cputime_zero                   ((cputime_t)0)
-#define cputime_max                    ((~((cputime_t)0) >> 1) - 1)
-#define cputime_add(__a, __b)          ((__a) +  (__b))
-#define cputime_sub(__a, __b)          ((__a) -  (__b))
-#define cputime_div(__a, __n)          ((__a) /  (__n))
-#define cputime_halve(__a)             ((__a) >> 1)
-#define cputime_eq(__a, __b)           ((__a) == (__b))
-#define cputime_gt(__a, __b)           ((__a) >  (__b))
-#define cputime_ge(__a, __b)           ((__a) >= (__b))
-#define cputime_lt(__a, __b)           ((__a) <  (__b))
-#define cputime_le(__a, __b)           ((__a) <= (__b))
-
-#define cputime64_zero                 ((cputime64_t)0)
-#define cputime64_add(__a, __b)                ((__a) + (__b))
-#define cputime64_sub(__a, __b)                ((__a) - (__b))
-#define cputime_to_cputime64(__ct)     (__ct)
-
-/*
- * Convert cputime <-> jiffies (HZ)
- */
-#define cputime_to_jiffies(__ct)       ((__ct) / (NSEC_PER_SEC / HZ))
-#define jiffies_to_cputime(__jif)      ((__jif) * (NSEC_PER_SEC / HZ))
-#define cputime64_to_jiffies64(__ct)   ((__ct) / (NSEC_PER_SEC / HZ))
-#define jiffies64_to_cputime64(__jif)  ((__jif) * (NSEC_PER_SEC / HZ))
-
-/*
- * Convert cputime <-> milliseconds
- */
-#define cputime_to_msecs(__ct)         ((__ct) / NSEC_PER_MSEC)
-#define msecs_to_cputime(__msecs)      ((__msecs) * NSEC_PER_MSEC)
-
-/*
- * Convert cputime <-> seconds
- */
-#define cputime_to_secs(__ct)          ((__ct) / NSEC_PER_SEC)
-#define secs_to_cputime(__secs)                ((__secs) * NSEC_PER_SEC)
-
-/*
- * Convert cputime <-> timespec (nsec)
- */
-static inline cputime_t timespec_to_cputime(const struct timespec *val)
-{
-       cputime_t ret = val->tv_sec * NSEC_PER_SEC;
-       return (ret + val->tv_nsec);
-}
-static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
-{
-       val->tv_sec  = ct / NSEC_PER_SEC;
-       val->tv_nsec = ct % NSEC_PER_SEC;
-}
-
-/*
- * Convert cputime <-> timeval (msec)
- */
-static inline cputime_t timeval_to_cputime(struct timeval *val)
-{
-       cputime_t ret = val->tv_sec * NSEC_PER_SEC;
-       return (ret + val->tv_usec * NSEC_PER_USEC);
-}
-static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val)
-{
-       val->tv_sec = ct / NSEC_PER_SEC;
-       val->tv_usec = (ct % NSEC_PER_SEC) / NSEC_PER_USEC;
-}
-
-/*
- * Convert cputime <-> clock (USER_HZ)
- */
-#define cputime_to_clock_t(__ct)       ((__ct) / (NSEC_PER_SEC / USER_HZ))
-#define clock_t_to_cputime(__x)                ((__x) * (NSEC_PER_SEC / USER_HZ))
-
-/*
- * Convert cputime64 to clock.
- */
-#define cputime64_to_clock_t(__ct)      cputime_to_clock_t((cputime_t)__ct)
-
-#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
-#endif /* __IA64_CPUTIME_H */
diff --git a/include/asm-ia64/current.h b/include/asm-ia64/current.h
deleted file mode 100644 (file)
index c659f90..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_IA64_CURRENT_H
-#define _ASM_IA64_CURRENT_H
-
-/*
- * Modified 1998-2000
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <asm/intrinsics.h>
-
-/*
- * In kernel mode, thread pointer (r13) is used to point to the current task
- * structure.
- */
-#define current        ((struct task_struct *) ia64_getreg(_IA64_REG_TP))
-
-#endif /* _ASM_IA64_CURRENT_H */
diff --git a/include/asm-ia64/cyclone.h b/include/asm-ia64/cyclone.h
deleted file mode 100644 (file)
index 88f6500..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef ASM_IA64_CYCLONE_H
-#define ASM_IA64_CYCLONE_H
-
-#ifdef CONFIG_IA64_CYCLONE
-extern int use_cyclone;
-extern void __init cyclone_setup(void);
-#else  /* CONFIG_IA64_CYCLONE */
-#define use_cyclone 0
-static inline void cyclone_setup(void)
-{
-       printk(KERN_ERR "Cyclone Counter: System not configured"
-                                       " w/ CONFIG_IA64_CYCLONE.\n");
-}
-#endif /* CONFIG_IA64_CYCLONE */
-#endif /* !ASM_IA64_CYCLONE_H */
diff --git a/include/asm-ia64/delay.h b/include/asm-ia64/delay.h
deleted file mode 100644 (file)
index a30a62f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef _ASM_IA64_DELAY_H
-#define _ASM_IA64_DELAY_H
-
-/*
- * Delay routines using a pre-computed "cycles/usec" value.
- *
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 1999 VA Linux Systems
- * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
- */
-
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/compiler.h>
-
-#include <asm/intrinsics.h>
-#include <asm/processor.h>
-
-static __inline__ void
-ia64_set_itm (unsigned long val)
-{
-       ia64_setreg(_IA64_REG_CR_ITM, val);
-       ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itm (void)
-{
-       unsigned long result;
-
-       result = ia64_getreg(_IA64_REG_CR_ITM);
-       ia64_srlz_d();
-       return result;
-}
-
-static __inline__ void
-ia64_set_itv (unsigned long val)
-{
-       ia64_setreg(_IA64_REG_CR_ITV, val);
-       ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itv (void)
-{
-       return ia64_getreg(_IA64_REG_CR_ITV);
-}
-
-static __inline__ void
-ia64_set_itc (unsigned long val)
-{
-       ia64_setreg(_IA64_REG_AR_ITC, val);
-       ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itc (void)
-{
-       unsigned long result;
-
-       result = ia64_getreg(_IA64_REG_AR_ITC);
-       ia64_barrier();
-#ifdef CONFIG_ITANIUM
-       while (unlikely((__s32) result == -1)) {
-               result = ia64_getreg(_IA64_REG_AR_ITC);
-               ia64_barrier();
-       }
-#endif
-       return result;
-}
-
-extern void ia64_delay_loop (unsigned long loops);
-
-static __inline__ void
-__delay (unsigned long loops)
-{
-       if (unlikely(loops < 1))
-               return;
-
-       ia64_delay_loop (loops - 1);
-}
-
-extern void udelay (unsigned long usecs);
-
-#endif /* _ASM_IA64_DELAY_H */
diff --git a/include/asm-ia64/device.h b/include/asm-ia64/device.h
deleted file mode 100644 (file)
index 3db6daf..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#ifndef _ASM_IA64_DEVICE_H
-#define _ASM_IA64_DEVICE_H
-
-struct dev_archdata {
-#ifdef CONFIG_ACPI
-       void    *acpi_handle;
-#endif
-};
-
-#endif /* _ASM_IA64_DEVICE_H */
diff --git a/include/asm-ia64/div64.h b/include/asm-ia64/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-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
deleted file mode 100644 (file)
index 9f0df9b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef _ASM_IA64_DMA_MAPPING_H
-#define _ASM_IA64_DMA_MAPPING_H
-
-/*
- * Copyright (C) 2003-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-#include <asm/machvec.h>
-#include <linux/scatterlist.h>
-
-#define dma_alloc_coherent     platform_dma_alloc_coherent
-/* coherent mem. is cheap */
-static inline void *
-dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
-                     gfp_t flag)
-{
-       return dma_alloc_coherent(dev, size, dma_handle, flag);
-}
-#define dma_free_coherent      platform_dma_free_coherent
-static inline void
-dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
-                    dma_addr_t dma_handle)
-{
-       dma_free_coherent(dev, size, cpu_addr, dma_handle);
-}
-#define dma_map_single_attrs   platform_dma_map_single_attrs
-static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
-                                       size_t size, int dir)
-{
-       return dma_map_single_attrs(dev, cpu_addr, size, dir, NULL);
-}
-#define dma_map_sg_attrs       platform_dma_map_sg_attrs
-static inline int dma_map_sg(struct device *dev, struct scatterlist *sgl,
-                            int nents, int dir)
-{
-       return dma_map_sg_attrs(dev, sgl, nents, dir, NULL);
-}
-#define dma_unmap_single_attrs platform_dma_unmap_single_attrs
-static inline void dma_unmap_single(struct device *dev, dma_addr_t cpu_addr,
-                                   size_t size, int dir)
-{
-       return dma_unmap_single_attrs(dev, cpu_addr, size, dir, NULL);
-}
-#define dma_unmap_sg_attrs     platform_dma_unmap_sg_attrs
-static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
-                               int nents, int dir)
-{
-       return dma_unmap_sg_attrs(dev, sgl, nents, dir, NULL);
-}
-#define dma_sync_single_for_cpu        platform_dma_sync_single_for_cpu
-#define dma_sync_sg_for_cpu    platform_dma_sync_sg_for_cpu
-#define dma_sync_single_for_device platform_dma_sync_single_for_device
-#define dma_sync_sg_for_device platform_dma_sync_sg_for_device
-#define dma_mapping_error      platform_dma_mapping_error
-
-#define dma_map_page(dev, pg, off, size, dir)                          \
-       dma_map_single(dev, page_address(pg) + (off), (size), (dir))
-#define dma_unmap_page(dev, dma_addr, size, dir)                       \
-       dma_unmap_single(dev, dma_addr, size, dir)
-
-/*
- * Rest of this file is part of the "Advanced DMA API".  Use at your own risk.
- * See Documentation/DMA-API.txt for details.
- */
-
-#define dma_sync_single_range_for_cpu(dev, dma_handle, offset, size, dir)      \
-       dma_sync_single_for_cpu(dev, dma_handle, size, dir)
-#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir)   \
-       dma_sync_single_for_device(dev, dma_handle, size, dir)
-
-#define dma_supported          platform_dma_supported
-
-static inline int
-dma_set_mask (struct device *dev, u64 mask)
-{
-       if (!dev->dma_mask || !dma_supported(dev, mask))
-               return -EIO;
-       *dev->dma_mask = mask;
-       return 0;
-}
-
-extern int dma_get_cache_alignment(void);
-
-static inline void
-dma_cache_sync (struct device *dev, void *vaddr, size_t size,
-       enum dma_data_direction dir)
-{
-       /*
-        * IA-64 is cache-coherent, so this is mostly a no-op.  However, we do need to
-        * ensure that dma_cache_sync() enforces order, hence the mb().
-        */
-       mb();
-}
-
-#define dma_is_consistent(d, h)        (1)     /* all we do is coherent memory... */
-
-#endif /* _ASM_IA64_DMA_MAPPING_H */
diff --git a/include/asm-ia64/dma.h b/include/asm-ia64/dma.h
deleted file mode 100644 (file)
index 4d97f60..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASM_IA64_DMA_H
-#define _ASM_IA64_DMA_H
-
-/*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#include <asm/io.h>            /* need byte IO */
-
-extern unsigned long MAX_DMA_ADDRESS;
-
-#ifdef CONFIG_PCI
-  extern int isa_dma_bridge_buggy;
-#else
-# define isa_dma_bridge_buggy  (0)
-#endif
-
-#define free_dma(x)
-
-void dma_mark_clean(void *addr, size_t size);
-
-#endif /* _ASM_IA64_DMA_H */
diff --git a/include/asm-ia64/dmi.h b/include/asm-ia64/dmi.h
deleted file mode 100644 (file)
index 00eb1b1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_DMI_H
-#define _ASM_DMI_H 1
-
-#include <asm/io.h>
-
-/* Use normal IO mappings for DMI */
-#define dmi_ioremap ioremap
-#define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
-
-#endif
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
deleted file mode 100644 (file)
index 5e0c1a6..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#ifndef _ASM_IA64_ELF_H
-#define _ASM_IA64_ELF_H
-
-/*
- * ELF-specific definitions.
- *
- * Copyright (C) 1998-1999, 2002-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#include <asm/fpu.h>
-#include <asm/page.h>
-#include <asm/auxvec.h>
-
-/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x) ((x)->e_machine == EM_IA_64)
-
-/*
- * These are used to set parameters in the core dumps.
- */
-#define ELF_CLASS      ELFCLASS64
-#define ELF_DATA       ELFDATA2LSB
-#define ELF_ARCH       EM_IA_64
-
-#define USE_ELF_CORE_DUMP
-#define CORE_DUMP_USE_REGSET
-
-/* Least-significant four bits of ELF header's e_flags are OS-specific.  The bits are
-   interpreted as follows by Linux: */
-#define EF_IA_64_LINUX_EXECUTABLE_STACK        0x1     /* is stack (& heap) executable by default? */
-
-#define ELF_EXEC_PAGESIZE      PAGE_SIZE
-
-/*
- * 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 + 0x800000000UL)
-
-#define PT_IA_64_UNWIND                0x70000001
-
-/* IA-64 relocations: */
-#define R_IA64_NONE            0x00    /* none */
-#define R_IA64_IMM14           0x21    /* symbol + addend, add imm14 */
-#define R_IA64_IMM22           0x22    /* symbol + addend, add imm22 */
-#define R_IA64_IMM64           0x23    /* symbol + addend, mov imm64 */
-#define R_IA64_DIR32MSB                0x24    /* symbol + addend, data4 MSB */
-#define R_IA64_DIR32LSB                0x25    /* symbol + addend, data4 LSB */
-#define R_IA64_DIR64MSB                0x26    /* symbol + addend, data8 MSB */
-#define R_IA64_DIR64LSB                0x27    /* symbol + addend, data8 LSB */
-#define R_IA64_GPREL22         0x2a    /* @gprel(sym+add), add imm22 */
-#define R_IA64_GPREL64I                0x2b    /* @gprel(sym+add), mov imm64 */
-#define R_IA64_GPREL32MSB      0x2c    /* @gprel(sym+add), data4 MSB */
-#define R_IA64_GPREL32LSB      0x2d    /* @gprel(sym+add), data4 LSB */
-#define R_IA64_GPREL64MSB      0x2e    /* @gprel(sym+add), data8 MSB */
-#define R_IA64_GPREL64LSB      0x2f    /* @gprel(sym+add), data8 LSB */
-#define R_IA64_LTOFF22         0x32    /* @ltoff(sym+add), add imm22 */
-#define R_IA64_LTOFF64I                0x33    /* @ltoff(sym+add), mov imm64 */
-#define R_IA64_PLTOFF22                0x3a    /* @pltoff(sym+add), add imm22 */
-#define R_IA64_PLTOFF64I       0x3b    /* @pltoff(sym+add), mov imm64 */
-#define R_IA64_PLTOFF64MSB     0x3e    /* @pltoff(sym+add), data8 MSB */
-#define R_IA64_PLTOFF64LSB     0x3f    /* @pltoff(sym+add), data8 LSB */
-#define R_IA64_FPTR64I         0x43    /* @fptr(sym+add), mov imm64 */
-#define R_IA64_FPTR32MSB       0x44    /* @fptr(sym+add), data4 MSB */
-#define R_IA64_FPTR32LSB       0x45    /* @fptr(sym+add), data4 LSB */
-#define R_IA64_FPTR64MSB       0x46    /* @fptr(sym+add), data8 MSB */
-#define R_IA64_FPTR64LSB       0x47    /* @fptr(sym+add), data8 LSB */
-#define R_IA64_PCREL60B                0x48    /* @pcrel(sym+add), brl */
-#define R_IA64_PCREL21B                0x49    /* @pcrel(sym+add), ptb, call */
-#define R_IA64_PCREL21M                0x4a    /* @pcrel(sym+add), chk.s */
-#define R_IA64_PCREL21F                0x4b    /* @pcrel(sym+add), fchkf */
-#define R_IA64_PCREL32MSB      0x4c    /* @pcrel(sym+add), data4 MSB */
-#define R_IA64_PCREL32LSB      0x4d    /* @pcrel(sym+add), data4 LSB */
-#define R_IA64_PCREL64MSB      0x4e    /* @pcrel(sym+add), data8 MSB */
-#define R_IA64_PCREL64LSB      0x4f    /* @pcrel(sym+add), data8 LSB */
-#define R_IA64_LTOFF_FPTR22    0x52    /* @ltoff(@fptr(s+a)), imm22 */
-#define R_IA64_LTOFF_FPTR64I   0x53    /* @ltoff(@fptr(s+a)), imm64 */
-#define R_IA64_LTOFF_FPTR32MSB 0x54    /* @ltoff(@fptr(s+a)), 4 MSB */
-#define R_IA64_LTOFF_FPTR32LSB 0x55    /* @ltoff(@fptr(s+a)), 4 LSB */
-#define R_IA64_LTOFF_FPTR64MSB 0x56    /* @ltoff(@fptr(s+a)), 8 MSB */
-#define R_IA64_LTOFF_FPTR64LSB 0x57    /* @ltoff(@fptr(s+a)), 8 LSB */
-#define R_IA64_SEGREL32MSB     0x5c    /* @segrel(sym+add), data4 MSB */
-#define R_IA64_SEGREL32LSB     0x5d    /* @segrel(sym+add), data4 LSB */
-#define R_IA64_SEGREL64MSB     0x5e    /* @segrel(sym+add), data8 MSB */
-#define R_IA64_SEGREL64LSB     0x5f    /* @segrel(sym+add), data8 LSB */
-#define R_IA64_SECREL32MSB     0x64    /* @secrel(sym+add), data4 MSB */
-#define R_IA64_SECREL32LSB     0x65    /* @secrel(sym+add), data4 LSB */
-#define R_IA64_SECREL64MSB     0x66    /* @secrel(sym+add), data8 MSB */
-#define R_IA64_SECREL64LSB     0x67    /* @secrel(sym+add), data8 LSB */
-#define R_IA64_REL32MSB                0x6c    /* data 4 + REL */
-#define R_IA64_REL32LSB                0x6d    /* data 4 + REL */
-#define R_IA64_REL64MSB                0x6e    /* data 8 + REL */
-#define R_IA64_REL64LSB                0x6f    /* data 8 + REL */
-#define R_IA64_LTV32MSB                0x74    /* symbol + addend, data4 MSB */
-#define R_IA64_LTV32LSB                0x75    /* symbol + addend, data4 LSB */
-#define R_IA64_LTV64MSB                0x76    /* symbol + addend, data8 MSB */
-#define R_IA64_LTV64LSB                0x77    /* symbol + addend, data8 LSB */
-#define R_IA64_PCREL21BI       0x79    /* @pcrel(sym+add), ptb, call */
-#define R_IA64_PCREL22         0x7a    /* @pcrel(sym+add), imm22 */
-#define R_IA64_PCREL64I                0x7b    /* @pcrel(sym+add), imm64 */
-#define R_IA64_IPLTMSB         0x80    /* dynamic reloc, imported PLT, MSB */
-#define R_IA64_IPLTLSB         0x81    /* dynamic reloc, imported PLT, LSB */
-#define R_IA64_COPY            0x84    /* dynamic reloc, data copy */
-#define R_IA64_SUB             0x85    /* -symbol + addend, add imm22 */
-#define R_IA64_LTOFF22X                0x86    /* LTOFF22, relaxable.  */
-#define R_IA64_LDXMOV          0x87    /* Use of LTOFF22X.  */
-#define R_IA64_TPREL14         0x91    /* @tprel(sym+add), add imm14 */
-#define R_IA64_TPREL22         0x92    /* @tprel(sym+add), add imm22 */
-#define R_IA64_TPREL64I                0x93    /* @tprel(sym+add), add imm64 */
-#define R_IA64_TPREL64MSB      0x96    /* @tprel(sym+add), data8 MSB */
-#define R_IA64_TPREL64LSB      0x97    /* @tprel(sym+add), data8 LSB */
-#define R_IA64_LTOFF_TPREL22   0x9a    /* @ltoff(@tprel(s+a)), add imm22 */
-#define R_IA64_DTPMOD64MSB     0xa6    /* @dtpmod(sym+add), data8 MSB */
-#define R_IA64_DTPMOD64LSB     0xa7    /* @dtpmod(sym+add), data8 LSB */
-#define R_IA64_LTOFF_DTPMOD22  0xaa    /* @ltoff(@dtpmod(s+a)), imm22 */
-#define R_IA64_DTPREL14                0xb1    /* @dtprel(sym+add), imm14 */
-#define R_IA64_DTPREL22                0xb2    /* @dtprel(sym+add), imm22 */
-#define R_IA64_DTPREL64I       0xb3    /* @dtprel(sym+add), imm64 */
-#define R_IA64_DTPREL32MSB     0xb4    /* @dtprel(sym+add), data4 MSB */
-#define R_IA64_DTPREL32LSB     0xb5    /* @dtprel(sym+add), data4 LSB */
-#define R_IA64_DTPREL64MSB     0xb6    /* @dtprel(sym+add), data8 MSB */
-#define R_IA64_DTPREL64LSB     0xb7    /* @dtprel(sym+add), data8 LSB */
-#define R_IA64_LTOFF_DTPREL22  0xba    /* @ltoff(@dtprel(s+a)), imm22 */
-
-/* IA-64 specific section flags: */
-#define SHF_IA_64_SHORT                0x10000000      /* section near gp */
-
-/*
- * We use (abuse?) this macro to insert the (empty) vm_area that is
- * used to map the register backing store.  I don't see any better
- * place to do this, but we should discuss this with Linus once we can
- * talk to him...
- */
-extern void ia64_init_addr_space (void);
-#define ELF_PLAT_INIT(_r, load_addr)   ia64_init_addr_space()
-
-/* ELF register definitions.  This is needed for core dump support.  */
-
-/*
- * elf_gregset_t contains the application-level state in the following order:
- *     r0-r31
- *     NaT bits (for r0-r31; bit N == 1 iff rN is a NaT)
- *     predicate registers (p0-p63)
- *     b0-b7
- *     ip cfm psr
- *     ar.rsc ar.bsp ar.bspstore ar.rnat
- *     ar.ccv ar.unat ar.fpsr ar.pfs ar.lc ar.ec ar.csd ar.ssd
- */
-#define ELF_NGREG      128     /* we really need just 72 but let's leave some headroom... */
-#define ELF_NFPREG     128     /* f0 and f1 could be omitted, but so what... */
-
-/* elf_gregset_t register offsets */
-#define ELF_GR_0_OFFSET     0
-#define ELF_NAT_OFFSET     (32 * sizeof(elf_greg_t))
-#define ELF_PR_OFFSET      (33 * sizeof(elf_greg_t))
-#define ELF_BR_0_OFFSET    (34 * sizeof(elf_greg_t))
-#define ELF_CR_IIP_OFFSET  (42 * sizeof(elf_greg_t))
-#define ELF_CFM_OFFSET     (43 * sizeof(elf_greg_t))
-#define ELF_CR_IPSR_OFFSET (44 * sizeof(elf_greg_t))
-#define ELF_GR_OFFSET(i)   (ELF_GR_0_OFFSET + i * sizeof(elf_greg_t))
-#define ELF_BR_OFFSET(i)   (ELF_BR_0_OFFSET + i * sizeof(elf_greg_t))
-#define ELF_AR_RSC_OFFSET  (45 * sizeof(elf_greg_t))
-#define ELF_AR_BSP_OFFSET  (46 * sizeof(elf_greg_t))
-#define ELF_AR_BSPSTORE_OFFSET (47 * sizeof(elf_greg_t))
-#define ELF_AR_RNAT_OFFSET (48 * sizeof(elf_greg_t))
-#define ELF_AR_CCV_OFFSET  (49 * sizeof(elf_greg_t))
-#define ELF_AR_UNAT_OFFSET (50 * sizeof(elf_greg_t))
-#define ELF_AR_FPSR_OFFSET (51 * sizeof(elf_greg_t))
-#define ELF_AR_PFS_OFFSET  (52 * sizeof(elf_greg_t))
-#define ELF_AR_LC_OFFSET   (53 * sizeof(elf_greg_t))
-#define ELF_AR_EC_OFFSET   (54 * sizeof(elf_greg_t))
-#define ELF_AR_CSD_OFFSET  (55 * sizeof(elf_greg_t))
-#define ELF_AR_SSD_OFFSET  (56 * sizeof(elf_greg_t))
-#define ELF_AR_END_OFFSET  (57 * sizeof(elf_greg_t))
-
-typedef unsigned long elf_fpxregset_t;
-
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-typedef struct ia64_fpreg elf_fpreg_t;
-typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-
-
-
-struct pt_regs;        /* forward declaration... */
-extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
-#define ELF_CORE_COPY_REGS(_dest,_regs)        ia64_elf_core_copy_regs(_regs, _dest);
-
-/* This macro yields a bitmask that programs can use to figure out
-   what instruction set this CPU supports.  */
-#define ELF_HWCAP      0
-
-/* This macro yields a string that ld.so will use to load
-   implementation specific libraries for optimization.  Not terribly
-   relevant until we have real hardware to play with... */
-#define ELF_PLATFORM   NULL
-
-#define SET_PERSONALITY(ex, ibcs2)     set_personality(PER_LINUX)
-#define elf_read_implies_exec(ex, executable_stack)                                    \
-       ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
-
-struct task_struct;
-
-#define GATE_EHDR      ((const struct elfhdr *) GATE_ADDR)
-
-/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
-#define ARCH_DLINFO                                                            \
-do {                                                                           \
-       extern char __kernel_syscall_via_epc[];                                 \
-       NEW_AUX_ENT(AT_SYSINFO, (unsigned long) __kernel_syscall_via_epc);      \
-       NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR);                \
-} while (0)
-
-
-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the gate DSO contents.  Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the gate DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS           (GATE_EHDR->e_phnum)
-#define ELF_CORE_WRITE_EXTRA_PHDRS                                             \
-do {                                                                           \
-       const struct elf_phdr *const gate_phdrs =                             \
-               (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);   \
-       int i;                                                                  \
-       Elf64_Off ofs = 0;                                                    \
-       for (i = 0; i < GATE_EHDR->e_phnum; ++i) {                              \
-               struct elf_phdr phdr = gate_phdrs[i];                         \
-               if (phdr.p_type == PT_LOAD) {                                   \
-                       phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);              \
-                       phdr.p_filesz = phdr.p_memsz;                         \
-                       if (ofs == 0) {                                       \
-                               ofs = phdr.p_offset = offset;                 \
-                       offset += phdr.p_filesz;                                \
-               }                                                             \
-               else                                                          \
-                               phdr.p_offset = ofs;                          \
-               }                                                             \
-               else                                                          \
-                       phdr.p_offset += ofs;                                   \
-               phdr.p_paddr = 0; /* match other core phdrs */                  \
-               DUMP_WRITE(&phdr, sizeof(phdr));                                \
-       }                                                                       \
-} while (0)
-#define ELF_CORE_WRITE_EXTRA_DATA                                      \
-do {                                                                   \
-       const struct elf_phdr *const gate_phdrs =                             \
-               (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);   \
-       int i;                                                          \
-       for (i = 0; i < GATE_EHDR->e_phnum; ++i) {                      \
-               if (gate_phdrs[i].p_type == PT_LOAD) {                        \
-                       DUMP_WRITE((void *) gate_phdrs[i].p_vaddr,            \
-                                  PAGE_ALIGN(gate_phdrs[i].p_memsz));        \
-                       break;                                                \
-               }                                                             \
-       }                                                               \
-} while (0)
-
-#endif /* _ASM_IA64_ELF_H */
diff --git a/include/asm-ia64/emergency-restart.h b/include/asm-ia64/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-ia64/errno.h b/include/asm-ia64/errno.h
deleted file mode 100644 (file)
index 4c82b50..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/errno.h>
diff --git a/include/asm-ia64/esi.h b/include/asm-ia64/esi.h
deleted file mode 100644 (file)
index 40991c6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * ESI service calls.
- *
- * Copyright (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P.
- *     Alex Williamson <alex.williamson@hp.com>
- */
-#ifndef esi_h
-#define esi_h
-
-#include <linux/efi.h>
-
-#define ESI_QUERY                      0x00000001
-#define ESI_OPEN_HANDLE                        0x02000000
-#define ESI_CLOSE_HANDLE               0x02000001
-
-enum esi_proc_type {
-       ESI_PROC_SERIALIZED,    /* calls need to be serialized */
-       ESI_PROC_MP_SAFE,       /* MP-safe, but not reentrant */
-       ESI_PROC_REENTRANT      /* MP-safe and reentrant */
-};
-
-extern struct ia64_sal_retval esi_call_phys (void *, u64 *);
-extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *,
-                        enum esi_proc_type,
-                        u64, u64, u64, u64, u64, u64, u64, u64);
-extern int ia64_esi_call_phys(efi_guid_t, struct ia64_sal_retval *, u64, u64,
-                              u64, u64, u64, u64, u64, u64);
-
-#endif /* esi_h */
diff --git a/include/asm-ia64/fb.h b/include/asm-ia64/fb.h
deleted file mode 100644 (file)
index 89a397c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
-
-#include <linux/fb.h>
-#include <linux/fs.h>
-#include <linux/efi.h>
-#include <asm/page.h>
-
-static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
-                               unsigned long off)
-{
-       if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
-               vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
-       else
-               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-}
-
-static inline int fb_is_primary_device(struct fb_info *info)
-{
-       return 0;
-}
-
-#endif /* _ASM_FB_H_ */
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
deleted file mode 100644 (file)
index 1dd275d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ASM_IA64_FCNTL_H
-#define _ASM_IA64_FCNTL_H
-/*
- * Modified 1998-2000
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
- */
-
-#define force_o_largefile()    \
-               (personality(current->personality) != PER_LINUX32)
-
-#include <asm-generic/fcntl.h>
-
-#endif /* _ASM_IA64_FCNTL_H */
diff --git a/include/asm-ia64/fpswa.h b/include/asm-ia64/fpswa.h
deleted file mode 100644 (file)
index 62edfce..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef _ASM_IA64_FPSWA_H
-#define _ASM_IA64_FPSWA_H
-
-/*
- * Floating-point Software Assist
- *
- * Copyright (C) 1999 Intel Corporation.
- * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 1999 Goutham Rao <goutham.rao@intel.com>
- */
-
-typedef struct {
-       /* 4 * 128 bits */
-       unsigned long fp_lp[4*2];
-} fp_state_low_preserved_t;
-
-typedef struct {
-       /* 10 * 128 bits */
-       unsigned long fp_lv[10 * 2];
-} fp_state_low_volatile_t;
-
-typedef        struct {
-       /* 16 * 128 bits */
-       unsigned long fp_hp[16 * 2];
-} fp_state_high_preserved_t;
-
-typedef struct {
-       /* 96 * 128 bits */
-       unsigned long fp_hv[96 * 2];
-} fp_state_high_volatile_t;
-
-/**
- * floating point state to be passed to the FP emulation library by
- * the trap/fault handler
- */
-typedef struct {
-       unsigned long                   bitmask_low64;
-       unsigned long                   bitmask_high64;
-       fp_state_low_preserved_t        *fp_state_low_preserved;
-       fp_state_low_volatile_t         *fp_state_low_volatile;
-       fp_state_high_preserved_t       *fp_state_high_preserved;
-       fp_state_high_volatile_t        *fp_state_high_volatile;
-} fp_state_t;
-
-typedef struct {
-       unsigned long status;
-       unsigned long err0;
-       unsigned long err1;
-       unsigned long err2;
-} fpswa_ret_t;
-
-/**
- * function header for the Floating Point software assist
- * library. This function is invoked by the Floating point software
- * assist trap/fault handler.
- */
-typedef fpswa_ret_t (*efi_fpswa_t) (unsigned long trap_type, void *bundle, unsigned long *ipsr,
-                                   unsigned long *fsr, unsigned long *isr, unsigned long *preds,
-                                   unsigned long *ifs, fp_state_t *fp_state);
-
-/**
- * This is the FPSWA library interface as defined by EFI.  We need to pass a 
- * pointer to the interface itself on a call to the assist library
- */
-typedef struct {
-       unsigned int     revision;
-       unsigned int     reserved;
-       efi_fpswa_t      fpswa;
-} fpswa_interface_t;
-
-extern fpswa_interface_t *fpswa_interface;
-
-#endif /* _ASM_IA64_FPSWA_H */
diff --git a/include/asm-ia64/fpu.h b/include/asm-ia64/fpu.h
deleted file mode 100644 (file)
index 3859558..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _ASM_IA64_FPU_H
-#define _ASM_IA64_FPU_H
-
-/*
- * Copyright (C) 1998, 1999, 2002, 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <asm/types.h>
-
-/* floating point status register: */
-#define FPSR_TRAP_VD   (1 << 0)        /* invalid op trap disabled */
-#define FPSR_TRAP_DD   (1 << 1)        /* denormal trap disabled */
-#define FPSR_TRAP_ZD   (1 << 2)        /* zero-divide trap disabled */
-#define FPSR_TRAP_OD   (1 << 3)        /* overflow trap disabled */
-#define FPSR_TRAP_UD   (1 << 4)        /* underflow trap disabled */
-#define FPSR_TRAP_ID   (1 << 5)        /* inexact trap disabled */
-#define FPSR_S0(x)     ((x) <<  6)
-#define FPSR_S1(x)     ((x) << 19)
-#define FPSR_S2(x)     (__IA64_UL(x) << 32)
-#define FPSR_S3(x)     (__IA64_UL(x) << 45)
-
-/* floating-point status field controls: */
-#define FPSF_FTZ       (1 << 0)                /* flush-to-zero */
-#define FPSF_WRE       (1 << 1)                /* widest-range exponent */
-#define FPSF_PC(x)     (((x) & 0x3) << 2)      /* precision control */
-#define FPSF_RC(x)     (((x) & 0x3) << 4)      /* rounding control */
-#define FPSF_TD                (1 << 6)                /* trap disabled */
-
-/* floating-point status field flags: */
-#define FPSF_V         (1 <<  7)               /* invalid operation flag */
-#define FPSF_D         (1 <<  8)               /* denormal/unnormal operand flag */
-#define FPSF_Z         (1 <<  9)               /* zero divide (IEEE) flag */
-#define FPSF_O         (1 << 10)               /* overflow (IEEE) flag */
-#define FPSF_U         (1 << 11)               /* underflow (IEEE) flag */
-#define FPSF_I         (1 << 12)               /* inexact (IEEE) flag) */
-
-/* floating-point rounding control: */
-#define FPRC_NEAREST   0x0
-#define FPRC_NEGINF    0x1
-#define FPRC_POSINF    0x2
-#define FPRC_TRUNC     0x3
-
-#define FPSF_DEFAULT   (FPSF_PC (0x3) | FPSF_RC (FPRC_NEAREST))
-
-/* This default value is the same as HP-UX uses.  Don't change it
-   without a very good reason.  */
-#define FPSR_DEFAULT   (FPSR_TRAP_VD | FPSR_TRAP_DD | FPSR_TRAP_ZD     \
-                        | FPSR_TRAP_OD | FPSR_TRAP_UD | FPSR_TRAP_ID   \
-                        | FPSR_S0 (FPSF_DEFAULT)                       \
-                        | FPSR_S1 (FPSF_DEFAULT | FPSF_TD | FPSF_WRE)  \
-                        | FPSR_S2 (FPSF_DEFAULT | FPSF_TD)             \
-                        | FPSR_S3 (FPSF_DEFAULT | FPSF_TD))
-
-# ifndef __ASSEMBLY__
-
-struct ia64_fpreg {
-       union {
-               unsigned long bits[2];
-               long double __dummy;    /* force 16-byte alignment */
-       } u;
-};
-
-# endif /* __ASSEMBLY__ */
-
-#endif /* _ASM_IA64_FPU_H */
diff --git a/include/asm-ia64/futex.h b/include/asm-ia64/futex.h
deleted file mode 100644 (file)
index c7f0f06..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef _ASM_FUTEX_H
-#define _ASM_FUTEX_H
-
-#include <linux/futex.h>
-#include <linux/uaccess.h>
-#include <asm/errno.h>
-#include <asm/system.h>
-
-#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
-do {                                                                   \
-       register unsigned long r8 __asm ("r8") = 0;                     \
-       __asm__ __volatile__(                                           \
-               "       mf;;                                    \n"     \
-               "[1:] " insn ";;                                \n"     \
-               "       .xdata4 \"__ex_table\", 1b-., 2f-.      \n"     \
-               "[2:]"                                                  \
-               : "+r" (r8), "=r" (oldval)                              \
-               : "r" (uaddr), "r" (oparg)                              \
-               : "memory");                                            \
-       ret = r8;                                                       \
-} while (0)
-
-#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
-do {                                                                   \
-       register unsigned long r8 __asm ("r8") = 0;                     \
-       int val, newval;                                                \
-       do {                                                            \
-               __asm__ __volatile__(                                   \
-                       "       mf;;                              \n"   \
-                       "[1:]   ld4 %3=[%4];;                     \n"   \
-                       "       mov %2=%3                         \n"   \
-                               insn    ";;                       \n"   \
-                       "       mov ar.ccv=%2;;                   \n"   \
-                       "[2:]   cmpxchg4.acq %1=[%4],%3,ar.ccv;;  \n"   \
-                       "       .xdata4 \"__ex_table\", 1b-., 3f-.\n"   \
-                       "       .xdata4 \"__ex_table\", 2b-., 3f-.\n"   \
-                       "[3:]"                                          \
-                       : "+r" (r8), "=r" (val), "=&r" (oldval),        \
-                          "=&r" (newval)                               \
-                       : "r" (uaddr), "r" (oparg)                      \
-                       : "memory");                                    \
-               if (unlikely (r8))                                      \
-                       break;                                          \
-       } while (unlikely (val != oldval));                             \
-       ret = r8;                                                       \
-} while (0)
-
-static inline int
-futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
-{
-       int op = (encoded_op >> 28) & 7;
-       int cmp = (encoded_op >> 24) & 15;
-       int oparg = (encoded_op << 8) >> 20;
-       int cmparg = (encoded_op << 20) >> 20;
-       int oldval = 0, ret;
-       if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
-               oparg = 1 << oparg;
-
-       if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
-               return -EFAULT;
-
-       pagefault_disable();
-
-       switch (op) {
-       case FUTEX_OP_SET:
-               __futex_atomic_op1("xchg4 %1=[%2],%3", ret, oldval, uaddr,
-                                  oparg);
-               break;
-       case FUTEX_OP_ADD:
-               __futex_atomic_op2("add %3=%3,%5", ret, oldval, uaddr, oparg);
-               break;
-       case FUTEX_OP_OR:
-               __futex_atomic_op2("or %3=%3,%5", ret, oldval, uaddr, oparg);
-               break;
-       case FUTEX_OP_ANDN:
-               __futex_atomic_op2("and %3=%3,%5", ret, oldval, uaddr,
-                                  ~oparg);
-               break;
-       case FUTEX_OP_XOR:
-               __futex_atomic_op2("xor %3=%3,%5", ret, oldval, uaddr, oparg);
-               break;
-       default:
-               ret = -ENOSYS;
-       }
-
-       pagefault_enable();
-
-       if (!ret) {
-               switch (cmp) {
-               case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
-               case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
-               case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
-               case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
-               case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
-               case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
-               default: ret = -ENOSYS;
-               }
-       }
-       return ret;
-}
-
-static inline int
-futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
-{
-       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
-               return -EFAULT;
-
-       {
-               register unsigned long r8 __asm ("r8");
-               __asm__ __volatile__(
-                       "       mf;;                                    \n"
-                       "       mov ar.ccv=%3;;                         \n"
-                       "[1:]   cmpxchg4.acq %0=[%1],%2,ar.ccv          \n"
-                       "       .xdata4 \"__ex_table\", 1b-., 2f-.      \n"
-                       "[2:]"
-                       : "=r" (r8)
-                       : "r" (uaddr), "r" (newval),
-                         "rO" ((long) (unsigned) oldval)
-                       : "memory");
-               return r8;
-       }
-}
-
-#endif /* _ASM_FUTEX_H */
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
deleted file mode 100644 (file)
index 0f5b559..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-#ifndef _ASM_IA64_GCC_INTRIN_H
-#define _ASM_IA64_GCC_INTRIN_H
-/*
- *
- * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
- * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
- */
-
-#include <linux/compiler.h>
-
-/* define this macro to get some asm stmts included in 'c' files */
-#define ASM_SUPPORTED
-
-/* Optimization barrier */
-/* The "volatile" is due to gcc bugs */
-#define ia64_barrier() asm volatile ("":::"memory")
-
-#define ia64_stop()    asm volatile (";;"::)
-
-#define ia64_invala_gr(regnum) asm volatile ("invala.e r%0" :: "i"(regnum))
-
-#define ia64_invala_fr(regnum) asm volatile ("invala.e f%0" :: "i"(regnum))
-
-#define ia64_flushrs() asm volatile ("flushrs;;":::"memory")
-
-#define ia64_loadrs() asm volatile ("loadrs;;":::"memory")
-
-extern void ia64_bad_param_for_setreg (void);
-extern void ia64_bad_param_for_getreg (void);
-
-#ifdef __KERNEL__
-register unsigned long ia64_r13 asm ("r13") __used;
-#endif
-
-#define ia64_native_setreg(regnum, val)                                                \
-({                                                                             \
-       switch (regnum) {                                                       \
-           case _IA64_REG_PSR_L:                                               \
-                   asm volatile ("mov psr.l=%0" :: "r"(val) : "memory");       \
-                   break;                                                      \
-           case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC:                          \
-                   asm volatile ("mov ar%0=%1" ::                              \
-                                         "i" (regnum - _IA64_REG_AR_KR0),      \
-                                         "r"(val): "memory");                  \
-                   break;                                                      \
-           case _IA64_REG_CR_DCR ... _IA64_REG_CR_LRR1:                        \
-                   asm volatile ("mov cr%0=%1" ::                              \
-                                         "i" (regnum - _IA64_REG_CR_DCR),      \
-                                         "r"(val): "memory" );                 \
-                   break;                                                      \
-           case _IA64_REG_SP:                                                  \
-                   asm volatile ("mov r12=%0" ::                               \
-                                         "r"(val): "memory");                  \
-                   break;                                                      \
-           case _IA64_REG_GP:                                                  \
-                   asm volatile ("mov gp=%0" :: "r"(val) : "memory");          \
-               break;                                                          \
-           default:                                                            \
-                   ia64_bad_param_for_setreg();                                \
-                   break;                                                      \
-       }                                                                       \
-})
-
-#define ia64_native_getreg(regnum)                                             \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-                                                                               \
-       switch (regnum) {                                                       \
-       case _IA64_REG_GP:                                                      \
-               asm volatile ("mov %0=gp" : "=r"(ia64_intri_res));              \
-               break;                                                          \
-       case _IA64_REG_IP:                                                      \
-               asm volatile ("mov %0=ip" : "=r"(ia64_intri_res));              \
-               break;                                                          \
-       case _IA64_REG_PSR:                                                     \
-               asm volatile ("mov %0=psr" : "=r"(ia64_intri_res));             \
-               break;                                                          \
-       case _IA64_REG_TP:      /* for current() */                             \
-               ia64_intri_res = ia64_r13;                                      \
-               break;                                                          \
-       case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC:                              \
-               asm volatile ("mov %0=ar%1" : "=r" (ia64_intri_res)             \
-                                     : "i"(regnum - _IA64_REG_AR_KR0));        \
-               break;                                                          \
-       case _IA64_REG_CR_DCR ... _IA64_REG_CR_LRR1:                            \
-               asm volatile ("mov %0=cr%1" : "=r" (ia64_intri_res)             \
-                                     : "i" (regnum - _IA64_REG_CR_DCR));       \
-               break;                                                          \
-       case _IA64_REG_SP:                                                      \
-               asm volatile ("mov %0=sp" : "=r" (ia64_intri_res));             \
-               break;                                                          \
-       default:                                                                \
-               ia64_bad_param_for_getreg();                                    \
-               break;                                                          \
-       }                                                                       \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_hint_pause 0
-
-#define ia64_hint(mode)                                                \
-({                                                             \
-       switch (mode) {                                         \
-       case ia64_hint_pause:                                   \
-               asm volatile ("hint @pause" ::: "memory");      \
-               break;                                          \
-       }                                                       \
-})
-
-
-/* Integer values for mux1 instruction */
-#define ia64_mux1_brcst 0
-#define ia64_mux1_mix   8
-#define ia64_mux1_shuf  9
-#define ia64_mux1_alt  10
-#define ia64_mux1_rev  11
-
-#define ia64_mux1(x, mode)                                                     \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-                                                                               \
-       switch (mode) {                                                         \
-       case ia64_mux1_brcst:                                                   \
-               asm ("mux1 %0=%1,@brcst" : "=r" (ia64_intri_res) : "r" (x));    \
-               break;                                                          \
-       case ia64_mux1_mix:                                                     \
-               asm ("mux1 %0=%1,@mix" : "=r" (ia64_intri_res) : "r" (x));      \
-               break;                                                          \
-       case ia64_mux1_shuf:                                                    \
-               asm ("mux1 %0=%1,@shuf" : "=r" (ia64_intri_res) : "r" (x));     \
-               break;                                                          \
-       case ia64_mux1_alt:                                                     \
-               asm ("mux1 %0=%1,@alt" : "=r" (ia64_intri_res) : "r" (x));      \
-               break;                                                          \
-       case ia64_mux1_rev:                                                     \
-               asm ("mux1 %0=%1,@rev" : "=r" (ia64_intri_res) : "r" (x));      \
-               break;                                                          \
-       }                                                                       \
-       ia64_intri_res;                                                         \
-})
-
-#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# define ia64_popcnt(x)                __builtin_popcountl(x)
-#else
-# define ia64_popcnt(x)                                                \
-  ({                                                           \
-       __u64 ia64_intri_res;                                   \
-       asm ("popcnt %0=%1" : "=r" (ia64_intri_res) : "r" (x)); \
-                                                               \
-       ia64_intri_res;                                         \
-  })
-#endif
-
-#define ia64_getf_exp(x)                                       \
-({                                                             \
-       long ia64_intri_res;                                    \
-                                                               \
-       asm ("getf.exp %0=%1" : "=r"(ia64_intri_res) : "f"(x)); \
-                                                               \
-       ia64_intri_res;                                         \
-})
-
-#define ia64_shrp(a, b, count)                                                         \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm ("shrp %0=%1,%2,%3" : "=r"(ia64_intri_res) : "r"(a), "r"(b), "i"(count));   \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_ldfs(regnum, x)                                   \
-({                                                             \
-       register double __f__ asm ("f"#regnum);                 \
-       asm volatile ("ldfs %0=[%1]" :"=f"(__f__): "r"(x));     \
-})
-
-#define ia64_ldfd(regnum, x)                                   \
-({                                                             \
-       register double __f__ asm ("f"#regnum);                 \
-       asm volatile ("ldfd %0=[%1]" :"=f"(__f__): "r"(x));     \
-})
-
-#define ia64_ldfe(regnum, x)                                   \
-({                                                             \
-       register double __f__ asm ("f"#regnum);                 \
-       asm volatile ("ldfe %0=[%1]" :"=f"(__f__): "r"(x));     \
-})
-
-#define ia64_ldf8(regnum, x)                                   \
-({                                                             \
-       register double __f__ asm ("f"#regnum);                 \
-       asm volatile ("ldf8 %0=[%1]" :"=f"(__f__): "r"(x));     \
-})
-
-#define ia64_ldf_fill(regnum, x)                               \
-({                                                             \
-       register double __f__ asm ("f"#regnum);                 \
-       asm volatile ("ldf.fill %0=[%1]" :"=f"(__f__): "r"(x)); \
-})
-
-#define ia64_st4_rel_nta(m, val)                                       \
-({                                                                     \
-       asm volatile ("st4.rel.nta [%0] = %1\n\t" :: "r"(m), "r"(val)); \
-})
-
-#define ia64_stfs(x, regnum)                                           \
-({                                                                     \
-       register double __f__ asm ("f"#regnum);                         \
-       asm volatile ("stfs [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
-})
-
-#define ia64_stfd(x, regnum)                                           \
-({                                                                     \
-       register double __f__ asm ("f"#regnum);                         \
-       asm volatile ("stfd [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
-})
-
-#define ia64_stfe(x, regnum)                                           \
-({                                                                     \
-       register double __f__ asm ("f"#regnum);                         \
-       asm volatile ("stfe [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
-})
-
-#define ia64_stf8(x, regnum)                                           \
-({                                                                     \
-       register double __f__ asm ("f"#regnum);                         \
-       asm volatile ("stf8 [%0]=%1" :: "r"(x), "f"(__f__) : "memory"); \
-})
-
-#define ia64_stf_spill(x, regnum)                                              \
-({                                                                             \
-       register double __f__ asm ("f"#regnum);                                 \
-       asm volatile ("stf.spill [%0]=%1" :: "r"(x), "f"(__f__) : "memory");    \
-})
-
-#define ia64_fetchadd4_acq(p, inc)                                             \
-({                                                                             \
-                                                                               \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("fetchadd4.acq %0=[%1],%2"                                \
-                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                               : "memory");                                    \
-                                                                               \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_fetchadd4_rel(p, inc)                                             \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("fetchadd4.rel %0=[%1],%2"                                \
-                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                               : "memory");                                    \
-                                                                               \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_fetchadd8_acq(p, inc)                                             \
-({                                                                             \
-                                                                               \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("fetchadd8.acq %0=[%1],%2"                                \
-                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                               : "memory");                                    \
-                                                                               \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_fetchadd8_rel(p, inc)                                             \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("fetchadd8.rel %0=[%1],%2"                                \
-                               : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                               : "memory");                                    \
-                                                                               \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_xchg1(ptr,x)                                                      \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("xchg1 %0=[%1],%2"                                        \
-                     : "=r" (ia64_intri_res) : "r" (ptr), "r" (x) : "memory"); \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_xchg2(ptr,x)                                              \
-({                                                                     \
-       __u64 ia64_intri_res;                                           \
-       asm volatile ("xchg2 %0=[%1],%2" : "=r" (ia64_intri_res)        \
-                     : "r" (ptr), "r" (x) : "memory");                 \
-       ia64_intri_res;                                                 \
-})
-
-#define ia64_xchg4(ptr,x)                                              \
-({                                                                     \
-       __u64 ia64_intri_res;                                           \
-       asm volatile ("xchg4 %0=[%1],%2" : "=r" (ia64_intri_res)        \
-                     : "r" (ptr), "r" (x) : "memory");                 \
-       ia64_intri_res;                                                 \
-})
-
-#define ia64_xchg8(ptr,x)                                              \
-({                                                                     \
-       __u64 ia64_intri_res;                                           \
-       asm volatile ("xchg8 %0=[%1],%2" : "=r" (ia64_intri_res)        \
-                     : "r" (ptr), "r" (x) : "memory");                 \
-       ia64_intri_res;                                                 \
-})
-
-#define ia64_cmpxchg1_acq(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg1.acq %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg1_rel(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg1.rel %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg2_acq(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg2.acq %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg2_rel(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-                                                                                       \
-       asm volatile ("cmpxchg2.rel %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg4_acq(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg4.acq %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg4_rel(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg4.rel %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg8_acq(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-       asm volatile ("cmpxchg8.acq %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_cmpxchg8_rel(ptr, new, old)                                               \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov ar.ccv=%0;;" :: "rO"(old));                                  \
-                                                                                       \
-       asm volatile ("cmpxchg8.rel %0=[%1],%2,ar.ccv":                                 \
-                             "=r"(ia64_intri_res) : "r"(ptr), "r"(new) : "memory");    \
-       ia64_intri_res;                                                                 \
-})
-
-#define ia64_mf()      asm volatile ("mf" ::: "memory")
-#define ia64_mfa()     asm volatile ("mf.a" ::: "memory")
-
-#define ia64_invala() asm volatile ("invala" ::: "memory")
-
-#define ia64_native_thash(addr)                                                        \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("thash %0=%1" : "=r"(ia64_intri_res) : "r" (addr));       \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_srlz_i()  asm volatile (";; srlz.i ;;" ::: "memory")
-#define ia64_srlz_d()  asm volatile (";; srlz.d" ::: "memory");
-
-#ifdef HAVE_SERIALIZE_DIRECTIVE
-# define ia64_dv_serialize_data()              asm volatile (".serialize.data");
-# define ia64_dv_serialize_instruction()       asm volatile (".serialize.instruction");
-#else
-# define ia64_dv_serialize_data()
-# define ia64_dv_serialize_instruction()
-#endif
-
-#define ia64_nop(x)    asm volatile ("nop %0"::"i"(x));
-
-#define ia64_itci(addr)        asm volatile ("itc.i %0;;" :: "r"(addr) : "memory")
-
-#define ia64_itcd(addr)        asm volatile ("itc.d %0;;" :: "r"(addr) : "memory")
-
-
-#define ia64_itri(trnum, addr) asm volatile ("itr.i itr[%0]=%1"                                \
-                                            :: "r"(trnum), "r"(addr) : "memory")
-
-#define ia64_itrd(trnum, addr) asm volatile ("itr.d dtr[%0]=%1"                                \
-                                            :: "r"(trnum), "r"(addr) : "memory")
-
-#define ia64_tpa(addr)                                                         \
-({                                                                             \
-       __u64 ia64_pa;                                                          \
-       asm volatile ("tpa %0 = %1" : "=r"(ia64_pa) : "r"(addr) : "memory");    \
-       ia64_pa;                                                                \
-})
-
-#define __ia64_set_dbr(index, val)                                             \
-       asm volatile ("mov dbr[%0]=%1" :: "r"(index), "r"(val) : "memory")
-
-#define ia64_set_ibr(index, val)                                               \
-       asm volatile ("mov ibr[%0]=%1" :: "r"(index), "r"(val) : "memory")
-
-#define ia64_set_pkr(index, val)                                               \
-       asm volatile ("mov pkr[%0]=%1" :: "r"(index), "r"(val) : "memory")
-
-#define ia64_set_pmc(index, val)                                               \
-       asm volatile ("mov pmc[%0]=%1" :: "r"(index), "r"(val) : "memory")
-
-#define ia64_set_pmd(index, val)                                               \
-       asm volatile ("mov pmd[%0]=%1" :: "r"(index), "r"(val) : "memory")
-
-#define ia64_native_set_rr(index, val)                                                 \
-       asm volatile ("mov rr[%0]=%1" :: "r"(index), "r"(val) : "memory");
-
-#define ia64_native_get_cpuid(index)                                                   \
-({                                                                                     \
-       __u64 ia64_intri_res;                                                           \
-       asm volatile ("mov %0=cpuid[%r1]" : "=r"(ia64_intri_res) : "rO"(index));        \
-       ia64_intri_res;                                                                 \
-})
-
-#define __ia64_get_dbr(index)                                                  \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=dbr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_get_ibr(index)                                                    \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=ibr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_get_pkr(index)                                                    \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=pkr[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_get_pmc(index)                                                    \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=pmc[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
-       ia64_intri_res;                                                         \
-})
-
-
-#define ia64_native_get_pmd(index)                                             \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=pmd[%1]" : "=r"(ia64_intri_res) : "r"(index));    \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_native_get_rr(index)                                              \
-({                                                                             \
-       __u64 ia64_intri_res;                                                   \
-       asm volatile ("mov %0=rr[%1]" : "=r"(ia64_intri_res) : "r" (index));    \
-       ia64_intri_res;                                                         \
-})
-
-#define ia64_native_fc(addr)   asm volatile ("fc %0" :: "r"(addr) : "memory")
-
-
-#define ia64_sync_i()  asm volatile (";; sync.i" ::: "memory")
-
-#define ia64_native_ssm(mask)  asm volatile ("ssm %0":: "i"((mask)) : "memory")
-#define ia64_native_rsm(mask)  asm volatile ("rsm %0":: "i"((mask)) : "memory")
-#define ia64_sum(mask) asm volatile ("sum %0":: "i"((mask)) : "memory")
-#define ia64_rum(mask) asm volatile ("rum %0":: "i"((mask)) : "memory")
-
-#define ia64_ptce(addr)        asm volatile ("ptc.e %0" :: "r"(addr))
-
-#define ia64_native_ptcga(addr, size)                                          \
-do {                                                                           \
-       asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory");       \
-       ia64_dv_serialize_data();                                               \
-} while (0)
-
-#define ia64_ptcl(addr, size)                                                  \
-do {                                                                           \
-       asm volatile ("ptc.l %0,%1" :: "r"(addr), "r"(size) : "memory");        \
-       ia64_dv_serialize_data();                                               \
-} while (0)
-
-#define ia64_ptri(addr, size)                                          \
-       asm volatile ("ptr.i %0,%1" :: "r"(addr), "r"(size) : "memory")
-
-#define ia64_ptrd(addr, size)                                          \
-       asm volatile ("ptr.d %0,%1" :: "r"(addr), "r"(size) : "memory")
-
-#define ia64_ttag(addr)                                                        \
-({                                                                       \
-       __u64 ia64_intri_res;                                              \
-       asm volatile ("ttag %0=%1" : "=r"(ia64_intri_res) : "r" (addr));   \
-       ia64_intri_res;                                                  \
-})
-
-
-/* Values for lfhint in ia64_lfetch and ia64_lfetch_fault */
-
-#define ia64_lfhint_none   0
-#define ia64_lfhint_nt1    1
-#define ia64_lfhint_nt2    2
-#define ia64_lfhint_nta    3
-
-#define ia64_lfetch(lfhint, y)                                 \
-({                                                             \
-        switch (lfhint) {                                      \
-        case ia64_lfhint_none:                                 \
-                asm volatile ("lfetch [%0]" : : "r"(y));       \
-                break;                                         \
-        case ia64_lfhint_nt1:                                  \
-                asm volatile ("lfetch.nt1 [%0]" : : "r"(y));   \
-                break;                                         \
-        case ia64_lfhint_nt2:                                  \
-                asm volatile ("lfetch.nt2 [%0]" : : "r"(y));   \
-                break;                                         \
-        case ia64_lfhint_nta:                                  \
-                asm volatile ("lfetch.nta [%0]" : : "r"(y));   \
-                break;                                         \
-        }                                                      \
-})
-
-#define ia64_lfetch_excl(lfhint, y)                                    \
-({                                                                     \
-        switch (lfhint) {                                              \
-        case ia64_lfhint_none:                                         \
-                asm volatile ("lfetch.excl [%0]" :: "r"(y));           \
-                break;                                                 \
-        case ia64_lfhint_nt1:                                          \
-                asm volatile ("lfetch.excl.nt1 [%0]" :: "r"(y));       \
-                break;                                                 \
-        case ia64_lfhint_nt2:                                          \
-                asm volatile ("lfetch.excl.nt2 [%0]" :: "r"(y));       \
-                break;                                                 \
-        case ia64_lfhint_nta:                                          \
-                asm volatile ("lfetch.excl.nta [%0]" :: "r"(y));       \
-                break;                                                 \
-        }                                                              \
-})
-
-#define ia64_lfetch_fault(lfhint, y)                                   \
-({                                                                     \
-        switch (lfhint) {                                              \
-        case ia64_lfhint_none:                                         \
-                asm volatile ("lfetch.fault [%0]" : : "r"(y));         \
-                break;                                                 \
-        case ia64_lfhint_nt1:                                          \
-                asm volatile ("lfetch.fault.nt1 [%0]" : : "r"(y));     \
-                break;                                                 \
-        case ia64_lfhint_nt2:                                          \
-                asm volatile ("lfetch.fault.nt2 [%0]" : : "r"(y));     \
-                break;                                                 \
-        case ia64_lfhint_nta:                                          \
-                asm volatile ("lfetch.fault.nta [%0]" : : "r"(y));     \
-                break;                                                 \
-        }                                                              \
-})
-
-#define ia64_lfetch_fault_excl(lfhint, y)                              \
-({                                                                     \
-        switch (lfhint) {                                              \
-        case ia64_lfhint_none:                                         \
-                asm volatile ("lfetch.fault.excl [%0]" :: "r"(y));     \
-                break;                                                 \
-        case ia64_lfhint_nt1:                                          \
-                asm volatile ("lfetch.fault.excl.nt1 [%0]" :: "r"(y)); \
-                break;                                                 \
-        case ia64_lfhint_nt2:                                          \
-                asm volatile ("lfetch.fault.excl.nt2 [%0]" :: "r"(y)); \
-                break;                                                 \
-        case ia64_lfhint_nta:                                          \
-                asm volatile ("lfetch.fault.excl.nta [%0]" :: "r"(y)); \
-                break;                                                 \
-        }                                                              \
-})
-
-#define ia64_native_intrin_local_irq_restore(x)                        \
-do {                                                           \
-       asm volatile (";;   cmp.ne p6,p7=%0,r0;;"               \
-                     "(p6) ssm psr.i;"                         \
-                     "(p7) rsm psr.i;;"                        \
-                     "(p6) srlz.d"                             \
-                     :: "r"((x)) : "p6", "p7", "memory");      \
-} while (0)
-
-#endif /* _ASM_IA64_GCC_INTRIN_H */
diff --git a/include/asm-ia64/hardirq.h b/include/asm-ia64/hardirq.h
deleted file mode 100644 (file)
index 140e495..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _ASM_IA64_HARDIRQ_H
-#define _ASM_IA64_HARDIRQ_H
-
-/*
- * Modified 1998-2002, 2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#include <linux/threads.h>
-#include <linux/irq.h>
-
-#include <asm/processor.h>
-
-/*
- * No irq_cpustat_t for IA-64.  The data is held in the per-CPU data structure.
- */
-
-#define __ARCH_IRQ_STAT        1
-
-#define local_softirq_pending()                (local_cpu_data->softirq_pending)
-
-#define HARDIRQ_BITS   14
-
-/*
- * The hardirq mask has to be large enough to have space for potentially all IRQ sources
- * in the system nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
-extern void __iomem *ipi_base_addr;
-
-void ack_bad_irq(unsigned int irq);
-
-#endif /* _ASM_IA64_HARDIRQ_H */
diff --git a/include/asm-ia64/hpsim.h b/include/asm-ia64/hpsim.h
deleted file mode 100644 (file)
index 892ab19..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASMIA64_HPSIM_H
-#define _ASMIA64_HPSIM_H
-
-#ifndef CONFIG_HP_SIMSERIAL_CONSOLE
-static inline int simcons_register(void) { return 1; }
-#else
-int simcons_register(void);
-#endif
-
-struct tty_driver;
-extern struct tty_driver *hp_simserial_driver;
-
-void ia64_ssc_connect_irq(long intr, long irq);
-void ia64_ctl_trace(long on);
-
-#endif
diff --git a/include/asm-ia64/hugetlb.h b/include/asm-ia64/hugetlb.h
deleted file mode 100644 (file)
index da55c63..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef _ASM_IA64_HUGETLB_H
-#define _ASM_IA64_HUGETLB_H
-
-#include <asm/page.h>
-
-
-void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
-                           unsigned long end, unsigned long floor,
-                           unsigned long ceiling);
-
-int prepare_hugepage_range(struct file *file,
-                       unsigned long addr, unsigned long len);
-
-static inline int is_hugepage_only_range(struct mm_struct *mm,
-                                        unsigned long addr,
-                                        unsigned long len)
-{
-       return (REGION_NUMBER(addr) == RGN_HPAGE ||
-               REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
-}
-
-static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
-{
-}
-
-static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
-                                  pte_t *ptep, pte_t pte)
-{
-       set_pte_at(mm, addr, ptep, pte);
-}
-
-static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
-                                           unsigned long addr, pte_t *ptep)
-{
-       return ptep_get_and_clear(mm, addr, ptep);
-}
-
-static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
-                                        unsigned long addr, pte_t *ptep)
-{
-}
-
-static inline int huge_pte_none(pte_t pte)
-{
-       return pte_none(pte);
-}
-
-static inline pte_t huge_pte_wrprotect(pte_t pte)
-{
-       return pte_wrprotect(pte);
-}
-
-static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
-                                          unsigned long addr, pte_t *ptep)
-{
-       ptep_set_wrprotect(mm, addr, ptep);
-}
-
-static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
-                                            unsigned long addr, pte_t *ptep,
-                                            pte_t pte, int dirty)
-{
-       return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
-}
-
-static inline pte_t huge_ptep_get(pte_t *ptep)
-{
-       return *ptep;
-}
-
-static inline int arch_prepare_hugepage(struct page *page)
-{
-       return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
-#endif /* _ASM_IA64_HUGETLB_H */
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
deleted file mode 100644 (file)
index 5c99cbc..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-#ifndef _ASM_IA64_HW_IRQ_H
-#define _ASM_IA64_HW_IRQ_H
-
-/*
- * Copyright (C) 2001-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/profile.h>
-
-#include <asm/machvec.h>
-#include <asm/ptrace.h>
-#include <asm/smp.h>
-
-#ifndef CONFIG_PARAVIRT
-typedef u8 ia64_vector;
-#else
-typedef u16 ia64_vector;
-#endif
-
-/*
- * 0 special
- *
- * 1,3-14 are reserved from firmware
- *
- * 16-255 (vectored external interrupts) are available
- *
- * 15 spurious interrupt (see IVR)
- *
- * 16 lowest priority, 255 highest priority
- *
- * 15 classes of 16 interrupts each.
- */
-#define IA64_MIN_VECTORED_IRQ           16
-#define IA64_MAX_VECTORED_IRQ          255
-#define IA64_NUM_VECTORS               256
-
-#define AUTO_ASSIGN                    -1
-
-#define IA64_SPURIOUS_INT_VECTOR       0x0f
-
-/*
- * Vectors 0x10-0x1f are used for low priority interrupts, e.g. CMCI.
- */
-#define IA64_CPEP_VECTOR               0x1c    /* corrected platform error polling vector */
-#define IA64_CMCP_VECTOR               0x1d    /* corrected machine-check polling vector */
-#define IA64_CPE_VECTOR                        0x1e    /* corrected platform error interrupt vector */
-#define IA64_CMC_VECTOR                        0x1f    /* corrected machine-check interrupt vector */
-/*
- * Vectors 0x20-0x2f are reserved for legacy ISA IRQs.
- * Use vectors 0x30-0xe7 as the default device vector range for ia64.
- * Platforms may choose to reduce this range in platform_irq_setup, but the
- * platform range must fall within
- *     [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR]
- */
-extern int ia64_first_device_vector;
-extern int ia64_last_device_vector;
-
-#define IA64_DEF_FIRST_DEVICE_VECTOR   0x30
-#define IA64_DEF_LAST_DEVICE_VECTOR    0xe7
-#define IA64_FIRST_DEVICE_VECTOR       ia64_first_device_vector
-#define IA64_LAST_DEVICE_VECTOR                ia64_last_device_vector
-#define IA64_MAX_DEVICE_VECTORS                (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1)
-#define IA64_NUM_DEVICE_VECTORS                (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1)
-
-#define IA64_MCA_RENDEZ_VECTOR         0xe8    /* MCA rendez interrupt */
-#define IA64_PERFMON_VECTOR            0xee    /* performance monitor interrupt vector */
-#define IA64_TIMER_VECTOR              0xef    /* use highest-prio group 15 interrupt for timer */
-#define        IA64_MCA_WAKEUP_VECTOR          0xf0    /* MCA wakeup (must be >MCA_RENDEZ_VECTOR) */
-#define IA64_IPI_LOCAL_TLB_FLUSH       0xfc    /* SMP flush local TLB */
-#define IA64_IPI_RESCHEDULE            0xfd    /* SMP reschedule */
-#define IA64_IPI_VECTOR                        0xfe    /* inter-processor interrupt vector */
-
-/* Used for encoding redirected irqs */
-
-#define IA64_IRQ_REDIRECTED            (1 << 31)
-
-/* IA64 inter-cpu interrupt related definitions */
-
-#define IA64_IPI_DEFAULT_BASE_ADDR     0xfee00000
-
-/* Delivery modes for inter-cpu interrupts */
-enum {
-        IA64_IPI_DM_INT =       0x0,    /* pend an external interrupt */
-        IA64_IPI_DM_PMI =       0x2,    /* pend a PMI */
-        IA64_IPI_DM_NMI =       0x4,    /* pend an NMI (vector 2) */
-        IA64_IPI_DM_INIT =      0x5,    /* pend an INIT interrupt */
-        IA64_IPI_DM_EXTINT =    0x7,    /* pend an 8259-compatible interrupt. */
-};
-
-extern __u8 isa_irq_to_vector_map[16];
-#define isa_irq_to_vector(x)   isa_irq_to_vector_map[(x)]
-
-struct irq_cfg {
-       ia64_vector vector;
-       cpumask_t domain;
-       cpumask_t old_domain;
-       unsigned move_cleanup_count;
-       u8 move_in_progress : 1;
-};
-extern spinlock_t vector_lock;
-extern struct irq_cfg irq_cfg[NR_IRQS];
-#define irq_to_domain(x)       irq_cfg[(x)].domain
-DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
-
-extern struct hw_interrupt_type irq_type_ia64_lsapic;  /* CPU-internal interrupt controller */
-
-#ifdef CONFIG_PARAVIRT_GUEST
-#include <asm/paravirt.h>
-#else
-#define ia64_register_ipi      ia64_native_register_ipi
-#define assign_irq_vector      ia64_native_assign_irq_vector
-#define free_irq_vector                ia64_native_free_irq_vector
-#define register_percpu_irq    ia64_native_register_percpu_irq
-#define ia64_resend_irq                ia64_native_resend_irq
-#endif
-
-extern void ia64_native_register_ipi(void);
-extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
-extern int ia64_native_assign_irq_vector (int irq);    /* allocate a free vector */
-extern void ia64_native_free_irq_vector (int vector);
-extern int reserve_irq_vector (int vector);
-extern void __setup_vector_irq(int cpu);
-extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
-extern void ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action);
-extern int check_irq_used (int irq);
-extern void destroy_and_reserve_irq (unsigned int irq);
-
-#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
-extern int irq_prepare_move(int irq, int cpu);
-extern void irq_complete_move(unsigned int irq);
-#else
-static inline int irq_prepare_move(int irq, int cpu) { return 0; }
-static inline void irq_complete_move(unsigned int irq) {}
-#endif
-
-static inline void ia64_native_resend_irq(unsigned int vector)
-{
-       platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
-}
-
-/*
- * Default implementations for the irq-descriptor API:
- */
-
-extern irq_desc_t irq_desc[NR_IRQS];
-
-#ifndef CONFIG_IA64_GENERIC
-static inline ia64_vector __ia64_irq_to_vector(int irq)
-{
-       return irq_cfg[irq].vector;
-}
-
-static inline unsigned int
-__ia64_local_vector_to_irq (ia64_vector vec)
-{
-       return __get_cpu_var(vector_irq)[vec];
-}
-#endif
-
-/*
- * Next follows the irq descriptor interface.  On IA-64, each CPU supports 256 interrupt
- * vectors.  On smaller systems, there is a one-to-one correspondence between interrupt
- * vectors and the Linux irq numbers.  However, larger systems may have multiple interrupt
- * domains meaning that the translation from vector number to irq number depends on the
- * interrupt domain that a CPU belongs to.  This API abstracts such platform-dependent
- * differences and provides a uniform means to translate between vector and irq numbers
- * and to obtain the irq descriptor for a given irq number.
- */
-
-/* Extract the IA-64 vector that corresponds to IRQ.  */
-static inline ia64_vector
-irq_to_vector (int irq)
-{
-       return platform_irq_to_vector(irq);
-}
-
-/*
- * Convert the local IA-64 vector to the corresponding irq number.  This translation is
- * done in the context of the interrupt domain that the currently executing CPU belongs
- * to.
- */
-static inline unsigned int
-local_vector_to_irq (ia64_vector vec)
-{
-       return platform_local_vector_to_irq(vec);
-}
-
-#endif /* _ASM_IA64_HW_IRQ_H */
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
deleted file mode 100644 (file)
index 2390ee1..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _ASM_IA64_IA32_H
-#define _ASM_IA64_IA32_H
-
-
-#include <asm/ptrace.h>
-#include <asm/signal.h>
-
-#define IA32_NR_syscalls               285     /* length of syscall table */
-#define IA32_PAGE_SHIFT                        12      /* 4KB pages */
-
-#ifndef __ASSEMBLY__
-
-# ifdef CONFIG_IA32_SUPPORT
-
-#define IA32_PAGE_OFFSET       0xc0000000
-
-extern void ia32_cpu_init (void);
-extern void ia32_mem_init (void);
-extern void ia32_gdt_init (void);
-extern int ia32_exception (struct pt_regs *regs, unsigned long isr);
-extern int ia32_intercept (struct pt_regs *regs, unsigned long isr);
-extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs);
-
-# endif /* !CONFIG_IA32_SUPPORT */
-
-/* Declare this unconditionally, so we don't get warnings for unreachable code.  */
-extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
-                             sigset_t *set, struct pt_regs *regs);
-#if PAGE_SHIFT > IA32_PAGE_SHIFT
-extern int ia32_copy_ia64_partial_page_list(struct task_struct *,
-                                       unsigned long);
-extern void ia32_drop_ia64_partial_page_list(struct task_struct *);
-#else
-# define ia32_copy_ia64_partial_page_list(a1, a2)      0
-# define ia32_drop_ia64_partial_page_list(a1)  do { ; } while (0)
-#endif
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_IA32_H */
diff --git a/include/asm-ia64/ia64regs.h b/include/asm-ia64/ia64regs.h
deleted file mode 100644 (file)
index 1757f1c..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2002,2003 Intel Corp.
- *      Jun Nakajima <jun.nakajima@intel.com>
- *      Suresh Siddha <suresh.b.siddha@intel.com>
- */
-
-#ifndef _ASM_IA64_IA64REGS_H
-#define _ASM_IA64_IA64REGS_H
-
-/*
- * Register Names for getreg() and setreg().
- *
- * The "magic" numbers happen to match the values used by the Intel compiler's
- * getreg()/setreg() intrinsics.
- */
-
-/* Special Registers */
-
-#define _IA64_REG_IP           1016    /* getreg only */
-#define _IA64_REG_PSR          1019
-#define _IA64_REG_PSR_L                1019
-
-/* General Integer Registers */
-
-#define _IA64_REG_GP           1025    /* R1 */
-#define _IA64_REG_R8           1032    /* R8 */
-#define _IA64_REG_R9           1033    /* R9 */
-#define _IA64_REG_SP           1036    /* R12 */
-#define _IA64_REG_TP           1037    /* R13 */
-
-/* Application Registers */
-
-#define _IA64_REG_AR_KR0       3072
-#define _IA64_REG_AR_KR1       3073
-#define _IA64_REG_AR_KR2       3074
-#define _IA64_REG_AR_KR3       3075
-#define _IA64_REG_AR_KR4       3076
-#define _IA64_REG_AR_KR5       3077
-#define _IA64_REG_AR_KR6       3078
-#define _IA64_REG_AR_KR7       3079
-#define _IA64_REG_AR_RSC       3088
-#define _IA64_REG_AR_BSP       3089
-#define _IA64_REG_AR_BSPSTORE  3090
-#define _IA64_REG_AR_RNAT      3091
-#define _IA64_REG_AR_FCR       3093
-#define _IA64_REG_AR_EFLAG     3096
-#define _IA64_REG_AR_CSD       3097
-#define _IA64_REG_AR_SSD       3098
-#define _IA64_REG_AR_CFLAG     3099
-#define _IA64_REG_AR_FSR       3100
-#define _IA64_REG_AR_FIR       3101
-#define _IA64_REG_AR_FDR       3102
-#define _IA64_REG_AR_CCV       3104
-#define _IA64_REG_AR_UNAT      3108
-#define _IA64_REG_AR_FPSR      3112
-#define _IA64_REG_AR_ITC       3116
-#define _IA64_REG_AR_PFS       3136
-#define _IA64_REG_AR_LC                3137
-#define _IA64_REG_AR_EC                3138
-
-/* Control Registers */
-
-#define _IA64_REG_CR_DCR       4096
-#define _IA64_REG_CR_ITM       4097
-#define _IA64_REG_CR_IVA       4098
-#define _IA64_REG_CR_PTA       4104
-#define _IA64_REG_CR_IPSR      4112
-#define _IA64_REG_CR_ISR       4113
-#define _IA64_REG_CR_IIP       4115
-#define _IA64_REG_CR_IFA       4116
-#define _IA64_REG_CR_ITIR      4117
-#define _IA64_REG_CR_IIPA      4118
-#define _IA64_REG_CR_IFS       4119
-#define _IA64_REG_CR_IIM       4120
-#define _IA64_REG_CR_IHA       4121
-#define _IA64_REG_CR_LID       4160
-#define _IA64_REG_CR_IVR       4161    /* getreg only */
-#define _IA64_REG_CR_TPR       4162
-#define _IA64_REG_CR_EOI       4163
-#define _IA64_REG_CR_IRR0      4164    /* getreg only */
-#define _IA64_REG_CR_IRR1      4165    /* getreg only */
-#define _IA64_REG_CR_IRR2      4166    /* getreg only */
-#define _IA64_REG_CR_IRR3      4167    /* getreg only */
-#define _IA64_REG_CR_ITV       4168
-#define _IA64_REG_CR_PMV       4169
-#define _IA64_REG_CR_CMCV      4170
-#define _IA64_REG_CR_LRR0      4176
-#define _IA64_REG_CR_LRR1      4177
-
-/* Indirect Registers for getindreg() and setindreg() */
-
-#define _IA64_REG_INDR_CPUID   9000    /* getindreg only */
-#define _IA64_REG_INDR_DBR     9001
-#define _IA64_REG_INDR_IBR     9002
-#define _IA64_REG_INDR_PKR     9003
-#define _IA64_REG_INDR_PMC     9004
-#define _IA64_REG_INDR_PMD     9005
-#define _IA64_REG_INDR_RR      9006
-
-#endif /* _ASM_IA64_IA64REGS_H */
diff --git a/include/asm-ia64/intel_intrin.h b/include/asm-ia64/intel_intrin.h
deleted file mode 100644 (file)
index 53cec57..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#ifndef _ASM_IA64_INTEL_INTRIN_H
-#define _ASM_IA64_INTEL_INTRIN_H
-/*
- * Intel Compiler Intrinsics
- *
- * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
- * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
- * Copyright (C) 2005,2006 Hongjiu Lu <hongjiu.lu@intel.com>
- *
- */
-#include <ia64intrin.h>
-
-#define ia64_barrier()         __memory_barrier()
-
-#define ia64_stop()    /* Nothing: As of now stop bit is generated for each
-                        * intrinsic
-                        */
-
-#define ia64_native_getreg     __getReg
-#define ia64_native_setreg     __setReg
-
-#define ia64_hint              __hint
-#define ia64_hint_pause                __hint_pause
-
-#define ia64_mux1_brcst                _m64_mux1_brcst
-#define ia64_mux1_mix          _m64_mux1_mix
-#define ia64_mux1_shuf         _m64_mux1_shuf
-#define ia64_mux1_alt          _m64_mux1_alt
-#define ia64_mux1_rev          _m64_mux1_rev
-
-#define ia64_mux1(x,v)         _m_to_int64(_m64_mux1(_m_from_int64(x), (v)))
-#define ia64_popcnt            _m64_popcnt
-#define ia64_getf_exp          __getf_exp
-#define ia64_shrp              _m64_shrp
-
-#define ia64_tpa               __tpa
-#define ia64_invala            __invala
-#define ia64_invala_gr         __invala_gr
-#define ia64_invala_fr         __invala_fr
-#define ia64_nop               __nop
-#define ia64_sum               __sum
-#define ia64_native_ssm                __ssm
-#define ia64_rum               __rum
-#define ia64_native_rsm                __rsm
-#define ia64_native_fc                 __fc
-
-#define ia64_ldfs              __ldfs
-#define ia64_ldfd              __ldfd
-#define ia64_ldfe              __ldfe
-#define ia64_ldf8              __ldf8
-#define ia64_ldf_fill          __ldf_fill
-
-#define ia64_stfs              __stfs
-#define ia64_stfd              __stfd
-#define ia64_stfe              __stfe
-#define ia64_stf8              __stf8
-#define ia64_stf_spill         __stf_spill
-
-#define ia64_mf                        __mf
-#define ia64_mfa               __mfa
-
-#define ia64_fetchadd4_acq     __fetchadd4_acq
-#define ia64_fetchadd4_rel     __fetchadd4_rel
-#define ia64_fetchadd8_acq     __fetchadd8_acq
-#define ia64_fetchadd8_rel     __fetchadd8_rel
-
-#define ia64_xchg1             _InterlockedExchange8
-#define ia64_xchg2             _InterlockedExchange16
-#define ia64_xchg4             _InterlockedExchange
-#define ia64_xchg8             _InterlockedExchange64
-
-#define ia64_cmpxchg1_rel      _InterlockedCompareExchange8_rel
-#define ia64_cmpxchg1_acq      _InterlockedCompareExchange8_acq
-#define ia64_cmpxchg2_rel      _InterlockedCompareExchange16_rel
-#define ia64_cmpxchg2_acq      _InterlockedCompareExchange16_acq
-#define ia64_cmpxchg4_rel      _InterlockedCompareExchange_rel
-#define ia64_cmpxchg4_acq      _InterlockedCompareExchange_acq
-#define ia64_cmpxchg8_rel      _InterlockedCompareExchange64_rel
-#define ia64_cmpxchg8_acq      _InterlockedCompareExchange64_acq
-
-#define __ia64_set_dbr(index, val)     \
-               __setIndReg(_IA64_REG_INDR_DBR, index, val)
-#define ia64_set_ibr(index, val)       \
-               __setIndReg(_IA64_REG_INDR_IBR, index, val)
-#define ia64_set_pkr(index, val)       \
-               __setIndReg(_IA64_REG_INDR_PKR, index, val)
-#define ia64_set_pmc(index, val)       \
-               __setIndReg(_IA64_REG_INDR_PMC, index, val)
-#define ia64_set_pmd(index, val)       \
-               __setIndReg(_IA64_REG_INDR_PMD, index, val)
-#define ia64_native_set_rr(index, val) \
-               __setIndReg(_IA64_REG_INDR_RR, index, val)
-
-#define ia64_native_get_cpuid(index)   \
-               __getIndReg(_IA64_REG_INDR_CPUID, index)
-#define __ia64_get_dbr(index)          __getIndReg(_IA64_REG_INDR_DBR, index)
-#define ia64_get_ibr(index)            __getIndReg(_IA64_REG_INDR_IBR, index)
-#define ia64_get_pkr(index)            __getIndReg(_IA64_REG_INDR_PKR, index)
-#define ia64_get_pmc(index)            __getIndReg(_IA64_REG_INDR_PMC, index)
-#define ia64_native_get_pmd(index)     __getIndReg(_IA64_REG_INDR_PMD, index)
-#define ia64_native_get_rr(index)      __getIndReg(_IA64_REG_INDR_RR, index)
-
-#define ia64_srlz_d            __dsrlz
-#define ia64_srlz_i            __isrlz
-
-#define ia64_dv_serialize_data()
-#define ia64_dv_serialize_instruction()
-
-#define ia64_st1_rel           __st1_rel
-#define ia64_st2_rel           __st2_rel
-#define ia64_st4_rel           __st4_rel
-#define ia64_st8_rel           __st8_rel
-
-/* FIXME: need st4.rel.nta intrinsic */
-#define ia64_st4_rel_nta       __st4_rel
-
-#define ia64_ld1_acq           __ld1_acq
-#define ia64_ld2_acq           __ld2_acq
-#define ia64_ld4_acq           __ld4_acq
-#define ia64_ld8_acq           __ld8_acq
-
-#define ia64_sync_i            __synci
-#define ia64_native_thash      __thash
-#define ia64_native_ttag       __ttag
-#define ia64_itcd              __itcd
-#define ia64_itci              __itci
-#define ia64_itrd              __itrd
-#define ia64_itri              __itri
-#define ia64_ptce              __ptce
-#define ia64_ptcl              __ptcl
-#define ia64_native_ptcg       __ptcg
-#define ia64_native_ptcga      __ptcga
-#define ia64_ptri              __ptri
-#define ia64_ptrd              __ptrd
-#define ia64_dep_mi            _m64_dep_mi
-
-/* Values for lfhint in __lfetch and __lfetch_fault */
-
-#define ia64_lfhint_none       __lfhint_none
-#define ia64_lfhint_nt1                __lfhint_nt1
-#define ia64_lfhint_nt2                __lfhint_nt2
-#define ia64_lfhint_nta                __lfhint_nta
-
-#define ia64_lfetch            __lfetch
-#define ia64_lfetch_excl       __lfetch_excl
-#define ia64_lfetch_fault      __lfetch_fault
-#define ia64_lfetch_fault_excl __lfetch_fault_excl
-
-#define ia64_native_intrin_local_irq_restore(x)                \
-do {                                                   \
-       if ((x) != 0) {                                 \
-               ia64_native_ssm(IA64_PSR_I);            \
-               ia64_srlz_d();                          \
-       } else {                                        \
-               ia64_native_rsm(IA64_PSR_I);            \
-       }                                               \
-} while (0)
-
-#define __builtin_trap()       __break(0);
-
-#endif /* _ASM_IA64_INTEL_INTRIN_H */
diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h
deleted file mode 100644 (file)
index 47d686d..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-#ifndef _ASM_IA64_INTRINSICS_H
-#define _ASM_IA64_INTRINSICS_H
-
-/*
- * Compiler-dependent intrinsics.
- *
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#ifndef __ASSEMBLY__
-
-/* include compiler specific intrinsics */
-#include <asm/ia64regs.h>
-#ifdef __INTEL_COMPILER
-# include <asm/intel_intrin.h>
-#else
-# include <asm/gcc_intrin.h>
-#endif
-
-#define ia64_native_get_psr_i()        (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I)
-
-#define ia64_native_set_rr0_to_rr4(val0, val1, val2, val3, val4)       \
-do {                                                                   \
-       ia64_native_set_rr(0x0000000000000000UL, (val0));               \
-       ia64_native_set_rr(0x2000000000000000UL, (val1));               \
-       ia64_native_set_rr(0x4000000000000000UL, (val2));               \
-       ia64_native_set_rr(0x6000000000000000UL, (val3));               \
-       ia64_native_set_rr(0x8000000000000000UL, (val4));               \
-} while (0)
-
-/*
- * Force an unresolved reference if someone tries to use
- * ia64_fetch_and_add() with a bad value.
- */
-extern unsigned long __bad_size_for_ia64_fetch_and_add (void);
-extern unsigned long __bad_increment_for_ia64_fetch_and_add (void);
-
-#define IA64_FETCHADD(tmp,v,n,sz,sem)                                          \
-({                                                                             \
-       switch (sz) {                                                           \
-             case 4:                                                           \
-               tmp = ia64_fetchadd4_##sem((unsigned int *) v, n);              \
-               break;                                                          \
-                                                                               \
-             case 8:                                                           \
-               tmp = ia64_fetchadd8_##sem((unsigned long *) v, n);             \
-               break;                                                          \
-                                                                               \
-             default:                                                          \
-               __bad_size_for_ia64_fetch_and_add();                            \
-       }                                                                       \
-})
-
-#define ia64_fetchadd(i,v,sem)                                                         \
-({                                                                                     \
-       __u64 _tmp;                                                                     \
-       volatile __typeof__(*(v)) *_v = (v);                                            \
-       /* Can't use a switch () here: gcc isn't always smart enough for that... */     \
-       if ((i) == -16)                                                                 \
-               IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v)), sem);                        \
-       else if ((i) == -8)                                                             \
-               IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v)), sem);                         \
-       else if ((i) == -4)                                                             \
-               IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v)), sem);                         \
-       else if ((i) == -1)                                                             \
-               IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v)), sem);                         \
-       else if ((i) == 1)                                                              \
-               IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v)), sem);                          \
-       else if ((i) == 4)                                                              \
-               IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v)), sem);                          \
-       else if ((i) == 8)                                                              \
-               IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v)), sem);                          \
-       else if ((i) == 16)                                                             \
-               IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v)), sem);                         \
-       else                                                                            \
-               _tmp = __bad_increment_for_ia64_fetch_and_add();                        \
-       (__typeof__(*(v))) (_tmp);      /* return old value */                          \
-})
-
-#define ia64_fetch_and_add(i,v)        (ia64_fetchadd(i, v, rel) + (i)) /* return new value */
-
-/*
- * This function doesn't exist, so you'll get a linker error if
- * something tries to do an invalid xchg().
- */
-extern void ia64_xchg_called_with_bad_pointer (void);
-
-#define __xchg(x,ptr,size)                                             \
-({                                                                     \
-       unsigned long __xchg_result;                                    \
-                                                                       \
-       switch (size) {                                                 \
-             case 1:                                                   \
-               __xchg_result = ia64_xchg1((__u8 *)ptr, x);             \
-               break;                                                  \
-                                                                       \
-             case 2:                                                   \
-               __xchg_result = ia64_xchg2((__u16 *)ptr, x);            \
-               break;                                                  \
-                                                                       \
-             case 4:                                                   \
-               __xchg_result = ia64_xchg4((__u32 *)ptr, x);            \
-               break;                                                  \
-                                                                       \
-             case 8:                                                   \
-               __xchg_result = ia64_xchg8((__u64 *)ptr, x);            \
-               break;                                                  \
-             default:                                                  \
-               ia64_xchg_called_with_bad_pointer();                    \
-       }                                                               \
-       __xchg_result;                                                  \
-})
-
-#define xchg(ptr,x)                                                         \
-  ((__typeof__(*(ptr))) __xchg ((unsigned long) (x), (ptr), 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.
- */
-
-#define __HAVE_ARCH_CMPXCHG 1
-
-/*
- * This function doesn't exist, so you'll get a linker error
- * if something tries to do an invalid cmpxchg().
- */
-extern long ia64_cmpxchg_called_with_bad_pointer (void);
-
-#define ia64_cmpxchg(sem,ptr,old,new,size)                                             \
-({                                                                                     \
-       __u64 _o_, _r_;                                                                 \
-                                                                                       \
-       switch (size) {                                                                 \
-             case 1: _o_ = (__u8 ) (long) (old); break;                                \
-             case 2: _o_ = (__u16) (long) (old); break;                                \
-             case 4: _o_ = (__u32) (long) (old); break;                                \
-             case 8: _o_ = (__u64) (long) (old); break;                                \
-             default: break;                                                           \
-       }                                                                               \
-       switch (size) {                                                                 \
-             case 1:                                                                   \
-               _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_);                      \
-               break;                                                                  \
-                                                                                       \
-             case 2:                                                                   \
-              _r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_);                      \
-               break;                                                                  \
-                                                                                       \
-             case 4:                                                                   \
-               _r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_);                     \
-               break;                                                                  \
-                                                                                       \
-             case 8:                                                                   \
-               _r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_);                     \
-               break;                                                                  \
-                                                                                       \
-             default:                                                                  \
-               _r_ = ia64_cmpxchg_called_with_bad_pointer();                           \
-               break;                                                                  \
-       }                                                                               \
-       (__typeof__(old)) _r_;                                                          \
-})
-
-#define cmpxchg_acq(ptr, o, n) \
-       ia64_cmpxchg(acq, (ptr), (o), (n), sizeof(*(ptr)))
-#define cmpxchg_rel(ptr, o, n) \
-       ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr)))
-
-/* for compatibility with other platforms: */
-#define cmpxchg(ptr, o, n)     cmpxchg_acq((ptr), (o), (n))
-#define cmpxchg64(ptr, o, n)   cmpxchg_acq((ptr), (o), (n))
-
-#define cmpxchg_local          cmpxchg
-#define cmpxchg64_local                cmpxchg64
-
-#ifdef CONFIG_IA64_DEBUG_CMPXCHG
-# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128;
-# define CMPXCHG_BUGCHECK(v)                                                   \
-  do {                                                                         \
-       if (_cmpxchg_bugcheck_count-- <= 0) {                                   \
-               void *ip;                                                       \
-               extern int printk(const char *fmt, ...);                        \
-               ip = (void *) ia64_getreg(_IA64_REG_IP);                        \
-               printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));  \
-               break;                                                          \
-       }                                                                       \
-  } while (0)
-#else /* !CONFIG_IA64_DEBUG_CMPXCHG */
-# define CMPXCHG_BUGCHECK_DECL
-# define CMPXCHG_BUGCHECK(v)
-#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */
-
-#endif
-
-#ifdef __KERNEL__
-#include <asm/paravirt_privop.h>
-#endif
-
-#ifndef __ASSEMBLY__
-#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__)
-#define IA64_INTRINSIC_API(name)       pv_cpu_ops.name
-#define IA64_INTRINSIC_MACRO(name)     paravirt_ ## name
-#else
-#define IA64_INTRINSIC_API(name)       ia64_native_ ## name
-#define IA64_INTRINSIC_MACRO(name)     ia64_native_ ## name
-#endif
-
-/************************************************/
-/* Instructions paravirtualized for correctness */
-/************************************************/
-/* fc, thash, get_cpuid, get_pmd, get_eflags, set_eflags */
-/* Note that "ttag" and "cover" are also privilege-sensitive; "ttag"
- * is not currently used (though it may be in a long-format VHPT system!)
- */
-#define ia64_fc                                IA64_INTRINSIC_API(fc)
-#define ia64_thash                     IA64_INTRINSIC_API(thash)
-#define ia64_get_cpuid                 IA64_INTRINSIC_API(get_cpuid)
-#define ia64_get_pmd                   IA64_INTRINSIC_API(get_pmd)
-
-
-/************************************************/
-/* Instructions paravirtualized for performance */
-/************************************************/
-#define ia64_ssm                       IA64_INTRINSIC_MACRO(ssm)
-#define ia64_rsm                       IA64_INTRINSIC_MACRO(rsm)
-#define ia64_getreg                    IA64_INTRINSIC_API(getreg)
-#define ia64_setreg                    IA64_INTRINSIC_API(setreg)
-#define ia64_set_rr                    IA64_INTRINSIC_API(set_rr)
-#define ia64_get_rr                    IA64_INTRINSIC_API(get_rr)
-#define ia64_ptcga                     IA64_INTRINSIC_API(ptcga)
-#define ia64_get_psr_i                 IA64_INTRINSIC_API(get_psr_i)
-#define ia64_intrin_local_irq_restore  \
-       IA64_INTRINSIC_API(intrin_local_irq_restore)
-#define ia64_set_rr0_to_rr4            IA64_INTRINSIC_API(set_rr0_to_rr4)
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_INTRINSICS_H */
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
deleted file mode 100644 (file)
index 260a85a..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-#ifndef _ASM_IA64_IO_H
-#define _ASM_IA64_IO_H
-
-/*
- * This file contains the definitions for the emulated IO instructions
- * inb/inw/inl/outb/outw/outl and the "string versions" of the same
- * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
- * versions of the single-IO instructions (inb_p/inw_p/..).
- *
- * This file is not meant to be obfuscating: it's just complicated to
- * (a) handle it all in a way that makes gcc able to optimize it as
- * well as possible and (b) trying to avoid writing the same thing
- * over and over again with slight variations and possibly making a
- * mistake somewhere.
- *
- * Copyright (C) 1998-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
- */
-
-/* We don't use IO slowdowns on the ia64, but.. */
-#define __SLOW_DOWN_IO do { } while (0)
-#define SLOW_DOWN_IO   do { } while (0)
-
-#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)
-
-/*
- * The legacy I/O space defined by the ia64 architecture supports only 65536 ports, but
- * large machines may have multiple other I/O spaces so we can't place any a priori limit
- * on IO_SPACE_LIMIT.  These additional spaces are described in ACPI.
- */
-#define IO_SPACE_LIMIT         0xffffffffffffffffUL
-
-#define MAX_IO_SPACES_BITS             8
-#define MAX_IO_SPACES                  (1UL << MAX_IO_SPACES_BITS)
-#define IO_SPACE_BITS                  24
-#define IO_SPACE_SIZE                  (1UL << IO_SPACE_BITS)
-
-#define IO_SPACE_NR(port)              ((port) >> IO_SPACE_BITS)
-#define IO_SPACE_BASE(space)           ((space) << IO_SPACE_BITS)
-#define IO_SPACE_PORT(port)            ((port) & (IO_SPACE_SIZE - 1))
-
-#define IO_SPACE_SPARSE_ENCODING(p)    ((((p) >> 2) << 12) | ((p) & 0xfff))
-
-struct io_space {
-       unsigned long mmio_base;        /* base in MMIO space */
-       int sparse;
-};
-
-extern struct io_space io_space[];
-extern unsigned int num_io_spaces;
-
-# ifdef __KERNEL__
-
-/*
- * All MMIO iomem cookies are in region 6; anything less is a PIO cookie:
- *     0xCxxxxxxxxxxxxxxx      MMIO cookie (return from ioremap)
- *     0x000000001SPPPPPP      PIO cookie (S=space number, P..P=port)
- *
- * ioread/writeX() uses the leading 1 in PIO cookies (PIO_OFFSET) to catch
- * code that uses bare port numbers without the prerequisite pci_iomap().
- */
-#define PIO_OFFSET             (1UL << (MAX_IO_SPACES_BITS + IO_SPACE_BITS))
-#define PIO_MASK               (PIO_OFFSET - 1)
-#define PIO_RESERVED           __IA64_UNCACHED_OFFSET
-#define HAVE_ARCH_PIO_SIZE
-
-#include <asm/intrinsics.h>
-#include <asm/machvec.h>
-#include <asm/page.h>
-#include <asm/system.h>
-#include <asm-generic/iomap.h>
-
-/*
- * Change virtual addresses to physical addresses and vv.
- */
-static inline unsigned long
-virt_to_phys (volatile void *address)
-{
-       return (unsigned long) address - PAGE_OFFSET;
-}
-
-static inline void*
-phys_to_virt (unsigned long address)
-{
-       return (void *) (address + PAGE_OFFSET);
-}
-
-#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
-extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
-extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */
-extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
-
-/*
- * The following two macros are deprecated and scheduled for removal.
- * Please use the PCI-DMA interface defined in <asm/pci.h> instead.
- */
-#define bus_to_virt    phys_to_virt
-#define virt_to_bus    virt_to_phys
-#define page_to_bus    page_to_phys
-
-# endif /* KERNEL */
-
-/*
- * Memory fence w/accept.  This should never be used in code that is
- * not IA-64 specific.
- */
-#define __ia64_mf_a()  ia64_mfa()
-
-/**
- * ___ia64_mmiowb - I/O write barrier
- *
- * Ensure ordering of I/O space writes.  This will make sure that writes
- * following the barrier will arrive after all previous writes.  For most
- * ia64 platforms, this is a simple 'mf.a' instruction.
- *
- * See Documentation/DocBook/deviceiobook.tmpl for more information.
- */
-static inline void ___ia64_mmiowb(void)
-{
-       ia64_mfa();
-}
-
-static inline void*
-__ia64_mk_io_addr (unsigned long port)
-{
-       struct io_space *space;
-       unsigned long offset;
-
-       space = &io_space[IO_SPACE_NR(port)];
-       port = IO_SPACE_PORT(port);
-       if (space->sparse)
-               offset = IO_SPACE_SPARSE_ENCODING(port);
-       else
-               offset = port;
-
-       return (void *) (space->mmio_base | offset);
-}
-
-#define __ia64_inb     ___ia64_inb
-#define __ia64_inw     ___ia64_inw
-#define __ia64_inl     ___ia64_inl
-#define __ia64_outb    ___ia64_outb
-#define __ia64_outw    ___ia64_outw
-#define __ia64_outl    ___ia64_outl
-#define __ia64_readb   ___ia64_readb
-#define __ia64_readw   ___ia64_readw
-#define __ia64_readl   ___ia64_readl
-#define __ia64_readq   ___ia64_readq
-#define __ia64_readb_relaxed   ___ia64_readb
-#define __ia64_readw_relaxed   ___ia64_readw
-#define __ia64_readl_relaxed   ___ia64_readl
-#define __ia64_readq_relaxed   ___ia64_readq
-#define __ia64_writeb  ___ia64_writeb
-#define __ia64_writew  ___ia64_writew
-#define __ia64_writel  ___ia64_writel
-#define __ia64_writeq  ___ia64_writeq
-#define __ia64_mmiowb  ___ia64_mmiowb
-
-/*
- * For the in/out routines, we need to do "mf.a" _after_ doing the I/O access to ensure
- * that the access has completed before executing other I/O accesses.  Since we're doing
- * the accesses through an uncachable (UC) translation, the CPU will execute them in
- * program order.  However, we still need to tell the compiler not to shuffle them around
- * during optimization, which is why we use "volatile" pointers.
- */
-
-static inline unsigned int
-___ia64_inb (unsigned long port)
-{
-       volatile unsigned char *addr = __ia64_mk_io_addr(port);
-       unsigned char ret;
-
-       ret = *addr;
-       __ia64_mf_a();
-       return ret;
-}
-
-static inline unsigned int
-___ia64_inw (unsigned long port)
-{
-       volatile unsigned short *addr = __ia64_mk_io_addr(port);
-       unsigned short ret;
-
-       ret = *addr;
-       __ia64_mf_a();
-       return ret;
-}
-
-static inline unsigned int
-___ia64_inl (unsigned long port)
-{
-       volatile unsigned int *addr = __ia64_mk_io_addr(port);
-       unsigned int ret;
-
-       ret = *addr;
-       __ia64_mf_a();
-       return ret;
-}
-
-static inline void
-___ia64_outb (unsigned char val, unsigned long port)
-{
-       volatile unsigned char *addr = __ia64_mk_io_addr(port);
-
-       *addr = val;
-       __ia64_mf_a();
-}
-
-static inline void
-___ia64_outw (unsigned short val, unsigned long port)
-{
-       volatile unsigned short *addr = __ia64_mk_io_addr(port);
-
-       *addr = val;
-       __ia64_mf_a();
-}
-
-static inline void
-___ia64_outl (unsigned int val, unsigned long port)
-{
-       volatile unsigned int *addr = __ia64_mk_io_addr(port);
-
-       *addr = val;
-       __ia64_mf_a();
-}
-
-static inline void
-__insb (unsigned long port, void *dst, unsigned long count)
-{
-       unsigned char *dp = dst;
-
-       while (count--)
-               *dp++ = platform_inb(port);
-}
-
-static inline void
-__insw (unsigned long port, void *dst, unsigned long count)
-{
-       unsigned short *dp = dst;
-
-       while (count--)
-               *dp++ = platform_inw(port);
-}
-
-static inline void
-__insl (unsigned long port, void *dst, unsigned long count)
-{
-       unsigned int *dp = dst;
-
-       while (count--)
-               *dp++ = platform_inl(port);
-}
-
-static inline void
-__outsb (unsigned long port, const void *src, unsigned long count)
-{
-       const unsigned char *sp = src;
-
-       while (count--)
-               platform_outb(*sp++, port);
-}
-
-static inline void
-__outsw (unsigned long port, const void *src, unsigned long count)
-{
-       const unsigned short *sp = src;
-
-       while (count--)
-               platform_outw(*sp++, port);
-}
-
-static inline void
-__outsl (unsigned long port, const void *src, unsigned long count)
-{
-       const unsigned int *sp = src;
-
-       while (count--)
-               platform_outl(*sp++, port);
-}
-
-/*
- * Unfortunately, some platforms are broken and do not follow the IA-64 architecture
- * specification regarding legacy I/O support.  Thus, we have to make these operations
- * platform dependent...
- */
-#define __inb          platform_inb
-#define __inw          platform_inw
-#define __inl          platform_inl
-#define __outb         platform_outb
-#define __outw         platform_outw
-#define __outl         platform_outl
-#define __mmiowb       platform_mmiowb
-
-#define inb(p)         __inb(p)
-#define inw(p)         __inw(p)
-#define inl(p)         __inl(p)
-#define insb(p,d,c)    __insb(p,d,c)
-#define insw(p,d,c)    __insw(p,d,c)
-#define insl(p,d,c)    __insl(p,d,c)
-#define outb(v,p)      __outb(v,p)
-#define outw(v,p)      __outw(v,p)
-#define outl(v,p)      __outl(v,p)
-#define outsb(p,s,c)   __outsb(p,s,c)
-#define outsw(p,s,c)   __outsw(p,s,c)
-#define outsl(p,s,c)   __outsl(p,s,c)
-#define mmiowb()       __mmiowb()
-
-/*
- * The address passed to these functions are ioremap()ped already.
- *
- * We need these to be machine vectors since some platforms don't provide
- * DMA coherence via PIO reads (PCI drivers and the spec imply that this is
- * a good idea).  Writes are ok though for all existing ia64 platforms (and
- * hopefully it'll stay that way).
- */
-static inline unsigned char
-___ia64_readb (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned char __force *)addr;
-}
-
-static inline unsigned short
-___ia64_readw (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned short __force *)addr;
-}
-
-static inline unsigned int
-___ia64_readl (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned int __force *) addr;
-}
-
-static inline unsigned long
-___ia64_readq (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned long __force *) addr;
-}
-
-static inline void
-__writeb (unsigned char val, volatile void __iomem *addr)
-{
-       *(volatile unsigned char __force *) addr = val;
-}
-
-static inline void
-__writew (unsigned short val, volatile void __iomem *addr)
-{
-       *(volatile unsigned short __force *) addr = val;
-}
-
-static inline void
-__writel (unsigned int val, volatile void __iomem *addr)
-{
-       *(volatile unsigned int __force *) addr = val;
-}
-
-static inline void
-__writeq (unsigned long val, volatile void __iomem *addr)
-{
-       *(volatile unsigned long __force *) addr = val;
-}
-
-#define __readb                platform_readb
-#define __readw                platform_readw
-#define __readl                platform_readl
-#define __readq                platform_readq
-#define __readb_relaxed        platform_readb_relaxed
-#define __readw_relaxed        platform_readw_relaxed
-#define __readl_relaxed        platform_readl_relaxed
-#define __readq_relaxed        platform_readq_relaxed
-
-#define readb(a)       __readb((a))
-#define readw(a)       __readw((a))
-#define readl(a)       __readl((a))
-#define readq(a)       __readq((a))
-#define readb_relaxed(a)       __readb_relaxed((a))
-#define readw_relaxed(a)       __readw_relaxed((a))
-#define readl_relaxed(a)       __readl_relaxed((a))
-#define readq_relaxed(a)       __readq_relaxed((a))
-#define __raw_readb    readb
-#define __raw_readw    readw
-#define __raw_readl    readl
-#define __raw_readq    readq
-#define __raw_readb_relaxed    readb_relaxed
-#define __raw_readw_relaxed    readw_relaxed
-#define __raw_readl_relaxed    readl_relaxed
-#define __raw_readq_relaxed    readq_relaxed
-#define writeb(v,a)    __writeb((v), (a))
-#define writew(v,a)    __writew((v), (a))
-#define writel(v,a)    __writel((v), (a))
-#define writeq(v,a)    __writeq((v), (a))
-#define __raw_writeb   writeb
-#define __raw_writew   writew
-#define __raw_writel   writel
-#define __raw_writeq   writeq
-
-#ifndef inb_p
-# define inb_p         inb
-#endif
-#ifndef inw_p
-# define inw_p         inw
-#endif
-#ifndef inl_p
-# define inl_p         inl
-#endif
-
-#ifndef outb_p
-# define outb_p                outb
-#endif
-#ifndef outw_p
-# define outw_p                outw
-#endif
-#ifndef outl_p
-# define outl_p                outl
-#endif
-
-# ifdef __KERNEL__
-
-extern void __iomem * ioremap(unsigned long offset, unsigned long size);
-extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
-extern void iounmap (volatile void __iomem *addr);
-
-/*
- * String version of IO memory access ops:
- */
-extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n);
-extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
-extern void memset_io(volatile void __iomem *s, int c, long n);
-
-# endif /* __KERNEL__ */
-
-/*
- * Enabling BIO_VMERGE_BOUNDARY forces us to turn off I/O MMU bypassing.  It is said that
- * BIO-level virtual merging can give up to 4% performance boost (not verified for ia64).
- * On the other hand, we know that I/O MMU bypassing gives ~8% performance improvement on
- * SPECweb-like workloads on zx1-based machines.  Thus, for now we favor I/O MMU bypassing
- * over BIO-level virtual merging.
- */
-extern unsigned long ia64_max_iommu_merge_mask;
-#if 1
-#define BIO_VMERGE_BOUNDARY    0
-#else
-/*
- * It makes no sense at all to have this BIO_VMERGE_BOUNDARY macro here.  Should be
- * replaced by dma_merge_mask() or something of that sort.  Note: the only way
- * BIO_VMERGE_BOUNDARY is used is to mask off bits.  Effectively, our definition gets
- * expanded into:
- *
- *     addr & ((ia64_max_iommu_merge_mask + 1) - 1) == (addr & ia64_max_iommu_vmerge_mask)
- *
- * which is precisely what we want.
- */
-#define BIO_VMERGE_BOUNDARY    (ia64_max_iommu_merge_mask + 1)
-#endif
-
-#endif /* _ASM_IA64_IO_H */
diff --git a/include/asm-ia64/ioctl.h b/include/asm-ia64/ioctl.h
deleted file mode 100644 (file)
index b279fe0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/ioctl.h>
diff --git a/include/asm-ia64/ioctls.h b/include/asm-ia64/ioctls.h
deleted file mode 100644 (file)
index f41b636..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef _ASM_IA64_IOCTLS_H
-#define _ASM_IA64_IOCTLS_H
-
-/*
- * Based on <asm-i386/ioctls.h>
- *
- * Modified 1998, 1999, 2002
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <asm/ioctl.h>
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS         0x5401
-#define TCSETS         0x5402  /* Clashes with SNDCTL_TMR_START sound ioctl */
-#define TCSETSW                0x5403
-#define TCSETSF                0x5404
-#define TCGETA         0x5405
-#define TCSETA         0x5406
-#define TCSETAW                0x5407
-#define TCSETAF                0x5408
-#define TCSBRK         0x5409
-#define TCXONC         0x540A
-#define TCFLSH         0x540B
-#define TIOCEXCL       0x540C
-#define TIOCNXCL       0x540D
-#define TIOCSCTTY      0x540E
-#define TIOCGPGRP      0x540F
-#define TIOCSPGRP      0x5410
-#define TIOCOUTQ       0x5411
-#define TIOCSTI                0x5412
-#define TIOCGWINSZ     0x5413
-#define TIOCSWINSZ     0x5414
-#define TIOCMGET       0x5415
-#define TIOCMBIS       0x5416
-#define TIOCMBIC       0x5417
-#define TIOCMSET       0x5418
-#define TIOCGSOFTCAR   0x5419
-#define TIOCSSOFTCAR   0x541A
-#define FIONREAD       0x541B
-#define TIOCINQ                FIONREAD
-#define TIOCLINUX      0x541C
-#define TIOCCONS       0x541D
-#define TIOCGSERIAL    0x541E
-#define TIOCSSERIAL    0x541F
-#define TIOCPKT                0x5420
-#define FIONBIO                0x5421
-#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 TCGETS2                _IOR('T',0x2A, struct termios2)
-#define TCSETS2                _IOW('T',0x2B, struct termios2)
-#define TCSETSW2       _IOW('T',0x2C, struct termios2)
-#define TCSETSF2       _IOW('T',0x2D, struct termios2)
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-
-#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
-#define FIOCLEX                0x5451
-#define FIOASYNC       0x5452
-#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 */
-#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 */
-#define FIOQSIZE       0x5460
-
-/* Used for packet mode */
-#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 TIOCSER_TEMT    0x01   /* Transmitter physically empty */
-
-#endif /* _ASM_IA64_IOCTLS_H */
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
deleted file mode 100644 (file)
index b9c102e..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef __ASM_IA64_IOSAPIC_H
-#define __ASM_IA64_IOSAPIC_H
-
-#define        IOSAPIC_REG_SELECT      0x0
-#define        IOSAPIC_WINDOW          0x10
-#define        IOSAPIC_EOI             0x40
-
-#define        IOSAPIC_VERSION         0x1
-
-/*
- * Redirection table entry
- */
-#define        IOSAPIC_RTE_LOW(i)      (0x10+i*2)
-#define        IOSAPIC_RTE_HIGH(i)     (0x11+i*2)
-
-#define        IOSAPIC_DEST_SHIFT              16
-
-/*
- * Delivery mode
- */
-#define        IOSAPIC_DELIVERY_SHIFT          8
-#define        IOSAPIC_FIXED                   0x0
-#define        IOSAPIC_LOWEST_PRIORITY 0x1
-#define        IOSAPIC_PMI                     0x2
-#define        IOSAPIC_NMI                     0x4
-#define        IOSAPIC_INIT                    0x5
-#define        IOSAPIC_EXTINT                  0x7
-
-/*
- * Interrupt polarity
- */
-#define        IOSAPIC_POLARITY_SHIFT          13
-#define        IOSAPIC_POL_HIGH                0
-#define        IOSAPIC_POL_LOW         1
-
-/*
- * Trigger mode
- */
-#define        IOSAPIC_TRIGGER_SHIFT           15
-#define        IOSAPIC_EDGE                    0
-#define        IOSAPIC_LEVEL                   1
-
-/*
- * Mask bit
- */
-
-#define        IOSAPIC_MASK_SHIFT              16
-#define        IOSAPIC_MASK                    (1<<IOSAPIC_MASK_SHIFT)
-
-#define IOSAPIC_VECTOR_MASK            0xffffff00
-
-#ifndef __ASSEMBLY__
-
-#ifdef CONFIG_IOSAPIC
-
-#define NR_IOSAPICS                    256
-
-#ifdef CONFIG_PARAVIRT_GUEST
-#include <asm/paravirt.h>
-#else
-#define iosapic_pcat_compat_init       ia64_native_iosapic_pcat_compat_init
-#define __iosapic_read                 __ia64_native_iosapic_read
-#define __iosapic_write                        __ia64_native_iosapic_write
-#define iosapic_get_irq_chip           ia64_native_iosapic_get_irq_chip
-#endif
-
-extern void __init ia64_native_iosapic_pcat_compat_init(void);
-extern struct irq_chip *ia64_native_iosapic_get_irq_chip(unsigned long trigger);
-
-static inline unsigned int
-__ia64_native_iosapic_read(char __iomem *iosapic, unsigned int reg)
-{
-       writel(reg, iosapic + IOSAPIC_REG_SELECT);
-       return readl(iosapic + IOSAPIC_WINDOW);
-}
-
-static inline void
-__ia64_native_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
-{
-       writel(reg, iosapic + IOSAPIC_REG_SELECT);
-       writel(val, iosapic + IOSAPIC_WINDOW);
-}
-
-static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
-{
-       writel(vector, iosapic + IOSAPIC_EOI);
-}
-
-extern void __init iosapic_system_init (int pcat_compat);
-extern int __devinit iosapic_init (unsigned long address,
-                                   unsigned int gsi_base);
-#ifdef CONFIG_HOTPLUG
-extern int iosapic_remove (unsigned int gsi_base);
-#else
-#define iosapic_remove(gsi_base)                               (-EINVAL)
-#endif /* CONFIG_HOTPLUG */
-extern int gsi_to_irq (unsigned int gsi);
-extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
-                                 unsigned long trigger);
-extern void iosapic_unregister_intr (unsigned int irq);
-extern void __devinit iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
-                                     unsigned long polarity,
-                                     unsigned long trigger);
-extern int __init iosapic_register_platform_intr (u32 int_type,
-                                          unsigned int gsi,
-                                          int pmi_vector,
-                                          u16 eid, u16 id,
-                                          unsigned long polarity,
-                                          unsigned long trigger);
-
-#ifdef CONFIG_NUMA
-extern void __devinit map_iosapic_to_node (unsigned int, int);
-#endif
-#else
-#define iosapic_system_init(pcat_compat)                       do { } while (0)
-#define iosapic_init(address,gsi_base)                         (-EINVAL)
-#define iosapic_remove(gsi_base)                               (-ENODEV)
-#define iosapic_register_intr(gsi,polarity,trigger)            (gsi)
-#define iosapic_unregister_intr(irq)                           do { } while (0)
-#define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0)
-#define iosapic_register_platform_intr(type,gsi,pmi,eid,id, \
-       polarity,trigger)                                       (gsi)
-#endif
-
-# endif /* !__ASSEMBLY__ */
-#endif /* __ASM_IA64_IOSAPIC_H */
diff --git a/include/asm-ia64/ipcbuf.h b/include/asm-ia64/ipcbuf.h
deleted file mode 100644 (file)
index 079899a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _ASM_IA64_IPCBUF_H
-#define _ASM_IA64_IPCBUF_H
-
-/*
- * The ipc64_perm structure for IA-64 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 /* _ASM_IA64_IPCBUF_H */
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
deleted file mode 100644 (file)
index 3627116..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _ASM_IA64_IRQ_H
-#define _ASM_IA64_IRQ_H
-
-/*
- * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Stephane Eranian <eranian@hpl.hp.com>
- *
- * 11/24/98    S.Eranian       updated TIMER_IRQ and irq_canonicalize
- * 01/20/99    S.Eranian       added keyboard interrupt
- * 02/29/00     D.Mosberger    moved most things into hw_irq.h
- */
-
-#include <linux/types.h>
-#include <linux/cpumask.h>
-#include <asm-ia64/nr-irqs.h>
-
-static __inline__ int
-irq_canonicalize (int irq)
-{
-       /*
-        * We do the legacy thing here of pretending that irqs < 16
-        * are 8259 irqs.  This really shouldn't be necessary at all,
-        * but we keep it here as serial.c still uses it...
-        */
-       return ((irq == 2) ? 9 : irq);
-}
-
-extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
-bool is_affinity_mask_valid(cpumask_t cpumask);
-
-#define is_affinity_mask_valid is_affinity_mask_valid
-
-#endif /* _ASM_IA64_IRQ_H */
diff --git a/include/asm-ia64/irq_regs.h b/include/asm-ia64/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-ia64/kdebug.h b/include/asm-ia64/kdebug.h
deleted file mode 100644 (file)
index 35e4940..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef _IA64_KDEBUG_H
-#define _IA64_KDEBUG_H 1
-/*
- * include/asm-ia64/kdebug.h
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright (C) Intel Corporation, 2005
- *
- * 2005-Apr     Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
- *              <anil.s.keshavamurthy@intel.com> adopted from
- *              include/asm-x86_64/kdebug.h
- *
- * 2005-Oct    Keith Owens <kaos@sgi.com>.  Expand notify_die to cover more
- *             events.
- */
-
-enum die_val {
-       DIE_BREAK = 1,
-       DIE_FAULT,
-       DIE_OOPS,
-       DIE_MACHINE_HALT,
-       DIE_MACHINE_RESTART,
-       DIE_MCA_MONARCH_ENTER,
-       DIE_MCA_MONARCH_PROCESS,
-       DIE_MCA_MONARCH_LEAVE,
-       DIE_MCA_SLAVE_ENTER,
-       DIE_MCA_SLAVE_PROCESS,
-       DIE_MCA_SLAVE_LEAVE,
-       DIE_MCA_RENDZVOUS_ENTER,
-       DIE_MCA_RENDZVOUS_PROCESS,
-       DIE_MCA_RENDZVOUS_LEAVE,
-       DIE_MCA_NEW_TIMEOUT,
-       DIE_INIT_ENTER,
-       DIE_INIT_MONARCH_ENTER,
-       DIE_INIT_MONARCH_PROCESS,
-       DIE_INIT_MONARCH_LEAVE,
-       DIE_INIT_SLAVE_ENTER,
-       DIE_INIT_SLAVE_PROCESS,
-       DIE_INIT_SLAVE_LEAVE,
-       DIE_KDEBUG_ENTER,
-       DIE_KDEBUG_LEAVE,
-       DIE_KDUMP_ENTER,
-       DIE_KDUMP_LEAVE,
-};
-
-#endif
diff --git a/include/asm-ia64/kexec.h b/include/asm-ia64/kexec.h
deleted file mode 100644 (file)
index 541be83..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _ASM_IA64_KEXEC_H
-#define _ASM_IA64_KEXEC_H
-
-
-/* Maximum physical address we can use pages from */
-#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
-/* Maximum address we can reach in physical address mode */
-#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
-/* 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)
-
-/* The native architecture */
-#define KEXEC_ARCH KEXEC_ARCH_IA_64
-
-#define kexec_flush_icache_page(page) do { \
-                unsigned long page_addr = (unsigned long)page_address(page); \
-                flush_icache_range(page_addr, page_addr + PAGE_SIZE); \
-        } while(0)
-
-extern struct kimage *ia64_kimage;
-extern const unsigned int relocate_new_kernel_size;
-extern void relocate_new_kernel(unsigned long, unsigned long,
-               struct ia64_boot_param *, unsigned long);
-static inline void
-crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs)
-{
-}
-extern struct resource efi_memmap_res;
-extern struct resource boot_param_res;
-extern void kdump_smp_send_stop(void);
-extern void kdump_smp_send_init(void);
-extern void kexec_disable_iosapic(void);
-extern void crash_save_this_cpu(void);
-struct rsvd_region;
-extern unsigned long kdump_find_rsvd_region(unsigned long size,
-               struct rsvd_region *rsvd_regions, int n);
-extern void kdump_cpu_freeze(struct unw_frame_info *info, void *arg);
-extern int kdump_status[];
-extern atomic_t kdump_cpu_freezed;
-extern atomic_t kdump_in_progress;
-
-#endif /* _ASM_IA64_KEXEC_H */
diff --git a/include/asm-ia64/kmap_types.h b/include/asm-ia64/kmap_types.h
deleted file mode 100644 (file)
index 5d1658a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _ASM_IA64_KMAP_TYPES_H
-#define _ASM_IA64_KMAP_TYPES_H
-
-
-#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 /* _ASM_IA64_KMAP_TYPES_H */
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
deleted file mode 100644 (file)
index ef71b57..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef _ASM_KPROBES_H
-#define _ASM_KPROBES_H
-/*
- *  Kernel Probes (KProbes)
- *  include/asm-ia64/kprobes.h
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright (C) IBM Corporation, 2002, 2004
- * Copyright (C) Intel Corporation, 2005
- *
- * 2005-Apr     Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
- *              <anil.s.keshavamurthy@intel.com> adapted from i386
- */
-#include <linux/types.h>
-#include <linux/ptrace.h>
-#include <linux/percpu.h>
-#include <asm/break.h>
-
-#define __ARCH_WANT_KPROBES_INSN_SLOT
-#define MAX_INSN_SIZE   2      /* last half is for kprobe-booster */
-#define BREAK_INST     (long)(__IA64_BREAK_KPROBE << 6)
-#define NOP_M_INST     (long)(1<<27)
-#define BRL_INST(i1, i2) ((long)((0xcL << 37) |        /* brl */ \
-                               (0x1L << 12) |  /* many */ \
-                               (((i1) & 1) << 36) | ((i2) << 13))) /* imm */
-
-typedef union cmp_inst {
-       struct {
-       unsigned long long qp : 6;
-       unsigned long long p1 : 6;
-       unsigned long long c  : 1;
-       unsigned long long r2 : 7;
-       unsigned long long r3 : 7;
-       unsigned long long p2 : 6;
-       unsigned long long ta : 1;
-       unsigned long long x2 : 2;
-       unsigned long long tb : 1;
-       unsigned long long opcode : 4;
-       unsigned long long reserved : 23;
-       }f;
-       unsigned long long l;
-} cmp_inst_t;
-
-struct kprobe;
-
-typedef struct _bundle {
-       struct {
-               unsigned long long template : 5;
-               unsigned long long slot0 : 41;
-               unsigned long long slot1_p0 : 64-46;
-       } quad0;
-       struct {
-               unsigned long long slot1_p1 : 41 - (64-46);
-               unsigned long long slot2 : 41;
-       } quad1;
-} __attribute__((__aligned__(16)))  bundle_t;
-
-struct prev_kprobe {
-       struct kprobe *kp;
-       unsigned long status;
-};
-
-#define        MAX_PARAM_RSE_SIZE      (0x60+0x60/0x3f)
-/* per-cpu kprobe control block */
-#define ARCH_PREV_KPROBE_SZ 2
-struct kprobe_ctlblk {
-       unsigned long kprobe_status;
-       struct pt_regs jprobe_saved_regs;
-       unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
-       unsigned long *bsp;
-       unsigned long cfm;
-       atomic_t prev_kprobe_index;
-       struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
-};
-
-#define kretprobe_blacklist_size 0
-
-#define SLOT0_OPCODE_SHIFT     (37)
-#define SLOT1_p1_OPCODE_SHIFT  (37 - (64-46))
-#define SLOT2_OPCODE_SHIFT     (37)
-
-#define INDIRECT_CALL_OPCODE           (1)
-#define IP_RELATIVE_CALL_OPCODE                (5)
-#define IP_RELATIVE_BRANCH_OPCODE      (4)
-#define IP_RELATIVE_PREDICT_OPCODE     (7)
-#define LONG_BRANCH_OPCODE             (0xC)
-#define LONG_CALL_OPCODE               (0xD)
-#define flush_insn_slot(p)             do { } while (0)
-
-typedef struct kprobe_opcode {
-       bundle_t bundle;
-} kprobe_opcode_t;
-
-struct fnptr {
-       unsigned long ip;
-       unsigned long gp;
-};
-
-/* Architecture specific copy of original instruction*/
-struct arch_specific_insn {
-       /* copy of the instruction to be emulated */
-       kprobe_opcode_t *insn;
- #define INST_FLAG_FIX_RELATIVE_IP_ADDR                1
- #define INST_FLAG_FIX_BRANCH_REG              2
- #define INST_FLAG_BREAK_INST                  4
- #define INST_FLAG_BOOSTABLE                   8
-       unsigned long inst_flag;
-       unsigned short target_br_reg;
-       unsigned short slot;
-};
-
-extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-                                   unsigned long val, void *data);
-
-extern void invalidate_stacked_regs(void);
-extern void flush_register_stack(void);
-extern void arch_remove_kprobe(struct kprobe *p);
-
-#endif                         /* _ASM_KPROBES_H */
diff --git a/include/asm-ia64/kregs.h b/include/asm-ia64/kregs.h
deleted file mode 100644 (file)
index aefcdfe..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef _ASM_IA64_KREGS_H
-#define _ASM_IA64_KREGS_H
-
-/*
- * Copyright (C) 2001-2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-/*
- * This file defines the kernel register usage convention used by Linux/ia64.
- */
-
-/*
- * Kernel registers:
- */
-#define IA64_KR_IO_BASE                0       /* ar.k0: legacy I/O base address */
-#define IA64_KR_TSSD           1       /* ar.k1: IVE uses this as the TSSD */
-#define IA64_KR_PER_CPU_DATA   3       /* ar.k3: physical per-CPU base */
-#define IA64_KR_CURRENT_STACK  4       /* ar.k4: what's mapped in IA64_TR_CURRENT_STACK */
-#define IA64_KR_FPU_OWNER      5       /* ar.k5: fpu-owner (UP only, at the moment) */
-#define IA64_KR_CURRENT                6       /* ar.k6: "current" task pointer */
-#define IA64_KR_PT_BASE                7       /* ar.k7: page table base address (physical) */
-
-#define _IA64_KR_PASTE(x,y)    x##y
-#define _IA64_KR_PREFIX(n)     _IA64_KR_PASTE(ar.k, n)
-#define IA64_KR(n)             _IA64_KR_PREFIX(IA64_KR_##n)
-
-/*
- * Translation registers:
- */
-#define IA64_TR_KERNEL         0       /* itr0, dtr0: maps kernel image (code & data) */
-#define IA64_TR_PALCODE                1       /* itr1: maps PALcode as required by EFI */
-#define IA64_TR_CURRENT_STACK  1       /* dtr1: maps kernel's memory- & register-stacks */
-
-#define IA64_TR_ALLOC_BASE     2       /* itr&dtr: Base of dynamic TR resource*/
-#define IA64_TR_ALLOC_MAX      32      /* Max number for dynamic use*/
-
-/* Processor status register bits: */
-#define IA64_PSR_BE_BIT                1
-#define IA64_PSR_UP_BIT                2
-#define IA64_PSR_AC_BIT                3
-#define IA64_PSR_MFL_BIT       4
-#define IA64_PSR_MFH_BIT       5
-#define IA64_PSR_IC_BIT                13
-#define IA64_PSR_I_BIT         14
-#define IA64_PSR_PK_BIT                15
-#define IA64_PSR_DT_BIT                17
-#define IA64_PSR_DFL_BIT       18
-#define IA64_PSR_DFH_BIT       19
-#define IA64_PSR_SP_BIT                20
-#define IA64_PSR_PP_BIT                21
-#define IA64_PSR_DI_BIT                22
-#define IA64_PSR_SI_BIT                23
-#define IA64_PSR_DB_BIT                24
-#define IA64_PSR_LP_BIT                25
-#define IA64_PSR_TB_BIT                26
-#define IA64_PSR_RT_BIT                27
-/* The following are not affected by save_flags()/restore_flags(): */
-#define IA64_PSR_CPL0_BIT      32
-#define IA64_PSR_CPL1_BIT      33
-#define IA64_PSR_IS_BIT                34
-#define IA64_PSR_MC_BIT                35
-#define IA64_PSR_IT_BIT                36
-#define IA64_PSR_ID_BIT                37
-#define IA64_PSR_DA_BIT                38
-#define IA64_PSR_DD_BIT                39
-#define IA64_PSR_SS_BIT                40
-#define IA64_PSR_RI_BIT                41
-#define IA64_PSR_ED_BIT                43
-#define IA64_PSR_BN_BIT                44
-#define IA64_PSR_IA_BIT                45
-
-/* A mask of PSR bits that we generally don't want to inherit across a clone2() or an
-   execve().  Only list flags here that need to be cleared/set for BOTH clone2() and
-   execve().  */
-#define IA64_PSR_BITS_TO_CLEAR (IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_DB | IA64_PSR_LP | \
-                                IA64_PSR_TB  | IA64_PSR_ID  | IA64_PSR_DA | IA64_PSR_DD | \
-                                IA64_PSR_SS  | IA64_PSR_ED  | IA64_PSR_IA)
-#define IA64_PSR_BITS_TO_SET   (IA64_PSR_DFH | IA64_PSR_SP)
-
-#define IA64_PSR_BE    (__IA64_UL(1) << IA64_PSR_BE_BIT)
-#define IA64_PSR_UP    (__IA64_UL(1) << IA64_PSR_UP_BIT)
-#define IA64_PSR_AC    (__IA64_UL(1) << IA64_PSR_AC_BIT)
-#define IA64_PSR_MFL   (__IA64_UL(1) << IA64_PSR_MFL_BIT)
-#define IA64_PSR_MFH   (__IA64_UL(1) << IA64_PSR_MFH_BIT)
-#define IA64_PSR_IC    (__IA64_UL(1) << IA64_PSR_IC_BIT)
-#define IA64_PSR_I     (__IA64_UL(1) << IA64_PSR_I_BIT)
-#define IA64_PSR_PK    (__IA64_UL(1) << IA64_PSR_PK_BIT)
-#define IA64_PSR_DT    (__IA64_UL(1) << IA64_PSR_DT_BIT)
-#define IA64_PSR_DFL   (__IA64_UL(1) << IA64_PSR_DFL_BIT)
-#define IA64_PSR_DFH   (__IA64_UL(1) << IA64_PSR_DFH_BIT)
-#define IA64_PSR_SP    (__IA64_UL(1) << IA64_PSR_SP_BIT)
-#define IA64_PSR_PP    (__IA64_UL(1) << IA64_PSR_PP_BIT)
-#define IA64_PSR_DI    (__IA64_UL(1) << IA64_PSR_DI_BIT)
-#define IA64_PSR_SI    (__IA64_UL(1) << IA64_PSR_SI_BIT)
-#define IA64_PSR_DB    (__IA64_UL(1) << IA64_PSR_DB_BIT)
-#define IA64_PSR_LP    (__IA64_UL(1) << IA64_PSR_LP_BIT)
-#define IA64_PSR_TB    (__IA64_UL(1) << IA64_PSR_TB_BIT)
-#define IA64_PSR_RT    (__IA64_UL(1) << IA64_PSR_RT_BIT)
-/* The following are not affected by save_flags()/restore_flags(): */
-#define IA64_PSR_CPL   (__IA64_UL(3) << IA64_PSR_CPL0_BIT)
-#define IA64_PSR_IS    (__IA64_UL(1) << IA64_PSR_IS_BIT)
-#define IA64_PSR_MC    (__IA64_UL(1) << IA64_PSR_MC_BIT)
-#define IA64_PSR_IT    (__IA64_UL(1) << IA64_PSR_IT_BIT)
-#define IA64_PSR_ID    (__IA64_UL(1) << IA64_PSR_ID_BIT)
-#define IA64_PSR_DA    (__IA64_UL(1) << IA64_PSR_DA_BIT)
-#define IA64_PSR_DD    (__IA64_UL(1) << IA64_PSR_DD_BIT)
-#define IA64_PSR_SS    (__IA64_UL(1) << IA64_PSR_SS_BIT)
-#define IA64_PSR_RI    (__IA64_UL(3) << IA64_PSR_RI_BIT)
-#define IA64_PSR_ED    (__IA64_UL(1) << IA64_PSR_ED_BIT)
-#define IA64_PSR_BN    (__IA64_UL(1) << IA64_PSR_BN_BIT)
-#define IA64_PSR_IA    (__IA64_UL(1) << IA64_PSR_IA_BIT)
-
-/* User mask bits: */
-#define IA64_PSR_UM    (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL | IA64_PSR_MFH)
-
-/* Default Control Register */
-#define IA64_DCR_PP_BIT                 0      /* privileged performance monitor default */
-#define IA64_DCR_BE_BIT                 1      /* big-endian default */
-#define IA64_DCR_LC_BIT                 2      /* ia32 lock-check enable */
-#define IA64_DCR_DM_BIT                 8      /* defer TLB miss faults */
-#define IA64_DCR_DP_BIT                 9      /* defer page-not-present faults */
-#define IA64_DCR_DK_BIT                10      /* defer key miss faults */
-#define IA64_DCR_DX_BIT                11      /* defer key permission faults */
-#define IA64_DCR_DR_BIT                12      /* defer access right faults */
-#define IA64_DCR_DA_BIT                13      /* defer access bit faults */
-#define IA64_DCR_DD_BIT                14      /* defer debug faults */
-
-#define IA64_DCR_PP    (__IA64_UL(1) << IA64_DCR_PP_BIT)
-#define IA64_DCR_BE    (__IA64_UL(1) << IA64_DCR_BE_BIT)
-#define IA64_DCR_LC    (__IA64_UL(1) << IA64_DCR_LC_BIT)
-#define IA64_DCR_DM    (__IA64_UL(1) << IA64_DCR_DM_BIT)
-#define IA64_DCR_DP    (__IA64_UL(1) << IA64_DCR_DP_BIT)
-#define IA64_DCR_DK    (__IA64_UL(1) << IA64_DCR_DK_BIT)
-#define IA64_DCR_DX    (__IA64_UL(1) << IA64_DCR_DX_BIT)
-#define IA64_DCR_DR    (__IA64_UL(1) << IA64_DCR_DR_BIT)
-#define IA64_DCR_DA    (__IA64_UL(1) << IA64_DCR_DA_BIT)
-#define IA64_DCR_DD    (__IA64_UL(1) << IA64_DCR_DD_BIT)
-
-/* Interrupt Status Register */
-#define IA64_ISR_X_BIT         32      /* execute access */
-#define IA64_ISR_W_BIT         33      /* write access */
-#define IA64_ISR_R_BIT         34      /* read access */
-#define IA64_ISR_NA_BIT                35      /* non-access */
-#define IA64_ISR_SP_BIT                36      /* speculative load exception */
-#define IA64_ISR_RS_BIT                37      /* mandatory register-stack exception */
-#define IA64_ISR_IR_BIT                38      /* invalid register frame exception */
-#define IA64_ISR_CODE_MASK     0xf
-
-#define IA64_ISR_X     (__IA64_UL(1) << IA64_ISR_X_BIT)
-#define IA64_ISR_W     (__IA64_UL(1) << IA64_ISR_W_BIT)
-#define IA64_ISR_R     (__IA64_UL(1) << IA64_ISR_R_BIT)
-#define IA64_ISR_NA    (__IA64_UL(1) << IA64_ISR_NA_BIT)
-#define IA64_ISR_SP    (__IA64_UL(1) << IA64_ISR_SP_BIT)
-#define IA64_ISR_RS    (__IA64_UL(1) << IA64_ISR_RS_BIT)
-#define IA64_ISR_IR    (__IA64_UL(1) << IA64_ISR_IR_BIT)
-
-/* ISR code field for non-access instructions */
-#define IA64_ISR_CODE_TPA      0
-#define IA64_ISR_CODE_FC       1
-#define IA64_ISR_CODE_PROBE    2
-#define IA64_ISR_CODE_TAK      3
-#define IA64_ISR_CODE_LFETCH   4
-#define IA64_ISR_CODE_PROBEF   5
-
-#endif /* _ASM_IA64_kREGS_H */
diff --git a/include/asm-ia64/kvm.h b/include/asm-ia64/kvm.h
deleted file mode 100644 (file)
index 3f6a090..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#ifndef __ASM_IA64_KVM_H
-#define __ASM_IA64_KVM_H
-
-/*
- * asm-ia64/kvm.h: kvm structure definitions  for ia64
- *
- * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- */
-
-#include <asm/types.h>
-
-#include <linux/ioctl.h>
-
-/* Architectural interrupt line count. */
-#define KVM_NR_INTERRUPTS 256
-
-#define KVM_IOAPIC_NUM_PINS  48
-
-struct kvm_ioapic_state {
-       __u64 base_address;
-       __u32 ioregsel;
-       __u32 id;
-       __u32 irr;
-       __u32 pad;
-       union {
-               __u64 bits;
-               struct {
-                       __u8 vector;
-                       __u8 delivery_mode:3;
-                       __u8 dest_mode:1;
-                       __u8 delivery_status:1;
-                       __u8 polarity:1;
-                       __u8 remote_irr:1;
-                       __u8 trig_mode:1;
-                       __u8 mask:1;
-                       __u8 reserve:7;
-                       __u8 reserved[4];
-                       __u8 dest_id;
-               } fields;
-       } redirtbl[KVM_IOAPIC_NUM_PINS];
-};
-
-#define KVM_IRQCHIP_PIC_MASTER   0
-#define KVM_IRQCHIP_PIC_SLAVE    1
-#define KVM_IRQCHIP_IOAPIC       2
-
-#define KVM_CONTEXT_SIZE       8*1024
-
-struct kvm_fpreg {
-       union {
-               unsigned long bits[2];
-               long double __dummy;    /* force 16-byte alignment */
-       } u;
-};
-
-union context {
-       /* 8K size */
-       char    dummy[KVM_CONTEXT_SIZE];
-       struct {
-               unsigned long       psr;
-               unsigned long       pr;
-               unsigned long       caller_unat;
-               unsigned long       pad;
-               unsigned long       gr[32];
-               unsigned long       ar[128];
-               unsigned long       br[8];
-               unsigned long       cr[128];
-               unsigned long       rr[8];
-               unsigned long       ibr[8];
-               unsigned long       dbr[8];
-               unsigned long       pkr[8];
-               struct kvm_fpreg   fr[128];
-       };
-};
-
-struct thash_data {
-       union {
-               struct {
-                       unsigned long p    :  1; /* 0 */
-                       unsigned long rv1  :  1; /* 1 */
-                       unsigned long ma   :  3; /* 2-4 */
-                       unsigned long a    :  1; /* 5 */
-                       unsigned long d    :  1; /* 6 */
-                       unsigned long pl   :  2; /* 7-8 */
-                       unsigned long ar   :  3; /* 9-11 */
-                       unsigned long ppn  : 38; /* 12-49 */
-                       unsigned long rv2  :  2; /* 50-51 */
-                       unsigned long ed   :  1; /* 52 */
-                       unsigned long ig1  : 11; /* 53-63 */
-               };
-               struct {
-                       unsigned long __rv1 : 53;     /* 0-52 */
-                       unsigned long contiguous : 1; /*53 */
-                       unsigned long tc : 1;         /* 54 TR or TC */
-                       unsigned long cl : 1;
-                       /* 55 I side or D side cache line */
-                       unsigned long len  :  4;      /* 56-59 */
-                       unsigned long io  : 1;  /* 60 entry is for io or not */
-                       unsigned long nomap : 1;
-                       /* 61 entry cann't be inserted into machine TLB.*/
-                       unsigned long checked : 1;
-                       /* 62 for VTLB/VHPT sanity check */
-                       unsigned long invalid : 1;
-                       /* 63 invalid entry */
-               };
-               unsigned long page_flags;
-       };                  /* same for VHPT and TLB */
-
-       union {
-               struct {
-                       unsigned long rv3  :  2;
-                       unsigned long ps   :  6;
-                       unsigned long key  : 24;
-                       unsigned long rv4  : 32;
-               };
-               unsigned long itir;
-       };
-       union {
-               struct {
-                       unsigned long ig2  :  12;
-                       unsigned long vpn  :  49;
-                       unsigned long vrn  :   3;
-               };
-               unsigned long ifa;
-               unsigned long vadr;
-               struct {
-                       unsigned long tag  :  63;
-                       unsigned long ti   :  1;
-               };
-               unsigned long etag;
-       };
-       union {
-               struct thash_data *next;
-               unsigned long rid;
-               unsigned long gpaddr;
-       };
-};
-
-#define        NITRS   8
-#define NDTRS  8
-
-struct saved_vpd {
-       unsigned long  vhpi;
-       unsigned long  vgr[16];
-       unsigned long  vbgr[16];
-       unsigned long  vnat;
-       unsigned long  vbnat;
-       unsigned long  vcpuid[5];
-       unsigned long  vpsr;
-       unsigned long  vpr;
-       unsigned long  vcr[128];
-};
-
-struct kvm_regs {
-       char *saved_guest;
-       char *saved_stack;
-       struct saved_vpd vpd;
-       /*Arch-regs*/
-       int mp_state;
-       unsigned long vmm_rr;
-       /* TR and TC.  */
-       struct thash_data itrs[NITRS];
-       struct thash_data dtrs[NDTRS];
-       /* Bit is set if there is a tr/tc for the region.  */
-       unsigned char itr_regions;
-       unsigned char dtr_regions;
-       unsigned char tc_regions;
-
-       char irq_check;
-       unsigned long saved_itc;
-       unsigned long itc_check;
-       unsigned long timer_check;
-       unsigned long timer_pending;
-       unsigned long last_itc;
-
-       unsigned long vrr[8];
-       unsigned long ibr[8];
-       unsigned long dbr[8];
-       unsigned long insvc[4];         /* Interrupt in service.  */
-       unsigned long xtp;
-
-       unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
-       unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
-       unsigned long metaphysical_saved_rr0; /* from kvm_arch          */
-       unsigned long metaphysical_saved_rr4; /* from kvm_arch          */
-       unsigned long fp_psr;       /*used for lazy float register */
-       unsigned long saved_gp;
-       /*for phycial  emulation */
-};
-
-struct kvm_sregs {
-};
-
-struct kvm_fpu {
-};
-
-#endif
diff --git a/include/asm-ia64/kvm_host.h b/include/asm-ia64/kvm_host.h
deleted file mode 100644 (file)
index 1efe513..0000000
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * kvm_host.h: used for kvm module, and hold ia64-specific sections.
- *
- * Copyright (C) 2007, Intel Corporation.
- *
- * Xiantao Zhang <xiantao.zhang@intel.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- */
-
-#ifndef __ASM_KVM_HOST_H
-#define __ASM_KVM_HOST_H
-
-
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/kvm.h>
-#include <linux/kvm_para.h>
-#include <linux/kvm_types.h>
-
-#include <asm/pal.h>
-#include <asm/sal.h>
-
-#define KVM_MAX_VCPUS 4
-#define KVM_MEMORY_SLOTS 32
-/* memory slots that does not exposed to userspace */
-#define KVM_PRIVATE_MEM_SLOTS 4
-
-#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
-
-/* define exit reasons from vmm to kvm*/
-#define EXIT_REASON_VM_PANIC           0
-#define EXIT_REASON_MMIO_INSTRUCTION   1
-#define EXIT_REASON_PAL_CALL           2
-#define EXIT_REASON_SAL_CALL           3
-#define EXIT_REASON_SWITCH_RR6         4
-#define EXIT_REASON_VM_DESTROY         5
-#define EXIT_REASON_EXTERNAL_INTERRUPT 6
-#define EXIT_REASON_IPI                        7
-#define EXIT_REASON_PTC_G              8
-
-/*Define vmm address space and vm data space.*/
-#define KVM_VMM_SIZE (16UL<<20)
-#define KVM_VMM_SHIFT 24
-#define KVM_VMM_BASE 0xD000000000000000UL
-#define VMM_SIZE (8UL<<20)
-
-/*
- * Define vm_buffer, used by PAL Services, base address.
- * Note: vmbuffer is in the VMM-BLOCK, the size must be < 8M
- */
-#define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
-#define KVM_VM_BUFFER_SIZE (8UL<<20)
-
-/*Define Virtual machine data layout.*/
-#define KVM_VM_DATA_SHIFT  24
-#define KVM_VM_DATA_SIZE (1UL << KVM_VM_DATA_SHIFT)
-#define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VMM_SIZE)
-
-
-#define KVM_P2M_BASE    KVM_VM_DATA_BASE
-#define KVM_P2M_OFS     0
-#define KVM_P2M_SIZE    (8UL << 20)
-
-#define KVM_VHPT_BASE   (KVM_P2M_BASE + KVM_P2M_SIZE)
-#define KVM_VHPT_OFS    KVM_P2M_SIZE
-#define KVM_VHPT_BLOCK_SIZE   (2UL << 20)
-#define VHPT_SHIFT      18
-#define VHPT_SIZE       (1UL << VHPT_SHIFT)
-#define VHPT_NUM_ENTRIES (1<<(VHPT_SHIFT-5))
-
-#define KVM_VTLB_BASE   (KVM_VHPT_BASE+KVM_VHPT_BLOCK_SIZE)
-#define KVM_VTLB_OFS    (KVM_VHPT_OFS+KVM_VHPT_BLOCK_SIZE)
-#define KVM_VTLB_BLOCK_SIZE   (1UL<<20)
-#define VTLB_SHIFT      17
-#define VTLB_SIZE       (1UL<<VTLB_SHIFT)
-#define VTLB_NUM_ENTRIES (1<<(VTLB_SHIFT-5))
-
-#define KVM_VPD_BASE   (KVM_VTLB_BASE+KVM_VTLB_BLOCK_SIZE)
-#define KVM_VPD_OFS    (KVM_VTLB_OFS+KVM_VTLB_BLOCK_SIZE)
-#define KVM_VPD_BLOCK_SIZE   (2UL<<20)
-#define VPD_SHIFT       16
-#define VPD_SIZE        (1UL<<VPD_SHIFT)
-
-#define KVM_VCPU_BASE   (KVM_VPD_BASE+KVM_VPD_BLOCK_SIZE)
-#define KVM_VCPU_OFS    (KVM_VPD_OFS+KVM_VPD_BLOCK_SIZE)
-#define KVM_VCPU_BLOCK_SIZE   (2UL<<20)
-#define VCPU_SHIFT 18
-#define VCPU_SIZE (1UL<<VCPU_SHIFT)
-#define MAX_VCPU_NUM KVM_VCPU_BLOCK_SIZE/VCPU_SIZE
-
-#define KVM_VM_BASE     (KVM_VCPU_BASE+KVM_VCPU_BLOCK_SIZE)
-#define KVM_VM_OFS      (KVM_VCPU_OFS+KVM_VCPU_BLOCK_SIZE)
-#define KVM_VM_BLOCK_SIZE     (1UL<<19)
-
-#define KVM_MEM_DIRTY_LOG_BASE (KVM_VM_BASE+KVM_VM_BLOCK_SIZE)
-#define KVM_MEM_DIRTY_LOG_OFS  (KVM_VM_OFS+KVM_VM_BLOCK_SIZE)
-#define KVM_MEM_DIRTY_LOG_SIZE (1UL<<19)
-
-/* Get vpd, vhpt, tlb, vcpu, base*/
-#define VPD_ADDR(n) (KVM_VPD_BASE+n*VPD_SIZE)
-#define VHPT_ADDR(n) (KVM_VHPT_BASE+n*VHPT_SIZE)
-#define VTLB_ADDR(n) (KVM_VTLB_BASE+n*VTLB_SIZE)
-#define VCPU_ADDR(n) (KVM_VCPU_BASE+n*VCPU_SIZE)
-
-/*IO section definitions*/
-#define IOREQ_READ      1
-#define IOREQ_WRITE     0
-
-#define STATE_IOREQ_NONE        0
-#define STATE_IOREQ_READY       1
-#define STATE_IOREQ_INPROCESS   2
-#define STATE_IORESP_READY      3
-
-/*Guest Physical address layout.*/
-#define GPFN_MEM        (0UL << 60) /* Guest pfn is normal mem */
-#define GPFN_FRAME_BUFFER   (1UL << 60) /* VGA framebuffer */
-#define GPFN_LOW_MMIO       (2UL << 60) /* Low MMIO range */
-#define GPFN_PIB        (3UL << 60) /* PIB base */
-#define GPFN_IOSAPIC        (4UL << 60) /* IOSAPIC base */
-#define GPFN_LEGACY_IO      (5UL << 60) /* Legacy I/O base */
-#define GPFN_GFW        (6UL << 60) /* Guest Firmware */
-#define GPFN_HIGH_MMIO      (7UL << 60) /* High MMIO range */
-
-#define GPFN_IO_MASK        (7UL << 60) /* Guest pfn is I/O type */
-#define GPFN_INV_MASK       (1UL << 63) /* Guest pfn is invalid */
-#define INVALID_MFN       (~0UL)
-#define MEM_G   (1UL << 30)
-#define MEM_M   (1UL << 20)
-#define MMIO_START       (3 * MEM_G)
-#define MMIO_SIZE        (512 * MEM_M)
-#define VGA_IO_START     0xA0000UL
-#define VGA_IO_SIZE      0x20000
-#define LEGACY_IO_START  (MMIO_START + MMIO_SIZE)
-#define LEGACY_IO_SIZE   (64 * MEM_M)
-#define IO_SAPIC_START   0xfec00000UL
-#define IO_SAPIC_SIZE    0x100000
-#define PIB_START 0xfee00000UL
-#define PIB_SIZE 0x200000
-#define GFW_START        (4 * MEM_G - 16 * MEM_M)
-#define GFW_SIZE         (16 * MEM_M)
-
-/*Deliver mode, defined for ioapic.c*/
-#define dest_Fixed IOSAPIC_FIXED
-#define dest_LowestPrio IOSAPIC_LOWEST_PRIORITY
-
-#define NMI_VECTOR                     2
-#define ExtINT_VECTOR                  0
-#define NULL_VECTOR                    (-1)
-#define IA64_SPURIOUS_INT_VECTOR       0x0f
-
-#define VCPU_LID(v) (((u64)(v)->vcpu_id) << 24)
-
-/*
- *Delivery mode
- */
-#define SAPIC_DELIV_SHIFT      8
-#define SAPIC_FIXED            0x0
-#define SAPIC_LOWEST_PRIORITY  0x1
-#define SAPIC_PMI              0x2
-#define SAPIC_NMI              0x4
-#define SAPIC_INIT             0x5
-#define SAPIC_EXTINT           0x7
-
-/*
- * vcpu->requests bit members for arch
- */
-#define KVM_REQ_PTC_G          32
-#define KVM_REQ_RESUME         33
-
-#define KVM_PAGES_PER_HPAGE    1
-
-struct kvm;
-struct kvm_vcpu;
-struct kvm_guest_debug{
-};
-
-struct kvm_mmio_req {
-       uint64_t addr;          /*  physical address            */
-       uint64_t size;          /*  size in bytes               */
-       uint64_t data;          /*  data (or paddr of data)     */
-       uint8_t state:4;
-       uint8_t dir:1;          /*  1=read, 0=write             */
-};
-
-/*Pal data struct */
-struct kvm_pal_call{
-       /*In area*/
-       uint64_t gr28;
-       uint64_t gr29;
-       uint64_t gr30;
-       uint64_t gr31;
-       /*Out area*/
-       struct ia64_pal_retval ret;
-};
-
-/* Sal data structure */
-struct kvm_sal_call{
-       /*In area*/
-       uint64_t in0;
-       uint64_t in1;
-       uint64_t in2;
-       uint64_t in3;
-       uint64_t in4;
-       uint64_t in5;
-       uint64_t in6;
-       uint64_t in7;
-       struct sal_ret_values ret;
-};
-
-/*Guest change rr6*/
-struct kvm_switch_rr6 {
-       uint64_t old_rr;
-       uint64_t new_rr;
-};
-
-union ia64_ipi_a{
-       unsigned long val;
-       struct {
-               unsigned long rv  : 3;
-               unsigned long ir  : 1;
-               unsigned long eid : 8;
-               unsigned long id  : 8;
-               unsigned long ib_base : 44;
-       };
-};
-
-union ia64_ipi_d {
-       unsigned long val;
-       struct {
-               unsigned long vector : 8;
-               unsigned long dm  : 3;
-               unsigned long ig  : 53;
-       };
-};
-
-/*ipi check exit data*/
-struct kvm_ipi_data{
-       union ia64_ipi_a addr;
-       union ia64_ipi_d data;
-};
-
-/*global purge data*/
-struct kvm_ptc_g {
-       unsigned long vaddr;
-       unsigned long rr;
-       unsigned long ps;
-       struct kvm_vcpu *vcpu;
-};
-
-/*Exit control data */
-struct exit_ctl_data{
-       uint32_t exit_reason;
-       uint32_t vm_status;
-       union {
-               struct kvm_mmio_req     ioreq;
-               struct kvm_pal_call     pal_data;
-               struct kvm_sal_call     sal_data;
-               struct kvm_switch_rr6   rr_data;
-               struct kvm_ipi_data     ipi_data;
-               struct kvm_ptc_g        ptc_g_data;
-       } u;
-};
-
-union pte_flags {
-       unsigned long val;
-       struct {
-               unsigned long p    :  1; /*0      */
-               unsigned long      :  1; /* 1     */
-               unsigned long ma   :  3; /* 2-4   */
-               unsigned long a    :  1; /* 5     */
-               unsigned long d    :  1; /* 6     */
-               unsigned long pl   :  2; /* 7-8   */
-               unsigned long ar   :  3; /* 9-11  */
-               unsigned long ppn  : 38; /* 12-49 */
-               unsigned long      :  2; /* 50-51 */
-               unsigned long ed   :  1; /* 52    */
-       };
-};
-
-union ia64_pta {
-       unsigned long val;
-       struct {
-               unsigned long ve : 1;
-               unsigned long reserved0 : 1;
-               unsigned long size : 6;
-               unsigned long vf : 1;
-               unsigned long reserved1 : 6;
-               unsigned long base : 49;
-       };
-};
-
-struct thash_cb {
-       /* THASH base information */
-       struct thash_data       *hash; /* hash table pointer */
-       union ia64_pta          pta;
-       int           num;
-};
-
-struct kvm_vcpu_stat {
-};
-
-struct kvm_vcpu_arch {
-       int launched;
-       int last_exit;
-       int last_run_cpu;
-       int vmm_tr_slot;
-       int vm_tr_slot;
-
-#define KVM_MP_STATE_RUNNABLE          0
-#define KVM_MP_STATE_UNINITIALIZED     1
-#define KVM_MP_STATE_INIT_RECEIVED     2
-#define KVM_MP_STATE_HALTED            3
-       int mp_state;
-
-#define MAX_PTC_G_NUM                  3
-       int ptc_g_count;
-       struct kvm_ptc_g ptc_g_data[MAX_PTC_G_NUM];
-
-       /*halt timer to wake up sleepy vcpus*/
-       struct hrtimer hlt_timer;
-       long ht_active;
-
-       struct kvm_lapic *apic;    /* kernel irqchip context */
-       struct vpd *vpd;
-
-       /* Exit data for vmm_transition*/
-       struct exit_ctl_data exit_data;
-
-       cpumask_t cache_coherent_map;
-
-       unsigned long vmm_rr;
-       unsigned long host_rr6;
-       unsigned long psbits[8];
-       unsigned long cr_iipa;
-       unsigned long cr_isr;
-       unsigned long vsa_base;
-       unsigned long dirty_log_lock_pa;
-       unsigned long __gp;
-       /* TR and TC.  */
-       struct thash_data itrs[NITRS];
-       struct thash_data dtrs[NDTRS];
-       /* Bit is set if there is a tr/tc for the region.  */
-       unsigned char itr_regions;
-       unsigned char dtr_regions;
-       unsigned char tc_regions;
-       /* purge all */
-       unsigned long ptce_base;
-       unsigned long ptce_count[2];
-       unsigned long ptce_stride[2];
-       /* itc/itm */
-       unsigned long last_itc;
-       long itc_offset;
-       unsigned long itc_check;
-       unsigned long timer_check;
-       unsigned long timer_pending;
-
-       unsigned long vrr[8];
-       unsigned long ibr[8];
-       unsigned long dbr[8];
-       unsigned long insvc[4];         /* Interrupt in service.  */
-       unsigned long xtp;
-
-       unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
-       unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
-       unsigned long metaphysical_saved_rr0; /* from kvm_arch          */
-       unsigned long metaphysical_saved_rr4; /* from kvm_arch          */
-       unsigned long fp_psr;       /*used for lazy float register */
-       unsigned long saved_gp;
-       /*for phycial  emulation */
-       int mode_flags;
-       struct thash_cb vtlb;
-       struct thash_cb vhpt;
-       char irq_check;
-       char irq_new_pending;
-
-       unsigned long opcode;
-       unsigned long cause;
-       union context host;
-       union context guest;
-};
-
-struct kvm_vm_stat {
-       u64 remote_tlb_flush;
-};
-
-struct kvm_sal_data {
-       unsigned long boot_ip;
-       unsigned long boot_gp;
-};
-
-struct kvm_arch {
-       unsigned long   vm_base;
-       unsigned long   metaphysical_rr0;
-       unsigned long   metaphysical_rr4;
-       unsigned long   vmm_init_rr;
-       unsigned long   vhpt_base;
-       unsigned long   vtlb_base;
-       unsigned long   vpd_base;
-       spinlock_t dirty_log_lock;
-       struct kvm_ioapic *vioapic;
-       struct kvm_vm_stat stat;
-       struct kvm_sal_data rdv_sal_data;
-};
-
-union cpuid3_t {
-       u64 value;
-       struct {
-               u64 number : 8;
-               u64 revision : 8;
-               u64 model : 8;
-               u64 family : 8;
-               u64 archrev : 8;
-               u64 rv : 24;
-       };
-};
-
-struct kvm_pt_regs {
-       /* The following registers are saved by SAVE_MIN: */
-       unsigned long b6;  /* scratch */
-       unsigned long b7;  /* scratch */
-
-       unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
-       unsigned long ar_ssd; /* reserved for future use (scratch) */
-
-       unsigned long r8;  /* scratch (return value register 0) */
-       unsigned long r9;  /* scratch (return value register 1) */
-       unsigned long r10; /* scratch (return value register 2) */
-       unsigned long r11; /* scratch (return value register 3) */
-
-       unsigned long cr_ipsr; /* interrupted task's psr */
-       unsigned long cr_iip;  /* interrupted task's instruction pointer */
-       unsigned long cr_ifs;  /* interrupted task's function state */
-
-       unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
-       unsigned long ar_pfs;  /* prev function state  */
-       unsigned long ar_rsc;  /* RSE configuration */
-       /* The following two are valid only if cr_ipsr.cpl > 0: */
-       unsigned long ar_rnat;  /* RSE NaT */
-       unsigned long ar_bspstore; /* RSE bspstore */
-
-       unsigned long pr;  /* 64 predicate registers (1 bit each) */
-       unsigned long b0;  /* return pointer (bp) */
-       unsigned long loadrs;  /* size of dirty partition << 16 */
-
-       unsigned long r1;  /* the gp pointer */
-       unsigned long r12; /* interrupted task's memory stack pointer */
-       unsigned long r13; /* thread pointer */
-
-       unsigned long ar_fpsr;  /* floating point status (preserved) */
-       unsigned long r15;  /* scratch */
-
-       /* The remaining registers are NOT saved for system calls.  */
-       unsigned long r14;  /* scratch */
-       unsigned long r2;  /* scratch */
-       unsigned long r3;  /* scratch */
-       unsigned long r16;  /* scratch */
-       unsigned long r17;  /* scratch */
-       unsigned long r18;  /* scratch */
-       unsigned long r19;  /* scratch */
-       unsigned long r20;  /* scratch */
-       unsigned long r21;  /* scratch */
-       unsigned long r22;  /* scratch */
-       unsigned long r23;  /* scratch */
-       unsigned long r24;  /* scratch */
-       unsigned long r25;  /* scratch */
-       unsigned long r26;  /* scratch */
-       unsigned long r27;  /* scratch */
-       unsigned long r28;  /* scratch */
-       unsigned long r29;  /* scratch */
-       unsigned long r30;  /* scratch */
-       unsigned long r31;  /* scratch */
-       unsigned long ar_ccv;  /* compare/exchange value (scratch) */
-
-       /*
-        * Floating point registers that the kernel considers scratch:
-        */
-       struct ia64_fpreg f6;  /* scratch */
-       struct ia64_fpreg f7;  /* scratch */
-       struct ia64_fpreg f8;  /* scratch */
-       struct ia64_fpreg f9;  /* scratch */
-       struct ia64_fpreg f10;  /* scratch */
-       struct ia64_fpreg f11;  /* scratch */
-
-       unsigned long r4;  /* preserved */
-       unsigned long r5;  /* preserved */
-       unsigned long r6;  /* preserved */
-       unsigned long r7;  /* preserved */
-       unsigned long eml_unat;    /* used for emulating instruction */
-       unsigned long pad0;     /* alignment pad */
-};
-
-static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v)
-{
-       return (struct kvm_pt_regs *) ((unsigned long) v + IA64_STK_OFFSET) - 1;
-}
-
-typedef int kvm_vmm_entry(void);
-typedef void kvm_tramp_entry(union context *host, union context *guest);
-
-struct kvm_vmm_info{
-       struct module   *module;
-       kvm_vmm_entry   *vmm_entry;
-       kvm_tramp_entry *tramp_entry;
-       unsigned long   vmm_ivt;
-};
-
-int kvm_highest_pending_irq(struct kvm_vcpu *vcpu);
-int kvm_emulate_halt(struct kvm_vcpu *vcpu);
-int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
-void kvm_sal_emul(struct kvm_vcpu *vcpu);
-
-static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {}
-
-#endif
diff --git a/include/asm-ia64/kvm_para.h b/include/asm-ia64/kvm_para.h
deleted file mode 100644 (file)
index 9f9796b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __IA64_KVM_PARA_H
-#define __IA64_KVM_PARA_H
-
-/*
- * asm-ia64/kvm_para.h
- *
- * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- */
-
-static inline unsigned int kvm_arch_para_features(void)
-{
-       return 0;
-}
-
-#endif
diff --git a/include/asm-ia64/libata-portmap.h b/include/asm-ia64/libata-portmap.h
deleted file mode 100644 (file)
index 0e00c9a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __ASM_IA64_LIBATA_PORTMAP_H
-#define __ASM_IA64_LIBATA_PORTMAP_H
-
-#define ATA_PRIMARY_CMD                0x1F0
-#define ATA_PRIMARY_CTL                0x3F6
-#define ATA_PRIMARY_IRQ(dev)   isa_irq_to_vector(14)
-
-#define ATA_SECONDARY_CMD      0x170
-#define ATA_SECONDARY_CTL      0x376
-#define ATA_SECONDARY_IRQ(dev) isa_irq_to_vector(15)
-
-#endif
diff --git a/include/asm-ia64/linkage.h b/include/asm-ia64/linkage.h
deleted file mode 100644 (file)
index ef22a45..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
-
-#ifndef __ASSEMBLY__
-
-#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
-
-#else
-
-#include <asm/asmmacro.h>
-
-#endif
-
-#endif
diff --git a/include/asm-ia64/local.h b/include/asm-ia64/local.h
deleted file mode 100644 (file)
index c11c530..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/local.h>
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
deleted file mode 100644 (file)
index a6d50c7..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Machine vector for IA-64.
- *
- * Copyright (C) 1999 Silicon Graphics, Inc.
- * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
- * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
- * Copyright (C) 1999-2001, 2003-2004 Hewlett-Packard Co.
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-#ifndef _ASM_IA64_MACHVEC_H
-#define _ASM_IA64_MACHVEC_H
-
-#include <linux/types.h>
-
-/* forward declarations: */
-struct device;
-struct pt_regs;
-struct scatterlist;
-struct page;
-struct mm_struct;
-struct pci_bus;
-struct task_struct;
-struct pci_dev;
-struct msi_desc;
-struct dma_attrs;
-
-typedef void ia64_mv_setup_t (char **);
-typedef void ia64_mv_cpu_init_t (void);
-typedef void ia64_mv_irq_init_t (void);
-typedef void ia64_mv_send_ipi_t (int, int, int, int);
-typedef void ia64_mv_timer_interrupt_t (int, void *);
-typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
-typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
-typedef u8 ia64_mv_irq_to_vector (int);
-typedef unsigned int ia64_mv_local_vector_to_irq (u8);
-typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
-typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
-                                      u8 size);
-typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val,
-                                       u8 size);
-typedef void ia64_mv_migrate_t(struct task_struct * task);
-typedef void ia64_mv_pci_fixup_bus_t (struct pci_bus *);
-typedef void ia64_mv_kernel_launch_event_t(void);
-
-/* DMA-mapping interface: */
-typedef void ia64_mv_dma_init (void);
-typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, gfp_t);
-typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t);
-typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int);
-typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int);
-typedef int ia64_mv_dma_map_sg (struct device *, struct scatterlist *, int, int);
-typedef void ia64_mv_dma_unmap_sg (struct device *, struct scatterlist *, int, int);
-typedef void ia64_mv_dma_sync_single_for_cpu (struct device *, dma_addr_t, size_t, int);
-typedef void ia64_mv_dma_sync_sg_for_cpu (struct device *, struct scatterlist *, int, int);
-typedef void ia64_mv_dma_sync_single_for_device (struct device *, dma_addr_t, size_t, int);
-typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist *, int, int);
-typedef int ia64_mv_dma_mapping_error(struct device *, dma_addr_t dma_addr);
-typedef int ia64_mv_dma_supported (struct device *, u64);
-
-typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *);
-typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *);
-typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
-typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
-
-/*
- * WARNING: The legacy I/O space is _architected_.  Platforms are
- * expected to follow this architected model (see Section 10.7 in the
- * IA-64 Architecture Software Developer's Manual).  Unfortunately,
- * some broken machines do not follow that model, which is why we have
- * to make the inX/outX operations part of the machine vector.
- * Platform designers should follow the architected model whenever
- * possible.
- */
-typedef unsigned int ia64_mv_inb_t (unsigned long);
-typedef unsigned int ia64_mv_inw_t (unsigned long);
-typedef unsigned int ia64_mv_inl_t (unsigned long);
-typedef void ia64_mv_outb_t (unsigned char, unsigned long);
-typedef void ia64_mv_outw_t (unsigned short, unsigned long);
-typedef void ia64_mv_outl_t (unsigned int, unsigned long);
-typedef void ia64_mv_mmiowb_t (void);
-typedef unsigned char ia64_mv_readb_t (const volatile void __iomem *);
-typedef unsigned short ia64_mv_readw_t (const volatile void __iomem *);
-typedef unsigned int ia64_mv_readl_t (const volatile void __iomem *);
-typedef unsigned long ia64_mv_readq_t (const volatile void __iomem *);
-typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *);
-typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
-typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
-typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
-
-typedef int ia64_mv_setup_msi_irq_t (struct pci_dev *pdev, struct msi_desc *);
-typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
-
-static inline void
-machvec_noop (void)
-{
-}
-
-static inline void
-machvec_noop_mm (struct mm_struct *mm)
-{
-}
-
-static inline void
-machvec_noop_task (struct task_struct *task)
-{
-}
-
-static inline void
-machvec_noop_bus (struct pci_bus *bus)
-{
-}
-
-extern void machvec_setup (char **);
-extern void machvec_timer_interrupt (int, void *);
-extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
-extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);
-extern void machvec_tlb_migrate_finish (struct mm_struct *);
-
-# if defined (CONFIG_IA64_HP_SIM)
-#  include <asm/machvec_hpsim.h>
-# elif defined (CONFIG_IA64_DIG)
-#  include <asm/machvec_dig.h>
-# elif defined (CONFIG_IA64_HP_ZX1)
-#  include <asm/machvec_hpzx1.h>
-# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
-#  include <asm/machvec_hpzx1_swiotlb.h>
-# elif defined (CONFIG_IA64_SGI_SN2)
-#  include <asm/machvec_sn2.h>
-# elif defined (CONFIG_IA64_SGI_UV)
-#  include <asm/machvec_uv.h>
-# elif defined (CONFIG_IA64_GENERIC)
-
-# ifdef MACHVEC_PLATFORM_HEADER
-#  include MACHVEC_PLATFORM_HEADER
-# else
-#  define platform_name                ia64_mv.name
-#  define platform_setup       ia64_mv.setup
-#  define platform_cpu_init    ia64_mv.cpu_init
-#  define platform_irq_init    ia64_mv.irq_init
-#  define platform_send_ipi    ia64_mv.send_ipi
-#  define platform_timer_interrupt     ia64_mv.timer_interrupt
-#  define platform_global_tlb_purge    ia64_mv.global_tlb_purge
-#  define platform_tlb_migrate_finish  ia64_mv.tlb_migrate_finish
-#  define platform_dma_init            ia64_mv.dma_init
-#  define platform_dma_alloc_coherent  ia64_mv.dma_alloc_coherent
-#  define platform_dma_free_coherent   ia64_mv.dma_free_coherent
-#  define platform_dma_map_single_attrs        ia64_mv.dma_map_single_attrs
-#  define platform_dma_unmap_single_attrs      ia64_mv.dma_unmap_single_attrs
-#  define platform_dma_map_sg_attrs    ia64_mv.dma_map_sg_attrs
-#  define platform_dma_unmap_sg_attrs  ia64_mv.dma_unmap_sg_attrs
-#  define platform_dma_sync_single_for_cpu ia64_mv.dma_sync_single_for_cpu
-#  define platform_dma_sync_sg_for_cpu ia64_mv.dma_sync_sg_for_cpu
-#  define platform_dma_sync_single_for_device ia64_mv.dma_sync_single_for_device
-#  define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
-#  define platform_dma_mapping_error           ia64_mv.dma_mapping_error
-#  define platform_dma_supported       ia64_mv.dma_supported
-#  define platform_irq_to_vector       ia64_mv.irq_to_vector
-#  define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
-#  define platform_pci_get_legacy_mem  ia64_mv.pci_get_legacy_mem
-#  define platform_pci_legacy_read     ia64_mv.pci_legacy_read
-#  define platform_pci_legacy_write    ia64_mv.pci_legacy_write
-#  define platform_inb         ia64_mv.inb
-#  define platform_inw         ia64_mv.inw
-#  define platform_inl         ia64_mv.inl
-#  define platform_outb                ia64_mv.outb
-#  define platform_outw                ia64_mv.outw
-#  define platform_outl                ia64_mv.outl
-#  define platform_mmiowb      ia64_mv.mmiowb
-#  define platform_readb        ia64_mv.readb
-#  define platform_readw        ia64_mv.readw
-#  define platform_readl        ia64_mv.readl
-#  define platform_readq        ia64_mv.readq
-#  define platform_readb_relaxed        ia64_mv.readb_relaxed
-#  define platform_readw_relaxed        ia64_mv.readw_relaxed
-#  define platform_readl_relaxed        ia64_mv.readl_relaxed
-#  define platform_readq_relaxed        ia64_mv.readq_relaxed
-#  define platform_migrate             ia64_mv.migrate
-#  define platform_setup_msi_irq       ia64_mv.setup_msi_irq
-#  define platform_teardown_msi_irq    ia64_mv.teardown_msi_irq
-#  define platform_pci_fixup_bus       ia64_mv.pci_fixup_bus
-#  define platform_kernel_launch_event ia64_mv.kernel_launch_event
-# endif
-
-/* __attribute__((__aligned__(16))) is required to make size of the
- * structure multiple of 16 bytes.
- * This will fillup the holes created because of section 3.3.1 in
- * Software Conventions guide.
- */
-struct ia64_machine_vector {
-       const char *name;
-       ia64_mv_setup_t *setup;
-       ia64_mv_cpu_init_t *cpu_init;
-       ia64_mv_irq_init_t *irq_init;
-       ia64_mv_send_ipi_t *send_ipi;
-       ia64_mv_timer_interrupt_t *timer_interrupt;
-       ia64_mv_global_tlb_purge_t *global_tlb_purge;
-       ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish;
-       ia64_mv_dma_init *dma_init;
-       ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
-       ia64_mv_dma_free_coherent *dma_free_coherent;
-       ia64_mv_dma_map_single_attrs *dma_map_single_attrs;
-       ia64_mv_dma_unmap_single_attrs *dma_unmap_single_attrs;
-       ia64_mv_dma_map_sg_attrs *dma_map_sg_attrs;
-       ia64_mv_dma_unmap_sg_attrs *dma_unmap_sg_attrs;
-       ia64_mv_dma_sync_single_for_cpu *dma_sync_single_for_cpu;
-       ia64_mv_dma_sync_sg_for_cpu *dma_sync_sg_for_cpu;
-       ia64_mv_dma_sync_single_for_device *dma_sync_single_for_device;
-       ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
-       ia64_mv_dma_mapping_error *dma_mapping_error;
-       ia64_mv_dma_supported *dma_supported;
-       ia64_mv_irq_to_vector *irq_to_vector;
-       ia64_mv_local_vector_to_irq *local_vector_to_irq;
-       ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
-       ia64_mv_pci_legacy_read_t *pci_legacy_read;
-       ia64_mv_pci_legacy_write_t *pci_legacy_write;
-       ia64_mv_inb_t *inb;
-       ia64_mv_inw_t *inw;
-       ia64_mv_inl_t *inl;
-       ia64_mv_outb_t *outb;
-       ia64_mv_outw_t *outw;
-       ia64_mv_outl_t *outl;
-       ia64_mv_mmiowb_t *mmiowb;
-       ia64_mv_readb_t *readb;
-       ia64_mv_readw_t *readw;
-       ia64_mv_readl_t *readl;
-       ia64_mv_readq_t *readq;
-       ia64_mv_readb_relaxed_t *readb_relaxed;
-       ia64_mv_readw_relaxed_t *readw_relaxed;
-       ia64_mv_readl_relaxed_t *readl_relaxed;
-       ia64_mv_readq_relaxed_t *readq_relaxed;
-       ia64_mv_migrate_t *migrate;
-       ia64_mv_setup_msi_irq_t *setup_msi_irq;
-       ia64_mv_teardown_msi_irq_t *teardown_msi_irq;
-       ia64_mv_pci_fixup_bus_t *pci_fixup_bus;
-       ia64_mv_kernel_launch_event_t *kernel_launch_event;
-} __attribute__((__aligned__(16))); /* align attrib? see above comment */
-
-#define MACHVEC_INIT(name)                     \
-{                                              \
-       #name,                                  \
-       platform_setup,                         \
-       platform_cpu_init,                      \
-       platform_irq_init,                      \
-       platform_send_ipi,                      \
-       platform_timer_interrupt,               \
-       platform_global_tlb_purge,              \
-       platform_tlb_migrate_finish,            \
-       platform_dma_init,                      \
-       platform_dma_alloc_coherent,            \
-       platform_dma_free_coherent,             \
-       platform_dma_map_single_attrs,          \
-       platform_dma_unmap_single_attrs,        \
-       platform_dma_map_sg_attrs,              \
-       platform_dma_unmap_sg_attrs,            \
-       platform_dma_sync_single_for_cpu,       \
-       platform_dma_sync_sg_for_cpu,           \
-       platform_dma_sync_single_for_device,    \
-       platform_dma_sync_sg_for_device,        \
-       platform_dma_mapping_error,                     \
-       platform_dma_supported,                 \
-       platform_irq_to_vector,                 \
-       platform_local_vector_to_irq,           \
-       platform_pci_get_legacy_mem,            \
-       platform_pci_legacy_read,               \
-       platform_pci_legacy_write,              \
-       platform_inb,                           \
-       platform_inw,                           \
-       platform_inl,                           \
-       platform_outb,                          \
-       platform_outw,                          \
-       platform_outl,                          \
-       platform_mmiowb,                        \
-       platform_readb,                         \
-       platform_readw,                         \
-       platform_readl,                         \
-       platform_readq,                         \
-       platform_readb_relaxed,                 \
-       platform_readw_relaxed,                 \
-       platform_readl_relaxed,                 \
-       platform_readq_relaxed,                 \
-       platform_migrate,                       \
-       platform_setup_msi_irq,                 \
-       platform_teardown_msi_irq,              \
-       platform_pci_fixup_bus,                 \
-       platform_kernel_launch_event            \
-}
-
-extern struct ia64_machine_vector ia64_mv;
-extern void machvec_init (const char *name);
-extern void machvec_init_from_cmdline(const char *cmdline);
-
-# else
-#  error Unknown configuration.  Update asm-ia64/machvec.h.
-# endif /* CONFIG_IA64_GENERIC */
-
-/*
- * Declare default routines which aren't declared anywhere else:
- */
-extern ia64_mv_dma_init                        swiotlb_init;
-extern ia64_mv_dma_alloc_coherent      swiotlb_alloc_coherent;
-extern ia64_mv_dma_free_coherent       swiotlb_free_coherent;
-extern ia64_mv_dma_map_single          swiotlb_map_single;
-extern ia64_mv_dma_map_single_attrs    swiotlb_map_single_attrs;
-extern ia64_mv_dma_unmap_single                swiotlb_unmap_single;
-extern ia64_mv_dma_unmap_single_attrs  swiotlb_unmap_single_attrs;
-extern ia64_mv_dma_map_sg              swiotlb_map_sg;
-extern ia64_mv_dma_map_sg_attrs                swiotlb_map_sg_attrs;
-extern ia64_mv_dma_unmap_sg            swiotlb_unmap_sg;
-extern ia64_mv_dma_unmap_sg_attrs      swiotlb_unmap_sg_attrs;
-extern ia64_mv_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu;
-extern ia64_mv_dma_sync_sg_for_cpu     swiotlb_sync_sg_for_cpu;
-extern ia64_mv_dma_sync_single_for_device swiotlb_sync_single_for_device;
-extern ia64_mv_dma_sync_sg_for_device  swiotlb_sync_sg_for_device;
-extern ia64_mv_dma_mapping_error       swiotlb_dma_mapping_error;
-extern ia64_mv_dma_supported           swiotlb_dma_supported;
-
-/*
- * Define default versions so we can extend machvec for new platforms without having
- * to update the machvec files for all existing platforms.
- */
-#ifndef platform_setup
-# define platform_setup                        machvec_setup
-#endif
-#ifndef platform_cpu_init
-# define platform_cpu_init             machvec_noop
-#endif
-#ifndef platform_irq_init
-# define platform_irq_init             machvec_noop
-#endif
-
-#ifndef platform_send_ipi
-# define platform_send_ipi             ia64_send_ipi   /* default to architected version */
-#endif
-#ifndef platform_timer_interrupt
-# define platform_timer_interrupt      machvec_timer_interrupt
-#endif
-#ifndef platform_global_tlb_purge
-# define platform_global_tlb_purge     ia64_global_tlb_purge /* default to architected version */
-#endif
-#ifndef platform_tlb_migrate_finish
-# define platform_tlb_migrate_finish   machvec_noop_mm
-#endif
-#ifndef platform_kernel_launch_event
-# define platform_kernel_launch_event  machvec_noop
-#endif
-#ifndef platform_dma_init
-# define platform_dma_init             swiotlb_init
-#endif
-#ifndef platform_dma_alloc_coherent
-# define platform_dma_alloc_coherent   swiotlb_alloc_coherent
-#endif
-#ifndef platform_dma_free_coherent
-# define platform_dma_free_coherent    swiotlb_free_coherent
-#endif
-#ifndef platform_dma_map_single_attrs
-# define platform_dma_map_single_attrs swiotlb_map_single_attrs
-#endif
-#ifndef platform_dma_unmap_single_attrs
-# define platform_dma_unmap_single_attrs       swiotlb_unmap_single_attrs
-#endif
-#ifndef platform_dma_map_sg_attrs
-# define platform_dma_map_sg_attrs     swiotlb_map_sg_attrs
-#endif
-#ifndef platform_dma_unmap_sg_attrs
-# define platform_dma_unmap_sg_attrs   swiotlb_unmap_sg_attrs
-#endif
-#ifndef platform_dma_sync_single_for_cpu
-# define platform_dma_sync_single_for_cpu      swiotlb_sync_single_for_cpu
-#endif
-#ifndef platform_dma_sync_sg_for_cpu
-# define platform_dma_sync_sg_for_cpu          swiotlb_sync_sg_for_cpu
-#endif
-#ifndef platform_dma_sync_single_for_device
-# define platform_dma_sync_single_for_device   swiotlb_sync_single_for_device
-#endif
-#ifndef platform_dma_sync_sg_for_device
-# define platform_dma_sync_sg_for_device       swiotlb_sync_sg_for_device
-#endif
-#ifndef platform_dma_mapping_error
-# define platform_dma_mapping_error            swiotlb_dma_mapping_error
-#endif
-#ifndef platform_dma_supported
-# define  platform_dma_supported       swiotlb_dma_supported
-#endif
-#ifndef platform_irq_to_vector
-# define platform_irq_to_vector                __ia64_irq_to_vector
-#endif
-#ifndef platform_local_vector_to_irq
-# define platform_local_vector_to_irq  __ia64_local_vector_to_irq
-#endif
-#ifndef platform_pci_get_legacy_mem
-# define platform_pci_get_legacy_mem   ia64_pci_get_legacy_mem
-#endif
-#ifndef platform_pci_legacy_read
-# define platform_pci_legacy_read      ia64_pci_legacy_read
-extern int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size);
-#endif
-#ifndef platform_pci_legacy_write
-# define platform_pci_legacy_write     ia64_pci_legacy_write
-extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size);
-#endif
-#ifndef platform_inb
-# define platform_inb          __ia64_inb
-#endif
-#ifndef platform_inw
-# define platform_inw          __ia64_inw
-#endif
-#ifndef platform_inl
-# define platform_inl          __ia64_inl
-#endif
-#ifndef platform_outb
-# define platform_outb         __ia64_outb
-#endif
-#ifndef platform_outw
-# define platform_outw         __ia64_outw
-#endif
-#ifndef platform_outl
-# define platform_outl         __ia64_outl
-#endif
-#ifndef platform_mmiowb
-# define platform_mmiowb       __ia64_mmiowb
-#endif
-#ifndef platform_readb
-# define platform_readb                __ia64_readb
-#endif
-#ifndef platform_readw
-# define platform_readw                __ia64_readw
-#endif
-#ifndef platform_readl
-# define platform_readl                __ia64_readl
-#endif
-#ifndef platform_readq
-# define platform_readq                __ia64_readq
-#endif
-#ifndef platform_readb_relaxed
-# define platform_readb_relaxed        __ia64_readb_relaxed
-#endif
-#ifndef platform_readw_relaxed
-# define platform_readw_relaxed        __ia64_readw_relaxed
-#endif
-#ifndef platform_readl_relaxed
-# define platform_readl_relaxed        __ia64_readl_relaxed
-#endif
-#ifndef platform_readq_relaxed
-# define platform_readq_relaxed        __ia64_readq_relaxed
-#endif
-#ifndef platform_migrate
-# define platform_migrate machvec_noop_task
-#endif
-#ifndef platform_setup_msi_irq
-# define platform_setup_msi_irq                ((ia64_mv_setup_msi_irq_t*)NULL)
-#endif
-#ifndef platform_teardown_msi_irq
-# define platform_teardown_msi_irq     ((ia64_mv_teardown_msi_irq_t*)NULL)
-#endif
-#ifndef platform_pci_fixup_bus
-# define platform_pci_fixup_bus        machvec_noop_bus
-#endif
-
-#endif /* _ASM_IA64_MACHVEC_H */
diff --git a/include/asm-ia64/machvec_dig.h b/include/asm-ia64/machvec_dig.h
deleted file mode 100644 (file)
index 8a0752f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_IA64_MACHVEC_DIG_h
-#define _ASM_IA64_MACHVEC_DIG_h
-
-extern ia64_mv_setup_t dig_setup;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name          "dig"
-#define platform_setup         dig_setup
-
-#endif /* _ASM_IA64_MACHVEC_DIG_h */
diff --git a/include/asm-ia64/machvec_hpsim.h b/include/asm-ia64/machvec_hpsim.h
deleted file mode 100644 (file)
index cf72fc8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _ASM_IA64_MACHVEC_HPSIM_h
-#define _ASM_IA64_MACHVEC_HPSIM_h
-
-extern ia64_mv_setup_t hpsim_setup;
-extern ia64_mv_irq_init_t hpsim_irq_init;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name          "hpsim"
-#define platform_setup         hpsim_setup
-#define platform_irq_init      hpsim_irq_init
-
-#endif /* _ASM_IA64_MACHVEC_HPSIM_h */
diff --git a/include/asm-ia64/machvec_hpzx1.h b/include/asm-ia64/machvec_hpzx1.h
deleted file mode 100644 (file)
index 2f57f51..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _ASM_IA64_MACHVEC_HPZX1_h
-#define _ASM_IA64_MACHVEC_HPZX1_h
-
-extern ia64_mv_setup_t                 dig_setup;
-extern ia64_mv_dma_alloc_coherent      sba_alloc_coherent;
-extern ia64_mv_dma_free_coherent       sba_free_coherent;
-extern ia64_mv_dma_map_single_attrs    sba_map_single_attrs;
-extern ia64_mv_dma_unmap_single_attrs  sba_unmap_single_attrs;
-extern ia64_mv_dma_map_sg_attrs                sba_map_sg_attrs;
-extern ia64_mv_dma_unmap_sg_attrs      sba_unmap_sg_attrs;
-extern ia64_mv_dma_supported           sba_dma_supported;
-extern ia64_mv_dma_mapping_error       sba_dma_mapping_error;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name                          "hpzx1"
-#define platform_setup                         dig_setup
-#define platform_dma_init                      machvec_noop
-#define platform_dma_alloc_coherent            sba_alloc_coherent
-#define platform_dma_free_coherent             sba_free_coherent
-#define platform_dma_map_single_attrs          sba_map_single_attrs
-#define platform_dma_unmap_single_attrs                sba_unmap_single_attrs
-#define platform_dma_map_sg_attrs              sba_map_sg_attrs
-#define platform_dma_unmap_sg_attrs            sba_unmap_sg_attrs
-#define platform_dma_sync_single_for_cpu       machvec_dma_sync_single
-#define platform_dma_sync_sg_for_cpu           machvec_dma_sync_sg
-#define platform_dma_sync_single_for_device    machvec_dma_sync_single
-#define platform_dma_sync_sg_for_device                machvec_dma_sync_sg
-#define platform_dma_supported                 sba_dma_supported
-#define platform_dma_mapping_error             sba_dma_mapping_error
-
-#endif /* _ASM_IA64_MACHVEC_HPZX1_h */
diff --git a/include/asm-ia64/machvec_hpzx1_swiotlb.h b/include/asm-ia64/machvec_hpzx1_swiotlb.h
deleted file mode 100644 (file)
index a842cdd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
-#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
-
-extern ia64_mv_setup_t                         dig_setup;
-extern ia64_mv_dma_alloc_coherent              hwsw_alloc_coherent;
-extern ia64_mv_dma_free_coherent               hwsw_free_coherent;
-extern ia64_mv_dma_map_single_attrs            hwsw_map_single_attrs;
-extern ia64_mv_dma_unmap_single_attrs          hwsw_unmap_single_attrs;
-extern ia64_mv_dma_map_sg_attrs                        hwsw_map_sg_attrs;
-extern ia64_mv_dma_unmap_sg_attrs              hwsw_unmap_sg_attrs;
-extern ia64_mv_dma_supported                   hwsw_dma_supported;
-extern ia64_mv_dma_mapping_error               hwsw_dma_mapping_error;
-extern ia64_mv_dma_sync_single_for_cpu         hwsw_sync_single_for_cpu;
-extern ia64_mv_dma_sync_sg_for_cpu             hwsw_sync_sg_for_cpu;
-extern ia64_mv_dma_sync_single_for_device      hwsw_sync_single_for_device;
-extern ia64_mv_dma_sync_sg_for_device          hwsw_sync_sg_for_device;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name                          "hpzx1_swiotlb"
-
-#define platform_setup                         dig_setup
-#define platform_dma_init                      machvec_noop
-#define platform_dma_alloc_coherent            hwsw_alloc_coherent
-#define platform_dma_free_coherent             hwsw_free_coherent
-#define platform_dma_map_single_attrs          hwsw_map_single_attrs
-#define platform_dma_unmap_single_attrs                hwsw_unmap_single_attrs
-#define platform_dma_map_sg_attrs              hwsw_map_sg_attrs
-#define platform_dma_unmap_sg_attrs            hwsw_unmap_sg_attrs
-#define platform_dma_supported                 hwsw_dma_supported
-#define platform_dma_mapping_error             hwsw_dma_mapping_error
-#define platform_dma_sync_single_for_cpu       hwsw_sync_single_for_cpu
-#define platform_dma_sync_sg_for_cpu           hwsw_sync_sg_for_cpu
-#define platform_dma_sync_single_for_device    hwsw_sync_single_for_device
-#define platform_dma_sync_sg_for_device                hwsw_sync_sg_for_device
-
-#endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */
diff --git a/include/asm-ia64/machvec_init.h b/include/asm-ia64/machvec_init.h
deleted file mode 100644 (file)
index 7f21249..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <asm/machvec.h>
-
-extern ia64_mv_send_ipi_t ia64_send_ipi;
-extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
-extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
-extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
-extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
-extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read;
-extern ia64_mv_pci_legacy_write_t ia64_pci_legacy_write;
-
-extern ia64_mv_inb_t __ia64_inb;
-extern ia64_mv_inw_t __ia64_inw;
-extern ia64_mv_inl_t __ia64_inl;
-extern ia64_mv_outb_t __ia64_outb;
-extern ia64_mv_outw_t __ia64_outw;
-extern ia64_mv_outl_t __ia64_outl;
-extern ia64_mv_mmiowb_t __ia64_mmiowb;
-extern ia64_mv_readb_t __ia64_readb;
-extern ia64_mv_readw_t __ia64_readw;
-extern ia64_mv_readl_t __ia64_readl;
-extern ia64_mv_readq_t __ia64_readq;
-extern ia64_mv_readb_t __ia64_readb_relaxed;
-extern ia64_mv_readw_t __ia64_readw_relaxed;
-extern ia64_mv_readl_t __ia64_readl_relaxed;
-extern ia64_mv_readq_t __ia64_readq_relaxed;
-
-#define MACHVEC_HELPER(name)                                                                   \
- struct ia64_machine_vector machvec_##name __attribute__ ((unused, __section__ (".machvec")))  \
-       = MACHVEC_INIT(name);
-
-#define MACHVEC_DEFINE(name)   MACHVEC_HELPER(name)
-
-MACHVEC_DEFINE(MACHVEC_PLATFORM_NAME)
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
deleted file mode 100644 (file)
index 781308e..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2002-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of version 2 of the GNU General Public License 
- * as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it would be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
- * 
- * Further, this software is distributed without any warranty that it is 
- * free of the rightful claim of any third person regarding infringement 
- * or the like.  Any license provided herein, whether implied or 
- * otherwise, applies only to this software file.  Patent licenses, if 
- * any, provided herein do not apply to combinations of this program with 
- * other software, or any other product whatsoever.
- * 
- * You should have received a copy of the GNU General Public 
- * License along with this program; if not, write the Free Software 
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
- * For further information regarding this notice, see: 
- * 
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan
- */
-
-#ifndef _ASM_IA64_MACHVEC_SN2_H
-#define _ASM_IA64_MACHVEC_SN2_H
-
-extern ia64_mv_setup_t sn_setup;
-extern ia64_mv_cpu_init_t sn_cpu_init;
-extern ia64_mv_irq_init_t sn_irq_init;
-extern ia64_mv_send_ipi_t sn2_send_IPI;
-extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
-extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
-extern ia64_mv_tlb_migrate_finish_t    sn_tlb_migrate_finish;
-extern ia64_mv_irq_to_vector sn_irq_to_vector;
-extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq;
-extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem;
-extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read;
-extern ia64_mv_pci_legacy_write_t sn_pci_legacy_write;
-extern ia64_mv_inb_t __sn_inb;
-extern ia64_mv_inw_t __sn_inw;
-extern ia64_mv_inl_t __sn_inl;
-extern ia64_mv_outb_t __sn_outb;
-extern ia64_mv_outw_t __sn_outw;
-extern ia64_mv_outl_t __sn_outl;
-extern ia64_mv_mmiowb_t __sn_mmiowb;
-extern ia64_mv_readb_t __sn_readb;
-extern ia64_mv_readw_t __sn_readw;
-extern ia64_mv_readl_t __sn_readl;
-extern ia64_mv_readq_t __sn_readq;
-extern ia64_mv_readb_t __sn_readb_relaxed;
-extern ia64_mv_readw_t __sn_readw_relaxed;
-extern ia64_mv_readl_t __sn_readl_relaxed;
-extern ia64_mv_readq_t __sn_readq_relaxed;
-extern ia64_mv_dma_alloc_coherent      sn_dma_alloc_coherent;
-extern ia64_mv_dma_free_coherent       sn_dma_free_coherent;
-extern ia64_mv_dma_map_single_attrs    sn_dma_map_single_attrs;
-extern ia64_mv_dma_unmap_single_attrs  sn_dma_unmap_single_attrs;
-extern ia64_mv_dma_map_sg_attrs                sn_dma_map_sg_attrs;
-extern ia64_mv_dma_unmap_sg_attrs      sn_dma_unmap_sg_attrs;
-extern ia64_mv_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu;
-extern ia64_mv_dma_sync_sg_for_cpu     sn_dma_sync_sg_for_cpu;
-extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device;
-extern ia64_mv_dma_sync_sg_for_device  sn_dma_sync_sg_for_device;
-extern ia64_mv_dma_mapping_error       sn_dma_mapping_error;
-extern ia64_mv_dma_supported           sn_dma_supported;
-extern ia64_mv_migrate_t               sn_migrate;
-extern ia64_mv_kernel_launch_event_t   sn_kernel_launch_event;
-extern ia64_mv_setup_msi_irq_t         sn_setup_msi_irq;
-extern ia64_mv_teardown_msi_irq_t      sn_teardown_msi_irq;
-extern ia64_mv_pci_fixup_bus_t         sn_pci_fixup_bus;
-
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name                  "sn2"
-#define platform_setup                 sn_setup
-#define platform_cpu_init              sn_cpu_init
-#define platform_irq_init              sn_irq_init
-#define platform_send_ipi              sn2_send_IPI
-#define platform_timer_interrupt       sn_timer_interrupt
-#define platform_global_tlb_purge       sn2_global_tlb_purge
-#define platform_tlb_migrate_finish    sn_tlb_migrate_finish
-#define platform_pci_fixup             sn_pci_fixup
-#define platform_inb                   __sn_inb
-#define platform_inw                   __sn_inw
-#define platform_inl                   __sn_inl
-#define platform_outb                  __sn_outb
-#define platform_outw                  __sn_outw
-#define platform_outl                  __sn_outl
-#define platform_mmiowb                        __sn_mmiowb
-#define platform_readb                 __sn_readb
-#define platform_readw                 __sn_readw
-#define platform_readl                 __sn_readl
-#define platform_readq                 __sn_readq
-#define platform_readb_relaxed         __sn_readb_relaxed
-#define platform_readw_relaxed         __sn_readw_relaxed
-#define platform_readl_relaxed         __sn_readl_relaxed
-#define platform_readq_relaxed         __sn_readq_relaxed
-#define platform_irq_to_vector         sn_irq_to_vector
-#define platform_local_vector_to_irq   sn_local_vector_to_irq
-#define platform_pci_get_legacy_mem    sn_pci_get_legacy_mem
-#define platform_pci_legacy_read       sn_pci_legacy_read
-#define platform_pci_legacy_write      sn_pci_legacy_write
-#define platform_dma_init              machvec_noop
-#define platform_dma_alloc_coherent    sn_dma_alloc_coherent
-#define platform_dma_free_coherent     sn_dma_free_coherent
-#define platform_dma_map_single_attrs  sn_dma_map_single_attrs
-#define platform_dma_unmap_single_attrs        sn_dma_unmap_single_attrs
-#define platform_dma_map_sg_attrs      sn_dma_map_sg_attrs
-#define platform_dma_unmap_sg_attrs    sn_dma_unmap_sg_attrs
-#define platform_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu
-#define platform_dma_sync_sg_for_cpu   sn_dma_sync_sg_for_cpu
-#define platform_dma_sync_single_for_device sn_dma_sync_single_for_device
-#define platform_dma_sync_sg_for_device        sn_dma_sync_sg_for_device
-#define platform_dma_mapping_error             sn_dma_mapping_error
-#define platform_dma_supported         sn_dma_supported
-#define platform_migrate               sn_migrate
-#define platform_kernel_launch_event    sn_kernel_launch_event
-#ifdef CONFIG_PCI_MSI
-#define platform_setup_msi_irq         sn_setup_msi_irq
-#define platform_teardown_msi_irq      sn_teardown_msi_irq
-#else
-#define platform_setup_msi_irq         ((ia64_mv_setup_msi_irq_t*)NULL)
-#define platform_teardown_msi_irq      ((ia64_mv_teardown_msi_irq_t*)NULL)
-#endif
-#define platform_pci_fixup_bus         sn_pci_fixup_bus
-
-#include <asm/sn/io.h>
-
-#endif /* _ASM_IA64_MACHVEC_SN2_H */
diff --git a/include/asm-ia64/machvec_uv.h b/include/asm-ia64/machvec_uv.h
deleted file mode 100644 (file)
index 2931447..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- *
- * SGI UV Core Functions
- *
- * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_MACHVEC_UV_H
-#define _ASM_IA64_MACHVEC_UV_H
-
-extern ia64_mv_setup_t uv_setup;
-
-/*
- * This stuff has dual use!
- *
- * For a generic kernel, the macros are used to initialize the
- * platform's machvec structure.  When compiling a non-generic kernel,
- * the macros are used directly.
- */
-#define platform_name                  "uv"
-#define platform_setup                 uv_setup
-
-#endif /* _ASM_IA64_MACHVEC_UV_H */
diff --git a/include/asm-ia64/mc146818rtc.h b/include/asm-ia64/mc146818rtc.h
deleted file mode 100644 (file)
index 407787a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _ASM_IA64_MC146818RTC_H
-#define _ASM_IA64_MC146818RTC_H
-
-/*
- * Machine dependent access functions for RTC registers.
- */
-
-/* empty include file to satisfy the include in genrtc.c */
-
-#endif /* _ASM_IA64_MC146818RTC_H */
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
deleted file mode 100644 (file)
index 18a4321..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * File:       mca.h
- * Purpose:    Machine check handling specific defines
- *
- * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
- * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
- * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
- * Copyright (C) Russ Anderson <rja@sgi.com>
- */
-
-#ifndef _ASM_IA64_MCA_H
-#define _ASM_IA64_MCA_H
-
-#if !defined(__ASSEMBLY__)
-
-#include <linux/interrupt.h>
-#include <linux/types.h>
-
-#include <asm/param.h>
-#include <asm/sal.h>
-#include <asm/processor.h>
-#include <asm/mca_asm.h>
-
-#define IA64_MCA_RENDEZ_TIMEOUT                (20 * 1000)     /* value in milliseconds - 20 seconds */
-
-typedef struct ia64_fptr {
-       unsigned long fp;
-       unsigned long gp;
-} ia64_fptr_t;
-
-typedef union cmcv_reg_u {
-       u64     cmcv_regval;
-       struct  {
-               u64     cmcr_vector             : 8;
-               u64     cmcr_reserved1          : 4;
-               u64     cmcr_ignored1           : 1;
-               u64     cmcr_reserved2          : 3;
-               u64     cmcr_mask               : 1;
-               u64     cmcr_ignored2           : 47;
-       } cmcv_reg_s;
-
-} cmcv_reg_t;
-
-#define cmcv_mask              cmcv_reg_s.cmcr_mask
-#define cmcv_vector            cmcv_reg_s.cmcr_vector
-
-enum {
-       IA64_MCA_RENDEZ_CHECKIN_NOTDONE =       0x0,
-       IA64_MCA_RENDEZ_CHECKIN_DONE    =       0x1,
-       IA64_MCA_RENDEZ_CHECKIN_INIT    =       0x2,
-       IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA  =       0x3,
-};
-
-/* Information maintained by the MC infrastructure */
-typedef struct ia64_mc_info_s {
-       u64             imi_mca_handler;
-       size_t          imi_mca_handler_size;
-       u64             imi_monarch_init_handler;
-       size_t          imi_monarch_init_handler_size;
-       u64             imi_slave_init_handler;
-       size_t          imi_slave_init_handler_size;
-       u8              imi_rendez_checkin[NR_CPUS];
-
-} ia64_mc_info_t;
-
-/* Handover state from SAL to OS and vice versa, for both MCA and INIT events.
- * Besides the handover state, it also contains some saved registers from the
- * time of the event.
- * Note: mca_asm.S depends on the precise layout of this structure.
- */
-
-struct ia64_sal_os_state {
-
-       /* SAL to OS */
-       u64                     os_gp;                  /* GP of the os registered with the SAL, physical */
-       u64                     pal_proc;               /* PAL_PROC entry point, physical */
-       u64                     sal_proc;               /* SAL_PROC entry point, physical */
-       u64                     rv_rc;                  /* MCA - Rendezvous state, INIT - reason code */
-       u64                     proc_state_param;       /* from R18 */
-       u64                     monarch;                /* 1 for a monarch event, 0 for a slave */
-
-       /* common */
-       u64                     sal_ra;                 /* Return address in SAL, physical */
-       u64                     sal_gp;                 /* GP of the SAL - physical */
-       pal_min_state_area_t    *pal_min_state;         /* from R17.  physical in asm, virtual in C */
-       /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK).
-        * Note: if the MCA/INIT recovery code wants to resume to a new context
-        * then it must change these values to reflect the new kernel stack.
-        */
-       u64                     prev_IA64_KR_CURRENT;   /* previous value of IA64_KR(CURRENT) */
-       u64                     prev_IA64_KR_CURRENT_STACK;
-       struct task_struct      *prev_task;             /* previous task, NULL if it is not useful */
-       /* Some interrupt registers are not saved in minstate, pt_regs or
-        * switch_stack.  Because MCA/INIT can occur when interrupts are
-        * disabled, we need to save the additional interrupt registers over
-        * MCA/INIT and resume.
-        */
-       u64                     isr;
-       u64                     ifa;
-       u64                     itir;
-       u64                     iipa;
-       u64                     iim;
-       u64                     iha;
-
-       /* OS to SAL */
-       u64                     os_status;              /* OS status to SAL, enum below */
-       u64                     context;                /* 0 if return to same context
-                                                          1 if return to new context */
-};
-
-enum {
-       IA64_MCA_CORRECTED      =       0x0,    /* Error has been corrected by OS_MCA */
-       IA64_MCA_WARM_BOOT      =       -1,     /* Warm boot of the system need from SAL */
-       IA64_MCA_COLD_BOOT      =       -2,     /* Cold boot of the system need from SAL */
-       IA64_MCA_HALT           =       -3      /* System to be halted by SAL */
-};
-
-enum {
-       IA64_INIT_RESUME        =       0x0,    /* Resume after return from INIT */
-       IA64_INIT_WARM_BOOT     =       -1,     /* Warm boot of the system need from SAL */
-};
-
-enum {
-       IA64_MCA_SAME_CONTEXT   =       0x0,    /* SAL to return to same context */
-       IA64_MCA_NEW_CONTEXT    =       -1      /* SAL to return to new context */
-};
-
-/* Per-CPU MCA state that is too big for normal per-CPU variables.  */
-
-struct ia64_mca_cpu {
-       u64 mca_stack[KERNEL_STACK_SIZE/8];
-       u64 init_stack[KERNEL_STACK_SIZE/8];
-};
-
-/* Array of physical addresses of each CPU's MCA area.  */
-extern unsigned long __per_cpu_mca[NR_CPUS];
-
-extern int cpe_vector;
-extern int ia64_cpe_irq;
-extern void ia64_mca_init(void);
-extern void ia64_mca_cpu_init(void *);
-extern void ia64_os_mca_dispatch(void);
-extern void ia64_os_mca_dispatch_end(void);
-extern void ia64_mca_ucmc_handler(struct pt_regs *, struct ia64_sal_os_state *);
-extern void ia64_init_handler(struct pt_regs *,
-                             struct switch_stack *,
-                             struct ia64_sal_os_state *);
-extern void ia64_monarch_init_handler(void);
-extern void ia64_slave_init_handler(void);
-extern void ia64_mca_cmc_vector_setup(void);
-extern int  ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *));
-extern void ia64_unreg_MCA_extension(void);
-extern u64 ia64_get_rnat(u64 *);
-extern void ia64_mca_printk(const char * fmt, ...)
-        __attribute__ ((format (printf, 1, 2)));
-
-struct ia64_mca_notify_die {
-       struct ia64_sal_os_state *sos;
-       int *monarch_cpu;
-       int *data;
-};
-
-DECLARE_PER_CPU(u64, ia64_mca_pal_base);
-
-#else  /* __ASSEMBLY__ */
-
-#define IA64_MCA_CORRECTED     0x0     /* Error has been corrected by OS_MCA */
-#define IA64_MCA_WARM_BOOT     -1      /* Warm boot of the system need from SAL */
-#define IA64_MCA_COLD_BOOT     -2      /* Cold boot of the system need from SAL */
-#define IA64_MCA_HALT          -3      /* System to be halted by SAL */
-
-#define IA64_INIT_RESUME       0x0     /* Resume after return from INIT */
-#define IA64_INIT_WARM_BOOT    -1      /* Warm boot of the system need from SAL */
-
-#define IA64_MCA_SAME_CONTEXT  0x0     /* SAL to return to same context */
-#define IA64_MCA_NEW_CONTEXT   -1      /* SAL to return to new context */
-
-#endif /* !__ASSEMBLY__ */
-#endif /* _ASM_IA64_MCA_H */
diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h
deleted file mode 100644 (file)
index dd2a5b1..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * File:       mca_asm.h
- * Purpose:    Machine check handling specific defines
- *
- * Copyright (C) 1999 Silicon Graphics, Inc.
- * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
- * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
- * Copyright (C) 2000 Hewlett-Packard Co.
- * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 2002 Intel Corp.
- * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
- * Copyright (C) 2005 Silicon Graphics, Inc
- * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
- */
-#ifndef _ASM_IA64_MCA_ASM_H
-#define _ASM_IA64_MCA_ASM_H
-
-#define PSR_IC         13
-#define PSR_I          14
-#define        PSR_DT          17
-#define PSR_RT         27
-#define PSR_MC         35
-#define PSR_IT         36
-#define PSR_BN         44
-
-/*
- * This macro converts a instruction virtual address to a physical address
- * Right now for simulation purposes the virtual addresses are
- * direct mapped to physical addresses.
- *     1. Lop off bits 61 thru 63 in the virtual address
- */
-#define INST_VA_TO_PA(addr)                                                    \
-       dep     addr    = 0, addr, 61, 3
-/*
- * This macro converts a data virtual address to a physical address
- * Right now for simulation purposes the virtual addresses are
- * direct mapped to physical addresses.
- *     1. Lop off bits 61 thru 63 in the virtual address
- */
-#define DATA_VA_TO_PA(addr)                                                    \
-       tpa     addr    = addr
-/*
- * This macro converts a data physical address to a virtual address
- * Right now for simulation purposes the virtual addresses are
- * direct mapped to physical addresses.
- *     1. Put 0x7 in bits 61 thru 63.
- */
-#define DATA_PA_TO_VA(addr,temp)                                                       \
-       mov     temp    = 0x7   ;;                                                      \
-       dep     addr    = temp, addr, 61, 3
-
-#define GET_THIS_PADDR(reg, var)               \
-       mov     reg = IA64_KR(PER_CPU_DATA);;   \
-        addl   reg = THIS_CPU(var), reg
-
-/*
- * This macro jumps to the instruction at the given virtual address
- * and starts execution in physical mode with all the address
- * translations turned off.
- *     1.      Save the current psr
- *     2.      Make sure that all the upper 32 bits are off
- *
- *     3.      Clear the interrupt enable and interrupt state collection bits
- *             in the psr before updating the ipsr and iip.
- *
- *     4.      Turn off the instruction, data and rse translation bits of the psr
- *             and store the new value into ipsr
- *             Also make sure that the interrupts are disabled.
- *             Ensure that we are in little endian mode.
- *             [psr.{rt, it, dt, i, be} = 0]
- *
- *     5.      Get the physical address corresponding to the virtual address
- *             of the next instruction bundle and put it in iip.
- *             (Using magic numbers 24 and 40 in the deposint instruction since
- *              the IA64_SDK code directly maps to lower 24bits as physical address
- *              from a virtual address).
- *
- *     6.      Do an rfi to move the values from ipsr to psr and iip to ip.
- */
-#define  PHYSICAL_MODE_ENTER(temp1, temp2, start_addr, old_psr)                                \
-       mov     old_psr = psr;                                                          \
-       ;;                                                                              \
-       dep     old_psr = 0, old_psr, 32, 32;                                           \
-                                                                                       \
-       mov     ar.rsc = 0 ;                                                            \
-       ;;                                                                              \
-       srlz.d;                                                                         \
-       mov     temp2 = ar.bspstore;                                                    \
-       ;;                                                                              \
-       DATA_VA_TO_PA(temp2);                                                           \
-       ;;                                                                              \
-       mov     temp1 = ar.rnat;                                                        \
-       ;;                                                                              \
-       mov     ar.bspstore = temp2;                                                    \
-       ;;                                                                              \
-       mov     ar.rnat = temp1;                                                        \
-       mov     temp1 = psr;                                                            \
-       mov     temp2 = psr;                                                            \
-       ;;                                                                              \
-                                                                                       \
-       dep     temp2 = 0, temp2, PSR_IC, 2;                                            \
-       ;;                                                                              \
-       mov     psr.l = temp2;                                                          \
-       ;;                                                                              \
-       srlz.d;                                                                         \
-       dep     temp1 = 0, temp1, 32, 32;                                               \
-       ;;                                                                              \
-       dep     temp1 = 0, temp1, PSR_IT, 1;                                            \
-       ;;                                                                              \
-       dep     temp1 = 0, temp1, PSR_DT, 1;                                            \
-       ;;                                                                              \
-       dep     temp1 = 0, temp1, PSR_RT, 1;                                            \
-       ;;                                                                              \
-       dep     temp1 = 0, temp1, PSR_I, 1;                                             \
-       ;;                                                                              \
-       dep     temp1 = 0, temp1, PSR_IC, 1;                                            \
-       ;;                                                                              \
-       dep     temp1 = -1, temp1, PSR_MC, 1;                                           \
-       ;;                                                                              \
-       mov     cr.ipsr = temp1;                                                        \
-       ;;                                                                              \
-       LOAD_PHYSICAL(p0, temp2, start_addr);                                           \
-       ;;                                                                              \
-       mov     cr.iip = temp2;                                                         \
-       mov     cr.ifs = r0;                                                            \
-       DATA_VA_TO_PA(sp);                                                              \
-       DATA_VA_TO_PA(gp);                                                              \
-       ;;                                                                              \
-       srlz.i;                                                                         \
-       ;;                                                                              \
-       nop     1;                                                                      \
-       nop     2;                                                                      \
-       nop     1;                                                                      \
-       nop     2;                                                                      \
-       rfi;                                                                            \
-       ;;
-
-/*
- * This macro jumps to the instruction at the given virtual address
- * and starts execution in virtual mode with all the address
- * translations turned on.
- *     1.      Get the old saved psr
- *
- *     2.      Clear the interrupt state collection bit in the current psr.
- *
- *     3.      Set the instruction translation bit back in the old psr
- *             Note we have to do this since we are right now saving only the
- *             lower 32-bits of old psr.(Also the old psr has the data and
- *             rse translation bits on)
- *
- *     4.      Set ipsr to this old_psr with "it" bit set and "bn" = 1.
- *
- *     5.      Reset the current thread pointer (r13).
- *
- *     6.      Set iip to the virtual address of the next instruction bundle.
- *
- *     7.      Do an rfi to move ipsr to psr and iip to ip.
- */
-
-#define VIRTUAL_MODE_ENTER(temp1, temp2, start_addr, old_psr)  \
-       mov     temp2 = psr;                                    \
-       ;;                                                      \
-       mov     old_psr = temp2;                                \
-       ;;                                                      \
-       dep     temp2 = 0, temp2, PSR_IC, 2;                    \
-       ;;                                                      \
-       mov     psr.l = temp2;                                  \
-       mov     ar.rsc = 0;                                     \
-       ;;                                                      \
-       srlz.d;                                                 \
-       mov     r13 = ar.k6;                                    \
-       mov     temp2 = ar.bspstore;                            \
-       ;;                                                      \
-       DATA_PA_TO_VA(temp2,temp1);                             \
-       ;;                                                      \
-       mov     temp1 = ar.rnat;                                \
-       ;;                                                      \
-       mov     ar.bspstore = temp2;                            \
-       ;;                                                      \
-       mov     ar.rnat = temp1;                                \
-       ;;                                                      \
-       mov     temp1 = old_psr;                                \
-       ;;                                                      \
-       mov     temp2 = 1;                                      \
-       ;;                                                      \
-       dep     temp1 = temp2, temp1, PSR_IC, 1;                \
-       ;;                                                      \
-       dep     temp1 = temp2, temp1, PSR_IT, 1;                \
-       ;;                                                      \
-       dep     temp1 = temp2, temp1, PSR_DT, 1;                \
-       ;;                                                      \
-       dep     temp1 = temp2, temp1, PSR_RT, 1;                \
-       ;;                                                      \
-       dep     temp1 = temp2, temp1, PSR_BN, 1;                \
-       ;;                                                      \
-                                                               \
-       mov     cr.ipsr = temp1;                                \
-       movl    temp2 = start_addr;                             \
-       ;;                                                      \
-       mov     cr.iip = temp2;                                 \
-       movl    gp = __gp                                       \
-       ;;                                                      \
-       DATA_PA_TO_VA(sp, temp1);                               \
-       srlz.i;                                                 \
-       ;;                                                      \
-       nop     1;                                              \
-       nop     2;                                              \
-       nop     1;                                              \
-       rfi                                                     \
-       ;;
-
-/*
- * The MCA and INIT stacks in struct ia64_mca_cpu look like normal kernel
- * stacks, except that the SAL/OS state and a switch_stack are stored near the
- * top of the MCA/INIT stack.  To support concurrent entry to MCA or INIT, as
- * well as MCA over INIT, each event needs its own SAL/OS state.  All entries
- * are 16 byte aligned.
- *
- *      +---------------------------+
- *      |          pt_regs          |
- *      +---------------------------+
- *      |        switch_stack       |
- *      +---------------------------+
- *      |        SAL/OS state       |
- *      +---------------------------+
- *      |    16 byte scratch area   |
- *      +---------------------------+ <-------- SP at start of C MCA handler
- *      |           .....           |
- *      +---------------------------+
- *      | RBS for MCA/INIT handler  |
- *      +---------------------------+
- *      | struct task for MCA/INIT  |
- *      +---------------------------+ <-------- Bottom of MCA/INIT stack
- */
-
-#define ALIGN16(x)                     ((x)&~15)
-#define MCA_PT_REGS_OFFSET             ALIGN16(KERNEL_STACK_SIZE-IA64_PT_REGS_SIZE)
-#define MCA_SWITCH_STACK_OFFSET                ALIGN16(MCA_PT_REGS_OFFSET-IA64_SWITCH_STACK_SIZE)
-#define MCA_SOS_OFFSET                 ALIGN16(MCA_SWITCH_STACK_OFFSET-IA64_SAL_OS_STATE_SIZE)
-#define MCA_SP_OFFSET                  ALIGN16(MCA_SOS_OFFSET-16)
-
-#endif /* _ASM_IA64_MCA_ASM_H */
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
deleted file mode 100644 (file)
index 7245a57..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef meminit_h
-#define meminit_h
-
-/*
- * 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.
- */
-
-
-/*
- * Entries defined so far:
- *     - boot param structure itself
- *     - memory map
- *     - initrd (optional)
- *     - command line string
- *     - kernel code & data
- *     - crash dumping code reserved region
- *     - Kernel memory map built from EFI memory map
- *     - ELF core header
- *
- * More could be added if necessary
- */
-#define IA64_MAX_RSVD_REGIONS 8
-
-struct rsvd_region {
-       unsigned long start;    /* virtual address of beginning of element */
-       unsigned long end;      /* virtual address of end of element + 1 */
-};
-
-extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
-extern int num_rsvd_regions;
-
-extern void find_memory (void);
-extern void reserve_memory (void);
-extern void find_initrd (void);
-extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
-extern int filter_memory (unsigned long start, unsigned long end, void *arg);
-extern unsigned long efi_memmap_init(unsigned long *s, unsigned long *e);
-extern int find_max_min_low_pfn (unsigned long , unsigned long, void *);
-
-extern unsigned long vmcore_find_descriptor_size(unsigned long address);
-extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end);
-
-/*
- * For rounding an address to the next IA64_GRANULE_SIZE or order
- */
-#define GRANULEROUNDDOWN(n)    ((n) & ~(IA64_GRANULE_SIZE-1))
-#define GRANULEROUNDUP(n)      (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
-#define ORDERROUNDDOWN(n)      ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1))
-
-#ifdef CONFIG_NUMA
-  extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
-#else
-# define call_pernode_memory(start, len, func) (*func)(start, len, 0)
-#endif
-
-#define IGNORE_PFN0    1       /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
-
-extern int register_active_ranges(u64 start, u64 len, int nid);
-
-#ifdef CONFIG_VIRTUAL_MEM_MAP
-# define LARGE_GAP     0x40000000 /* Use virtual mem map if hole is > than this */
-  extern unsigned long vmalloc_end;
-  extern struct page *vmem_map;
-  extern int find_largest_hole (u64 start, u64 end, void *arg);
-  extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
-  extern int vmemmap_find_next_valid_pfn(int, int);
-#else
-static inline int vmemmap_find_next_valid_pfn(int node, int i)
-{
-       return i + 1;
-}
-#endif
-#endif /* meminit_h */
diff --git a/include/asm-ia64/mman.h b/include/asm-ia64/mman.h
deleted file mode 100644 (file)
index c73b878..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _ASM_IA64_MMAN_H
-#define _ASM_IA64_MMAN_H
-
-/*
- * Based on <asm-i386/mman.h>.
- *
- * Modified 1998-2000, 2002
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <asm-generic/mman.h>
-
-#define MAP_GROWSDOWN  0x00100         /* stack-like segment */
-#define MAP_GROWSUP    0x00200         /* register stack-like segment */
-#define MAP_DENYWRITE  0x00800         /* ETXTBSY */
-#define MAP_EXECUTABLE 0x01000         /* mark it as an executable */
-#define MAP_LOCKED     0x02000         /* pages are locked */
-#define MAP_NORESERVE  0x04000         /* don't check for reservations */
-#define MAP_POPULATE   0x08000         /* populate (prefault) pagetables */
-#define MAP_NONBLOCK   0x10000         /* do not block on IO */
-
-#define MCL_CURRENT    1               /* lock all current mappings */
-#define MCL_FUTURE     2               /* lock all future mappings */
-
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
-#define arch_mmap_check        ia64_mmap_check
-int ia64_mmap_check(unsigned long addr, unsigned long len,
-               unsigned long flags);
-#endif
-#endif
-
-#endif /* _ASM_IA64_MMAN_H */
diff --git a/include/asm-ia64/mmu.h b/include/asm-ia64/mmu.h
deleted file mode 100644 (file)
index 611432b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __MMU_H
-#define __MMU_H
-
-/*
- * Type for a context number.  We declare it volatile to ensure proper
- * ordering when it's accessed outside of spinlock'd critical sections
- * (e.g., as done in activate_mm() and init_new_context()).
- */
-typedef volatile unsigned long mm_context_t;
-
-typedef unsigned long nv_mm_context_t;
-
-#endif
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h
deleted file mode 100644 (file)
index 040bc87..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef _ASM_IA64_MMU_CONTEXT_H
-#define _ASM_IA64_MMU_CONTEXT_H
-
-/*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-/*
- * Routines to manage the allocation of task context numbers.  Task context
- * numbers are used to reduce or eliminate the need to perform TLB flushes
- * due to context switches.  Context numbers are implemented using ia-64
- * region ids.  Since the IA-64 TLB does not consider the region number when
- * performing a TLB lookup, we need to assign a unique region id to each
- * region in a process.  We use the least significant three bits in aregion
- * id for this purpose.
- */
-
-#define IA64_REGION_ID_KERNEL  0 /* the kernel's region id (tlb.c depends on this being 0) */
-
-#define ia64_rid(ctx,addr)     (((ctx) << 3) | (addr >> 61))
-
-# include <asm/page.h>
-# ifndef __ASSEMBLY__
-
-#include <linux/compiler.h>
-#include <linux/percpu.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-
-#include <asm/processor.h>
-#include <asm-generic/mm_hooks.h>
-
-struct ia64_ctx {
-       spinlock_t lock;
-       unsigned int next;      /* next context number to use */
-       unsigned int limit;     /* available free range */
-       unsigned int max_ctx;   /* max. context value supported by all CPUs */
-                               /* call wrap_mmu_context when next >= max */
-       unsigned long *bitmap;  /* bitmap size is max_ctx+1 */
-       unsigned long *flushmap;/* pending rid to be flushed */
-};
-
-extern struct ia64_ctx ia64_ctx;
-DECLARE_PER_CPU(u8, ia64_need_tlb_flush);
-
-extern void mmu_context_init (void);
-extern void wrap_mmu_context (struct mm_struct *mm);
-
-static inline void
-enter_lazy_tlb (struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
-/*
- * When the context counter wraps around all TLBs need to be flushed because
- * an old context number might have been reused. This is signalled by the
- * ia64_need_tlb_flush per-CPU variable, which is checked in the routine
- * below. Called by activate_mm(). <efocht@ess.nec.de>
- */
-static inline void
-delayed_tlb_flush (void)
-{
-       extern void local_flush_tlb_all (void);
-       unsigned long flags;
-
-       if (unlikely(__ia64_per_cpu_var(ia64_need_tlb_flush))) {
-               spin_lock_irqsave(&ia64_ctx.lock, flags);
-               if (__ia64_per_cpu_var(ia64_need_tlb_flush)) {
-                       local_flush_tlb_all();
-                       __ia64_per_cpu_var(ia64_need_tlb_flush) = 0;
-               }
-               spin_unlock_irqrestore(&ia64_ctx.lock, flags);
-       }
-}
-
-static inline nv_mm_context_t
-get_mmu_context (struct mm_struct *mm)
-{
-       unsigned long flags;
-       nv_mm_context_t context = mm->context;
-
-       if (likely(context))
-               goto out;
-
-       spin_lock_irqsave(&ia64_ctx.lock, flags);
-       /* re-check, now that we've got the lock: */
-       context = mm->context;
-       if (context == 0) {
-               cpus_clear(mm->cpu_vm_mask);
-               if (ia64_ctx.next >= ia64_ctx.limit) {
-                       ia64_ctx.next = find_next_zero_bit(ia64_ctx.bitmap,
-                                       ia64_ctx.max_ctx, ia64_ctx.next);
-                       ia64_ctx.limit = find_next_bit(ia64_ctx.bitmap,
-                                       ia64_ctx.max_ctx, ia64_ctx.next);
-                       if (ia64_ctx.next >= ia64_ctx.max_ctx)
-                               wrap_mmu_context(mm);
-               }
-               mm->context = context = ia64_ctx.next++;
-               __set_bit(context, ia64_ctx.bitmap);
-       }
-       spin_unlock_irqrestore(&ia64_ctx.lock, flags);
-out:
-       /*
-        * Ensure we're not starting to use "context" before any old
-        * uses of it are gone from our TLB.
-        */
-       delayed_tlb_flush();
-
-       return context;
-}
-
-/*
- * Initialize context number to some sane value.  MM is guaranteed to be a
- * brand-new address-space, so no TLB flushing is needed, ever.
- */
-static inline int
-init_new_context (struct task_struct *p, struct mm_struct *mm)
-{
-       mm->context = 0;
-       return 0;
-}
-
-static inline void
-destroy_context (struct mm_struct *mm)
-{
-       /* Nothing to do.  */
-}
-
-static inline void
-reload_context (nv_mm_context_t context)
-{
-       unsigned long rid;
-       unsigned long rid_incr = 0;
-       unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
-
-       old_rr4 = ia64_get_rr(RGN_BASE(RGN_HPAGE));
-       rid = context << 3;     /* make space for encoding the region number */
-       rid_incr = 1 << 8;
-
-       /* encode the region id, preferred page size, and VHPT enable bit: */
-       rr0 = (rid << 8) | (PAGE_SHIFT << 2) | 1;
-       rr1 = rr0 + 1*rid_incr;
-       rr2 = rr0 + 2*rid_incr;
-       rr3 = rr0 + 3*rid_incr;
-       rr4 = rr0 + 4*rid_incr;
-#ifdef  CONFIG_HUGETLB_PAGE
-       rr4 = (rr4 & (~(0xfcUL))) | (old_rr4 & 0xfc);
-
-#  if RGN_HPAGE != 4
-#    error "reload_context assumes RGN_HPAGE is 4"
-#  endif
-#endif
-
-       ia64_set_rr0_to_rr4(rr0, rr1, rr2, rr3, rr4);
-       ia64_srlz_i();                  /* srlz.i implies srlz.d */
-}
-
-/*
- * Must be called with preemption off
- */
-static inline void
-activate_context (struct mm_struct *mm)
-{
-       nv_mm_context_t context;
-
-       do {
-               context = get_mmu_context(mm);
-               if (!cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
-                       cpu_set(smp_processor_id(), mm->cpu_vm_mask);
-               reload_context(context);
-               /*
-                * in the unlikely event of a TLB-flush by another thread,
-                * redo the load.
-                */
-       } while (unlikely(context != mm->context));
-}
-
-#define deactivate_mm(tsk,mm)  do { } while (0)
-
-/*
- * Switch from address space PREV to address space NEXT.
- */
-static inline void
-activate_mm (struct mm_struct *prev, struct mm_struct *next)
-{
-       /*
-        * We may get interrupts here, but that's OK because interrupt
-        * handlers cannot touch user-space.
-        */
-       ia64_set_kr(IA64_KR_PT_BASE, __pa(next->pgd));
-       activate_context(next);
-}
-
-#define switch_mm(prev_mm,next_mm,next_task)   activate_mm(prev_mm, next_mm)
-
-# endif /* ! __ASSEMBLY__ */
-#endif /* _ASM_IA64_MMU_CONTEXT_H */
diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h
deleted file mode 100644 (file)
index 34efe88..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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) 2000,2003 Silicon Graphics, Inc.  All rights reserved.
- * Copyright (c) 2002 NEC Corp.
- * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
- * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
- */
-#ifndef _ASM_IA64_MMZONE_H
-#define _ASM_IA64_MMZONE_H
-
-#include <linux/numa.h>
-#include <asm/page.h>
-#include <asm/meminit.h>
-
-#ifdef CONFIG_NUMA
-
-static inline int pfn_to_nid(unsigned long pfn)
-{
-#ifdef CONFIG_NUMA
-       extern int paddr_to_nid(unsigned long);
-       int nid = paddr_to_nid(pfn << PAGE_SHIFT);
-       if (nid < 0)
-               return 0;
-       else
-               return nid;
-#else
-       return 0;
-#endif
-}
-
-#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-extern int early_pfn_to_nid(unsigned long pfn);
-#endif
-
-#ifdef CONFIG_IA64_DIG /* DIG systems are small */
-# define MAX_PHYSNODE_ID       8
-# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 8)
-#else /* sn2 is the biggest case, so we use that if !DIG */
-# define MAX_PHYSNODE_ID       2048
-# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 4)
-#endif
-
-#else /* CONFIG_NUMA */
-# define NR_NODE_MEMBLKS       (MAX_NUMNODES * 4)
-#endif /* CONFIG_NUMA */
-
-#endif /* _ASM_IA64_MMZONE_H */
diff --git a/include/asm-ia64/module.h b/include/asm-ia64/module.h
deleted file mode 100644 (file)
index d2da61e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _ASM_IA64_MODULE_H
-#define _ASM_IA64_MODULE_H
-
-/*
- * IA-64-specific support for kernel module loader.
- *
- * Copyright (C) 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-struct elf64_shdr;                     /* forward declration */
-
-struct mod_arch_specific {
-       struct elf64_shdr *core_plt;    /* core PLT section */
-       struct elf64_shdr *init_plt;    /* init PLT section */
-       struct elf64_shdr *got;         /* global offset table */
-       struct elf64_shdr *opd;         /* official procedure descriptors */
-       struct elf64_shdr *unwind;      /* unwind-table section */
-       unsigned long gp;               /* global-pointer for module */
-
-       void *core_unw_table;           /* core unwind-table cookie returned by unwinder */
-       void *init_unw_table;           /* init unwind-table cookie returned by unwinder */
-       unsigned int next_got_entry;    /* index of next available got entry */
-};
-
-#define Elf_Shdr       Elf64_Shdr
-#define Elf_Sym                Elf64_Sym
-#define Elf_Ehdr       Elf64_Ehdr
-
-#define MODULE_PROC_FAMILY     "ia64"
-#define MODULE_ARCH_VERMAGIC   MODULE_PROC_FAMILY \
-       "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
-
-#define ARCH_SHF_SMALL SHF_IA_64_SHORT
-
-#endif /* _ASM_IA64_MODULE_H */
diff --git a/include/asm-ia64/msgbuf.h b/include/asm-ia64/msgbuf.h
deleted file mode 100644 (file)
index 6c64c0d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ASM_IA64_MSGBUF_H
-#define _ASM_IA64_MSGBUF_H
-
-/*
- * The msqid64_ds structure for IA-64 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 /* _ASM_IA64_MSGBUF_H */
diff --git a/include/asm-ia64/mutex.h b/include/asm-ia64/mutex.h
deleted file mode 100644 (file)
index bed73a6..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * ia64 implementation of the mutex fastpath.
- *
- * Copyright (C) 2006 Ken Chen <kenneth.w.chen@intel.com>
- *
- */
-
-#ifndef _ASM_MUTEX_H
-#define _ASM_MUTEX_H
-
-/**
- *  __mutex_fastpath_lock - try to take the lock by moving the count
- *                          from 1 to a 0 value
- *  @count: pointer of type atomic_t
- *  @fail_fn: function to call if the original value was not 1
- *
- * Change the count from 1 to a value lower than 1, and call <fail_fn> if
- * it wasn't 1 originally. This function MUST leave the value lower than
- * 1 even when the "1" assertion wasn't true.
- */
-static inline void
-__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
-       if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
-               fail_fn(count);
-}
-
-/**
- *  __mutex_fastpath_lock_retval - try to take the lock by moving the count
- *                                 from 1 to a 0 value
- *  @count: pointer of type atomic_t
- *  @fail_fn: function to call if the original value was not 1
- *
- * Change the count from 1 to a value lower than 1, and call <fail_fn> if
- * it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
- * or anything the slow path function returns.
- */
-static inline int
-__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
-{
-       if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
-               return fail_fn(count);
-       return 0;
-}
-
-/**
- *  __mutex_fastpath_unlock - try to promote the count from 0 to 1
- *  @count: pointer of type atomic_t
- *  @fail_fn: function to call if the original value was not 0
- *
- * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
- * In the failure case, this function is allowed to either set the value to
- * 1, or to set it to a value lower than 1.
- *
- * If the implementation sets it to a value of lower than 1, then the
- * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
- * to return 0 otherwise.
- */
-static inline void
-__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
-       int ret = ia64_fetchadd4_rel(count, 1);
-       if (unlikely(ret < 0))
-               fail_fn(count);
-}
-
-#define __mutex_slowpath_needs_to_unlock()             1
-
-/**
- * __mutex_fastpath_trylock - try to acquire the mutex, without waiting
- *
- *  @count: pointer of type atomic_t
- *  @fail_fn: fallback function
- *
- * Change the count from 1 to a value lower than 1, and return 0 (failure)
- * if it wasn't 1 originally, or return 1 (success) otherwise. This function
- * MUST leave the value lower than 1 even when the "1" assertion wasn't true.
- * Additionally, if the value was < 0 originally, this function must not leave
- * it to 0 on failure.
- *
- * If the architecture has no effective trylock variant, it should call the
- * <fail_fn> spinlock-based trylock variant unconditionally.
- */
-static inline int
-__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
-{
-       if (cmpxchg_acq(count, 1, 0) == 1)
-               return 1;
-       return 0;
-}
-
-#endif
diff --git a/include/asm-ia64/native/inst.h b/include/asm-ia64/native/inst.h
deleted file mode 100644 (file)
index c953a2c..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/******************************************************************************
- * include/asm-ia64/native/inst.h
- *
- * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#define DO_SAVE_MIN            IA64_NATIVE_DO_SAVE_MIN
-
-#define __paravirt_switch_to                   ia64_native_switch_to
-#define __paravirt_leave_syscall               ia64_native_leave_syscall
-#define __paravirt_work_processed_syscall      ia64_native_work_processed_syscall
-#define __paravirt_leave_kernel                        ia64_native_leave_kernel
-#define __paravirt_pending_syscall_end         ia64_work_pending_syscall_end
-#define __paravirt_work_processed_syscall_target \
-                                               ia64_work_processed_syscall
-
-#ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
-# define PARAVIRT_POISON       0xdeadbeefbaadf00d
-# define CLOBBER(clob)                         \
-       ;;                                      \
-       movl clob = PARAVIRT_POISON;            \
-       ;;
-#else
-# define CLOBBER(clob)         /* nothing */
-#endif
-
-#define MOV_FROM_IFA(reg)      \
-       mov reg = cr.ifa
-
-#define MOV_FROM_ITIR(reg)     \
-       mov reg = cr.itir
-
-#define MOV_FROM_ISR(reg)      \
-       mov reg = cr.isr
-
-#define MOV_FROM_IHA(reg)      \
-       mov reg = cr.iha
-
-#define MOV_FROM_IPSR(pred, reg)       \
-(pred) mov reg = cr.ipsr
-
-#define MOV_FROM_IIM(reg)      \
-       mov reg = cr.iim
-
-#define MOV_FROM_IIP(reg)      \
-       mov reg = cr.iip
-
-#define MOV_FROM_IVR(reg, clob)        \
-       mov reg = cr.ivr        \
-       CLOBBER(clob)
-
-#define MOV_FROM_PSR(pred, reg, clob)  \
-(pred) mov reg = psr                   \
-       CLOBBER(clob)
-
-#define MOV_TO_IFA(reg, clob)  \
-       mov cr.ifa = reg        \
-       CLOBBER(clob)
-
-#define MOV_TO_ITIR(pred, reg, clob)   \
-(pred) mov cr.itir = reg               \
-       CLOBBER(clob)
-
-#define MOV_TO_IHA(pred, reg, clob)    \
-(pred) mov cr.iha = reg                \
-       CLOBBER(clob)
-
-#define MOV_TO_IPSR(pred, reg, clob)           \
-(pred) mov cr.ipsr = reg                       \
-       CLOBBER(clob)
-
-#define MOV_TO_IFS(pred, reg, clob)    \
-(pred) mov cr.ifs = reg                \
-       CLOBBER(clob)
-
-#define MOV_TO_IIP(reg, clob)  \
-       mov cr.iip = reg        \
-       CLOBBER(clob)
-
-#define MOV_TO_KR(kr, reg, clob0, clob1)       \
-       mov IA64_KR(kr) = reg                   \
-       CLOBBER(clob0)                          \
-       CLOBBER(clob1)
-
-#define ITC_I(pred, reg, clob) \
-(pred) itc.i reg               \
-       CLOBBER(clob)
-
-#define ITC_D(pred, reg, clob) \
-(pred) itc.d reg               \
-       CLOBBER(clob)
-
-#define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
-(pred_i) itc.i reg;                            \
-(pred_d) itc.d reg                             \
-       CLOBBER(clob)
-
-#define THASH(pred, reg0, reg1, clob)          \
-(pred) thash reg0 = reg1                       \
-       CLOBBER(clob)
-
-#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1)           \
-       ssm psr.ic | PSR_DEFAULT_BITS                                   \
-       CLOBBER(clob0)                                                  \
-       CLOBBER(clob1)                                                  \
-       ;;                                                              \
-       srlz.i /* guarantee that interruption collectin is on */        \
-       ;;
-
-#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1)    \
-       ssm psr.ic                              \
-       CLOBBER(clob0)                          \
-       CLOBBER(clob1)                          \
-       ;;                                      \
-       srlz.d
-
-#define RSM_PSR_IC(clob)       \
-       rsm psr.ic              \
-       CLOBBER(clob)
-
-#define SSM_PSR_I(pred, pred_clob, clob)       \
-(pred) ssm psr.i                               \
-       CLOBBER(clob)
-
-#define RSM_PSR_I(pred, clob0, clob1)  \
-(pred) rsm psr.i                       \
-       CLOBBER(clob0)                  \
-       CLOBBER(clob1)
-
-#define RSM_PSR_I_IC(clob0, clob1, clob2)      \
-       rsm psr.i | psr.ic                      \
-       CLOBBER(clob0)                          \
-       CLOBBER(clob1)                          \
-       CLOBBER(clob2)
-
-#define RSM_PSR_DT             \
-       rsm psr.dt
-
-#define SSM_PSR_DT_AND_SRLZ_I  \
-       ssm psr.dt              \
-       ;;                      \
-       srlz.i
-
-#define BSW_0(clob0, clob1, clob2)     \
-       bsw.0                           \
-       CLOBBER(clob0)                  \
-       CLOBBER(clob1)                  \
-       CLOBBER(clob2)
-
-#define BSW_1(clob0, clob1)    \
-       bsw.1                   \
-       CLOBBER(clob0)          \
-       CLOBBER(clob1)
-
-#define COVER  \
-       cover
-
-#define RFI    \
-       rfi
diff --git a/include/asm-ia64/native/irq.h b/include/asm-ia64/native/irq.h
deleted file mode 100644 (file)
index efe9ff7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/******************************************************************************
- * include/asm-ia64/native/irq.h
- *
- * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * moved from linux/include/asm-ia64/irq.h.
- */
-
-#ifndef _ASM_IA64_NATIVE_IRQ_H
-#define _ASM_IA64_NATIVE_IRQ_H
-
-#define NR_VECTORS     256
-
-#if (NR_VECTORS + 32 * NR_CPUS) < 1024
-#define IA64_NATIVE_NR_IRQS (NR_VECTORS + 32 * NR_CPUS)
-#else
-#define IA64_NATIVE_NR_IRQS 1024
-#endif
-
-#endif /* _ASM_IA64_NATIVE_IRQ_H */
diff --git a/include/asm-ia64/nodedata.h b/include/asm-ia64/nodedata.h
deleted file mode 100644 (file)
index 2fb337b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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) 2000 Silicon Graphics, Inc.  All rights reserved.
- * Copyright (c) 2002 NEC Corp.
- * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
- * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
- */
-#ifndef _ASM_IA64_NODEDATA_H
-#define _ASM_IA64_NODEDATA_H
-
-#include <linux/numa.h>
-
-#include <asm/percpu.h>
-#include <asm/mmzone.h>
-
-#ifdef CONFIG_NUMA
-
-/*
- * Node Data. One of these structures is located on each node of a NUMA system.
- */
-
-struct pglist_data;
-struct ia64_node_data {
-       short                   active_cpu_count;
-       short                   node;
-       struct pglist_data      *pg_data_ptrs[MAX_NUMNODES];
-};
-
-
-/*
- * Return a pointer to the node_data structure for the executing cpu.
- */
-#define local_node_data                (local_cpu_data->node_data)
-
-/*
- * Given a node id, return a pointer to the pg_data_t for the node.
- *
- * NODE_DATA   - should be used in all code not related to system
- *               initialization. It uses pernode data structures to minimize
- *               offnode memory references. However, these structure are not 
- *               present during boot. This macro can be used once cpu_init
- *               completes.
- */
-#define NODE_DATA(nid)         (local_node_data->pg_data_ptrs[nid])
-
-/*
- * LOCAL_DATA_ADDR - This is to calculate the address of other node's
- *                  "local_node_data" at hot-plug phase. The local_node_data
- *                  is pointed by per_cpu_page. Kernel usually use it for
- *                  just executing cpu. However, when new node is hot-added,
- *                  the addresses of local data for other nodes are necessary
- *                  to update all of them.
- */
-#define LOCAL_DATA_ADDR(pgdat)                         \
-       ((struct ia64_node_data *)((u64)(pgdat) +       \
-                                  L1_CACHE_ALIGN(sizeof(struct pglist_data))))
-
-#endif /* CONFIG_NUMA */
-
-#endif /* _ASM_IA64_NODEDATA_H */
diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
deleted file mode 100644 (file)
index 3499ff5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- *
- * This file contains NUMA specific prototypes and definitions.
- *
- * 2002/08/05 Erich Focht <efocht@ess.nec.de>
- *
- */
-#ifndef _ASM_IA64_NUMA_H
-#define _ASM_IA64_NUMA_H
-
-
-#ifdef CONFIG_NUMA
-
-#include <linux/cache.h>
-#include <linux/cpumask.h>
-#include <linux/numa.h>
-#include <linux/smp.h>
-#include <linux/threads.h>
-
-#include <asm/mmzone.h>
-
-#define NUMA_NO_NODE   -1
-
-extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
-extern pg_data_t *pgdat_list[MAX_NUMNODES];
-
-/* Stuff below this line could be architecture independent */
-
-extern int num_node_memblks;           /* total number of memory chunks */
-
-/*
- * List of node memory chunks. Filled when parsing SRAT table to
- * obtain information about memory nodes.
-*/
-
-struct node_memblk_s {
-       unsigned long start_paddr;
-       unsigned long size;
-       int nid;                /* which logical node contains this chunk? */
-       int bank;               /* which mem bank on this node */
-};
-
-struct node_cpuid_s {
-       u16     phys_id;        /* id << 8 | eid */
-       int     nid;            /* logical node containing this CPU */
-};
-
-extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
-extern struct node_cpuid_s node_cpuid[NR_CPUS];
-
-/*
- * ACPI 2.0 SLIT (System Locality Information Table)
- * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
- *
- * This is a matrix with "distances" between nodes, they should be
- * proportional to the memory access latency ratios.
- */
-
-extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
-#define node_distance(from,to) (numa_slit[(from) * num_online_nodes() + (to)])
-
-extern int paddr_to_nid(unsigned long paddr);
-
-#define local_nodeid (cpu_to_node_map[smp_processor_id()])
-
-extern void map_cpu_to_node(int cpu, int nid);
-extern void unmap_cpu_from_node(int cpu, int nid);
-
-
-#else /* !CONFIG_NUMA */
-#define map_cpu_to_node(cpu, nid)      do{}while(0)
-#define unmap_cpu_from_node(cpu, nid)  do{}while(0)
-
-#define paddr_to_nid(addr)     0
-
-#endif /* CONFIG_NUMA */
-
-#endif /* _ASM_IA64_NUMA_H */
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
deleted file mode 100644 (file)
index 5f271bc..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-#ifndef _ASM_IA64_PAGE_H
-#define _ASM_IA64_PAGE_H
-/*
- * Pagetable related stuff.
- *
- * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <asm/intrinsics.h>
-#include <asm/types.h>
-
-/*
- * The top three bits of an IA64 address are its Region Number.
- * Different regions are assigned to different purposes.
- */
-#define RGN_SHIFT      (61)
-#define RGN_BASE(r)    (__IA64_UL_CONST(r)<<RGN_SHIFT)
-#define RGN_BITS       (RGN_BASE(-1))
-
-#define RGN_KERNEL     7       /* Identity mapped region */
-#define RGN_UNCACHED    6      /* Identity mapped I/O region */
-#define RGN_GATE       5       /* Gate page, Kernel text, etc */
-#define RGN_HPAGE      4       /* For Huge TLB pages */
-
-/*
- * PAGE_SHIFT determines the actual kernel page size.
- */
-#if defined(CONFIG_IA64_PAGE_SIZE_4KB)
-# define PAGE_SHIFT    12
-#elif defined(CONFIG_IA64_PAGE_SIZE_8KB)
-# define PAGE_SHIFT    13
-#elif defined(CONFIG_IA64_PAGE_SIZE_16KB)
-# define PAGE_SHIFT    14
-#elif defined(CONFIG_IA64_PAGE_SIZE_64KB)
-# define PAGE_SHIFT    16
-#else
-# error Unsupported page size!
-#endif
-
-#define PAGE_SIZE              (__IA64_UL_CONST(1) << PAGE_SHIFT)
-#define PAGE_MASK              (~(PAGE_SIZE - 1))
-
-#define PERCPU_PAGE_SHIFT      16      /* log2() of max. size of per-CPU area */
-#define PERCPU_PAGE_SIZE       (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT)
-
-
-#ifdef CONFIG_HUGETLB_PAGE
-# define HPAGE_REGION_BASE     RGN_BASE(RGN_HPAGE)
-# define HPAGE_SHIFT           hpage_shift
-# define HPAGE_SHIFT_DEFAULT   28      /* check ia64 SDM for architecture supported size */
-# define HPAGE_SIZE            (__IA64_UL_CONST(1) << HPAGE_SHIFT)
-# define HPAGE_MASK            (~(HPAGE_SIZE - 1))
-
-# define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
-#endif /* CONFIG_HUGETLB_PAGE */
-
-#ifdef __ASSEMBLY__
-# define __pa(x)               ((x) - PAGE_OFFSET)
-# define __va(x)               ((x) + PAGE_OFFSET)
-#else /* !__ASSEMBLY */
-#  define STRICT_MM_TYPECHECKS
-
-extern void clear_page (void *page);
-extern void copy_page (void *to, void *from);
-
-/*
- * clear_user_page() and copy_user_page() can't be inline functions because
- * flush_dcache_page() can't be defined until later...
- */
-#define clear_user_page(addr, vaddr, page)     \
-do {                                           \
-       clear_page(addr);                       \
-       flush_dcache_page(page);                \
-} while (0)
-
-#define copy_user_page(to, from, vaddr, page)  \
-do {                                           \
-       copy_page((to), (from));                \
-       flush_dcache_page(page);                \
-} while (0)
-
-
-#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr)         \
-({                                                                     \
-       struct page *page = alloc_page_vma(                             \
-               GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr);  \
-       if (page)                                                       \
-               flush_dcache_page(page);                                \
-       page;                                                           \
-})
-
-#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
-
-#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
-
-#ifdef CONFIG_VIRTUAL_MEM_MAP
-extern int ia64_pfn_valid (unsigned long pfn);
-#else
-# define ia64_pfn_valid(pfn) 1
-#endif
-
-#ifdef CONFIG_VIRTUAL_MEM_MAP
-extern struct page *vmem_map;
-#ifdef CONFIG_DISCONTIGMEM
-# define page_to_pfn(page)     ((unsigned long) (page - vmem_map))
-# define pfn_to_page(pfn)      (vmem_map + (pfn))
-#else
-# include <asm-generic/memory_model.h>
-#endif
-#else
-# include <asm-generic/memory_model.h>
-#endif
-
-#ifdef CONFIG_FLATMEM
-# define pfn_valid(pfn)                (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
-#elif defined(CONFIG_DISCONTIGMEM)
-extern unsigned long min_low_pfn;
-extern unsigned long max_low_pfn;
-# define pfn_valid(pfn)                (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
-#endif
-
-#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
-#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
-
-typedef union ia64_va {
-       struct {
-               unsigned long off : 61;         /* intra-region offset */
-               unsigned long reg :  3;         /* region number */
-       } f;
-       unsigned long l;
-       void *p;
-} ia64_va;
-
-/*
- * Note: These macros depend on the fact that PAGE_OFFSET has all
- * region bits set to 1 and all other bits set to zero.  They are
- * expressed in this way to ensure they result in a single "dep"
- * instruction.
- */
-#define __pa(x)                ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
-#define __va(x)                ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
-
-#define REGION_NUMBER(x)       ({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
-#define REGION_OFFSET(x)       ({ia64_va _v; _v.l = (long) (x); _v.f.off;})
-
-#ifdef CONFIG_HUGETLB_PAGE
-# define htlbpage_to_page(x)   (((unsigned long) REGION_NUMBER(x) << 61)                       \
-                                | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
-# define HUGETLB_PAGE_ORDER    (HPAGE_SHIFT - PAGE_SHIFT)
-extern unsigned int hpage_shift;
-#endif
-
-static __inline__ int
-get_order (unsigned long size)
-{
-       long double d = size - 1;
-       long order;
-
-       order = ia64_getf_exp(d);
-       order = order - PAGE_SHIFT - 0xffff + 1;
-       if (order < 0)
-               order = 0;
-       return order;
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#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;
-#ifdef CONFIG_PGTABLE_4
-  typedef struct { unsigned long pud; } pud_t;
-#endif
-  typedef struct { unsigned long pgd; } pgd_t;
-  typedef struct { unsigned long pgprot; } pgprot_t;
-  typedef struct page *pgtable_t;
-
-# define pte_val(x)    ((x).pte)
-# define pmd_val(x)    ((x).pmd)
-#ifdef CONFIG_PGTABLE_4
-# define pud_val(x)    ((x).pud)
-#endif
-# define pgd_val(x)    ((x).pgd)
-# define pgprot_val(x) ((x).pgprot)
-
-# define __pte(x)      ((pte_t) { (x) } )
-# define __pgprot(x)   ((pgprot_t) { (x) } )
-
-#else /* !STRICT_MM_TYPECHECKS */
-  /*
-   * .. while these make it easier on the compiler
-   */
-# ifndef __ASSEMBLY__
-    typedef unsigned long pte_t;
-    typedef unsigned long pmd_t;
-    typedef unsigned long pgd_t;
-    typedef unsigned long pgprot_t;
-    typedef struct page *pgtable_t;
-# endif
-
-# 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 */
-
-#define PAGE_OFFSET                    RGN_BASE(RGN_KERNEL)
-
-#define VM_DATA_DEFAULT_FLAGS          (VM_READ | VM_WRITE |                                   \
-                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |                \
-                                        (((current->personality & READ_IMPLIES_EXEC) != 0)     \
-                                         ? VM_EXEC : 0))
-
-#endif /* _ASM_IA64_PAGE_H */
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
deleted file mode 100644 (file)
index 67b0290..0000000
+++ /dev/null
@@ -1,1827 +0,0 @@
-#ifndef _ASM_IA64_PAL_H
-#define _ASM_IA64_PAL_H
-
-/*
- * Processor Abstraction Layer definitions.
- *
- * This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0
- * chapter 11 IA-64 Processor Abstraction Layer
- *
- * Copyright (C) 1998-2001 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Stephane Eranian <eranian@hpl.hp.com>
- * Copyright (C) 1999 VA Linux Systems
- * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
- * Copyright (C) 2008 Silicon Graphics, Inc. (SGI)
- *
- * 99/10/01    davidm  Make sure we pass zero for reserved parameters.
- * 00/03/07    davidm  Updated pal_cache_flush() to be in sync with PAL v2.6.
- * 00/03/23     cfleck  Modified processor min-state save area to match updated PAL & SAL info
- * 00/05/24     eranian Updated to latest PAL spec, fix structures bugs, added
- * 00/05/25    eranian Support for stack calls, and static physical calls
- * 00/06/18    eranian Support for stacked physical calls
- * 06/10/26    rja     Support for Intel Itanium Architecture Software Developer's
- *                     Manual Rev 2.2 (Jan 2006)
- */
-
-/*
- * Note that some of these calls use a static-register only calling
- * convention which has nothing to do with the regular calling
- * convention.
- */
-#define PAL_CACHE_FLUSH                1       /* flush i/d cache */
-#define PAL_CACHE_INFO         2       /* get detailed i/d cache info */
-#define PAL_CACHE_INIT         3       /* initialize i/d cache */
-#define PAL_CACHE_SUMMARY      4       /* get summary of cache hierarchy */
-#define PAL_MEM_ATTRIB         5       /* list supported memory attributes */
-#define PAL_PTCE_INFO          6       /* purge TLB info */
-#define PAL_VM_INFO            7       /* return supported virtual memory features */
-#define PAL_VM_SUMMARY         8       /* return summary on supported vm features */
-#define PAL_BUS_GET_FEATURES   9       /* return processor bus interface features settings */
-#define PAL_BUS_SET_FEATURES   10      /* set processor bus features */
-#define PAL_DEBUG_INFO         11      /* get number of debug registers */
-#define PAL_FIXED_ADDR         12      /* get fixed component of processors's directed address */
-#define PAL_FREQ_BASE          13      /* base frequency of the platform */
-#define PAL_FREQ_RATIOS                14      /* ratio of processor, bus and ITC frequency */
-#define PAL_PERF_MON_INFO      15      /* return performance monitor info */
-#define PAL_PLATFORM_ADDR      16      /* set processor interrupt block and IO port space addr */
-#define PAL_PROC_GET_FEATURES  17      /* get configurable processor features & settings */
-#define PAL_PROC_SET_FEATURES  18      /* enable/disable configurable processor features */
-#define PAL_RSE_INFO           19      /* return rse information */
-#define PAL_VERSION            20      /* return version of PAL code */
-#define PAL_MC_CLEAR_LOG       21      /* clear all processor log info */
-#define PAL_MC_DRAIN           22      /* drain operations which could result in an MCA */
-#define PAL_MC_EXPECTED                23      /* set/reset expected MCA indicator */
-#define PAL_MC_DYNAMIC_STATE   24      /* get processor dynamic state */
-#define PAL_MC_ERROR_INFO      25      /* get processor MCA info and static state */
-#define PAL_MC_RESUME          26      /* Return to interrupted process */
-#define PAL_MC_REGISTER_MEM    27      /* Register memory for PAL to use during MCAs and inits */
-#define PAL_HALT               28      /* enter the low power HALT state */
-#define PAL_HALT_LIGHT         29      /* enter the low power light halt state*/
-#define PAL_COPY_INFO          30      /* returns info needed to relocate PAL */
-#define PAL_CACHE_LINE_INIT    31      /* init tags & data of cache line */
-#define PAL_PMI_ENTRYPOINT     32      /* register PMI memory entry points with the processor */
-#define PAL_ENTER_IA_32_ENV    33      /* enter IA-32 system environment */
-#define PAL_VM_PAGE_SIZE       34      /* return vm TC and page walker page sizes */
-
-#define PAL_MEM_FOR_TEST       37      /* get amount of memory needed for late processor test */
-#define PAL_CACHE_PROT_INFO    38      /* get i/d cache protection info */
-#define PAL_REGISTER_INFO      39      /* return AR and CR register information*/
-#define PAL_SHUTDOWN           40      /* enter processor shutdown state */
-#define PAL_PREFETCH_VISIBILITY        41      /* Make Processor Prefetches Visible */
-#define PAL_LOGICAL_TO_PHYSICAL 42     /* returns information on logical to physical processor mapping */
-#define PAL_CACHE_SHARED_INFO  43      /* returns information on caches shared by logical processor */
-#define PAL_GET_HW_POLICY      48      /* Get current hardware resource sharing policy */
-#define PAL_SET_HW_POLICY      49      /* Set current hardware resource sharing policy */
-#define PAL_VP_INFO            50      /* Information about virtual processor features */
-#define PAL_MC_HW_TRACKING     51      /* Hardware tracking status */
-
-#define PAL_COPY_PAL           256     /* relocate PAL procedures and PAL PMI */
-#define PAL_HALT_INFO          257     /* return the low power capabilities of processor */
-#define PAL_TEST_PROC          258     /* perform late processor self-test */
-#define PAL_CACHE_READ         259     /* read tag & data of cacheline for diagnostic testing */
-#define PAL_CACHE_WRITE                260     /* write tag & data of cacheline for diagnostic testing */
-#define PAL_VM_TR_READ         261     /* read contents of translation register */
-#define PAL_GET_PSTATE         262     /* get the current P-state */
-#define PAL_SET_PSTATE         263     /* set the P-state */
-#define PAL_BRAND_INFO         274     /* Processor branding information */
-
-#define PAL_GET_PSTATE_TYPE_LASTSET    0
-#define PAL_GET_PSTATE_TYPE_AVGANDRESET        1
-#define PAL_GET_PSTATE_TYPE_AVGNORESET 2
-#define PAL_GET_PSTATE_TYPE_INSTANT    3
-
-#define PAL_MC_ERROR_INJECT    276     /* Injects processor error or returns injection capabilities */
-
-#ifndef __ASSEMBLY__
-
-#include <linux/types.h>
-#include <asm/fpu.h>
-
-/*
- * Data types needed to pass information into PAL procedures and
- * interpret information returned by them.
- */
-
-/* Return status from the PAL procedure */
-typedef s64                            pal_status_t;
-
-#define PAL_STATUS_SUCCESS             0       /* No error */
-#define PAL_STATUS_UNIMPLEMENTED       (-1)    /* Unimplemented procedure */
-#define PAL_STATUS_EINVAL              (-2)    /* Invalid argument */
-#define PAL_STATUS_ERROR               (-3)    /* Error */
-#define PAL_STATUS_CACHE_INIT_FAIL     (-4)    /* Could not initialize the
-                                                * specified level and type of
-                                                * cache without sideeffects
-                                                * and "restrict" was 1
-                                                */
-#define PAL_STATUS_REQUIRES_MEMORY     (-9)    /* Call requires PAL memory buffer */
-
-/* Processor cache level in the hierarchy */
-typedef u64                            pal_cache_level_t;
-#define PAL_CACHE_LEVEL_L0             0       /* L0 */
-#define PAL_CACHE_LEVEL_L1             1       /* L1 */
-#define PAL_CACHE_LEVEL_L2             2       /* L2 */
-
-
-/* Processor cache type at a particular level in the hierarchy */
-
-typedef u64                            pal_cache_type_t;
-#define PAL_CACHE_TYPE_INSTRUCTION     1       /* Instruction cache */
-#define PAL_CACHE_TYPE_DATA            2       /* Data or unified cache */
-#define PAL_CACHE_TYPE_INSTRUCTION_DATA        3       /* Both Data & Instruction */
-
-
-#define PAL_CACHE_FLUSH_INVALIDATE     1       /* Invalidate clean lines */
-#define PAL_CACHE_FLUSH_CHK_INTRS      2       /* check for interrupts/mc while flushing */
-
-/* Processor cache line size in bytes  */
-typedef int                            pal_cache_line_size_t;
-
-/* Processor cache line state */
-typedef u64                            pal_cache_line_state_t;
-#define PAL_CACHE_LINE_STATE_INVALID   0       /* Invalid */
-#define PAL_CACHE_LINE_STATE_SHARED    1       /* Shared */
-#define PAL_CACHE_LINE_STATE_EXCLUSIVE 2       /* Exclusive */
-#define PAL_CACHE_LINE_STATE_MODIFIED  3       /* Modified */
-
-typedef struct pal_freq_ratio {
-       u32 den, num;           /* numerator & denominator */
-} itc_ratio, proc_ratio;
-
-typedef        union  pal_cache_config_info_1_s {
-       struct {
-               u64             u               : 1,    /* 0 Unified cache ? */
-                               at              : 2,    /* 2-1 Cache mem attr*/
-                               reserved        : 5,    /* 7-3 Reserved */
-                               associativity   : 8,    /* 16-8 Associativity*/
-                               line_size       : 8,    /* 23-17 Line size */
-                               stride          : 8,    /* 31-24 Stride */
-                               store_latency   : 8,    /*39-32 Store latency*/
-                               load_latency    : 8,    /* 47-40 Load latency*/
-                               store_hints     : 8,    /* 55-48 Store hints*/
-                               load_hints      : 8;    /* 63-56 Load hints */
-       } pcci1_bits;
-       u64                     pcci1_data;
-} pal_cache_config_info_1_t;
-
-typedef        union  pal_cache_config_info_2_s {
-       struct {
-               u32             cache_size;             /*cache size in bytes*/
-
-
-               u32             alias_boundary  : 8,    /* 39-32 aliased addr
-                                                        * separation for max
-                                                        * performance.
-                                                        */
-                               tag_ls_bit      : 8,    /* 47-40 LSb of addr*/
-                               tag_ms_bit      : 8,    /* 55-48 MSb of addr*/
-                               reserved        : 8;    /* 63-56 Reserved */
-       } pcci2_bits;
-       u64                     pcci2_data;
-} pal_cache_config_info_2_t;
-
-
-typedef struct pal_cache_config_info_s {
-       pal_status_t                    pcci_status;
-       pal_cache_config_info_1_t       pcci_info_1;
-       pal_cache_config_info_2_t       pcci_info_2;
-       u64                             pcci_reserved;
-} pal_cache_config_info_t;
-
-#define pcci_ld_hints          pcci_info_1.pcci1_bits.load_hints
-#define pcci_st_hints          pcci_info_1.pcci1_bits.store_hints
-#define pcci_ld_latency                pcci_info_1.pcci1_bits.load_latency
-#define pcci_st_latency                pcci_info_1.pcci1_bits.store_latency
-#define pcci_stride            pcci_info_1.pcci1_bits.stride
-#define pcci_line_size         pcci_info_1.pcci1_bits.line_size
-#define pcci_assoc             pcci_info_1.pcci1_bits.associativity
-#define pcci_cache_attr                pcci_info_1.pcci1_bits.at
-#define pcci_unified           pcci_info_1.pcci1_bits.u
-#define pcci_tag_msb           pcci_info_2.pcci2_bits.tag_ms_bit
-#define pcci_tag_lsb           pcci_info_2.pcci2_bits.tag_ls_bit
-#define pcci_alias_boundary    pcci_info_2.pcci2_bits.alias_boundary
-#define pcci_cache_size                pcci_info_2.pcci2_bits.cache_size
-
-
-
-/* Possible values for cache attributes */
-
-#define PAL_CACHE_ATTR_WT              0       /* Write through cache */
-#define PAL_CACHE_ATTR_WB              1       /* Write back cache */
-#define PAL_CACHE_ATTR_WT_OR_WB                2       /* Either write thru or write
-                                                * back depending on TLB
-                                                * memory attributes
-                                                */
-
-
-/* Possible values for cache hints */
-
-#define PAL_CACHE_HINT_TEMP_1          0       /* Temporal level 1 */
-#define PAL_CACHE_HINT_NTEMP_1         1       /* Non-temporal level 1 */
-#define PAL_CACHE_HINT_NTEMP_ALL       3       /* Non-temporal all levels */
-
-/* Processor cache protection  information */
-typedef union pal_cache_protection_element_u {
-       u32                     pcpi_data;
-       struct {
-               u32             data_bits       : 8, /* # data bits covered by
-                                                     * each unit of protection
-                                                     */
-
-                               tagprot_lsb     : 6, /* Least -do- */
-                               tagprot_msb     : 6, /* Most Sig. tag address
-                                                     * bit that this
-                                                     * protection covers.
-                                                     */
-                               prot_bits       : 6, /* # of protection bits */
-                               method          : 4, /* Protection method */
-                               t_d             : 2; /* Indicates which part
-                                                     * of the cache this
-                                                     * protection encoding
-                                                     * applies.
-                                                     */
-       } pcp_info;
-} pal_cache_protection_element_t;
-
-#define pcpi_cache_prot_part   pcp_info.t_d
-#define pcpi_prot_method       pcp_info.method
-#define pcpi_prot_bits         pcp_info.prot_bits
-#define pcpi_tagprot_msb       pcp_info.tagprot_msb
-#define pcpi_tagprot_lsb       pcp_info.tagprot_lsb
-#define pcpi_data_bits         pcp_info.data_bits
-
-/* Processor cache part encodings */
-#define PAL_CACHE_PROT_PART_DATA       0       /* Data protection  */
-#define PAL_CACHE_PROT_PART_TAG                1       /* Tag  protection */
-#define PAL_CACHE_PROT_PART_TAG_DATA   2       /* Tag+data protection (tag is
-                                                * more significant )
-                                                */
-#define PAL_CACHE_PROT_PART_DATA_TAG   3       /* Data+tag protection (data is
-                                                * more significant )
-                                                */
-#define PAL_CACHE_PROT_PART_MAX                6
-
-
-typedef struct pal_cache_protection_info_s {
-       pal_status_t                    pcpi_status;
-       pal_cache_protection_element_t  pcp_info[PAL_CACHE_PROT_PART_MAX];
-} pal_cache_protection_info_t;
-
-
-/* Processor cache protection method encodings */
-#define PAL_CACHE_PROT_METHOD_NONE             0       /* No protection */
-#define PAL_CACHE_PROT_METHOD_ODD_PARITY       1       /* Odd parity */
-#define PAL_CACHE_PROT_METHOD_EVEN_PARITY      2       /* Even parity */
-#define PAL_CACHE_PROT_METHOD_ECC              3       /* ECC protection */
-
-
-/* Processor cache line identification in the hierarchy */
-typedef union pal_cache_line_id_u {
-       u64                     pclid_data;
-       struct {
-               u64             cache_type      : 8,    /* 7-0 cache type */
-                               level           : 8,    /* 15-8 level of the
-                                                        * cache in the
-                                                        * hierarchy.
-                                                        */
-                               way             : 8,    /* 23-16 way in the set
-                                                        */
-                               part            : 8,    /* 31-24 part of the
-                                                        * cache
-                                                        */
-                               reserved        : 32;   /* 63-32 is reserved*/
-       } pclid_info_read;
-       struct {
-               u64             cache_type      : 8,    /* 7-0 cache type */
-                               level           : 8,    /* 15-8 level of the
-                                                        * cache in the
-                                                        * hierarchy.
-                                                        */
-                               way             : 8,    /* 23-16 way in the set
-                                                        */
-                               part            : 8,    /* 31-24 part of the
-                                                        * cache
-                                                        */
-                               mesi            : 8,    /* 39-32 cache line
-                                                        * state
-                                                        */
-                               start           : 8,    /* 47-40 lsb of data to
-                                                        * invert
-                                                        */
-                               length          : 8,    /* 55-48 #bits to
-                                                        * invert
-                                                        */
-                               trigger         : 8;    /* 63-56 Trigger error
-                                                        * by doing a load
-                                                        * after the write
-                                                        */
-
-       } pclid_info_write;
-} pal_cache_line_id_u_t;
-
-#define pclid_read_part                pclid_info_read.part
-#define pclid_read_way         pclid_info_read.way
-#define pclid_read_level       pclid_info_read.level
-#define pclid_read_cache_type  pclid_info_read.cache_type
-
-#define pclid_write_trigger    pclid_info_write.trigger
-#define pclid_write_length     pclid_info_write.length
-#define pclid_write_start      pclid_info_write.start
-#define pclid_write_mesi       pclid_info_write.mesi
-#define pclid_write_part       pclid_info_write.part
-#define pclid_write_way                pclid_info_write.way
-#define pclid_write_level      pclid_info_write.level
-#define pclid_write_cache_type pclid_info_write.cache_type
-
-/* Processor cache line part encodings */
-#define PAL_CACHE_LINE_ID_PART_DATA            0       /* Data */
-#define PAL_CACHE_LINE_ID_PART_TAG             1       /* Tag */
-#define PAL_CACHE_LINE_ID_PART_DATA_PROT       2       /* Data protection */
-#define PAL_CACHE_LINE_ID_PART_TAG_PROT                3       /* Tag protection */
-#define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT   4       /* Data+tag
-                                                        * protection
-                                                        */
-typedef struct pal_cache_line_info_s {
-       pal_status_t            pcli_status;            /* Return status of the read cache line
-                                                        * info call.
-                                                        */
-       u64                     pcli_data;              /* 64-bit data, tag, protection bits .. */
-       u64                     pcli_data_len;          /* data length in bits */
-       pal_cache_line_state_t  pcli_cache_line_state;  /* mesi state */
-
-} pal_cache_line_info_t;
-
-
-/* Machine Check related crap */
-
-/* Pending event status bits  */
-typedef u64                                    pal_mc_pending_events_t;
-
-#define PAL_MC_PENDING_MCA                     (1 << 0)
-#define PAL_MC_PENDING_INIT                    (1 << 1)
-
-/* Error information type */
-typedef u64                                    pal_mc_info_index_t;
-
-#define PAL_MC_INFO_PROCESSOR                  0       /* Processor */
-#define PAL_MC_INFO_CACHE_CHECK                        1       /* Cache check */
-#define PAL_MC_INFO_TLB_CHECK                  2       /* Tlb check */
-#define PAL_MC_INFO_BUS_CHECK                  3       /* Bus check */
-#define PAL_MC_INFO_REQ_ADDR                   4       /* Requestor address */
-#define PAL_MC_INFO_RESP_ADDR                  5       /* Responder address */
-#define PAL_MC_INFO_TARGET_ADDR                        6       /* Target address */
-#define PAL_MC_INFO_IMPL_DEP                   7       /* Implementation
-                                                        * dependent
-                                                        */
-
-#define PAL_TLB_CHECK_OP_PURGE                 8
-
-typedef struct pal_process_state_info_s {
-       u64             reserved1       : 2,
-                       rz              : 1,    /* PAL_CHECK processor
-                                                * rendezvous
-                                                * successful.
-                                                */
-
-                       ra              : 1,    /* PAL_CHECK attempted
-                                                * a rendezvous.
-                                                */
-                       me              : 1,    /* Distinct multiple
-                                                * errors occurred
-                                                */
-
-                       mn              : 1,    /* Min. state save
-                                                * area has been
-                                                * registered with PAL
-                                                */
-
-                       sy              : 1,    /* Storage integrity
-                                                * synched
-                                                */
-
-
-                       co              : 1,    /* Continuable */
-                       ci              : 1,    /* MC isolated */
-                       us              : 1,    /* Uncontained storage
-                                                * damage.
-                                                */
-
-
-                       hd              : 1,    /* Non-essential hw
-                                                * lost (no loss of
-                                                * functionality)
-                                                * causing the
-                                                * processor to run in
-                                                * degraded mode.
-                                                */
-
-                       tl              : 1,    /* 1 => MC occurred
-                                                * after an instr was
-                                                * executed but before
-                                                * the trap that
-                                                * resulted from instr
-                                                * execution was
-                                                * generated.
-                                                * (Trap Lost )
-                                                */
-                       mi              : 1,    /* More information available
-                                                * call PAL_MC_ERROR_INFO
-                                                */
-                       pi              : 1,    /* Precise instruction pointer */
-                       pm              : 1,    /* Precise min-state save area */
-
-                       dy              : 1,    /* Processor dynamic
-                                                * state valid
-                                                */
-
-
-                       in              : 1,    /* 0 = MC, 1 = INIT */
-                       rs              : 1,    /* RSE valid */
-                       cm              : 1,    /* MC corrected */
-                       ex              : 1,    /* MC is expected */
-                       cr              : 1,    /* Control regs valid*/
-                       pc              : 1,    /* Perf cntrs valid */
-                       dr              : 1,    /* Debug regs valid */
-                       tr              : 1,    /* Translation regs
-                                                * valid
-                                                */
-                       rr              : 1,    /* Region regs valid */
-                       ar              : 1,    /* App regs valid */
-                       br              : 1,    /* Branch regs valid */
-                       pr              : 1,    /* Predicate registers
-                                                * valid
-                                                */
-
-                       fp              : 1,    /* fp registers valid*/
-                       b1              : 1,    /* Preserved bank one
-                                                * general registers
-                                                * are valid
-                                                */
-                       b0              : 1,    /* Preserved bank zero
-                                                * general registers
-                                                * are valid
-                                                */
-                       gr              : 1,    /* General registers
-                                                * are valid
-                                                * (excl. banked regs)
-                                                */
-                       dsize           : 16,   /* size of dynamic
-                                                * state returned
-                                                * by the processor
-                                                */
-
-                       se              : 1,    /* Shared error.  MCA in a
-                                                  shared structure */
-                       reserved2       : 10,
-                       cc              : 1,    /* Cache check */
-                       tc              : 1,    /* TLB check */
-                       bc              : 1,    /* Bus check */
-                       rc              : 1,    /* Register file check */
-                       uc              : 1;    /* Uarch check */
-
-} pal_processor_state_info_t;
-
-typedef struct pal_cache_check_info_s {
-       u64             op              : 4,    /* Type of cache
-                                                * operation that
-                                                * caused the machine
-                                                * check.
-                                                */
-                       level           : 2,    /* Cache level */
-                       reserved1       : 2,
-                       dl              : 1,    /* Failure in data part
-                                                * of cache line
-                                                */
-                       tl              : 1,    /* Failure in tag part
-                                                * of cache line
-                                                */
-                       dc              : 1,    /* Failure in dcache */
-                       ic              : 1,    /* Failure in icache */
-                       mesi            : 3,    /* Cache line state */
-                       mv              : 1,    /* mesi valid */
-                       way             : 5,    /* Way in which the
-                                                * error occurred
-                                                */
-                       wiv             : 1,    /* Way field valid */
-                       reserved2       : 1,
-                       dp              : 1,    /* Data poisoned on MBE */
-                       reserved3       : 6,
-                       hlth            : 2,    /* Health indicator */
-
-                       index           : 20,   /* Cache line index */
-                       reserved4       : 2,
-
-                       is              : 1,    /* instruction set (1 == ia32) */
-                       iv              : 1,    /* instruction set field valid */
-                       pl              : 2,    /* privilege level */
-                       pv              : 1,    /* privilege level field valid */
-                       mcc             : 1,    /* Machine check corrected */
-                       tv              : 1,    /* Target address
-                                                * structure is valid
-                                                */
-                       rq              : 1,    /* Requester identifier
-                                                * structure is valid
-                                                */
-                       rp              : 1,    /* Responder identifier
-                                                * structure is valid
-                                                */
-                       pi              : 1;    /* Precise instruction pointer
-                                                * structure is valid
-                                                */
-} pal_cache_check_info_t;
-
-typedef struct pal_tlb_check_info_s {
-
-       u64             tr_slot         : 8,    /* Slot# of TR where
-                                                * error occurred
-                                                */
-                       trv             : 1,    /* tr_slot field is valid */
-                       reserved1       : 1,
-                       level           : 2,    /* TLB level where failure occurred */
-                       reserved2       : 4,
-                       dtr             : 1,    /* Fail in data TR */
-                       itr             : 1,    /* Fail in inst TR */
-                       dtc             : 1,    /* Fail in data TC */
-                       itc             : 1,    /* Fail in inst. TC */
-                       op              : 4,    /* Cache operation */
-                       reserved3       : 6,
-                       hlth            : 2,    /* Health indicator */
-                       reserved4       : 22,
-
-                       is              : 1,    /* instruction set (1 == ia32) */
-                       iv              : 1,    /* instruction set field valid */
-                       pl              : 2,    /* privilege level */
-                       pv              : 1,    /* privilege level field valid */
-                       mcc             : 1,    /* Machine check corrected */
-                       tv              : 1,    /* Target address
-                                                * structure is valid
-                                                */
-                       rq              : 1,    /* Requester identifier
-                                                * structure is valid
-                                                */
-                       rp              : 1,    /* Responder identifier
-                                                * structure is valid
-                                                */
-                       pi              : 1;    /* Precise instruction pointer
-                                                * structure is valid
-                                                */
-} pal_tlb_check_info_t;
-
-typedef struct pal_bus_check_info_s {
-       u64             size            : 5,    /* Xaction size */
-                       ib              : 1,    /* Internal bus error */
-                       eb              : 1,    /* External bus error */
-                       cc              : 1,    /* Error occurred
-                                                * during cache-cache
-                                                * transfer.
-                                                */
-                       type            : 8,    /* Bus xaction type*/
-                       sev             : 5,    /* Bus error severity*/
-                       hier            : 2,    /* Bus hierarchy level */
-                       dp              : 1,    /* Data poisoned on MBE */
-                       bsi             : 8,    /* Bus error status
-                                                * info
-                                                */
-                       reserved2       : 22,
-
-                       is              : 1,    /* instruction set (1 == ia32) */
-                       iv              : 1,    /* instruction set field valid */
-                       pl              : 2,    /* privilege level */
-                       pv              : 1,    /* privilege level field valid */
-                       mcc             : 1,    /* Machine check corrected */
-                       tv              : 1,    /* Target address
-                                                * structure is valid
-                                                */
-                       rq              : 1,    /* Requester identifier
-                                                * structure is valid
-                                                */
-                       rp              : 1,    /* Responder identifier
-                                                * structure is valid
-                                                */
-                       pi              : 1;    /* Precise instruction pointer
-                                                * structure is valid
-                                                */
-} pal_bus_check_info_t;
-
-typedef struct pal_reg_file_check_info_s {
-       u64             id              : 4,    /* Register file identifier */
-                       op              : 4,    /* Type of register
-                                                * operation that
-                                                * caused the machine
-                                                * check.
-                                                */
-                       reg_num         : 7,    /* Register number */
-                       rnv             : 1,    /* reg_num valid */
-                       reserved2       : 38,
-
-                       is              : 1,    /* instruction set (1 == ia32) */
-                       iv              : 1,    /* instruction set field valid */
-                       pl              : 2,    /* privilege level */
-                       pv              : 1,    /* privilege level field valid */
-                       mcc             : 1,    /* Machine check corrected */
-                       reserved3       : 3,
-                       pi              : 1;    /* Precise instruction pointer
-                                                * structure is valid
-                                                */
-} pal_reg_file_check_info_t;
-
-typedef struct pal_uarch_check_info_s {
-       u64             sid             : 5,    /* Structure identification */
-                       level           : 3,    /* Level of failure */
-                       array_id        : 4,    /* Array identification */
-                       op              : 4,    /* Type of
-                                                * operation that
-                                                * caused the machine
-                                                * check.
-                                                */
-                       way             : 6,    /* Way of structure */
-                       wv              : 1,    /* way valid */
-                       xv              : 1,    /* index valid */
-                       reserved1       : 6,
-                       hlth            : 2,    /* Health indicator */
-                       index           : 8,    /* Index or set of the uarch
-                                                * structure that failed.
-                                                */
-                       reserved2       : 24,
-
-                       is              : 1,    /* instruction set (1 == ia32) */
-                       iv              : 1,    /* instruction set field valid */
-                       pl              : 2,    /* privilege level */
-                       pv              : 1,    /* privilege level field valid */
-                       mcc             : 1,    /* Machine check corrected */
-                       tv              : 1,    /* Target address
-                                                * structure is valid
-                                                */
-                       rq              : 1,    /* Requester identifier
-                                                * structure is valid
-                                                */
-                       rp              : 1,    /* Responder identifier
-                                                * structure is valid
-                                                */
-                       pi              : 1;    /* Precise instruction pointer
-                                                * structure is valid
-                                                */
-} pal_uarch_check_info_t;
-
-typedef union pal_mc_error_info_u {
-       u64                             pmei_data;
-       pal_processor_state_info_t      pme_processor;
-       pal_cache_check_info_t          pme_cache;
-       pal_tlb_check_info_t            pme_tlb;
-       pal_bus_check_info_t            pme_bus;
-       pal_reg_file_check_info_t       pme_reg_file;
-       pal_uarch_check_info_t          pme_uarch;
-} pal_mc_error_info_t;
-
-#define pmci_proc_unknown_check                        pme_processor.uc
-#define pmci_proc_bus_check                    pme_processor.bc
-#define pmci_proc_tlb_check                    pme_processor.tc
-#define pmci_proc_cache_check                  pme_processor.cc
-#define pmci_proc_dynamic_state_size           pme_processor.dsize
-#define pmci_proc_gpr_valid                    pme_processor.gr
-#define pmci_proc_preserved_bank0_gpr_valid    pme_processor.b0
-#define pmci_proc_preserved_bank1_gpr_valid    pme_processor.b1
-#define pmci_proc_fp_valid                     pme_processor.fp
-#define pmci_proc_predicate_regs_valid         pme_processor.pr
-#define pmci_proc_branch_regs_valid            pme_processor.br
-#define pmci_proc_app_regs_valid               pme_processor.ar
-#define pmci_proc_region_regs_valid            pme_processor.rr
-#define pmci_proc_translation_regs_valid       pme_processor.tr
-#define pmci_proc_debug_regs_valid             pme_processor.dr
-#define pmci_proc_perf_counters_valid          pme_processor.pc
-#define pmci_proc_control_regs_valid           pme_processor.cr
-#define pmci_proc_machine_check_expected       pme_processor.ex
-#define pmci_proc_machine_check_corrected      pme_processor.cm
-#define pmci_proc_rse_valid                    pme_processor.rs
-#define pmci_proc_machine_check_or_init                pme_processor.in
-#define pmci_proc_dynamic_state_valid          pme_processor.dy
-#define pmci_proc_operation                    pme_processor.op
-#define pmci_proc_trap_lost                    pme_processor.tl
-#define pmci_proc_hardware_damage              pme_processor.hd
-#define pmci_proc_uncontained_storage_damage   pme_processor.us
-#define pmci_proc_machine_check_isolated       pme_processor.ci
-#define pmci_proc_continuable                  pme_processor.co
-#define pmci_proc_storage_intergrity_synced    pme_processor.sy
-#define pmci_proc_min_state_save_area_regd     pme_processor.mn
-#define        pmci_proc_distinct_multiple_errors      pme_processor.me
-#define pmci_proc_pal_attempted_rendezvous     pme_processor.ra
-#define pmci_proc_pal_rendezvous_complete      pme_processor.rz
-
-
-#define pmci_cache_level                       pme_cache.level
-#define pmci_cache_line_state                  pme_cache.mesi
-#define pmci_cache_line_state_valid            pme_cache.mv
-#define pmci_cache_line_index                  pme_cache.index
-#define pmci_cache_instr_cache_fail            pme_cache.ic
-#define pmci_cache_data_cache_fail             pme_cache.dc
-#define pmci_cache_line_tag_fail               pme_cache.tl
-#define pmci_cache_line_data_fail              pme_cache.dl
-#define pmci_cache_operation                   pme_cache.op
-#define pmci_cache_way_valid                   pme_cache.wv
-#define pmci_cache_target_address_valid                pme_cache.tv
-#define pmci_cache_way                         pme_cache.way
-#define pmci_cache_mc                          pme_cache.mc
-
-#define pmci_tlb_instr_translation_cache_fail  pme_tlb.itc
-#define pmci_tlb_data_translation_cache_fail   pme_tlb.dtc
-#define pmci_tlb_instr_translation_reg_fail    pme_tlb.itr
-#define pmci_tlb_data_translation_reg_fail     pme_tlb.dtr
-#define pmci_tlb_translation_reg_slot          pme_tlb.tr_slot
-#define pmci_tlb_mc                            pme_tlb.mc
-
-#define pmci_bus_status_info                   pme_bus.bsi
-#define pmci_bus_req_address_valid             pme_bus.rq
-#define pmci_bus_resp_address_valid            pme_bus.rp
-#define pmci_bus_target_address_valid          pme_bus.tv
-#define pmci_bus_error_severity                        pme_bus.sev
-#define pmci_bus_transaction_type              pme_bus.type
-#define pmci_bus_cache_cache_transfer          pme_bus.cc
-#define pmci_bus_transaction_size              pme_bus.size
-#define pmci_bus_internal_error                        pme_bus.ib
-#define pmci_bus_external_error                        pme_bus.eb
-#define pmci_bus_mc                            pme_bus.mc
-
-/*
- * NOTE: this min_state_save area struct only includes the 1KB
- * architectural state save area.  The other 3 KB is scratch space
- * for PAL.
- */
-
-typedef struct pal_min_state_area_s {
-       u64     pmsa_nat_bits;          /* nat bits for saved GRs  */
-       u64     pmsa_gr[15];            /* GR1  - GR15             */
-       u64     pmsa_bank0_gr[16];      /* GR16 - GR31             */
-       u64     pmsa_bank1_gr[16];      /* GR16 - GR31             */
-       u64     pmsa_pr;                /* predicate registers     */
-       u64     pmsa_br0;               /* branch register 0       */
-       u64     pmsa_rsc;               /* ar.rsc                  */
-       u64     pmsa_iip;               /* cr.iip                  */
-       u64     pmsa_ipsr;              /* cr.ipsr                 */
-       u64     pmsa_ifs;               /* cr.ifs                  */
-       u64     pmsa_xip;               /* previous iip            */
-       u64     pmsa_xpsr;              /* previous psr            */
-       u64     pmsa_xfs;               /* previous ifs            */
-       u64     pmsa_br1;               /* branch register 1       */
-       u64     pmsa_reserved[70];      /* pal_min_state_area should total to 1KB */
-} pal_min_state_area_t;
-
-
-struct ia64_pal_retval {
-       /*
-        * A zero status value indicates call completed without error.
-        * A negative status value indicates reason of call failure.
-        * A positive status value indicates success but an
-        * informational value should be printed (e.g., "reboot for
-        * change to take effect").
-        */
-       s64 status;
-       u64 v0;
-       u64 v1;
-       u64 v2;
-};
-
-/*
- * Note: Currently unused PAL arguments are generally labeled
- * "reserved" so the value specified in the PAL documentation
- * (generally 0) MUST be passed.  Reserved parameters are not optional
- * parameters.
- */
-extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
-extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
-extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
-extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
-extern void ia64_save_scratch_fpregs (struct ia64_fpreg *);
-extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
-
-#define PAL_CALL(iprv,a0,a1,a2,a3) do {                        \
-       struct ia64_fpreg fr[6];                        \
-       ia64_save_scratch_fpregs(fr);                   \
-       iprv = ia64_pal_call_static(a0, a1, a2, a3);    \
-       ia64_load_scratch_fpregs(fr);                   \
-} while (0)
-
-#define PAL_CALL_STK(iprv,a0,a1,a2,a3) do {            \
-       struct ia64_fpreg fr[6];                        \
-       ia64_save_scratch_fpregs(fr);                   \
-       iprv = ia64_pal_call_stacked(a0, a1, a2, a3);   \
-       ia64_load_scratch_fpregs(fr);                   \
-} while (0)
-
-#define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do {                   \
-       struct ia64_fpreg fr[6];                                \
-       ia64_save_scratch_fpregs(fr);                           \
-       iprv = ia64_pal_call_phys_static(a0, a1, a2, a3);       \
-       ia64_load_scratch_fpregs(fr);                           \
-} while (0)
-
-#define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do {               \
-       struct ia64_fpreg fr[6];                                \
-       ia64_save_scratch_fpregs(fr);                           \
-       iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3);      \
-       ia64_load_scratch_fpregs(fr);                           \
-} while (0)
-
-typedef int (*ia64_pal_handler) (u64, ...);
-extern ia64_pal_handler ia64_pal;
-extern void ia64_pal_handler_init (void *);
-
-extern ia64_pal_handler ia64_pal;
-
-extern pal_cache_config_info_t         l0d_cache_config_info;
-extern pal_cache_config_info_t         l0i_cache_config_info;
-extern pal_cache_config_info_t         l1_cache_config_info;
-extern pal_cache_config_info_t         l2_cache_config_info;
-
-extern pal_cache_protection_info_t     l0d_cache_protection_info;
-extern pal_cache_protection_info_t     l0i_cache_protection_info;
-extern pal_cache_protection_info_t     l1_cache_protection_info;
-extern pal_cache_protection_info_t     l2_cache_protection_info;
-
-extern pal_cache_config_info_t         pal_cache_config_info_get(pal_cache_level_t,
-                                                                 pal_cache_type_t);
-
-extern pal_cache_protection_info_t     pal_cache_protection_info_get(pal_cache_level_t,
-                                                                     pal_cache_type_t);
-
-
-extern void                            pal_error(int);
-
-
-/* Useful wrappers for the current list of pal procedures */
-
-typedef union pal_bus_features_u {
-       u64     pal_bus_features_val;
-       struct {
-               u64     pbf_reserved1                           :       29;
-               u64     pbf_req_bus_parking                     :       1;
-               u64     pbf_bus_lock_mask                       :       1;
-               u64     pbf_enable_half_xfer_rate               :       1;
-               u64     pbf_reserved2                           :       20;
-               u64     pbf_enable_shared_line_replace          :       1;
-               u64     pbf_enable_exclusive_line_replace       :       1;
-               u64     pbf_disable_xaction_queueing            :       1;
-               u64     pbf_disable_resp_err_check              :       1;
-               u64     pbf_disable_berr_check                  :       1;
-               u64     pbf_disable_bus_req_internal_err_signal :       1;
-               u64     pbf_disable_bus_req_berr_signal         :       1;
-               u64     pbf_disable_bus_init_event_check        :       1;
-               u64     pbf_disable_bus_init_event_signal       :       1;
-               u64     pbf_disable_bus_addr_err_check          :       1;
-               u64     pbf_disable_bus_addr_err_signal         :       1;
-               u64     pbf_disable_bus_data_err_check          :       1;
-       } pal_bus_features_s;
-} pal_bus_features_u_t;
-
-extern void pal_bus_features_print (u64);
-
-/* Provide information about configurable processor bus features */
-static inline s64
-ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
-                          pal_bus_features_u_t *features_status,
-                          pal_bus_features_u_t *features_control)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0);
-       if (features_avail)
-               features_avail->pal_bus_features_val = iprv.v0;
-       if (features_status)
-               features_status->pal_bus_features_val = iprv.v1;
-       if (features_control)
-               features_control->pal_bus_features_val = iprv.v2;
-       return iprv.status;
-}
-
-/* Enables/disables specific processor bus features */
-static inline s64
-ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
-       return iprv.status;
-}
-
-/* Get detailed cache information */
-static inline s64
-ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf)
-{
-       struct ia64_pal_retval iprv;
-
-       PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
-
-       if (iprv.status == 0) {
-               conf->pcci_status                 = iprv.status;
-               conf->pcci_info_1.pcci1_data      = iprv.v0;
-               conf->pcci_info_2.pcci2_data      = iprv.v1;
-               conf->pcci_reserved               = iprv.v2;
-       }
-       return iprv.status;
-
-}
-
-/* Get detailed cche protection information */
-static inline s64
-ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot)
-{
-       struct ia64_pal_retval iprv;
-
-       PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
-
-       if (iprv.status == 0) {
-               prot->pcpi_status           = iprv.status;
-               prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff;
-               prot->pcp_info[1].pcpi_data = iprv.v0 >> 32;
-               prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff;
-               prot->pcp_info[3].pcpi_data = iprv.v1 >> 32;
-               prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
-               prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
-       }
-       return iprv.status;
-}
-
-/*
- * Flush the processor instruction or data caches.  *PROGRESS must be
- * initialized to zero before calling this for the first time..
- */
-static inline s64
-ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
-       if (vector)
-               *vector = iprv.v0;
-       *progress = iprv.v1;
-       return iprv.status;
-}
-
-
-/* Initialize the processor controlled caches */
-static inline s64
-ia64_pal_cache_init (u64 level, u64 cache_type, u64 rest)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, rest);
-       return iprv.status;
-}
-
-/* Initialize the tags and data of a data or unified cache line of
- * processor controlled cache to known values without the availability
- * of backing memory.
- */
-static inline s64
-ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
-       return iprv.status;
-}
-
-
-/* Read the data and tag of a processor controlled cache line for diags */
-static inline s64
-ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data,
-                               physical_addr, 0);
-       return iprv.status;
-}
-
-/* Return summary information about the hierarchy of caches controlled by the processor */
-static inline s64
-ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_CACHE_SUMMARY, 0, 0, 0);
-       if (cache_levels)
-               *cache_levels = iprv.v0;
-       if (unique_caches)
-               *unique_caches = iprv.v1;
-       return iprv.status;
-}
-
-/* Write the data and tag of a processor-controlled cache line for diags */
-static inline s64
-ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data,
-                               physical_addr, data);
-       return iprv.status;
-}
-
-
-/* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
-static inline s64
-ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
-                   u64 *buffer_size, u64 *buffer_align)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
-       if (buffer_size)
-               *buffer_size = iprv.v0;
-       if (buffer_align)
-               *buffer_align = iprv.v1;
-       return iprv.status;
-}
-
-/* Copy relocatable PAL procedures from ROM to memory */
-static inline s64
-ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
-       if (pal_proc_offset)
-               *pal_proc_offset = iprv.v0;
-       return iprv.status;
-}
-
-/* Return the number of instruction and data debug register pairs */
-static inline s64
-ia64_pal_debug_info (u64 *inst_regs,  u64 *data_regs)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
-       if (inst_regs)
-               *inst_regs = iprv.v0;
-       if (data_regs)
-               *data_regs = iprv.v1;
-
-       return iprv.status;
-}
-
-#ifdef TBD
-/* Switch from IA64-system environment to IA-32 system environment */
-static inline s64
-ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
-       return iprv.status;
-}
-#endif
-
-/* Get unique geographical address of this processor on its bus */
-static inline s64
-ia64_pal_fixed_addr (u64 *global_unique_addr)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
-       if (global_unique_addr)
-               *global_unique_addr = iprv.v0;
-       return iprv.status;
-}
-
-/* Get base frequency of the platform if generated by the processor */
-static inline s64
-ia64_pal_freq_base (u64 *platform_base_freq)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
-       if (platform_base_freq)
-               *platform_base_freq = iprv.v0;
-       return iprv.status;
-}
-
-/*
- * Get the ratios for processor frequency, bus frequency and interval timer to
- * to base frequency of the platform
- */
-static inline s64
-ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
-                     struct pal_freq_ratio *itc_ratio)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
-       if (proc_ratio)
-               *(u64 *)proc_ratio = iprv.v0;
-       if (bus_ratio)
-               *(u64 *)bus_ratio = iprv.v1;
-       if (itc_ratio)
-               *(u64 *)itc_ratio = iprv.v2;
-       return iprv.status;
-}
-
-/*
- * Get the current hardware resource sharing policy of the processor
- */
-static inline s64
-ia64_pal_get_hw_policy (u64 proc_num, u64 *cur_policy, u64 *num_impacted,
-                       u64 *la)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_GET_HW_POLICY, proc_num, 0, 0);
-       if (cur_policy)
-               *cur_policy = iprv.v0;
-       if (num_impacted)
-               *num_impacted = iprv.v1;
-       if (la)
-               *la = iprv.v2;
-       return iprv.status;
-}
-
-/* Make the processor enter HALT or one of the implementation dependent low
- * power states where prefetching and execution are suspended and cache and
- * TLB coherency is not maintained.
- */
-static inline s64
-ia64_pal_halt (u64 halt_state)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
-       return iprv.status;
-}
-
-typedef union pal_power_mgmt_info_u {
-       u64                     ppmi_data;
-       struct {
-              u64              exit_latency            : 16,
-                               entry_latency           : 16,
-                               power_consumption       : 28,
-                               im                      : 1,
-                               co                      : 1,
-                               reserved                : 2;
-       } pal_power_mgmt_info_s;
-} pal_power_mgmt_info_u_t;
-
-/* Return information about processor's optional power management capabilities. */
-static inline s64
-ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
-       return iprv.status;
-}
-
-/* Get the current P-state information */
-static inline s64
-ia64_pal_get_pstate (u64 *pstate_index, unsigned long type)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_STK(iprv, PAL_GET_PSTATE, type, 0, 0);
-       *pstate_index = iprv.v0;
-       return iprv.status;
-}
-
-/* Set the P-state */
-static inline s64
-ia64_pal_set_pstate (u64 pstate_index)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0);
-       return iprv.status;
-}
-
-/* Processor branding information*/
-static inline s64
-ia64_pal_get_brand_info (char *brand_info)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
-       return iprv.status;
-}
-
-/* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
- * suspended, but cache and TLB coherency is maintained.
- */
-static inline s64
-ia64_pal_halt_light (void)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
-       return iprv.status;
-}
-
-/* Clear all the processor error logging   registers and reset the indicator that allows
- * the error logging registers to be written. This procedure also checks the pending
- * machine check bit and pending INIT bit and reports their states.
- */
-static inline s64
-ia64_pal_mc_clear_log (u64 *pending_vector)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
-       if (pending_vector)
-               *pending_vector = iprv.v0;
-       return iprv.status;
-}
-
-/* Ensure that all outstanding transactions in a processor are completed or that any
- * MCA due to thes outstanding transaction is taken.
- */
-static inline s64
-ia64_pal_mc_drain (void)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
-       return iprv.status;
-}
-
-/* Return the machine check dynamic processor state */
-static inline s64
-ia64_pal_mc_dynamic_state (u64 info_type, u64 dy_buffer, u64 *size)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, info_type, dy_buffer, 0);
-       if (size)
-               *size = iprv.v0;
-       return iprv.status;
-}
-
-/* Return processor machine check information */
-static inline s64
-ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
-       if (size)
-               *size = iprv.v0;
-       if (error_info)
-               *error_info = iprv.v1;
-       return iprv.status;
-}
-
-/* Injects the requested processor error or returns info on
- * supported injection capabilities for current processor implementation
- */
-static inline s64
-ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info,
-                       u64 err_data_buffer, u64 *capabilities, u64 *resources)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
-                         err_struct_info, err_data_buffer);
-       if (capabilities)
-               *capabilities= iprv.v0;
-       if (resources)
-               *resources= iprv.v1;
-       return iprv.status;
-}
-
-static inline s64
-ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info,
-                       u64 err_data_buffer, u64 *capabilities, u64 *resources)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
-                         err_struct_info, err_data_buffer);
-       if (capabilities)
-               *capabilities= iprv.v0;
-       if (resources)
-               *resources= iprv.v1;
-       return iprv.status;
-}
-
-/* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
- * attempt to correct any expected machine checks.
- */
-static inline s64
-ia64_pal_mc_expected (u64 expected, u64 *previous)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
-       if (previous)
-               *previous = iprv.v0;
-       return iprv.status;
-}
-
-typedef union pal_hw_tracking_u {
-       u64                     pht_data;
-       struct {
-               u64             itc     :4,     /* Instruction cache tracking */
-                               dct     :4,     /* Date cache tracking */
-                               itt     :4,     /* Instruction TLB tracking */
-                               ddt     :4,     /* Data TLB tracking */
-                               reserved:48;
-       } pal_hw_tracking_s;
-} pal_hw_tracking_u_t;
-
-/*
- * Hardware tracking status.
- */
-static inline s64
-ia64_pal_mc_hw_tracking (u64 *status)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_HW_TRACKING, 0, 0, 0);
-       if (status)
-               *status = iprv.v0;
-       return iprv.status;
-}
-
-/* Register a platform dependent location with PAL to which it can save
- * minimal processor state in the event of a machine check or initialization
- * event.
- */
-static inline s64
-ia64_pal_mc_register_mem (u64 physical_addr, u64 size, u64 *req_size)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, size, 0);
-       if (req_size)
-               *req_size = iprv.v0;
-       return iprv.status;
-}
-
-/* Restore minimal architectural processor state, set CMC interrupt if necessary
- * and resume execution
- */
-static inline s64
-ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
-       return iprv.status;
-}
-
-/* Return the memory attributes implemented by the processor */
-static inline s64
-ia64_pal_mem_attrib (u64 *mem_attrib)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
-       if (mem_attrib)
-               *mem_attrib = iprv.v0 & 0xff;
-       return iprv.status;
-}
-
-/* Return the amount of memory needed for second phase of processor
- * self-test and the required alignment of memory.
- */
-static inline s64
-ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_MEM_FOR_TEST, 0, 0, 0);
-       if (bytes_needed)
-               *bytes_needed = iprv.v0;
-       if (alignment)
-               *alignment = iprv.v1;
-       return iprv.status;
-}
-
-typedef union pal_perf_mon_info_u {
-       u64                       ppmi_data;
-       struct {
-              u64              generic         : 8,
-                               width           : 8,
-                               cycles          : 8,
-                               retired         : 8,
-                               reserved        : 32;
-       } pal_perf_mon_info_s;
-} pal_perf_mon_info_u_t;
-
-/* Return the performance monitor information about what can be counted
- * and how to configure the monitors to count the desired events.
- */
-static inline s64
-ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
-       if (pm_info)
-               pm_info->ppmi_data = iprv.v0;
-       return iprv.status;
-}
-
-/* Specifies the physical address of the processor interrupt block
- * and I/O port space.
- */
-static inline s64
-ia64_pal_platform_addr (u64 type, u64 physical_addr)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
-       return iprv.status;
-}
-
-/* Set the SAL PMI entrypoint in memory */
-static inline s64
-ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
-       return iprv.status;
-}
-
-struct pal_features_s;
-/* Provide information about configurable processor features */
-static inline s64
-ia64_pal_proc_get_features (u64 *features_avail,
-                           u64 *features_status,
-                           u64 *features_control,
-                           u64 features_set)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, features_set, 0);
-       if (iprv.status == 0) {
-               *features_avail   = iprv.v0;
-               *features_status  = iprv.v1;
-               *features_control = iprv.v2;
-       }
-       return iprv.status;
-}
-
-/* Enable/disable processor dependent features */
-static inline s64
-ia64_pal_proc_set_features (u64 feature_select)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
-       return iprv.status;
-}
-
-/*
- * Put everything in a struct so we avoid the global offset table whenever
- * possible.
- */
-typedef struct ia64_ptce_info_s {
-       u64             base;
-       u32             count[2];
-       u32             stride[2];
-} ia64_ptce_info_t;
-
-/* Return the information required for the architected loop used to purge
- * (initialize) the entire TC
- */
-static inline s64
-ia64_get_ptce (ia64_ptce_info_t *ptce)
-{
-       struct ia64_pal_retval iprv;
-
-       if (!ptce)
-               return -1;
-
-       PAL_CALL(iprv, PAL_PTCE_INFO, 0, 0, 0);
-       if (iprv.status == 0) {
-               ptce->base = iprv.v0;
-               ptce->count[0] = iprv.v1 >> 32;
-               ptce->count[1] = iprv.v1 & 0xffffffff;
-               ptce->stride[0] = iprv.v2 >> 32;
-               ptce->stride[1] = iprv.v2 & 0xffffffff;
-       }
-       return iprv.status;
-}
-
-/* Return info about implemented application and control registers. */
-static inline s64
-ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
-       if (reg_info_1)
-               *reg_info_1 = iprv.v0;
-       if (reg_info_2)
-               *reg_info_2 = iprv.v1;
-       return iprv.status;
-}
-
-typedef union pal_hints_u {
-       u64                     ph_data;
-       struct {
-              u64              si              : 1,
-                               li              : 1,
-                               reserved        : 62;
-       } pal_hints_s;
-} pal_hints_u_t;
-
-/* Return information about the register stack and RSE for this processor
- * implementation.
- */
-static inline s64
-ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
-       if (num_phys_stacked)
-               *num_phys_stacked = iprv.v0;
-       if (hints)
-               hints->ph_data = iprv.v1;
-       return iprv.status;
-}
-
-/*
- * Set the current hardware resource sharing policy of the processor
- */
-static inline s64
-ia64_pal_set_hw_policy (u64 policy)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_SET_HW_POLICY, policy, 0, 0);
-       return iprv.status;
-}
-
-/* Cause the processor to enter        SHUTDOWN state, where prefetching and execution are
- * suspended, but cause cache and TLB coherency to be maintained.
- * This is usually called in IA-32 mode.
- */
-static inline s64
-ia64_pal_shutdown (void)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
-       return iprv.status;
-}
-
-/* Perform the second phase of processor self-test. */
-static inline s64
-ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
-       if (self_test_state)
-               *self_test_state = iprv.v0;
-       return iprv.status;
-}
-
-typedef union  pal_version_u {
-       u64     pal_version_val;
-       struct {
-               u64     pv_pal_b_rev            :       8;
-               u64     pv_pal_b_model          :       8;
-               u64     pv_reserved1            :       8;
-               u64     pv_pal_vendor           :       8;
-               u64     pv_pal_a_rev            :       8;
-               u64     pv_pal_a_model          :       8;
-               u64     pv_reserved2            :       16;
-       } pal_version_s;
-} pal_version_u_t;
-
-
-/*
- * Return PAL version information.  While the documentation states that
- * PAL_VERSION can be called in either physical or virtual mode, some
- * implementations only allow physical calls.  We don't call it very often,
- * so the overhead isn't worth eliminating.
- */
-static inline s64
-ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
-       if (pal_min_version)
-               pal_min_version->pal_version_val = iprv.v0;
-
-       if (pal_cur_version)
-               pal_cur_version->pal_version_val = iprv.v1;
-
-       return iprv.status;
-}
-
-typedef union pal_tc_info_u {
-       u64                     pti_val;
-       struct {
-              u64              num_sets        :       8,
-                               associativity   :       8,
-                               num_entries     :       16,
-                               pf              :       1,
-                               unified         :       1,
-                               reduce_tr       :       1,
-                               reserved        :       29;
-       } pal_tc_info_s;
-} pal_tc_info_u_t;
-
-#define tc_reduce_tr           pal_tc_info_s.reduce_tr
-#define tc_unified             pal_tc_info_s.unified
-#define tc_pf                  pal_tc_info_s.pf
-#define tc_num_entries         pal_tc_info_s.num_entries
-#define tc_associativity       pal_tc_info_s.associativity
-#define tc_num_sets            pal_tc_info_s.num_sets
-
-
-/* Return information about the virtual memory characteristics of the processor
- * implementation.
- */
-static inline s64
-ia64_pal_vm_info (u64 tc_level, u64 tc_type,  pal_tc_info_u_t *tc_info, u64 *tc_pages)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_VM_INFO, tc_level, tc_type, 0);
-       if (tc_info)
-               tc_info->pti_val = iprv.v0;
-       if (tc_pages)
-               *tc_pages = iprv.v1;
-       return iprv.status;
-}
-
-/* Get page size information about the virtual memory characteristics of the processor
- * implementation.
- */
-static inline s64
-ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_VM_PAGE_SIZE, 0, 0, 0);
-       if (tr_pages)
-               *tr_pages = iprv.v0;
-       if (vw_pages)
-               *vw_pages = iprv.v1;
-       return iprv.status;
-}
-
-typedef union pal_vm_info_1_u {
-       u64                     pvi1_val;
-       struct {
-               u64             vw              : 1,
-                               phys_add_size   : 7,
-                               key_size        : 8,
-                               max_pkr         : 8,
-                               hash_tag_id     : 8,
-                               max_dtr_entry   : 8,
-                               max_itr_entry   : 8,
-                               max_unique_tcs  : 8,
-                               num_tc_levels   : 8;
-       } pal_vm_info_1_s;
-} pal_vm_info_1_u_t;
-
-#define PAL_MAX_PURGES         0xFFFF          /* all ones is means unlimited */
-
-typedef union pal_vm_info_2_u {
-       u64                     pvi2_val;
-       struct {
-               u64             impl_va_msb     : 8,
-                               rid_size        : 8,
-                               max_purges      : 16,
-                               reserved        : 32;
-       } pal_vm_info_2_s;
-} pal_vm_info_2_u_t;
-
-/* Get summary information about the virtual memory characteristics of the processor
- * implementation.
- */
-static inline s64
-ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
-       if (vm_info_1)
-               vm_info_1->pvi1_val = iprv.v0;
-       if (vm_info_2)
-               vm_info_2->pvi2_val = iprv.v1;
-       return iprv.status;
-}
-
-typedef union pal_vp_info_u {
-       u64                     pvi_val;
-       struct {
-               u64             index:          48,     /* virtual feature set info */
-                               vmm_id:         16;     /* feature set id */
-       } pal_vp_info_s;
-} pal_vp_info_u_t;
-
-/*
- * Returns infomation about virtual processor features
- */
-static inline s64
-ia64_pal_vp_info (u64 feature_set, u64 vp_buffer, u64 *vp_info, u64 *vmm_id)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_VP_INFO, feature_set, vp_buffer, 0);
-       if (vp_info)
-               *vp_info = iprv.v0;
-       if (vmm_id)
-               *vmm_id = iprv.v1;
-       return iprv.status;
-}
-
-typedef union pal_itr_valid_u {
-       u64                     piv_val;
-       struct {
-              u64              access_rights_valid     : 1,
-                               priv_level_valid        : 1,
-                               dirty_bit_valid         : 1,
-                               mem_attr_valid          : 1,
-                               reserved                : 60;
-       } pal_tr_valid_s;
-} pal_tr_valid_u_t;
-
-/* Read a translation register */
-static inline s64
-ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)ia64_tpa(tr_buffer));
-       if (tr_valid)
-               tr_valid->piv_val = iprv.v0;
-       return iprv.status;
-}
-
-/*
- * PAL_PREFETCH_VISIBILITY transaction types
- */
-#define PAL_VISIBILITY_VIRTUAL         0
-#define PAL_VISIBILITY_PHYSICAL                1
-
-/*
- * PAL_PREFETCH_VISIBILITY return codes
- */
-#define PAL_VISIBILITY_OK              1
-#define PAL_VISIBILITY_OK_REMOTE_NEEDED        0
-#define PAL_VISIBILITY_INVAL_ARG       -2
-#define PAL_VISIBILITY_ERROR           -3
-
-static inline s64
-ia64_pal_prefetch_visibility (s64 trans_type)
-{
-       struct ia64_pal_retval iprv;
-       PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0);
-       return iprv.status;
-}
-
-/* data structure for getting information on logical to physical mappings */
-typedef union pal_log_overview_u {
-       struct {
-               u64     num_log         :16,    /* Total number of logical
-                                                * processors on this die
-                                                */
-                       tpc             :8,     /* Threads per core */
-                       reserved3       :8,     /* Reserved */
-                       cpp             :8,     /* Cores per processor */
-                       reserved2       :8,     /* Reserved */
-                       ppid            :8,     /* Physical processor ID */
-                       reserved1       :8;     /* Reserved */
-       } overview_bits;
-       u64 overview_data;
-} pal_log_overview_t;
-
-typedef union pal_proc_n_log_info1_u{
-       struct {
-               u64     tid             :16,    /* Thread id */
-                       reserved2       :16,    /* Reserved */
-                       cid             :16,    /* Core id */
-                       reserved1       :16;    /* Reserved */
-       } ppli1_bits;
-       u64     ppli1_data;
-} pal_proc_n_log_info1_t;
-
-typedef union pal_proc_n_log_info2_u {
-       struct {
-               u64     la              :16,    /* Logical address */
-                       reserved        :48;    /* Reserved */
-       } ppli2_bits;
-       u64     ppli2_data;
-} pal_proc_n_log_info2_t;
-
-typedef struct pal_logical_to_physical_s
-{
-       pal_log_overview_t overview;
-       pal_proc_n_log_info1_t ppli1;
-       pal_proc_n_log_info2_t ppli2;
-} pal_logical_to_physical_t;
-
-#define overview_num_log       overview.overview_bits.num_log
-#define overview_tpc           overview.overview_bits.tpc
-#define overview_cpp           overview.overview_bits.cpp
-#define overview_ppid          overview.overview_bits.ppid
-#define log1_tid               ppli1.ppli1_bits.tid
-#define log1_cid               ppli1.ppli1_bits.cid
-#define log2_la                        ppli2.ppli2_bits.la
-
-/* Get information on logical to physical processor mappings. */
-static inline s64
-ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
-{
-       struct ia64_pal_retval iprv;
-
-       PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
-
-       if (iprv.status == PAL_STATUS_SUCCESS)
-       {
-               mapping->overview.overview_data = iprv.v0;
-               mapping->ppli1.ppli1_data = iprv.v1;
-               mapping->ppli2.ppli2_data = iprv.v2;
-       }
-
-       return iprv.status;
-}
-
-typedef struct pal_cache_shared_info_s
-{
-       u64 num_shared;
-       pal_proc_n_log_info1_t ppli1;
-       pal_proc_n_log_info2_t ppli2;
-} pal_cache_shared_info_t;
-
-/* Get information on logical to physical processor mappings. */
-static inline s64
-ia64_pal_cache_shared_info(u64 level,
-               u64 type,
-               u64 proc_number,
-               pal_cache_shared_info_t *info)
-{
-       struct ia64_pal_retval iprv;
-
-       PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
-
-       if (iprv.status == PAL_STATUS_SUCCESS) {
-               info->num_shared = iprv.v0;
-               info->ppli1.ppli1_data = iprv.v1;
-               info->ppli2.ppli2_data = iprv.v2;
-       }
-
-       return iprv.status;
-}
-#endif /* __ASSEMBLY__ */
-
-#endif /* _ASM_IA64_PAL_H */
diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h
deleted file mode 100644 (file)
index 0964c32..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _ASM_IA64_PARAM_H
-#define _ASM_IA64_PARAM_H
-
-/*
- * Fundamental kernel parameters.
- *
- * Based on <asm-i386/param.h>.
- *
- * Modified 1998, 1999, 2002-2003
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#define EXEC_PAGESIZE  65536
-
-#ifndef NOGROUP
-# define NOGROUP       (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
-
-#ifdef __KERNEL__
-# define HZ            CONFIG_HZ
-# define USER_HZ       HZ
-# define CLOCKS_PER_SEC        HZ      /* frequency at which times() counts */
-#else
-   /*
-    * Technically, this is wrong, but some old apps still refer to it.  The proper way to
-    * get the HZ value is via sysconf(_SC_CLK_TCK).
-    */
-# define HZ 1024
-#endif
-
-#endif /* _ASM_IA64_PARAM_H */
diff --git a/include/asm-ia64/paravirt.h b/include/asm-ia64/paravirt.h
deleted file mode 100644 (file)
index 1b4df12..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/******************************************************************************
- * include/asm-ia64/paravirt.h
- *
- * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-
-#ifndef __ASM_PARAVIRT_H
-#define __ASM_PARAVIRT_H
-
-#ifdef CONFIG_PARAVIRT_GUEST
-
-#define PARAVIRT_HYPERVISOR_TYPE_DEFAULT       0
-#define PARAVIRT_HYPERVISOR_TYPE_XEN           1
-
-#ifndef __ASSEMBLY__
-
-#include <asm/hw_irq.h>
-#include <asm/meminit.h>
-
-/******************************************************************************
- * general info
- */
-struct pv_info {
-       unsigned int kernel_rpl;
-       int paravirt_enabled;
-       const char *name;
-};
-
-extern struct pv_info pv_info;
-
-static inline int paravirt_enabled(void)
-{
-       return pv_info.paravirt_enabled;
-}
-
-static inline unsigned int get_kernel_rpl(void)
-{
-       return pv_info.kernel_rpl;
-}
-
-/******************************************************************************
- * initialization hooks.
- */
-struct rsvd_region;
-
-struct pv_init_ops {
-       void (*banner)(void);
-
-       int (*reserve_memory)(struct rsvd_region *region);
-
-       void (*arch_setup_early)(void);
-       void (*arch_setup_console)(char **cmdline_p);
-       int (*arch_setup_nomca)(void);
-
-       void (*post_smp_prepare_boot_cpu)(void);
-};
-
-extern struct pv_init_ops pv_init_ops;
-
-static inline void paravirt_banner(void)
-{
-       if (pv_init_ops.banner)
-               pv_init_ops.banner();
-}
-
-static inline int paravirt_reserve_memory(struct rsvd_region *region)
-{
-       if (pv_init_ops.reserve_memory)
-               return pv_init_ops.reserve_memory(region);
-       return 0;
-}
-
-static inline void paravirt_arch_setup_early(void)
-{
-       if (pv_init_ops.arch_setup_early)
-               pv_init_ops.arch_setup_early();
-}
-
-static inline void paravirt_arch_setup_console(char **cmdline_p)
-{
-       if (pv_init_ops.arch_setup_console)
-               pv_init_ops.arch_setup_console(cmdline_p);
-}
-
-static inline int paravirt_arch_setup_nomca(void)
-{
-       if (pv_init_ops.arch_setup_nomca)
-               return pv_init_ops.arch_setup_nomca();
-       return 0;
-}
-
-static inline void paravirt_post_smp_prepare_boot_cpu(void)
-{
-       if (pv_init_ops.post_smp_prepare_boot_cpu)
-               pv_init_ops.post_smp_prepare_boot_cpu();
-}
-
-/******************************************************************************
- * replacement of iosapic operations.
- */
-
-struct pv_iosapic_ops {
-       void (*pcat_compat_init)(void);
-
-       struct irq_chip *(*get_irq_chip)(unsigned long trigger);
-
-       unsigned int (*__read)(char __iomem *iosapic, unsigned int reg);
-       void (*__write)(char __iomem *iosapic, unsigned int reg, u32 val);
-};
-
-extern struct pv_iosapic_ops pv_iosapic_ops;
-
-static inline void
-iosapic_pcat_compat_init(void)
-{
-       if (pv_iosapic_ops.pcat_compat_init)
-               pv_iosapic_ops.pcat_compat_init();
-}
-
-static inline struct irq_chip*
-iosapic_get_irq_chip(unsigned long trigger)
-{
-       return pv_iosapic_ops.get_irq_chip(trigger);
-}
-
-static inline unsigned int
-__iosapic_read(char __iomem *iosapic, unsigned int reg)
-{
-       return pv_iosapic_ops.__read(iosapic, reg);
-}
-
-static inline void
-__iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
-{
-       return pv_iosapic_ops.__write(iosapic, reg, val);
-}
-
-/******************************************************************************
- * replacement of irq operations.
- */
-
-struct pv_irq_ops {
-       void (*register_ipi)(void);
-
-       int (*assign_irq_vector)(int irq);
-       void (*free_irq_vector)(int vector);
-
-       void (*register_percpu_irq)(ia64_vector vec,
-                                   struct irqaction *action);
-
-       void (*resend_irq)(unsigned int vector);
-};
-
-extern struct pv_irq_ops pv_irq_ops;
-
-static inline void
-ia64_register_ipi(void)
-{
-       pv_irq_ops.register_ipi();
-}
-
-static inline int
-assign_irq_vector(int irq)
-{
-       return pv_irq_ops.assign_irq_vector(irq);
-}
-
-static inline void
-free_irq_vector(int vector)
-{
-       return pv_irq_ops.free_irq_vector(vector);
-}
-
-static inline void
-register_percpu_irq(ia64_vector vec, struct irqaction *action)
-{
-       pv_irq_ops.register_percpu_irq(vec, action);
-}
-
-static inline void
-ia64_resend_irq(unsigned int vector)
-{
-       pv_irq_ops.resend_irq(vector);
-}
-
-/******************************************************************************
- * replacement of time operations.
- */
-
-extern struct itc_jitter_data_t itc_jitter_data;
-extern volatile int time_keeper_id;
-
-struct pv_time_ops {
-       void (*init_missing_ticks_accounting)(int cpu);
-       int (*do_steal_accounting)(unsigned long *new_itm);
-
-       void (*clocksource_resume)(void);
-};
-
-extern struct pv_time_ops pv_time_ops;
-
-static inline void
-paravirt_init_missing_ticks_accounting(int cpu)
-{
-       if (pv_time_ops.init_missing_ticks_accounting)
-               pv_time_ops.init_missing_ticks_accounting(cpu);
-}
-
-static inline int
-paravirt_do_steal_accounting(unsigned long *new_itm)
-{
-       return pv_time_ops.do_steal_accounting(new_itm);
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#else
-/* fallback for native case */
-
-#ifndef __ASSEMBLY__
-
-#define paravirt_banner()                              do { } while (0)
-#define paravirt_reserve_memory(region)                        0
-
-#define paravirt_arch_setup_early()                    do { } while (0)
-#define paravirt_arch_setup_console(cmdline_p)         do { } while (0)
-#define paravirt_arch_setup_nomca()                    0
-#define paravirt_post_smp_prepare_boot_cpu()           do { } while (0)
-
-#define paravirt_init_missing_ticks_accounting(cpu)    do { } while (0)
-#define paravirt_do_steal_accounting(new_itm)          0
-
-#endif /* __ASSEMBLY__ */
-
-
-#endif /* CONFIG_PARAVIRT_GUEST */
-
-#endif /* __ASM_PARAVIRT_H */
diff --git a/include/asm-ia64/paravirt_privop.h b/include/asm-ia64/paravirt_privop.h
deleted file mode 100644 (file)
index 52482e6..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/******************************************************************************
- * include/asm-ia64/paravirt_privops.h
- *
- * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-#ifndef _ASM_IA64_PARAVIRT_PRIVOP_H
-#define _ASM_IA64_PARAVIRT_PRIVOP_H
-
-#ifdef CONFIG_PARAVIRT
-
-#ifndef __ASSEMBLY__
-
-#include <linux/types.h>
-#include <asm/kregs.h> /* for IA64_PSR_I */
-
-/******************************************************************************
- * replacement of intrinsics operations.
- */
-
-struct pv_cpu_ops {
-       void (*fc)(unsigned long addr);
-       unsigned long (*thash)(unsigned long addr);
-       unsigned long (*get_cpuid)(int index);
-       unsigned long (*get_pmd)(int index);
-       unsigned long (*getreg)(int reg);
-       void (*setreg)(int reg, unsigned long val);
-       void (*ptcga)(unsigned long addr, unsigned long size);
-       unsigned long (*get_rr)(unsigned long index);
-       void (*set_rr)(unsigned long index, unsigned long val);
-       void (*set_rr0_to_rr4)(unsigned long val0, unsigned long val1,
-                              unsigned long val2, unsigned long val3,
-                              unsigned long val4);
-       void (*ssm_i)(void);
-       void (*rsm_i)(void);
-       unsigned long (*get_psr_i)(void);
-       void (*intrin_local_irq_restore)(unsigned long flags);
-};
-
-extern struct pv_cpu_ops pv_cpu_ops;
-
-extern void ia64_native_setreg_func(int regnum, unsigned long val);
-extern unsigned long ia64_native_getreg_func(int regnum);
-
-/************************************************/
-/* Instructions paravirtualized for performance */
-/************************************************/
-
-/* mask for ia64_native_ssm/rsm() must be constant.("i" constraing).
- * static inline function doesn't satisfy it. */
-#define paravirt_ssm(mask)                     \
-       do {                                    \
-               if ((mask) == IA64_PSR_I)       \
-                       pv_cpu_ops.ssm_i();     \
-               else                            \
-                       ia64_native_ssm(mask);  \
-       } while (0)
-
-#define paravirt_rsm(mask)                     \
-       do {                                    \
-               if ((mask) == IA64_PSR_I)       \
-                       pv_cpu_ops.rsm_i();     \
-               else                            \
-                       ia64_native_rsm(mask);  \
-       } while (0)
-
-/******************************************************************************
- * replacement of hand written assembly codes.
- */
-struct pv_cpu_asm_switch {
-       unsigned long switch_to;
-       unsigned long leave_syscall;
-       unsigned long work_processed_syscall;
-       unsigned long leave_kernel;
-};
-void paravirt_cpu_asm_init(const struct pv_cpu_asm_switch *cpu_asm_switch);
-
-#endif /* __ASSEMBLY__ */
-
-#define IA64_PARAVIRT_ASM_FUNC(name)   paravirt_ ## name
-
-#else
-
-/* fallback for native case */
-#define IA64_PARAVIRT_ASM_FUNC(name)   ia64_native_ ## name
-
-#endif /* CONFIG_PARAVIRT */
-
-/* these routines utilize privilege-sensitive or performance-sensitive
- * privileged instructions so the code must be replaced with
- * paravirtualized versions */
-#define ia64_switch_to                 IA64_PARAVIRT_ASM_FUNC(switch_to)
-#define ia64_leave_syscall             IA64_PARAVIRT_ASM_FUNC(leave_syscall)
-#define ia64_work_processed_syscall    \
-       IA64_PARAVIRT_ASM_FUNC(work_processed_syscall)
-#define ia64_leave_kernel              IA64_PARAVIRT_ASM_FUNC(leave_kernel)
-
-#endif /* _ASM_IA64_PARAVIRT_PRIVOP_H */
diff --git a/include/asm-ia64/parport.h b/include/asm-ia64/parport.h
deleted file mode 100644 (file)
index 67e16ad..0000000
+++ /dev/null
@@ -1,20 +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_IA64_PARPORT_H
-#define _ASM_IA64_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_IA64_PARPORT_H */
diff --git a/include/asm-ia64/patch.h b/include/asm-ia64/patch.h
deleted file mode 100644 (file)
index 295fe6a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ASM_IA64_PATCH_H
-#define _ASM_IA64_PATCH_H
-
-/*
- * Copyright (C) 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * There are a number of reasons for patching instructions.  Rather than duplicating code
- * all over the place, we put the common stuff here.  Reasons for patching: in-kernel
- * module-loader, virtual-to-physical patch-list, McKinley Errata 9 workaround, and gate
- * shared library.  Undoubtedly, some of these reasons will disappear and others will
- * be added over time.
- */
-#include <linux/elf.h>
-#include <linux/types.h>
-
-extern void ia64_patch (u64 insn_addr, u64 mask, u64 val);     /* patch any insn slot */
-extern void ia64_patch_imm64 (u64 insn_addr, u64 val);         /* patch "movl" w/abs. value*/
-extern void ia64_patch_imm60 (u64 insn_addr, u64 val);         /* patch "brl" w/ip-rel value */
-
-extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end);
-extern void ia64_patch_vtop (unsigned long start, unsigned long end);
-extern void ia64_patch_phys_stack_reg(unsigned long val);
-extern void ia64_patch_rse (unsigned long start, unsigned long end);
-extern void ia64_patch_gate (void);
-
-#endif /* _ASM_IA64_PATCH_H */
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
deleted file mode 100644 (file)
index 0149097..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef _ASM_IA64_PCI_H
-#define _ASM_IA64_PCI_H
-
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/types.h>
-
-#include <asm/io.h>
-#include <asm/scatterlist.h>
-#include <asm/hw_irq.h>
-
-/*
- * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
- * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
- * loader.
- */
-#define pcibios_assign_all_busses()     0
-#define pcibios_scan_all_fns(a, b)     0
-
-#define PCIBIOS_MIN_IO         0x1000
-#define PCIBIOS_MIN_MEM                0x10000000
-
-void pcibios_config_init(void);
-
-struct pci_dev;
-
-/*
- * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct
- * correspondence between device bus addresses and CPU physical addresses.
- * Platforms with a hardware I/O MMU _must_ turn this off to suppress the
- * bounce buffer handling code in the block and network device layers.
- * Platforms with separate bus address spaces _must_ turn this off and provide
- * a device DMA mapping implementation that takes care of the necessary
- * address translation.
- *
- * For now, the ia64 platforms which may have separate/multiple bus address
- * spaces all have I/O MMUs which support the merging of physically
- * discontiguous buffers, so we can use that as the sole factor to determine
- * the setting of PCI_DMA_BUS_IS_PHYS.
- */
-extern unsigned long ia64_max_iommu_merge_mask;
-#define PCI_DMA_BUS_IS_PHYS    (ia64_max_iommu_merge_mask == ~0UL)
-
-static inline void
-pcibios_set_master (struct pci_dev *dev)
-{
-       /* No special bus mastering setup handling */
-}
-
-static inline void
-pcibios_penalize_isa_irq (int irq, int active)
-{
-       /* We don't do dynamic PCI IRQ allocation */
-}
-
-#include <asm-generic/pci-dma-compat.h>
-
-/* 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))
-
-#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_MULTIPLE;
-       *strategy_parameter = cacheline_size;
-}
-#endif
-
-#define HAVE_PCI_MMAP
-extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
-                               enum pci_mmap_state mmap_state, int write_combine);
-#define HAVE_PCI_LEGACY
-extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
-                                     struct vm_area_struct *vma);
-extern ssize_t pci_read_legacy_io(struct kobject *kobj,
-                                 struct bin_attribute *bin_attr,
-                                 char *buf, loff_t off, size_t count);
-extern ssize_t pci_write_legacy_io(struct kobject *kobj,
-                                  struct bin_attribute *bin_attr,
-                                  char *buf, loff_t off, size_t count);
-extern int pci_mmap_legacy_mem(struct kobject *kobj,
-                              struct bin_attribute *attr,
-                              struct vm_area_struct *vma);
-
-#define pci_get_legacy_mem platform_pci_get_legacy_mem
-#define pci_legacy_read platform_pci_legacy_read
-#define pci_legacy_write platform_pci_legacy_write
-
-struct pci_window {
-       struct resource resource;
-       u64 offset;
-};
-
-struct pci_controller {
-       void *acpi_handle;
-       void *iommu;
-       int segment;
-       int node;               /* nearest node with memory or -1 for global allocation */
-
-       unsigned int windows;
-       struct pci_window *window;
-
-       void *platform_data;
-};
-
-#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
-#define pci_domain_nr(busdev)    (PCI_CONTROLLER(busdev)->segment)
-
-extern struct pci_ops pci_root_ops;
-
-static inline int pci_proc_domain(struct pci_bus *bus)
-{
-       return (pci_domain_nr(bus) != 0);
-}
-
-extern void pcibios_resource_to_bus(struct pci_dev *dev,
-               struct pci_bus_region *region, struct resource *res);
-
-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 pcibios_scan_all_fns(a, b)     0
-
-#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
-static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
-{
-       return channel ? isa_irq_to_vector(15) : isa_irq_to_vector(14);
-}
-
-#endif /* _ASM_IA64_PCI_H */
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
deleted file mode 100644 (file)
index 77f30b6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _ASM_IA64_PERCPU_H
-#define _ASM_IA64_PERCPU_H
-
-/*
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
-
-#ifdef __ASSEMBLY__
-# define THIS_CPU(var) (per_cpu__##var)  /* use this to mark accesses to per-CPU variables... */
-#else /* !__ASSEMBLY__ */
-
-
-#include <linux/threads.h>
-
-#ifdef CONFIG_SMP
-
-#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
-# define PER_CPU_ATTRIBUTES    __attribute__((__model__ (__small__)))
-#endif
-
-#define __my_cpu_offset        __ia64_per_cpu_var(local_per_cpu_offset)
-
-extern void *per_cpu_init(void);
-
-#else /* ! SMP */
-
-#define PER_CPU_ATTRIBUTES     __attribute__((__section__(".data.percpu")))
-
-#define per_cpu_init()                         (__phys_per_cpu_start)
-
-#endif /* SMP */
-
-/*
- * Be extremely careful when taking the address of this variable!  Due to virtual
- * remapping, it is different from the canonical address returned by __get_cpu_var(var)!
- * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
- * more efficient.
- */
-#define __ia64_per_cpu_var(var)        per_cpu__##var
-
-#include <asm-generic/percpu.h>
-
-/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
-DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_PERCPU_H */
diff --git a/include/asm-ia64/perfmon.h b/include/asm-ia64/perfmon.h
deleted file mode 100644 (file)
index 7f3333d..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Hewlett-Packard Co
- *               Stephane Eranian <eranian@hpl.hp.com>
- */
-
-#ifndef _ASM_IA64_PERFMON_H
-#define _ASM_IA64_PERFMON_H
-
-/*
- * perfmon comamnds supported on all CPU models
- */
-#define PFM_WRITE_PMCS         0x01
-#define PFM_WRITE_PMDS         0x02
-#define PFM_READ_PMDS          0x03
-#define PFM_STOP               0x04
-#define PFM_START              0x05
-#define PFM_ENABLE             0x06 /* obsolete */
-#define PFM_DISABLE            0x07 /* obsolete */
-#define PFM_CREATE_CONTEXT     0x08
-#define PFM_DESTROY_CONTEXT    0x09 /* obsolete use close() */
-#define PFM_RESTART            0x0a
-#define PFM_PROTECT_CONTEXT    0x0b /* obsolete */
-#define PFM_GET_FEATURES       0x0c
-#define PFM_DEBUG              0x0d
-#define PFM_UNPROTECT_CONTEXT  0x0e /* obsolete */
-#define PFM_GET_PMC_RESET_VAL  0x0f
-#define PFM_LOAD_CONTEXT       0x10
-#define PFM_UNLOAD_CONTEXT     0x11
-
-/*
- * PMU model specific commands (may not be supported on all PMU models)
- */
-#define PFM_WRITE_IBRS         0x20
-#define PFM_WRITE_DBRS         0x21
-
-/*
- * context flags
- */
-#define PFM_FL_NOTIFY_BLOCK             0x01   /* block task on user level notifications */
-#define PFM_FL_SYSTEM_WIDE      0x02   /* create a system wide context */
-#define PFM_FL_OVFL_NO_MSG      0x80   /* do not post overflow/end messages for notification */
-
-/*
- * event set flags
- */
-#define PFM_SETFL_EXCL_IDLE      0x01   /* exclude idle task (syswide only) XXX: DO NOT USE YET */
-
-/*
- * PMC flags
- */
-#define PFM_REGFL_OVFL_NOTIFY  0x1     /* send notification on overflow */
-#define PFM_REGFL_RANDOM       0x2     /* randomize sampling interval   */
-
-/*
- * PMD/PMC/IBR/DBR return flags (ignored on input)
- *
- * Those flags are used on output and must be checked in case EAGAIN is returned
- * by any of the calls using a pfarg_reg_t or pfarg_dbreg_t structure.
- */
-#define PFM_REG_RETFL_NOTAVAIL (1UL<<31) /* set if register is implemented but not available */
-#define PFM_REG_RETFL_EINVAL   (1UL<<30) /* set if register entry is invalid */
-#define PFM_REG_RETFL_MASK     (PFM_REG_RETFL_NOTAVAIL|PFM_REG_RETFL_EINVAL)
-
-#define PFM_REG_HAS_ERROR(flag)        (((flag) & PFM_REG_RETFL_MASK) != 0)
-
-typedef unsigned char pfm_uuid_t[16];  /* custom sampling buffer identifier type */
-
-/*
- * Request structure used to define a context
- */
-typedef struct {
-       pfm_uuid_t     ctx_smpl_buf_id;  /* which buffer format to use (if needed) */
-       unsigned long  ctx_flags;        /* noblock/block */
-       unsigned short ctx_nextra_sets;  /* number of extra event sets (you always get 1) */
-       unsigned short ctx_reserved1;    /* for future use */
-       int            ctx_fd;           /* return arg: unique identification for context */
-       void           *ctx_smpl_vaddr;  /* return arg: virtual address of sampling buffer, is used */
-       unsigned long  ctx_reserved2[11];/* for future use */
-} pfarg_context_t;
-
-/*
- * Request structure used to write/read a PMC or PMD
- */
-typedef struct {
-       unsigned int    reg_num;           /* which register */
-       unsigned short  reg_set;           /* event set for this register */
-       unsigned short  reg_reserved1;     /* for future use */
-
-       unsigned long   reg_value;         /* initial pmc/pmd value */
-       unsigned long   reg_flags;         /* input: pmc/pmd flags, return: reg error */
-
-       unsigned long   reg_long_reset;    /* reset after buffer overflow notification */
-       unsigned long   reg_short_reset;   /* reset after counter overflow */
-
-       unsigned long   reg_reset_pmds[4]; /* which other counters to reset on overflow */
-       unsigned long   reg_random_seed;   /* seed value when randomization is used */
-       unsigned long   reg_random_mask;   /* bitmask used to limit random value */
-       unsigned long   reg_last_reset_val;/* return: PMD last reset value */
-
-       unsigned long   reg_smpl_pmds[4];  /* which pmds are accessed when PMC overflows */
-       unsigned long   reg_smpl_eventid;  /* opaque sampling event identifier */
-
-       unsigned long   reg_reserved2[3];   /* for future use */
-} pfarg_reg_t;
-
-typedef struct {
-       unsigned int    dbreg_num;              /* which debug register */
-       unsigned short  dbreg_set;              /* event set for this register */
-       unsigned short  dbreg_reserved1;        /* for future use */
-       unsigned long   dbreg_value;            /* value for debug register */
-       unsigned long   dbreg_flags;            /* return: dbreg error */
-       unsigned long   dbreg_reserved2[1];     /* for future use */
-} pfarg_dbreg_t;
-
-typedef struct {
-       unsigned int    ft_version;     /* perfmon: major [16-31], minor [0-15] */
-       unsigned int    ft_reserved;    /* reserved for future use */
-       unsigned long   reserved[4];    /* for future use */
-} pfarg_features_t;
-
-typedef struct {
-       pid_t           load_pid;          /* process to load the context into */
-       unsigned short  load_set;          /* first event set to load */
-       unsigned short  load_reserved1;    /* for future use */
-       unsigned long   load_reserved2[3]; /* for future use */
-} pfarg_load_t;
-
-typedef struct {
-       int             msg_type;               /* generic message header */
-       int             msg_ctx_fd;             /* generic message header */
-       unsigned long   msg_ovfl_pmds[4];       /* which PMDs overflowed */
-       unsigned short  msg_active_set;         /* active set at the time of overflow */
-       unsigned short  msg_reserved1;          /* for future use */
-       unsigned int    msg_reserved2;          /* for future use */
-       unsigned long   msg_tstamp;             /* for perf tuning/debug */
-} pfm_ovfl_msg_t;
-
-typedef struct {
-       int             msg_type;               /* generic message header */
-       int             msg_ctx_fd;             /* generic message header */
-       unsigned long   msg_tstamp;             /* for perf tuning */
-} pfm_end_msg_t;
-
-typedef struct {
-       int             msg_type;               /* type of the message */
-       int             msg_ctx_fd;             /* unique identifier for the context */
-       unsigned long   msg_tstamp;             /* for perf tuning */
-} pfm_gen_msg_t;
-
-#define PFM_MSG_OVFL   1       /* an overflow happened */
-#define PFM_MSG_END    2       /* task to which context was attached ended */
-
-typedef union {
-       pfm_ovfl_msg_t  pfm_ovfl_msg;
-       pfm_end_msg_t   pfm_end_msg;
-       pfm_gen_msg_t   pfm_gen_msg;
-} pfm_msg_t;
-
-/*
- * Define the version numbers for both perfmon as a whole and the sampling buffer format.
- */
-#define PFM_VERSION_MAJ                 2U
-#define PFM_VERSION_MIN                 0U
-#define PFM_VERSION             (((PFM_VERSION_MAJ&0xffff)<<16)|(PFM_VERSION_MIN & 0xffff))
-#define PFM_VERSION_MAJOR(x)    (((x)>>16) & 0xffff)
-#define PFM_VERSION_MINOR(x)    ((x) & 0xffff)
-
-
-/*
- * miscellaneous architected definitions
- */
-#define PMU_FIRST_COUNTER      4       /* first counting monitor (PMC/PMD) */
-#define PMU_MAX_PMCS           256     /* maximum architected number of PMC registers */
-#define PMU_MAX_PMDS           256     /* maximum architected number of PMD registers */
-
-#ifdef __KERNEL__
-
-extern long perfmonctl(int fd, int cmd, void *arg, int narg);
-
-typedef struct {
-       void (*handler)(int irq, void *arg, struct pt_regs *regs);
-} pfm_intr_handler_desc_t;
-
-extern void pfm_save_regs (struct task_struct *);
-extern void pfm_load_regs (struct task_struct *);
-
-extern void pfm_exit_thread(struct task_struct *);
-extern int  pfm_use_debug_registers(struct task_struct *);
-extern int  pfm_release_debug_registers(struct task_struct *);
-extern void pfm_syst_wide_update_task(struct task_struct *, unsigned long info, int is_ctxswin);
-extern void pfm_inherit(struct task_struct *task, struct pt_regs *regs);
-extern void pfm_init_percpu(void);
-extern void pfm_handle_work(void);
-extern int  pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *h);
-extern int  pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *h);
-
-
-
-/*
- * Reset PMD register flags
- */
-#define PFM_PMD_SHORT_RESET    0
-#define PFM_PMD_LONG_RESET     1
-
-typedef union {
-       unsigned int val;
-       struct {
-               unsigned int notify_user:1;     /* notify user program of overflow */
-               unsigned int reset_ovfl_pmds:1; /* reset overflowed PMDs */
-               unsigned int block_task:1;      /* block monitored task on kernel exit */
-               unsigned int mask_monitoring:1; /* mask monitors via PMCx.plm */
-               unsigned int reserved:28;       /* for future use */
-       } bits;
-} pfm_ovfl_ctrl_t;
-
-typedef struct {
-       unsigned char   ovfl_pmd;                       /* index of overflowed PMD  */
-       unsigned char   ovfl_notify;                    /* =1 if monitor requested overflow notification */
-       unsigned short  active_set;                     /* event set active at the time of the overflow */
-       pfm_ovfl_ctrl_t ovfl_ctrl;                      /* return: perfmon controls to set by handler */
-
-       unsigned long   pmd_last_reset;                 /* last reset value of of the PMD */
-       unsigned long   smpl_pmds[4];                   /* bitmask of other PMD of interest on overflow */
-       unsigned long   smpl_pmds_values[PMU_MAX_PMDS]; /* values for the other PMDs of interest */
-       unsigned long   pmd_value;                      /* current 64-bit value of the PMD */
-       unsigned long   pmd_eventid;                    /* eventid associated with PMD */
-} pfm_ovfl_arg_t;
-
-
-typedef struct {
-       char            *fmt_name;
-       pfm_uuid_t      fmt_uuid;
-       size_t          fmt_arg_size;
-       unsigned long   fmt_flags;
-
-       int             (*fmt_validate)(struct task_struct *task, unsigned int flags, int cpu, void *arg);
-       int             (*fmt_getsize)(struct task_struct *task, unsigned int flags, int cpu, void *arg, unsigned long *size);
-       int             (*fmt_init)(struct task_struct *task, void *buf, unsigned int flags, int cpu, void *arg);
-       int             (*fmt_handler)(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct pt_regs *regs, unsigned long stamp);
-       int             (*fmt_restart)(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, struct pt_regs *regs);
-       int             (*fmt_restart_active)(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, struct pt_regs *regs);
-       int             (*fmt_exit)(struct task_struct *task, void *buf, struct pt_regs *regs);
-
-       struct list_head fmt_list;
-} pfm_buffer_fmt_t;
-
-extern int pfm_register_buffer_fmt(pfm_buffer_fmt_t *fmt);
-extern int pfm_unregister_buffer_fmt(pfm_uuid_t uuid);
-
-/*
- * perfmon interface exported to modules
- */
-extern int pfm_mod_read_pmds(struct task_struct *, void *req, unsigned int nreq, struct pt_regs *regs);
-extern int pfm_mod_write_pmcs(struct task_struct *, void *req, unsigned int nreq, struct pt_regs *regs);
-extern int pfm_mod_write_ibrs(struct task_struct *task, void *req, unsigned int nreq, struct pt_regs *regs);
-extern int pfm_mod_write_dbrs(struct task_struct *task, void *req, unsigned int nreq, struct pt_regs *regs);
-
-/*
- * describe the content of the local_cpu_date->pfm_syst_info field
- */
-#define PFM_CPUINFO_SYST_WIDE  0x1     /* if set a system wide session exists */
-#define PFM_CPUINFO_DCR_PP     0x2     /* if set the system wide session has started */
-#define PFM_CPUINFO_EXCL_IDLE  0x4     /* the system wide session excludes the idle task */
-
-/*
- * sysctl control structure. visible to sampling formats
- */
-typedef struct {
-       int     debug;          /* turn on/off debugging via syslog */
-       int     debug_ovfl;     /* turn on/off debug printk in overflow handler */
-       int     fastctxsw;      /* turn on/off fast (unsecure) ctxsw */
-       int     expert_mode;    /* turn on/off value checking */
-} pfm_sysctl_t;
-extern pfm_sysctl_t pfm_sysctl;
-
-
-#endif /* __KERNEL__ */
-
-#endif /* _ASM_IA64_PERFMON_H */
diff --git a/include/asm-ia64/perfmon_default_smpl.h b/include/asm-ia64/perfmon_default_smpl.h
deleted file mode 100644 (file)
index 48822c0..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *               Stephane Eranian <eranian@hpl.hp.com>
- *
- * This file implements the default sampling buffer format
- * for Linux/ia64 perfmon subsystem.
- */
-#ifndef __PERFMON_DEFAULT_SMPL_H__
-#define __PERFMON_DEFAULT_SMPL_H__ 1
-
-#define PFM_DEFAULT_SMPL_UUID { \
-               0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97}
-
-/*
- * format specific parameters (passed at context creation)
- */
-typedef struct {
-       unsigned long buf_size;         /* size of the buffer in bytes */
-       unsigned int  flags;            /* buffer specific flags */
-       unsigned int  res1;             /* for future use */
-       unsigned long reserved[2];      /* for future use */
-} pfm_default_smpl_arg_t;
-
-/*
- * combined context+format specific structure. Can be passed
- * to PFM_CONTEXT_CREATE
- */
-typedef struct {
-       pfarg_context_t         ctx_arg;
-       pfm_default_smpl_arg_t  buf_arg;
-} pfm_default_smpl_ctx_arg_t;
-
-/*
- * This header is at the beginning of the sampling buffer returned to the user.
- * It is directly followed by the first record.
- */
-typedef struct {
-       unsigned long   hdr_count;              /* how many valid entries */
-       unsigned long   hdr_cur_offs;           /* current offset from top of buffer */
-       unsigned long   hdr_reserved2;          /* reserved for future use */
-
-       unsigned long   hdr_overflows;          /* how many times the buffer overflowed */
-       unsigned long   hdr_buf_size;           /* how many bytes in the buffer */
-
-       unsigned int    hdr_version;            /* contains perfmon version (smpl format diffs) */
-       unsigned int    hdr_reserved1;          /* for future use */
-       unsigned long   hdr_reserved[10];       /* for future use */
-} pfm_default_smpl_hdr_t;
-
-/*
- * Entry header in the sampling buffer.  The header is directly followed
- * with the values of the PMD registers of interest saved in increasing 
- * index order: PMD4, PMD5, and so on. How many PMDs are present depends 
- * on how the session was programmed.
- *
- * In the case where multiple counters overflow at the same time, multiple
- * entries are written consecutively.
- *
- * last_reset_value member indicates the initial value of the overflowed PMD. 
- */
-typedef struct {
-        int             pid;                    /* thread id (for NPTL, this is gettid()) */
-        unsigned char   reserved1[3];           /* reserved for future use */
-        unsigned char   ovfl_pmd;               /* index of overflowed PMD */
-
-        unsigned long   last_reset_val;         /* initial value of overflowed PMD */
-        unsigned long   ip;                     /* where did the overflow interrupt happened  */
-        unsigned long   tstamp;                 /* ar.itc when entering perfmon intr. handler */
-
-        unsigned short  cpu;                    /* cpu on which the overfow occured */
-        unsigned short  set;                    /* event set active when overflow ocurred   */
-        int                    tgid;                   /* thread group id (for NPTL, this is getpid()) */
-} pfm_default_smpl_entry_t;
-
-#define PFM_DEFAULT_MAX_PMDS           64 /* how many pmds supported by data structures (sizeof(unsigned long) */
-#define PFM_DEFAULT_MAX_ENTRY_SIZE     (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS))
-#define PFM_DEFAULT_SMPL_MIN_BUF_SIZE  (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE)
-
-#define PFM_DEFAULT_SMPL_VERSION_MAJ   2U
-#define PFM_DEFAULT_SMPL_VERSION_MIN   0U
-#define PFM_DEFAULT_SMPL_VERSION       (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff))
-
-#endif /* __PERFMON_DEFAULT_SMPL_H__ */
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
deleted file mode 100644 (file)
index b9ac1a6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef _ASM_IA64_PGALLOC_H
-#define _ASM_IA64_PGALLOC_H
-
-/*
- * This file contains the functions and defines necessary to allocate
- * page tables.
- *
- * This hopefully works with any (fixed) ia-64 page-size, as defined
- * in <asm/page.h> (currently 8192).
- *
- * Copyright (C) 1998-2001 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com>
- */
-
-
-#include <linux/compiler.h>
-#include <linux/mm.h>
-#include <linux/page-flags.h>
-#include <linux/threads.h>
-#include <linux/quicklist.h>
-
-#include <asm/mmu_context.h>
-
-static inline pgd_t *pgd_alloc(struct mm_struct *mm)
-{
-       return quicklist_alloc(0, GFP_KERNEL, NULL);
-}
-
-static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
-{
-       quicklist_free(0, NULL, pgd);
-}
-
-#ifdef CONFIG_PGTABLE_4
-static inline void
-pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
-{
-       pgd_val(*pgd_entry) = __pa(pud);
-}
-
-static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
-{
-       return quicklist_alloc(0, GFP_KERNEL, NULL);
-}
-
-static inline void pud_free(struct mm_struct *mm, pud_t *pud)
-{
-       quicklist_free(0, NULL, pud);
-}
-#define __pud_free_tlb(tlb, pud)       pud_free((tlb)->mm, pud)
-#endif /* CONFIG_PGTABLE_4 */
-
-static inline void
-pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
-{
-       pud_val(*pud_entry) = __pa(pmd);
-}
-
-static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
-{
-       return quicklist_alloc(0, GFP_KERNEL, NULL);
-}
-
-static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
-{
-       quicklist_free(0, NULL, pmd);
-}
-
-#define __pmd_free_tlb(tlb, pmd)       pmd_free((tlb)->mm, pmd)
-
-static inline void
-pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
-{
-       pmd_val(*pmd_entry) = page_to_phys(pte);
-}
-#define pmd_pgtable(pmd) pmd_page(pmd)
-
-static inline void
-pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
-{
-       pmd_val(*pmd_entry) = __pa(pte);
-}
-
-static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr)
-{
-       struct page *page;
-       void *pg;
-
-       pg = quicklist_alloc(0, GFP_KERNEL, NULL);
-       if (!pg)
-               return NULL;
-       page = virt_to_page(pg);
-       pgtable_page_ctor(page);
-       return page;
-}
-
-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
-                                         unsigned long addr)
-{
-       return quicklist_alloc(0, GFP_KERNEL, NULL);
-}
-
-static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
-{
-       pgtable_page_dtor(pte);
-       quicklist_free_page(0, NULL, pte);
-}
-
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
-{
-       quicklist_free(0, NULL, pte);
-}
-
-static inline void check_pgt_cache(void)
-{
-       quicklist_trim(0, NULL, 25, 16);
-}
-
-#define __pte_free_tlb(tlb, pte)       pte_free((tlb)->mm, pte)
-
-#endif                         /* _ASM_IA64_PGALLOC_H */
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
deleted file mode 100644 (file)
index 7a9bff4..0000000
+++ /dev/null
@@ -1,615 +0,0 @@
-#ifndef _ASM_IA64_PGTABLE_H
-#define _ASM_IA64_PGTABLE_H
-
-/*
- * This file contains the functions and defines necessary to modify and use
- * the IA-64 page table tree.
- *
- * This hopefully works with any (fixed) IA-64 page-size, as defined
- * in <asm/page.h>.
- *
- * Copyright (C) 1998-2005 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#include <asm/mman.h>
-#include <asm/page.h>
-#include <asm/processor.h>
-#include <asm/system.h>
-#include <asm/types.h>
-
-#define IA64_MAX_PHYS_BITS     50      /* max. number of physical address bits (architected) */
-
-/*
- * First, define the various bits in a PTE.  Note that the PTE format
- * matches the VHPT short format, the firt doubleword of the VHPD long
- * format, and the first doubleword of the TLB insertion format.
- */
-#define _PAGE_P_BIT            0
-#define _PAGE_A_BIT            5
-#define _PAGE_D_BIT            6
-
-#define _PAGE_P                        (1 << _PAGE_P_BIT)      /* page present bit */
-#define _PAGE_MA_WB            (0x0 <<  2)     /* write back memory attribute */
-#define _PAGE_MA_UC            (0x4 <<  2)     /* uncacheable memory attribute */
-#define _PAGE_MA_UCE           (0x5 <<  2)     /* UC exported attribute */
-#define _PAGE_MA_WC            (0x6 <<  2)     /* write coalescing memory attribute */
-#define _PAGE_MA_NAT           (0x7 <<  2)     /* not-a-thing attribute */
-#define _PAGE_MA_MASK          (0x7 <<  2)
-#define _PAGE_PL_0             (0 <<  7)       /* privilege level 0 (kernel) */
-#define _PAGE_PL_1             (1 <<  7)       /* privilege level 1 (unused) */
-#define _PAGE_PL_2             (2 <<  7)       /* privilege level 2 (unused) */
-#define _PAGE_PL_3             (3 <<  7)       /* privilege level 3 (user) */
-#define _PAGE_PL_MASK          (3 <<  7)
-#define _PAGE_AR_R             (0 <<  9)       /* read only */
-#define _PAGE_AR_RX            (1 <<  9)       /* read & execute */
-#define _PAGE_AR_RW            (2 <<  9)       /* read & write */
-#define _PAGE_AR_RWX           (3 <<  9)       /* read, write & execute */
-#define _PAGE_AR_R_RW          (4 <<  9)       /* read / read & write */
-#define _PAGE_AR_RX_RWX                (5 <<  9)       /* read & exec / read, write & exec */
-#define _PAGE_AR_RWX_RW                (6 <<  9)       /* read, write & exec / read & write */
-#define _PAGE_AR_X_RX          (7 <<  9)       /* exec & promote / read & exec */
-#define _PAGE_AR_MASK          (7 <<  9)
-#define _PAGE_AR_SHIFT         9
-#define _PAGE_A                        (1 << _PAGE_A_BIT)      /* page accessed bit */
-#define _PAGE_D                        (1 << _PAGE_D_BIT)      /* page dirty bit */
-#define _PAGE_PPN_MASK         (((__IA64_UL(1) << IA64_MAX_PHYS_BITS) - 1) & ~0xfffUL)
-#define _PAGE_ED               (__IA64_UL(1) << 52)    /* exception deferral */
-#define _PAGE_PROTNONE         (__IA64_UL(1) << 63)
-
-/* Valid only for a PTE with the present bit cleared: */
-#define _PAGE_FILE             (1 << 1)                /* see swap & file pte remarks below */
-
-#define _PFN_MASK              _PAGE_PPN_MASK
-/* Mask of bits which may be changed by pte_modify(); the odd bits are there for _PAGE_PROTNONE */
-#define _PAGE_CHG_MASK (_PAGE_P | _PAGE_PROTNONE | _PAGE_PL_MASK | _PAGE_AR_MASK | _PAGE_ED)
-
-#define _PAGE_SIZE_4K  12
-#define _PAGE_SIZE_8K  13
-#define _PAGE_SIZE_16K 14
-#define _PAGE_SIZE_64K 16
-#define _PAGE_SIZE_256K        18
-#define _PAGE_SIZE_1M  20
-#define _PAGE_SIZE_4M  22
-#define _PAGE_SIZE_16M 24
-#define _PAGE_SIZE_64M 26
-#define _PAGE_SIZE_256M        28
-#define _PAGE_SIZE_1G  30
-#define _PAGE_SIZE_4G  32
-
-#define __ACCESS_BITS          _PAGE_ED | _PAGE_A | _PAGE_P | _PAGE_MA_WB
-#define __DIRTY_BITS_NO_ED     _PAGE_A | _PAGE_P | _PAGE_D | _PAGE_MA_WB
-#define __DIRTY_BITS           _PAGE_ED | __DIRTY_BITS_NO_ED
-
-/*
- * How many pointers will a page table level hold expressed in shift
- */
-#define PTRS_PER_PTD_SHIFT     (PAGE_SHIFT-3)
-
-/*
- * Definitions for fourth level:
- */
-#define PTRS_PER_PTE   (__IA64_UL(1) << (PTRS_PER_PTD_SHIFT))
-
-/*
- * Definitions for third level:
- *
- * PMD_SHIFT determines the size of the area a third-level page table
- * can map.
- */
-#define PMD_SHIFT      (PAGE_SHIFT + (PTRS_PER_PTD_SHIFT))
-#define PMD_SIZE       (1UL << PMD_SHIFT)
-#define PMD_MASK       (~(PMD_SIZE-1))
-#define PTRS_PER_PMD   (1UL << (PTRS_PER_PTD_SHIFT))
-
-#ifdef CONFIG_PGTABLE_4
-/*
- * Definitions for second level:
- *
- * PUD_SHIFT determines the size of the area a second-level page table
- * can map.
- */
-#define PUD_SHIFT      (PMD_SHIFT + (PTRS_PER_PTD_SHIFT))
-#define PUD_SIZE       (1UL << PUD_SHIFT)
-#define PUD_MASK       (~(PUD_SIZE-1))
-#define PTRS_PER_PUD   (1UL << (PTRS_PER_PTD_SHIFT))
-#endif
-
-/*
- * Definitions for first level:
- *
- * PGDIR_SHIFT determines what a first-level page table entry can map.
- */
-#ifdef CONFIG_PGTABLE_4
-#define PGDIR_SHIFT            (PUD_SHIFT + (PTRS_PER_PTD_SHIFT))
-#else
-#define PGDIR_SHIFT            (PMD_SHIFT + (PTRS_PER_PTD_SHIFT))
-#endif
-#define PGDIR_SIZE             (__IA64_UL(1) << PGDIR_SHIFT)
-#define PGDIR_MASK             (~(PGDIR_SIZE-1))
-#define PTRS_PER_PGD_SHIFT     PTRS_PER_PTD_SHIFT
-#define PTRS_PER_PGD           (1UL << PTRS_PER_PGD_SHIFT)
-#define USER_PTRS_PER_PGD      (5*PTRS_PER_PGD/8)      /* regions 0-4 are user regions */
-#define FIRST_USER_ADDRESS     0
-
-/*
- * 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_PROTNONE | _PAGE_A)
-#define PAGE_SHARED    __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RW)
-#define PAGE_READONLY  __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R)
-#define PAGE_COPY      __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R)
-#define PAGE_COPY_EXEC __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
-#define PAGE_GATE      __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX)
-#define PAGE_KERNEL    __pgprot(__DIRTY_BITS  | _PAGE_PL_0 | _PAGE_AR_RWX)
-#define PAGE_KERNELRX  __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX)
-
-# ifndef __ASSEMBLY__
-
-#include <linux/sched.h>       /* for mm_struct */
-#include <linux/bitops.h>
-#include <asm/cacheflush.h>
-#include <asm/mmu_context.h>
-#include <asm/processor.h>
-
-/*
- * Next come the mappings that determine how mmap() protection bits
- * (PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE) get implemented.  The
- * _P version gets used for a private shared memory segment, the _S
- * version gets used for a shared memory segment with MAP_SHARED on.
- * In a private shared memory segment, we do a copy-on-write if a task
- * attempts to write to the page.
- */
-       /* xwr */
-#define __P000 PAGE_NONE
-#define __P001 PAGE_READONLY
-#define __P010 PAGE_READONLY   /* write to priv pg -> copy & make writable */
-#define __P011 PAGE_READONLY   /* ditto */
-#define __P100 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_X_RX)
-#define __P101 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
-#define __P110 PAGE_COPY_EXEC
-#define __P111 PAGE_COPY_EXEC
-
-#define __S000 PAGE_NONE
-#define __S001 PAGE_READONLY
-#define __S010 PAGE_SHARED     /* we don't have (and don't need) write-only */
-#define __S011 PAGE_SHARED
-#define __S100 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_X_RX)
-#define __S101 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX)
-#define __S110 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX)
-#define __S111 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX)
-
-#define pgd_ERROR(e)   printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
-#ifdef CONFIG_PGTABLE_4
-#define pud_ERROR(e)   printk("%s:%d: bad pud %016lx.\n", __FILE__, __LINE__, pud_val(e))
-#endif
-#define pmd_ERROR(e)   printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
-#define pte_ERROR(e)   printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
-
-
-/*
- * Some definitions to translate between mem_map, PTEs, and page addresses:
- */
-
-
-/* Quick test to see if ADDR is a (potentially) valid physical address. */
-static inline long
-ia64_phys_addr_valid (unsigned long addr)
-{
-       return (addr & (local_cpu_data->unimpl_pa_mask)) == 0;
-}
-
-/*
- * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
- * memory.  For the return value to be meaningful, ADDR must be >=
- * PAGE_OFFSET.  This operation can be relatively expensive (e.g.,
- * require a hash-, or multi-level tree-lookup or something of that
- * sort) but it guarantees to return TRUE only if accessing the page
- * at that address does not cause an error.  Note that there may be
- * addresses for which kern_addr_valid() returns FALSE even though an
- * access would not cause an error (e.g., this is typically true for
- * memory mapped I/O regions.
- *
- * XXX Need to implement this for IA-64.
- */
-#define kern_addr_valid(addr)  (1)
-
-
-/*
- * Now come the defines and routines to manage and access the three-level
- * page table.
- */
-
-
-#define VMALLOC_START          (RGN_BASE(RGN_GATE) + 0x200000000UL)
-#ifdef CONFIG_VIRTUAL_MEM_MAP
-# define VMALLOC_END_INIT      (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9)))
-# define VMALLOC_END           vmalloc_end
-  extern unsigned long vmalloc_end;
-#else
-#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_SPARSEMEM_VMEMMAP)
-/* SPARSEMEM_VMEMMAP uses half of vmalloc... */
-# define VMALLOC_END           (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10)))
-# define vmemmap               ((struct page *)VMALLOC_END)
-#else
-# define VMALLOC_END           (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9)))
-#endif
-#endif
-
-/* fs/proc/kcore.c */
-#define        kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE))
-#define        kc_offset_to_vaddr(o) ((o) + RGN_BASE(RGN_GATE))
-
-#define RGN_MAP_SHIFT (PGDIR_SHIFT + PTRS_PER_PGD_SHIFT - 3)
-#define RGN_MAP_LIMIT  ((1UL << RGN_MAP_SHIFT) - PAGE_SIZE)    /* per region addr limit */
-
-/*
- * Conversion functions: convert page frame number (pfn) and a protection value to a page
- * table entry (pte).
- */
-#define pfn_pte(pfn, pgprot) \
-({ pte_t __pte; pte_val(__pte) = ((pfn) << PAGE_SHIFT) | pgprot_val(pgprot); __pte; })
-
-/* Extract pfn from pte.  */
-#define pte_pfn(_pte)          ((pte_val(_pte) & _PFN_MASK) >> PAGE_SHIFT)
-
-#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
-
-/* This takes a physical page address that is used by the remapping functions */
-#define mk_pte_phys(physpage, pgprot) \
-({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
-
-#define pte_modify(_pte, newprot) \
-       (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK)))
-
-#define pte_none(pte)                  (!pte_val(pte))
-#define pte_present(pte)               (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE))
-#define pte_clear(mm,addr,pte)         (pte_val(*(pte)) = 0UL)
-/* pte_page() returns the "struct page *" corresponding to the PTE: */
-#define pte_page(pte)                  virt_to_page(((pte_val(pte) & _PFN_MASK) + PAGE_OFFSET))
-
-#define pmd_none(pmd)                  (!pmd_val(pmd))
-#define pmd_bad(pmd)                   (!ia64_phys_addr_valid(pmd_val(pmd)))
-#define pmd_present(pmd)               (pmd_val(pmd) != 0UL)
-#define pmd_clear(pmdp)                        (pmd_val(*(pmdp)) = 0UL)
-#define pmd_page_vaddr(pmd)            ((unsigned long) __va(pmd_val(pmd) & _PFN_MASK))
-#define pmd_page(pmd)                  virt_to_page((pmd_val(pmd) + PAGE_OFFSET))
-
-#define pud_none(pud)                  (!pud_val(pud))
-#define pud_bad(pud)                   (!ia64_phys_addr_valid(pud_val(pud)))
-#define pud_present(pud)               (pud_val(pud) != 0UL)
-#define pud_clear(pudp)                        (pud_val(*(pudp)) = 0UL)
-#define pud_page_vaddr(pud)            ((unsigned long) __va(pud_val(pud) & _PFN_MASK))
-#define pud_page(pud)                  virt_to_page((pud_val(pud) + PAGE_OFFSET))
-
-#ifdef CONFIG_PGTABLE_4
-#define pgd_none(pgd)                  (!pgd_val(pgd))
-#define pgd_bad(pgd)                   (!ia64_phys_addr_valid(pgd_val(pgd)))
-#define pgd_present(pgd)               (pgd_val(pgd) != 0UL)
-#define pgd_clear(pgdp)                        (pgd_val(*(pgdp)) = 0UL)
-#define pgd_page_vaddr(pgd)            ((unsigned long) __va(pgd_val(pgd) & _PFN_MASK))
-#define pgd_page(pgd)                  virt_to_page((pgd_val(pgd) + PAGE_OFFSET))
-#endif
-
-/*
- * The following have defined behavior only work if pte_present() is true.
- */
-#define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4)
-#define pte_exec(pte)          ((pte_val(pte) & _PAGE_AR_RX) != 0)
-#define pte_dirty(pte)         ((pte_val(pte) & _PAGE_D) != 0)
-#define pte_young(pte)         ((pte_val(pte) & _PAGE_A) != 0)
-#define pte_file(pte)          ((pte_val(pte) & _PAGE_FILE) != 0)
-#define pte_special(pte)       0
-
-/*
- * Note: we convert AR_RWX to AR_RX and AR_RW to AR_R by clearing the 2nd bit in the
- * access rights:
- */
-#define pte_wrprotect(pte)     (__pte(pte_val(pte) & ~_PAGE_AR_RW))
-#define pte_mkwrite(pte)       (__pte(pte_val(pte) | _PAGE_AR_RW))
-#define pte_mkold(pte)         (__pte(pte_val(pte) & ~_PAGE_A))
-#define pte_mkyoung(pte)       (__pte(pte_val(pte) | _PAGE_A))
-#define pte_mkclean(pte)       (__pte(pte_val(pte) & ~_PAGE_D))
-#define pte_mkdirty(pte)       (__pte(pte_val(pte) | _PAGE_D))
-#define pte_mkhuge(pte)                (__pte(pte_val(pte)))
-#define pte_mkspecial(pte)     (pte)
-
-/*
- * Because ia64's Icache and Dcache is not coherent (on a cpu), we need to
- * sync icache and dcache when we insert *new* executable page.
- *  __ia64_sync_icache_dcache() check Pg_arch_1 bit and flush icache
- * if necessary.
- *
- *  set_pte() is also called by the kernel, but we can expect that the kernel
- *  flushes icache explicitly if necessary.
- */
-#define pte_present_exec_user(pte)\
-       ((pte_val(pte) & (_PAGE_P | _PAGE_PL_MASK | _PAGE_AR_RX)) == \
-               (_PAGE_P | _PAGE_PL_3 | _PAGE_AR_RX))
-
-extern void __ia64_sync_icache_dcache(pte_t pteval);
-static inline void set_pte(pte_t *ptep, pte_t pteval)
-{
-       /* page is present && page is user  && page is executable
-        * && (page swapin or new page or page migraton
-        *      || copy_on_write with page copying.)
-        */
-       if (pte_present_exec_user(pteval) &&
-           (!pte_present(*ptep) ||
-               pte_pfn(*ptep) != pte_pfn(pteval)))
-               /* load_module() calles flush_icache_range() explicitly*/
-               __ia64_sync_icache_dcache(pteval);
-       *ptep = pteval;
-}
-
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
-
-/*
- * Make page protection values cacheable, uncacheable, or write-
- * combining.  Note that "protection" is really a misnomer here as the
- * protection value contains the memory attribute bits, dirty bits, and
- * various other bits as well.
- */
-#define pgprot_cacheable(prot)         __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WB)
-#define pgprot_noncached(prot)         __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_UC)
-#define pgprot_writecombine(prot)      __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC)
-
-struct file;
-extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
-                                    unsigned long size, pgprot_t vma_prot);
-#define __HAVE_PHYS_MEM_ACCESS_PROT
-
-static inline unsigned long
-pgd_index (unsigned long address)
-{
-       unsigned long region = address >> 61;
-       unsigned long l1index = (address >> PGDIR_SHIFT) & ((PTRS_PER_PGD >> 3) - 1);
-
-       return (region << (PAGE_SHIFT - 6)) | l1index;
-}
-
-/* The offset in the 1-level directory is given by the 3 region bits
-   (61..63) and the level-1 bits.  */
-static inline pgd_t*
-pgd_offset (const struct mm_struct *mm, unsigned long address)
-{
-       return mm->pgd + pgd_index(address);
-}
-
-/* In the kernel's mapped region we completely ignore the region number
-   (since we know it's in region number 5). */
-#define pgd_offset_k(addr) \
-       (init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
-
-/* Look up a pgd entry in the gate area.  On IA-64, the gate-area
-   resides in the kernel-mapped segment, hence we use pgd_offset_k()
-   here.  */
-#define pgd_offset_gate(mm, addr)      pgd_offset_k(addr)
-
-#ifdef CONFIG_PGTABLE_4
-/* Find an entry in the second-level page table.. */
-#define pud_offset(dir,addr) \
-       ((pud_t *) pgd_page_vaddr(*(dir)) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
-#endif
-
-/* Find an entry in the third-level page table.. */
-#define pmd_offset(dir,addr) \
-       ((pmd_t *) pud_page_vaddr(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
-
-/*
- * Find an entry in the third-level page table.  This looks more complicated than it
- * should be because some platforms place page tables in high memory.
- */
-#define pte_index(addr)                (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir,addr)    ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr)       pte_offset_kernel(dir, addr)
-#define pte_offset_map_nested(dir,addr)        pte_offset_map(dir, addr)
-#define pte_unmap(pte)                 do { } while (0)
-#define pte_unmap_nested(pte)          do { } while (0)
-
-/* atomic versions of the some PTE manipulations: */
-
-static inline int
-ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
-{
-#ifdef CONFIG_SMP
-       if (!pte_young(*ptep))
-               return 0;
-       return test_and_clear_bit(_PAGE_A_BIT, ptep);
-#else
-       pte_t pte = *ptep;
-       if (!pte_young(pte))
-               return 0;
-       set_pte_at(vma->vm_mm, addr, ptep, pte_mkold(pte));
-       return 1;
-#endif
-}
-
-static inline pte_t
-ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-{
-#ifdef CONFIG_SMP
-       return __pte(xchg((long *) ptep, 0));
-#else
-       pte_t pte = *ptep;
-       pte_clear(mm, addr, ptep);
-       return pte;
-#endif
-}
-
-static inline void
-ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-{
-#ifdef CONFIG_SMP
-       unsigned long new, old;
-
-       do {
-               old = pte_val(*ptep);
-               new = pte_val(pte_wrprotect(__pte (old)));
-       } while (cmpxchg((unsigned long *) ptep, old, new) != old);
-#else
-       pte_t old_pte = *ptep;
-       set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
-#endif
-}
-
-static inline int
-pte_same (pte_t a, pte_t b)
-{
-       return pte_val(a) == pte_val(b);
-}
-
-#define update_mmu_cache(vma, address, pte) do { } while (0)
-
-extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-extern void paging_init (void);
-
-/*
- * Note: The macros below rely on the fact that MAX_SWAPFILES_SHIFT <= number of
- *      bits in the swap-type field of the swap pte.  It would be nice to
- *      enforce that, but we can't easily include <linux/swap.h> here.
- *      (Of course, better still would be to define MAX_SWAPFILES_SHIFT here...).
- *
- * Format of swap pte:
- *     bit   0   : present bit (must be zero)
- *     bit   1   : _PAGE_FILE (must be zero)
- *     bits  2- 8: swap-type
- *     bits  9-62: swap offset
- *     bit  63   : _PAGE_PROTNONE bit
- *
- * Format of file pte:
- *     bit   0   : present bit (must be zero)
- *     bit   1   : _PAGE_FILE (must be one)
- *     bits  2-62: file_offset/PAGE_SIZE
- *     bit  63   : _PAGE_PROTNONE bit
- */
-#define __swp_type(entry)              (((entry).val >> 2) & 0x7f)
-#define __swp_offset(entry)            (((entry).val << 1) >> 10)
-#define __swp_entry(type,offset)       ((swp_entry_t) { ((type) << 2) | ((long) (offset) << 9) })
-#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
-
-#define PTE_FILE_MAX_BITS              61
-#define pte_to_pgoff(pte)              ((pte_val(pte) << 1) >> 3)
-#define pgoff_to_pte(off)              ((pte_t) { ((off) << 2) | _PAGE_FILE })
-
-#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)                \
-               remap_pfn_range(vma, vaddr, pfn, size, prot)
-
-/*
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
-extern struct page *zero_page_memmap_ptr;
-#define ZERO_PAGE(vaddr) (zero_page_memmap_ptr)
-
-/* We provide our own get_unmapped_area to cope with VA holes for userland */
-#define HAVE_ARCH_UNMAPPED_AREA
-
-#ifdef CONFIG_HUGETLB_PAGE
-#define HUGETLB_PGDIR_SHIFT    (HPAGE_SHIFT + 2*(PAGE_SHIFT-3))
-#define HUGETLB_PGDIR_SIZE     (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT)
-#define HUGETLB_PGDIR_MASK     (~(HUGETLB_PGDIR_SIZE-1))
-#endif
-
-
-#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-/*
- * Update PTEP with ENTRY, which is guaranteed to be a less
- * restrictive PTE.  That is, ENTRY may have the ACCESSED, DIRTY, and
- * WRITABLE bits turned on, when the value at PTEP did not.  The
- * WRITABLE bit may only be turned if SAFELY_WRITABLE is TRUE.
- *
- * SAFELY_WRITABLE is TRUE if we can update the value at PTEP without
- * having to worry about races.  On SMP machines, there are only two
- * cases where this is true:
- *
- *     (1) *PTEP has the PRESENT bit turned OFF
- *     (2) ENTRY has the DIRTY bit turned ON
- *
- * On ia64, we could implement this routine with a cmpxchg()-loop
- * which ORs in the _PAGE_A/_PAGE_D bit if they're set in ENTRY.
- * However, like on x86, we can get a more streamlined version by
- * observing that it is OK to drop ACCESSED bit updates when
- * SAFELY_WRITABLE is FALSE.  Besides being rare, all that would do is
- * result in an extra Access-bit fault, which would then turn on the
- * ACCESSED bit in the low-level fault handler (iaccess_bit or
- * daccess_bit in ivt.S).
- */
-#ifdef CONFIG_SMP
-# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
-({                                                                     \
-       int __changed = !pte_same(*(__ptep), __entry);                  \
-       if (__changed && __safely_writable) {                           \
-               set_pte(__ptep, __entry);                               \
-               flush_tlb_page(__vma, __addr);                          \
-       }                                                               \
-       __changed;                                                      \
-})
-#else
-# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
-({                                                                     \
-       int __changed = !pte_same(*(__ptep), __entry);                  \
-       if (__changed) {                                                \
-               set_pte_at((__vma)->vm_mm, (__addr), __ptep, __entry);  \
-               flush_tlb_page(__vma, __addr);                          \
-       }                                                               \
-       __changed;                                                      \
-})
-#endif
-
-#  ifdef CONFIG_VIRTUAL_MEM_MAP
-  /* arch mem_map init routine is needed due to holes in a virtual mem_map */
-#   define __HAVE_ARCH_MEMMAP_INIT
-    extern void memmap_init (unsigned long size, int nid, unsigned long zone,
-                            unsigned long start_pfn);
-#  endif /* CONFIG_VIRTUAL_MEM_MAP */
-# endif /* !__ASSEMBLY__ */
-
-/*
- * Identity-mapped regions use a large page size.  We'll call such large pages
- * "granules".  If you can think of a better name that's unambiguous, let me
- * know...
- */
-#if defined(CONFIG_IA64_GRANULE_64MB)
-# define IA64_GRANULE_SHIFT    _PAGE_SIZE_64M
-#elif defined(CONFIG_IA64_GRANULE_16MB)
-# define IA64_GRANULE_SHIFT    _PAGE_SIZE_16M
-#endif
-#define IA64_GRANULE_SIZE      (1 << IA64_GRANULE_SHIFT)
-/*
- * log2() of the page size we use to map the kernel image (IA64_TR_KERNEL):
- */
-#define KERNEL_TR_PAGE_SHIFT   _PAGE_SIZE_64M
-#define KERNEL_TR_PAGE_SIZE    (1 << KERNEL_TR_PAGE_SHIFT)
-
-/*
- * No page table caches to initialise
- */
-#define pgtable_cache_init()   do { } while (0)
-
-/* These tell get_user_pages() that the first gate page is accessible from user-level.  */
-#define FIXADDR_USER_START     GATE_ADDR
-#ifdef HAVE_BUGGY_SEGREL
-# define FIXADDR_USER_END      (GATE_ADDR + 2*PAGE_SIZE)
-#else
-# define FIXADDR_USER_END      (GATE_ADDR + 2*PERCPU_PAGE_SIZE)
-#endif
-
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-#define __HAVE_ARCH_PTE_SAME
-#define __HAVE_ARCH_PGD_OFFSET_GATE
-
-
-#ifndef CONFIG_PGTABLE_4
-#include <asm-generic/pgtable-nopud.h>
-#endif
-#include <asm-generic/pgtable.h>
-
-#endif /* _ASM_IA64_PGTABLE_H */
diff --git a/include/asm-ia64/poll.h b/include/asm-ia64/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-ia64/posix_types.h b/include/asm-ia64/posix_types.h
deleted file mode 100644 (file)
index 1788556..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef _ASM_IA64_POSIX_TYPES_H
-#define _ASM_IA64_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.
- *
- * Based on <asm-alpha/posix_types.h>.
- *
- * Modified 1998-2000, 2003
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-typedef unsigned long  __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_timer_t;
-typedef int            __kernel_clockid_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 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 /* _ASM_IA64_POSIX_TYPES_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
deleted file mode 100644 (file)
index f88fa05..0000000
+++ /dev/null
@@ -1,771 +0,0 @@
-#ifndef _ASM_IA64_PROCESSOR_H
-#define _ASM_IA64_PROCESSOR_H
-
-/*
- * Copyright (C) 1998-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Stephane Eranian <eranian@hpl.hp.com>
- * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
- *
- * 11/24/98    S.Eranian       added ia64_set_iva()
- * 12/03/99    D. Mosberger    implement thread_saved_pc() via kernel unwind API
- * 06/16/00    A. Mallick      added csd/ssd/tssd for ia32 support
- */
-
-
-#include <asm/intrinsics.h>
-#include <asm/kregs.h>
-#include <asm/ptrace.h>
-#include <asm/ustack.h>
-
-#define IA64_NUM_PHYS_STACK_REG        96
-#define IA64_NUM_DBG_REGS      8
-
-#define DEFAULT_MAP_BASE       __IA64_UL_CONST(0x2000000000000000)
-#define DEFAULT_TASK_SIZE      __IA64_UL_CONST(0xa000000000000000)
-
-/*
- * TASK_SIZE really is a mis-named.  It really is the maximum user
- * space address (plus one).  On IA-64, there are five regions of 2TB
- * each (assuming 8KB page size), for a total of 8TB of user virtual
- * address space.
- */
-#define TASK_SIZE_OF(tsk)      ((tsk)->thread.task_size)
-#define TASK_SIZE              TASK_SIZE_OF(current)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE     (current->thread.map_base)
-
-#define IA64_THREAD_FPH_VALID  (__IA64_UL(1) << 0)     /* floating-point high state valid? */
-#define IA64_THREAD_DBG_VALID  (__IA64_UL(1) << 1)     /* debug registers valid? */
-#define IA64_THREAD_PM_VALID   (__IA64_UL(1) << 2)     /* performance registers valid? */
-#define IA64_THREAD_UAC_NOPRINT        (__IA64_UL(1) << 3)     /* don't log unaligned accesses */
-#define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4)     /* generate SIGBUS on unaligned acc. */
-#define IA64_THREAD_MIGRATION  (__IA64_UL(1) << 5)     /* require migration
-                                                          sync at ctx sw */
-#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6)  /* don't log any fpswa faults */
-#define IA64_THREAD_FPEMU_SIGFPE  (__IA64_UL(1) << 7)  /* send a SIGFPE for fpswa faults */
-
-#define IA64_THREAD_UAC_SHIFT  3
-#define IA64_THREAD_UAC_MASK   (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
-#define IA64_THREAD_FPEMU_SHIFT        6
-#define IA64_THREAD_FPEMU_MASK (IA64_THREAD_FPEMU_NOPRINT | IA64_THREAD_FPEMU_SIGFPE)
-
-
-/*
- * This shift should be large enough to be able to represent 1000000000/itc_freq with good
- * accuracy while being small enough to fit 10*1000000000<<IA64_NSEC_PER_CYC_SHIFT in 64 bits
- * (this will give enough slack to represent 10 seconds worth of time as a scaled number).
- */
-#define IA64_NSEC_PER_CYC_SHIFT        30
-
-#ifndef __ASSEMBLY__
-
-#include <linux/cache.h>
-#include <linux/compiler.h>
-#include <linux/threads.h>
-#include <linux/types.h>
-
-#include <asm/fpu.h>
-#include <asm/page.h>
-#include <asm/percpu.h>
-#include <asm/rse.h>
-#include <asm/unwind.h>
-#include <asm/atomic.h>
-#ifdef CONFIG_NUMA
-#include <asm/nodedata.h>
-#endif
-
-/* like above but expressed as bitfields for more efficient access: */
-struct ia64_psr {
-       __u64 reserved0 : 1;
-       __u64 be : 1;
-       __u64 up : 1;
-       __u64 ac : 1;
-       __u64 mfl : 1;
-       __u64 mfh : 1;
-       __u64 reserved1 : 7;
-       __u64 ic : 1;
-       __u64 i : 1;
-       __u64 pk : 1;
-       __u64 reserved2 : 1;
-       __u64 dt : 1;
-       __u64 dfl : 1;
-       __u64 dfh : 1;
-       __u64 sp : 1;
-       __u64 pp : 1;
-       __u64 di : 1;
-       __u64 si : 1;
-       __u64 db : 1;
-       __u64 lp : 1;
-       __u64 tb : 1;
-       __u64 rt : 1;
-       __u64 reserved3 : 4;
-       __u64 cpl : 2;
-       __u64 is : 1;
-       __u64 mc : 1;
-       __u64 it : 1;
-       __u64 id : 1;
-       __u64 da : 1;
-       __u64 dd : 1;
-       __u64 ss : 1;
-       __u64 ri : 2;
-       __u64 ed : 1;
-       __u64 bn : 1;
-       __u64 reserved4 : 19;
-};
-
-union ia64_isr {
-       __u64  val;
-       struct {
-               __u64 code : 16;
-               __u64 vector : 8;
-               __u64 reserved1 : 8;
-               __u64 x : 1;
-               __u64 w : 1;
-               __u64 r : 1;
-               __u64 na : 1;
-               __u64 sp : 1;
-               __u64 rs : 1;
-               __u64 ir : 1;
-               __u64 ni : 1;
-               __u64 so : 1;
-               __u64 ei : 2;
-               __u64 ed : 1;
-               __u64 reserved2 : 20;
-       };
-};
-
-union ia64_lid {
-       __u64 val;
-       struct {
-               __u64  rv  : 16;
-               __u64  eid : 8;
-               __u64  id  : 8;
-               __u64  ig  : 32;
-       };
-};
-
-union ia64_tpr {
-       __u64 val;
-       struct {
-               __u64 ig0 : 4;
-               __u64 mic : 4;
-               __u64 rsv : 8;
-               __u64 mmi : 1;
-               __u64 ig1 : 47;
-       };
-};
-
-union ia64_itir {
-       __u64 val;
-       struct {
-               __u64 rv3  :  2; /* 0-1 */
-               __u64 ps   :  6; /* 2-7 */
-               __u64 key  : 24; /* 8-31 */
-               __u64 rv4  : 32; /* 32-63 */
-       };
-};
-
-union  ia64_rr {
-       __u64 val;
-       struct {
-               __u64  ve       :  1;  /* enable hw walker */
-               __u64  reserved0:  1;  /* reserved */
-               __u64  ps       :  6;  /* log page size */
-               __u64  rid      : 24;  /* region id */
-               __u64  reserved1: 32;  /* reserved */
-       };
-};
-
-/*
- * CPU type, hardware bug flags, and per-CPU state.  Frequently used
- * state comes earlier:
- */
-struct cpuinfo_ia64 {
-       __u32 softirq_pending;
-       __u64 itm_delta;        /* # of clock cycles between clock ticks */
-       __u64 itm_next;         /* interval timer mask value to use for next clock tick */
-       __u64 nsec_per_cyc;     /* (1000000000<<IA64_NSEC_PER_CYC_SHIFT)/itc_freq */
-       __u64 unimpl_va_mask;   /* mask of unimplemented virtual address bits (from PAL) */
-       __u64 unimpl_pa_mask;   /* mask of unimplemented physical address bits (from PAL) */
-       __u64 itc_freq;         /* frequency of ITC counter */
-       __u64 proc_freq;        /* frequency of processor */
-       __u64 cyc_per_usec;     /* itc_freq/1000000 */
-       __u64 ptce_base;
-       __u32 ptce_count[2];
-       __u32 ptce_stride[2];
-       struct task_struct *ksoftirqd;  /* kernel softirq daemon for this CPU */
-
-#ifdef CONFIG_SMP
-       __u64 loops_per_jiffy;
-       int cpu;
-       __u32 socket_id;        /* physical processor socket id */
-       __u16 core_id;          /* core id */
-       __u16 thread_id;        /* thread id */
-       __u16 num_log;          /* Total number of logical processors on
-                                * this socket that were successfully booted */
-       __u8  cores_per_socket; /* Cores per processor socket */
-       __u8  threads_per_core; /* Threads per core */
-#endif
-
-       /* CPUID-derived information: */
-       __u64 ppn;
-       __u64 features;
-       __u8 number;
-       __u8 revision;
-       __u8 model;
-       __u8 family;
-       __u8 archrev;
-       char vendor[16];
-       char *model_name;
-
-#ifdef CONFIG_NUMA
-       struct ia64_node_data *node_data;
-#endif
-};
-
-DECLARE_PER_CPU(struct cpuinfo_ia64, cpu_info);
-
-/*
- * The "local" data variable.  It refers to the per-CPU data of the currently executing
- * CPU, much like "current" points to the per-task data of the currently executing task.
- * Do not use the address of local_cpu_data, since it will be different from
- * cpu_data(smp_processor_id())!
- */
-#define local_cpu_data         (&__ia64_per_cpu_var(cpu_info))
-#define cpu_data(cpu)          (&per_cpu(cpu_info, cpu))
-
-extern void print_cpu_info (struct cpuinfo_ia64 *);
-
-typedef struct {
-       unsigned long seg;
-} mm_segment_t;
-
-#define SET_UNALIGN_CTL(task,value)                                                            \
-({                                                                                             \
-       (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_UAC_MASK)                  \
-                               | (((value) << IA64_THREAD_UAC_SHIFT) & IA64_THREAD_UAC_MASK)); \
-       0;                                                                                      \
-})
-#define GET_UNALIGN_CTL(task,addr)                                                             \
-({                                                                                             \
-       put_user(((task)->thread.flags & IA64_THREAD_UAC_MASK) >> IA64_THREAD_UAC_SHIFT,        \
-                (int __user *) (addr));                                                        \
-})
-
-#define SET_FPEMU_CTL(task,value)                                                              \
-({                                                                                             \
-       (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_FPEMU_MASK)                \
-                         | (((value) << IA64_THREAD_FPEMU_SHIFT) & IA64_THREAD_FPEMU_MASK));   \
-       0;                                                                                      \
-})
-#define GET_FPEMU_CTL(task,addr)                                                               \
-({                                                                                             \
-       put_user(((task)->thread.flags & IA64_THREAD_FPEMU_MASK) >> IA64_THREAD_FPEMU_SHIFT,    \
-                (int __user *) (addr));                                                        \
-})
-
-#ifdef CONFIG_IA32_SUPPORT
-struct desc_struct {
-       unsigned int a, b;
-};
-
-#define desc_empty(desc)               (!((desc)->a | (desc)->b))
-#define desc_equal(desc1, desc2)       (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
-
-#define GDT_ENTRY_TLS_ENTRIES  3
-#define GDT_ENTRY_TLS_MIN      6
-#define GDT_ENTRY_TLS_MAX      (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
-
-#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
-
-struct ia64_partial_page_list;
-#endif
-
-struct thread_struct {
-       __u32 flags;                    /* various thread flags (see IA64_THREAD_*) */
-       /* writing on_ustack is performance-critical, so it's worth spending 8 bits on it... */
-       __u8 on_ustack;                 /* executing on user-stacks? */
-       __u8 pad[3];
-       __u64 ksp;                      /* kernel stack pointer */
-       __u64 map_base;                 /* base address for get_unmapped_area() */
-       __u64 task_size;                /* limit for task size */
-       __u64 rbs_bot;                  /* the base address for the RBS */
-       int last_fph_cpu;               /* CPU that may hold the contents of f32-f127 */
-
-#ifdef CONFIG_IA32_SUPPORT
-       __u64 eflag;                    /* IA32 EFLAGS reg */
-       __u64 fsr;                      /* IA32 floating pt status reg */
-       __u64 fcr;                      /* IA32 floating pt control reg */
-       __u64 fir;                      /* IA32 fp except. instr. reg */
-       __u64 fdr;                      /* IA32 fp except. data reg */
-       __u64 old_k1;                   /* old value of ar.k1 */
-       __u64 old_iob;                  /* old IOBase value */
-       struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */
-        /* cached TLS descriptors. */
-       struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
-
-# define INIT_THREAD_IA32      .eflag =        0,                      \
-                               .fsr =          0,                      \
-                               .fcr =          0x17800000037fULL,      \
-                               .fir =          0,                      \
-                               .fdr =          0,                      \
-                               .old_k1 =       0,                      \
-                               .old_iob =      0,                      \
-                               .ppl =          NULL,
-#else
-# define INIT_THREAD_IA32
-#endif /* CONFIG_IA32_SUPPORT */
-#ifdef CONFIG_PERFMON
-       void *pfm_context;                   /* pointer to detailed PMU context */
-       unsigned long pfm_needs_checking;    /* when >0, pending perfmon work on kernel exit */
-# define INIT_THREAD_PM                .pfm_context =          NULL,     \
-                               .pfm_needs_checking =   0UL,
-#else
-# define INIT_THREAD_PM
-#endif
-       __u64 dbr[IA64_NUM_DBG_REGS];
-       __u64 ibr[IA64_NUM_DBG_REGS];
-       struct ia64_fpreg fph[96];      /* saved/loaded on demand */
-};
-
-#define INIT_THREAD {                                          \
-       .flags =        0,                                      \
-       .on_ustack =    0,                                      \
-       .ksp =          0,                                      \
-       .map_base =     DEFAULT_MAP_BASE,                       \
-       .rbs_bot =      STACK_TOP - DEFAULT_USER_STACK_SIZE,    \
-       .task_size =    DEFAULT_TASK_SIZE,                      \
-       .last_fph_cpu =  -1,                                    \
-       INIT_THREAD_IA32                                        \
-       INIT_THREAD_PM                                          \
-       .dbr =          {0, },                                  \
-       .ibr =          {0, },                                  \
-       .fph =          {{{{0}}}, }                             \
-}
-
-#define start_thread(regs,new_ip,new_sp) do {                                                  \
-       set_fs(USER_DS);                                                                        \
-       regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL))                \
-                        & ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS));              \
-       regs->cr_iip = new_ip;                                                                  \
-       regs->ar_rsc = 0xf;             /* eager mode, privilege level 3 */                     \
-       regs->ar_rnat = 0;                                                                      \
-       regs->ar_bspstore = current->thread.rbs_bot;                                            \
-       regs->ar_fpsr = FPSR_DEFAULT;                                                           \
-       regs->loadrs = 0;                                                                       \
-       regs->r8 = get_dumpable(current->mm);   /* set "don't zap registers" flag */            \
-       regs->r12 = new_sp - 16;        /* allocate 16 byte scratch area */                     \
-       if (unlikely(!get_dumpable(current->mm))) {                                                     \
-               /*                                                                              \
-                * Zap scratch regs to avoid leaking bits between processes with different      \
-                * uid/privileges.                                                              \
-                */                                                                             \
-               regs->ar_pfs = 0; regs->b0 = 0; regs->pr = 0;                                   \
-               regs->r1 = 0; regs->r9  = 0; regs->r11 = 0; regs->r13 = 0; regs->r15 = 0;       \
-       }                                                                                       \
-} while (0)
-
-/* Forward declarations, a strange C thing... */
-struct mm_struct;
-struct task_struct;
-
-/*
- * Free all resources held by a thread. This is called after the
- * parent of DEAD_TASK has collected the exit status of the task via
- * wait().
- */
-#define release_thread(dead_task)
-
-/* Prepare to copy thread state - unlazy all lazy status */
-#define prepare_to_copy(tsk)   do { } while (0)
-
-/*
- * This is the mechanism for creating a new kernel thread.
- *
- * NOTE 1: Only a kernel-only process (ie the swapper or direct
- * descendants who haven't done an "execve()") should use this: it
- * will work within a system call from a "real" process, but the
- * process memory space will not be free'd until both the parent and
- * the child have exited.
- *
- * NOTE 2: This MUST NOT be an inlined function.  Otherwise, we get
- * into trouble in init/main.c when the child thread returns to
- * do_basic_setup() and the timing is such that free_initmem() has
- * been called already.
- */
-extern pid_t kernel_thread (int (*fn)(void *), void *arg, unsigned long flags);
-
-/* Get wait channel for task P.  */
-extern unsigned long get_wchan (struct task_struct *p);
-
-/* Return instruction pointer of blocked task TSK.  */
-#define KSTK_EIP(tsk)                                  \
-  ({                                                   \
-       struct pt_regs *_regs = task_pt_regs(tsk);      \
-       _regs->cr_iip + ia64_psr(_regs)->ri;            \
-  })
-
-/* Return stack pointer of blocked task TSK.  */
-#define KSTK_ESP(tsk)  ((tsk)->thread.ksp)
-
-extern void ia64_getreg_unknown_kr (void);
-extern void ia64_setreg_unknown_kr (void);
-
-#define ia64_get_kr(regnum)                                    \
-({                                                             \
-       unsigned long r = 0;                                    \
-                                                               \
-       switch (regnum) {                                       \
-           case 0: r = ia64_getreg(_IA64_REG_AR_KR0); break;   \
-           case 1: r = ia64_getreg(_IA64_REG_AR_KR1); break;   \
-           case 2: r = ia64_getreg(_IA64_REG_AR_KR2); break;   \
-           case 3: r = ia64_getreg(_IA64_REG_AR_KR3); break;   \
-           case 4: r = ia64_getreg(_IA64_REG_AR_KR4); break;   \
-           case 5: r = ia64_getreg(_IA64_REG_AR_KR5); break;   \
-           case 6: r = ia64_getreg(_IA64_REG_AR_KR6); break;   \
-           case 7: r = ia64_getreg(_IA64_REG_AR_KR7); break;   \
-           default: ia64_getreg_unknown_kr(); break;           \
-       }                                                       \
-       r;                                                      \
-})
-
-#define ia64_set_kr(regnum, r)                                         \
-({                                                             \
-       switch (regnum) {                                       \
-           case 0: ia64_setreg(_IA64_REG_AR_KR0, r); break;    \
-           case 1: ia64_setreg(_IA64_REG_AR_KR1, r); break;    \
-           case 2: ia64_setreg(_IA64_REG_AR_KR2, r); break;    \
-           case 3: ia64_setreg(_IA64_REG_AR_KR3, r); break;    \
-           case 4: ia64_setreg(_IA64_REG_AR_KR4, r); break;    \
-           case 5: ia64_setreg(_IA64_REG_AR_KR5, r); break;    \
-           case 6: ia64_setreg(_IA64_REG_AR_KR6, r); break;    \
-           case 7: ia64_setreg(_IA64_REG_AR_KR7, r); break;    \
-           default: ia64_setreg_unknown_kr(); break;           \
-       }                                                       \
-})
-
-/*
- * The following three macros can't be inline functions because we don't have struct
- * task_struct at this point.
- */
-
-/*
- * Return TRUE if task T owns the fph partition of the CPU we're running on.
- * Must be called from code that has preemption disabled.
- */
-#define ia64_is_local_fpu_owner(t)                                                             \
-({                                                                                             \
-       struct task_struct *__ia64_islfo_task = (t);                                            \
-       (__ia64_islfo_task->thread.last_fph_cpu == smp_processor_id()                           \
-        && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER));        \
-})
-
-/*
- * Mark task T as owning the fph partition of the CPU we're running on.
- * Must be called from code that has preemption disabled.
- */
-#define ia64_set_local_fpu_owner(t) do {                                               \
-       struct task_struct *__ia64_slfo_task = (t);                                     \
-       __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id();                     \
-       ia64_set_kr(IA64_KR_FPU_OWNER, (unsigned long) __ia64_slfo_task);               \
-} while (0)
-
-/* Mark the fph partition of task T as being invalid on all CPUs.  */
-#define ia64_drop_fpu(t)       ((t)->thread.last_fph_cpu = -1)
-
-extern void __ia64_init_fpu (void);
-extern void __ia64_save_fpu (struct ia64_fpreg *fph);
-extern void __ia64_load_fpu (struct ia64_fpreg *fph);
-extern void ia64_save_debug_regs (unsigned long *save_area);
-extern void ia64_load_debug_regs (unsigned long *save_area);
-
-#ifdef CONFIG_IA32_SUPPORT
-extern void ia32_save_state (struct task_struct *task);
-extern void ia32_load_state (struct task_struct *task);
-#endif
-
-#define ia64_fph_enable()      do { ia64_rsm(IA64_PSR_DFH); ia64_srlz_d(); } while (0)
-#define ia64_fph_disable()     do { ia64_ssm(IA64_PSR_DFH); ia64_srlz_d(); } while (0)
-
-/* load fp 0.0 into fph */
-static inline void
-ia64_init_fpu (void) {
-       ia64_fph_enable();
-       __ia64_init_fpu();
-       ia64_fph_disable();
-}
-
-/* save f32-f127 at FPH */
-static inline void
-ia64_save_fpu (struct ia64_fpreg *fph) {
-       ia64_fph_enable();
-       __ia64_save_fpu(fph);
-       ia64_fph_disable();
-}
-
-/* load f32-f127 from FPH */
-static inline void
-ia64_load_fpu (struct ia64_fpreg *fph) {
-       ia64_fph_enable();
-       __ia64_load_fpu(fph);
-       ia64_fph_disable();
-}
-
-static inline __u64
-ia64_clear_ic (void)
-{
-       __u64 psr;
-       psr = ia64_getreg(_IA64_REG_PSR);
-       ia64_stop();
-       ia64_rsm(IA64_PSR_I | IA64_PSR_IC);
-       ia64_srlz_i();
-       return psr;
-}
-
-/*
- * Restore the psr.
- */
-static inline void
-ia64_set_psr (__u64 psr)
-{
-       ia64_stop();
-       ia64_setreg(_IA64_REG_PSR_L, psr);
-       ia64_srlz_i();
-}
-
-/*
- * Insert a translation into an instruction and/or data translation
- * register.
- */
-static inline void
-ia64_itr (__u64 target_mask, __u64 tr_num,
-         __u64 vmaddr, __u64 pte,
-         __u64 log_page_size)
-{
-       ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
-       ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
-       ia64_stop();
-       if (target_mask & 0x1)
-               ia64_itri(tr_num, pte);
-       if (target_mask & 0x2)
-               ia64_itrd(tr_num, pte);
-}
-
-/*
- * Insert a translation into the instruction and/or data translation
- * cache.
- */
-static inline void
-ia64_itc (__u64 target_mask, __u64 vmaddr, __u64 pte,
-         __u64 log_page_size)
-{
-       ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
-       ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
-       ia64_stop();
-       /* as per EAS2.6, itc must be the last instruction in an instruction group */
-       if (target_mask & 0x1)
-               ia64_itci(pte);
-       if (target_mask & 0x2)
-               ia64_itcd(pte);
-}
-
-/*
- * Purge a range of addresses from instruction and/or data translation
- * register(s).
- */
-static inline void
-ia64_ptr (__u64 target_mask, __u64 vmaddr, __u64 log_size)
-{
-       if (target_mask & 0x1)
-               ia64_ptri(vmaddr, (log_size << 2));
-       if (target_mask & 0x2)
-               ia64_ptrd(vmaddr, (log_size << 2));
-}
-
-/* Set the interrupt vector address.  The address must be suitably aligned (32KB).  */
-static inline void
-ia64_set_iva (void *ivt_addr)
-{
-       ia64_setreg(_IA64_REG_CR_IVA, (__u64) ivt_addr);
-       ia64_srlz_i();
-}
-
-/* Set the page table address and control bits.  */
-static inline void
-ia64_set_pta (__u64 pta)
-{
-       /* Note: srlz.i implies srlz.d */
-       ia64_setreg(_IA64_REG_CR_PTA, pta);
-       ia64_srlz_i();
-}
-
-static inline void
-ia64_eoi (void)
-{
-       ia64_setreg(_IA64_REG_CR_EOI, 0);
-       ia64_srlz_d();
-}
-
-#define cpu_relax()    ia64_hint(ia64_hint_pause)
-
-static inline int
-ia64_get_irr(unsigned int vector)
-{
-       unsigned int reg = vector / 64;
-       unsigned int bit = vector % 64;
-       u64 irr;
-
-       switch (reg) {
-       case 0: irr = ia64_getreg(_IA64_REG_CR_IRR0); break;
-       case 1: irr = ia64_getreg(_IA64_REG_CR_IRR1); break;
-       case 2: irr = ia64_getreg(_IA64_REG_CR_IRR2); break;
-       case 3: irr = ia64_getreg(_IA64_REG_CR_IRR3); break;
-       }
-
-       return test_bit(bit, &irr);
-}
-
-static inline void
-ia64_set_lrr0 (unsigned long val)
-{
-       ia64_setreg(_IA64_REG_CR_LRR0, val);
-       ia64_srlz_d();
-}
-
-static inline void
-ia64_set_lrr1 (unsigned long val)
-{
-       ia64_setreg(_IA64_REG_CR_LRR1, val);
-       ia64_srlz_d();
-}
-
-
-/*
- * Given the address to which a spill occurred, return the unat bit
- * number that corresponds to this address.
- */
-static inline __u64
-ia64_unat_pos (void *spill_addr)
-{
-       return ((__u64) spill_addr >> 3) & 0x3f;
-}
-
-/*
- * Set the NaT bit of an integer register which was spilled at address
- * SPILL_ADDR.  UNAT is the mask to be updated.
- */
-static inline void
-ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat)
-{
-       __u64 bit = ia64_unat_pos(spill_addr);
-       __u64 mask = 1UL << bit;
-
-       *unat = (*unat & ~mask) | (nat << bit);
-}
-
-/*
- * Return saved PC of a blocked thread.
- * Note that the only way T can block is through a call to schedule() -> switch_to().
- */
-static inline unsigned long
-thread_saved_pc (struct task_struct *t)
-{
-       struct unw_frame_info info;
-       unsigned long ip;
-
-       unw_init_from_blocked_task(&info, t);
-       if (unw_unwind(&info) < 0)
-               return 0;
-       unw_get_ip(&info, &ip);
-       return ip;
-}
-
-/*
- * Get the current instruction/program counter value.
- */
-#define current_text_addr() \
-       ({ void *_pc; _pc = (void *)ia64_getreg(_IA64_REG_IP); _pc; })
-
-static inline __u64
-ia64_get_ivr (void)
-{
-       __u64 r;
-       ia64_srlz_d();
-       r = ia64_getreg(_IA64_REG_CR_IVR);
-       ia64_srlz_d();
-       return r;
-}
-
-static inline void
-ia64_set_dbr (__u64 regnum, __u64 value)
-{
-       __ia64_set_dbr(regnum, value);
-#ifdef CONFIG_ITANIUM
-       ia64_srlz_d();
-#endif
-}
-
-static inline __u64
-ia64_get_dbr (__u64 regnum)
-{
-       __u64 retval;
-
-       retval = __ia64_get_dbr(regnum);
-#ifdef CONFIG_ITANIUM
-       ia64_srlz_d();
-#endif
-       return retval;
-}
-
-static inline __u64
-ia64_rotr (__u64 w, __u64 n)
-{
-       return (w >> n) | (w << (64 - n));
-}
-
-#define ia64_rotl(w,n) ia64_rotr((w), (64) - (n))
-
-/*
- * Take a mapped kernel address and return the equivalent address
- * in the region 7 identity mapped virtual area.
- */
-static inline void *
-ia64_imva (void *addr)
-{
-       void *result;
-       result = (void *) ia64_tpa(addr);
-       return __va(result);
-}
-
-#define ARCH_HAS_PREFETCH
-#define ARCH_HAS_PREFETCHW
-#define ARCH_HAS_SPINLOCK_PREFETCH
-#define PREFETCH_STRIDE                        L1_CACHE_BYTES
-
-static inline void
-prefetch (const void *x)
-{
-        ia64_lfetch(ia64_lfhint_none, x);
-}
-
-static inline void
-prefetchw (const void *x)
-{
-       ia64_lfetch_excl(ia64_lfhint_none, x);
-}
-
-#define spin_lock_prefetch(x)  prefetchw(x)
-
-extern unsigned long boot_option_idle_override;
-extern unsigned long idle_halt;
-extern unsigned long idle_nomwait;
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_PROCESSOR_H */
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
deleted file mode 100644 (file)
index 15f8dcf..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-#ifndef _ASM_IA64_PTRACE_H
-#define _ASM_IA64_PTRACE_H
-
-/*
- * Copyright (C) 1998-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Stephane Eranian <eranian@hpl.hp.com>
- * Copyright (C) 2003 Intel Co
- *     Suresh Siddha <suresh.b.siddha@intel.com>
- *     Fenghua Yu <fenghua.yu@intel.com>
- *     Arun Sharma <arun.sharma@intel.com>
- *
- * 12/07/98    S. Eranian      added pt_regs & switch_stack
- * 12/21/98    D. Mosberger    updated to match latest code
- *  6/17/99    D. Mosberger    added second unat member to "struct switch_stack"
- *
- */
-/*
- * When a user process is blocked, its state looks as follows:
- *
- *            +----------------------+ ------- IA64_STK_OFFSET
- *                   |                      |   ^
- *            | struct pt_regs       |  |
- *           |                      |   |
- *            +----------------------+  |
- *           |                      |   |
- *                   |    memory stack      |   |
- *           | (growing downwards)  |   |
- *           //.....................//  |
- *                                      |
- *           //.....................//  |
- *           |                      |   |
- *            +----------------------+  |
- *            | struct switch_stack  |  |
- *           |                      |   |
- *           +----------------------+   |
- *           |                      |   |
- *           //.....................//  |
- *                                      |
- *           //.....................//  |
- *           |                      |   |
- *           |  register stack      |   |
- *           | (growing upwards)    |   |
- *            |                             |   |
- *           +----------------------+   |  --- IA64_RBS_OFFSET
- *            |  struct thread_info  |  |  ^
- *           +----------------------+   |  |
- *           |                      |   |  |
- *            |  struct task_struct  |  |  |
- * current -> |                             |   |  |
- *           +----------------------+ -------
- *
- * Note that ar.ec is not saved explicitly in pt_reg or switch_stack.
- * This is because ar.ec is saved as part of ar.pfs.
- */
-
-
-#include <asm/fpu.h>
-
-#ifdef __KERNEL__
-#ifndef ASM_OFFSETS_C
-#include <asm/asm-offsets.h>
-#endif
-
-/*
- * Base-2 logarithm of number of pages to allocate per task structure
- * (including register backing store and memory stack):
- */
-#if defined(CONFIG_IA64_PAGE_SIZE_4KB)
-# define KERNEL_STACK_SIZE_ORDER               3
-#elif defined(CONFIG_IA64_PAGE_SIZE_8KB)
-# define KERNEL_STACK_SIZE_ORDER               2
-#elif defined(CONFIG_IA64_PAGE_SIZE_16KB)
-# define KERNEL_STACK_SIZE_ORDER               1
-#else
-# define KERNEL_STACK_SIZE_ORDER               0
-#endif
-
-#define IA64_RBS_OFFSET                        ((IA64_TASK_SIZE + IA64_THREAD_INFO_SIZE + 31) & ~31)
-#define IA64_STK_OFFSET                        ((1 << KERNEL_STACK_SIZE_ORDER)*PAGE_SIZE)
-
-#define KERNEL_STACK_SIZE              IA64_STK_OFFSET
-
-#endif /* __KERNEL__ */
-
-#ifndef __ASSEMBLY__
-
-/*
- * This struct defines the way the registers are saved on system
- * calls.
- *
- * We don't save all floating point register because the kernel
- * is compiled to use only a very small subset, so the other are
- * untouched.
- *
- * THIS STRUCTURE MUST BE A MULTIPLE 16-BYTE IN SIZE
- * (because the memory stack pointer MUST ALWAYS be aligned this way)
- *
- */
-struct pt_regs {
-       /* The following registers are saved by SAVE_MIN: */
-       unsigned long b6;               /* scratch */
-       unsigned long b7;               /* scratch */
-
-       unsigned long ar_csd;           /* used by cmp8xchg16 (scratch) */
-       unsigned long ar_ssd;           /* reserved for future use (scratch) */
-
-       unsigned long r8;               /* scratch (return value register 0) */
-       unsigned long r9;               /* scratch (return value register 1) */
-       unsigned long r10;              /* scratch (return value register 2) */
-       unsigned long r11;              /* scratch (return value register 3) */
-
-       unsigned long cr_ipsr;          /* interrupted task's psr */
-       unsigned long cr_iip;           /* interrupted task's instruction pointer */
-       /*
-        * interrupted task's function state; if bit 63 is cleared, it
-        * contains syscall's ar.pfs.pfm:
-        */
-       unsigned long cr_ifs;
-
-       unsigned long ar_unat;          /* interrupted task's NaT register (preserved) */
-       unsigned long ar_pfs;           /* prev function state  */
-       unsigned long ar_rsc;           /* RSE configuration */
-       /* The following two are valid only if cr_ipsr.cpl > 0 || ti->flags & _TIF_MCA_INIT */
-       unsigned long ar_rnat;          /* RSE NaT */
-       unsigned long ar_bspstore;      /* RSE bspstore */
-
-       unsigned long pr;               /* 64 predicate registers (1 bit each) */
-       unsigned long b0;               /* return pointer (bp) */
-       unsigned long loadrs;           /* size of dirty partition << 16 */
-
-       unsigned long r1;               /* the gp pointer */
-       unsigned long r12;              /* interrupted task's memory stack pointer */
-       unsigned long r13;              /* thread pointer */
-
-       unsigned long ar_fpsr;          /* floating point status (preserved) */
-       unsigned long r15;              /* scratch */
-
-       /* The remaining registers are NOT saved for system calls.  */
-
-       unsigned long r14;              /* scratch */
-       unsigned long r2;               /* scratch */
-       unsigned long r3;               /* scratch */
-
-       /* The following registers are saved by SAVE_REST: */
-       unsigned long r16;              /* scratch */
-       unsigned long r17;              /* scratch */
-       unsigned long r18;              /* scratch */
-       unsigned long r19;              /* scratch */
-       unsigned long r20;              /* scratch */
-       unsigned long r21;              /* scratch */
-       unsigned long r22;              /* scratch */
-       unsigned long r23;              /* scratch */
-       unsigned long r24;              /* scratch */
-       unsigned long r25;              /* scratch */
-       unsigned long r26;              /* scratch */
-       unsigned long r27;              /* scratch */
-       unsigned long r28;              /* scratch */
-       unsigned long r29;              /* scratch */
-       unsigned long r30;              /* scratch */
-       unsigned long r31;              /* scratch */
-
-       unsigned long ar_ccv;           /* compare/exchange value (scratch) */
-
-       /*
-        * Floating point registers that the kernel considers scratch:
-        */
-       struct ia64_fpreg f6;           /* scratch */
-       struct ia64_fpreg f7;           /* scratch */
-       struct ia64_fpreg f8;           /* scratch */
-       struct ia64_fpreg f9;           /* scratch */
-       struct ia64_fpreg f10;          /* scratch */
-       struct ia64_fpreg f11;          /* scratch */
-};
-
-/*
- * This structure contains the addition registers that need to
- * preserved across a context switch.  This generally consists of
- * "preserved" registers.
- */
-struct switch_stack {
-       unsigned long caller_unat;      /* user NaT collection register (preserved) */
-       unsigned long ar_fpsr;          /* floating-point status register */
-
-       struct ia64_fpreg f2;           /* preserved */
-       struct ia64_fpreg f3;           /* preserved */
-       struct ia64_fpreg f4;           /* preserved */
-       struct ia64_fpreg f5;           /* preserved */
-
-       struct ia64_fpreg f12;          /* scratch, but untouched by kernel */
-       struct ia64_fpreg f13;          /* scratch, but untouched by kernel */
-       struct ia64_fpreg f14;          /* scratch, but untouched by kernel */
-       struct ia64_fpreg f15;          /* scratch, but untouched by kernel */
-       struct ia64_fpreg f16;          /* preserved */
-       struct ia64_fpreg f17;          /* preserved */
-       struct ia64_fpreg f18;          /* preserved */
-       struct ia64_fpreg f19;          /* preserved */
-       struct ia64_fpreg f20;          /* preserved */
-       struct ia64_fpreg f21;          /* preserved */
-       struct ia64_fpreg f22;          /* preserved */
-       struct ia64_fpreg f23;          /* preserved */
-       struct ia64_fpreg f24;          /* preserved */
-       struct ia64_fpreg f25;          /* preserved */
-       struct ia64_fpreg f26;          /* preserved */
-       struct ia64_fpreg f27;          /* preserved */
-       struct ia64_fpreg f28;          /* preserved */
-       struct ia64_fpreg f29;          /* preserved */
-       struct ia64_fpreg f30;          /* preserved */
-       struct ia64_fpreg f31;          /* preserved */
-
-       unsigned long r4;               /* preserved */
-       unsigned long r5;               /* preserved */
-       unsigned long r6;               /* preserved */
-       unsigned long r7;               /* preserved */
-
-       unsigned long b0;               /* so we can force a direct return in copy_thread */
-       unsigned long b1;
-       unsigned long b2;
-       unsigned long b3;
-       unsigned long b4;
-       unsigned long b5;
-
-       unsigned long ar_pfs;           /* previous function state */
-       unsigned long ar_lc;            /* loop counter (preserved) */
-       unsigned long ar_unat;          /* NaT bits for r4-r7 */
-       unsigned long ar_rnat;          /* RSE NaT collection register */
-       unsigned long ar_bspstore;      /* RSE dirty base (preserved) */
-       unsigned long pr;               /* 64 predicate registers (1 bit each) */
-};
-
-#ifdef __KERNEL__
-
-#include <asm/current.h>
-#include <asm/page.h>
-
-/*
- * We use the ia64_psr(regs)->ri to determine which of the three
- * instructions in bundle (16 bytes) took the sample. Generate
- * the canonical representation by adding to instruction pointer.
- */
-# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri)
-
-#define regs_return_value(regs) ((regs)->r8)
-
-/* Conserve space in histogram by encoding slot bits in address
- * bits 2 and 3 rather than bits 0 and 1.
- */
-#define profile_pc(regs)                                               \
-({                                                                     \
-       unsigned long __ip = instruction_pointer(regs);                 \
-       (__ip & ~3UL) + ((__ip & 3UL) << 2);                            \
-})
-
-  /* given a pointer to a task_struct, return the user's pt_regs */
-# define task_pt_regs(t)               (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
-# define ia64_psr(regs)                        ((struct ia64_psr *) &(regs)->cr_ipsr)
-# define user_mode(regs)               (((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0)
-# define user_stack(task,regs) ((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs))
-# define fsys_mode(task,regs)                                  \
-  ({                                                           \
-         struct task_struct *_task = (task);                   \
-         struct pt_regs *_regs = (regs);                       \
-         !user_mode(_regs) && user_stack(_task, _regs);        \
-  })
-
-  /*
-   * System call handlers that, upon successful completion, need to return a negative value
-   * should call force_successful_syscall_return() right before returning.  On architectures
-   * where the syscall convention provides for a separate error flag (e.g., alpha, ia64,
-   * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error
-   * flag will not get set.  On architectures which do not support a separate error flag,
-   * the macro is a no-op and the spurious error condition needs to be filtered out by some
-   * other means (e.g., in user-level, by passing an extra argument to the syscall handler,
-   * or something along those lines).
-   *
-   * On ia64, we can clear the user's pt_regs->r8 to force a successful syscall.
-   */
-# define force_successful_syscall_return()     (task_pt_regs(current)->r8 = 0)
-
-  struct task_struct;                  /* forward decl */
-  struct unw_frame_info;               /* forward decl */
-
-  extern void show_regs (struct pt_regs *);
-  extern void ia64_do_show_stack (struct unw_frame_info *, void *);
-  extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
-                                             unsigned long *);
-  extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long,
-                        unsigned long, long *);
-  extern long ia64_poke (struct task_struct *, struct switch_stack *, unsigned long,
-                        unsigned long, long);
-  extern void ia64_flush_fph (struct task_struct *);
-  extern void ia64_sync_fph (struct task_struct *);
-  extern void ia64_sync_krbs(void);
-  extern long ia64_sync_user_rbs (struct task_struct *, struct switch_stack *,
-                                 unsigned long, unsigned long);
-
-  /* get nat bits for scratch registers such that bit N==1 iff scratch register rN is a NaT */
-  extern unsigned long ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat);
-  /* put nat bits for scratch registers such that scratch register rN is a NaT iff bit N==1 */
-  extern unsigned long ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat);
-
-  extern void ia64_increment_ip (struct pt_regs *pt);
-  extern void ia64_decrement_ip (struct pt_regs *pt);
-
-  extern void ia64_ptrace_stop(void);
-  #define arch_ptrace_stop(code, info) \
-       ia64_ptrace_stop()
-  #define arch_ptrace_stop_needed(code, info) \
-       (!test_thread_flag(TIF_RESTORE_RSE))
-
-  extern void ptrace_attach_sync_user_rbs (struct task_struct *);
-  #define arch_ptrace_attach(child) \
-       ptrace_attach_sync_user_rbs(child)
-
-  #define arch_has_single_step()  (1)
-  extern void user_enable_single_step(struct task_struct *);
-  extern void user_disable_single_step(struct task_struct *);
-
-  #define arch_has_block_step()   (1)
-  extern void user_enable_block_step(struct task_struct *);
-
-#endif /* !__KERNEL__ */
-
-/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
-struct pt_all_user_regs {
-       unsigned long nat;
-       unsigned long cr_iip;
-       unsigned long cfm;
-       unsigned long cr_ipsr;
-       unsigned long pr;
-
-       unsigned long gr[32];
-       unsigned long br[8];
-       unsigned long ar[128];
-       struct ia64_fpreg fr[128];
-};
-
-#endif /* !__ASSEMBLY__ */
-
-/* indices to application-registers array in pt_all_user_regs */
-#define PT_AUR_RSC     16
-#define PT_AUR_BSP     17
-#define PT_AUR_BSPSTORE        18
-#define PT_AUR_RNAT    19
-#define PT_AUR_CCV     32
-#define PT_AUR_UNAT    36
-#define PT_AUR_FPSR    40
-#define PT_AUR_PFS     64
-#define PT_AUR_LC      65
-#define PT_AUR_EC      66
-
-/*
- * The numbers chosen here are somewhat arbitrary but absolutely MUST
- * not overlap with any of the number assigned in <linux/ptrace.h>.
- */
-#define PTRACE_SINGLEBLOCK     12      /* resume execution until next branch */
-#define PTRACE_OLD_GETSIGINFO  13      /* (replaced by PTRACE_GETSIGINFO in <linux/ptrace.h>)  */
-#define PTRACE_OLD_SETSIGINFO  14      /* (replaced by PTRACE_SETSIGINFO in <linux/ptrace.h>)  */
-#define PTRACE_GETREGS         18      /* get all registers (pt_all_user_regs) in one shot */
-#define PTRACE_SETREGS         19      /* set all registers (pt_all_user_regs) in one shot */
-
-#define PTRACE_OLDSETOPTIONS   21
-
-#endif /* _ASM_IA64_PTRACE_H */
diff --git a/include/asm-ia64/ptrace_offsets.h b/include/asm-ia64/ptrace_offsets.h
deleted file mode 100644 (file)
index b712773..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-#ifndef _ASM_IA64_PTRACE_OFFSETS_H
-#define _ASM_IA64_PTRACE_OFFSETS_H
-
-/*
- * Copyright (C) 1999, 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-/*
- * The "uarea" that can be accessed via PEEKUSER and POKEUSER is a
- * virtual structure that would have the following definition:
- *
- *     struct uarea {
- *             struct ia64_fpreg fph[96];              // f32-f127
- *             unsigned long nat_bits;
- *             unsigned long empty1;
- *             struct ia64_fpreg f2;                   // f2-f5
- *                     :
- *             struct ia64_fpreg f5;
- *             struct ia64_fpreg f10;                  // f10-f31
- *                     :
- *             struct ia64_fpreg f31;
- *             unsigned long r4;                       // r4-r7
- *                     :
- *             unsigned long r7;
- *             unsigned long b1;                       // b1-b5
- *                     :
- *             unsigned long b5;
- *             unsigned long ar_ec;
- *             unsigned long ar_lc;
- *             unsigned long empty2[5];
- *             unsigned long cr_ipsr;
- *             unsigned long cr_iip;
- *             unsigned long cfm;
- *             unsigned long ar_unat;
- *             unsigned long ar_pfs;
- *             unsigned long ar_rsc;
- *             unsigned long ar_rnat;
- *             unsigned long ar_bspstore;
- *             unsigned long pr;
- *             unsigned long b6;
- *             unsigned long ar_bsp;
- *             unsigned long r1;
- *             unsigned long r2;
- *             unsigned long r3;
- *             unsigned long r12;
- *             unsigned long r13;
- *             unsigned long r14;
- *             unsigned long r15;
- *             unsigned long r8;
- *             unsigned long r9;
- *             unsigned long r10;
- *             unsigned long r11;
- *             unsigned long r16;
- *                     :
- *             unsigned long r31;
- *             unsigned long ar_ccv;
- *             unsigned long ar_fpsr;
- *             unsigned long b0;
- *             unsigned long b7;
- *             unsigned long f6;
- *             unsigned long f7;
- *             unsigned long f8;
- *             unsigned long f9;
- *             unsigned long ar_csd;
- *             unsigned long ar_ssd;
- *             unsigned long rsvd1[710];
- *             unsigned long dbr[8];
- *             unsigned long rsvd2[504];
- *             unsigned long ibr[8];
- *             unsigned long rsvd3[504];
- *             unsigned long pmd[4];
- *     }
- */
-
-/* fph: */
-#define PT_F32                 0x0000
-#define PT_F33                 0x0010
-#define PT_F34                 0x0020
-#define PT_F35                 0x0030
-#define PT_F36                 0x0040
-#define PT_F37                 0x0050
-#define PT_F38                 0x0060
-#define PT_F39                 0x0070
-#define PT_F40                 0x0080
-#define PT_F41                 0x0090
-#define PT_F42                 0x00a0
-#define PT_F43                 0x00b0
-#define PT_F44                 0x00c0
-#define PT_F45                 0x00d0
-#define PT_F46                 0x00e0
-#define PT_F47                 0x00f0
-#define PT_F48                 0x0100
-#define PT_F49                 0x0110
-#define PT_F50                 0x0120
-#define PT_F51                 0x0130
-#define PT_F52                 0x0140
-#define PT_F53                 0x0150
-#define PT_F54                 0x0160
-#define PT_F55                 0x0170
-#define PT_F56                 0x0180
-#define PT_F57                 0x0190
-#define PT_F58                 0x01a0
-#define PT_F59                 0x01b0
-#define PT_F60                 0x01c0
-#define PT_F61                 0x01d0
-#define PT_F62                 0x01e0
-#define PT_F63                 0x01f0
-#define PT_F64                 0x0200
-#define PT_F65                 0x0210
-#define PT_F66                 0x0220
-#define PT_F67                 0x0230
-#define PT_F68                 0x0240
-#define PT_F69                 0x0250
-#define PT_F70                 0x0260
-#define PT_F71                 0x0270
-#define PT_F72                 0x0280
-#define PT_F73                 0x0290
-#define PT_F74                 0x02a0
-#define PT_F75                 0x02b0
-#define PT_F76                 0x02c0
-#define PT_F77                 0x02d0
-#define PT_F78                 0x02e0
-#define PT_F79                 0x02f0
-#define PT_F80                 0x0300
-#define PT_F81                 0x0310
-#define PT_F82                 0x0320
-#define PT_F83                 0x0330
-#define PT_F84                 0x0340
-#define PT_F85                 0x0350
-#define PT_F86                 0x0360
-#define PT_F87                 0x0370
-#define PT_F88                 0x0380
-#define PT_F89                 0x0390
-#define PT_F90                 0x03a0
-#define PT_F91                 0x03b0
-#define PT_F92                 0x03c0
-#define PT_F93                 0x03d0
-#define PT_F94                 0x03e0
-#define PT_F95                 0x03f0
-#define PT_F96                 0x0400
-#define PT_F97                 0x0410
-#define PT_F98                 0x0420
-#define PT_F99                 0x0430
-#define PT_F100                        0x0440
-#define PT_F101                        0x0450
-#define PT_F102                        0x0460
-#define PT_F103                        0x0470
-#define PT_F104                        0x0480
-#define PT_F105                        0x0490
-#define PT_F106                        0x04a0
-#define PT_F107                        0x04b0
-#define PT_F108                        0x04c0
-#define PT_F109                        0x04d0
-#define PT_F110                        0x04e0
-#define PT_F111                        0x04f0
-#define PT_F112                        0x0500
-#define PT_F113                        0x0510
-#define PT_F114                        0x0520
-#define PT_F115                        0x0530
-#define PT_F116                        0x0540
-#define PT_F117                        0x0550
-#define PT_F118                        0x0560
-#define PT_F119                        0x0570
-#define PT_F120                        0x0580
-#define PT_F121                        0x0590
-#define PT_F122                        0x05a0
-#define PT_F123                        0x05b0
-#define PT_F124                        0x05c0
-#define PT_F125                        0x05d0
-#define PT_F126                        0x05e0
-#define PT_F127                        0x05f0
-
-#define PT_NAT_BITS            0x0600
-
-#define PT_F2                  0x0610
-#define PT_F3                  0x0620
-#define PT_F4                  0x0630
-#define PT_F5                  0x0640
-#define PT_F10                 0x0650
-#define PT_F11                 0x0660
-#define PT_F12                 0x0670
-#define PT_F13                 0x0680
-#define PT_F14                 0x0690
-#define PT_F15                 0x06a0
-#define PT_F16                 0x06b0
-#define PT_F17                 0x06c0
-#define PT_F18                 0x06d0
-#define PT_F19                 0x06e0
-#define PT_F20                 0x06f0
-#define PT_F21                 0x0700
-#define PT_F22                 0x0710
-#define PT_F23                 0x0720
-#define PT_F24                 0x0730
-#define PT_F25                 0x0740
-#define PT_F26                 0x0750
-#define PT_F27                 0x0760
-#define PT_F28                 0x0770
-#define PT_F29                 0x0780
-#define PT_F30                 0x0790
-#define PT_F31                 0x07a0
-#define PT_R4                  0x07b0
-#define PT_R5                  0x07b8
-#define PT_R6                  0x07c0
-#define PT_R7                  0x07c8
-
-#define PT_B1                  0x07d8
-#define PT_B2                  0x07e0
-#define PT_B3                  0x07e8
-#define PT_B4                  0x07f0
-#define PT_B5                  0x07f8
-
-#define PT_AR_EC               0x0800
-#define PT_AR_LC               0x0808
-
-#define PT_CR_IPSR             0x0830
-#define PT_CR_IIP              0x0838
-#define PT_CFM                 0x0840
-#define PT_AR_UNAT             0x0848
-#define PT_AR_PFS              0x0850
-#define PT_AR_RSC              0x0858
-#define PT_AR_RNAT             0x0860
-#define PT_AR_BSPSTORE         0x0868
-#define PT_PR                  0x0870
-#define PT_B6                  0x0878
-#define PT_AR_BSP              0x0880  /* note: this points to the *end* of the backing store! */
-#define PT_R1                  0x0888
-#define PT_R2                  0x0890
-#define PT_R3                  0x0898
-#define PT_R12                 0x08a0
-#define PT_R13                 0x08a8
-#define PT_R14                 0x08b0
-#define PT_R15                 0x08b8
-#define PT_R8                  0x08c0
-#define PT_R9                  0x08c8
-#define PT_R10                 0x08d0
-#define PT_R11                 0x08d8
-#define PT_R16                 0x08e0
-#define PT_R17                 0x08e8
-#define PT_R18                 0x08f0
-#define PT_R19                 0x08f8
-#define PT_R20                 0x0900
-#define PT_R21                 0x0908
-#define PT_R22                 0x0910
-#define PT_R23                 0x0918
-#define PT_R24                 0x0920
-#define PT_R25                 0x0928
-#define PT_R26                 0x0930
-#define PT_R27                 0x0938
-#define PT_R28                 0x0940
-#define PT_R29                 0x0948
-#define PT_R30                 0x0950
-#define PT_R31                 0x0958
-#define PT_AR_CCV              0x0960
-#define PT_AR_FPSR             0x0968
-#define PT_B0                  0x0970
-#define PT_B7                  0x0978
-#define PT_F6                  0x0980
-#define PT_F7                  0x0990
-#define PT_F8                  0x09a0
-#define PT_F9                  0x09b0
-#define PT_AR_CSD              0x09c0
-#define PT_AR_SSD              0x09c8
-
-#define PT_DBR                 0x2000  /* data breakpoint registers */
-#define PT_IBR                 0x3000  /* instruction breakpoint registers */
-#define PT_PMD                 0x4000  /* performance monitoring counters */
-
-#endif /* _ASM_IA64_PTRACE_OFFSETS_H */
diff --git a/include/asm-ia64/resource.h b/include/asm-ia64/resource.h
deleted file mode 100644 (file)
index ba2272a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ASM_IA64_RESOURCE_H
-#define _ASM_IA64_RESOURCE_H
-
-#include <asm/ustack.h>
-#include <asm-generic/resource.h>
-
-#endif /* _ASM_IA64_RESOURCE_H */
diff --git a/include/asm-ia64/rse.h b/include/asm-ia64/rse.h
deleted file mode 100644 (file)
index 02830a3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _ASM_IA64_RSE_H
-#define _ASM_IA64_RSE_H
-
-/*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * Register stack engine related helper functions.  This file may be
- * used in applications, so be careful about the name-space and give
- * some consideration to non-GNU C compilers (though __inline__ is
- * fine).
- */
-
-static __inline__ unsigned long
-ia64_rse_slot_num (unsigned long *addr)
-{
-       return (((unsigned long) addr) >> 3) & 0x3f;
-}
-
-/*
- * Return TRUE if ADDR is the address of an RNAT slot.
- */
-static __inline__ unsigned long
-ia64_rse_is_rnat_slot (unsigned long *addr)
-{
-       return ia64_rse_slot_num(addr) == 0x3f;
-}
-
-/*
- * Returns the address of the RNAT slot that covers the slot at
- * address SLOT_ADDR.
- */
-static __inline__ unsigned long *
-ia64_rse_rnat_addr (unsigned long *slot_addr)
-{
-       return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3));
-}
-
-/*
- * Calculate the number of registers in the dirty partition starting at BSPSTORE and
- * ending at BSP.  This isn't simply (BSP-BSPSTORE)/8 because every 64th slot stores
- * ar.rnat.
- */
-static __inline__ unsigned long
-ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp)
-{
-       unsigned long slots = (bsp - bspstore);
-
-       return slots - (ia64_rse_slot_num(bspstore) + slots)/0x40;
-}
-
-/*
- * The inverse of the above: given bspstore and the number of
- * registers, calculate ar.bsp.
- */
-static __inline__ unsigned long *
-ia64_rse_skip_regs (unsigned long *addr, long num_regs)
-{
-       long delta = ia64_rse_slot_num(addr) + num_regs;
-
-       if (num_regs < 0)
-               delta -= 0x3e;
-       return addr + num_regs + delta/0x3f;
-}
-
-#endif /* _ASM_IA64_RSE_H */
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
deleted file mode 100644 (file)
index 8aba06a..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * asm-ia64/rwsem.h: R/W semaphores for ia64
- *
- * Copyright (C) 2003 Ken Chen <kenneth.w.chen@intel.com>
- * Copyright (C) 2003 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 2005 Christoph Lameter <clameter@sgi.com>
- *
- * Based on asm-i386/rwsem.h and other architecture implementation.
- *
- * The MSW of the count is the negated number of active writers and
- * waiting lockers, and the LSW is the total number of active locks.
- *
- * The lock count is initialized to 0 (no active and no waiting lockers).
- *
- * When a writer subtracts WRITE_BIAS, it'll get 0xffffffff00000001 for
- * the case of an uncontended lock. Readers increment by 1 and see a positive
- * value when uncontended, negative if there are writers (and maybe) readers
- * waiting (in which case it goes to sleep).
- */
-
-#ifndef _ASM_IA64_RWSEM_H
-#define _ASM_IA64_RWSEM_H
-
-#ifndef _LINUX_RWSEM_H
-#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
-#endif
-
-#include <linux/list.h>
-#include <linux/spinlock.h>
-
-#include <asm/intrinsics.h>
-
-/*
- * the semaphore definition
- */
-struct rw_semaphore {
-       signed long             count;
-       spinlock_t              wait_lock;
-       struct list_head        wait_list;
-};
-
-#define RWSEM_UNLOCKED_VALUE           __IA64_UL_CONST(0x0000000000000000)
-#define RWSEM_ACTIVE_BIAS              __IA64_UL_CONST(0x0000000000000001)
-#define RWSEM_ACTIVE_MASK              __IA64_UL_CONST(0x00000000ffffffff)
-#define RWSEM_WAITING_BIAS             -__IA64_UL_CONST(0x0000000100000000)
-#define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
-
-#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)
-
-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 *sem);
-extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
-
-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);
-}
-
-/*
- * lock for reading
- */
-static inline void
-__down_read (struct rw_semaphore *sem)
-{
-       long result = ia64_fetchadd8_acq((unsigned long *)&sem->count, 1);
-
-       if (result < 0)
-               rwsem_down_read_failed(sem);
-}
-
-/*
- * lock for writing
- */
-static inline void
-__down_write (struct rw_semaphore *sem)
-{
-       long old, new;
-
-       do {
-               old = sem->count;
-               new = old + RWSEM_ACTIVE_WRITE_BIAS;
-       } while (cmpxchg_acq(&sem->count, old, new) != old);
-
-       if (old != 0)
-               rwsem_down_write_failed(sem);
-}
-
-/*
- * unlock after reading
- */
-static inline void
-__up_read (struct rw_semaphore *sem)
-{
-       long result = ia64_fetchadd8_rel((unsigned long *)&sem->count, -1);
-
-       if (result < 0 && (--result & RWSEM_ACTIVE_MASK) == 0)
-               rwsem_wake(sem);
-}
-
-/*
- * unlock after writing
- */
-static inline void
-__up_write (struct rw_semaphore *sem)
-{
-       long old, new;
-
-       do {
-               old = sem->count;
-               new = old - RWSEM_ACTIVE_WRITE_BIAS;
-       } while (cmpxchg_rel(&sem->count, old, new) != old);
-
-       if (new < 0 && (new & RWSEM_ACTIVE_MASK) == 0)
-               rwsem_wake(sem);
-}
-
-/*
- * trylock for reading -- returns 1 if successful, 0 if contention
- */
-static inline int
-__down_read_trylock (struct rw_semaphore *sem)
-{
-       long tmp;
-       while ((tmp = sem->count) >= 0) {
-               if (tmp == cmpxchg_acq(&sem->count, tmp, tmp+1)) {
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-/*
- * trylock for writing -- returns 1 if successful, 0 if contention
- */
-static inline int
-__down_write_trylock (struct rw_semaphore *sem)
-{
-       long tmp = cmpxchg_acq(&sem->count, RWSEM_UNLOCKED_VALUE,
-                             RWSEM_ACTIVE_WRITE_BIAS);
-       return tmp == RWSEM_UNLOCKED_VALUE;
-}
-
-/*
- * downgrade write lock to read lock
- */
-static inline void
-__downgrade_write (struct rw_semaphore *sem)
-{
-       long old, new;
-
-       do {
-               old = sem->count;
-               new = old - RWSEM_WAITING_BIAS;
-       } while (cmpxchg_rel(&sem->count, old, new) != old);
-
-       if (old < 0)
-               rwsem_downgrade_wake(sem);
-}
-
-/*
- * Implement atomic add functionality.  These used to be "inline" functions, but GCC v3.1
- * doesn't quite optimize this stuff right and ends up with bad calls to fetchandadd.
- */
-#define rwsem_atomic_add(delta, sem)   atomic64_add(delta, (atomic64_t *)(&(sem)->count))
-#define rwsem_atomic_update(delta, sem)        atomic64_add_return(delta, (atomic64_t *)(&(sem)->count))
-
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
-{
-       return (sem->count != 0);
-}
-
-#endif /* _ASM_IA64_RWSEM_H */
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
deleted file mode 100644 (file)
index 89594b4..0000000
+++ /dev/null
@@ -1,905 +0,0 @@
-#ifndef _ASM_IA64_SAL_H
-#define _ASM_IA64_SAL_H
-
-/*
- * System Abstraction Layer definitions.
- *
- * This is based on version 2.5 of the manual "IA-64 System
- * Abstraction Layer".
- *
- * Copyright (C) 2001 Intel
- * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
- * Copyright (C) 2001 Fred Lewis <frederick.v.lewis@intel.com>
- * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
- *
- * 02/01/04 J. Hall Updated Error Record Structures to conform to July 2001
- *                 revision of the SAL spec.
- * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000
- *                  revision of the SAL spec.
- * 99/09/29 davidm     Updated for SAL 2.6.
- * 00/03/29 cfleck      Updated SAL Error Logging info for processor (SAL 2.6)
- *                      (plus examples of platform error info structures from smariset @ Intel)
- */
-
-#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT         0
-#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT   1
-#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT   2
-#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT                3
-
-#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK       (1<<IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT)
-#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT)
-#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT)
-#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT      (1<<IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT)
-
-#ifndef __ASSEMBLY__
-
-#include <linux/bcd.h>
-#include <linux/spinlock.h>
-#include <linux/efi.h>
-
-#include <asm/pal.h>
-#include <asm/system.h>
-#include <asm/fpu.h>
-
-extern spinlock_t sal_lock;
-
-/* SAL spec _requires_ eight args for each call. */
-#define __IA64_FW_CALL(entry,result,a0,a1,a2,a3,a4,a5,a6,a7)   \
-       result = (*entry)(a0,a1,a2,a3,a4,a5,a6,a7)
-
-# define IA64_FW_CALL(entry,result,args...) do {               \
-       unsigned long __ia64_sc_flags;                          \
-       struct ia64_fpreg __ia64_sc_fr[6];                      \
-       ia64_save_scratch_fpregs(__ia64_sc_fr);                 \
-       spin_lock_irqsave(&sal_lock, __ia64_sc_flags);          \
-       __IA64_FW_CALL(entry, result, args);                    \
-       spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags);     \
-       ia64_load_scratch_fpregs(__ia64_sc_fr);                 \
-} while (0)
-
-# define SAL_CALL(result,args...)                      \
-       IA64_FW_CALL(ia64_sal, result, args);
-
-# define SAL_CALL_NOLOCK(result,args...) do {          \
-       unsigned long __ia64_scn_flags;                 \
-       struct ia64_fpreg __ia64_scn_fr[6];             \
-       ia64_save_scratch_fpregs(__ia64_scn_fr);        \
-       local_irq_save(__ia64_scn_flags);               \
-       __IA64_FW_CALL(ia64_sal, result, args);         \
-       local_irq_restore(__ia64_scn_flags);            \
-       ia64_load_scratch_fpregs(__ia64_scn_fr);        \
-} while (0)
-
-# define SAL_CALL_REENTRANT(result,args...) do {       \
-       struct ia64_fpreg __ia64_scs_fr[6];             \
-       ia64_save_scratch_fpregs(__ia64_scs_fr);        \
-       preempt_disable();                              \
-       __IA64_FW_CALL(ia64_sal, result, args);         \
-       preempt_enable();                               \
-       ia64_load_scratch_fpregs(__ia64_scs_fr);        \
-} while (0)
-
-#define SAL_SET_VECTORS                        0x01000000
-#define SAL_GET_STATE_INFO             0x01000001
-#define SAL_GET_STATE_INFO_SIZE                0x01000002
-#define SAL_CLEAR_STATE_INFO           0x01000003
-#define SAL_MC_RENDEZ                  0x01000004
-#define SAL_MC_SET_PARAMS              0x01000005
-#define SAL_REGISTER_PHYSICAL_ADDR     0x01000006
-
-#define SAL_CACHE_FLUSH                        0x01000008
-#define SAL_CACHE_INIT                 0x01000009
-#define SAL_PCI_CONFIG_READ            0x01000010
-#define SAL_PCI_CONFIG_WRITE           0x01000011
-#define SAL_FREQ_BASE                  0x01000012
-#define SAL_PHYSICAL_ID_INFO           0x01000013
-
-#define SAL_UPDATE_PAL                 0x01000020
-
-struct ia64_sal_retval {
-       /*
-        * A zero status value indicates call completed without error.
-        * A negative status value indicates reason of call failure.
-        * A positive status value indicates success but an
-        * informational value should be printed (e.g., "reboot for
-        * change to take effect").
-        */
-       s64 status;
-       u64 v0;
-       u64 v1;
-       u64 v2;
-};
-
-typedef struct ia64_sal_retval (*ia64_sal_handler) (u64, ...);
-
-enum {
-       SAL_FREQ_BASE_PLATFORM = 0,
-       SAL_FREQ_BASE_INTERVAL_TIMER = 1,
-       SAL_FREQ_BASE_REALTIME_CLOCK = 2
-};
-
-/*
- * The SAL system table is followed by a variable number of variable
- * length descriptors.  The structure of these descriptors follows
- * below.
- * The defininition follows SAL specs from July 2000
- */
-struct ia64_sal_systab {
-       u8 signature[4];        /* should be "SST_" */
-       u32 size;               /* size of this table in bytes */
-       u8 sal_rev_minor;
-       u8 sal_rev_major;
-       u16 entry_count;        /* # of entries in variable portion */
-       u8 checksum;
-       u8 reserved1[7];
-       u8 sal_a_rev_minor;
-       u8 sal_a_rev_major;
-       u8 sal_b_rev_minor;
-       u8 sal_b_rev_major;
-       /* oem_id & product_id: terminating NUL is missing if string is exactly 32 bytes long. */
-       u8 oem_id[32];
-       u8 product_id[32];      /* ASCII product id  */
-       u8 reserved2[8];
-};
-
-enum sal_systab_entry_type {
-       SAL_DESC_ENTRY_POINT = 0,
-       SAL_DESC_MEMORY = 1,
-       SAL_DESC_PLATFORM_FEATURE = 2,
-       SAL_DESC_TR = 3,
-       SAL_DESC_PTC = 4,
-       SAL_DESC_AP_WAKEUP = 5
-};
-
-/*
- * Entry type: Size:
- *     0       48
- *     1       32
- *     2       16
- *     3       32
- *     4       16
- *     5       16
- */
-#define SAL_DESC_SIZE(type)    "\060\040\020\040\020\020"[(unsigned) type]
-
-typedef struct ia64_sal_desc_entry_point {
-       u8 type;
-       u8 reserved1[7];
-       u64 pal_proc;
-       u64 sal_proc;
-       u64 gp;
-       u8 reserved2[16];
-}ia64_sal_desc_entry_point_t;
-
-typedef struct ia64_sal_desc_memory {
-       u8 type;
-       u8 used_by_sal; /* needs to be mapped for SAL? */
-       u8 mem_attr;            /* current memory attribute setting */
-       u8 access_rights;       /* access rights set up by SAL */
-       u8 mem_attr_mask;       /* mask of supported memory attributes */
-       u8 reserved1;
-       u8 mem_type;            /* memory type */
-       u8 mem_usage;           /* memory usage */
-       u64 addr;               /* physical address of memory */
-       u32 length;     /* length (multiple of 4KB pages) */
-       u32 reserved2;
-       u8 oem_reserved[8];
-} ia64_sal_desc_memory_t;
-
-typedef struct ia64_sal_desc_platform_feature {
-       u8 type;
-       u8 feature_mask;
-       u8 reserved1[14];
-} ia64_sal_desc_platform_feature_t;
-
-typedef struct ia64_sal_desc_tr {
-       u8 type;
-       u8 tr_type;             /* 0 == instruction, 1 == data */
-       u8 regnum;              /* translation register number */
-       u8 reserved1[5];
-       u64 addr;               /* virtual address of area covered */
-       u64 page_size;          /* encoded page size */
-       u8 reserved2[8];
-} ia64_sal_desc_tr_t;
-
-typedef struct ia64_sal_desc_ptc {
-       u8 type;
-       u8 reserved1[3];
-       u32 num_domains;        /* # of coherence domains */
-       u64 domain_info;        /* physical address of domain info table */
-} ia64_sal_desc_ptc_t;
-
-typedef struct ia64_sal_ptc_domain_info {
-       u64 proc_count;         /* number of processors in domain */
-       u64 proc_list;          /* physical address of LID array */
-} ia64_sal_ptc_domain_info_t;
-
-typedef struct ia64_sal_ptc_domain_proc_entry {
-       u64 id  : 8;            /* id of processor */
-       u64 eid : 8;            /* eid of processor */
-} ia64_sal_ptc_domain_proc_entry_t;
-
-
-#define IA64_SAL_AP_EXTERNAL_INT 0
-
-typedef struct ia64_sal_desc_ap_wakeup {
-       u8 type;
-       u8 mechanism;           /* 0 == external interrupt */
-       u8 reserved1[6];
-       u64 vector;             /* interrupt vector in range 0x10-0xff */
-} ia64_sal_desc_ap_wakeup_t ;
-
-extern ia64_sal_handler ia64_sal;
-extern struct ia64_sal_desc_ptc *ia64_ptc_domain_info;
-
-extern unsigned short sal_revision;    /* supported SAL spec revision */
-extern unsigned short sal_version;     /* SAL version; OEM dependent */
-#define SAL_VERSION_CODE(major, minor) ((BIN2BCD(major) << 8) | BIN2BCD(minor))
-
-extern const char *ia64_sal_strerror (long status);
-extern void ia64_sal_init (struct ia64_sal_systab *sal_systab);
-
-/* SAL information type encodings */
-enum {
-       SAL_INFO_TYPE_MCA  = 0,         /* Machine check abort information */
-        SAL_INFO_TYPE_INIT = 1,                /* Init information */
-        SAL_INFO_TYPE_CMC  = 2,                /* Corrected machine check information */
-        SAL_INFO_TYPE_CPE  = 3         /* Corrected platform error information */
-};
-
-/* Encodings for machine check parameter types */
-enum {
-       SAL_MC_PARAM_RENDEZ_INT    = 1, /* Rendezvous interrupt */
-       SAL_MC_PARAM_RENDEZ_WAKEUP = 2, /* Wakeup */
-       SAL_MC_PARAM_CPE_INT       = 3  /* Corrected Platform Error Int */
-};
-
-/* Encodings for rendezvous mechanisms */
-enum {
-       SAL_MC_PARAM_MECHANISM_INT = 1, /* Use interrupt */
-       SAL_MC_PARAM_MECHANISM_MEM = 2  /* Use memory synchronization variable*/
-};
-
-/* Encodings for vectors which can be registered by the OS with SAL */
-enum {
-       SAL_VECTOR_OS_MCA         = 0,
-       SAL_VECTOR_OS_INIT        = 1,
-       SAL_VECTOR_OS_BOOT_RENDEZ = 2
-};
-
-/* Encodings for mca_opt parameter sent to SAL_MC_SET_PARAMS */
-#define        SAL_MC_PARAM_RZ_ALWAYS          0x1
-#define        SAL_MC_PARAM_BINIT_ESCALATE     0x10
-
-/*
- * Definition of the SAL Error Log from the SAL spec
- */
-
-/* SAL Error Record Section GUID Definitions */
-#define SAL_PROC_DEV_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_MEM_DEV_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf2, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_SEL_DEV_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf3, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_PCI_BUS_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf4, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf5, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_PCI_COMP_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf6, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_SPECIFIC_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf7, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf8, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define SAL_PLAT_BUS_ERR_SECT_GUID  \
-    EFI_GUID(0xe429faf9, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
-#define PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID \
-    EFI_GUID(0x6cb0a200, 0x893a, 0x11da, 0x96, 0xd2, 0x0, 0x10, 0x83, 0xff, \
-               0xca, 0x4d)
-
-#define MAX_CACHE_ERRORS       6
-#define MAX_TLB_ERRORS         6
-#define MAX_BUS_ERRORS         1
-
-/* Definition of version  according to SAL spec for logging purposes */
-typedef struct sal_log_revision {
-       u8 minor;               /* BCD (0..99) */
-       u8 major;               /* BCD (0..99) */
-} sal_log_revision_t;
-
-/* Definition of timestamp according to SAL spec for logging purposes */
-typedef struct sal_log_timestamp {
-       u8 slh_second;          /* Second (0..59) */
-       u8 slh_minute;          /* Minute (0..59) */
-       u8 slh_hour;            /* Hour (0..23) */
-       u8 slh_reserved;
-       u8 slh_day;             /* Day (1..31) */
-       u8 slh_month;           /* Month (1..12) */
-       u8 slh_year;            /* Year (00..99) */
-       u8 slh_century;         /* Century (19, 20, 21, ...) */
-} sal_log_timestamp_t;
-
-/* Definition of log record  header structures */
-typedef struct sal_log_record_header {
-       u64 id;                         /* Unique monotonically increasing ID */
-       sal_log_revision_t revision;    /* Major and Minor revision of header */
-       u8 severity;                    /* Error Severity */
-       u8 validation_bits;             /* 0: platform_guid, 1: !timestamp */
-       u32 len;                        /* Length of this error log in bytes */
-       sal_log_timestamp_t timestamp;  /* Timestamp */
-       efi_guid_t platform_guid;       /* Unique OEM Platform ID */
-} sal_log_record_header_t;
-
-#define sal_log_severity_recoverable   0
-#define sal_log_severity_fatal         1
-#define sal_log_severity_corrected     2
-
-/* Definition of log section header structures */
-typedef struct sal_log_sec_header {
-    efi_guid_t guid;                   /* Unique Section ID */
-    sal_log_revision_t revision;       /* Major and Minor revision of Section */
-    u16 reserved;
-    u32 len;                           /* Section length */
-} sal_log_section_hdr_t;
-
-typedef struct sal_log_mod_error_info {
-       struct {
-               u64 check_info              : 1,
-                   requestor_identifier    : 1,
-                   responder_identifier    : 1,
-                   target_identifier       : 1,
-                   precise_ip              : 1,
-                   reserved                : 59;
-       } valid;
-       u64 check_info;
-       u64 requestor_identifier;
-       u64 responder_identifier;
-       u64 target_identifier;
-       u64 precise_ip;
-} sal_log_mod_error_info_t;
-
-typedef struct sal_processor_static_info {
-       struct {
-               u64 minstate        : 1,
-                   br              : 1,
-                   cr              : 1,
-                   ar              : 1,
-                   rr              : 1,
-                   fr              : 1,
-                   reserved        : 58;
-       } valid;
-       pal_min_state_area_t min_state_area;
-       u64 br[8];
-       u64 cr[128];
-       u64 ar[128];
-       u64 rr[8];
-       struct ia64_fpreg __attribute__ ((packed)) fr[128];
-} sal_processor_static_info_t;
-
-struct sal_cpuid_info {
-       u64 regs[5];
-       u64 reserved;
-};
-
-typedef struct sal_log_processor_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 proc_error_map      : 1,
-                   proc_state_param    : 1,
-                   proc_cr_lid         : 1,
-                   psi_static_struct   : 1,
-                   num_cache_check     : 4,
-                   num_tlb_check       : 4,
-                   num_bus_check       : 4,
-                   num_reg_file_check  : 4,
-                   num_ms_check        : 4,
-                   cpuid_info          : 1,
-                   reserved1           : 39;
-       } valid;
-       u64 proc_error_map;
-       u64 proc_state_parameter;
-       u64 proc_cr_lid;
-       /*
-        * The rest of this structure consists of variable-length arrays, which can't be
-        * expressed in C.
-        */
-       sal_log_mod_error_info_t info[0];
-       /*
-        * This is what the rest looked like if C supported variable-length arrays:
-        *
-        * sal_log_mod_error_info_t cache_check_info[.valid.num_cache_check];
-        * sal_log_mod_error_info_t tlb_check_info[.valid.num_tlb_check];
-        * sal_log_mod_error_info_t bus_check_info[.valid.num_bus_check];
-        * sal_log_mod_error_info_t reg_file_check_info[.valid.num_reg_file_check];
-        * sal_log_mod_error_info_t ms_check_info[.valid.num_ms_check];
-        * struct sal_cpuid_info cpuid_info;
-        * sal_processor_static_info_t processor_static_info;
-        */
-} sal_log_processor_info_t;
-
-/* Given a sal_log_processor_info_t pointer, return a pointer to the processor_static_info: */
-#define SAL_LPI_PSI_INFO(l)                                                                    \
-({     sal_log_processor_info_t *_l = (l);                                                     \
-       ((sal_processor_static_info_t *)                                                        \
-        ((char *) _l->info + ((_l->valid.num_cache_check + _l->valid.num_tlb_check             \
-                               + _l->valid.num_bus_check + _l->valid.num_reg_file_check        \
-                               + _l->valid.num_ms_check) * sizeof(sal_log_mod_error_info_t)    \
-                              + sizeof(struct sal_cpuid_info))));                              \
-})
-
-/* platform error log structures */
-
-typedef struct sal_log_mem_dev_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 error_status    : 1,
-                   physical_addr   : 1,
-                   addr_mask       : 1,
-                   node            : 1,
-                   card            : 1,
-                   module          : 1,
-                   bank            : 1,
-                   device          : 1,
-                   row             : 1,
-                   column          : 1,
-                   bit_position    : 1,
-                   requestor_id    : 1,
-                   responder_id    : 1,
-                   target_id       : 1,
-                   bus_spec_data   : 1,
-                   oem_id          : 1,
-                   oem_data        : 1,
-                   reserved        : 47;
-       } valid;
-       u64 error_status;
-       u64 physical_addr;
-       u64 addr_mask;
-       u16 node;
-       u16 card;
-       u16 module;
-       u16 bank;
-       u16 device;
-       u16 row;
-       u16 column;
-       u16 bit_position;
-       u64 requestor_id;
-       u64 responder_id;
-       u64 target_id;
-       u64 bus_spec_data;
-       u8 oem_id[16];
-       u8 oem_data[1];                 /* Variable length data */
-} sal_log_mem_dev_err_info_t;
-
-typedef struct sal_log_sel_dev_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 record_id       : 1,
-                   record_type     : 1,
-                   generator_id    : 1,
-                   evm_rev         : 1,
-                   sensor_type     : 1,
-                   sensor_num      : 1,
-                   event_dir       : 1,
-                   event_data1     : 1,
-                   event_data2     : 1,
-                   event_data3     : 1,
-                   reserved        : 54;
-       } valid;
-       u16 record_id;
-       u8 record_type;
-       u8 timestamp[4];
-       u16 generator_id;
-       u8 evm_rev;
-       u8 sensor_type;
-       u8 sensor_num;
-       u8 event_dir;
-       u8 event_data1;
-       u8 event_data2;
-       u8 event_data3;
-} sal_log_sel_dev_err_info_t;
-
-typedef struct sal_log_pci_bus_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 err_status      : 1,
-                   err_type        : 1,
-                   bus_id          : 1,
-                   bus_address     : 1,
-                   bus_data        : 1,
-                   bus_cmd         : 1,
-                   requestor_id    : 1,
-                   responder_id    : 1,
-                   target_id       : 1,
-                   oem_data        : 1,
-                   reserved        : 54;
-       } valid;
-       u64 err_status;
-       u16 err_type;
-       u16 bus_id;
-       u32 reserved;
-       u64 bus_address;
-       u64 bus_data;
-       u64 bus_cmd;
-       u64 requestor_id;
-       u64 responder_id;
-       u64 target_id;
-       u8 oem_data[1];                 /* Variable length data */
-} sal_log_pci_bus_err_info_t;
-
-typedef struct sal_log_smbios_dev_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 event_type      : 1,
-                   length          : 1,
-                   time_stamp      : 1,
-                   data            : 1,
-                   reserved1       : 60;
-       } valid;
-       u8 event_type;
-       u8 length;
-       u8 time_stamp[6];
-       u8 data[1];                     /* data of variable length, length == slsmb_length */
-} sal_log_smbios_dev_err_info_t;
-
-typedef struct sal_log_pci_comp_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 err_status      : 1,
-                   comp_info       : 1,
-                   num_mem_regs    : 1,
-                   num_io_regs     : 1,
-                   reg_data_pairs  : 1,
-                   oem_data        : 1,
-                   reserved        : 58;
-       } valid;
-       u64 err_status;
-       struct {
-               u16 vendor_id;
-               u16 device_id;
-               u8 class_code[3];
-               u8 func_num;
-               u8 dev_num;
-               u8 bus_num;
-               u8 seg_num;
-               u8 reserved[5];
-       } comp_info;
-       u32 num_mem_regs;
-       u32 num_io_regs;
-       u64 reg_data_pairs[1];
-       /*
-        * array of address/data register pairs is num_mem_regs + num_io_regs elements
-        * long.  Each array element consists of a u64 address followed by a u64 data
-        * value.  The oem_data array immediately follows the reg_data_pairs array
-        */
-       u8 oem_data[1];                 /* Variable length data */
-} sal_log_pci_comp_err_info_t;
-
-typedef struct sal_log_plat_specific_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 err_status      : 1,
-                   guid            : 1,
-                   oem_data        : 1,
-                   reserved        : 61;
-       } valid;
-       u64 err_status;
-       efi_guid_t guid;
-       u8 oem_data[1];                 /* platform specific variable length data */
-} sal_log_plat_specific_err_info_t;
-
-typedef struct sal_log_host_ctlr_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 err_status      : 1,
-                   requestor_id    : 1,
-                   responder_id    : 1,
-                   target_id       : 1,
-                   bus_spec_data   : 1,
-                   oem_data        : 1,
-                   reserved        : 58;
-       } valid;
-       u64 err_status;
-       u64 requestor_id;
-       u64 responder_id;
-       u64 target_id;
-       u64 bus_spec_data;
-       u8 oem_data[1];                 /* Variable length OEM data */
-} sal_log_host_ctlr_err_info_t;
-
-typedef struct sal_log_plat_bus_err_info {
-       sal_log_section_hdr_t header;
-       struct {
-               u64 err_status      : 1,
-                   requestor_id    : 1,
-                   responder_id    : 1,
-                   target_id       : 1,
-                   bus_spec_data   : 1,
-                   oem_data        : 1,
-                   reserved        : 58;
-       } valid;
-       u64 err_status;
-       u64 requestor_id;
-       u64 responder_id;
-       u64 target_id;
-       u64 bus_spec_data;
-       u8 oem_data[1];                 /* Variable length OEM data */
-} sal_log_plat_bus_err_info_t;
-
-/* Overall platform error section structure */
-typedef union sal_log_platform_err_info {
-       sal_log_mem_dev_err_info_t mem_dev_err;
-       sal_log_sel_dev_err_info_t sel_dev_err;
-       sal_log_pci_bus_err_info_t pci_bus_err;
-       sal_log_smbios_dev_err_info_t smbios_dev_err;
-       sal_log_pci_comp_err_info_t pci_comp_err;
-       sal_log_plat_specific_err_info_t plat_specific_err;
-       sal_log_host_ctlr_err_info_t host_ctlr_err;
-       sal_log_plat_bus_err_info_t plat_bus_err;
-} sal_log_platform_err_info_t;
-
-/* SAL log over-all, multi-section error record structure (processor+platform) */
-typedef struct err_rec {
-       sal_log_record_header_t sal_elog_header;
-       sal_log_processor_info_t proc_err;
-       sal_log_platform_err_info_t plat_err;
-       u8 oem_data_pad[1024];
-} ia64_err_rec_t;
-
-/*
- * Now define a couple of inline functions for improved type checking
- * and convenience.
- */
-
-extern s64 ia64_sal_cache_flush (u64 cache_type);
-extern void __init check_sal_cache_flush (void);
-
-/* Initialize all the processor and platform level instruction and data caches */
-static inline s64
-ia64_sal_cache_init (void)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_CACHE_INIT, 0, 0, 0, 0, 0, 0, 0);
-       return isrv.status;
-}
-
-/*
- * Clear the processor and platform information logged by SAL with respect to the machine
- * state at the time of MCA's, INITs, CMCs, or CPEs.
- */
-static inline s64
-ia64_sal_clear_state_info (u64 sal_info_type)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_REENTRANT(isrv, SAL_CLEAR_STATE_INFO, sal_info_type, 0,
-                     0, 0, 0, 0, 0);
-       return isrv.status;
-}
-
-
-/* Get the processor and platform information logged by SAL with respect to the machine
- * state at the time of the MCAs, INITs, CMCs, or CPEs.
- */
-static inline u64
-ia64_sal_get_state_info (u64 sal_info_type, u64 *sal_info)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_REENTRANT(isrv, SAL_GET_STATE_INFO, sal_info_type, 0,
-                     sal_info, 0, 0, 0, 0);
-       if (isrv.status)
-               return 0;
-
-       return isrv.v0;
-}
-
-/*
- * Get the maximum size of the information logged by SAL with respect to the machine state
- * at the time of MCAs, INITs, CMCs, or CPEs.
- */
-static inline u64
-ia64_sal_get_state_info_size (u64 sal_info_type)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_REENTRANT(isrv, SAL_GET_STATE_INFO_SIZE, sal_info_type, 0,
-                     0, 0, 0, 0, 0);
-       if (isrv.status)
-               return 0;
-       return isrv.v0;
-}
-
-/*
- * Causes the processor to go into a spin loop within SAL where SAL awaits a wakeup from
- * the monarch processor.  Must not lock, because it will not return on any cpu until the
- * monarch processor sends a wake up.
- */
-static inline s64
-ia64_sal_mc_rendez (void)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_NOLOCK(isrv, SAL_MC_RENDEZ, 0, 0, 0, 0, 0, 0, 0);
-       return isrv.status;
-}
-
-/*
- * Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during
- * the machine check rendezvous sequence as well as the mechanism to wake up the
- * non-monarch processor at the end of machine check processing.
- * Returns the complete ia64_sal_retval because some calls return more than just a status
- * value.
- */
-static inline struct ia64_sal_retval
-ia64_sal_mc_set_params (u64 param_type, u64 i_or_m, u64 i_or_m_val, u64 timeout, u64 rz_always)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_MC_SET_PARAMS, param_type, i_or_m, i_or_m_val,
-                timeout, rz_always, 0, 0);
-       return isrv;
-}
-
-/* Read from PCI configuration space */
-static inline s64
-ia64_sal_pci_config_read (u64 pci_config_addr, int type, u64 size, u64 *value)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_PCI_CONFIG_READ, pci_config_addr, size, type, 0, 0, 0, 0);
-       if (value)
-               *value = isrv.v0;
-       return isrv.status;
-}
-
-/* Write to PCI configuration space */
-static inline s64
-ia64_sal_pci_config_write (u64 pci_config_addr, int type, u64 size, u64 value)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_PCI_CONFIG_WRITE, pci_config_addr, size, value,
-                type, 0, 0, 0);
-       return isrv.status;
-}
-
-/*
- * Register physical addresses of locations needed by SAL when SAL procedures are invoked
- * in virtual mode.
- */
-static inline s64
-ia64_sal_register_physical_addr (u64 phys_entry, u64 phys_addr)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_REGISTER_PHYSICAL_ADDR, phys_entry, phys_addr,
-                0, 0, 0, 0, 0);
-       return isrv.status;
-}
-
-/*
- * Register software dependent code locations within SAL. These locations are handlers or
- * entry points where SAL will pass control for the specified event. These event handlers
- * are for the bott rendezvous, MCAs and INIT scenarios.
- */
-static inline s64
-ia64_sal_set_vectors (u64 vector_type,
-                     u64 handler_addr1, u64 gp1, u64 handler_len1,
-                     u64 handler_addr2, u64 gp2, u64 handler_len2)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_SET_VECTORS, vector_type,
-                       handler_addr1, gp1, handler_len1,
-                       handler_addr2, gp2, handler_len2);
-
-       return isrv.status;
-}
-
-/* Update the contents of PAL block in the non-volatile storage device */
-static inline s64
-ia64_sal_update_pal (u64 param_buf, u64 scratch_buf, u64 scratch_buf_size,
-                    u64 *error_code, u64 *scratch_buf_size_needed)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL(isrv, SAL_UPDATE_PAL, param_buf, scratch_buf, scratch_buf_size,
-                0, 0, 0, 0);
-       if (error_code)
-               *error_code = isrv.v0;
-       if (scratch_buf_size_needed)
-               *scratch_buf_size_needed = isrv.v1;
-       return isrv.status;
-}
-
-/* Get physical processor die mapping in the platform. */
-static inline s64
-ia64_sal_physical_id_info(u16 *splid)
-{
-       struct ia64_sal_retval isrv;
-
-       if (sal_revision < SAL_VERSION_CODE(3,2))
-               return -1;
-
-       SAL_CALL(isrv, SAL_PHYSICAL_ID_INFO, 0, 0, 0, 0, 0, 0, 0);
-       if (splid)
-               *splid = isrv.v0;
-       return isrv.status;
-}
-
-extern unsigned long sal_platform_features;
-
-extern int (*salinfo_platform_oemdata)(const u8 *, u8 **, u64 *);
-
-struct sal_ret_values {
-       long r8; long r9; long r10; long r11;
-};
-
-#define IA64_SAL_OEMFUNC_MIN           0x02000000
-#define IA64_SAL_OEMFUNC_MAX           0x03ffffff
-
-extern int ia64_sal_oemcall(struct ia64_sal_retval *, u64, u64, u64, u64, u64,
-                           u64, u64, u64);
-extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
-                                  u64, u64, u64, u64, u64);
-extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
-                                     u64, u64, u64, u64, u64);
-extern long
-ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
-                   unsigned long *drift_info);
-#ifdef CONFIG_HOTPLUG_CPU
-/*
- * System Abstraction Layer Specification
- * Section 3.2.5.1: OS_BOOT_RENDEZ to SAL return State.
- * Note: region regs are stored first in head.S _start. Hence they must
- * stay up front.
- */
-struct sal_to_os_boot {
-       u64 rr[8];              /* Region Registers */
-       u64 br[6];              /* br0:
-                                * return addr into SAL boot rendez routine */
-       u64 gr1;                /* SAL:GP */
-       u64 gr12;               /* SAL:SP */
-       u64 gr13;               /* SAL: Task Pointer */
-       u64 fpsr;
-       u64 pfs;
-       u64 rnat;
-       u64 unat;
-       u64 bspstore;
-       u64 dcr;                /* Default Control Register */
-       u64 iva;
-       u64 pta;
-       u64 itv;
-       u64 pmv;
-       u64 cmcv;
-       u64 lrr[2];
-       u64 gr[4];
-       u64 pr;                 /* Predicate registers */
-       u64 lc;                 /* Loop Count */
-       struct ia64_fpreg fp[20];
-};
-
-/*
- * Global array allocated for NR_CPUS at boot time
- */
-extern struct sal_to_os_boot sal_boot_rendez_state[NR_CPUS];
-
-extern void ia64_jump_to_sal(struct sal_to_os_boot *);
-#endif
-
-extern void ia64_sal_handler_init(void *entry_point, void *gpval);
-
-#define PALO_MAX_TLB_PURGES    0xFFFF
-#define PALO_SIG       "PALO"
-
-struct palo_table {
-       u8  signature[4];       /* Should be "PALO" */
-       u32 length;
-       u8  minor_revision;
-       u8  major_revision;
-       u8  checksum;
-       u8  reserved1[5];
-       u16 max_tlb_purges;
-       u8  reserved2[6];
-};
-
-#define NPTCG_FROM_PAL                 0
-#define NPTCG_FROM_PALO                        1
-#define NPTCG_FROM_KERNEL_PARAMETER    2
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _ASM_IA64_SAL_H */
diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h
deleted file mode 100644 (file)
index d6f5787..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _ASM_IA64_SCATTERLIST_H
-#define _ASM_IA64_SCATTERLIST_H
-
-/*
- * Modified 1998-1999, 2001-2002, 2004
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#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;    /* buffer length */
-
-       dma_addr_t dma_address;
-       unsigned int dma_length;
-};
-
-/*
- * It used to be that ISA_DMA_THRESHOLD had something to do with the
- * DMA-limits of ISA-devices.  Nowadays, its only remaining use (apart
- * from the aha1542.c driver, which isn't 64-bit clean anyhow) is to
- * tell the block-layer (via BLK_BOUNCE_ISA) what the max. physical
- * address of a page is that is allocated with GFP_DMA.  On IA-64,
- * that's 4GB - 1.
- */
-#define ISA_DMA_THRESHOLD      0xffffffff
-
-#define sg_dma_len(sg)         ((sg)->dma_length)
-#define sg_dma_address(sg)     ((sg)->dma_address)
-
-#define        ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_IA64_SCATTERLIST_H */
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h
deleted file mode 100644 (file)
index 7286e4a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ASM_IA64_SECTIONS_H
-#define _ASM_IA64_SECTIONS_H
-
-/*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <asm-generic/sections.h>
-
-extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[];
-extern char __start___vtop_patchlist[], __end___vtop_patchlist[];
-extern char __start___rse_patchlist[], __end___rse_patchlist[];
-extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[];
-extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[];
-extern char __start_gate_section[];
-extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[];
-extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
-extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
-extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
-extern char __start_unwind[], __end_unwind[];
-extern char __start_ivt_text[], __end_ivt_text[];
-
-#endif /* _ASM_IA64_SECTIONS_H */
-
diff --git a/include/asm-ia64/segment.h b/include/asm-ia64/segment.h
deleted file mode 100644 (file)
index b89e2b3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_IA64_SEGMENT_H
-#define _ASM_IA64_SEGMENT_H
-
-/* Only here because we have some old header files that expect it.. */
-
-#endif /* _ASM_IA64_SEGMENT_H */
diff --git a/include/asm-ia64/sembuf.h b/include/asm-ia64/sembuf.h
deleted file mode 100644 (file)
index 1340fbc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _ASM_IA64_SEMBUF_H
-#define _ASM_IA64_SEMBUF_H
-
-/*
- * The semid64_ds structure for IA-64 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 /* _ASM_IA64_SEMBUF_H */
diff --git a/include/asm-ia64/serial.h b/include/asm-ia64/serial.h
deleted file mode 100644 (file)
index 0c7a2f3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * include/asm-ia64/serial.h
- *
- * Derived from the i386 version.
- */
-
-/*
- * 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 )
-
-/*
- * All legacy serial ports should be enumerated via ACPI namespace, so
- * we need not list them here.
- */
diff --git a/include/asm-ia64/setup.h b/include/asm-ia64/setup.h
deleted file mode 100644 (file)
index 4399a44..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __IA64_SETUP_H
-#define __IA64_SETUP_H
-
-#define COMMAND_LINE_SIZE      2048
-
-#endif
diff --git a/include/asm-ia64/shmbuf.h b/include/asm-ia64/shmbuf.h
deleted file mode 100644 (file)
index 585002a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _ASM_IA64_SHMBUF_H
-#define _ASM_IA64_SHMBUF_H
-
-/*
- * The shmid64_ds structure for IA-64 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 /* _ASM_IA64_SHMBUF_H */
diff --git a/include/asm-ia64/shmparam.h b/include/asm-ia64/shmparam.h
deleted file mode 100644 (file)
index d07508d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_IA64_SHMPARAM_H
-#define _ASM_IA64_SHMPARAM_H
-
-/*
- * SHMLBA controls minimum alignment at which shared memory segments
- * get attached.  The IA-64 architecture says that there may be a
- * performance degradation when there are virtual aliases within 1MB.
- * To reduce the chance of this, we set SHMLBA to 1MB. --davidm 00/12/20
- */
-#define        SHMLBA  (1024*1024)
-
-#endif /* _ASM_IA64_SHMPARAM_H */
diff --git a/include/asm-ia64/sigcontext.h b/include/asm-ia64/sigcontext.h
deleted file mode 100644 (file)
index 57ff777..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef _ASM_IA64_SIGCONTEXT_H
-#define _ASM_IA64_SIGCONTEXT_H
-
-/*
- * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
- * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <asm/fpu.h>
-
-#define IA64_SC_FLAG_ONSTACK_BIT               0       /* is handler running on signal stack? */
-#define IA64_SC_FLAG_IN_SYSCALL_BIT            1       /* did signal interrupt a syscall? */
-#define IA64_SC_FLAG_FPH_VALID_BIT             2       /* is state in f[32]-f[127] valid? */
-
-#define IA64_SC_FLAG_ONSTACK           (1 << IA64_SC_FLAG_ONSTACK_BIT)
-#define IA64_SC_FLAG_IN_SYSCALL                (1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
-#define IA64_SC_FLAG_FPH_VALID         (1 << IA64_SC_FLAG_FPH_VALID_BIT)
-
-# ifndef __ASSEMBLY__
-
-/*
- * Note on handling of register backing store: sc_ar_bsp contains the address that would
- * be found in ar.bsp after executing a "cover" instruction the context in which the
- * signal was raised.  If signal delivery required switching to an alternate signal stack
- * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
- * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
- * original one.  In this case, sc_rbs_base contains the base address of the new register
- * backing store.  The number of registers in the dirty partition can be calculated as:
- *
- *   ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
- *
- */
-
-struct sigcontext {
-       unsigned long           sc_flags;       /* see manifest constants above */
-       unsigned long           sc_nat;         /* bit i == 1 iff scratch reg gr[i] is a NaT */
-       stack_t                 sc_stack;       /* previously active stack */
-
-       unsigned long           sc_ip;          /* instruction pointer */
-       unsigned long           sc_cfm;         /* current frame marker */
-       unsigned long           sc_um;          /* user mask bits */
-       unsigned long           sc_ar_rsc;      /* register stack configuration register */
-       unsigned long           sc_ar_bsp;      /* backing store pointer */
-       unsigned long           sc_ar_rnat;     /* RSE NaT collection register */
-       unsigned long           sc_ar_ccv;      /* compare and exchange compare value register */
-       unsigned long           sc_ar_unat;     /* ar.unat of interrupted context */
-       unsigned long           sc_ar_fpsr;     /* floating-point status register */
-       unsigned long           sc_ar_pfs;      /* previous function state */
-       unsigned long           sc_ar_lc;       /* loop count register */
-       unsigned long           sc_pr;          /* predicate registers */
-       unsigned long           sc_br[8];       /* branch registers */
-       /* Note: sc_gr[0] is used as the "uc_link" member of ucontext_t */
-       unsigned long           sc_gr[32];      /* general registers (static partition) */
-       struct ia64_fpreg       sc_fr[128];     /* floating-point registers */
-
-       unsigned long           sc_rbs_base;    /* NULL or new base of sighandler's rbs */
-       unsigned long           sc_loadrs;      /* see description above */
-
-       unsigned long           sc_ar25;        /* cmp8xchg16 uses this */
-       unsigned long           sc_ar26;        /* rsvd for scratch use */
-       unsigned long           sc_rsvd[12];    /* reserved for future use */
-       /*
-        * The mask must come last so we can increase _NSIG_WORDS
-        * without breaking binary compatibility.
-        */
-       sigset_t                sc_mask;        /* signal mask to restore after handler returns */
-};
-
-# endif /* __ASSEMBLY__ */
-#endif /* _ASM_IA64_SIGCONTEXT_H */
diff --git a/include/asm-ia64/siginfo.h b/include/asm-ia64/siginfo.h
deleted file mode 100644 (file)
index 9294e4b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef _ASM_IA64_SIGINFO_H
-#define _ASM_IA64_SIGINFO_H
-
-/*
- * Based on <asm-i386/siginfo.h>.
- *
- * Modified 1998-2002
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
-
-#define HAVE_ARCH_SIGINFO_T
-#define HAVE_ARCH_COPY_SIGINFO
-#define HAVE_ARCH_COPY_SIGINFO_TO_USER
-
-#include <asm-generic/siginfo.h>
-
-typedef struct siginfo {
-       int si_signo;
-       int si_errno;
-       int si_code;
-       int __pad0;
-
-       union {
-               int _pad[SI_PAD_SIZE];
-
-               /* kill() */
-               struct {
-                       pid_t _pid;             /* sender's pid */
-                       uid_t _uid;             /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       timer_t _tid;           /* timer id */
-                       int _overrun;           /* overrun count */
-                       char _pad[sizeof(__ARCH_SI_UID_T) - sizeof(int)];
-                       sigval_t _sigval;       /* must overlay ._rt._sigval! */
-                       int _sys_private;       /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       pid_t _pid;             /* sender's pid */
-                       uid_t _uid;             /* sender's uid */
-                       sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       pid_t _pid;             /* which child */
-                       uid_t _uid;             /* sender's uid */
-                       int _status;            /* exit code */
-                       clock_t _utime;
-                       clock_t _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       void __user *_addr;     /* faulting insn/memory ref. */
-                       int _imm;               /* immediate value for "break" */
-                       unsigned int _flags;    /* see below */
-                       unsigned long _isr;     /* isr */
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       long _band;     /* POLL_IN, POLL_OUT, POLL_MSG (XPG requires a "long") */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-} siginfo_t;
-
-#define si_imm         _sifields._sigfault._imm        /* as per UNIX SysV ABI spec */
-#define si_flags       _sifields._sigfault._flags
-/*
- * si_isr is valid for SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP provided that
- * si_code is non-zero and __ISR_VALID is set in si_flags.
- */
-#define si_isr         _sifields._sigfault._isr
-
-/*
- * Flag values for si_flags:
- */
-#define __ISR_VALID_BIT        0
-#define __ISR_VALID    (1 << __ISR_VALID_BIT)
-
-/*
- * SIGILL si_codes
- */
-#define ILL_BADIADDR   (__SI_FAULT|9)  /* unimplemented instruction address */
-#define __ILL_BREAK    (__SI_FAULT|10) /* illegal break */
-#define __ILL_BNDMOD   (__SI_FAULT|11) /* bundle-update (modification) in progress */
-#undef NSIGILL
-#define NSIGILL                11
-
-/*
- * SIGFPE si_codes
- */
-#define __FPE_DECOVF   (__SI_FAULT|9)  /* decimal overflow */
-#define __FPE_DECDIV   (__SI_FAULT|10) /* decimal division by zero */
-#define __FPE_DECERR   (__SI_FAULT|11) /* packed decimal error */
-#define __FPE_INVASC   (__SI_FAULT|12) /* invalid ASCII digit */
-#define __FPE_INVDEC   (__SI_FAULT|13) /* invalid decimal digit */
-#undef NSIGFPE
-#define NSIGFPE                13
-
-/*
- * SIGSEGV si_codes
- */
-#define __SEGV_PSTKOVF (__SI_FAULT|3)  /* paragraph stack overflow */
-#undef NSIGSEGV
-#define NSIGSEGV       3
-
-/*
- * SIGTRAP si_codes
- */
-#define TRAP_BRANCH    (__SI_FAULT|3)  /* process taken branch trap */
-#define TRAP_HWBKPT    (__SI_FAULT|4)  /* hardware breakpoint or watchpoint */
-#undef NSIGTRAP
-#define NSIGTRAP       4
-
-#ifdef __KERNEL__
-#include <linux/string.h>
-
-static inline void
-copy_siginfo (siginfo_t *to, siginfo_t *from)
-{
-       if (from->si_code < 0)
-               memcpy(to, from, sizeof(siginfo_t));
-       else
-               /* _sigchld is currently the largest know union member */
-               memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigchld));
-}
-
-#endif /* __KERNEL__ */
-
-#endif /* _ASM_IA64_SIGINFO_H */
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
deleted file mode 100644 (file)
index 4f5ca56..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef _ASM_IA64_SIGNAL_H
-#define _ASM_IA64_SIGNAL_H
-
-/*
- * Modified 1998-2001, 2003
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- *
- * Unfortunately, this file is being included by bits/signal.h in
- * glibc-2.x.  Hence the #ifdef __KERNEL__ ugliness.
- */
-
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGBUS          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGUSR1                10
-#define SIGSEGV                11
-#define SIGUSR2                12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGSTKFLT      16
-#define SIGCHLD                17
-#define SIGCONT                18
-#define SIGSTOP                19
-#define SIGTSTP                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGURG         23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGIO          29
-#define SIGPOLL                SIGIO
-/*
-#define SIGLOST                29
-*/
-#define SIGPWR         30
-#define SIGSYS         31
-/* signal 31 is no longer "unused", but the SIGUNUSED macro remains for backwards compatibility */
-#define        SIGUNUSED       31
-
-/* 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_NOCLDSTOP   0x00000001
-#define SA_NOCLDWAIT   0x00000002
-#define SA_SIGINFO     0x00000004
-#define SA_ONSTACK     0x08000000
-#define SA_RESTART     0x10000000
-#define SA_NODEFER     0x40000000
-#define SA_RESETHAND   0x80000000
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-#define SA_RESTORER    0x04000000
-
-/*
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-/*
- * The minimum stack size needs to be fairly large because we want to
- * be sure that an app compiled for today's CPUs will continue to run
- * on all future CPU models.  The CPU model matters because the signal
- * frame needs to have space for the complete machine state, including
- * all physical stacked registers.  The number of physical stacked
- * registers is CPU model dependent, but given that the width of
- * ar.rsc.loadrs is 14 bits, we can assume that they'll never take up
- * more than 16KB of space.
- */
-#if 1
-  /*
-   * This is a stupid typo: the value was _meant_ to be 131072 (0x20000), but I typed it
-   * in wrong. ;-(  To preserve backwards compatibility, we leave the kernel at the
-   * incorrect value and fix libc only.
-   */
-# define MINSIGSTKSZ   131027  /* min. stack size for sigaltstack() */
-#else
-# define MINSIGSTKSZ   131072  /* min. stack size for sigaltstack() */
-#endif
-#define SIGSTKSZ       262144  /* default stack size for sigaltstack() */
-
-#ifdef __KERNEL__
-
-#define _NSIG          64
-#define _NSIG_BPW      64
-#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
-
-#endif /* __KERNEL__ */
-
-#include <asm-generic/signal.h>
-
-# ifndef __ASSEMBLY__
-
-#  include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-
-typedef struct sigaltstack {
-       void __user *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-#ifdef __KERNEL__
-
-/* Most things should be clean enough to redefine this at will, if care
-   is taken to make libc match.  */
-
-typedef unsigned long old_sigset_t;
-
-typedef struct {
-       unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-struct sigaction {
-       __sighandler_t sa_handler;
-       unsigned long sa_flags;
-       sigset_t sa_mask;               /* mask last for extensibility */
-};
-
-struct k_sigaction {
-       struct sigaction sa;
-};
-
-#  include <asm/sigcontext.h>
-
-#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-
-#endif /* __KERNEL__ */
-
-# endif /* !__ASSEMBLY__ */
-#endif /* _ASM_IA64_SIGNAL_H */
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
deleted file mode 100644 (file)
index 12d96e0..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * SMP Support
- *
- * Copyright (C) 1999 VA Linux Systems
- * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P.
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Bjorn Helgaas <bjorn.helgaas@hp.com>
- */
-#ifndef _ASM_IA64_SMP_H
-#define _ASM_IA64_SMP_H
-
-#include <linux/init.h>
-#include <linux/threads.h>
-#include <linux/kernel.h>
-#include <linux/cpumask.h>
-#include <linux/bitops.h>
-#include <linux/irqreturn.h>
-
-#include <asm/io.h>
-#include <asm/param.h>
-#include <asm/processor.h>
-#include <asm/ptrace.h>
-
-static inline unsigned int
-ia64_get_lid (void)
-{
-       union {
-               struct {
-                       unsigned long reserved : 16;
-                       unsigned long eid : 8;
-                       unsigned long id : 8;
-                       unsigned long ignored : 32;
-               } f;
-               unsigned long bits;
-       } lid;
-
-       lid.bits = ia64_getreg(_IA64_REG_CR_LID);
-       return lid.f.id << 8 | lid.f.eid;
-}
-
-#define hard_smp_processor_id()                ia64_get_lid()
-
-#ifdef CONFIG_SMP
-
-#define XTP_OFFSET             0x1e0008
-
-#define SMP_IRQ_REDIRECTION    (1 << 0)
-#define SMP_IPI_REDIRECTION    (1 << 1)
-
-#define raw_smp_processor_id() (current_thread_info()->cpu)
-
-extern struct smp_boot_data {
-       int cpu_count;
-       int cpu_phys_id[NR_CPUS];
-} smp_boot_data __initdata;
-
-extern char no_int_routing __devinitdata;
-
-extern cpumask_t cpu_online_map;
-extern cpumask_t cpu_core_map[NR_CPUS];
-DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
-extern int smp_num_siblings;
-extern void __iomem *ipi_base_addr;
-extern unsigned char smp_int_redirect;
-
-extern volatile int ia64_cpu_to_sapicid[];
-#define cpu_physical_id(i)     ia64_cpu_to_sapicid[i]
-
-extern unsigned long ap_wakeup_vector;
-
-/*
- * Function to map hard smp processor id to logical id.  Slow, so don't use this in
- * performance-critical code.
- */
-static inline int
-cpu_logical_id (int cpuid)
-{
-       int i;
-
-       for (i = 0; i < NR_CPUS; ++i)
-               if (cpu_physical_id(i) == cpuid)
-                       break;
-       return i;
-}
-
-/*
- * XTP control functions:
- *     min_xtp   : route all interrupts to this CPU
- *     normal_xtp: nominal XTP value
- *     max_xtp   : never deliver interrupts to this CPU.
- */
-
-static inline void
-min_xtp (void)
-{
-       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
-               writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
-}
-
-static inline void
-normal_xtp (void)
-{
-       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
-               writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
-}
-
-static inline void
-max_xtp (void)
-{
-       if (smp_int_redirect & SMP_IRQ_REDIRECTION)
-               writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
-}
-
-/* Upping and downing of CPUs */
-extern int __cpu_disable (void);
-extern void __cpu_die (unsigned int cpu);
-extern void cpu_die (void) __attribute__ ((noreturn));
-extern void __init smp_build_cpu_map(void);
-
-extern void __init init_smp_config (void);
-extern void smp_do_timer (struct pt_regs *regs);
-
-extern irqreturn_t handle_IPI(int irq, void *dev_id);
-extern void smp_send_reschedule (int cpu);
-extern void identify_siblings (struct cpuinfo_ia64 *);
-extern int is_multithreading_enabled(void);
-
-extern void arch_send_call_function_single_ipi(int cpu);
-extern void arch_send_call_function_ipi(cpumask_t mask);
-
-#else /* CONFIG_SMP */
-
-#define cpu_logical_id(i)              0
-#define cpu_physical_id(i)             ia64_get_lid()
-
-#endif /* CONFIG_SMP */
-#endif /* _ASM_IA64_SMP_H */
diff --git a/include/asm-ia64/sn/acpi.h b/include/asm-ia64/sn/acpi.h
deleted file mode 100644 (file)
index 9ce2801..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * 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) 2006 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_ACPI_H
-#define _ASM_IA64_SN_ACPI_H
-
-#include "acpi/acglobal.h"
-
-extern int sn_acpi_rev;
-#define SN_ACPI_BASE_SUPPORT()   (sn_acpi_rev >= 0x20101)
-
-#endif /* _ASM_IA64_SN_ACPI_H */
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
deleted file mode 100644 (file)
index e715c79..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * 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) 1992-1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_ADDRS_H
-#define _ASM_IA64_SN_ADDRS_H
-
-#include <asm/percpu.h>
-#include <asm/sn/types.h>
-#include <asm/sn/arch.h>
-#include <asm/sn/pda.h>
-
-/*
- *  Memory/SHUB Address Format:
- *  +-+---------+--+--------------+
- *  |0|  NASID  |AS| NodeOffset   |
- *  +-+---------+--+--------------+
- *
- *  NASID: (low NASID bit is 0) Memory and SHUB MMRs
- *   AS: 2-bit Address Space Identifier. Used only if low NASID bit is 0
- *     00: Local Resources and MMR space
- *           Top bit of NodeOffset
- *               0: Local resources space
- *                  node id:
- *                        0: IA64/NT compatibility space
- *                        2: Local MMR Space
- *                        4: Local memory, regardless of local node id
- *               1: Global MMR space
- *     01: GET space.
- *     10: AMO space.
- *     11: Cacheable memory space.
- *
- *   NodeOffset: byte offset
- *
- *
- *  TIO address format:
- *  +-+----------+--+--------------+
- *  |0|  NASID   |AS| Nodeoffset   |
- *  +-+----------+--+--------------+
- *
- *  NASID: (low NASID bit is 1) TIO
- *   AS: 2-bit Chiplet Identifier
- *     00: TIO LB (Indicates TIO MMR access.)
- *     01: TIO ICE (indicates coretalk space access.)
- * 
- *   NodeOffset: top bit must be set.
- *
- *
- * Note that in both of the above address formats, the low
- * NASID bit indicates if the reference is to the SHUB or TIO MMRs.
- */
-
-
-/*
- * Define basic shift & mask constants for manipulating NASIDs and AS values.
- */
-#define NASID_BITMASK          (sn_hub_info->nasid_bitmask)
-#define NASID_SHIFT            (sn_hub_info->nasid_shift)
-#define AS_SHIFT               (sn_hub_info->as_shift)
-#define AS_BITMASK             0x3UL
-
-#define NASID_MASK              ((u64)NASID_BITMASK << NASID_SHIFT)
-#define AS_MASK                        ((u64)AS_BITMASK << AS_SHIFT)
-
-
-/*
- * AS values. These are the same on both SHUB1 & SHUB2.
- */
-#define AS_GET_VAL             1UL
-#define AS_AMO_VAL             2UL
-#define AS_CAC_VAL             3UL
-#define AS_GET_SPACE           (AS_GET_VAL << AS_SHIFT)
-#define AS_AMO_SPACE           (AS_AMO_VAL << AS_SHIFT)
-#define AS_CAC_SPACE           (AS_CAC_VAL << AS_SHIFT)
-
-
-/* 
- * Virtual Mode Local & Global MMR space.  
- */
-#define SH1_LOCAL_MMR_OFFSET   0x8000000000UL
-#define SH2_LOCAL_MMR_OFFSET   0x0200000000UL
-#define LOCAL_MMR_OFFSET       (is_shub2() ? SH2_LOCAL_MMR_OFFSET : SH1_LOCAL_MMR_OFFSET)
-#define LOCAL_MMR_SPACE                (__IA64_UNCACHED_OFFSET | LOCAL_MMR_OFFSET)
-#define LOCAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | LOCAL_MMR_OFFSET)
-
-#define SH1_GLOBAL_MMR_OFFSET  0x0800000000UL
-#define SH2_GLOBAL_MMR_OFFSET  0x0300000000UL
-#define GLOBAL_MMR_OFFSET      (is_shub2() ? SH2_GLOBAL_MMR_OFFSET : SH1_GLOBAL_MMR_OFFSET)
-#define GLOBAL_MMR_SPACE       (__IA64_UNCACHED_OFFSET | GLOBAL_MMR_OFFSET)
-
-/*
- * Physical mode addresses
- */
-#define GLOBAL_PHYS_MMR_SPACE  (RGN_BASE(RGN_HPAGE) | GLOBAL_MMR_OFFSET)
-
-
-/*
- * Clear region & AS bits.
- */
-#define TO_PHYS_MASK           (~(RGN_BITS | AS_MASK))
-
-
-/*
- * Misc NASID manipulation.
- */
-#define NASID_SPACE(n)         ((u64)(n) << NASID_SHIFT)
-#define REMOTE_ADDR(n,a)       (NASID_SPACE(n) | (a))
-#define NODE_OFFSET(x)         ((x) & (NODE_ADDRSPACE_SIZE - 1))
-#define NODE_ADDRSPACE_SIZE     (1UL << AS_SHIFT)
-#define NASID_GET(x)           (int) (((u64) (x) >> NASID_SHIFT) & NASID_BITMASK)
-#define LOCAL_MMR_ADDR(a)      (LOCAL_MMR_SPACE | (a))
-#define GLOBAL_MMR_ADDR(n,a)   (GLOBAL_MMR_SPACE | REMOTE_ADDR(n,a))
-#define GLOBAL_MMR_PHYS_ADDR(n,a) (GLOBAL_PHYS_MMR_SPACE | REMOTE_ADDR(n,a))
-#define GLOBAL_CAC_ADDR(n,a)   (CAC_BASE | REMOTE_ADDR(n,a))
-#define CHANGE_NASID(n,x)      ((void *)(((u64)(x) & ~NASID_MASK) | NASID_SPACE(n)))
-#define IS_TIO_NASID(n)                ((n) & 1)
-
-
-/* non-II mmr's start at top of big window space (4G) */
-#define BWIN_TOP               0x0000000100000000UL
-
-/*
- * general address defines
- */
-#define CAC_BASE               (PAGE_OFFSET | AS_CAC_SPACE)
-#define AMO_BASE               (__IA64_UNCACHED_OFFSET | AS_AMO_SPACE)
-#define AMO_PHYS_BASE          (RGN_BASE(RGN_HPAGE) | AS_AMO_SPACE)
-#define GET_BASE               (PAGE_OFFSET | AS_GET_SPACE)
-
-/*
- * Convert Memory addresses between various addressing modes.
- */
-#define TO_PHYS(x)             (TO_PHYS_MASK & (x))
-#define TO_CAC(x)              (CAC_BASE     | TO_PHYS(x))
-#ifdef CONFIG_SGI_SN
-#define TO_AMO(x)              (AMO_BASE     | TO_PHYS(x))
-#define TO_GET(x)              (GET_BASE     | TO_PHYS(x))
-#else
-#define TO_AMO(x)              ({ BUG(); x; })
-#define TO_GET(x)              ({ BUG(); x; })
-#endif
-
-/*
- * Covert from processor physical address to II/TIO physical address:
- *     II - squeeze out the AS bits
- *     TIO- requires a chiplet id in bits 38-39.  For DMA to memory,
- *           the chiplet id is zero.  If we implement TIO-TIO dma, we might need
- *           to insert a chiplet id into this macro.  However, it is our belief
- *           right now that this chiplet id will be ICE, which is also zero.
- */
-#define SH1_TIO_PHYS_TO_DMA(x)                                                 \
-       ((((u64)(NASID_GET(x))) << 40) | NODE_OFFSET(x))
-
-#define SH2_NETWORK_BANK_OFFSET(x)                                     \
-        ((u64)(x) & ((1UL << (sn_hub_info->nasid_shift - 4)) -1))
-
-#define SH2_NETWORK_BANK_SELECT(x)                                     \
-        ((((u64)(x) & (0x3UL << (sn_hub_info->nasid_shift - 4)))       \
-               >> (sn_hub_info->nasid_shift - 4)) << 36)
-
-#define SH2_NETWORK_ADDRESS(x)                                                 \
-       (SH2_NETWORK_BANK_OFFSET(x) | SH2_NETWORK_BANK_SELECT(x))
-
-#define SH2_TIO_PHYS_TO_DMA(x)                                                 \
-        (((u64)(NASID_GET(x)) << 40) |         SH2_NETWORK_ADDRESS(x))
-
-#define PHYS_TO_TIODMA(x)                                              \
-       (is_shub1() ? SH1_TIO_PHYS_TO_DMA(x) : SH2_TIO_PHYS_TO_DMA(x))
-
-#define PHYS_TO_DMA(x)                                                 \
-       ((((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x))
-
-
-/*
- * Macros to test for address type.
- */
-#define IS_AMO_ADDRESS(x)      (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_BASE)
-#define IS_AMO_PHYS_ADDRESS(x) (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_PHYS_BASE)
-
-
-/*
- * The following definitions pertain to the IO special address
- * space.  They define the location of the big and little windows
- * of any given node.
- */
-#define BWIN_SIZE_BITS                 29      /* big window size: 512M */
-#define TIO_BWIN_SIZE_BITS             30      /* big window size: 1G */
-#define NODE_SWIN_BASE(n, w)           ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \
-               : RAW_NODE_SWIN_BASE(n, w))
-#define TIO_SWIN_BASE(n, w)            (TIO_IO_BASE(n) + \
-                                           ((u64) (w) << TIO_SWIN_SIZE_BITS))
-#define NODE_IO_BASE(n)                        (GLOBAL_MMR_SPACE | NASID_SPACE(n))
-#define TIO_IO_BASE(n)                  (__IA64_UNCACHED_OFFSET | NASID_SPACE(n))
-#define BWIN_SIZE                      (1UL << BWIN_SIZE_BITS)
-#define NODE_BWIN_BASE0(n)             (NODE_IO_BASE(n) + BWIN_SIZE)
-#define NODE_BWIN_BASE(n, w)           (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS))
-#define RAW_NODE_SWIN_BASE(n, w)       (NODE_IO_BASE(n) + ((u64) (w) << SWIN_SIZE_BITS))
-#define BWIN_WIDGET_MASK               0x7
-#define BWIN_WINDOWNUM(x)              (((x) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
-#define SH1_IS_BIG_WINDOW_ADDR(x)      ((x) & BWIN_TOP)
-
-#define TIO_BWIN_WINDOW_SELECT_MASK    0x7
-#define TIO_BWIN_WINDOWNUM(x)          (((x) >> TIO_BWIN_SIZE_BITS) & TIO_BWIN_WINDOW_SELECT_MASK)
-
-#define TIO_HWIN_SHIFT_BITS            33
-#define TIO_HWIN(x)                    (NODE_OFFSET(x) >> TIO_HWIN_SHIFT_BITS)
-
-/*
- * The following definitions pertain to the IO special address
- * space.  They define the location of the big and little windows
- * of any given node.
- */
-
-#define SWIN_SIZE_BITS                 24
-#define        SWIN_WIDGET_MASK                0xF
-
-#define TIO_SWIN_SIZE_BITS             28
-#define TIO_SWIN_SIZE                  (1UL << TIO_SWIN_SIZE_BITS)
-#define TIO_SWIN_WIDGET_MASK           0x3
-
-/*
- * Convert smallwindow address to xtalk address.
- *
- * 'addr' can be physical or virtual address, but will be converted
- * to Xtalk address in the range 0 -> SWINZ_SIZEMASK
- */
-#define        SWIN_WIDGETNUM(x)               (((x)  >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK)
-#define TIO_SWIN_WIDGETNUM(x)          (((x)  >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK)
-
-
-/*
- * The following macros produce the correct base virtual address for
- * the hub registers. The REMOTE_HUB_* macro produce
- * the address for the specified hub's registers.  The intent is
- * that the appropriate PI, MD, NI, or II register would be substituted
- * for x.
- *
- *   WARNING:
- *     When certain Hub chip workaround are defined, it's not sufficient
- *     to dereference the *_HUB_ADDR() macros.  You should instead use
- *     HUB_L() and HUB_S() if you must deal with pointers to hub registers.
- *     Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S().
- *     They're always safe.
- */
-/* Shub1 TIO & MMR addressing macros */
-#define SH1_TIO_IOSPACE_ADDR(n,x)                                      \
-       GLOBAL_MMR_ADDR(n,x)
-
-#define SH1_REMOTE_BWIN_MMR(n,x)                                       \
-       GLOBAL_MMR_ADDR(n,x)
-
-#define SH1_REMOTE_SWIN_MMR(n,x)                                       \
-       (NODE_SWIN_BASE(n,1) + 0x800000UL + (x))
-
-#define SH1_REMOTE_MMR(n,x)                                            \
-       (SH1_IS_BIG_WINDOW_ADDR(x) ? SH1_REMOTE_BWIN_MMR(n,x) :         \
-               SH1_REMOTE_SWIN_MMR(n,x))
-
-/* Shub1 TIO & MMR addressing macros */
-#define SH2_TIO_IOSPACE_ADDR(n,x)                                      \
-       ((__IA64_UNCACHED_OFFSET | REMOTE_ADDR(n,x) | 1UL << (NASID_SHIFT - 2)))
-
-#define SH2_REMOTE_MMR(n,x)                                            \
-       GLOBAL_MMR_ADDR(n,x)
-
-
-/* TIO & MMR addressing macros that work on both shub1 & shub2 */
-#define TIO_IOSPACE_ADDR(n,x)                                          \
-       ((u64 *)(is_shub1() ? SH1_TIO_IOSPACE_ADDR(n,x) :               \
-                SH2_TIO_IOSPACE_ADDR(n,x)))
-
-#define SH_REMOTE_MMR(n,x)                                             \
-       (is_shub1() ? SH1_REMOTE_MMR(n,x) : SH2_REMOTE_MMR(n,x))
-
-#define REMOTE_HUB_ADDR(n,x)                                           \
-       (IS_TIO_NASID(n) ?  ((volatile u64*)TIO_IOSPACE_ADDR(n,x)) :    \
-        ((volatile u64*)SH_REMOTE_MMR(n,x)))
-
-
-#define HUB_L(x)                       (*((volatile typeof(*x) *)x))
-#define        HUB_S(x,d)                      (*((volatile typeof(*x) *)x) = (d))
-
-#define REMOTE_HUB_L(n, a)             HUB_L(REMOTE_HUB_ADDR((n), (a)))
-#define REMOTE_HUB_S(n, a, d)          HUB_S(REMOTE_HUB_ADDR((n), (a)), (d))
-
-/*
- * Coretalk address breakdown
- */
-#define CTALK_NASID_SHFT               40
-#define CTALK_NASID_MASK               (0x3FFFULL << CTALK_NASID_SHFT)
-#define CTALK_CID_SHFT                 38
-#define CTALK_CID_MASK                 (0x3ULL << CTALK_CID_SHFT)
-#define CTALK_NODE_OFFSET              0x3FFFFFFFFF
-
-#endif /* _ASM_IA64_SN_ADDRS_H */
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
deleted file mode 100644 (file)
index 7caa1f4..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- *
- * SGI specific setup.
- *
- * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc.  All rights reserved.
- * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
- */
-#ifndef _ASM_IA64_SN_ARCH_H
-#define _ASM_IA64_SN_ARCH_H
-
-#include <linux/numa.h>
-#include <asm/types.h>
-#include <asm/percpu.h>
-#include <asm/sn/types.h>
-#include <asm/sn/sn_cpuid.h>
-
-/*
- * This is the maximum number of NUMALINK nodes that can be part of a single
- * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in
- * remote partitions are NOT included in this number.
- * The number of compact nodes cannot exceed size of a coherency domain.
- * The purpose of this define is to specify a node count that includes
- * all C/M/TIO nodes in an SSI system.
- *
- * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes.
- *
- *     Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade
- *     to ACPI3.0, this limit will be removed. The notion of "compact nodes"
- *     should be deleted and TIOs should be included in MAX_NUMNODES.
- */
-#define MAX_TIO_NODES          MAX_NUMNODES
-#define MAX_COMPACT_NODES      (MAX_NUMNODES + MAX_TIO_NODES)
-
-/*
- * Maximum number of nodes in all partitions and in all coherency domains.
- * This is the total number of nodes accessible in the numalink fabric. It
- * includes all C & M bricks, plus all TIOs.
- *
- * This value is also the value of the maximum number of NASIDs in the numalink
- * fabric.
- */
-#define MAX_NUMALINK_NODES     16384
-
-/*
- * The following defines attributes of the HUB chip. These attributes are
- * frequently referenced. They are kept in the per-cpu data areas of each cpu.
- * They are kept together in a struct to minimize cache misses.
- */
-struct sn_hub_info_s {
-       u8 shub2;
-       u8 nasid_shift;
-       u8 as_shift;
-       u8 shub_1_1_found;
-       u16 nasid_bitmask;
-};
-DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
-#define sn_hub_info    (&__get_cpu_var(__sn_hub_info))
-#define is_shub2()     (sn_hub_info->shub2)
-#define is_shub1()     (sn_hub_info->shub2 == 0)
-
-/*
- * Use this macro to test if shub 1.1 wars should be enabled
- */
-#define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found)
-
-
-/*
- * Compact node ID to nasid mappings kept in the per-cpu data areas of each
- * cpu.
- */
-DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]);
-#define sn_cnodeid_to_nasid    (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
-
-
-extern u8 sn_partition_id;
-extern u8 sn_system_size;
-extern u8 sn_sharing_domain_size;
-extern u8 sn_region_size;
-
-extern void sn_flush_all_caches(long addr, long bytes);
-extern bool sn_cpu_disable_allowed(int cpu);
-
-#endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h
deleted file mode 100644 (file)
index a0d214f..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * 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) 2000-2007 Silicon Graphics, Inc.  All Rights Reserved.
- */
-
-
-#ifndef _ASM_IA64_SN_BTE_H
-#define _ASM_IA64_SN_BTE_H
-
-#include <linux/timer.h>
-#include <linux/spinlock.h>
-#include <linux/cache.h>
-#include <asm/sn/pda.h>
-#include <asm/sn/types.h>
-#include <asm/sn/shub_mmr.h>
-
-#define IBCT_NOTIFY             (0x1UL << 4)
-#define IBCT_ZFIL_MODE          (0x1UL << 0)
-
-/* #define BTE_DEBUG */
-/* #define BTE_DEBUG_VERBOSE */
-
-#ifdef BTE_DEBUG
-#  define BTE_PRINTK(x) printk x       /* Terse */
-#  ifdef BTE_DEBUG_VERBOSE
-#    define BTE_PRINTKV(x) printk x    /* Verbose */
-#  else
-#    define BTE_PRINTKV(x)
-#  endif /* BTE_DEBUG_VERBOSE */
-#else
-#  define BTE_PRINTK(x)
-#  define BTE_PRINTKV(x)
-#endif /* BTE_DEBUG */
-
-
-/* BTE status register only supports 16 bits for length field */
-#define BTE_LEN_BITS (16)
-#define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1)
-#define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES)
-
-
-/* Define hardware */
-#define BTES_PER_NODE (is_shub2() ? 4 : 2)
-#define MAX_BTES_PER_NODE 4
-
-#define BTE2OFF_CTRL   0
-#define BTE2OFF_SRC    (SH2_BT_ENG_SRC_ADDR_0 - SH2_BT_ENG_CSR_0)
-#define BTE2OFF_DEST   (SH2_BT_ENG_DEST_ADDR_0 - SH2_BT_ENG_CSR_0)
-#define BTE2OFF_NOTIFY (SH2_BT_ENG_NOTIF_ADDR_0 - SH2_BT_ENG_CSR_0)
-
-#define BTE_BASE_ADDR(interface)                               \
-    (is_shub2() ? (interface == 0) ? SH2_BT_ENG_CSR_0 :                \
-                 (interface == 1) ? SH2_BT_ENG_CSR_1 :         \
-                 (interface == 2) ? SH2_BT_ENG_CSR_2 :         \
-                                    SH2_BT_ENG_CSR_3           \
-               : (interface == 0) ? IIO_IBLS0 : IIO_IBLS1)
-
-#define BTE_SOURCE_ADDR(base)                                  \
-    (is_shub2() ? base + (BTE2OFF_SRC/8)                       \
-               : base + (BTEOFF_SRC/8))
-
-#define BTE_DEST_ADDR(base)                                    \
-    (is_shub2() ? base + (BTE2OFF_DEST/8)                      \
-               : base + (BTEOFF_DEST/8))
-
-#define BTE_CTRL_ADDR(base)                                    \
-    (is_shub2() ? base + (BTE2OFF_CTRL/8)                      \
-               : base + (BTEOFF_CTRL/8))
-
-#define BTE_NOTIF_ADDR(base)                                   \
-    (is_shub2() ? base + (BTE2OFF_NOTIFY/8)                    \
-               : base + (BTEOFF_NOTIFY/8))
-
-/* Define hardware modes */
-#define BTE_NOTIFY IBCT_NOTIFY
-#define BTE_NORMAL BTE_NOTIFY
-#define BTE_ZERO_FILL (BTE_NOTIFY | IBCT_ZFIL_MODE)
-/* Use a reserved bit to let the caller specify a wait for any BTE */
-#define BTE_WACQUIRE 0x4000
-/* Use the BTE on the node with the destination memory */
-#define BTE_USE_DEST (BTE_WACQUIRE << 1)
-/* Use any available BTE interface on any node for the transfer */
-#define BTE_USE_ANY (BTE_USE_DEST << 1)
-/* macro to force the IBCT0 value valid */
-#define BTE_VALID_MODE(x) ((x) & (IBCT_NOTIFY | IBCT_ZFIL_MODE))
-
-#define BTE_ACTIVE             (IBLS_BUSY | IBLS_ERROR)
-#define BTE_WORD_AVAILABLE     (IBLS_BUSY << 1)
-#define BTE_WORD_BUSY          (~BTE_WORD_AVAILABLE)
-
-/*
- * Some macros to simplify reading.
- * Start with macros to locate the BTE control registers.
- */
-#define BTE_LNSTAT_LOAD(_bte)                                          \
-                       HUB_L(_bte->bte_base_addr)
-#define BTE_LNSTAT_STORE(_bte, _x)                                     \
-                       HUB_S(_bte->bte_base_addr, (_x))
-#define BTE_SRC_STORE(_bte, _x)                                                \
-({                                                                     \
-               u64 __addr = ((_x) & ~AS_MASK);                         \
-               if (is_shub2())                                         \
-                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
-               HUB_S(_bte->bte_source_addr, __addr);                   \
-})
-#define BTE_DEST_STORE(_bte, _x)                                       \
-({                                                                     \
-               u64 __addr = ((_x) & ~AS_MASK);                         \
-               if (is_shub2())                                         \
-                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
-               HUB_S(_bte->bte_destination_addr, __addr);              \
-})
-#define BTE_CTRL_STORE(_bte, _x)                                       \
-                       HUB_S(_bte->bte_control_addr, (_x))
-#define BTE_NOTIF_STORE(_bte, _x)                                      \
-({                                                                     \
-               u64 __addr = ia64_tpa((_x) & ~AS_MASK);                 \
-               if (is_shub2())                                         \
-                       __addr = SH2_TIO_PHYS_TO_DMA(__addr);           \
-               HUB_S(_bte->bte_notify_addr, __addr);                   \
-})
-
-#define BTE_START_TRANSFER(_bte, _len, _mode)                          \
-       is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \
-               : BTE_LNSTAT_STORE(_bte, _len);                         \
-                 BTE_CTRL_STORE(_bte, _mode)
-
-/* Possible results from bte_copy and bte_unaligned_copy */
-/* The following error codes map into the BTE hardware codes
- * IIO_ICRB_ECODE_* (in shubio.h). The hardware uses
- * an error code of 0 (IIO_ICRB_ECODE_DERR), but we want zero
- * to mean BTE_SUCCESS, so add one (BTEFAIL_OFFSET) to the error
- * codes to give the following error codes.
- */
-#define BTEFAIL_OFFSET 1
-
-typedef enum {
-       BTE_SUCCESS,            /* 0 is success */
-       BTEFAIL_DIR,            /* Directory error due to IIO access*/
-       BTEFAIL_POISON,         /* poison error on IO access (write to poison page) */
-       BTEFAIL_WERR,           /* Write error (ie WINV to a Read only line) */
-       BTEFAIL_ACCESS,         /* access error (protection violation) */
-       BTEFAIL_PWERR,          /* Partial Write Error */
-       BTEFAIL_PRERR,          /* Partial Read Error */
-       BTEFAIL_TOUT,           /* CRB Time out */
-       BTEFAIL_XTERR,          /* Incoming xtalk pkt had error bit */
-       BTEFAIL_NOTAVAIL,       /* BTE not available */
-} bte_result_t;
-
-#define BTEFAIL_SH2_RESP_SHORT 0x1     /* bit 000001 */
-#define BTEFAIL_SH2_RESP_LONG  0x2     /* bit 000010 */
-#define BTEFAIL_SH2_RESP_DSP   0x4     /* bit 000100 */
-#define BTEFAIL_SH2_RESP_ACCESS        0x8     /* bit 001000 */
-#define BTEFAIL_SH2_CRB_TO     0x10    /* bit 010000 */
-#define BTEFAIL_SH2_NACK_LIMIT 0x20    /* bit 100000 */
-#define BTEFAIL_SH2_ALL                0x3F    /* bit 111111 */
-
-#define        BTE_ERR_BITS    0x3FUL
-#define        BTE_ERR_SHIFT   36
-#define BTE_ERR_MASK   (BTE_ERR_BITS << BTE_ERR_SHIFT)
-
-#define BTE_ERROR_RETRY(value)                                         \
-       (is_shub2() ? (value != BTEFAIL_SH2_CRB_TO)                     \
-               : (value != BTEFAIL_TOUT))
-
-/*
- * On shub1 BTE_ERR_MASK will always be false, so no need for is_shub2()
- */
-#define BTE_SHUB2_ERROR(_status)                                       \
-       ((_status & BTE_ERR_MASK)                                       \
-          ? (((_status >> BTE_ERR_SHIFT) & BTE_ERR_BITS) | IBLS_ERROR) \
-          : _status)
-
-#define BTE_GET_ERROR_STATUS(_status)                                  \
-       (BTE_SHUB2_ERROR(_status) & ~IBLS_ERROR)
-
-#define BTE_VALID_SH2_ERROR(value)                                     \
-       ((value >= BTEFAIL_SH2_RESP_SHORT) && (value <= BTEFAIL_SH2_ALL))
-
-/*
- * Structure defining a bte.  An instance of this
- * structure is created in the nodepda for each
- * bte on that node (as defined by BTES_PER_NODE)
- * This structure contains everything necessary
- * to work with a BTE.
- */
-struct bteinfo_s {
-       volatile u64 notify ____cacheline_aligned;
-       u64 *bte_base_addr ____cacheline_aligned;
-       u64 *bte_source_addr;
-       u64 *bte_destination_addr;
-       u64 *bte_control_addr;
-       u64 *bte_notify_addr;
-       spinlock_t spinlock;
-       cnodeid_t bte_cnode;    /* cnode                            */
-       int bte_error_count;    /* Number of errors encountered     */
-       int bte_num;            /* 0 --> BTE0, 1 --> BTE1           */
-       int cleanup_active;     /* Interface is locked for cleanup  */
-       volatile bte_result_t bh_error; /* error while processing   */
-       volatile u64 *most_rcnt_na;
-       struct bteinfo_s *btes_to_try[MAX_BTES_PER_NODE];
-};
-
-
-/*
- * Function prototypes (functions defined in bte.c, used elsewhere)
- */
-extern bte_result_t bte_copy(u64, u64, u64, u64, void *);
-extern bte_result_t bte_unaligned_copy(u64, u64, u64, u64);
-extern void bte_error_handler(unsigned long);
-
-#define bte_zero(dest, len, mode, notification) \
-       bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)
-
-/*
- * The following is the prefered way of calling bte_unaligned_copy
- * If the copy is fully cache line aligned, then bte_copy is
- * used instead.  Since bte_copy is inlined, this saves a call
- * stack.  NOTE: bte_copy is called synchronously and does block
- * until the transfer is complete.  In order to get the asynch
- * version of bte_copy, you must perform this check yourself.
- */
-#define BTE_UNALIGNED_COPY(src, dest, len, mode)                        \
-       (((len & L1_CACHE_MASK) || (src & L1_CACHE_MASK) ||             \
-         (dest & L1_CACHE_MASK)) ?                                     \
-        bte_unaligned_copy(src, dest, len, mode) :                     \
-        bte_copy(src, dest, len, mode, NULL))
-
-
-#endif /* _ASM_IA64_SN_BTE_H */
diff --git a/include/asm-ia64/sn/clksupport.h b/include/asm-ia64/sn/clksupport.h
deleted file mode 100644 (file)
index d340c36..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
- */
-
-/*
- * This file contains definitions for accessing a platform supported high resolution
- * clock. The clock is monitonically increasing and can be accessed from any node
- * in the system. The clock is synchronized across nodes - all nodes see the
- * same value.
- * 
- *     RTC_COUNTER_ADDR - contains the address of the counter 
- *
- */
-
-#ifndef _ASM_IA64_SN_CLKSUPPORT_H
-#define _ASM_IA64_SN_CLKSUPPORT_H
-
-extern unsigned long sn_rtc_cycles_per_second;
-
-#define RTC_COUNTER_ADDR       ((long *)LOCAL_MMR_ADDR(SH_RTC))
-
-#define rtc_time()             (*RTC_COUNTER_ADDR)
-
-#endif /* _ASM_IA64_SN_CLKSUPPORT_H */
diff --git a/include/asm-ia64/sn/geo.h b/include/asm-ia64/sn/geo.h
deleted file mode 100644 (file)
index f083c94..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_GEO_H
-#define _ASM_IA64_SN_GEO_H
-
-/* The geoid_t implementation below is based loosely on the pcfg_t
-   implementation in sys/SN/promcfg.h. */
-
-/* Type declaractions */
-
-/* Size of a geoid_t structure (must be before decl. of geoid_u) */
-#define GEOID_SIZE     8       /* Would 16 be better?  The size can
-                                  be different on different platforms. */
-
-#define MAX_SLOTS      0xf     /* slots per module */
-#define MAX_SLABS      0xf     /* slabs per slot */
-
-typedef unsigned char  geo_type_t;
-
-/* Fields common to all substructures */
-typedef struct geo_common_s {
-    moduleid_t module;         /* The module (box) this h/w lives in */
-    geo_type_t type;           /* What type of h/w is named by this geoid_t */
-    slabid_t   slab:4;         /* slab (ASIC), 0 .. 15 within slot */
-    slotid_t   slot:4;         /* slot (Blade), 0 .. 15 within module */
-} geo_common_t;
-
-/* Additional fields for particular types of hardware */
-typedef struct geo_node_s {
-    geo_common_t       common;         /* No additional fields needed */
-} geo_node_t;
-
-typedef struct geo_rtr_s {
-    geo_common_t       common;         /* No additional fields needed */
-} geo_rtr_t;
-
-typedef struct geo_iocntl_s {
-    geo_common_t       common;         /* No additional fields needed */
-} geo_iocntl_t;
-
-typedef struct geo_pcicard_s {
-    geo_iocntl_t       common;
-    char               bus;    /* Bus/widget number */
-    char               slot;   /* PCI slot number */
-} geo_pcicard_t;
-
-/* Subcomponents of a node */
-typedef struct geo_cpu_s {
-    geo_node_t node;
-    char       slice;          /* Which CPU on the node */
-} geo_cpu_t;
-
-typedef struct geo_mem_s {
-    geo_node_t node;
-    char       membus;         /* The memory bus on the node */
-    char       memslot;        /* The memory slot on the bus */
-} geo_mem_t;
-
-
-typedef union geoid_u {
-    geo_common_t       common;
-    geo_node_t         node;
-    geo_iocntl_t       iocntl;
-    geo_pcicard_t      pcicard;
-    geo_rtr_t          rtr;
-    geo_cpu_t          cpu;
-    geo_mem_t          mem;
-    char               padsize[GEOID_SIZE];
-} geoid_t;
-
-
-/* Preprocessor macros */
-
-#define GEO_MAX_LEN    48      /* max. formatted length, plus some pad:
-                                  module/001c07/slab/5/node/memory/2/slot/4 */
-
-/* Values for geo_type_t */
-#define GEO_TYPE_INVALID       0
-#define GEO_TYPE_MODULE                1
-#define GEO_TYPE_NODE          2
-#define GEO_TYPE_RTR           3
-#define GEO_TYPE_IOCNTL                4
-#define GEO_TYPE_IOCARD                5
-#define GEO_TYPE_CPU           6
-#define GEO_TYPE_MEM           7
-#define GEO_TYPE_MAX           (GEO_TYPE_MEM+1)
-
-/* Parameter for hwcfg_format_geoid_compt() */
-#define GEO_COMPT_MODULE       1
-#define GEO_COMPT_SLAB         2
-#define GEO_COMPT_IOBUS                3
-#define GEO_COMPT_IOSLOT       4
-#define GEO_COMPT_CPU          5
-#define GEO_COMPT_MEMBUS       6
-#define GEO_COMPT_MEMSLOT      7
-
-#define GEO_INVALID_STR                "<invalid>"
-
-#define INVALID_NASID           ((nasid_t)-1)
-#define INVALID_CNODEID         ((cnodeid_t)-1)
-#define INVALID_PNODEID         ((pnodeid_t)-1)
-#define INVALID_SLAB            (slabid_t)-1
-#define INVALID_SLOT            (slotid_t)-1
-#define INVALID_MODULE          ((moduleid_t)-1)
-
-static inline slabid_t geo_slab(geoid_t g)
-{
-       return (g.common.type == GEO_TYPE_INVALID) ?
-               INVALID_SLAB : g.common.slab;
-}
-
-static inline slotid_t geo_slot(geoid_t g)
-{
-       return (g.common.type == GEO_TYPE_INVALID) ?
-               INVALID_SLOT : g.common.slot;
-}
-
-static inline moduleid_t geo_module(geoid_t g)
-{
-       return (g.common.type == GEO_TYPE_INVALID) ?
-               INVALID_MODULE : g.common.module;
-}
-
-extern geoid_t cnodeid_get_geoid(cnodeid_t cnode);
-
-#endif /* _ASM_IA64_SN_GEO_H */
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
deleted file mode 100644 (file)
index e0487aa..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_INTR_H
-#define _ASM_IA64_SN_INTR_H
-
-#include <linux/rcupdate.h>
-#include <asm/sn/types.h>
-
-#define SGI_UART_VECTOR                0xe9
-
-/* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */
-#define SGI_XPC_ACTIVATE       0x30
-#define SGI_II_ERROR           0x31
-#define SGI_XBOW_ERROR         0x32
-#define SGI_PCIASIC_ERROR      0x33
-#define SGI_ACPI_SCI_INT       0x34
-#define SGI_TIOCA_ERROR                0x35
-#define SGI_TIO_ERROR          0x36
-#define SGI_TIOCX_ERROR                0x37
-#define SGI_MMTIMER_VECTOR     0x38
-#define SGI_XPC_NOTIFY         0xe7
-
-#define IA64_SN2_FIRST_DEVICE_VECTOR   0x3c
-#define IA64_SN2_LAST_DEVICE_VECTOR    0xe6
-
-#define SN2_IRQ_RESERVED       0x1
-#define SN2_IRQ_CONNECTED      0x2
-#define SN2_IRQ_SHARED         0x4
-
-// The SN PROM irq struct
-struct sn_irq_info {
-       struct sn_irq_info *irq_next;   /* deprecated DO NOT USE     */
-       short           irq_nasid;      /* Nasid IRQ is assigned to  */
-       int             irq_slice;      /* slice IRQ is assigned to  */
-       int             irq_cpuid;      /* kernel logical cpuid      */
-       int             irq_irq;        /* the IRQ number */
-       int             irq_int_bit;    /* Bridge interrupt pin */
-                                       /* <0 means MSI */
-       u64     irq_xtalkaddr;  /* xtalkaddr IRQ is sent to  */
-       int             irq_bridge_type;/* pciio asic type (pciio.h) */
-       void           *irq_bridge;     /* bridge generating irq     */
-       void           *irq_pciioinfo;  /* associated pciio_info_t   */
-       int             irq_last_intr;  /* For Shub lb lost intr WAR */
-       int             irq_cookie;     /* unique cookie             */
-       int             irq_flags;      /* flags */
-       int             irq_share_cnt;  /* num devices sharing IRQ   */
-       struct list_head        list;   /* list of sn_irq_info structs */
-       struct rcu_head         rcu;    /* rcu callback list */
-};
-
-extern void sn_send_IPI_phys(int, long, int, int);
-extern u64 sn_intr_alloc(nasid_t, int,
-                             struct sn_irq_info *,
-                             int, nasid_t, int);
-extern void sn_intr_free(nasid_t, int, struct sn_irq_info *);
-extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int);
-extern void sn_set_err_irq_affinity(unsigned int);
-extern struct list_head **sn_irq_lh;
-
-#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
-
-#endif /* _ASM_IA64_SN_INTR_H */
diff --git a/include/asm-ia64/sn/io.h b/include/asm-ia64/sn/io.h
deleted file mode 100644 (file)
index 41c73a7..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/* 
- * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_SN_IO_H
-#define _ASM_SN_IO_H
-#include <linux/compiler.h>
-#include <asm/intrinsics.h>
-
-extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
-extern void __sn_mmiowb(void); /* Forward definition */
-
-extern int num_cnodes;
-
-#define __sn_mf_a()   ia64_mfa()
-
-extern void sn_dma_flush(unsigned long);
-
-#define __sn_inb ___sn_inb
-#define __sn_inw ___sn_inw
-#define __sn_inl ___sn_inl
-#define __sn_outb ___sn_outb
-#define __sn_outw ___sn_outw
-#define __sn_outl ___sn_outl
-#define __sn_readb ___sn_readb
-#define __sn_readw ___sn_readw
-#define __sn_readl ___sn_readl
-#define __sn_readq ___sn_readq
-#define __sn_readb_relaxed ___sn_readb_relaxed
-#define __sn_readw_relaxed ___sn_readw_relaxed
-#define __sn_readl_relaxed ___sn_readl_relaxed
-#define __sn_readq_relaxed ___sn_readq_relaxed
-
-/*
- * Convenience macros for setting/clearing bits using the above accessors
- */
-
-#define __sn_setq_relaxed(addr, val) \
-       writeq((__sn_readq_relaxed(addr) | (val)), (addr))
-#define __sn_clrq_relaxed(addr, val) \
-       writeq((__sn_readq_relaxed(addr) & ~(val)), (addr))
-
-/*
- * The following routines are SN Platform specific, called when
- * a reference is made to inX/outX set macros.  SN Platform
- * inX set of macros ensures that Posted DMA writes on the
- * Bridge is flushed.
- *
- * The routines should be self explainatory.
- */
-
-static inline unsigned int
-___sn_inb (unsigned long port)
-{
-       volatile unsigned char *addr;
-       unsigned char ret = -1;
-
-       if ((addr = sn_io_addr(port))) {
-               ret = *addr;
-               __sn_mf_a();
-               sn_dma_flush((unsigned long)addr);
-       }
-       return ret;
-}
-
-static inline unsigned int
-___sn_inw (unsigned long port)
-{
-       volatile unsigned short *addr;
-       unsigned short ret = -1;
-
-       if ((addr = sn_io_addr(port))) {
-               ret = *addr;
-               __sn_mf_a();
-               sn_dma_flush((unsigned long)addr);
-       }
-       return ret;
-}
-
-static inline unsigned int
-___sn_inl (unsigned long port)
-{
-       volatile unsigned int *addr;
-       unsigned int ret = -1;
-
-       if ((addr = sn_io_addr(port))) {
-               ret = *addr;
-               __sn_mf_a();
-               sn_dma_flush((unsigned long)addr);
-       }
-       return ret;
-}
-
-static inline void
-___sn_outb (unsigned char val, unsigned long port)
-{
-       volatile unsigned char *addr;
-
-       if ((addr = sn_io_addr(port))) {
-               *addr = val;
-               __sn_mmiowb();
-       }
-}
-
-static inline void
-___sn_outw (unsigned short val, unsigned long port)
-{
-       volatile unsigned short *addr;
-
-       if ((addr = sn_io_addr(port))) {
-               *addr = val;
-               __sn_mmiowb();
-       }
-}
-
-static inline void
-___sn_outl (unsigned int val, unsigned long port)
-{
-       volatile unsigned int *addr;
-
-       if ((addr = sn_io_addr(port))) {
-               *addr = val;
-               __sn_mmiowb();
-       }
-}
-
-/*
- * The following routines are SN Platform specific, called when 
- * a reference is made to readX/writeX set macros.  SN Platform 
- * readX set of macros ensures that Posted DMA writes on the 
- * Bridge is flushed.
- * 
- * The routines should be self explainatory.
- */
-
-static inline unsigned char
-___sn_readb (const volatile void __iomem *addr)
-{
-       unsigned char val;
-
-       val = *(volatile unsigned char __force *)addr;
-       __sn_mf_a();
-       sn_dma_flush((unsigned long)addr);
-        return val;
-}
-
-static inline unsigned short
-___sn_readw (const volatile void __iomem *addr)
-{
-       unsigned short val;
-
-       val = *(volatile unsigned short __force *)addr;
-       __sn_mf_a();
-       sn_dma_flush((unsigned long)addr);
-        return val;
-}
-
-static inline unsigned int
-___sn_readl (const volatile void __iomem *addr)
-{
-       unsigned int val;
-
-       val = *(volatile unsigned int __force *)addr;
-       __sn_mf_a();
-       sn_dma_flush((unsigned long)addr);
-        return val;
-}
-
-static inline unsigned long
-___sn_readq (const volatile void __iomem *addr)
-{
-       unsigned long val;
-
-       val = *(volatile unsigned long __force *)addr;
-       __sn_mf_a();
-       sn_dma_flush((unsigned long)addr);
-        return val;
-}
-
-/*
- * For generic and SN2 kernels, we have a set of fast access
- * PIO macros. These macros are provided on SN Platform
- * because the normal inX and readX macros perform an
- * additional task of flushing Post DMA request on the Bridge.
- *
- * These routines should be self explainatory.
- */
-
-static inline unsigned int
-sn_inb_fast (unsigned long port)
-{
-       volatile unsigned char *addr = (unsigned char *)port;
-       unsigned char ret;
-
-       ret = *addr;
-       __sn_mf_a();
-       return ret;
-}
-
-static inline unsigned int
-sn_inw_fast (unsigned long port)
-{
-       volatile unsigned short *addr = (unsigned short *)port;
-       unsigned short ret;
-
-       ret = *addr;
-       __sn_mf_a();
-       return ret;
-}
-
-static inline unsigned int
-sn_inl_fast (unsigned long port)
-{
-       volatile unsigned int *addr = (unsigned int *)port;
-       unsigned int ret;
-
-       ret = *addr;
-       __sn_mf_a();
-       return ret;
-}
-
-static inline unsigned char
-___sn_readb_relaxed (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned char __force *)addr;
-}
-
-static inline unsigned short
-___sn_readw_relaxed (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned short __force *)addr;
-}
-
-static inline unsigned int
-___sn_readl_relaxed (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned int __force *) addr;
-}
-
-static inline unsigned long
-___sn_readq_relaxed (const volatile void __iomem *addr)
-{
-       return *(volatile unsigned long __force *) addr;
-}
-
-struct pci_dev;
-
-static inline int
-sn_pci_set_vchan(struct pci_dev *pci_dev, unsigned long *addr, int vchan)
-{
-
-       if (vchan > 1) {
-               return -1;
-       }
-
-       if (!(*addr >> 32))     /* Using a mask here would be cleaner */
-               return 0;       /* but this generates better code */
-
-       if (vchan == 1) {
-               /* Set Bit 57 */
-               *addr |= (1UL << 57);
-       } else {
-               /* Clear Bit 57 */
-               *addr &= ~(1UL << 57);
-       }
-
-       return 0;
-}
-
-#endif /* _ASM_SN_IO_H */
diff --git a/include/asm-ia64/sn/ioc3.h b/include/asm-ia64/sn/ioc3.h
deleted file mode 100644 (file)
index 95ed6cc..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2005 Silicon Graphics, Inc.
- */
-#ifndef IA64_SN_IOC3_H
-#define IA64_SN_IOC3_H
-
-/* serial port register map */
-struct ioc3_serialregs {
-       uint32_t sscr;
-       uint32_t stpir;
-       uint32_t stcir;
-       uint32_t srpir;
-       uint32_t srcir;
-       uint32_t srtr;
-       uint32_t shadow;
-};
-
-/* SUPERIO uart register map */
-struct ioc3_uartregs {
-       char iu_lcr;
-       union {
-               char iir;       /* read only */
-               char fcr;       /* write only */
-       } u3;
-       union {
-               char ier;       /* DLAB == 0 */
-               char dlm;       /* DLAB == 1 */
-       } u2;
-       union {
-               char rbr;       /* read only, DLAB == 0 */
-               char thr;       /* write only, DLAB == 0 */
-               char dll;       /* DLAB == 1 */
-       } u1;
-       char iu_scr;
-       char iu_msr;
-       char iu_lsr;
-       char iu_mcr;
-};
-
-#define iu_rbr u1.rbr
-#define iu_thr u1.thr
-#define iu_dll u1.dll
-#define iu_ier u2.ier
-#define iu_dlm u2.dlm
-#define iu_iir u3.iir
-#define iu_fcr u3.fcr
-
-struct ioc3_sioregs {
-       char fill[0x170];
-       struct ioc3_uartregs uartb;
-       struct ioc3_uartregs uarta;
-};
-
-/* PCI IO/mem space register map */
-struct ioc3 {
-       uint32_t pci_id;
-       uint32_t pci_scr;
-       uint32_t pci_rev;
-       uint32_t pci_lat;
-       uint32_t pci_addr;
-       uint32_t pci_err_addr_l;
-       uint32_t pci_err_addr_h;
-
-       uint32_t sio_ir;
-       /* these registers are read-only for general kernel code. To
-        * modify them use the functions in ioc3.c
-        */
-       uint32_t sio_ies;
-       uint32_t sio_iec;
-       uint32_t sio_cr;
-       uint32_t int_out;
-       uint32_t mcr;
-       uint32_t gpcr_s;
-       uint32_t gpcr_c;
-       uint32_t gpdr;
-       uint32_t gppr[9];
-       char fill[0x4c];
-
-       /* serial port registers */
-       uint32_t sbbr_h;
-       uint32_t sbbr_l;
-
-       struct ioc3_serialregs port_a;
-       struct ioc3_serialregs port_b;
-       char fill1[0x1ff10];
-       /* superio registers */
-       struct ioc3_sioregs sregs;
-};
-
-/* These don't exist on the ioc3 serial card... */
-#define eier   fill1[8]
-#define eisr   fill1[4]
-
-#define PCI_LAT                        0xc     /* Latency Timer */
-#define PCI_SCR_DROP_MODE_EN   0x00008000 /* drop pios on parity err */
-#define UARTA_BASE             0x178
-#define UARTB_BASE             0x170
-
-
-/* bitmasks for serial RX status byte */
-#define RXSB_OVERRUN           0x01    /* char(s) lost */
-#define RXSB_PAR_ERR           0x02    /* parity error */
-#define RXSB_FRAME_ERR         0x04    /* framing error */
-#define RXSB_BREAK             0x08    /* break character */
-#define RXSB_CTS               0x10    /* state of CTS */
-#define RXSB_DCD               0x20    /* state of DCD */
-#define RXSB_MODEM_VALID       0x40    /* DCD, CTS and OVERRUN are valid */
-#define RXSB_DATA_VALID                0x80    /* FRAME_ERR PAR_ERR & BREAK valid */
-
-/* bitmasks for serial TX control byte */
-#define TXCB_INT_WHEN_DONE     0x20    /* interrupt after this byte is sent */
-#define TXCB_INVALID           0x00    /* byte is invalid */
-#define TXCB_VALID             0x40    /* byte is valid */
-#define TXCB_MCR               0x80    /* data<7:0> to modem cntrl register */
-#define TXCB_DELAY             0xc0    /* delay data<7:0> mSec */
-
-/* bitmasks for SBBR_L */
-#define SBBR_L_SIZE            0x00000001      /* 0 1KB rings, 1 4KB rings */
-
-/* bitmasks for SSCR_<A:B> */
-#define SSCR_RX_THRESHOLD      0x000001ff      /* hiwater mark */
-#define SSCR_TX_TIMER_BUSY     0x00010000      /* TX timer in progress */
-#define SSCR_HFC_EN            0x00020000      /* h/w flow cntrl enabled */
-#define SSCR_RX_RING_DCD       0x00040000      /* postRX record on delta-DCD */
-#define SSCR_RX_RING_CTS       0x00080000      /* postRX record on delta-CTS */
-#define SSCR_HIGH_SPD          0x00100000      /* 4X speed */
-#define SSCR_DIAG              0x00200000      /* bypass clock divider */
-#define SSCR_RX_DRAIN          0x08000000      /* drain RX buffer to memory */
-#define SSCR_DMA_EN            0x10000000      /* enable ring buffer DMA */
-#define SSCR_DMA_PAUSE         0x20000000      /* pause DMA */
-#define SSCR_PAUSE_STATE       0x40000000      /* set when PAUSE takes effect*/
-#define SSCR_RESET             0x80000000      /* reset DMA channels */
-
-/* all producer/comsumer pointers are the same bitfield */
-#define PROD_CONS_PTR_4K       0x00000ff8      /* for 4K buffers */
-#define PROD_CONS_PTR_1K       0x000003f8      /* for 1K buffers */
-#define PROD_CONS_PTR_OFF      3
-
-/* bitmasks for SRCIR_<A:B> */
-#define SRCIR_ARM              0x80000000      /* arm RX timer */
-
-/* bitmasks for SHADOW_<A:B> */
-#define SHADOW_DR              0x00000001      /* data ready */
-#define SHADOW_OE              0x00000002      /* overrun error */
-#define SHADOW_PE              0x00000004      /* parity error */
-#define SHADOW_FE              0x00000008      /* framing error */
-#define SHADOW_BI              0x00000010      /* break interrupt */
-#define SHADOW_THRE            0x00000020      /* transmit holding reg empty */
-#define SHADOW_TEMT            0x00000040      /* transmit shift reg empty */
-#define SHADOW_RFCE            0x00000080      /* char in RX fifo has error */
-#define SHADOW_DCTS            0x00010000      /* delta clear to send */
-#define SHADOW_DDCD            0x00080000      /* delta data carrier detect */
-#define SHADOW_CTS             0x00100000      /* clear to send */
-#define SHADOW_DCD             0x00800000      /* data carrier detect */
-#define SHADOW_DTR             0x01000000      /* data terminal ready */
-#define SHADOW_RTS             0x02000000      /* request to send */
-#define SHADOW_OUT1            0x04000000      /* 16550 OUT1 bit */
-#define SHADOW_OUT2            0x08000000      /* 16550 OUT2 bit */
-#define SHADOW_LOOP            0x10000000      /* loopback enabled */
-
-/* bitmasks for SRTR_<A:B> */
-#define SRTR_CNT               0x00000fff      /* reload value for RX timer */
-#define SRTR_CNT_VAL           0x0fff0000      /* current value of RX timer */
-#define SRTR_CNT_VAL_SHIFT     16
-#define SRTR_HZ                        16000           /* SRTR clock frequency */
-
-/* bitmasks for SIO_IR, SIO_IEC and SIO_IES  */
-#define SIO_IR_SA_TX_MT                0x00000001      /* Serial port A TX empty */
-#define SIO_IR_SA_RX_FULL      0x00000002      /* port A RX buf full */
-#define SIO_IR_SA_RX_HIGH      0x00000004      /* port A RX hiwat */
-#define SIO_IR_SA_RX_TIMER     0x00000008      /* port A RX timeout */
-#define SIO_IR_SA_DELTA_DCD    0x00000010      /* port A delta DCD */
-#define SIO_IR_SA_DELTA_CTS    0x00000020      /* port A delta CTS */
-#define SIO_IR_SA_INT          0x00000040      /* port A pass-thru intr */
-#define SIO_IR_SA_TX_EXPLICIT  0x00000080      /* port A explicit TX thru */
-#define SIO_IR_SA_MEMERR       0x00000100      /* port A PCI error */
-#define SIO_IR_SB_TX_MT                0x00000200
-#define SIO_IR_SB_RX_FULL      0x00000400
-#define SIO_IR_SB_RX_HIGH      0x00000800
-#define SIO_IR_SB_RX_TIMER     0x00001000
-#define SIO_IR_SB_DELTA_DCD    0x00002000
-#define SIO_IR_SB_DELTA_CTS    0x00004000
-#define SIO_IR_SB_INT          0x00008000
-#define SIO_IR_SB_TX_EXPLICIT  0x00010000
-#define SIO_IR_SB_MEMERR       0x00020000
-#define SIO_IR_PP_INT          0x00040000      /* P port pass-thru intr */
-#define SIO_IR_PP_INTA         0x00080000      /* PP context A thru */
-#define SIO_IR_PP_INTB         0x00100000      /* PP context B thru */
-#define SIO_IR_PP_MEMERR       0x00200000      /* PP PCI error */
-#define SIO_IR_KBD_INT         0x00400000      /* kbd/mouse intr */
-#define SIO_IR_RT_INT          0x08000000      /* RT output pulse */
-#define SIO_IR_GEN_INT1                0x10000000      /* RT input pulse */
-#define SIO_IR_GEN_INT_SHIFT   28
-
-/* per device interrupt masks */
-#define SIO_IR_SA              (SIO_IR_SA_TX_MT | \
-                                SIO_IR_SA_RX_FULL | \
-                                SIO_IR_SA_RX_HIGH | \
-                                SIO_IR_SA_RX_TIMER | \
-                                SIO_IR_SA_DELTA_DCD | \
-                                SIO_IR_SA_DELTA_CTS | \
-                                SIO_IR_SA_INT | \
-                                SIO_IR_SA_TX_EXPLICIT | \
-                                SIO_IR_SA_MEMERR)
-
-#define SIO_IR_SB              (SIO_IR_SB_TX_MT | \
-                                SIO_IR_SB_RX_FULL | \
-                                SIO_IR_SB_RX_HIGH | \
-                                SIO_IR_SB_RX_TIMER | \
-                                SIO_IR_SB_DELTA_DCD | \
-                                SIO_IR_SB_DELTA_CTS | \
-                                SIO_IR_SB_INT | \
-                                SIO_IR_SB_TX_EXPLICIT | \
-                                SIO_IR_SB_MEMERR)
-
-#define SIO_IR_PP              (SIO_IR_PP_INT | SIO_IR_PP_INTA | \
-                                SIO_IR_PP_INTB | SIO_IR_PP_MEMERR)
-#define SIO_IR_RT              (SIO_IR_RT_INT | SIO_IR_GEN_INT1)
-
-/* bitmasks for SIO_CR */
-#define SIO_CR_CMD_PULSE_SHIFT 15
-#define SIO_CR_SER_A_BASE_SHIFT 1
-#define SIO_CR_SER_B_BASE_SHIFT 8
-#define SIO_CR_ARB_DIAG                0x00380000      /* cur !enet PCI requet (ro) */
-#define SIO_CR_ARB_DIAG_TXA    0x00000000
-#define SIO_CR_ARB_DIAG_RXA    0x00080000
-#define SIO_CR_ARB_DIAG_TXB    0x00100000
-#define SIO_CR_ARB_DIAG_RXB    0x00180000
-#define SIO_CR_ARB_DIAG_PP     0x00200000
-#define SIO_CR_ARB_DIAG_IDLE   0x00400000      /* 0 -> active request (ro) */
-
-/* defs for some of the generic I/O pins */
-#define GPCR_PHY_RESET         0x20    /* pin is output to PHY reset */
-#define GPCR_UARTB_MODESEL     0x40    /* pin is output to port B mode sel */
-#define GPCR_UARTA_MODESEL     0x80    /* pin is output to port A mode sel */
-
-#define GPPR_PHY_RESET_PIN     5       /* GIO pin controlling phy reset */
-#define GPPR_UARTB_MODESEL_PIN 6       /* GIO pin cntrling uartb modeselect */
-#define GPPR_UARTA_MODESEL_PIN 7       /* GIO pin cntrling uarta modeselect */
-
-#endif /* IA64_SN_IOC3_H */
diff --git a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h
deleted file mode 100644 (file)
index bcbf209..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * 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.
- *
- * Derived from IRIX <sys/SN/klconfig.h>.
- *
- * Copyright (C) 1992-1997,1999,2001-2004 Silicon Graphics, Inc.  All Rights Reserved.
- * Copyright (C) 1999 by Ralf Baechle
- */
-#ifndef _ASM_IA64_SN_KLCONFIG_H
-#define _ASM_IA64_SN_KLCONFIG_H
-
-/*
- * The KLCONFIG structures store info about the various BOARDs found
- * during Hardware Discovery. In addition, it stores info about the
- * components found on the BOARDs.
- */
-
-typedef s32 klconf_off_t;
-
-
-/* Functions/macros needed to use this structure */
-
-typedef struct kl_config_hdr {
-       char            pad[20];
-       klconf_off_t    ch_board_info;  /* the link list of boards */
-       char            pad0[88];
-} kl_config_hdr_t;
-
-
-#define NODE_OFFSET_TO_LBOARD(nasid,off)        (lboard_t*)(GLOBAL_CAC_ADDR((nasid), (off)))
-
-/*
- * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD
- * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to 
- * the LOCAL/current NODE. REMOTE means it is attached to a different
- * node.(TBD - Need a way to treat ROUTER boards.)
- *
- * There are 2 different structures to represent these boards -
- * lboard - Local board, rboard - remote board. These 2 structures
- * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer
- * Figure below). The first byte of the rboard or lboard structure
- * is used to find out its type - no unions are used.
- * If it is a lboard, then the config info of this board will be found
- * on the local node. (LOCAL NODE BASE + offset value gives pointer to 
- * the structure.
- * If it is a rboard, the local structure contains the node number
- * and the offset of the beginning of the LINKED LIST on the remote node.
- * The details of the hardware on a remote node can be built locally,
- * if required, by reading the LINKED LIST on the remote node and 
- * ignoring all the rboards on that node.
- *
- * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the 
- * First board info on the remote node. The remote node list is 
- * traversed as the local list, using the REMOTE BASE ADDRESS and not
- * the local base address and ignoring all rboard values.
- *
- * 
- KLCONFIG
-
- +------------+      +------------+      +------------+      +------------+
- |  lboard    |  +-->|   lboard   |  +-->|   rboard   |  +-->|   lboard   |
- +------------+  |   +------------+  |   +------------+  |   +------------+
- | board info |  |   | board info |  |   |errinfo,bptr|  |   | board info |
- +------------+  |   +------------+  |   +------------+  |   +------------+
- | offset     |--+   |  offset    |--+   |  offset    |--+   |offset=NULL |
- +------------+      +------------+      +------------+      +------------+
-
-
- +------------+
- | board info |
- +------------+       +--------------------------------+
- | compt 1    |------>| type, rev, diaginfo, size ...  |  (CPU)
- +------------+       +--------------------------------+
- | compt 2    |--+
- +------------+  |    +--------------------------------+
- |  ...       |  +--->| type, rev, diaginfo, size ...  |  (MEM_BANK)
- +------------+       +--------------------------------+
- | errinfo    |--+
- +------------+  |    +--------------------------------+
-                 +--->|r/l brd errinfo,compt err flags |
-                      +--------------------------------+
-
- *
- * Each BOARD consists of COMPONENTs and the BOARD structure has 
- * pointers (offsets) to its COMPONENT structure.
- * The COMPONENT structure has version info, size and speed info, revision,
- * error info and the NIC info. This structure can accommodate any
- * BOARD with arbitrary COMPONENT composition.
- *
- * The ERRORINFO part of each BOARD has error information
- * that describes errors about the BOARD itself. It also has flags to
- * indicate the COMPONENT(s) on the board that have errors. The error 
- * information specific to the COMPONENT is present in the respective 
- * COMPONENT structure.
- *
- * The ERRORINFO structure is also treated like a COMPONENT, ie. the 
- * BOARD has pointers(offset) to the ERRORINFO structure. The rboard
- * structure also has a pointer to the ERRORINFO structure. This is 
- * the place to store ERRORINFO about a REMOTE NODE, if the HUB on
- * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where 
- * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can
- * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info 
- * which is present on the REMOTE NODE.(TBD)
- * REMOTE ERRINFO can be stored on any of the nearest nodes 
- * or on all the nearest nodes.(TBD)
- * Like BOARD structures, REMOTE ERRINFO structures can be built locally
- * using the rboard errinfo pointer.
- *
- * In order to get useful information from this Data organization, a set of
- * interface routines are provided (TBD). The important thing to remember while
- * manipulating the structures, is that, the NODE number information should
- * be used. If the NODE is non-zero (remote) then each offset should
- * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR. 
- * This includes offsets for BOARDS, COMPONENTS and ERRORINFO.
- * 
- * Note that these structures do not provide much info about connectivity.
- * That info will be part of HWGRAPH, which is an extension of the cfg_t
- * data structure. (ref IP27prom/cfg.h) It has to be extended to include
- * the IO part of the Network(TBD).
- *
- * The data structures below define the above concepts.
- */
-
-
-/*
- * BOARD classes
- */
-
-#define KLCLASS_MASK   0xf0   
-#define KLCLASS_NONE   0x00
-#define KLCLASS_NODE   0x10             /* CPU, Memory and HUB board */
-#define KLCLASS_CPU    KLCLASS_NODE    
-#define KLCLASS_IO     0x20             /* BaseIO, 4 ch SCSI, ethernet, FDDI 
-                                           and the non-graphics widget boards */
-#define KLCLASS_ROUTER 0x30             /* Router board */
-#define KLCLASS_MIDPLANE 0x40            /* We need to treat this as a board
-                                            so that we can record error info */
-#define KLCLASS_IOBRICK        0x70            /* IP35 iobrick */
-#define KLCLASS_MAX    8               /* Bump this if a new CLASS is added */
-
-#define KLCLASS(_x) ((_x) & KLCLASS_MASK)
-
-
-/*
- * board types
- */
-
-#define KLTYPE_MASK    0x0f
-#define KLTYPE(_x)      ((_x) & KLTYPE_MASK)
-
-#define KLTYPE_SNIA    (KLCLASS_CPU | 0x1)
-#define KLTYPE_TIO     (KLCLASS_CPU | 0x2)
-
-#define KLTYPE_ROUTER     (KLCLASS_ROUTER | 0x1)
-#define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
-#define KLTYPE_REPEATER_ROUTER (KLCLASS_ROUTER | 0x4)
-
-#define KLTYPE_IOBRICK_XBOW    (KLCLASS_MIDPLANE | 0x2)
-
-#define KLTYPE_IOBRICK         (KLCLASS_IOBRICK | 0x0)
-#define KLTYPE_NBRICK          (KLCLASS_IOBRICK | 0x4)
-#define KLTYPE_PXBRICK         (KLCLASS_IOBRICK | 0x6)
-#define KLTYPE_IXBRICK         (KLCLASS_IOBRICK | 0x7)
-#define KLTYPE_CGBRICK         (KLCLASS_IOBRICK | 0x8)
-#define KLTYPE_OPUSBRICK       (KLCLASS_IOBRICK | 0x9)
-#define KLTYPE_SABRICK          (KLCLASS_IOBRICK | 0xa)
-#define KLTYPE_IABRICK         (KLCLASS_IOBRICK | 0xb)
-#define KLTYPE_PABRICK          (KLCLASS_IOBRICK | 0xc)
-#define KLTYPE_GABRICK         (KLCLASS_IOBRICK | 0xd)
-
-
-/* 
- * board structures
- */
-
-#define MAX_COMPTS_PER_BRD 24
-
-typedef struct lboard_s {
-       klconf_off_t    brd_next_any;     /* Next BOARD */
-       unsigned char   struct_type;      /* type of structure, local or remote */
-       unsigned char   brd_type;         /* type+class */
-       unsigned char   brd_sversion;     /* version of this structure */
-        unsigned char  brd_brevision;    /* board revision */
-        unsigned char  brd_promver;      /* board prom version, if any */
-       unsigned char   brd_flags;        /* Enabled, Disabled etc */
-       unsigned char   brd_slot;         /* slot number */
-       unsigned short  brd_debugsw;      /* Debug switches */
-       geoid_t         brd_geoid;        /* geo id */
-       partid_t        brd_partition;    /* Partition number */
-        unsigned short         brd_diagval;      /* diagnostic value */
-        unsigned short         brd_diagparm;     /* diagnostic parameter */
-        unsigned char  brd_inventory;    /* inventory history */
-        unsigned char  brd_numcompts;    /* Number of components */
-        nic_t          brd_nic;          /* Number in CAN */
-       nasid_t         brd_nasid;        /* passed parameter */
-       klconf_off_t    brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */
-       klconf_off_t    brd_errinfo;      /* Board's error information */
-       struct lboard_s *brd_parent;      /* Logical parent for this brd */
-       char            pad0[4];
-       unsigned char   brd_confidence;   /* confidence that the board is bad */
-       nasid_t         brd_owner;        /* who owns this board */
-       unsigned char   brd_nic_flags;    /* To handle 8 more NICs */
-       char            pad1[24];         /* future expansion */
-       char            brd_name[32];
-       nasid_t         brd_next_same_host; /* host of next brd w/same nasid */
-       klconf_off_t    brd_next_same;    /* Next BOARD with same nasid */
-} lboard_t;
-
-/*
- * Generic info structure. This stores common info about a 
- * component.
- */
-typedef struct klinfo_s {                  /* Generic info */
-        unsigned char   struct_type;       /* type of this structure */
-        unsigned char   struct_version;    /* version of this structure */
-        unsigned char   flags;            /* Enabled, disabled etc */
-        unsigned char   revision;         /* component revision */
-        unsigned short  diagval;          /* result of diagnostics */
-        unsigned short  diagparm;         /* diagnostic parameter */
-        unsigned char   inventory;        /* previous inventory status */
-        unsigned short  partid;                   /* widget part number */
-       nic_t           nic;              /* MUst be aligned properly */
-        unsigned char   physid;           /* physical id of component */
-        unsigned int    virtid;           /* virtual id as seen by system */
-       unsigned char   widid;            /* Widget id - if applicable */
-       nasid_t         nasid;            /* node number - from parent */
-       char            pad1;             /* pad out structure. */
-       char            pad2;             /* pad out structure. */
-       void            *data;
-        klconf_off_t   errinfo;          /* component specific errors */
-        unsigned short  pad3;             /* pci fields have moved over to */
-        unsigned short  pad4;             /* klbri_t */
-} klinfo_t ;
-
-
-static inline lboard_t *find_lboard_next(lboard_t * brd)
-{
-       if (brd && brd->brd_next_any)
-               return NODE_OFFSET_TO_LBOARD(NASID_GET(brd), brd->brd_next_any);
-        return NULL;
-}
-
-#endif /* _ASM_IA64_SN_KLCONFIG_H */
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h
deleted file mode 100644 (file)
index 344bf44..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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) 1992-1997,2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
- */
-
-#ifndef _ASM_IA64_SN_L1_H
-#define _ASM_IA64_SN_L1_H
-
-/* brick type response codes */
-#define L1_BRICKTYPE_PX         0x23            /* # */
-#define L1_BRICKTYPE_PE         0x25            /* % */
-#define L1_BRICKTYPE_N_p0       0x26            /* & */
-#define L1_BRICKTYPE_IP45       0x34            /* 4 */
-#define L1_BRICKTYPE_IP41       0x35            /* 5 */
-#define L1_BRICKTYPE_TWISTER    0x36            /* 6 */ /* IP53 & ROUTER */
-#define L1_BRICKTYPE_IX         0x3d            /* = */
-#define L1_BRICKTYPE_IP34       0x61            /* a */
-#define L1_BRICKTYPE_GA                0x62            /* b */
-#define L1_BRICKTYPE_C          0x63            /* c */
-#define L1_BRICKTYPE_OPUS_TIO  0x66            /* f */
-#define L1_BRICKTYPE_I          0x69            /* i */
-#define L1_BRICKTYPE_N          0x6e            /* n */
-#define L1_BRICKTYPE_OPUS       0x6f           /* o */
-#define L1_BRICKTYPE_P          0x70            /* p */
-#define L1_BRICKTYPE_R          0x72            /* r */
-#define L1_BRICKTYPE_CHI_CG     0x76            /* v */
-#define L1_BRICKTYPE_X          0x78            /* x */
-#define L1_BRICKTYPE_X2         0x79            /* y */
-#define L1_BRICKTYPE_SA                0x5e            /* ^ */
-#define L1_BRICKTYPE_PA                0x6a            /* j */
-#define L1_BRICKTYPE_IA                0x6b            /* k */
-#define L1_BRICKTYPE_ATHENA    0x2b            /* + */
-#define L1_BRICKTYPE_DAYTONA   0x7a            /* z */
-#define L1_BRICKTYPE_1932      0x2c            /* . */
-#define L1_BRICKTYPE_191010    0x2e            /* , */
-
-/* board type response codes */
-#define L1_BOARDTYPE_IP69       0x0100          /* CA */
-#define L1_BOARDTYPE_IP63       0x0200          /* CB */
-#define L1_BOARDTYPE_BASEIO     0x0300          /* IB */
-#define L1_BOARDTYPE_PCIE2SLOT  0x0400          /* IC */
-#define L1_BOARDTYPE_PCIX3SLOT  0x0500          /* ID */
-#define L1_BOARDTYPE_PCIXPCIE4SLOT 0x0600       /* IE */
-#define L1_BOARDTYPE_ABACUS     0x0700          /* AB */
-#define L1_BOARDTYPE_DAYTONA    0x0800          /* AD */
-#define L1_BOARDTYPE_INVAL      (-1)            /* invalid brick type */
-
-#endif /* _ASM_IA64_SN_L1_H */
diff --git a/include/asm-ia64/sn/leds.h b/include/asm-ia64/sn/leds.h
deleted file mode 100644 (file)
index 66cf8c4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_LEDS_H
-#define _ASM_IA64_SN_LEDS_H
-
-#include <asm/sn/addrs.h>
-#include <asm/sn/pda.h>
-#include <asm/sn/shub_mmr.h>
-
-#define LED0           (LOCAL_MMR_ADDR(SH_REAL_JUNK_BUS_LED0))
-#define LED_CPU_SHIFT  16
-
-#define LED_CPU_HEARTBEAT      0x01
-#define LED_CPU_ACTIVITY       0x02
-#define LED_ALWAYS_SET         0x00
-
-/*
- * Basic macros for flashing the LEDS on an SGI SN.
- */
-
-static __inline__ void
-set_led_bits(u8 value, u8 mask)
-{
-       pda->led_state = (pda->led_state & ~mask) | (value & mask);
-       *pda->led_address = (short) pda->led_state;
-}
-
-#endif /* _ASM_IA64_SN_LEDS_H */
-
diff --git a/include/asm-ia64/sn/module.h b/include/asm-ia64/sn/module.h
deleted file mode 100644 (file)
index 734e980..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_MODULE_H
-#define _ASM_IA64_SN_MODULE_H
-
-/* parameter for format_module_id() */
-#define MODULE_FORMAT_BRIEF    1
-#define MODULE_FORMAT_LONG     2
-#define MODULE_FORMAT_LCD      3
-
-/*
- *     Module id format
- *
- *     31-16   Rack ID (encoded class, group, number - 16-bit unsigned int)
- *      15-8   Brick type (8-bit ascii character)
- *       7-0   Bay (brick position in rack (0-63) - 8-bit unsigned int)
- *
- */
-
-/*
- * Macros for getting the brick type
- */
-#define MODULE_BTYPE_MASK      0xff00
-#define MODULE_BTYPE_SHFT      8
-#define MODULE_GET_BTYPE(_m)   (((_m) & MODULE_BTYPE_MASK) >> MODULE_BTYPE_SHFT)
-#define MODULE_BT_TO_CHAR(_b)  ((char)(_b))
-#define MODULE_GET_BTCHAR(_m)  (MODULE_BT_TO_CHAR(MODULE_GET_BTYPE(_m)))
-
-/*
- * Macros for getting the rack ID.
- */
-#define MODULE_RACK_MASK       0xffff0000
-#define MODULE_RACK_SHFT       16
-#define MODULE_GET_RACK(_m)    (((_m) & MODULE_RACK_MASK) >> MODULE_RACK_SHFT)
-
-/*
- * Macros for getting the brick position
- */
-#define MODULE_BPOS_MASK       0x00ff
-#define MODULE_BPOS_SHFT       0
-#define MODULE_GET_BPOS(_m)    (((_m) & MODULE_BPOS_MASK) >> MODULE_BPOS_SHFT)
-
-/*
- * Macros for encoding and decoding rack IDs
- * A rack number consists of three parts:
- *   class (0==CPU/mixed, 1==I/O), group, number
- *
- * Rack number is stored just as it is displayed on the screen:
- * a 3-decimal-digit number.
- */
-#define RACK_CLASS_DVDR         100
-#define RACK_GROUP_DVDR         10
-#define RACK_NUM_DVDR           1
-
-#define RACK_CREATE_RACKID(_c, _g, _n)  ((_c) * RACK_CLASS_DVDR +       \
-        (_g) * RACK_GROUP_DVDR + (_n) * RACK_NUM_DVDR)
-
-#define RACK_GET_CLASS(_r)              ((_r) / RACK_CLASS_DVDR)
-#define RACK_GET_GROUP(_r)              (((_r) - RACK_GET_CLASS(_r) *   \
-            RACK_CLASS_DVDR) / RACK_GROUP_DVDR)
-#define RACK_GET_NUM(_r)                (((_r) - RACK_GET_CLASS(_r) *   \
-            RACK_CLASS_DVDR - RACK_GET_GROUP(_r) *      \
-            RACK_GROUP_DVDR) / RACK_NUM_DVDR)
-
-/*
- * Macros for encoding and decoding rack IDs
- * A rack number consists of three parts:
- *   class      1 bit, 0==CPU/mixed, 1==I/O
- *   group      2 bits for CPU/mixed, 3 bits for I/O
- *   number     3 bits for CPU/mixed, 2 bits for I/O (1 based)
- */
-#define RACK_GROUP_BITS(_r)     (RACK_GET_CLASS(_r) ? 3 : 2)
-#define RACK_NUM_BITS(_r)       (RACK_GET_CLASS(_r) ? 2 : 3)
-
-#define RACK_CLASS_MASK(_r)     0x20
-#define RACK_CLASS_SHFT(_r)     5
-#define RACK_ADD_CLASS(_r, _c)  \
-        ((_r) |= (_c) << RACK_CLASS_SHFT(_r) & RACK_CLASS_MASK(_r))
-
-#define RACK_GROUP_SHFT(_r)     RACK_NUM_BITS(_r)
-#define RACK_GROUP_MASK(_r)     \
-        ( (((unsigned)1<<RACK_GROUP_BITS(_r)) - 1) << RACK_GROUP_SHFT(_r) )
-#define RACK_ADD_GROUP(_r, _g)  \
-        ((_r) |= (_g) << RACK_GROUP_SHFT(_r) & RACK_GROUP_MASK(_r))
-
-#define RACK_NUM_SHFT(_r)       0
-#define RACK_NUM_MASK(_r)       \
-        ( (((unsigned)1<<RACK_NUM_BITS(_r)) - 1) << RACK_NUM_SHFT(_r) )
-#define RACK_ADD_NUM(_r, _n)    \
-        ((_r) |= ((_n) - 1) << RACK_NUM_SHFT(_r) & RACK_NUM_MASK(_r))
-
-
-/*
- * Brick type definitions
- */
-#define MAX_BRICK_TYPES         256 /* brick type is stored as uchar */
-
-extern char brick_types[];
-
-#define MODULE_CBRICK           0
-#define MODULE_RBRICK           1
-#define MODULE_IBRICK           2
-#define MODULE_KBRICK           3
-#define MODULE_XBRICK           4
-#define MODULE_DBRICK           5
-#define MODULE_PBRICK           6
-#define MODULE_NBRICK           7
-#define MODULE_PEBRICK          8
-#define MODULE_PXBRICK          9
-#define MODULE_IXBRICK          10
-#define MODULE_CGBRICK         11
-#define MODULE_OPUSBRICK        12
-#define MODULE_SABRICK         13      /* TIO BringUp Brick */
-#define MODULE_IABRICK         14
-#define MODULE_PABRICK         15
-#define MODULE_GABRICK         16
-#define MODULE_OPUS_TIO                17      /* OPUS TIO Riser */
-
-extern char brick_types[];
-extern void format_module_id(char *, moduleid_t, int);
-
-#endif /* _ASM_IA64_SN_MODULE_H */
diff --git a/include/asm-ia64/sn/mspec.h b/include/asm-ia64/sn/mspec.h
deleted file mode 100644 (file)
index c1d3c50..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * 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) 2001-2008 Silicon Graphics, Inc.  All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_MSPEC_H
-#define _ASM_IA64_SN_MSPEC_H
-
-#define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */
-
-#define FETCHOP_LOAD           0
-#define FETCHOP_INCREMENT      8
-#define FETCHOP_DECREMENT      16
-#define FETCHOP_CLEAR          24
-
-#define FETCHOP_STORE          0
-#define FETCHOP_AND            24
-#define FETCHOP_OR             32
-
-#define FETCHOP_CLEAR_CACHE    56
-
-#define FETCHOP_LOAD_OP(addr, op) ( \
-         *(volatile long *)((char*) (addr) + (op)))
-
-#define FETCHOP_STORE_OP(addr, op, x) ( \
-         *(volatile long *)((char*) (addr) + (op)) = (long) (x))
-
-#ifdef __KERNEL__
-
-/*
- * Each Atomic Memory Operation (amo, formerly known as fetchop)
- * variable is 64 bytes long.  The first 8 bytes are used.  The
- * remaining 56 bytes are unaddressable due to the operation taking
- * that portion of the address.
- *
- * NOTE: The amo structure _MUST_ be placed in either the first or second
- * half of the cache line.  The cache line _MUST NOT_ be used for anything
- * other than additional amo entries.  This is because there are two
- * addresses which reference the same physical cache line.  One will
- * be a cached entry with the memory type bits all set.  This address
- * may be loaded into processor cache.  The amo will be referenced
- * uncached via the memory special memory type.  If any portion of the
- * cached cache-line is modified, when that line is flushed, it will
- * overwrite the uncached value in physical memory and lead to
- * inconsistency.
- */
-struct amo {
-        u64 variable;
-        u64 unused[7];
-};
-
-
-#endif /* __KERNEL__ */
-
-#endif /* _ASM_IA64_SN_MSPEC_H */
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
deleted file mode 100644 (file)
index ee118b9..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_NODEPDA_H
-#define _ASM_IA64_SN_NODEPDA_H
-
-
-#include <asm/irq.h>
-#include <asm/sn/arch.h>
-#include <asm/sn/intr.h>
-#include <asm/sn/bte.h>
-
-/*
- * NUMA Node-Specific Data structures are defined in this file.
- * In particular, this is the location of the node PDA.
- * A pointer to the right node PDA is saved in each CPU PDA.
- */
-
-/*
- * Node-specific data structure.
- *
- * One of these structures is allocated on each node of a NUMA system.
- *
- * This structure provides a convenient way of keeping together 
- * all per-node data structures. 
- */
-struct phys_cpuid {
-       short                   nasid;
-       char                    subnode;
-       char                    slice;
-};
-
-struct nodepda_s {
-       void            *pdinfo;        /* Platform-dependent per-node info */
-
-       /*
-        * The BTEs on this node are shared by the local cpus
-        */
-       struct bteinfo_s        bte_if[MAX_BTES_PER_NODE];      /* Virtual Interface */
-       struct timer_list       bte_recovery_timer;
-       spinlock_t              bte_recovery_lock;
-
-       /* 
-        * Array of pointers to the nodepdas for each node.
-        */
-       struct nodepda_s        *pernode_pdaindr[MAX_COMPACT_NODES]; 
-
-       /*
-        * Array of physical cpu identifiers. Indexed by cpuid.
-        */
-       struct phys_cpuid       phys_cpuid[NR_CPUS];
-       spinlock_t              ptc_lock ____cacheline_aligned_in_smp;
-};
-
-typedef struct nodepda_s nodepda_t;
-
-/*
- * Access Functions for node PDA.
- * Since there is one nodepda for each node, we need a convenient mechanism
- * to access these nodepdas without cluttering code with #ifdefs.
- * The next set of definitions provides this.
- * Routines are expected to use 
- *
- *     sn_nodepda   - to access node PDA for the node on which code is running
- *     NODEPDA(cnodeid)   - to access node PDA for cnodeid
- */
-
-DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda);
-#define sn_nodepda             (__get_cpu_var(__sn_nodepda))
-#define        NODEPDA(cnodeid)        (sn_nodepda->pernode_pdaindr[cnodeid])
-
-/*
- * Check if given a compact node id the corresponding node has all the
- * cpus disabled. 
- */
-#define is_headless_node(cnodeid)      (nr_cpus_node(cnodeid) == 0)
-
-#endif /* _ASM_IA64_SN_NODEPDA_H */
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
deleted file mode 100644 (file)
index da205b7..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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) 1992-1997,2000-2006 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
-#define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
-
-#include <asm/sn/intr.h>
-#include <asm/sn/pcibus_provider_defs.h>
-
-/* Workarounds */
-#define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */
-
-#define BUSTYPE_MASK                    0x1
-
-/* Macros given a pcibus structure */
-#define IS_PCIX(ps)     ((ps)->pbi_bridge_mode & BUSTYPE_MASK)
-#define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \
-                asic == PCIIO_ASIC_TYPE_TIOCP)
-#define IS_PIC_SOFT(ps)     (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC)
-#define IS_TIOCP_SOFT(ps)   (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_TIOCP)
-
-
-/*
- * The different PCI Bridge types supported on the SGI Altix platforms
- */
-#define PCIBR_BRIDGETYPE_UNKNOWN       -1
-#define PCIBR_BRIDGETYPE_PIC            2
-#define PCIBR_BRIDGETYPE_TIOCP          3
-
-/*
- * Bridge 64bit Direct Map Attributes
- */
-#define PCI64_ATTR_PREF                 (1ull << 59)
-#define PCI64_ATTR_PREC                 (1ull << 58)
-#define PCI64_ATTR_VIRTUAL              (1ull << 57)
-#define PCI64_ATTR_BAR                  (1ull << 56)
-#define PCI64_ATTR_SWAP                 (1ull << 55)
-#define PCI64_ATTR_VIRTUAL1             (1ull << 54)
-
-#define PCI32_LOCAL_BASE                0
-#define PCI32_MAPPED_BASE               0x40000000
-#define PCI32_DIRECT_BASE               0x80000000
-
-#define IS_PCI32_MAPPED(x)              ((u64)(x) < PCI32_DIRECT_BASE && \
-                                         (u64)(x) >= PCI32_MAPPED_BASE)
-#define IS_PCI32_DIRECT(x)              ((u64)(x) >= PCI32_MAPPED_BASE)
-
-
-/*
- * Bridge PMU Address Transaltion Entry Attibutes
- */
-#define PCI32_ATE_V                     (0x1 << 0)
-#define PCI32_ATE_CO                    (0x1 << 1)     /* PIC ASIC ONLY */
-#define PCI32_ATE_PIO                   (0x1 << 1)     /* TIOCP ASIC ONLY */
-#define PCI32_ATE_MSI                   (0x1 << 2)
-#define PCI32_ATE_PREF                  (0x1 << 3)
-#define PCI32_ATE_BAR                   (0x1 << 4)
-#define PCI32_ATE_ADDR_SHFT             12
-
-#define MINIMAL_ATES_REQUIRED(addr, size) \
-       (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
-
-#define MINIMAL_ATE_FLAG(addr, size) \
-       (MINIMAL_ATES_REQUIRED((u64)addr, size) ? 1 : 0)
-
-/* bit 29 of the pci address is the SWAP bit */
-#define ATE_SWAPSHIFT                   29
-#define ATE_SWAP_ON(x)                  ((x) |= (1 << ATE_SWAPSHIFT))
-#define ATE_SWAP_OFF(x)                 ((x) &= ~(1 << ATE_SWAPSHIFT))
-
-/*
- * I/O page size
- */
-#if PAGE_SIZE < 16384
-#define IOPFNSHIFT                      12      /* 4K per mapped page */
-#else
-#define IOPFNSHIFT                      14      /* 16K per mapped page */
-#endif
-
-#define IOPGSIZE                        (1 << IOPFNSHIFT)
-#define IOPG(x)                         ((x) >> IOPFNSHIFT)
-#define IOPGOFF(x)                      ((x) & (IOPGSIZE-1))
-
-#define PCIBR_DEV_SWAP_DIR              (1ull << 19)
-#define PCIBR_CTRL_PAGE_SIZE            (0x1 << 21)
-
-/*
- * PMU resources.
- */
-struct ate_resource{
-       u64 *ate;
-       u64 num_ate;
-       u64 lowest_free_index;
-};
-
-struct pcibus_info {
-       struct pcibus_bussoft   pbi_buscommon;   /* common header */
-       u32                pbi_moduleid;
-       short                   pbi_bridge_type;
-       short                   pbi_bridge_mode;
-
-       struct ate_resource     pbi_int_ate_resource;
-       u64                pbi_int_ate_size;
-
-       u64                pbi_dir_xbase;
-       char                    pbi_hub_xid;
-
-       u64                pbi_devreg[8];
-
-       u32             pbi_valid_devices;
-       u32             pbi_enabled_devices;
-
-       spinlock_t              pbi_lock;
-};
-
-extern int  pcibr_init_provider(void);
-extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *);
-extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type);
-extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type);
-extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
-
-/*
- * prototypes for the bridge asic register access routines in pcibr_reg.c
- */
-extern void             pcireg_control_bit_clr(struct pcibus_info *, u64);
-extern void             pcireg_control_bit_set(struct pcibus_info *, u64);
-extern u64         pcireg_tflush_get(struct pcibus_info *);
-extern u64         pcireg_intr_status_get(struct pcibus_info *);
-extern void             pcireg_intr_enable_bit_clr(struct pcibus_info *, u64);
-extern void             pcireg_intr_enable_bit_set(struct pcibus_info *, u64);
-extern void             pcireg_intr_addr_addr_set(struct pcibus_info *, int, u64);
-extern void             pcireg_force_intr_set(struct pcibus_info *, int);
-extern u64         pcireg_wrb_flush_get(struct pcibus_info *, int);
-extern void             pcireg_int_ate_set(struct pcibus_info *, int, u64);
-extern u64 __iomem *   pcireg_int_ate_addr(struct pcibus_info *, int);
-extern void            pcibr_force_interrupt(struct sn_irq_info *sn_irq_info);
-extern void            pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info);
-extern int             pcibr_ate_alloc(struct pcibus_info *, int);
-extern void            pcibr_ate_free(struct pcibus_info *, int);
-extern void            ate_write(struct pcibus_info *, int, int, u64);
-extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
-                                void *resp, char **ssdt);
-extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
-                                 int action, void *resp);
-extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
-#endif
diff --git a/include/asm-ia64/sn/pcibus_provider_defs.h b/include/asm-ia64/sn/pcibus_provider_defs.h
deleted file mode 100644 (file)
index 8f7c83d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
-#define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
-
-/*
- * SN pci asic types.  Do not ever renumber these or reuse values.  The
- * values must agree with what prom thinks they are.
- */
-
-#define PCIIO_ASIC_TYPE_UNKNOWN        0
-#define PCIIO_ASIC_TYPE_PPB    1
-#define PCIIO_ASIC_TYPE_PIC    2
-#define PCIIO_ASIC_TYPE_TIOCP  3
-#define PCIIO_ASIC_TYPE_TIOCA  4
-#define PCIIO_ASIC_TYPE_TIOCE  5
-
-#define PCIIO_ASIC_MAX_TYPES   6
-
-/*
- * Common pciio bus provider data.  There should be one of these as the
- * first field in any pciio based provider soft structure (e.g. pcibr_soft
- * tioca_soft, etc).
- */
-
-struct pcibus_bussoft {
-       u32             bs_asic_type;   /* chipset type */
-       u32             bs_xid;         /* xwidget id */
-       u32             bs_persist_busnum; /* Persistent Bus Number */
-       u32             bs_persist_segment; /* Segment Number */
-       u64             bs_legacy_io;   /* legacy io pio addr */
-       u64             bs_legacy_mem;  /* legacy mem pio addr */
-       u64             bs_base;        /* widget base */
-       struct xwidget_info     *bs_xwidget_info;
-};
-
-struct pci_controller;
-/*
- * SN pci bus indirection
- */
-
-struct sn_pcibus_provider {
-       dma_addr_t      (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags);
-       dma_addr_t      (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags);
-       void            (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
-       void *          (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *);
-       void            (*force_interrupt)(struct sn_irq_info *);
-       void            (*target_interrupt)(struct sn_irq_info *);
-};
-
-/*
- * Flags used by the map interfaces
- * bits 3:0 specifies format of passed in address
- * bit  4   specifies that address is to be used for MSI
- */
-
-#define SN_DMA_ADDRTYPE(x)     ((x) & 0xf)
-#define     SN_DMA_ADDR_PHYS   1       /* address is an xio address. */
-#define     SN_DMA_ADDR_XIO    2       /* address is phys memory */
-#define SN_DMA_MSI             0x10    /* Bus address is to be used for MSI */
-
-extern struct sn_pcibus_provider *sn_pci_provider[];
-#endif                         /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
deleted file mode 100644 (file)
index 1c2382c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PCI_PCIDEV_H
-#define _ASM_IA64_SN_PCI_PCIDEV_H
-
-#include <linux/pci.h>
-
-/*
- * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to
- * the pcidev_info structs for all devices under a controller, we keep a
- * list of pcidev_info under pci_controller->platform_data.
- */
-struct sn_platform_data {
-       void *provider_soft;
-       struct list_head pcidev_info;
-};
-
-#define SN_PLATFORM_DATA(busdev) \
-       ((struct sn_platform_data *)(PCI_CONTROLLER(busdev)->platform_data))
-
-#define SN_PCIDEV_INFO(dev)    sn_pcidev_info_get(dev)
-
-/*
- * Given a pci_bus, return the sn pcibus_bussoft struct.  Note that
- * this only works for root busses, not for busses represented by PPB's.
- */
-
-#define SN_PCIBUS_BUSSOFT(pci_bus) \
-       ((struct pcibus_bussoft *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
-
-#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
-       ((struct pcibus_info *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
-/*
- * Given a struct pci_dev, return the sn pcibus_bussoft struct.  Note
- * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
- * due to possible PPB's in the path.
- */
-
-#define SN_PCIDEV_BUSSOFT(pci_dev) \
-       (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info)
-
-#define SN_PCIDEV_BUSPROVIDER(pci_dev) \
-       (SN_PCIDEV_INFO(pci_dev)->pdi_provider)
-
-#define PCIIO_BUS_NONE 255      /* bus 255 reserved */
-#define PCIIO_SLOT_NONE 255
-#define PCIIO_FUNC_NONE 255
-#define PCIIO_VENDOR_ID_NONE   (-1)
-
-struct pcidev_info {
-       u64             pdi_pio_mapped_addr[7]; /* 6 BARs PLUS 1 ROM */
-       u64             pdi_slot_host_handle;   /* Bus and devfn Host pci_dev */
-
-       struct pcibus_bussoft   *pdi_pcibus_info;       /* Kernel common bus soft */
-       struct pcidev_info      *pdi_host_pcidev_info;  /* Kernel Host pci_dev */
-       struct pci_dev          *pdi_linux_pcidev;      /* Kernel pci_dev */
-
-       struct sn_irq_info      *pdi_sn_irq_info;
-       struct sn_pcibus_provider *pdi_provider;        /* sn pci ops */
-       struct pci_dev          *host_pci_dev;          /* host bus link */
-       struct list_head        pdi_list;               /* List of pcidev_info */
-};
-
-extern void sn_irq_fixup(struct pci_dev *pci_dev,
-                        struct sn_irq_info *sn_irq_info);
-extern void sn_irq_unfixup(struct pci_dev *pci_dev);
-extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
-extern void sn_bus_fixup(struct pci_bus *);
-extern void sn_acpi_bus_fixup(struct pci_bus *);
-extern void sn_common_bus_fixup(struct pci_bus *, struct pcibus_bussoft *);
-extern void sn_bus_store_sysdata(struct pci_dev *dev);
-extern void sn_bus_free_sysdata(void);
-extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
-extern void sn_io_slot_fixup(struct pci_dev *);
-extern void sn_acpi_slot_fixup(struct pci_dev *);
-extern void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *,
-                             struct sn_irq_info *);
-extern void sn_pci_unfixup_slot(struct pci_dev *dev);
-extern void sn_irq_lh_init(void);
-#endif                         /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h
deleted file mode 100644 (file)
index 1c5108d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PDA_H
-#define _ASM_IA64_SN_PDA_H
-
-#include <linux/cache.h>
-#include <asm/percpu.h>
-#include <asm/system.h>
-
-
-/*
- * CPU-specific data structure.
- *
- * One of these structures is allocated for each cpu of a NUMA system.
- *
- * This structure provides a convenient way of keeping together 
- * all SN per-cpu data structures. 
- */
-
-typedef struct pda_s {
-
-       /*
-        * Support for SN LEDs
-        */
-       volatile short  *led_address;
-       u8              led_state;
-       u8              hb_state;       /* supports blinking heartbeat leds */
-       unsigned int    hb_count;
-
-       unsigned int    idle_flag;
-       
-       volatile unsigned long *bedrock_rev_id;
-       volatile unsigned long *pio_write_status_addr;
-       unsigned long pio_write_status_val;
-       volatile unsigned long *pio_shub_war_cam_addr;
-
-       unsigned long   sn_in_service_ivecs[4];
-       int             sn_lb_int_war_ticks;
-       int             sn_last_irq;
-       int             sn_first_irq;
-} pda_t;
-
-
-#define CACHE_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
-
-/*
- * PDA
- * Per-cpu private data area for each cpu. The PDA is located immediately after
- * the IA64 cpu_data area. A full page is allocated for the cp_data area for each
- * cpu but only a small amout of the page is actually used. We put the SNIA PDA
- * in the same page as the cpu_data area. Note that there is a check in the setup
- * code to verify that we don't overflow the page.
- *
- * Seems like we should should cache-line align the pda so that any changes in the
- * size of the cpu_data area don't change cache layout. Should we align to 32, 64, 128
- * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later.
- */
-DECLARE_PER_CPU(struct pda_s, pda_percpu);
-
-#define pda            (&__ia64_per_cpu_var(pda_percpu))
-
-#define pdacpu(cpu)    (&per_cpu(pda_percpu, cpu))
-
-#endif /* _ASM_IA64_SN_PDA_H */
diff --git a/include/asm-ia64/sn/pic.h b/include/asm-ia64/sn/pic.h
deleted file mode 100644 (file)
index 5f9da5f..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PCI_PIC_H
-#define _ASM_IA64_SN_PCI_PIC_H
-
-/*
- * PIC AS DEVICE ZERO
- * ------------------
- *
- * PIC handles PCI/X busses.  PCI/X requires that the 'bridge' (i.e. PIC)
- * be designated as 'device 0'.   That is a departure from earlier SGI
- * PCI bridges.  Because of that we use config space 1 to access the
- * config space of the first actual PCI device on the bus.
- * Here's what the PIC manual says:
- *
- *     The current PCI-X bus specification now defines that the parent
- *     hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC
- *     reduced the total number of devices from 8 to 4 and removed the
- *     device registers and windows, now only supporting devices 0,1,2, and
- *     3. PIC did leave all 8 configuration space windows. The reason was
- *     there was nothing to gain by removing them. Here in lies the problem.
- *     The device numbering we do using 0 through 3 is unrelated to the device
- *     numbering which PCI-X requires in configuration space. In the past we
- *     correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc.
- *     PCI-X requires we start a 1, not 0 and currently the PX brick
- *     does associate our:
- *
- *         device 0 with configuration space window 1,
- *         device 1 with configuration space window 2,
- *         device 2 with configuration space window 3,
- *         device 3 with configuration space window 4.
- *
- * The net effect is that all config space access are off-by-one with
- * relation to other per-slot accesses on the PIC.
- * Here is a table that shows some of that:
- *
- *                               Internal Slot#
- *           |
- *           |     0         1        2         3
- * ----------|---------------------------------------
- * config    |  0x21000   0x22000  0x23000   0x24000
- *           |
- * even rrb  |  0[0]      n/a      1[0]      n/a       [] == implied even/odd
- *           |
- * odd rrb   |  n/a       0[1]     n/a       1[1]
- *           |
- * int dev   |  00       01        10        11
- *           |
- * ext slot# |  1        2         3         4
- * ----------|---------------------------------------
- */
-
-#define PIC_ATE_TARGETID_SHFT           8
-#define PIC_HOST_INTR_ADDR              0x0000FFFFFFFFFFFFUL
-#define PIC_PCI64_ATTR_TARG_SHFT        60
-
-
-/*****************************************************************************
- *********************** PIC MMR structure mapping ***************************
- *****************************************************************************/
-
-/* NOTE: PIC WAR. PV#854697.  PIC does not allow writes just to [31:0]
- * of a 64-bit register.  When writing PIC registers, always write the
- * entire 64 bits.
- */
-
-struct pic {
-
-    /* 0x000000-0x00FFFF -- Local Registers */
-
-    /* 0x000000-0x000057 -- Standard Widget Configuration */
-    u64                p_wid_id;                       /* 0x000000 */
-    u64                p_wid_stat;                     /* 0x000008 */
-    u64                p_wid_err_upper;                /* 0x000010 */
-    u64                p_wid_err_lower;                /* 0x000018 */
-    #define p_wid_err p_wid_err_lower
-    u64                p_wid_control;                  /* 0x000020 */
-    u64                p_wid_req_timeout;              /* 0x000028 */
-    u64                p_wid_int_upper;                /* 0x000030 */
-    u64                p_wid_int_lower;                /* 0x000038 */
-    #define p_wid_int p_wid_int_lower
-    u64                p_wid_err_cmdword;              /* 0x000040 */
-    u64                p_wid_llp;                      /* 0x000048 */
-    u64                p_wid_tflush;                   /* 0x000050 */
-
-    /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
-    u64                p_wid_aux_err;                  /* 0x000058 */
-    u64                p_wid_resp_upper;               /* 0x000060 */
-    u64                p_wid_resp_lower;               /* 0x000068 */
-    #define p_wid_resp p_wid_resp_lower
-    u64                p_wid_tst_pin_ctrl;             /* 0x000070 */
-    u64                p_wid_addr_lkerr;               /* 0x000078 */
-
-    /* 0x000080-0x00008F -- PMU & MAP */
-    u64                p_dir_map;                      /* 0x000080 */
-    u64                _pad_000088;                    /* 0x000088 */
-
-    /* 0x000090-0x00009F -- SSRAM */
-    u64                p_map_fault;                    /* 0x000090 */
-    u64                _pad_000098;                    /* 0x000098 */
-
-    /* 0x0000A0-0x0000AF -- Arbitration */
-    u64                p_arb;                          /* 0x0000A0 */
-    u64                _pad_0000A8;                    /* 0x0000A8 */
-
-    /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
-    u64                p_ate_parity_err;               /* 0x0000B0 */
-    u64                _pad_0000B8;                    /* 0x0000B8 */
-
-    /* 0x0000C0-0x0000FF -- PCI/GIO */
-    u64                p_bus_timeout;                  /* 0x0000C0 */
-    u64                p_pci_cfg;                      /* 0x0000C8 */
-    u64                p_pci_err_upper;                /* 0x0000D0 */
-    u64                p_pci_err_lower;                /* 0x0000D8 */
-    #define p_pci_err p_pci_err_lower
-    u64                _pad_0000E0[4];                 /* 0x0000{E0..F8} */
-
-    /* 0x000100-0x0001FF -- Interrupt */
-    u64                p_int_status;                   /* 0x000100 */
-    u64                p_int_enable;                   /* 0x000108 */
-    u64                p_int_rst_stat;                 /* 0x000110 */
-    u64                p_int_mode;                     /* 0x000118 */
-    u64                p_int_device;                   /* 0x000120 */
-    u64                p_int_host_err;                 /* 0x000128 */
-    u64                p_int_addr[8];                  /* 0x0001{30,,,68} */
-    u64                p_err_int_view;                 /* 0x000170 */
-    u64                p_mult_int;                     /* 0x000178 */
-    u64                p_force_always[8];              /* 0x0001{80,,,B8} */
-    u64                p_force_pin[8];                 /* 0x0001{C0,,,F8} */
-
-    /* 0x000200-0x000298 -- Device */
-    u64                p_device[4];                    /* 0x0002{00,,,18} */
-    u64                _pad_000220[4];                 /* 0x0002{20,,,38} */
-    u64                p_wr_req_buf[4];                /* 0x0002{40,,,58} */
-    u64                _pad_000260[4];                 /* 0x0002{60,,,78} */
-    u64                p_rrb_map[2];                   /* 0x0002{80,,,88} */
-    #define p_even_resp p_rrb_map[0]                   /* 0x000280 */
-    #define p_odd_resp  p_rrb_map[1]                   /* 0x000288 */
-    u64                p_resp_status;                  /* 0x000290 */
-    u64                p_resp_clear;                   /* 0x000298 */
-
-    u64                _pad_0002A0[12];                /* 0x0002{A0..F8} */
-
-    /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
-    struct {
-       u64     upper;                          /* 0x0003{00,,,F0} */
-       u64     lower;                          /* 0x0003{08,,,F8} */
-    } p_buf_addr_match[16];
-
-    /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
-    struct {
-       u64     flush_w_touch;                  /* 0x000{400,,,5C0} */
-       u64     flush_wo_touch;                 /* 0x000{408,,,5C8} */
-       u64     inflight;                       /* 0x000{410,,,5D0} */
-       u64     prefetch;                       /* 0x000{418,,,5D8} */
-       u64     total_pci_retry;                /* 0x000{420,,,5E0} */
-       u64     max_pci_retry;                  /* 0x000{428,,,5E8} */
-       u64     max_latency;                    /* 0x000{430,,,5F0} */
-       u64     clear_all;                      /* 0x000{438,,,5F8} */
-    } p_buf_count[8];
-
-
-    /* 0x000600-0x0009FF -- PCI/X registers */
-    u64                p_pcix_bus_err_addr;            /* 0x000600 */
-    u64                p_pcix_bus_err_attr;            /* 0x000608 */
-    u64                p_pcix_bus_err_data;            /* 0x000610 */
-    u64                p_pcix_pio_split_addr;          /* 0x000618 */
-    u64                p_pcix_pio_split_attr;          /* 0x000620 */
-    u64                p_pcix_dma_req_err_attr;        /* 0x000628 */
-    u64                p_pcix_dma_req_err_addr;        /* 0x000630 */
-    u64                p_pcix_timeout;                 /* 0x000638 */
-
-    u64                _pad_000640[120];               /* 0x000{640,,,9F8} */
-
-    /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
-    struct {
-       u64     p_buf_addr;                     /* 0x000{A00,,,AF0} */
-       u64     p_buf_attr;                     /* 0X000{A08,,,AF8} */
-    } p_pcix_read_buf_64[16];
-
-    struct {
-       u64     p_buf_addr;                     /* 0x000{B00,,,BE0} */
-       u64     p_buf_attr;                     /* 0x000{B08,,,BE8} */
-       u64     p_buf_valid;                    /* 0x000{B10,,,BF0} */
-       u64     __pad1;                         /* 0x000{B18,,,BF8} */
-    } p_pcix_write_buf_64[8];
-
-    /* End of Local Registers -- Start of Address Map space */
-
-    char               _pad_000c00[0x010000 - 0x000c00];
-
-    /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
-    u64                p_int_ate_ram[1024];            /* 0x010000-0x011fff */
-
-    /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
-    u64                p_int_ate_ram_mp[1024];         /* 0x012000-0x013fff */
-
-    char               _pad_014000[0x18000 - 0x014000];
-
-    /* 0x18000-0x197F8 -- PIC Write Request Ram */
-    u64                p_wr_req_lower[256];            /* 0x18000 - 0x187F8 */
-    u64                p_wr_req_upper[256];            /* 0x18800 - 0x18FF8 */
-    u64                p_wr_req_parity[256];           /* 0x19000 - 0x197F8 */
-
-    char               _pad_019800[0x20000 - 0x019800];
-
-    /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
-    union {
-       u8              c[0x1000 / 1];                  /* 0x02{0000,,,7FFF} */
-       u16     s[0x1000 / 2];                  /* 0x02{0000,,,7FFF} */
-       u32     l[0x1000 / 4];                  /* 0x02{0000,,,7FFF} */
-       u64     d[0x1000 / 8];                  /* 0x02{0000,,,7FFF} */
-       union {
-           u8  c[0x100 / 1];
-           u16 s[0x100 / 2];
-           u32 l[0x100 / 4];
-           u64 d[0x100 / 8];
-       } f[8];
-    } p_type0_cfg_dev[8];                              /* 0x02{0000,,,7FFF} */
-
-    /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
-    union {
-       u8              c[0x1000 / 1];                  /* 0x028000-0x029000 */
-       u16     s[0x1000 / 2];                  /* 0x028000-0x029000 */
-       u32     l[0x1000 / 4];                  /* 0x028000-0x029000 */
-       u64     d[0x1000 / 8];                  /* 0x028000-0x029000 */
-       union {
-           u8  c[0x100 / 1];
-           u16 s[0x100 / 2];
-           u32 l[0x100 / 4];
-           u64 d[0x100 / 8];
-       } f[8];
-    } p_type1_cfg;                                     /* 0x028000-0x029000 */
-
-    char               _pad_029000[0x030000-0x029000];
-
-    /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
-    union {
-       u8              c[8 / 1];
-       u16     s[8 / 2];
-       u32     l[8 / 4];
-       u64     d[8 / 8];
-    } p_pci_iack;                                      /* 0x030000-0x030007 */
-
-    char               _pad_030007[0x040000-0x030008];
-
-    /* 0x040000-0x030007 -- PCIX Special Cycle */
-    union {
-       u8              c[8 / 1];
-       u16     s[8 / 2];
-       u32     l[8 / 4];
-       u64     d[8 / 8];
-    } p_pcix_cycle;                                    /* 0x040000-0x040007 */
-};
-
-#endif                          /* _ASM_IA64_SN_PCI_PIC_H */
diff --git a/include/asm-ia64/sn/rw_mmr.h b/include/asm-ia64/sn/rw_mmr.h
deleted file mode 100644 (file)
index 2d78f4c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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) 2002-2006 Silicon Graphics, Inc.  All Rights Reserved.
- */
-#ifndef _ASM_IA64_SN_RW_MMR_H
-#define _ASM_IA64_SN_RW_MMR_H
-
-
-/*
- * This file that access MMRs via uncached physical addresses.
- *     pio_phys_read_mmr  - read an MMR
- *     pio_phys_write_mmr - write an MMR
- *     pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0
- *             Second MMR will be skipped if address is NULL
- *
- * Addresses passed to these routines should be uncached physical addresses
- * ie., 0x80000....
- */
-
-
-extern long pio_phys_read_mmr(volatile long *mmr); 
-extern void pio_phys_write_mmr(volatile long *mmr, long val);
-extern void pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2); 
-
-#endif /* _ASM_IA64_SN_RW_MMR_H */
diff --git a/include/asm-ia64/sn/shub_mmr.h b/include/asm-ia64/sn/shub_mmr.h
deleted file mode 100644 (file)
index 7de1d1d..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- *
- * 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) 2001-2005 Silicon Graphics, Inc.  All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_SHUB_MMR_H
-#define _ASM_IA64_SN_SHUB_MMR_H
-
-/* ==================================================================== */
-/*                        Register "SH_IPI_INT"                         */
-/*               SHub Inter-Processor Interrupt Registers               */
-/* ==================================================================== */
-#define SH1_IPI_INT                    __IA64_UL_CONST(0x0000000110000380)
-#define SH2_IPI_INT                    __IA64_UL_CONST(0x0000000010000380)
-
-/*   SH_IPI_INT_TYPE                                                    */
-/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
-#define SH_IPI_INT_TYPE_SHFT                           0
-#define SH_IPI_INT_TYPE_MASK           __IA64_UL_CONST(0x0000000000000007)
-
-/*   SH_IPI_INT_AGT                                                     */
-/*   Description:  Agent, must be 0 for SHub                            */
-#define SH_IPI_INT_AGT_SHFT                            3
-#define SH_IPI_INT_AGT_MASK            __IA64_UL_CONST(0x0000000000000008)
-
-/*   SH_IPI_INT_PID                                                     */
-/*   Description:  Processor ID, same setting as on targeted McKinley  */
-#define SH_IPI_INT_PID_SHFT                            4
-#define SH_IPI_INT_PID_MASK            __IA64_UL_CONST(0x00000000000ffff0)
-
-/*   SH_IPI_INT_BASE                                                    */
-/*   Description:  Optional interrupt vector area, 2MB aligned          */
-#define SH_IPI_INT_BASE_SHFT                           21
-#define SH_IPI_INT_BASE_MASK           __IA64_UL_CONST(0x0003ffffffe00000)
-
-/*   SH_IPI_INT_IDX                                                     */
-/*   Description:  Targeted McKinley interrupt vector                   */
-#define SH_IPI_INT_IDX_SHFT                            52
-#define SH_IPI_INT_IDX_MASK            __IA64_UL_CONST(0x0ff0000000000000)
-
-/*   SH_IPI_INT_SEND                                                    */
-/*   Description:  Send Interrupt Message to PI, This generates a puls  */
-#define SH_IPI_INT_SEND_SHFT                           63
-#define SH_IPI_INT_SEND_MASK           __IA64_UL_CONST(0x8000000000000000)
-
-/* ==================================================================== */
-/*                     Register "SH_EVENT_OCCURRED"                     */
-/*                    SHub Interrupt Event Occurred                     */
-/* ==================================================================== */
-#define SH1_EVENT_OCCURRED             __IA64_UL_CONST(0x0000000110010000)
-#define SH1_EVENT_OCCURRED_ALIAS       __IA64_UL_CONST(0x0000000110010008)
-#define SH2_EVENT_OCCURRED             __IA64_UL_CONST(0x0000000010010000)
-#define SH2_EVENT_OCCURRED_ALIAS       __IA64_UL_CONST(0x0000000010010008)
-
-/* ==================================================================== */
-/*                     Register "SH_PI_CAM_CONTROL"                     */
-/*                      CRB CAM MMR Access Control                      */
-/* ==================================================================== */
-#define SH1_PI_CAM_CONTROL             __IA64_UL_CONST(0x0000000120050300)
-
-/* ==================================================================== */
-/*                        Register "SH_SHUB_ID"                         */
-/*                            SHub ID Number                            */
-/* ==================================================================== */
-#define SH1_SHUB_ID                    __IA64_UL_CONST(0x0000000110060580)
-#define SH1_SHUB_ID_REVISION_SHFT                      28
-#define SH1_SHUB_ID_REVISION_MASK      __IA64_UL_CONST(0x00000000f0000000)
-
-/* ==================================================================== */
-/*                          Register "SH_RTC"                           */
-/*                           Real-time Clock                            */
-/* ==================================================================== */
-#define SH1_RTC                                __IA64_UL_CONST(0x00000001101c0000)
-#define SH2_RTC                                __IA64_UL_CONST(0x00000002101c0000)
-#define SH_RTC_MASK                    __IA64_UL_CONST(0x007fffffffffffff)
-
-/* ==================================================================== */
-/*                   Register "SH_PIO_WRITE_STATUS_0|1"                 */
-/*                      PIO Write Status for CPU 0 & 1                  */
-/* ==================================================================== */
-#define SH1_PIO_WRITE_STATUS_0         __IA64_UL_CONST(0x0000000120070200)
-#define SH1_PIO_WRITE_STATUS_1         __IA64_UL_CONST(0x0000000120070280)
-#define SH2_PIO_WRITE_STATUS_0         __IA64_UL_CONST(0x0000000020070200)
-#define SH2_PIO_WRITE_STATUS_1         __IA64_UL_CONST(0x0000000020070280)
-#define SH2_PIO_WRITE_STATUS_2         __IA64_UL_CONST(0x0000000020070300)
-#define SH2_PIO_WRITE_STATUS_3         __IA64_UL_CONST(0x0000000020070380)
-
-/*   SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK                               */
-/*   Description:  Deadlock response detected                           */
-#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT                1
-#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK \
-                                       __IA64_UL_CONST(0x0000000000000002)
-
-/*   SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT                          */
-/*   Description:  Count of currently pending PIO writes                */
-#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_SHFT   56
-#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK \
-                                       __IA64_UL_CONST(0x3f00000000000000)
-
-/* ==================================================================== */
-/*                Register "SH_PIO_WRITE_STATUS_0_ALIAS"                */
-/* ==================================================================== */
-#define SH1_PIO_WRITE_STATUS_0_ALIAS   __IA64_UL_CONST(0x0000000120070208)
-#define SH2_PIO_WRITE_STATUS_0_ALIAS   __IA64_UL_CONST(0x0000000020070208)
-
-/* ==================================================================== */
-/*                     Register "SH_EVENT_OCCURRED"                     */
-/*                    SHub Interrupt Event Occurred                     */
-/* ==================================================================== */
-/*   SH_EVENT_OCCURRED_UART_INT                                         */
-/*   Description:  Pending Junk Bus UART Interrupt                      */
-#define SH_EVENT_OCCURRED_UART_INT_SHFT                        20
-#define SH_EVENT_OCCURRED_UART_INT_MASK        __IA64_UL_CONST(0x0000000000100000)
-
-/*   SH_EVENT_OCCURRED_IPI_INT                                          */
-/*   Description:  Pending IPI Interrupt                                */
-#define SH_EVENT_OCCURRED_IPI_INT_SHFT                 28
-#define SH_EVENT_OCCURRED_IPI_INT_MASK __IA64_UL_CONST(0x0000000010000000)
-
-/*   SH_EVENT_OCCURRED_II_INT0                                          */
-/*   Description:  Pending II 0 Interrupt                               */
-#define SH_EVENT_OCCURRED_II_INT0_SHFT                 29
-#define SH_EVENT_OCCURRED_II_INT0_MASK __IA64_UL_CONST(0x0000000020000000)
-
-/*   SH_EVENT_OCCURRED_II_INT1                                          */
-/*   Description:  Pending II 1 Interrupt                               */
-#define SH_EVENT_OCCURRED_II_INT1_SHFT                 30
-#define SH_EVENT_OCCURRED_II_INT1_MASK __IA64_UL_CONST(0x0000000040000000)
-
-/*   SH2_EVENT_OCCURRED_EXTIO_INT2                                      */
-/*   Description:  Pending SHUB 2 EXT IO INT2                           */
-#define SH2_EVENT_OCCURRED_EXTIO_INT2_SHFT             33
-#define SH2_EVENT_OCCURRED_EXTIO_INT2_MASK __IA64_UL_CONST(0x0000000200000000)
-
-/*   SH2_EVENT_OCCURRED_EXTIO_INT3                                      */
-/*   Description:  Pending SHUB 2 EXT IO INT3                           */
-#define SH2_EVENT_OCCURRED_EXTIO_INT3_SHFT             34
-#define SH2_EVENT_OCCURRED_EXTIO_INT3_MASK __IA64_UL_CONST(0x0000000400000000)
-
-#define SH_ALL_INT_MASK \
-       (SH_EVENT_OCCURRED_UART_INT_MASK | SH_EVENT_OCCURRED_IPI_INT_MASK | \
-        SH_EVENT_OCCURRED_II_INT0_MASK | SH_EVENT_OCCURRED_II_INT1_MASK | \
-        SH_EVENT_OCCURRED_II_INT1_MASK | SH2_EVENT_OCCURRED_EXTIO_INT2_MASK | \
-        SH2_EVENT_OCCURRED_EXTIO_INT3_MASK)
-
-
-/* ==================================================================== */
-/*                         LEDS                                         */
-/* ==================================================================== */
-#define SH1_REAL_JUNK_BUS_LED0                 0x7fed00000UL
-#define SH1_REAL_JUNK_BUS_LED1                 0x7fed10000UL
-#define SH1_REAL_JUNK_BUS_LED2                 0x7fed20000UL
-#define SH1_REAL_JUNK_BUS_LED3                 0x7fed30000UL
-
-#define SH2_REAL_JUNK_BUS_LED0                 0xf0000000UL
-#define SH2_REAL_JUNK_BUS_LED1                 0xf0010000UL
-#define SH2_REAL_JUNK_BUS_LED2                 0xf0020000UL
-#define SH2_REAL_JUNK_BUS_LED3                 0xf0030000UL
-
-/* ==================================================================== */
-/*                         Register "SH1_PTC_0"                         */
-/*       Puge Translation Cache Message Configuration Information       */
-/* ==================================================================== */
-#define SH1_PTC_0                      __IA64_UL_CONST(0x00000001101a0000)
-
-/*   SH1_PTC_0_A                                                        */
-/*   Description:  Type                                                 */
-#define SH1_PTC_0_A_SHFT                               0
-
-/*   SH1_PTC_0_PS                                                       */
-/*   Description:  Page Size                                            */
-#define SH1_PTC_0_PS_SHFT                              2
-
-/*   SH1_PTC_0_RID                                                      */
-/*   Description:  Region ID                                            */
-#define SH1_PTC_0_RID_SHFT                             8
-
-/*   SH1_PTC_0_START                                                    */
-/*   Description:  Start                                                */
-#define SH1_PTC_0_START_SHFT                           63
-
-/* ==================================================================== */
-/*                         Register "SH1_PTC_1"                         */
-/*       Puge Translation Cache Message Configuration Information       */
-/* ==================================================================== */
-#define SH1_PTC_1                      __IA64_UL_CONST(0x00000001101a0080)
-
-/*   SH1_PTC_1_START                                                    */
-/*   Description:  PTC_1 Start                                          */
-#define SH1_PTC_1_START_SHFT                           63
-
-/* ==================================================================== */
-/*                         Register "SH2_PTC"                           */
-/*       Puge Translation Cache Message Configuration Information       */
-/* ==================================================================== */
-#define SH2_PTC                                __IA64_UL_CONST(0x0000000170000000)
-
-/*   SH2_PTC_A                                                          */
-/*   Description:  Type                                                 */
-#define SH2_PTC_A_SHFT                                 0
-
-/*   SH2_PTC_PS                                                         */
-/*   Description:  Page Size                                            */
-#define SH2_PTC_PS_SHFT                                        2
-
-/*   SH2_PTC_RID                                                      */
-/*   Description:  Region ID                                            */
-#define SH2_PTC_RID_SHFT                               4
-
-/*   SH2_PTC_START                                                      */
-/*   Description:  Start                                                */
-#define SH2_PTC_START_SHFT                             63
-
-/*   SH2_PTC_ADDR_RID                                                   */
-/*   Description:  Region ID                                            */
-#define SH2_PTC_ADDR_SHFT                              4
-#define SH2_PTC_ADDR_MASK              __IA64_UL_CONST(0x1ffffffffffff000)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC1_INT_CONFIG"                     */
-/*                SHub RTC 1 Interrupt Config Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC1_INT_CONFIG            __IA64_UL_CONST(0x0000000110001480)
-#define SH2_RTC1_INT_CONFIG            __IA64_UL_CONST(0x0000000010001480)
-#define SH_RTC1_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
-#define SH_RTC1_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC1_INT_CONFIG_TYPE                                            */
-/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
-#define SH_RTC1_INT_CONFIG_TYPE_SHFT                   0
-#define SH_RTC1_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
-
-/*   SH_RTC1_INT_CONFIG_AGT                                             */
-/*   Description:  Agent, must be 0 for SHub                            */
-#define SH_RTC1_INT_CONFIG_AGT_SHFT                    3
-#define SH_RTC1_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
-
-/*   SH_RTC1_INT_CONFIG_PID                                             */
-/*   Description:  Processor ID, same setting as on targeted McKinley  */
-#define SH_RTC1_INT_CONFIG_PID_SHFT                    4
-#define SH_RTC1_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
-
-/*   SH_RTC1_INT_CONFIG_BASE                                            */
-/*   Description:  Optional interrupt vector area, 2MB aligned          */
-#define SH_RTC1_INT_CONFIG_BASE_SHFT                   21
-#define SH_RTC1_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
-
-/*   SH_RTC1_INT_CONFIG_IDX                                             */
-/*   Description:  Targeted McKinley interrupt vector                   */
-#define SH_RTC1_INT_CONFIG_IDX_SHFT                    52
-#define SH_RTC1_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC1_INT_ENABLE"                     */
-/*                SHub RTC 1 Interrupt Enable Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC1_INT_ENABLE            __IA64_UL_CONST(0x0000000110001500)
-#define SH2_RTC1_INT_ENABLE            __IA64_UL_CONST(0x0000000010001500)
-#define SH_RTC1_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
-#define SH_RTC1_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC1_INT_ENABLE_RTC1_ENABLE                                     */
-/*   Description:  Enable RTC 1 Interrupt                               */
-#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_SHFT            0
-#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_MASK \
-                                       __IA64_UL_CONST(0x0000000000000001)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC2_INT_CONFIG"                     */
-/*                SHub RTC 2 Interrupt Config Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC2_INT_CONFIG            __IA64_UL_CONST(0x0000000110001580)
-#define SH2_RTC2_INT_CONFIG            __IA64_UL_CONST(0x0000000010001580)
-#define SH_RTC2_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
-#define SH_RTC2_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC2_INT_CONFIG_TYPE                                            */
-/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
-#define SH_RTC2_INT_CONFIG_TYPE_SHFT                   0
-#define SH_RTC2_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
-
-/*   SH_RTC2_INT_CONFIG_AGT                                             */
-/*   Description:  Agent, must be 0 for SHub                            */
-#define SH_RTC2_INT_CONFIG_AGT_SHFT                    3
-#define SH_RTC2_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
-
-/*   SH_RTC2_INT_CONFIG_PID                                             */
-/*   Description:  Processor ID, same setting as on targeted McKinley  */
-#define SH_RTC2_INT_CONFIG_PID_SHFT                    4
-#define SH_RTC2_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
-
-/*   SH_RTC2_INT_CONFIG_BASE                                            */
-/*   Description:  Optional interrupt vector area, 2MB aligned          */
-#define SH_RTC2_INT_CONFIG_BASE_SHFT                   21
-#define SH_RTC2_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
-
-/*   SH_RTC2_INT_CONFIG_IDX                                             */
-/*   Description:  Targeted McKinley interrupt vector                   */
-#define SH_RTC2_INT_CONFIG_IDX_SHFT                    52
-#define SH_RTC2_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC2_INT_ENABLE"                     */
-/*                SHub RTC 2 Interrupt Enable Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC2_INT_ENABLE            __IA64_UL_CONST(0x0000000110001600)
-#define SH2_RTC2_INT_ENABLE            __IA64_UL_CONST(0x0000000010001600)
-#define SH_RTC2_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
-#define SH_RTC2_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC2_INT_ENABLE_RTC2_ENABLE                                     */
-/*   Description:  Enable RTC 2 Interrupt                               */
-#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_SHFT            0
-#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_MASK \
-                                       __IA64_UL_CONST(0x0000000000000001)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC3_INT_CONFIG"                     */
-/*                SHub RTC 3 Interrupt Config Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC3_INT_CONFIG            __IA64_UL_CONST(0x0000000110001680)
-#define SH2_RTC3_INT_CONFIG            __IA64_UL_CONST(0x0000000010001680)
-#define SH_RTC3_INT_CONFIG_MASK                __IA64_UL_CONST(0x0ff3ffffffefffff)
-#define SH_RTC3_INT_CONFIG_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC3_INT_CONFIG_TYPE                                            */
-/*   Description:  Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT       */
-#define SH_RTC3_INT_CONFIG_TYPE_SHFT                   0
-#define SH_RTC3_INT_CONFIG_TYPE_MASK   __IA64_UL_CONST(0x0000000000000007)
-
-/*   SH_RTC3_INT_CONFIG_AGT                                             */
-/*   Description:  Agent, must be 0 for SHub                            */
-#define SH_RTC3_INT_CONFIG_AGT_SHFT                    3
-#define SH_RTC3_INT_CONFIG_AGT_MASK    __IA64_UL_CONST(0x0000000000000008)
-
-/*   SH_RTC3_INT_CONFIG_PID                                             */
-/*   Description:  Processor ID, same setting as on targeted McKinley  */
-#define SH_RTC3_INT_CONFIG_PID_SHFT                    4
-#define SH_RTC3_INT_CONFIG_PID_MASK    __IA64_UL_CONST(0x00000000000ffff0)
-
-/*   SH_RTC3_INT_CONFIG_BASE                                            */
-/*   Description:  Optional interrupt vector area, 2MB aligned          */
-#define SH_RTC3_INT_CONFIG_BASE_SHFT                   21
-#define SH_RTC3_INT_CONFIG_BASE_MASK   __IA64_UL_CONST(0x0003ffffffe00000)
-
-/*   SH_RTC3_INT_CONFIG_IDX                                             */
-/*   Description:  Targeted McKinley interrupt vector                   */
-#define SH_RTC3_INT_CONFIG_IDX_SHFT                    52
-#define SH_RTC3_INT_CONFIG_IDX_MASK    __IA64_UL_CONST(0x0ff0000000000000)
-
-/* ==================================================================== */
-/*                    Register "SH_RTC3_INT_ENABLE"                     */
-/*                SHub RTC 3 Interrupt Enable Registers                 */
-/* ==================================================================== */
-
-#define SH1_RTC3_INT_ENABLE            __IA64_UL_CONST(0x0000000110001700)
-#define SH2_RTC3_INT_ENABLE            __IA64_UL_CONST(0x0000000010001700)
-#define SH_RTC3_INT_ENABLE_MASK                __IA64_UL_CONST(0x0000000000000001)
-#define SH_RTC3_INT_ENABLE_INIT                __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_RTC3_INT_ENABLE_RTC3_ENABLE                                     */
-/*   Description:  Enable RTC 3 Interrupt                               */
-#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_SHFT            0
-#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_MASK \
-                                       __IA64_UL_CONST(0x0000000000000001)
-
-/*   SH_EVENT_OCCURRED_RTC1_INT                                         */
-/*   Description:  Pending RTC 1 Interrupt                              */
-#define SH_EVENT_OCCURRED_RTC1_INT_SHFT                        24
-#define SH_EVENT_OCCURRED_RTC1_INT_MASK        __IA64_UL_CONST(0x0000000001000000)
-
-/*   SH_EVENT_OCCURRED_RTC2_INT                                         */
-/*   Description:  Pending RTC 2 Interrupt                              */
-#define SH_EVENT_OCCURRED_RTC2_INT_SHFT                        25
-#define SH_EVENT_OCCURRED_RTC2_INT_MASK        __IA64_UL_CONST(0x0000000002000000)
-
-/*   SH_EVENT_OCCURRED_RTC3_INT                                         */
-/*   Description:  Pending RTC 3 Interrupt                              */
-#define SH_EVENT_OCCURRED_RTC3_INT_SHFT                        26
-#define SH_EVENT_OCCURRED_RTC3_INT_MASK        __IA64_UL_CONST(0x0000000004000000)
-
-/* ==================================================================== */
-/*                       Register "SH_IPI_ACCESS"                       */
-/*                 CPU interrupt Access Permission Bits                 */
-/* ==================================================================== */
-
-#define SH1_IPI_ACCESS                 __IA64_UL_CONST(0x0000000110060480)
-#define SH2_IPI_ACCESS0                        __IA64_UL_CONST(0x0000000010060c00)
-#define SH2_IPI_ACCESS1                        __IA64_UL_CONST(0x0000000010060c80)
-#define SH2_IPI_ACCESS2                        __IA64_UL_CONST(0x0000000010060d00)
-#define SH2_IPI_ACCESS3                        __IA64_UL_CONST(0x0000000010060d80)
-
-/* ==================================================================== */
-/*                        Register "SH_INT_CMPB"                        */
-/*                  RTC Compare Value for Processor B                   */
-/* ==================================================================== */
-
-#define SH1_INT_CMPB                   __IA64_UL_CONST(0x00000001101b0080)
-#define SH2_INT_CMPB                   __IA64_UL_CONST(0x00000000101b0080)
-#define SH_INT_CMPB_MASK               __IA64_UL_CONST(0x007fffffffffffff)
-#define SH_INT_CMPB_INIT               __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_INT_CMPB_REAL_TIME_CMPB                                         */
-/*   Description:  Real Time Clock Compare                              */
-#define SH_INT_CMPB_REAL_TIME_CMPB_SHFT                        0
-#define SH_INT_CMPB_REAL_TIME_CMPB_MASK        __IA64_UL_CONST(0x007fffffffffffff)
-
-/* ==================================================================== */
-/*                        Register "SH_INT_CMPC"                        */
-/*                  RTC Compare Value for Processor C                   */
-/* ==================================================================== */
-
-#define SH1_INT_CMPC                   __IA64_UL_CONST(0x00000001101b0100)
-#define SH2_INT_CMPC                   __IA64_UL_CONST(0x00000000101b0100)
-#define SH_INT_CMPC_MASK               __IA64_UL_CONST(0x007fffffffffffff)
-#define SH_INT_CMPC_INIT               __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_INT_CMPC_REAL_TIME_CMPC                                         */
-/*   Description:  Real Time Clock Compare                              */
-#define SH_INT_CMPC_REAL_TIME_CMPC_SHFT                        0
-#define SH_INT_CMPC_REAL_TIME_CMPC_MASK        __IA64_UL_CONST(0x007fffffffffffff)
-
-/* ==================================================================== */
-/*                        Register "SH_INT_CMPD"                        */
-/*                  RTC Compare Value for Processor D                   */
-/* ==================================================================== */
-
-#define SH1_INT_CMPD                   __IA64_UL_CONST(0x00000001101b0180)
-#define SH2_INT_CMPD                   __IA64_UL_CONST(0x00000000101b0180)
-#define SH_INT_CMPD_MASK               __IA64_UL_CONST(0x007fffffffffffff)
-#define SH_INT_CMPD_INIT               __IA64_UL_CONST(0x0000000000000000)
-
-/*   SH_INT_CMPD_REAL_TIME_CMPD                                         */
-/*   Description:  Real Time Clock Compare                              */
-#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT                        0
-#define SH_INT_CMPD_REAL_TIME_CMPD_MASK        __IA64_UL_CONST(0x007fffffffffffff)
-
-/* ==================================================================== */
-/*                Register "SH_MD_DQLP_MMR_DIR_PRIVEC0"                 */
-/*                      privilege vector for acc=0                      */
-/* ==================================================================== */
-#define SH1_MD_DQLP_MMR_DIR_PRIVEC0    __IA64_UL_CONST(0x0000000100030300)
-
-/* ==================================================================== */
-/*                Register "SH_MD_DQRP_MMR_DIR_PRIVEC0"                 */
-/*                      privilege vector for acc=0                      */
-/* ==================================================================== */
-#define SH1_MD_DQRP_MMR_DIR_PRIVEC0    __IA64_UL_CONST(0x0000000100050300)
-
-/* ==================================================================== */
-/* Some MMRs are functionally identical (or close enough) on both SHUB1 */
-/* and SHUB2 that it makes sense to define a geberic name for the MMR.  */
-/* It is acceptible to use (for example) SH_IPI_INT to reference the    */
-/* the IPI MMR. The value of SH_IPI_INT is determined at runtime based  */
-/* on the type of the SHUB. Do not use these #defines in performance    */
-/* critical code  or loops - there is a small performance penalty.      */
-/* ==================================================================== */
-#define shubmmr(a,b)           (is_shub2() ? a##2_##b : a##1_##b)
-
-#define SH_REAL_JUNK_BUS_LED0  shubmmr(SH, REAL_JUNK_BUS_LED0)
-#define SH_IPI_INT             shubmmr(SH, IPI_INT)
-#define SH_EVENT_OCCURRED      shubmmr(SH, EVENT_OCCURRED)
-#define SH_EVENT_OCCURRED_ALIAS        shubmmr(SH, EVENT_OCCURRED_ALIAS)
-#define SH_RTC                 shubmmr(SH, RTC)
-#define SH_RTC1_INT_CONFIG     shubmmr(SH, RTC1_INT_CONFIG)
-#define SH_RTC1_INT_ENABLE     shubmmr(SH, RTC1_INT_ENABLE)
-#define SH_RTC2_INT_CONFIG     shubmmr(SH, RTC2_INT_CONFIG)
-#define SH_RTC2_INT_ENABLE     shubmmr(SH, RTC2_INT_ENABLE)
-#define SH_RTC3_INT_CONFIG     shubmmr(SH, RTC3_INT_CONFIG)
-#define SH_RTC3_INT_ENABLE     shubmmr(SH, RTC3_INT_ENABLE)
-#define SH_INT_CMPB            shubmmr(SH, INT_CMPB)
-#define SH_INT_CMPC            shubmmr(SH, INT_CMPC)
-#define SH_INT_CMPD            shubmmr(SH, INT_CMPD)
-
-/* ========================================================================== */
-/*                        Register "SH2_BT_ENG_CSR_0"                         */
-/*                    Engine 0 Control and Status Register                    */
-/* ========================================================================== */
-
-#define SH2_BT_ENG_CSR_0               __IA64_UL_CONST(0x0000000030040000)
-#define SH2_BT_ENG_SRC_ADDR_0          __IA64_UL_CONST(0x0000000030040080)
-#define SH2_BT_ENG_DEST_ADDR_0         __IA64_UL_CONST(0x0000000030040100)
-#define SH2_BT_ENG_NOTIF_ADDR_0                __IA64_UL_CONST(0x0000000030040180)
-
-/* ========================================================================== */
-/*                       BTE interfaces 1-3                                   */
-/* ========================================================================== */
-
-#define SH2_BT_ENG_CSR_1               __IA64_UL_CONST(0x0000000030050000)
-#define SH2_BT_ENG_CSR_2               __IA64_UL_CONST(0x0000000030060000)
-#define SH2_BT_ENG_CSR_3               __IA64_UL_CONST(0x0000000030070000)
-
-#endif /* _ASM_IA64_SN_SHUB_MMR_H */
diff --git a/include/asm-ia64/sn/shubio.h b/include/asm-ia64/sn/shubio.h
deleted file mode 100644 (file)
index 22a6f18..0000000
+++ /dev/null
@@ -1,3358 +0,0 @@
-/*
- * 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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_SHUBIO_H
-#define _ASM_IA64_SN_SHUBIO_H
-
-#define HUB_WIDGET_ID_MAX      0xf
-#define IIO_NUM_ITTES          7
-#define HUB_NUM_BIG_WINDOW     (IIO_NUM_ITTES - 1)
-
-#define                IIO_WID                 0x00400000      /* Crosstalk Widget Identification */
-                                                       /* This register is also accessible from
-                                                        * Crosstalk at address 0x0.  */
-#define                IIO_WSTAT               0x00400008      /* Crosstalk Widget Status */
-#define                IIO_WCR                 0x00400020      /* Crosstalk Widget Control Register */
-#define                IIO_ILAPR               0x00400100      /* IO Local Access Protection Register */
-#define                IIO_ILAPO               0x00400108      /* IO Local Access Protection Override */
-#define                IIO_IOWA                0x00400110      /* IO Outbound Widget Access */
-#define                IIO_IIWA                0x00400118      /* IO Inbound Widget Access */
-#define                IIO_IIDEM               0x00400120      /* IO Inbound Device Error Mask */
-#define                IIO_ILCSR               0x00400128      /* IO LLP Control and Status Register */
-#define                IIO_ILLR                0x00400130      /* IO LLP Log Register    */
-#define                IIO_IIDSR               0x00400138      /* IO Interrupt Destination */
-
-#define                IIO_IGFX0               0x00400140      /* IO Graphics Node-Widget Map 0 */
-#define                IIO_IGFX1               0x00400148      /* IO Graphics Node-Widget Map 1 */
-
-#define                IIO_ISCR0               0x00400150      /* IO Scratch Register 0 */
-#define                IIO_ISCR1               0x00400158      /* IO Scratch Register 1 */
-
-#define                IIO_ITTE1               0x00400160      /* IO Translation Table Entry 1 */
-#define                IIO_ITTE2               0x00400168      /* IO Translation Table Entry 2 */
-#define                IIO_ITTE3               0x00400170      /* IO Translation Table Entry 3 */
-#define                IIO_ITTE4               0x00400178      /* IO Translation Table Entry 4 */
-#define                IIO_ITTE5               0x00400180      /* IO Translation Table Entry 5 */
-#define                IIO_ITTE6               0x00400188      /* IO Translation Table Entry 6 */
-#define                IIO_ITTE7               0x00400190      /* IO Translation Table Entry 7 */
-
-#define                IIO_IPRB0               0x00400198      /* IO PRB Entry 0   */
-#define                IIO_IPRB8               0x004001A0      /* IO PRB Entry 8   */
-#define                IIO_IPRB9               0x004001A8      /* IO PRB Entry 9   */
-#define                IIO_IPRBA               0x004001B0      /* IO PRB Entry A   */
-#define                IIO_IPRBB               0x004001B8      /* IO PRB Entry B   */
-#define                IIO_IPRBC               0x004001C0      /* IO PRB Entry C   */
-#define                IIO_IPRBD               0x004001C8      /* IO PRB Entry D   */
-#define                IIO_IPRBE               0x004001D0      /* IO PRB Entry E   */
-#define                IIO_IPRBF               0x004001D8      /* IO PRB Entry F   */
-
-#define                IIO_IXCC                0x004001E0      /* IO Crosstalk Credit Count Timeout */
-#define                IIO_IMEM                0x004001E8      /* IO Miscellaneous Error Mask */
-#define                IIO_IXTT                0x004001F0      /* IO Crosstalk Timeout Threshold */
-#define                IIO_IECLR               0x004001F8      /* IO Error Clear Register */
-#define                IIO_IBCR                0x00400200      /* IO BTE Control Register */
-
-#define                IIO_IXSM                0x00400208      /* IO Crosstalk Spurious Message */
-#define                IIO_IXSS                0x00400210      /* IO Crosstalk Spurious Sideband */
-
-#define                IIO_ILCT                0x00400218      /* IO LLP Channel Test    */
-
-#define                IIO_IIEPH1              0x00400220      /* IO Incoming Error Packet Header, Part 1 */
-#define                IIO_IIEPH2              0x00400228      /* IO Incoming Error Packet Header, Part 2 */
-
-#define                IIO_ISLAPR              0x00400230      /* IO SXB Local Access Protection Regster */
-#define                IIO_ISLAPO              0x00400238      /* IO SXB Local Access Protection Override */
-
-#define                IIO_IWI                 0x00400240      /* IO Wrapper Interrupt Register */
-#define                IIO_IWEL                0x00400248      /* IO Wrapper Error Log Register */
-#define                IIO_IWC                 0x00400250      /* IO Wrapper Control Register */
-#define                IIO_IWS                 0x00400258      /* IO Wrapper Status Register */
-#define                IIO_IWEIM               0x00400260      /* IO Wrapper Error Interrupt Masking Register */
-
-#define                IIO_IPCA                0x00400300      /* IO PRB Counter Adjust */
-
-#define                IIO_IPRTE0_A            0x00400308      /* IO PIO Read Address Table Entry 0, Part A */
-#define                IIO_IPRTE1_A            0x00400310      /* IO PIO Read Address Table Entry 1, Part A */
-#define                IIO_IPRTE2_A            0x00400318      /* IO PIO Read Address Table Entry 2, Part A */
-#define                IIO_IPRTE3_A            0x00400320      /* IO PIO Read Address Table Entry 3, Part A */
-#define                IIO_IPRTE4_A            0x00400328      /* IO PIO Read Address Table Entry 4, Part A */
-#define                IIO_IPRTE5_A            0x00400330      /* IO PIO Read Address Table Entry 5, Part A */
-#define                IIO_IPRTE6_A            0x00400338      /* IO PIO Read Address Table Entry 6, Part A */
-#define                IIO_IPRTE7_A            0x00400340      /* IO PIO Read Address Table Entry 7, Part A */
-
-#define                IIO_IPRTE0_B            0x00400348      /* IO PIO Read Address Table Entry 0, Part B */
-#define                IIO_IPRTE1_B            0x00400350      /* IO PIO Read Address Table Entry 1, Part B */
-#define                IIO_IPRTE2_B            0x00400358      /* IO PIO Read Address Table Entry 2, Part B */
-#define                IIO_IPRTE3_B            0x00400360      /* IO PIO Read Address Table Entry 3, Part B */
-#define                IIO_IPRTE4_B            0x00400368      /* IO PIO Read Address Table Entry 4, Part B */
-#define                IIO_IPRTE5_B            0x00400370      /* IO PIO Read Address Table Entry 5, Part B */
-#define                IIO_IPRTE6_B            0x00400378      /* IO PIO Read Address Table Entry 6, Part B */
-#define                IIO_IPRTE7_B            0x00400380      /* IO PIO Read Address Table Entry 7, Part B */
-
-#define                IIO_IPDR                0x00400388      /* IO PIO Deallocation Register */
-#define                IIO_ICDR                0x00400390      /* IO CRB Entry Deallocation Register */
-#define                IIO_IFDR                0x00400398      /* IO IOQ FIFO Depth Register */
-#define                IIO_IIAP                0x004003A0      /* IO IIQ Arbitration Parameters */
-#define                IIO_ICMR                0x004003A8      /* IO CRB Management Register */
-#define                IIO_ICCR                0x004003B0      /* IO CRB Control Register */
-#define                IIO_ICTO                0x004003B8      /* IO CRB Timeout   */
-#define                IIO_ICTP                0x004003C0      /* IO CRB Timeout Prescalar */
-
-#define                IIO_ICRB0_A             0x00400400      /* IO CRB Entry 0_A */
-#define                IIO_ICRB0_B             0x00400408      /* IO CRB Entry 0_B */
-#define                IIO_ICRB0_C             0x00400410      /* IO CRB Entry 0_C */
-#define                IIO_ICRB0_D             0x00400418      /* IO CRB Entry 0_D */
-#define                IIO_ICRB0_E             0x00400420      /* IO CRB Entry 0_E */
-
-#define                IIO_ICRB1_A             0x00400430      /* IO CRB Entry 1_A */
-#define                IIO_ICRB1_B             0x00400438      /* IO CRB Entry 1_B */
-#define                IIO_ICRB1_C             0x00400440      /* IO CRB Entry 1_C */
-#define                IIO_ICRB1_D             0x00400448      /* IO CRB Entry 1_D */
-#define                IIO_ICRB1_E             0x00400450      /* IO CRB Entry 1_E */
-
-#define                IIO_ICRB2_A             0x00400460      /* IO CRB Entry 2_A */
-#define                IIO_ICRB2_B             0x00400468      /* IO CRB Entry 2_B */
-#define                IIO_ICRB2_C             0x00400470      /* IO CRB Entry 2_C */
-#define                IIO_ICRB2_D             0x00400478      /* IO CRB Entry 2_D */
-#define                IIO_ICRB2_E             0x00400480      /* IO CRB Entry 2_E */
-
-#define                IIO_ICRB3_A             0x00400490      /* IO CRB Entry 3_A */
-#define                IIO_ICRB3_B             0x00400498      /* IO CRB Entry 3_B */
-#define                IIO_ICRB3_C             0x004004a0      /* IO CRB Entry 3_C */
-#define                IIO_ICRB3_D             0x004004a8      /* IO CRB Entry 3_D */
-#define                IIO_ICRB3_E             0x004004b0      /* IO CRB Entry 3_E */
-
-#define                IIO_ICRB4_A             0x004004c0      /* IO CRB Entry 4_A */
-#define                IIO_ICRB4_B             0x004004c8      /* IO CRB Entry 4_B */
-#define                IIO_ICRB4_C             0x004004d0      /* IO CRB Entry 4_C */
-#define                IIO_ICRB4_D             0x004004d8      /* IO CRB Entry 4_D */
-#define                IIO_ICRB4_E             0x004004e0      /* IO CRB Entry 4_E */
-
-#define                IIO_ICRB5_A             0x004004f0      /* IO CRB Entry 5_A */
-#define                IIO_ICRB5_B             0x004004f8      /* IO CRB Entry 5_B */
-#define                IIO_ICRB5_C             0x00400500      /* IO CRB Entry 5_C */
-#define                IIO_ICRB5_D             0x00400508      /* IO CRB Entry 5_D */
-#define                IIO_ICRB5_E             0x00400510      /* IO CRB Entry 5_E */
-
-#define                IIO_ICRB6_A             0x00400520      /* IO CRB Entry 6_A */
-#define                IIO_ICRB6_B             0x00400528      /* IO CRB Entry 6_B */
-#define                IIO_ICRB6_C             0x00400530      /* IO CRB Entry 6_C */
-#define                IIO_ICRB6_D             0x00400538      /* IO CRB Entry 6_D */
-#define                IIO_ICRB6_E             0x00400540      /* IO CRB Entry 6_E */
-
-#define                IIO_ICRB7_A             0x00400550      /* IO CRB Entry 7_A */
-#define                IIO_ICRB7_B             0x00400558      /* IO CRB Entry 7_B */
-#define                IIO_ICRB7_C             0x00400560      /* IO CRB Entry 7_C */
-#define                IIO_ICRB7_D             0x00400568      /* IO CRB Entry 7_D */
-#define                IIO_ICRB7_E             0x00400570      /* IO CRB Entry 7_E */
-
-#define                IIO_ICRB8_A             0x00400580      /* IO CRB Entry 8_A */
-#define                IIO_ICRB8_B             0x00400588      /* IO CRB Entry 8_B */
-#define                IIO_ICRB8_C             0x00400590      /* IO CRB Entry 8_C */
-#define                IIO_ICRB8_D             0x00400598      /* IO CRB Entry 8_D */
-#define                IIO_ICRB8_E             0x004005a0      /* IO CRB Entry 8_E */
-
-#define                IIO_ICRB9_A             0x004005b0      /* IO CRB Entry 9_A */
-#define                IIO_ICRB9_B             0x004005b8      /* IO CRB Entry 9_B */
-#define                IIO_ICRB9_C             0x004005c0      /* IO CRB Entry 9_C */
-#define                IIO_ICRB9_D             0x004005c8      /* IO CRB Entry 9_D */
-#define                IIO_ICRB9_E             0x004005d0      /* IO CRB Entry 9_E */
-
-#define                IIO_ICRBA_A             0x004005e0      /* IO CRB Entry A_A */
-#define                IIO_ICRBA_B             0x004005e8      /* IO CRB Entry A_B */
-#define                IIO_ICRBA_C             0x004005f0      /* IO CRB Entry A_C */
-#define                IIO_ICRBA_D             0x004005f8      /* IO CRB Entry A_D */
-#define                IIO_ICRBA_E             0x00400600      /* IO CRB Entry A_E */
-
-#define                IIO_ICRBB_A             0x00400610      /* IO CRB Entry B_A */
-#define                IIO_ICRBB_B             0x00400618      /* IO CRB Entry B_B */
-#define                IIO_ICRBB_C             0x00400620      /* IO CRB Entry B_C */
-#define                IIO_ICRBB_D             0x00400628      /* IO CRB Entry B_D */
-#define                IIO_ICRBB_E             0x00400630      /* IO CRB Entry B_E */
-
-#define                IIO_ICRBC_A             0x00400640      /* IO CRB Entry C_A */
-#define                IIO_ICRBC_B             0x00400648      /* IO CRB Entry C_B */
-#define                IIO_ICRBC_C             0x00400650      /* IO CRB Entry C_C */
-#define                IIO_ICRBC_D             0x00400658      /* IO CRB Entry C_D */
-#define                IIO_ICRBC_E             0x00400660      /* IO CRB Entry C_E */
-
-#define                IIO_ICRBD_A             0x00400670      /* IO CRB Entry D_A */
-#define                IIO_ICRBD_B             0x00400678      /* IO CRB Entry D_B */
-#define                IIO_ICRBD_C             0x00400680      /* IO CRB Entry D_C */
-#define                IIO_ICRBD_D             0x00400688      /* IO CRB Entry D_D */
-#define                IIO_ICRBD_E             0x00400690      /* IO CRB Entry D_E */
-
-#define                IIO_ICRBE_A             0x004006a0      /* IO CRB Entry E_A */
-#define                IIO_ICRBE_B             0x004006a8      /* IO CRB Entry E_B */
-#define                IIO_ICRBE_C             0x004006b0      /* IO CRB Entry E_C */
-#define                IIO_ICRBE_D             0x004006b8      /* IO CRB Entry E_D */
-#define                IIO_ICRBE_E             0x004006c0      /* IO CRB Entry E_E */
-
-#define                IIO_ICSML               0x00400700      /* IO CRB Spurious Message Low */
-#define                IIO_ICSMM               0x00400708      /* IO CRB Spurious Message Middle */
-#define                IIO_ICSMH               0x00400710      /* IO CRB Spurious Message High */
-
-#define                IIO_IDBSS               0x00400718      /* IO Debug Submenu Select */
-
-#define                IIO_IBLS0               0x00410000      /* IO BTE Length Status 0 */
-#define                IIO_IBSA0               0x00410008      /* IO BTE Source Address 0 */
-#define                IIO_IBDA0               0x00410010      /* IO BTE Destination Address 0 */
-#define                IIO_IBCT0               0x00410018      /* IO BTE Control Terminate 0 */
-#define                IIO_IBNA0               0x00410020      /* IO BTE Notification Address 0 */
-#define                IIO_IBIA0               0x00410028      /* IO BTE Interrupt Address 0 */
-#define                IIO_IBLS1               0x00420000      /* IO BTE Length Status 1 */
-#define                IIO_IBSA1               0x00420008      /* IO BTE Source Address 1 */
-#define                IIO_IBDA1               0x00420010      /* IO BTE Destination Address 1 */
-#define                IIO_IBCT1               0x00420018      /* IO BTE Control Terminate 1 */
-#define                IIO_IBNA1               0x00420020      /* IO BTE Notification Address 1 */
-#define                IIO_IBIA1               0x00420028      /* IO BTE Interrupt Address 1 */
-
-#define                IIO_IPCR                0x00430000      /* IO Performance Control */
-#define                IIO_IPPR                0x00430008      /* IO Performance Profiling */
-
-/************************************************************************
- *                                                                     *
- * Description:  This register echoes some information from the         *
- * LB_REV_ID register. It is available through Crosstalk as described   *
- * above. The REV_NUM and MFG_NUM fields receive their values from      *
- * the REVISION and MANUFACTURER fields in the LB_REV_ID register.      *
- * The PART_NUM field's value is the Crosstalk device ID number that    *
- * Steve Miller assigned to the SHub chip.                              *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_wid_u {
-       u64 ii_wid_regval;
-       struct {
-               u64 w_rsvd_1:1;
-               u64 w_mfg_num:11;
-               u64 w_part_num:16;
-               u64 w_rev_num:4;
-               u64 w_rsvd:32;
-       } ii_wid_fld_s;
-} ii_wid_u_t;
-
-/************************************************************************
- *                                                                     *
- *  The fields in this register are set upon detection of an error      *
- * and cleared by various mechanisms, as explained in the               *
- * description.                                                         *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_wstat_u {
-       u64 ii_wstat_regval;
-       struct {
-               u64 w_pending:4;
-               u64 w_xt_crd_to:1;
-               u64 w_xt_tail_to:1;
-               u64 w_rsvd_3:3;
-               u64 w_tx_mx_rty:1;
-               u64 w_rsvd_2:6;
-               u64 w_llp_tx_cnt:8;
-               u64 w_rsvd_1:8;
-               u64 w_crazy:1;
-               u64 w_rsvd:31;
-       } ii_wstat_fld_s;
-} ii_wstat_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This is a read-write enabled register. It controls     *
- * various aspects of the Crosstalk flow control.                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_wcr_u {
-       u64 ii_wcr_regval;
-       struct {
-               u64 w_wid:4;
-               u64 w_tag:1;
-               u64 w_rsvd_1:8;
-               u64 w_dst_crd:3;
-               u64 w_f_bad_pkt:1;
-               u64 w_dir_con:1;
-               u64 w_e_thresh:5;
-               u64 w_rsvd:41;
-       } ii_wcr_fld_s;
-} ii_wcr_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register's value is a bit vector that guards      *
- * access to local registers within the II as well as to external       *
- * Crosstalk widgets. Each bit in the register corresponds to a         *
- * particular region in the system; a region consists of one, two or    *
- * four nodes (depending on the value of the REGION_SIZE field in the   *
- * LB_REV_ID register, which is documented in Section 8.3.1.1). The     *
- * protection provided by this register applies to PIO read             *
- * operations as well as PIO write operations. The II will perform a    *
- * PIO read or write request only if the bit for the requestor's        *
- * region is set; otherwise, the II will not perform the requested      *
- * operation and will return an error response. When a PIO read or      *
- * write request targets an external Crosstalk widget, then not only    *
- * must the bit for the requestor's region be set in the ILAPR, but     *
- * also the target widget's bit in the IOWA register must be set in     *
- * order for the II to perform the requested operation; otherwise,      *
- * the II will return an error response. Hence, the protection          *
- * provided by the IOWA register supplements the protection provided    *
- * by the ILAPR for requests that target external Crosstalk widgets.    *
- * This register itself can be accessed only by the nodes whose         *
- * region ID bits are enabled in this same register. It can also be     *
- * accessed through the IAlias space by the local processors.           *
- * The reset value of this register allows access by all nodes.         *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ilapr_u {
-       u64 ii_ilapr_regval;
-       struct {
-               u64 i_region:64;
-       } ii_ilapr_fld_s;
-} ii_ilapr_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  A write to this register of the 64-bit value           *
- * "SGIrules" in ASCII, will cause the bit in the ILAPR register        *
- * corresponding to the region of the requestor to be set (allow        *
- * access). A write of any other value will be ignored. Access          *
- * protection for this register is "SGIrules".                          *
- * This register can also be accessed through the IAlias space.         *
- * However, this access will not change the access permissions in the   *
- * ILAPR.                                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ilapo_u {
-       u64 ii_ilapo_regval;
-       struct {
-               u64 i_io_ovrride:64;
-       } ii_ilapo_fld_s;
-} ii_ilapo_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register qualifies all the PIO and Graphics writes launched    *
- * from the SHUB towards a widget.                                      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iowa_u {
-       u64 ii_iowa_regval;
-       struct {
-               u64 i_w0_oac:1;
-               u64 i_rsvd_1:7;
-               u64 i_wx_oac:8;
-               u64 i_rsvd:48;
-       } ii_iowa_fld_s;
-} ii_iowa_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register qualifies all the requests launched      *
- * from a widget towards the Shub. This register is intended to be      *
- * used by software in case of misbehaving widgets.                     *
- *                                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iiwa_u {
-       u64 ii_iiwa_regval;
-       struct {
-               u64 i_w0_iac:1;
-               u64 i_rsvd_1:7;
-               u64 i_wx_iac:8;
-               u64 i_rsvd:48;
-       } ii_iiwa_fld_s;
-} ii_iiwa_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register qualifies all the operations launched    *
- * from a widget towards the SHub. It allows individual access          *
- * control for up to 8 devices per widget. A device refers to           *
- * individual DMA master hosted by a widget.                            *
- * The bits in each field of this register are cleared by the Shub      *
- * upon detection of an error which requires the device to be           *
- * disabled. These fields assume that 0=TNUM=7 (i.e., Bridge-centric    *
- * Crosstalk). Whether or not a device has access rights to this        *
- * Shub is determined by an AND of the device enable bit in the         *
- * appropriate field of this register and the corresponding bit in      *
- * the Wx_IAC field (for the widget which this device belongs to).      *
- * The bits in this field are set by writing a 1 to them. Incoming      *
- * replies from Crosstalk are not subject to this access control        *
- * mechanism.                                                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iidem_u {
-       u64 ii_iidem_regval;
-       struct {
-               u64 i_w8_dxs:8;
-               u64 i_w9_dxs:8;
-               u64 i_wa_dxs:8;
-               u64 i_wb_dxs:8;
-               u64 i_wc_dxs:8;
-               u64 i_wd_dxs:8;
-               u64 i_we_dxs:8;
-               u64 i_wf_dxs:8;
-       } ii_iidem_fld_s;
-} ii_iidem_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the various programmable fields necessary    *
- * for controlling and observing the LLP signals.                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ilcsr_u {
-       u64 ii_ilcsr_regval;
-       struct {
-               u64 i_nullto:6;
-               u64 i_rsvd_4:2;
-               u64 i_wrmrst:1;
-               u64 i_rsvd_3:1;
-               u64 i_llp_en:1;
-               u64 i_bm8:1;
-               u64 i_llp_stat:2;
-               u64 i_remote_power:1;
-               u64 i_rsvd_2:1;
-               u64 i_maxrtry:10;
-               u64 i_d_avail_sel:2;
-               u64 i_rsvd_1:4;
-               u64 i_maxbrst:10;
-               u64 i_rsvd:22;
-
-       } ii_ilcsr_fld_s;
-} ii_ilcsr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This is simply a status registers that monitors the LLP error       *
- * rate.                                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_illr_u {
-       u64 ii_illr_regval;
-       struct {
-               u64 i_sn_cnt:16;
-               u64 i_cb_cnt:16;
-               u64 i_rsvd:32;
-       } ii_illr_fld_s;
-} ii_illr_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  All II-detected non-BTE error interrupts are           *
- * specified via this register.                                         *
- * NOTE: The PI interrupt register address is hardcoded in the II. If   *
- * PI_ID==0, then the II sends an interrupt request (Duplonet PWRI      *
- * packet) to address offset 0x0180_0090 within the local register      *
- * address space of PI0 on the node specified by the NODE field. If     *
- * PI_ID==1, then the II sends the interrupt request to address         *
- * offset 0x01A0_0090 within the local register address space of PI1    *
- * on the node specified by the NODE field.                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iidsr_u {
-       u64 ii_iidsr_regval;
-       struct {
-               u64 i_level:8;
-               u64 i_pi_id:1;
-               u64 i_node:11;
-               u64 i_rsvd_3:4;
-               u64 i_enable:1;
-               u64 i_rsvd_2:3;
-               u64 i_int_sent:2;
-               u64 i_rsvd_1:2;
-               u64 i_pi0_forward_int:1;
-               u64 i_pi1_forward_int:1;
-               u64 i_rsvd:30;
-       } ii_iidsr_fld_s;
-} ii_iidsr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are two instances of this register. This register is used     *
- * for matching up the incoming responses from the graphics widget to   *
- * the processor that initiated the graphics operation. The             *
- * write-responses are converted to graphics credits and returned to    *
- * the processor so that the processor interface can manage the flow    *
- * control.                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_igfx0_u {
-       u64 ii_igfx0_regval;
-       struct {
-               u64 i_w_num:4;
-               u64 i_pi_id:1;
-               u64 i_n_num:12;
-               u64 i_p_num:1;
-               u64 i_rsvd:46;
-       } ii_igfx0_fld_s;
-} ii_igfx0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are two instances of this register. This register is used     *
- * for matching up the incoming responses from the graphics widget to   *
- * the processor that initiated the graphics operation. The             *
- * write-responses are converted to graphics credits and returned to    *
- * the processor so that the processor interface can manage the flow    *
- * control.                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_igfx1_u {
-       u64 ii_igfx1_regval;
-       struct {
-               u64 i_w_num:4;
-               u64 i_pi_id:1;
-               u64 i_n_num:12;
-               u64 i_p_num:1;
-               u64 i_rsvd:46;
-       } ii_igfx1_fld_s;
-} ii_igfx1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are two instances of this registers. These registers are      *
- * used as scratch registers for software use.                          *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iscr0_u {
-       u64 ii_iscr0_regval;
-       struct {
-               u64 i_scratch:64;
-       } ii_iscr0_fld_s;
-} ii_iscr0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are two instances of this registers. These registers are      *
- * used as scratch registers for software use.                          *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iscr1_u {
-       u64 ii_iscr1_regval;
-       struct {
-               u64 i_scratch:64;
-       } ii_iscr1_fld_s;
-} ii_iscr1_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a Shub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the SHub is thus the lower 16 GBytes per widget       * 
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the Shub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte1_u {
-       u64 ii_itte1_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte1_fld_s;
-} ii_itte1_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a Shub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the Shub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the Shub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte2_u {
-       u64 ii_itte2_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte2_fld_s;
-} ii_itte2_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a Shub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the Shub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the SHub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte3_u {
-       u64 ii_itte3_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte3_fld_s;
-} ii_itte3_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a SHub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the SHub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the SHub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte4_u {
-       u64 ii_itte4_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte4_fld_s;
-} ii_itte4_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a SHub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the Shub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the Shub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte5_u {
-       u64 ii_itte5_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte5_fld_s;
-} ii_itte5_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a Shub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the Shub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the Shub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte6_u {
-       u64 ii_itte6_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte6_fld_s;
-} ii_itte6_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are seven instances of translation table entry   *
- * registers. Each register maps a Shub Big Window to a 48-bit          *
- * address on Crosstalk.                                                *
- * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window      *
- * number) are used to select one of these 7 registers. The Widget      *
- * number field is then derived from the W_NUM field for synthesizing   *
- * a Crosstalk packet. The 5 bits of OFFSET are concatenated with       *
- * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34]      *
- * are padded with zeros. Although the maximum Crosstalk space          *
- * addressable by the Shub is thus the lower 16 GBytes per widget       *
- * (M-mode), however only <SUP >7</SUP>/<SUB >32nds</SUB> of this       *
- * space can be accessed.                                               *
- * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big         *
- * Window number) are used to select one of these 7 registers. The      *
- * Widget number field is then derived from the W_NUM field for         *
- * synthesizing a Crosstalk packet. The 5 bits of OFFSET are            *
- * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP      *
- * field is used as Crosstalk[47], and remainder of the Crosstalk       *
- * address bits (Crosstalk[46:34]) are always zero. While the maximum   *
- * Crosstalk space addressable by the SHub is thus the lower            *
- * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB>   *
- * of this space can be accessed.                                       *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_itte7_u {
-       u64 ii_itte7_regval;
-       struct {
-               u64 i_offset:5;
-               u64 i_rsvd_1:3;
-               u64 i_w_num:4;
-               u64 i_iosp:1;
-               u64 i_rsvd:51;
-       } ii_itte7_fld_s;
-} ii_itte7_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprb0_u {
-       u64 ii_iprb0_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprb0_fld_s;
-} ii_iprb0_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprb8_u {
-       u64 ii_iprb8_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprb8_fld_s;
-} ii_iprb8_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprb9_u {
-       u64 ii_iprb9_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprb9_fld_s;
-} ii_iprb9_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.        *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- *                                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprba_u {
-       u64 ii_iprba_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprba_fld_s;
-} ii_iprba_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprbb_u {
-       u64 ii_iprbb_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprbb_fld_s;
-} ii_iprbb_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprbc_u {
-       u64 ii_iprbc_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprbc_fld_s;
-} ii_iprbc_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprbd_u {
-       u64 ii_iprbd_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprbd_fld_s;
-} ii_iprbd_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of SHub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprbe_u {
-       u64 ii_iprbe_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprbe_fld_s;
-} ii_iprbe_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 9 instances of this register, one per        *
- * actual widget in this implementation of Shub and Crossbow.           *
- * Note: Crossbow only has ports for Widgets 8 through F, widget 0      *
- * refers to Crossbow's internal space.                                 *
- * This register contains the state elements per widget that are        *
- * necessary to manage the PIO flow control on Crosstalk and on the     *
- * Router Network. See the PIO Flow Control chapter for a complete      *
- * description of this register                                         *
- * The SPUR_WR bit requires some explanation. When this register is     *
- * written, the new value of the C field is captured in an internal     *
- * register so the hardware can remember what the programmer wrote      *
- * into the credit counter. The SPUR_WR bit sets whenever the C field   *
- * increments above this stored value, which indicates that there       *
- * have been more responses received than requests sent. The SPUR_WR    *
- * bit cannot be cleared until a value is written to the IPRBx          *
- * register; the write will correct the C field and capture its new     *
- * value in the internal register. Even if IECLR[E_PRB_x] is set, the   *
- * SPUR_WR bit will persist if IPRBx hasn't yet been written.           *
- * .                                                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprbf_u {
-       u64 ii_iprbf_regval;
-       struct {
-               u64 i_c:8;
-               u64 i_na:14;
-               u64 i_rsvd_2:2;
-               u64 i_nb:14;
-               u64 i_rsvd_1:2;
-               u64 i_m:2;
-               u64 i_f:1;
-               u64 i_of_cnt:5;
-               u64 i_error:1;
-               u64 i_rd_to:1;
-               u64 i_spur_wr:1;
-               u64 i_spur_rd:1;
-               u64 i_rsvd:11;
-               u64 i_mult_err:1;
-       } ii_iprbe_fld_s;
-} ii_iprbf_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register specifies the timeout value to use for monitoring     *
- * Crosstalk credits which are used outbound to Crosstalk. An           *
- * internal counter called the Crosstalk Credit Timeout Counter         *
- * increments every 128 II clocks. The counter starts counting          *
- * anytime the credit count drops below a threshold, and resets to      *
- * zero (stops counting) anytime the credit count is at or above the    *
- * threshold. The threshold is 1 credit in direct connect mode and 2    *
- * in Crossbow connect mode. When the internal Crosstalk Credit         *
- * Timeout Counter reaches the value programmed in this register, a     *
- * Crosstalk Credit Timeout has occurred. The internal counter is not   *
- * readable from software, and stops counting at its maximum value,     *
- * so it cannot cause more than one interrupt.                          *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ixcc_u {
-       u64 ii_ixcc_regval;
-       struct {
-               u64 i_time_out:26;
-               u64 i_rsvd:38;
-       } ii_ixcc_fld_s;
-} ii_ixcc_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register qualifies all the PIO and DMA            *
- * operations launched from widget 0 towards the SHub. In               *
- * addition, it also qualifies accesses by the BTE streams.             *
- * The bits in each field of this register are cleared by the SHub      *
- * upon detection of an error which requires widget 0 or the BTE        *
- * streams to be terminated. Whether or not widget x has access         *
- * rights to this SHub is determined by an AND of the device            *
- * enable bit in the appropriate field of this register and bit 0 in    *
- * the Wx_IAC field. The bits in this field are set by writing a 1 to   *
- * them. Incoming replies from Crosstalk are not subject to this        *
- * access control mechanism.                                            *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_imem_u {
-       u64 ii_imem_regval;
-       struct {
-               u64 i_w0_esd:1;
-               u64 i_rsvd_3:3;
-               u64 i_b0_esd:1;
-               u64 i_rsvd_2:3;
-               u64 i_b1_esd:1;
-               u64 i_rsvd_1:3;
-               u64 i_clr_precise:1;
-               u64 i_rsvd:51;
-       } ii_imem_fld_s;
-} ii_imem_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register specifies the timeout value to use for   *
- * monitoring Crosstalk tail flits coming into the Shub in the          *
- * TAIL_TO field. An internal counter associated with this register     *
- * is incremented every 128 II internal clocks (7 bits). The counter    *
- * starts counting anytime a header micropacket is received and stops   *
- * counting (and resets to zero) any time a micropacket with a Tail     *
- * bit is received. Once the counter reaches the threshold value        *
- * programmed in this register, it generates an interrupt to the        *
- * processor that is programmed into the IIDSR. The counter saturates   *
- * (does not roll over) at its maximum value, so it cannot cause        *
- * another interrupt until after it is cleared.                         *
- * The register also contains the Read Response Timeout values. The     *
- * Prescalar is 23 bits, and counts II clocks. An internal counter      *
- * increments on every II clock and when it reaches the value in the    *
- * Prescalar field, all IPRTE registers with their valid bits set       *
- * have their Read Response timers bumped. Whenever any of them match   *
- * the value in the RRSP_TO field, a Read Response Timeout has          *
- * occurred, and error handling occurs as described in the Error        *
- * Handling section of this document.                                   *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ixtt_u {
-       u64 ii_ixtt_regval;
-       struct {
-               u64 i_tail_to:26;
-               u64 i_rsvd_1:6;
-               u64 i_rrsp_ps:23;
-               u64 i_rrsp_to:5;
-               u64 i_rsvd:4;
-       } ii_ixtt_fld_s;
-} ii_ixtt_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Writing a 1 to the fields of this register clears the appropriate   *
- * error bits in other areas of SHub. Note that when the                *
- * E_PRB_x bits are used to clear error bits in PRB registers,          *
- * SPUR_RD and SPUR_WR may persist, because they require additional     *
- * action to clear them. See the IPRBx and IXSS Register                *
- * specifications.                                                      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ieclr_u {
-       u64 ii_ieclr_regval;
-       struct {
-               u64 i_e_prb_0:1;
-               u64 i_rsvd:7;
-               u64 i_e_prb_8:1;
-               u64 i_e_prb_9:1;
-               u64 i_e_prb_a:1;
-               u64 i_e_prb_b:1;
-               u64 i_e_prb_c:1;
-               u64 i_e_prb_d:1;
-               u64 i_e_prb_e:1;
-               u64 i_e_prb_f:1;
-               u64 i_e_crazy:1;
-               u64 i_e_bte_0:1;
-               u64 i_e_bte_1:1;
-               u64 i_reserved_1:10;
-               u64 i_spur_rd_hdr:1;
-               u64 i_cam_intr_to:1;
-               u64 i_cam_overflow:1;
-               u64 i_cam_read_miss:1;
-               u64 i_ioq_rep_underflow:1;
-               u64 i_ioq_req_underflow:1;
-               u64 i_ioq_rep_overflow:1;
-               u64 i_ioq_req_overflow:1;
-               u64 i_iiq_rep_overflow:1;
-               u64 i_iiq_req_overflow:1;
-               u64 i_ii_xn_rep_cred_overflow:1;
-               u64 i_ii_xn_req_cred_overflow:1;
-               u64 i_ii_xn_invalid_cmd:1;
-               u64 i_xn_ii_invalid_cmd:1;
-               u64 i_reserved_2:21;
-       } ii_ieclr_fld_s;
-} ii_ieclr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register controls both BTEs. SOFT_RESET is intended for        *
- * recovery after an error. COUNT controls the total number of CRBs     *
- * that both BTEs (combined) can use, which affects total BTE           *
- * bandwidth.                                                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibcr_u {
-       u64 ii_ibcr_regval;
-       struct {
-               u64 i_count:4;
-               u64 i_rsvd_1:4;
-               u64 i_soft_reset:1;
-               u64 i_rsvd:55;
-       } ii_ibcr_fld_s;
-} ii_ibcr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the header of a spurious read response       *
- * received from Crosstalk. A spurious read response is defined as a    *
- * read response received by II from a widget for which (1) the SIDN    *
- * has a value between 1 and 7, inclusive (II never sends requests to   *
- * these widgets (2) there is no valid IPRTE register which             *
- * corresponds to the TNUM, or (3) the widget indicated in SIDN is      *
- * not the same as the widget recorded in the IPRTE register            *
- * referenced by the TNUM. If this condition is true, and if the        *
- * IXSS[VALID] bit is clear, then the header of the spurious read       *
- * response is capture in IXSM and IXSS, and IXSS[VALID] is set. The    *
- * errant header is thereby captured, and no further spurious read      *
- * respones are captured until IXSS[VALID] is cleared by setting the    *
- * appropriate bit in IECLR.Everytime a spurious read response is       *
- * detected, the SPUR_RD bit of the PRB corresponding to the incoming   *
- * message's SIDN field is set. This always happens, regarless of       *
- * whether a header is captured. The programmer should check            *
- * IXSM[SIDN] to determine which widget sent the spurious response,     *
- * because there may be more than one SPUR_RD bit set in the PRB        *
- * registers. The widget indicated by IXSM[SIDN] was the first          *
- * spurious read response to be received since the last time            *
- * IXSS[VALID] was clear. The SPUR_RD bit of the corresponding PRB      *
- * will be set. Any SPUR_RD bits in any other PRB registers indicate    *
- * spurious messages from other widets which were detected after the    *
- * header was captured..                                                *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ixsm_u {
-       u64 ii_ixsm_regval;
-       struct {
-               u64 i_byte_en:32;
-               u64 i_reserved:1;
-               u64 i_tag:3;
-               u64 i_alt_pactyp:4;
-               u64 i_bo:1;
-               u64 i_error:1;
-               u64 i_vbpm:1;
-               u64 i_gbr:1;
-               u64 i_ds:2;
-               u64 i_ct:1;
-               u64 i_tnum:5;
-               u64 i_pactyp:4;
-               u64 i_sidn:4;
-               u64 i_didn:4;
-       } ii_ixsm_fld_s;
-} ii_ixsm_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the sideband bits of a spurious read         *
- * response received from Crosstalk.                                    *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ixss_u {
-       u64 ii_ixss_regval;
-       struct {
-               u64 i_sideband:8;
-               u64 i_rsvd:55;
-               u64 i_valid:1;
-       } ii_ixss_fld_s;
-} ii_ixss_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register enables software to access the II LLP's test port.    *
- * Refer to the LLP 2.5 documentation for an explanation of the test    *
- * port. Software can write to this register to program the values      *
- * for the control fields (TestErrCapture, TestClear, TestFlit,         *
- * TestMask and TestSeed). Similarly, software can read from this       *
- * register to obtain the values of the test port's status outputs      *
- * (TestCBerr, TestValid and TestData).                                 *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ilct_u {
-       u64 ii_ilct_regval;
-       struct {
-               u64 i_test_seed:20;
-               u64 i_test_mask:8;
-               u64 i_test_data:20;
-               u64 i_test_valid:1;
-               u64 i_test_cberr:1;
-               u64 i_test_flit:3;
-               u64 i_test_clear:1;
-               u64 i_test_err_capture:1;
-               u64 i_rsvd:9;
-       } ii_ilct_fld_s;
-} ii_ilct_u_t;
-
-/************************************************************************
- *                                                                     *
- *  If the II detects an illegal incoming Duplonet packet (request or   *
- * reply) when VALID==0 in the IIEPH1 register, then it saves the       *
- * contents of the packet's header flit in the IIEPH1 and IIEPH2        *
- * registers, sets the VALID bit in IIEPH1, clears the OVERRUN bit,     *
- * and assigns a value to the ERR_TYPE field which indicates the        *
- * specific nature of the error. The II recognizes four different       *
- * types of errors: short request packets (ERR_TYPE==2), short reply    *
- * packets (ERR_TYPE==3), long request packets (ERR_TYPE==4) and long   *
- * reply packets (ERR_TYPE==5). The encodings for these types of        *
- * errors were chosen to be consistent with the same types of errors    *
- * indicated by the ERR_TYPE field in the LB_ERROR_HDR1 register (in    *
- * the LB unit). If the II detects an illegal incoming Duplonet         *
- * packet when VALID==1 in the IIEPH1 register, then it merely sets     *
- * the OVERRUN bit to indicate that a subsequent error has happened,    *
- * and does nothing further.                                            *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iieph1_u {
-       u64 ii_iieph1_regval;
-       struct {
-               u64 i_command:7;
-               u64 i_rsvd_5:1;
-               u64 i_suppl:14;
-               u64 i_rsvd_4:1;
-               u64 i_source:14;
-               u64 i_rsvd_3:1;
-               u64 i_err_type:4;
-               u64 i_rsvd_2:4;
-               u64 i_overrun:1;
-               u64 i_rsvd_1:3;
-               u64 i_valid:1;
-               u64 i_rsvd:13;
-       } ii_iieph1_fld_s;
-} ii_iieph1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register holds the Address field from the header flit of an    *
- * incoming erroneous Duplonet packet, along with the tail bit which    *
- * accompanied this header flit. This register is essentially an        *
- * extension of IIEPH1. Two registers were necessary because the 64     *
- * bits available in only a single register were insufficient to        *
- * capture the entire header flit of an erroneous packet.               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iieph2_u {
-       u64 ii_iieph2_regval;
-       struct {
-               u64 i_rsvd_0:3;
-               u64 i_address:47;
-               u64 i_rsvd_1:10;
-               u64 i_tail:1;
-               u64 i_rsvd:3;
-       } ii_iieph2_fld_s;
-} ii_iieph2_u_t;
-
-/******************************/
-
-/************************************************************************
- *                                                                     *
- *  This register's value is a bit vector that guards access from SXBs  *
- * to local registers within the II as well as to external Crosstalk    *
- * widgets                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_islapr_u {
-       u64 ii_islapr_regval;
-       struct {
-               u64 i_region:64;
-       } ii_islapr_fld_s;
-} ii_islapr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  A write to this register of the 56-bit value "Pup+Bun" will cause  *
- * the bit in the ISLAPR register corresponding to the region of the   *
- * requestor to be set (access allowed).                               (
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_islapo_u {
-       u64 ii_islapo_regval;
-       struct {
-               u64 i_io_sbx_ovrride:56;
-               u64 i_rsvd:8;
-       } ii_islapo_fld_s;
-} ii_islapo_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Determines how long the wrapper will wait aftr an interrupt is     *
- * initially issued from the II before it times out the outstanding    *
- * interrupt and drops it from the interrupt queue.                    * 
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iwi_u {
-       u64 ii_iwi_regval;
-       struct {
-               u64 i_prescale:24;
-               u64 i_rsvd:8;
-               u64 i_timeout:8;
-               u64 i_rsvd1:8;
-               u64 i_intrpt_retry_period:8;
-               u64 i_rsvd2:8;
-       } ii_iwi_fld_s;
-} ii_iwi_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Log errors which have occurred in the II wrapper. The errors are   *
- * cleared by writing to the IECLR register.                           * 
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iwel_u {
-       u64 ii_iwel_regval;
-       struct {
-               u64 i_intr_timed_out:1;
-               u64 i_rsvd:7;
-               u64 i_cam_overflow:1;
-               u64 i_cam_read_miss:1;
-               u64 i_rsvd1:2;
-               u64 i_ioq_rep_underflow:1;
-               u64 i_ioq_req_underflow:1;
-               u64 i_ioq_rep_overflow:1;
-               u64 i_ioq_req_overflow:1;
-               u64 i_iiq_rep_overflow:1;
-               u64 i_iiq_req_overflow:1;
-               u64 i_rsvd2:6;
-               u64 i_ii_xn_rep_cred_over_under:1;
-               u64 i_ii_xn_req_cred_over_under:1;
-               u64 i_rsvd3:6;
-               u64 i_ii_xn_invalid_cmd:1;
-               u64 i_xn_ii_invalid_cmd:1;
-               u64 i_rsvd4:30;
-       } ii_iwel_fld_s;
-} ii_iwel_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Controls the II wrapper.                                           * 
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iwc_u {
-       u64 ii_iwc_regval;
-       struct {
-               u64 i_dma_byte_swap:1;
-               u64 i_rsvd:3;
-               u64 i_cam_read_lines_reset:1;
-               u64 i_rsvd1:3;
-               u64 i_ii_xn_cred_over_under_log:1;
-               u64 i_rsvd2:19;
-               u64 i_xn_rep_iq_depth:5;
-               u64 i_rsvd3:3;
-               u64 i_xn_req_iq_depth:5;
-               u64 i_rsvd4:3;
-               u64 i_iiq_depth:6;
-               u64 i_rsvd5:12;
-               u64 i_force_rep_cred:1;
-               u64 i_force_req_cred:1;
-       } ii_iwc_fld_s;
-} ii_iwc_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Status in the II wrapper.                                          * 
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iws_u {
-       u64 ii_iws_regval;
-       struct {
-               u64 i_xn_rep_iq_credits:5;
-               u64 i_rsvd:3;
-               u64 i_xn_req_iq_credits:5;
-               u64 i_rsvd1:51;
-       } ii_iws_fld_s;
-} ii_iws_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Masks errors in the IWEL register.                                 *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iweim_u {
-       u64 ii_iweim_regval;
-       struct {
-               u64 i_intr_timed_out:1;
-               u64 i_rsvd:7;
-               u64 i_cam_overflow:1;
-               u64 i_cam_read_miss:1;
-               u64 i_rsvd1:2;
-               u64 i_ioq_rep_underflow:1;
-               u64 i_ioq_req_underflow:1;
-               u64 i_ioq_rep_overflow:1;
-               u64 i_ioq_req_overflow:1;
-               u64 i_iiq_rep_overflow:1;
-               u64 i_iiq_req_overflow:1;
-               u64 i_rsvd2:6;
-               u64 i_ii_xn_rep_cred_overflow:1;
-               u64 i_ii_xn_req_cred_overflow:1;
-               u64 i_rsvd3:6;
-               u64 i_ii_xn_invalid_cmd:1;
-               u64 i_xn_ii_invalid_cmd:1;
-               u64 i_rsvd4:30;
-       } ii_iweim_fld_s;
-} ii_iweim_u_t;
-
-/************************************************************************
- *                                                                     *
- *  A write to this register causes a particular field in the           *
- * corresponding widget's PRB entry to be adjusted up or down by 1.     *
- * This counter should be used when recovering from error and reset     *
- * conditions. Note that software would be capable of causing           *
- * inadvertent overflow or underflow of these counters.                 *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ipca_u {
-       u64 ii_ipca_regval;
-       struct {
-               u64 i_wid:4;
-               u64 i_adjust:1;
-               u64 i_rsvd_1:3;
-               u64 i_field:2;
-               u64 i_rsvd:54;
-       } ii_ipca_fld_s;
-} ii_ipca_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte0a_u {
-       u64 ii_iprte0a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte0a_fld_s;
-} ii_iprte0a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte1a_u {
-       u64 ii_iprte1a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte1a_fld_s;
-} ii_iprte1a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte2a_u {
-       u64 ii_iprte2a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte2a_fld_s;
-} ii_iprte2a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte3a_u {
-       u64 ii_iprte3a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte3a_fld_s;
-} ii_iprte3a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte4a_u {
-       u64 ii_iprte4a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte4a_fld_s;
-} ii_iprte4a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte5a_u {
-       u64 ii_iprte5a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte5a_fld_s;
-} ii_iprte5a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte6a_u {
-       u64 ii_iprte6a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprte6a_fld_s;
-} ii_iprte6a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte7a_u {
-       u64 ii_iprte7a_regval;
-       struct {
-               u64 i_rsvd_1:54;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } ii_iprtea7_fld_s;
-} ii_iprte7a_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte0b_u {
-       u64 ii_iprte0b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte0b_fld_s;
-} ii_iprte0b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte1b_u {
-       u64 ii_iprte1b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte1b_fld_s;
-} ii_iprte1b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte2b_u {
-       u64 ii_iprte2b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte2b_fld_s;
-} ii_iprte2b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte3b_u {
-       u64 ii_iprte3b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte3b_fld_s;
-} ii_iprte3b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte4b_u {
-       u64 ii_iprte4b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte4b_fld_s;
-} ii_iprte4b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte5b_u {
-       u64 ii_iprte5b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte5b_fld_s;
-} ii_iprte5b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte6b_u {
-       u64 ii_iprte6b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-
-       } ii_iprte6b_fld_s;
-} ii_iprte6b_u_t;
-
-/************************************************************************
- *                                                                     *
- *  There are 8 instances of this register. This register contains      *
- * the information that the II has to remember once it has launched a   *
- * PIO Read operation. The contents are used to form the correct        *
- * Router Network packet and direct the Crosstalk reply to the          *
- * appropriate processor.                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iprte7b_u {
-       u64 ii_iprte7b_regval;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_address:47;
-               u64 i_init:3;
-               u64 i_source:11;
-       } ii_iprte7b_fld_s;
-} ii_iprte7b_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  SHub II contains a feature which did not exist in      *
- * the Hub which automatically cleans up after a Read Response          *
- * timeout, including deallocation of the IPRTE and recovery of IBuf    *
- * space. The inclusion of this register in SHub is for backward        *
- * compatibility                                                        *
- * A write to this register causes an entry from the table of           *
- * outstanding PIO Read Requests to be freed and returned to the        *
- * stack of free entries. This register is used in handling the         *
- * timeout errors that result in a PIO Reply never returning from       *
- * Crosstalk.                                                           *
- * Note that this register does not affect the contents of the IPRTE    *
- * registers. The Valid bits in those registers have to be              *
- * specifically turned off by software.                                 *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ipdr_u {
-       u64 ii_ipdr_regval;
-       struct {
-               u64 i_te:3;
-               u64 i_rsvd_1:1;
-               u64 i_pnd:1;
-               u64 i_init_rpcnt:1;
-               u64 i_rsvd:58;
-       } ii_ipdr_fld_s;
-} ii_ipdr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  A write to this register causes a CRB entry to be returned to the   *
- * queue of free CRBs. The entry should have previously been cleared    *
- * (mark bit) via backdoor access to the pertinent CRB entry. This      *
- * register is used in the last step of handling the errors that are    *
- * captured and marked in CRB entries.  Briefly: 1) first error for     *
- * DMA write from a particular device, and first error for a            *
- * particular BTE stream, lead to a marked CRB entry, and processor     *
- * interrupt, 2) software reads the error information captured in the   *
- * CRB entry, and presumably takes some corrective action, 3)           *
- * software clears the mark bit, and finally 4) software writes to      *
- * the ICDR register to return the CRB entry to the list of free CRB    *
- * entries.                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icdr_u {
-       u64 ii_icdr_regval;
-       struct {
-               u64 i_crb_num:4;
-               u64 i_pnd:1;
-               u64 i_rsvd:59;
-       } ii_icdr_fld_s;
-} ii_icdr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register provides debug access to two FIFOs inside of II.      *
- * Both IOQ_MAX* fields of this register contain the instantaneous      *
- * depth (in units of the number of available entries) of the           *
- * associated IOQ FIFO.  A read of this register will return the        *
- * number of free entries on each FIFO at the time of the read.  So     *
- * when a FIFO is idle, the associated field contains the maximum       *
- * depth of the FIFO.  This register is writable for debug reasons      *
- * and is intended to be written with the maximum desired FIFO depth    *
- * while the FIFO is idle. Software must assure that II is idle when    *
- * this register is written. If there are any active entries in any     *
- * of these FIFOs when this register is written, the results are        *
- * undefined.                                                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ifdr_u {
-       u64 ii_ifdr_regval;
-       struct {
-               u64 i_ioq_max_rq:7;
-               u64 i_set_ioq_rq:1;
-               u64 i_ioq_max_rp:7;
-               u64 i_set_ioq_rp:1;
-               u64 i_rsvd:48;
-       } ii_ifdr_fld_s;
-} ii_ifdr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register allows the II to become sluggish in removing          *
- * messages from its inbound queue (IIQ). This will cause messages to   *
- * back up in either virtual channel. Disabling the "molasses" mode     *
- * subsequently allows the II to be tested under stress. In the         *
- * sluggish ("Molasses") mode, the localized effects of congestion      *
- * can be observed.                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iiap_u {
-       u64 ii_iiap_regval;
-       struct {
-               u64 i_rq_mls:6;
-               u64 i_rsvd_1:2;
-               u64 i_rp_mls:6;
-               u64 i_rsvd:50;
-       } ii_iiap_fld_s;
-} ii_iiap_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register allows several parameters of CRB operation to be      *
- * set. Note that writing to this register can have catastrophic side   *
- * effects, if the CRB is not quiescent, i.e. if the CRB is             *
- * processing protocol messages when the write occurs.                  *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icmr_u {
-       u64 ii_icmr_regval;
-       struct {
-               u64 i_sp_msg:1;
-               u64 i_rd_hdr:1;
-               u64 i_rsvd_4:2;
-               u64 i_c_cnt:4;
-               u64 i_rsvd_3:4;
-               u64 i_clr_rqpd:1;
-               u64 i_clr_rppd:1;
-               u64 i_rsvd_2:2;
-               u64 i_fc_cnt:4;
-               u64 i_crb_vld:15;
-               u64 i_crb_mark:15;
-               u64 i_rsvd_1:2;
-               u64 i_precise:1;
-               u64 i_rsvd:11;
-       } ii_icmr_fld_s;
-} ii_icmr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register allows control of the table portion of the CRB        *
- * logic via software. Control operations from this register have       *
- * priority over all incoming Crosstalk or BTE requests.                *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_iccr_u {
-       u64 ii_iccr_regval;
-       struct {
-               u64 i_crb_num:4;
-               u64 i_rsvd_1:4;
-               u64 i_cmd:8;
-               u64 i_pending:1;
-               u64 i_rsvd:47;
-       } ii_iccr_fld_s;
-} ii_iccr_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register allows the maximum timeout value to be programmed.    *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icto_u {
-       u64 ii_icto_regval;
-       struct {
-               u64 i_timeout:8;
-               u64 i_rsvd:56;
-       } ii_icto_fld_s;
-} ii_icto_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register allows the timeout prescalar to be programmed. An     *
- * internal counter is associated with this register. When the          *
- * internal counter reaches the value of the PRESCALE field, the        *
- * timer registers in all valid CRBs are incremented (CRBx_D[TIMEOUT]   *
- * field). The internal counter resets to zero, and then continues      *
- * counting.                                                            *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ictp_u {
-       u64 ii_ictp_regval;
-       struct {
-               u64 i_prescale:24;
-               u64 i_rsvd:40;
-       } ii_ictp_fld_s;
-} ii_ictp_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
- * used for Crosstalk operations (both cacheline and partial            *
- * operations) or BTE/IO. Because the CRB entries are very wide, five   *
- * registers (_A to _E) are required to read and write each entry.      *
- * The CRB Entry registers can be conceptualized as rows and columns    *
- * (illustrated in the table above). Each row contains the 4            *
- * registers required for a single CRB Entry. The first doubleword      *
- * (column) for each entry is labeled A, and the second doubleword      *
- * (higher address) is labeled B, the third doubleword is labeled C,    *
- * the fourth doubleword is labeled D and the fifth doubleword is       *
- * labeled E. All CRB entries have their addresses on a quarter         *
- * cacheline aligned boundary.                   *
- * Upon reset, only the following fields are initialized: valid         *
- * (VLD), priority count, timeout, timeout valid, and context valid.    *
- * All other bits should be cleared by software before use (after       *
- * recovering any potential error state from before the reset).         *
- * The following four tables summarize the format for the four          *
- * registers that are used for each ICRB# Entry.                        *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icrb0_a_u {
-       u64 ii_icrb0_a_regval;
-       struct {
-               u64 ia_iow:1;
-               u64 ia_vld:1;
-               u64 ia_addr:47;
-               u64 ia_tnum:5;
-               u64 ia_sidn:4;
-               u64 ia_rsvd:6;
-       } ii_icrb0_a_fld_s;
-} ii_icrb0_a_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
- * used for Crosstalk operations (both cacheline and partial            *
- * operations) or BTE/IO. Because the CRB entries are very wide, five   *
- * registers (_A to _E) are required to read and write each entry.      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icrb0_b_u {
-       u64 ii_icrb0_b_regval;
-       struct {
-               u64 ib_xt_err:1;
-               u64 ib_mark:1;
-               u64 ib_ln_uce:1;
-               u64 ib_errcode:3;
-               u64 ib_error:1;
-               u64 ib_stall__bte_1:1;
-               u64 ib_stall__bte_0:1;
-               u64 ib_stall__intr:1;
-               u64 ib_stall_ib:1;
-               u64 ib_intvn:1;
-               u64 ib_wb:1;
-               u64 ib_hold:1;
-               u64 ib_ack:1;
-               u64 ib_resp:1;
-               u64 ib_ack_cnt:11;
-               u64 ib_rsvd:7;
-               u64 ib_exc:5;
-               u64 ib_init:3;
-               u64 ib_imsg:8;
-               u64 ib_imsgtype:2;
-               u64 ib_use_old:1;
-               u64 ib_rsvd_1:11;
-       } ii_icrb0_b_fld_s;
-} ii_icrb0_b_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
- * used for Crosstalk operations (both cacheline and partial            *
- * operations) or BTE/IO. Because the CRB entries are very wide, five   *
- * registers (_A to _E) are required to read and write each entry.      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icrb0_c_u {
-       u64 ii_icrb0_c_regval;
-       struct {
-               u64 ic_source:15;
-               u64 ic_size:2;
-               u64 ic_ct:1;
-               u64 ic_bte_num:1;
-               u64 ic_gbr:1;
-               u64 ic_resprqd:1;
-               u64 ic_bo:1;
-               u64 ic_suppl:15;
-               u64 ic_rsvd:27;
-       } ii_icrb0_c_fld_s;
-} ii_icrb0_c_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
- * used for Crosstalk operations (both cacheline and partial            *
- * operations) or BTE/IO. Because the CRB entries are very wide, five   *
- * registers (_A to _E) are required to read and write each entry.      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icrb0_d_u {
-       u64 ii_icrb0_d_regval;
-       struct {
-               u64 id_pa_be:43;
-               u64 id_bte_op:1;
-               u64 id_pr_psc:4;
-               u64 id_pr_cnt:4;
-               u64 id_sleep:1;
-               u64 id_rsvd:11;
-       } ii_icrb0_d_fld_s;
-} ii_icrb0_d_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  There are 15 CRB Entries (ICRB0 to ICRBE) that are     *
- * used for Crosstalk operations (both cacheline and partial            *
- * operations) or BTE/IO. Because the CRB entries are very wide, five   *
- * registers (_A to _E) are required to read and write each entry.      *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icrb0_e_u {
-       u64 ii_icrb0_e_regval;
-       struct {
-               u64 ie_timeout:8;
-               u64 ie_context:15;
-               u64 ie_rsvd:1;
-               u64 ie_tvld:1;
-               u64 ie_cvld:1;
-               u64 ie_rsvd_0:38;
-       } ii_icrb0_e_fld_s;
-} ii_icrb0_e_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the lower 64 bits of the header of the       *
- * spurious message captured by II. Valid when the SP_MSG bit in ICMR   *
- * register is set.                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icsml_u {
-       u64 ii_icsml_regval;
-       struct {
-               u64 i_tt_addr:47;
-               u64 i_newsuppl_ex:14;
-               u64 i_reserved:2;
-               u64 i_overflow:1;
-       } ii_icsml_fld_s;
-} ii_icsml_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the middle 64 bits of the header of the      *
- * spurious message captured by II. Valid when the SP_MSG bit in ICMR   *
- * register is set.                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icsmm_u {
-       u64 ii_icsmm_regval;
-       struct {
-               u64 i_tt_ack_cnt:11;
-               u64 i_reserved:53;
-       } ii_icsmm_fld_s;
-} ii_icsmm_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the microscopic state, all the inputs to     *
- * the protocol table, captured with the spurious message. Valid when   *
- * the SP_MSG bit in the ICMR register is set.                          *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_icsmh_u {
-       u64 ii_icsmh_regval;
-       struct {
-               u64 i_tt_vld:1;
-               u64 i_xerr:1;
-               u64 i_ft_cwact_o:1;
-               u64 i_ft_wact_o:1;
-               u64 i_ft_active_o:1;
-               u64 i_sync:1;
-               u64 i_mnusg:1;
-               u64 i_mnusz:1;
-               u64 i_plusz:1;
-               u64 i_plusg:1;
-               u64 i_tt_exc:5;
-               u64 i_tt_wb:1;
-               u64 i_tt_hold:1;
-               u64 i_tt_ack:1;
-               u64 i_tt_resp:1;
-               u64 i_tt_intvn:1;
-               u64 i_g_stall_bte1:1;
-               u64 i_g_stall_bte0:1;
-               u64 i_g_stall_il:1;
-               u64 i_g_stall_ib:1;
-               u64 i_tt_imsg:8;
-               u64 i_tt_imsgtype:2;
-               u64 i_tt_use_old:1;
-               u64 i_tt_respreqd:1;
-               u64 i_tt_bte_num:1;
-               u64 i_cbn:1;
-               u64 i_match:1;
-               u64 i_rpcnt_lt_34:1;
-               u64 i_rpcnt_ge_34:1;
-               u64 i_rpcnt_lt_18:1;
-               u64 i_rpcnt_ge_18:1;
-               u64 i_rpcnt_lt_2:1;
-               u64 i_rpcnt_ge_2:1;
-               u64 i_rqcnt_lt_18:1;
-               u64 i_rqcnt_ge_18:1;
-               u64 i_rqcnt_lt_2:1;
-               u64 i_rqcnt_ge_2:1;
-               u64 i_tt_device:7;
-               u64 i_tt_init:3;
-               u64 i_reserved:5;
-       } ii_icsmh_fld_s;
-} ii_icsmh_u_t;
-
-/************************************************************************
- *                                                                     *
- *  The Shub DEBUG unit provides a 3-bit selection signal to the        *
- * II core and a 3-bit selection signal to the fsbclk domain in the II  *
- * wrapper.                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_idbss_u {
-       u64 ii_idbss_regval;
-       struct {
-               u64 i_iioclk_core_submenu:3;
-               u64 i_rsvd:5;
-               u64 i_fsbclk_wrapper_submenu:3;
-               u64 i_rsvd_1:5;
-               u64 i_iioclk_menu:5;
-               u64 i_rsvd_2:43;
-       } ii_idbss_fld_s;
-} ii_idbss_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register is used to set up the length for a       *
- * transfer and then to monitor the progress of that transfer. This     *
- * register needs to be initialized before a transfer is started. A     *
- * legitimate write to this register will set the Busy bit, clear the   *
- * Error bit, and initialize the length to the value desired.           *
- * While the transfer is in progress, hardware will decrement the       *
- * length field with each successful block that is copied. Once the     *
- * transfer completes, hardware will clear the Busy bit. The length     *
- * field will also contain the number of cache lines left to be         *
- * transferred.                                                         *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibls0_u {
-       u64 ii_ibls0_regval;
-       struct {
-               u64 i_length:16;
-               u64 i_error:1;
-               u64 i_rsvd_1:3;
-               u64 i_busy:1;
-               u64 i_rsvd:43;
-       } ii_ibls0_fld_s;
-} ii_ibls0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register should be loaded before a transfer is started. The    *
- * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
- * address as described in Section 1.3, Figure2 and Figure3. Since      *
- * the bottom 7 bits of the address are always taken to be zero, BTE    *
- * transfers are always cacheline-aligned.                              *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibsa0_u {
-       u64 ii_ibsa0_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:42;
-               u64 i_rsvd:15;
-       } ii_ibsa0_fld_s;
-} ii_ibsa0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register should be loaded before a transfer is started. The    *
- * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
- * address as described in Section 1.3, Figure2 and Figure3. Since      *
- * the bottom 7 bits of the address are always taken to be zero, BTE    *
- * transfers are always cacheline-aligned.                              *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibda0_u {
-       u64 ii_ibda0_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:42;
-               u64 i_rsvd:15;
-       } ii_ibda0_fld_s;
-} ii_ibda0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Writing to this register sets up the attributes of the transfer     *
- * and initiates the transfer operation. Reading this register has      *
- * the side effect of terminating any transfer in progress. Note:       *
- * stopping a transfer midstream could have an adverse impact on the    *
- * other BTE. If a BTE stream has to be stopped (due to error           *
- * handling for example), both BTE streams should be stopped and        *
- * their transfers discarded.                                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibct0_u {
-       u64 ii_ibct0_regval;
-       struct {
-               u64 i_zerofill:1;
-               u64 i_rsvd_2:3;
-               u64 i_notify:1;
-               u64 i_rsvd_1:3;
-               u64 i_poison:1;
-               u64 i_rsvd:55;
-       } ii_ibct0_fld_s;
-} ii_ibct0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the address to which the WINV is sent.       *
- * This address has to be cache line aligned.                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibna0_u {
-       u64 ii_ibna0_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:42;
-               u64 i_rsvd:15;
-       } ii_ibna0_fld_s;
-} ii_ibna0_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the programmable level as well as the node   *
- * ID and PI unit of the processor to which the interrupt will be       *
- * sent.                                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibia0_u {
-       u64 ii_ibia0_regval;
-       struct {
-               u64 i_rsvd_2:1;
-               u64 i_node_id:11;
-               u64 i_rsvd_1:4;
-               u64 i_level:7;
-               u64 i_rsvd:41;
-       } ii_ibia0_fld_s;
-} ii_ibia0_u_t;
-
-/************************************************************************
- *                                                                     *
- * Description:  This register is used to set up the length for a       *
- * transfer and then to monitor the progress of that transfer. This     *
- * register needs to be initialized before a transfer is started. A     *
- * legitimate write to this register will set the Busy bit, clear the   *
- * Error bit, and initialize the length to the value desired.           *
- * While the transfer is in progress, hardware will decrement the       *
- * length field with each successful block that is copied. Once the     *
- * transfer completes, hardware will clear the Busy bit. The length     *
- * field will also contain the number of cache lines left to be         *
- * transferred.                                                         *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibls1_u {
-       u64 ii_ibls1_regval;
-       struct {
-               u64 i_length:16;
-               u64 i_error:1;
-               u64 i_rsvd_1:3;
-               u64 i_busy:1;
-               u64 i_rsvd:43;
-       } ii_ibls1_fld_s;
-} ii_ibls1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register should be loaded before a transfer is started. The    *
- * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
- * address as described in Section 1.3, Figure2 and Figure3. Since      *
- * the bottom 7 bits of the address are always taken to be zero, BTE    *
- * transfers are always cacheline-aligned.                              *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibsa1_u {
-       u64 ii_ibsa1_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:33;
-               u64 i_rsvd:24;
-       } ii_ibsa1_fld_s;
-} ii_ibsa1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register should be loaded before a transfer is started. The    *
- * address to be loaded in bits 39:0 is the 40-bit TRex+ physical       *
- * address as described in Section 1.3, Figure2 and Figure3. Since      *
- * the bottom 7 bits of the address are always taken to be zero, BTE    *
- * transfers are always cacheline-aligned.                              *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibda1_u {
-       u64 ii_ibda1_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:33;
-               u64 i_rsvd:24;
-       } ii_ibda1_fld_s;
-} ii_ibda1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  Writing to this register sets up the attributes of the transfer     *
- * and initiates the transfer operation. Reading this register has      *
- * the side effect of terminating any transfer in progress. Note:       *
- * stopping a transfer midstream could have an adverse impact on the    *
- * other BTE. If a BTE stream has to be stopped (due to error           *
- * handling for example), both BTE streams should be stopped and        *
- * their transfers discarded.                                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibct1_u {
-       u64 ii_ibct1_regval;
-       struct {
-               u64 i_zerofill:1;
-               u64 i_rsvd_2:3;
-               u64 i_notify:1;
-               u64 i_rsvd_1:3;
-               u64 i_poison:1;
-               u64 i_rsvd:55;
-       } ii_ibct1_fld_s;
-} ii_ibct1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the address to which the WINV is sent.       *
- * This address has to be cache line aligned.                           *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibna1_u {
-       u64 ii_ibna1_regval;
-       struct {
-               u64 i_rsvd_1:7;
-               u64 i_addr:33;
-               u64 i_rsvd:24;
-       } ii_ibna1_fld_s;
-} ii_ibna1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register contains the programmable level as well as the node   *
- * ID and PI unit of the processor to which the interrupt will be       *
- * sent.                                                               *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ibia1_u {
-       u64 ii_ibia1_regval;
-       struct {
-               u64 i_pi_id:1;
-               u64 i_node_id:8;
-               u64 i_rsvd_1:7;
-               u64 i_level:7;
-               u64 i_rsvd:41;
-       } ii_ibia1_fld_s;
-} ii_ibia1_u_t;
-
-/************************************************************************
- *                                                                     *
- *  This register defines the resources that feed information into      *
- * the two performance counters located in the IO Performance           *
- * Profiling Register. There are 17 different quantities that can be    *
- * measured. Given these 17 different options, the two performance      *
- * counters have 15 of them in common; menu selections 0 through 0xE    *
- * are identical for each performance counter. As for the other two     *
- * options, one is available from one performance counter and the       *
- * other is available from the other performance counter. Hence, the    *
- * II supports all 17*16=272 possible combinations of quantities to     *
- * measure.                                                             *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ipcr_u {
-       u64 ii_ipcr_regval;
-       struct {
-               u64 i_ippr0_c:4;
-               u64 i_ippr1_c:4;
-               u64 i_icct:8;
-               u64 i_rsvd:48;
-       } ii_ipcr_fld_s;
-} ii_ipcr_u_t;
-
-/************************************************************************
- *                                                                     *
- *                                                                     *
- *                                                                     *
- ************************************************************************/
-
-typedef union ii_ippr_u {
-       u64 ii_ippr_regval;
-       struct {
-               u64 i_ippr0:32;
-               u64 i_ippr1:32;
-       } ii_ippr_fld_s;
-} ii_ippr_u_t;
-
-/************************************************************************
- *                                                                     *
- * The following defines which were not formed into structures are     *
- * probably indentical to another register, and the name of the                *
- * register is provided against each of these registers. This          *
- * information needs to be checked carefully                           *
- *                                                                     *
- *             IIO_ICRB1_A             IIO_ICRB0_A                     *
- *             IIO_ICRB1_B             IIO_ICRB0_B                     *
- *             IIO_ICRB1_C             IIO_ICRB0_C                     *
- *             IIO_ICRB1_D             IIO_ICRB0_D                     *
- *             IIO_ICRB1_E             IIO_ICRB0_E                     *
- *             IIO_ICRB2_A             IIO_ICRB0_A                     *
- *             IIO_ICRB2_B             IIO_ICRB0_B                     *
- *             IIO_ICRB2_C             IIO_ICRB0_C                     *
- *             IIO_ICRB2_D             IIO_ICRB0_D                     *
- *             IIO_ICRB2_E             IIO_ICRB0_E                     *
- *             IIO_ICRB3_A             IIO_ICRB0_A                     *
- *             IIO_ICRB3_B             IIO_ICRB0_B                     *
- *             IIO_ICRB3_C             IIO_ICRB0_C                     *
- *             IIO_ICRB3_D             IIO_ICRB0_D                     *
- *             IIO_ICRB3_E             IIO_ICRB0_E                     *
- *             IIO_ICRB4_A             IIO_ICRB0_A                     *
- *             IIO_ICRB4_B             IIO_ICRB0_B                     *
- *             IIO_ICRB4_C             IIO_ICRB0_C                     *
- *             IIO_ICRB4_D             IIO_ICRB0_D                     *
- *             IIO_ICRB4_E             IIO_ICRB0_E                     *
- *             IIO_ICRB5_A             IIO_ICRB0_A                     *
- *             IIO_ICRB5_B             IIO_ICRB0_B                     *
- *             IIO_ICRB5_C             IIO_ICRB0_C                     *
- *             IIO_ICRB5_D             IIO_ICRB0_D                     *
- *             IIO_ICRB5_E             IIO_ICRB0_E                     *
- *             IIO_ICRB6_A             IIO_ICRB0_A                     *
- *             IIO_ICRB6_B             IIO_ICRB0_B                     *
- *             IIO_ICRB6_C             IIO_ICRB0_C                     *
- *             IIO_ICRB6_D             IIO_ICRB0_D                     *
- *             IIO_ICRB6_E             IIO_ICRB0_E                     *
- *             IIO_ICRB7_A             IIO_ICRB0_A                     *
- *             IIO_ICRB7_B             IIO_ICRB0_B                     *
- *             IIO_ICRB7_C             IIO_ICRB0_C                     *
- *             IIO_ICRB7_D             IIO_ICRB0_D                     *
- *             IIO_ICRB7_E             IIO_ICRB0_E                     *
- *             IIO_ICRB8_A             IIO_ICRB0_A                     *
- *             IIO_ICRB8_B             IIO_ICRB0_B                     *
- *             IIO_ICRB8_C             IIO_ICRB0_C                     *
- *             IIO_ICRB8_D             IIO_ICRB0_D                     *
- *             IIO_ICRB8_E             IIO_ICRB0_E                     *
- *             IIO_ICRB9_A             IIO_ICRB0_A                     *
- *             IIO_ICRB9_B             IIO_ICRB0_B                     *
- *             IIO_ICRB9_C             IIO_ICRB0_C                     *
- *             IIO_ICRB9_D             IIO_ICRB0_D                     *
- *             IIO_ICRB9_E             IIO_ICRB0_E                     *
- *             IIO_ICRBA_A             IIO_ICRB0_A                     *
- *             IIO_ICRBA_B             IIO_ICRB0_B                     *
- *             IIO_ICRBA_C             IIO_ICRB0_C                     *
- *             IIO_ICRBA_D             IIO_ICRB0_D                     *
- *             IIO_ICRBA_E             IIO_ICRB0_E                     *
- *             IIO_ICRBB_A             IIO_ICRB0_A                     *
- *             IIO_ICRBB_B             IIO_ICRB0_B                     *
- *             IIO_ICRBB_C             IIO_ICRB0_C                     *
- *             IIO_ICRBB_D             IIO_ICRB0_D                     *
- *             IIO_ICRBB_E             IIO_ICRB0_E                     *
- *             IIO_ICRBC_A             IIO_ICRB0_A                     *
- *             IIO_ICRBC_B             IIO_ICRB0_B                     *
- *             IIO_ICRBC_C             IIO_ICRB0_C                     *
- *             IIO_ICRBC_D             IIO_ICRB0_D                     *
- *             IIO_ICRBC_E             IIO_ICRB0_E                     *
- *             IIO_ICRBD_A             IIO_ICRB0_A                     *
- *             IIO_ICRBD_B             IIO_ICRB0_B                     *
- *             IIO_ICRBD_C             IIO_ICRB0_C                     *
- *             IIO_ICRBD_D             IIO_ICRB0_D                     *
- *             IIO_ICRBD_E             IIO_ICRB0_E                     *
- *             IIO_ICRBE_A             IIO_ICRB0_A                     *
- *             IIO_ICRBE_B             IIO_ICRB0_B                     *
- *             IIO_ICRBE_C             IIO_ICRB0_C                     *
- *             IIO_ICRBE_D             IIO_ICRB0_D                     *
- *             IIO_ICRBE_E             IIO_ICRB0_E                     *
- *                                                                     *
- ************************************************************************/
-
-/*
- * Slightly friendlier names for some common registers.
- */
-#define IIO_WIDGET              IIO_WID                /* Widget identification */
-#define IIO_WIDGET_STAT         IIO_WSTAT      /* Widget status register */
-#define IIO_WIDGET_CTRL         IIO_WCR                /* Widget control register */
-#define IIO_PROTECT             IIO_ILAPR      /* IO interface protection */
-#define IIO_PROTECT_OVRRD       IIO_ILAPO      /* IO protect override */
-#define IIO_OUTWIDGET_ACCESS    IIO_IOWA       /* Outbound widget access */
-#define IIO_INWIDGET_ACCESS     IIO_IIWA       /* Inbound widget access */
-#define IIO_INDEV_ERR_MASK      IIO_IIDEM      /* Inbound device error mask */
-#define IIO_LLP_CSR             IIO_ILCSR      /* LLP control and status */
-#define IIO_LLP_LOG             IIO_ILLR       /* LLP log */
-#define IIO_XTALKCC_TOUT        IIO_IXCC       /* Xtalk credit count timeout */
-#define IIO_XTALKTT_TOUT        IIO_IXTT       /* Xtalk tail timeout */
-#define IIO_IO_ERR_CLR          IIO_IECLR      /* IO error clear */
-#define IIO_IGFX_0             IIO_IGFX0
-#define IIO_IGFX_1             IIO_IGFX1
-#define IIO_IBCT_0             IIO_IBCT0
-#define IIO_IBCT_1             IIO_IBCT1
-#define IIO_IBLS_0             IIO_IBLS0
-#define IIO_IBLS_1             IIO_IBLS1
-#define IIO_IBSA_0             IIO_IBSA0
-#define IIO_IBSA_1             IIO_IBSA1
-#define IIO_IBDA_0             IIO_IBDA0
-#define IIO_IBDA_1             IIO_IBDA1
-#define IIO_IBNA_0             IIO_IBNA0
-#define IIO_IBNA_1             IIO_IBNA1
-#define IIO_IBIA_0             IIO_IBIA0
-#define IIO_IBIA_1             IIO_IBIA1
-#define IIO_IOPRB_0            IIO_IPRB0
-
-#define IIO_PRTE_A(_x)         (IIO_IPRTE0_A + (8 * (_x)))
-#define IIO_PRTE_B(_x)         (IIO_IPRTE0_B + (8 * (_x)))
-#define IIO_NUM_PRTES          8       /* Total number of PRB table entries */
-#define IIO_WIDPRTE_A(x)       IIO_PRTE_A(((x) - 8))   /* widget ID to its PRTE num */
-#define IIO_WIDPRTE_B(x)       IIO_PRTE_B(((x) - 8))   /* widget ID to its PRTE num */
-
-#define IIO_NUM_IPRBS          9
-
-#define IIO_LLP_CSR_IS_UP              0x00002000
-#define IIO_LLP_CSR_LLP_STAT_MASK       0x00003000
-#define IIO_LLP_CSR_LLP_STAT_SHFT       12
-
-#define IIO_LLP_CB_MAX  0xffff /* in ILLR CB_CNT, Max Check Bit errors */
-#define IIO_LLP_SN_MAX  0xffff /* in ILLR SN_CNT, Max Sequence Number errors */
-
-/* key to IIO_PROTECT_OVRRD */
-#define IIO_PROTECT_OVRRD_KEY   0x53474972756c6573ull  /* "SGIrules" */
-
-/* BTE register names */
-#define IIO_BTE_STAT_0          IIO_IBLS_0     /* Also BTE length/status 0 */
-#define IIO_BTE_SRC_0           IIO_IBSA_0     /* Also BTE source address  0 */
-#define IIO_BTE_DEST_0          IIO_IBDA_0     /* Also BTE dest. address 0 */
-#define IIO_BTE_CTRL_0          IIO_IBCT_0     /* Also BTE control/terminate 0 */
-#define IIO_BTE_NOTIFY_0        IIO_IBNA_0     /* Also BTE notification 0 */
-#define IIO_BTE_INT_0           IIO_IBIA_0     /* Also BTE interrupt 0 */
-#define IIO_BTE_OFF_0           0      /* Base offset from BTE 0 regs. */
-#define IIO_BTE_OFF_1          (IIO_IBLS_1 - IIO_IBLS_0)       /* Offset from base to BTE 1 */
-
-/* BTE register offsets from base */
-#define BTEOFF_STAT             0
-#define BTEOFF_SRC             (IIO_BTE_SRC_0 - IIO_BTE_STAT_0)
-#define BTEOFF_DEST            (IIO_BTE_DEST_0 - IIO_BTE_STAT_0)
-#define BTEOFF_CTRL            (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0)
-#define BTEOFF_NOTIFY          (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0)
-#define BTEOFF_INT             (IIO_BTE_INT_0 - IIO_BTE_STAT_0)
-
-/* names used in shub diags */
-#define IIO_BASE_BTE0   IIO_IBLS_0
-#define IIO_BASE_BTE1   IIO_IBLS_1
-
-/*
- * Macro which takes the widget number, and returns the
- * IO PRB address of that widget.
- * value _x is expected to be a widget number in the range
- * 0, 8 - 0xF
- */
-#define IIO_IOPRB(_x)  (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
-                       (_x) : \
-                       (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
-
-/* GFX Flow Control Node/Widget Register */
-#define IIO_IGFX_W_NUM_BITS    4       /* size of widget num field */
-#define IIO_IGFX_W_NUM_MASK    ((1<<IIO_IGFX_W_NUM_BITS)-1)
-#define IIO_IGFX_W_NUM_SHIFT   0
-#define IIO_IGFX_PI_NUM_BITS   1       /* size of PI num field */
-#define IIO_IGFX_PI_NUM_MASK   ((1<<IIO_IGFX_PI_NUM_BITS)-1)
-#define IIO_IGFX_PI_NUM_SHIFT  4
-#define IIO_IGFX_N_NUM_BITS    8       /* size of node num field */
-#define IIO_IGFX_N_NUM_MASK    ((1<<IIO_IGFX_N_NUM_BITS)-1)
-#define IIO_IGFX_N_NUM_SHIFT   5
-#define IIO_IGFX_P_NUM_BITS    1       /* size of processor num field */
-#define IIO_IGFX_P_NUM_MASK    ((1<<IIO_IGFX_P_NUM_BITS)-1)
-#define IIO_IGFX_P_NUM_SHIFT   16
-#define IIO_IGFX_INIT(widget, pi, node, cpu)                           (\
-       (((widget) & IIO_IGFX_W_NUM_MASK) << IIO_IGFX_W_NUM_SHIFT) |     \
-       (((pi)     & IIO_IGFX_PI_NUM_MASK)<< IIO_IGFX_PI_NUM_SHIFT)|     \
-       (((node)   & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) |     \
-       (((cpu)    & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT))
-
-/* Scratch registers (all bits available) */
-#define IIO_SCRATCH_REG0        IIO_ISCR0
-#define IIO_SCRATCH_REG1        IIO_ISCR1
-#define IIO_SCRATCH_MASK        0xffffffffffffffffUL
-
-#define IIO_SCRATCH_BIT0_0      0x0000000000000001UL
-#define IIO_SCRATCH_BIT0_1      0x0000000000000002UL
-#define IIO_SCRATCH_BIT0_2      0x0000000000000004UL
-#define IIO_SCRATCH_BIT0_3      0x0000000000000008UL
-#define IIO_SCRATCH_BIT0_4      0x0000000000000010UL
-#define IIO_SCRATCH_BIT0_5      0x0000000000000020UL
-#define IIO_SCRATCH_BIT0_6      0x0000000000000040UL
-#define IIO_SCRATCH_BIT0_7      0x0000000000000080UL
-#define IIO_SCRATCH_BIT0_8      0x0000000000000100UL
-#define IIO_SCRATCH_BIT0_9      0x0000000000000200UL
-#define IIO_SCRATCH_BIT0_A      0x0000000000000400UL
-
-#define IIO_SCRATCH_BIT1_0      0x0000000000000001UL
-#define IIO_SCRATCH_BIT1_1      0x0000000000000002UL
-/* IO Translation Table Entries */
-#define IIO_NUM_ITTES   7      /* ITTEs numbered 0..6 */
-                                       /* Hw manuals number them 1..7! */
-/*
- * IIO_IMEM Register fields.
- */
-#define IIO_IMEM_W0ESD  0x1UL  /* Widget 0 shut down due to error */
-#define IIO_IMEM_B0ESD (1UL << 4)      /* BTE 0 shut down due to error */
-#define IIO_IMEM_B1ESD (1UL << 8)      /* BTE 1 Shut down due to error */
-
-/*
- * As a permanent workaround for a bug in the PI side of the shub, we've
- * redefined big window 7 as small window 0.
- XXX does this still apply for SN1??
- */
-#define HUB_NUM_BIG_WINDOW     (IIO_NUM_ITTES - 1)
-
-/*
- * Use the top big window as a surrogate for the first small window
- */
-#define SWIN0_BIGWIN            HUB_NUM_BIG_WINDOW
-
-#define ILCSR_WARM_RESET        0x100
-
-/*
- * CRB manipulation macros
- *     The CRB macros are slightly complicated, since there are up to
- *     four registers associated with each CRB entry.
- */
-#define IIO_NUM_CRBS            15     /* Number of CRBs */
-#define IIO_NUM_PC_CRBS         4      /* Number of partial cache CRBs */
-#define IIO_ICRB_OFFSET         8
-#define IIO_ICRB_0              IIO_ICRB0_A
-#define IIO_ICRB_ADDR_SHFT     2       /* Shift to get proper address */
-/* XXX - This is now tuneable:
-        #define IIO_FIRST_PC_ENTRY 12
- */
-
-#define IIO_ICRB_A(_x) ((u64)(IIO_ICRB_0 + (6 * IIO_ICRB_OFFSET * (_x))))
-#define IIO_ICRB_B(_x) ((u64)((char *)IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET))
-#define IIO_ICRB_C(_x) ((u64)((char *)IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET))
-#define IIO_ICRB_D(_x) ((u64)((char *)IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET))
-#define IIO_ICRB_E(_x) ((u64)((char *)IIO_ICRB_A(_x) + 4*IIO_ICRB_OFFSET))
-
-#define TNUM_TO_WIDGET_DEV(_tnum)      (_tnum & 0x7)
-
-/*
- * values for "ecode" field
- */
-#define IIO_ICRB_ECODE_DERR     0      /* Directory error due to IIO access */
-#define IIO_ICRB_ECODE_PERR     1      /* Poison error on IO access */
-#define IIO_ICRB_ECODE_WERR     2      /* Write error by IIO access
-                                        * e.g. WINV to a Read only line. */
-#define IIO_ICRB_ECODE_AERR     3      /* Access error caused by IIO access */
-#define IIO_ICRB_ECODE_PWERR    4      /* Error on partial write */
-#define IIO_ICRB_ECODE_PRERR    5      /* Error on partial read  */
-#define IIO_ICRB_ECODE_TOUT     6      /* CRB timeout before deallocating */
-#define IIO_ICRB_ECODE_XTERR    7      /* Incoming xtalk pkt had error bit */
-
-/*
- * Values for field imsgtype
- */
-#define IIO_ICRB_IMSGT_XTALK    0      /* Incoming Meessage from Xtalk */
-#define IIO_ICRB_IMSGT_BTE      1      /* Incoming message from BTE    */
-#define IIO_ICRB_IMSGT_SN1NET   2      /* Incoming message from SN1 net */
-#define IIO_ICRB_IMSGT_CRB      3      /* Incoming message from CRB ???  */
-
-/*
- * values for field initiator.
- */
-#define IIO_ICRB_INIT_XTALK     0      /* Message originated in xtalk  */
-#define IIO_ICRB_INIT_BTE0      0x1    /* Message originated in BTE 0  */
-#define IIO_ICRB_INIT_SN1NET    0x2    /* Message originated in SN1net */
-#define IIO_ICRB_INIT_CRB       0x3    /* Message originated in CRB ?  */
-#define IIO_ICRB_INIT_BTE1      0x5    /* MEssage originated in BTE 1  */
-
-/*
- * Number of credits Hub widget has while sending req/response to
- * xbow.
- * Value of 3 is required by Xbow 1.1
- * We may be able to increase this to 4 with Xbow 1.2.
- */
-#define                   HUBII_XBOW_CREDIT       3
-#define                   HUBII_XBOW_REV2_CREDIT  4
-
-/*
- * Number of credits that xtalk devices should use when communicating
- * with a SHub (depth of SHub's queue).
- */
-#define HUB_CREDIT 4
-
-/*
- * Some IIO_PRB fields
- */
-#define IIO_PRB_MULTI_ERR      (1LL << 63)
-#define IIO_PRB_SPUR_RD                (1LL << 51)
-#define IIO_PRB_SPUR_WR                (1LL << 50)
-#define IIO_PRB_RD_TO          (1LL << 49)
-#define IIO_PRB_ERROR          (1LL << 48)
-
-/*************************************************************************
-
- Some of the IIO field masks and shifts are defined here.
- This is in order to maintain compatibility in SN0 and SN1 code
-**************************************************************************/
-
-/*
- * ICMR register fields
- * (Note: the IIO_ICMR_P_CNT and IIO_ICMR_PC_VLD from Hub are not
- * present in SHub)
- */
-
-#define IIO_ICMR_CRB_VLD_SHFT   20
-#define IIO_ICMR_CRB_VLD_MASK  (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT)
-
-#define IIO_ICMR_FC_CNT_SHFT    16
-#define IIO_ICMR_FC_CNT_MASK   (0xf << IIO_ICMR_FC_CNT_SHFT)
-
-#define IIO_ICMR_C_CNT_SHFT     4
-#define IIO_ICMR_C_CNT_MASK    (0xf << IIO_ICMR_C_CNT_SHFT)
-
-#define IIO_ICMR_PRECISE       (1UL << 52)
-#define IIO_ICMR_CLR_RPPD      (1UL << 13)
-#define IIO_ICMR_CLR_RQPD      (1UL << 12)
-
-/*
- * IIO PIO Deallocation register field masks : (IIO_IPDR)
- XXX present but not needed in bedrock?  See the manual.
- */
-#define IIO_IPDR_PND           (1 << 4)
-
-/*
- * IIO CRB deallocation register field masks: (IIO_ICDR)
- */
-#define IIO_ICDR_PND           (1 << 4)
-
-/* 
- * IO BTE Length/Status (IIO_IBLS) register bit field definitions
- */
-#define IBLS_BUSY              (0x1UL << 20)
-#define IBLS_ERROR_SHFT                16
-#define IBLS_ERROR             (0x1UL << IBLS_ERROR_SHFT)
-#define IBLS_LENGTH_MASK       0xffff
-
-/*
- * IO BTE Control/Terminate register (IBCT) register bit field definitions
- */
-#define IBCT_POISON            (0x1UL << 8)
-#define IBCT_NOTIFY            (0x1UL << 4)
-#define IBCT_ZFIL_MODE         (0x1UL << 0)
-
-/*
- * IIO Incoming Error Packet Header (IIO_IIEPH1/IIO_IIEPH2)
- */
-#define IIEPH1_VALID           (1UL << 44)
-#define IIEPH1_OVERRUN         (1UL << 40)
-#define IIEPH1_ERR_TYPE_SHFT   32
-#define IIEPH1_ERR_TYPE_MASK   0xf
-#define IIEPH1_SOURCE_SHFT     20
-#define IIEPH1_SOURCE_MASK     11
-#define IIEPH1_SUPPL_SHFT      8
-#define IIEPH1_SUPPL_MASK      11
-#define IIEPH1_CMD_SHFT                0
-#define IIEPH1_CMD_MASK                7
-
-#define IIEPH2_TAIL            (1UL << 40)
-#define IIEPH2_ADDRESS_SHFT    0
-#define IIEPH2_ADDRESS_MASK    38
-
-#define IIEPH1_ERR_SHORT_REQ   2
-#define IIEPH1_ERR_SHORT_REPLY 3
-#define IIEPH1_ERR_LONG_REQ    4
-#define IIEPH1_ERR_LONG_REPLY  5
-
-/*
- * IO Error Clear register bit field definitions
- */
-#define IECLR_PI1_FWD_INT      (1UL << 31)     /* clear PI1_FORWARD_INT in iidsr */
-#define IECLR_PI0_FWD_INT      (1UL << 30)     /* clear PI0_FORWARD_INT in iidsr */
-#define IECLR_SPUR_RD_HDR      (1UL << 29)     /* clear valid bit in ixss reg */
-#define IECLR_BTE1             (1UL << 18)     /* clear bte error 1 */
-#define IECLR_BTE0             (1UL << 17)     /* clear bte error 0 */
-#define IECLR_CRAZY            (1UL << 16)     /* clear crazy bit in wstat reg */
-#define IECLR_PRB_F            (1UL << 15)     /* clear err bit in PRB_F reg */
-#define IECLR_PRB_E            (1UL << 14)     /* clear err bit in PRB_E reg */
-#define IECLR_PRB_D            (1UL << 13)     /* clear err bit in PRB_D reg */
-#define IECLR_PRB_C            (1UL << 12)     /* clear err bit in PRB_C reg */
-#define IECLR_PRB_B            (1UL << 11)     /* clear err bit in PRB_B reg */
-#define IECLR_PRB_A            (1UL << 10)     /* clear err bit in PRB_A reg */
-#define IECLR_PRB_9            (1UL << 9)      /* clear err bit in PRB_9 reg */
-#define IECLR_PRB_8            (1UL << 8)      /* clear err bit in PRB_8 reg */
-#define IECLR_PRB_0            (1UL << 0)      /* clear err bit in PRB_0 reg */
-
-/*
- * IIO CRB control register Fields: IIO_ICCR 
- */
-#define        IIO_ICCR_PENDING        0x10000
-#define        IIO_ICCR_CMD_MASK       0xFF
-#define        IIO_ICCR_CMD_SHFT       7
-#define        IIO_ICCR_CMD_NOP        0x0     /* No Op */
-#define        IIO_ICCR_CMD_WAKE       0x100   /* Reactivate CRB entry and process */
-#define        IIO_ICCR_CMD_TIMEOUT    0x200   /* Make CRB timeout & mark invalid */
-#define        IIO_ICCR_CMD_EJECT      0x400   /* Contents of entry written to memory
-                                        * via a WB
-                                        */
-#define        IIO_ICCR_CMD_FLUSH      0x800
-
-/*
- *
- * CRB Register description.
- *
- * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
- * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
- * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
- * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
- * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
- *
- * Many of the fields in CRB are status bits used by hardware
- * for implementation of the protocol. It's very dangerous to
- * mess around with the CRB registers.
- *
- * It's OK to read the CRB registers and try to make sense out of the
- * fields in CRB.
- *
- * Updating CRB requires all activities in Hub IIO to be quiesced.
- * otherwise, a write to CRB could corrupt other CRB entries.
- * CRBs are here only as a back door peek to shub IIO's status.
- * Quiescing implies  no dmas no PIOs
- * either directly from the cpu or from sn0net.
- * this is not something that can be done easily. So, AVOID updating
- * CRBs.
- */
-
-/*
- * Easy access macros for CRBs, all 5 registers (A-E)
- */
-typedef ii_icrb0_a_u_t icrba_t;
-#define a_sidn         ii_icrb0_a_fld_s.ia_sidn
-#define a_tnum         ii_icrb0_a_fld_s.ia_tnum
-#define a_addr          ii_icrb0_a_fld_s.ia_addr
-#define a_valid         ii_icrb0_a_fld_s.ia_vld
-#define a_iow           ii_icrb0_a_fld_s.ia_iow
-#define a_regvalue     ii_icrb0_a_regval
-
-typedef ii_icrb0_b_u_t icrbb_t;
-#define b_use_old       ii_icrb0_b_fld_s.ib_use_old
-#define b_imsgtype      ii_icrb0_b_fld_s.ib_imsgtype
-#define b_imsg          ii_icrb0_b_fld_s.ib_imsg
-#define b_initiator     ii_icrb0_b_fld_s.ib_init
-#define b_exc           ii_icrb0_b_fld_s.ib_exc
-#define b_ackcnt        ii_icrb0_b_fld_s.ib_ack_cnt
-#define b_resp          ii_icrb0_b_fld_s.ib_resp
-#define b_ack           ii_icrb0_b_fld_s.ib_ack
-#define b_hold          ii_icrb0_b_fld_s.ib_hold
-#define b_wb            ii_icrb0_b_fld_s.ib_wb
-#define b_intvn         ii_icrb0_b_fld_s.ib_intvn
-#define b_stall_ib      ii_icrb0_b_fld_s.ib_stall_ib
-#define b_stall_int     ii_icrb0_b_fld_s.ib_stall__intr
-#define b_stall_bte_0   ii_icrb0_b_fld_s.ib_stall__bte_0
-#define b_stall_bte_1   ii_icrb0_b_fld_s.ib_stall__bte_1
-#define b_error         ii_icrb0_b_fld_s.ib_error
-#define b_ecode         ii_icrb0_b_fld_s.ib_errcode
-#define b_lnetuce       ii_icrb0_b_fld_s.ib_ln_uce
-#define b_mark          ii_icrb0_b_fld_s.ib_mark
-#define b_xerr          ii_icrb0_b_fld_s.ib_xt_err
-#define b_regvalue     ii_icrb0_b_regval
-
-typedef ii_icrb0_c_u_t icrbc_t;
-#define c_suppl         ii_icrb0_c_fld_s.ic_suppl
-#define c_barrop        ii_icrb0_c_fld_s.ic_bo
-#define c_doresp        ii_icrb0_c_fld_s.ic_resprqd
-#define c_gbr           ii_icrb0_c_fld_s.ic_gbr
-#define c_btenum        ii_icrb0_c_fld_s.ic_bte_num
-#define c_cohtrans      ii_icrb0_c_fld_s.ic_ct
-#define c_xtsize        ii_icrb0_c_fld_s.ic_size
-#define c_source        ii_icrb0_c_fld_s.ic_source
-#define c_regvalue     ii_icrb0_c_regval
-
-typedef ii_icrb0_d_u_t icrbd_t;
-#define d_sleep         ii_icrb0_d_fld_s.id_sleep
-#define d_pricnt        ii_icrb0_d_fld_s.id_pr_cnt
-#define d_pripsc        ii_icrb0_d_fld_s.id_pr_psc
-#define d_bteop         ii_icrb0_d_fld_s.id_bte_op
-#define d_bteaddr       ii_icrb0_d_fld_s.id_pa_be      /* ic_pa_be fld has 2 names */
-#define d_benable       ii_icrb0_d_fld_s.id_pa_be      /* ic_pa_be fld has 2 names */
-#define d_regvalue     ii_icrb0_d_regval
-
-typedef ii_icrb0_e_u_t icrbe_t;
-#define icrbe_ctxtvld   ii_icrb0_e_fld_s.ie_cvld
-#define icrbe_toutvld   ii_icrb0_e_fld_s.ie_tvld
-#define icrbe_context   ii_icrb0_e_fld_s.ie_context
-#define icrbe_timeout   ii_icrb0_e_fld_s.ie_timeout
-#define e_regvalue     ii_icrb0_e_regval
-
-/* Number of widgets supported by shub */
-#define HUB_NUM_WIDGET          9
-#define HUB_WIDGET_ID_MIN       0x8
-#define HUB_WIDGET_ID_MAX       0xf
-
-#define HUB_WIDGET_PART_NUM     0xc120
-#define MAX_HUBS_PER_XBOW       2
-
-/* A few more #defines for backwards compatibility */
-#define iprb_t          ii_iprb0_u_t
-#define iprb_regval     ii_iprb0_regval
-#define iprb_mult_err  ii_iprb0_fld_s.i_mult_err
-#define iprb_spur_rd   ii_iprb0_fld_s.i_spur_rd
-#define iprb_spur_wr   ii_iprb0_fld_s.i_spur_wr
-#define iprb_rd_to     ii_iprb0_fld_s.i_rd_to
-#define iprb_ovflow     ii_iprb0_fld_s.i_of_cnt
-#define iprb_error      ii_iprb0_fld_s.i_error
-#define iprb_ff         ii_iprb0_fld_s.i_f
-#define iprb_mode       ii_iprb0_fld_s.i_m
-#define iprb_bnakctr    ii_iprb0_fld_s.i_nb
-#define iprb_anakctr    ii_iprb0_fld_s.i_na
-#define iprb_xtalkctr   ii_iprb0_fld_s.i_c
-
-#define LNK_STAT_WORKING        0x2            /* LLP is working */
-
-#define IIO_WSTAT_ECRAZY       (1ULL << 32)    /* Hub gone crazy */
-#define IIO_WSTAT_TXRETRY      (1ULL << 9)     /* Hub Tx Retry timeout */
-#define IIO_WSTAT_TXRETRY_MASK  0x7F           /* should be 0xFF?? */
-#define IIO_WSTAT_TXRETRY_SHFT  16
-#define IIO_WSTAT_TXRETRY_CNT(w)       (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \
-                                       IIO_WSTAT_TXRETRY_MASK)
-
-/* Number of II perf. counters we can multiplex at once */
-
-#define IO_PERF_SETS   32
-
-/* Bit for the widget in inbound access register */
-#define IIO_IIWA_WIDGET(_w)    ((u64)(1ULL << _w))
-/* Bit for the widget in outbound access register */
-#define IIO_IOWA_WIDGET(_w)    ((u64)(1ULL << _w))
-
-/* NOTE: The following define assumes that we are going to get
- * widget numbers from 8 thru F and the device numbers within
- * widget from 0 thru 7.
- */
-#define IIO_IIDEM_WIDGETDEV_MASK(w, d) ((u64)(1ULL << (8 * ((w) - 8) + (d))))
-
-/* IO Interrupt Destination Register */
-#define IIO_IIDSR_SENT_SHIFT    28
-#define IIO_IIDSR_SENT_MASK     0x30000000
-#define IIO_IIDSR_ENB_SHIFT     24
-#define IIO_IIDSR_ENB_MASK      0x01000000
-#define IIO_IIDSR_NODE_SHIFT    9
-#define IIO_IIDSR_NODE_MASK     0x000ff700
-#define IIO_IIDSR_PI_ID_SHIFT   8
-#define IIO_IIDSR_PI_ID_MASK    0x00000100
-#define IIO_IIDSR_LVL_SHIFT     0
-#define IIO_IIDSR_LVL_MASK      0x000000ff
-
-/* Xtalk timeout threshhold register (IIO_IXTT) */
-#define IXTT_RRSP_TO_SHFT      55      /* read response timeout */
-#define IXTT_RRSP_TO_MASK      (0x1FULL << IXTT_RRSP_TO_SHFT)
-#define IXTT_RRSP_PS_SHFT      32      /* read responsed TO prescalar */
-#define IXTT_RRSP_PS_MASK      (0x7FFFFFULL << IXTT_RRSP_PS_SHFT)
-#define IXTT_TAIL_TO_SHFT      0       /* tail timeout counter threshold */
-#define IXTT_TAIL_TO_MASK      (0x3FFFFFFULL << IXTT_TAIL_TO_SHFT)
-
-/*
- * The IO LLP control status register and widget control register
- */
-
-typedef union hubii_wcr_u {
-       u64 wcr_reg_value;
-       struct {
-               u64 wcr_widget_id:4,    /* LLP crossbar credit */
-                wcr_tag_mode:1,        /* Tag mode */
-                wcr_rsvd1:8,   /* Reserved */
-                wcr_xbar_crd:3,        /* LLP crossbar credit */
-                wcr_f_bad_pkt:1,       /* Force bad llp pkt enable */
-                wcr_dir_con:1, /* widget direct connect */
-                wcr_e_thresh:5,        /* elasticity threshold */
-                wcr_rsvd:41;   /* unused */
-       } wcr_fields_s;
-} hubii_wcr_t;
-
-#define iwcr_dir_con    wcr_fields_s.wcr_dir_con
-
-/* The structures below are defined to extract and modify the ii
-performance registers */
-
-/* io_perf_sel allows the caller to specify what tests will be
-   performed */
-
-typedef union io_perf_sel {
-       u64 perf_sel_reg;
-       struct {
-               u64 perf_ippr0:4, perf_ippr1:4, perf_icct:8, perf_rsvd:48;
-       } perf_sel_bits;
-} io_perf_sel_t;
-
-/* io_perf_cnt is to extract the count from the shub registers. Due to
-   hardware problems there is only one counter, not two. */
-
-typedef union io_perf_cnt {
-       u64 perf_cnt;
-       struct {
-               u64 perf_cnt:20, perf_rsvd2:12, perf_rsvd1:32;
-       } perf_cnt_bits;
-
-} io_perf_cnt_t;
-
-typedef union iprte_a {
-       u64 entry;
-       struct {
-               u64 i_rsvd_1:3;
-               u64 i_addr:38;
-               u64 i_init:3;
-               u64 i_source:8;
-               u64 i_rsvd:2;
-               u64 i_widget:4;
-               u64 i_to_cnt:5;
-               u64 i_vld:1;
-       } iprte_fields;
-} iprte_a_t;
-
-#endif                         /* _ASM_IA64_SN_SHUBIO_H */
diff --git a/include/asm-ia64/sn/simulator.h b/include/asm-ia64/sn/simulator.h
deleted file mode 100644 (file)
index c2611f6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_SIMULATOR_H
-#define _ASM_IA64_SN_SIMULATOR_H
-
-#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_SGI_UV)
-#define SNMAGIC 0xaeeeeeee8badbeefL
-#define IS_MEDUSA()                    ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;})
-
-#define SIMULATOR_SLEEP()              asm("nop.i 0x8beef")
-#define IS_RUNNING_ON_SIMULATOR()      (sn_prom_type)
-#define IS_RUNNING_ON_FAKE_PROM()      (sn_prom_type == 2)
-extern int sn_prom_type;               /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
-#else
-#define IS_MEDUSA()                    0
-#define SIMULATOR_SLEEP()
-#define IS_RUNNING_ON_SIMULATOR()      0
-#endif
-
-#endif /* _ASM_IA64_SN_SIMULATOR_H */
diff --git a/include/asm-ia64/sn/sn2/sn_hwperf.h b/include/asm-ia64/sn/sn2/sn_hwperf.h
deleted file mode 100644 (file)
index e61ebac..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * 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) 2004 Silicon Graphics, Inc. All rights reserved.
- *
- * Data types used by the SN_SAL_HWPERF_OP SAL call for monitoring
- * SGI Altix node and router hardware
- *
- * Mark Goodwin <markgw@sgi.com> Mon Aug 30 12:23:46 EST 2004
- */
-
-#ifndef SN_HWPERF_H
-#define SN_HWPERF_H
-
-/*
- * object structure. SN_HWPERF_ENUM_OBJECTS and SN_HWPERF_GET_CPU_INFO
- * return an array of these. Do not change this without also
- * changing the corresponding SAL code.
- */
-#define SN_HWPERF_MAXSTRING            128
-struct sn_hwperf_object_info {
-       u32 id;
-       union {
-               struct {
-                       u64 this_part:1;
-                       u64 is_shared:1;
-               } fields;
-               struct {
-                       u64 flags;
-                       u64 reserved;
-               } b;
-       } f;
-       char name[SN_HWPERF_MAXSTRING];
-       char location[SN_HWPERF_MAXSTRING];
-       u32 ports;
-};
-
-#define sn_hwp_this_part       f.fields.this_part
-#define sn_hwp_is_shared       f.fields.is_shared
-#define sn_hwp_flags           f.b.flags
-
-/* macros for object classification */
-#define SN_HWPERF_IS_NODE(x)           ((x) && strstr((x)->name, "SHub"))
-#define SN_HWPERF_IS_NODE_SHUB2(x)     ((x) && strstr((x)->name, "SHub 2."))
-#define SN_HWPERF_IS_IONODE(x)         ((x) && strstr((x)->name, "TIO"))
-#define SN_HWPERF_IS_NL3ROUTER(x)      ((x) && strstr((x)->name, "NL3Router"))
-#define SN_HWPERF_IS_NL4ROUTER(x)      ((x) && strstr((x)->name, "NL4Router"))
-#define SN_HWPERF_IS_OLDROUTER(x)      ((x) && strstr((x)->name, "Router"))
-#define SN_HWPERF_IS_ROUTER(x)         (SN_HWPERF_IS_NL3ROUTER(x) ||           \
-                                               SN_HWPERF_IS_NL4ROUTER(x) ||    \
-                                               SN_HWPERF_IS_OLDROUTER(x))
-#define SN_HWPERF_FOREIGN(x)           ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared)
-#define SN_HWPERF_SAME_OBJTYPE(x,y)    ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\
-                                       (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\
-                                       (SN_HWPERF_IS_ROUTER(x) && SN_HWPERF_IS_ROUTER(y)))
-
-/* numa port structure, SN_HWPERF_ENUM_PORTS returns an array of these */
-struct sn_hwperf_port_info {
-       u32 port;
-       u32 conn_id;
-       u32 conn_port;
-};
-
-/* for HWPERF_{GET,SET}_MMRS */
-struct sn_hwperf_data {
-       u64 addr;
-       u64 data;
-};
-
-/* user ioctl() argument, see below */
-struct sn_hwperf_ioctl_args {
-        u64 arg;               /* argument, usually an object id */
-        u64 sz;                 /* size of transfer */
-        void *ptr;              /* pointer to source/target */
-        u32 v0;                        /* second return value */
-};
-
-/*
- * For SN_HWPERF_{GET,SET}_MMRS and SN_HWPERF_OBJECT_DISTANCE,
- * sn_hwperf_ioctl_args.arg can be used to specify a CPU on which
- * to call SAL, and whether to use an interprocessor interrupt
- * or task migration in order to do so. If the CPU specified is
- * SN_HWPERF_ARG_ANY_CPU, then the current CPU will be used.
- */
-#define SN_HWPERF_ARG_ANY_CPU          0x7fffffffUL
-#define SN_HWPERF_ARG_CPU_MASK         0x7fffffff00000000ULL
-#define SN_HWPERF_ARG_USE_IPI_MASK     0x8000000000000000ULL
-#define SN_HWPERF_ARG_OBJID_MASK       0x00000000ffffffffULL
-
-/* 
- * ioctl requests on the "sn_hwperf" misc device that call SAL.
- */
-#define SN_HWPERF_OP_MEM_COPYIN                0x1000
-#define SN_HWPERF_OP_MEM_COPYOUT       0x2000
-#define SN_HWPERF_OP_MASK              0x0fff
-
-/*
- * Determine mem requirement.
- * arg don't care
- * sz  8
- * p   pointer to u64 integer
- */
-#define        SN_HWPERF_GET_HEAPSIZE          1
-
-/*
- * Install mem for SAL drvr
- * arg don't care
- * sz  sizeof buffer pointed to by p
- * p   pointer to buffer for scratch area
- */
-#define SN_HWPERF_INSTALL_HEAP         2
-
-/*
- * Determine number of objects
- * arg don't care
- * sz  8
- * p   pointer to u64 integer
- */
-#define SN_HWPERF_OBJECT_COUNT         (10|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Determine object "distance", relative to a cpu. This operation can
- * execute on a designated logical cpu number, using either an IPI or
- * via task migration. If the cpu number is SN_HWPERF_ANY_CPU, then
- * the current CPU is used. See the SN_HWPERF_ARG_* macros above.
- *
- * arg bitmap of IPI flag, cpu number and object id
- * sz  8
- * p   pointer to u64 integer
- */
-#define SN_HWPERF_OBJECT_DISTANCE      (11|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Enumerate objects. Special case if sz == 8, returns the required
- * buffer size.
- * arg don't care
- * sz  sizeof buffer pointed to by p
- * p   pointer to array of struct sn_hwperf_object_info
- */
-#define SN_HWPERF_ENUM_OBJECTS         (12|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Enumerate NumaLink ports for an object. Special case if sz == 8,
- * returns the required buffer size.
- * arg object id
- * sz  sizeof buffer pointed to by p
- * p   pointer to array of struct sn_hwperf_port_info
- */
-#define SN_HWPERF_ENUM_PORTS           (13|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * SET/GET memory mapped registers. These operations can execute
- * on a designated logical cpu number, using either an IPI or via
- * task migration. If the cpu number is SN_HWPERF_ANY_CPU, then
- * the current CPU is used. See the SN_HWPERF_ARG_* macros above.
- *
- * arg bitmap of ipi flag, cpu number and object id
- * sz  sizeof buffer pointed to by p
- * p   pointer to array of struct sn_hwperf_data
- */
-#define SN_HWPERF_SET_MMRS             (14|SN_HWPERF_OP_MEM_COPYIN)
-#define SN_HWPERF_GET_MMRS             (15|SN_HWPERF_OP_MEM_COPYOUT| \
-                                           SN_HWPERF_OP_MEM_COPYIN)
-/*
- * Lock a shared object
- * arg object id
- * sz  don't care
- * p   don't care
- */
-#define SN_HWPERF_ACQUIRE              16
-
-/*
- * Unlock a shared object
- * arg object id
- * sz  don't care
- * p   don't care
- */
-#define SN_HWPERF_RELEASE              17
-
-/*
- * Break a lock on a shared object
- * arg object id
- * sz  don't care
- * p   don't care
- */
-#define SN_HWPERF_FORCE_RELEASE                18
-
-/*
- * ioctl requests on "sn_hwperf" that do not call SAL
- */
-
-/*
- * get cpu info as an array of hwperf_object_info_t. 
- * id is logical CPU number, name is description, location
- * is geoid (e.g. 001c04#1c). Special case if sz == 8,
- * returns the required buffer size.
- *
- * arg don't care
- * sz  sizeof buffer pointed to by p
- * p   pointer to array of struct sn_hwperf_object_info
- */
-#define SN_HWPERF_GET_CPU_INFO         (100|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Given an object id, return it's node number (aka cnode).
- * arg object id
- * sz  8
- * p   pointer to u64 integer
- */
-#define SN_HWPERF_GET_OBJ_NODE         (101|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Given a node number (cnode), return it's nasid.
- * arg ordinal node number (aka cnodeid)
- * sz  8
- * p   pointer to u64 integer
- */
-#define SN_HWPERF_GET_NODE_NASID       (102|SN_HWPERF_OP_MEM_COPYOUT)
-
-/*
- * Given a node id, determine the id of the nearest node with CPUs
- * and the id of the nearest node that has memory. The argument
- * node would normally be a "headless" node, e.g. an "IO node".
- * Return 0 on success.
- */
-extern int sn_hwperf_get_nearest_node(cnodeid_t node,
-       cnodeid_t *near_mem, cnodeid_t *near_cpu);
-
-/* return codes */
-#define SN_HWPERF_OP_OK                        0
-#define SN_HWPERF_OP_NOMEM             1
-#define SN_HWPERF_OP_NO_PERM           2
-#define SN_HWPERF_OP_IO_ERROR          3
-#define SN_HWPERF_OP_BUSY              4
-#define SN_HWPERF_OP_RECONFIGURE       253
-#define SN_HWPERF_OP_INVAL             254
-
-int sn_topology_open(struct inode *inode, struct file *file);
-int sn_topology_release(struct inode *inode, struct file *file);
-#endif                         /* SN_HWPERF_H */
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
deleted file mode 100644 (file)
index a676dd9..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/* 
- *
- * 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) 2000-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-
-#ifndef _ASM_IA64_SN_SN_CPUID_H
-#define _ASM_IA64_SN_SN_CPUID_H
-
-#include <linux/smp.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/pda.h>
-#include <asm/intrinsics.h>
-
-
-/*
- * Functions for converting between cpuids, nodeids and NASIDs.
- * 
- * These are for SGI platforms only.
- *
- */
-
-
-
-
-/*
- *  Definitions of terms (these definitions are for IA64 ONLY. Other architectures
- *  use cpuid/cpunum quite defferently):
- *
- *        CPUID - a number in range of 0..NR_CPUS-1 that uniquely identifies
- *             the cpu. The value cpuid has no significance on IA64 other than
- *             the boot cpu is 0.
- *                     smp_processor_id() returns the cpuid of the current cpu.
- *
- *        CPU_PHYSICAL_ID (also known as HARD_PROCESSOR_ID)
- *             This is the same as 31:24 of the processor LID register
- *                     hard_smp_processor_id()- cpu_physical_id of current processor
- *                     cpu_physical_id(cpuid) - convert a <cpuid> to a <physical_cpuid>
- *                     cpu_logical_id(phy_id) - convert a <physical_cpuid> to a <cpuid> 
- *                             * not real efficient - don't use in perf critical code
- *
- *         SLICE - a number in the range of 0 - 3 (typically) that represents the
- *             cpu number on a brick.
- *
- *        SUBNODE - (almost obsolete) the number of the FSB that a cpu is
- *             connected to. This is also the same as the PI number. Usually 0 or 1.
- *
- *     NOTE!!!: the value of the bits in the cpu physical id (SAPICid or LID) of a cpu has no 
- *     significance. The SAPIC id (LID) is a 16-bit cookie that has meaning only to the PROM.
- *
- *
- * The macros convert between cpu physical ids & slice/nasid/cnodeid.
- * These terms are described below:
- *
- *
- * Brick
- *          -----   -----           -----   -----       CPU
- *          | 0 |   | 1 |           | 0 |   | 1 |       SLICE
- *          -----   -----           -----   -----
- *            |       |               |       |
- *            |       |               |       |
- *          0 |       | 2           0 |       | 2       FSB SLOT
- *             -------                 -------  
- *                |                       |
- *                |                       |
- *                |                       |
- *             ------------      -------------
- *             |          |      |           |
- *             |    SHUB  |      |   SHUB    |        NASID   (0..MAX_NASIDS)
- *             |          |----- |           |        CNODEID (0..num_compact_nodes-1)
- *             |          |      |           |
- *             |          |      |           |
- *             ------------      -------------
- *                   |                 |
- *                           
- *
- */
-
-#define get_node_number(addr)                  NASID_GET(addr)
-
-/*
- * NOTE: on non-MP systems, only cpuid 0 exists
- */
-
-extern short physical_node_map[];      /* indexed by nasid to get cnode */
-
-/*
- * Macros for retrieving info about current cpu
- */
-#define get_nasid()    (sn_nodepda->phys_cpuid[smp_processor_id()].nasid)
-#define get_subnode()  (sn_nodepda->phys_cpuid[smp_processor_id()].subnode)
-#define get_slice()    (sn_nodepda->phys_cpuid[smp_processor_id()].slice)
-#define get_cnode()    (sn_nodepda->phys_cpuid[smp_processor_id()].cnode)
-#define get_sapicid()  ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
-
-/*
- * Macros for retrieving info about an arbitrary cpu
- *     cpuid - logical cpu id
- */
-#define cpuid_to_nasid(cpuid)          (sn_nodepda->phys_cpuid[cpuid].nasid)
-#define cpuid_to_subnode(cpuid)                (sn_nodepda->phys_cpuid[cpuid].subnode)
-#define cpuid_to_slice(cpuid)          (sn_nodepda->phys_cpuid[cpuid].slice)
-
-
-/*
- * Dont use the following in performance critical code. They require scans
- * of potentially large tables.
- */
-extern int nasid_slice_to_cpuid(int, int);
-
-/*
- * cnodeid_to_nasid - convert a cnodeid to a NASID
- */
-#define cnodeid_to_nasid(cnodeid)      (sn_cnodeid_to_nasid[cnodeid])
-/*
- * nasid_to_cnodeid - convert a NASID to a cnodeid
- */
-#define nasid_to_cnodeid(nasid)                (physical_node_map[nasid])
-
-/*
- * partition_coherence_id - get the coherence ID of the current partition
- */
-extern u8 sn_coherency_id;
-#define partition_coherence_id()       (sn_coherency_id)
-
-#endif /* _ASM_IA64_SN_SN_CPUID_H */
-
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h
deleted file mode 100644 (file)
index 8e83ac1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _ASM_IA64_SN_FEATURE_SETS_H
-#define _ASM_IA64_SN_FEATURE_SETS_H
-
-/*
- * SN PROM Features
- *
- * 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) 2005-2006 Silicon Graphics, Inc.  All rights reserved.
- */
-
-
-/* --------------------- PROM Features -----------------------------*/
-extern int sn_prom_feature_available(int id);
-
-#define MAX_PROM_FEATURE_SETS                  2
-
-/*
- * The following defines features that may or may not be supported by the
- * current PROM. The OS uses sn_prom_feature_available(feature) to test for
- * the presence of a PROM feature. Down rev (old) PROMs will always test
- * "false" for new features.
- *
- * Use:
- *             if (sn_prom_feature_available(PRF_XXX))
- *                     ...
- */
-
-#define PRF_PAL_CACHE_FLUSH_SAFE       0
-#define PRF_DEVICE_FLUSH_LIST          1
-#define PRF_HOTPLUG_SUPPORT            2
-#define PRF_CPU_DISABLE_SUPPORT                3
-
-/* --------------------- OS Features -------------------------------*/
-
-/*
- * The following defines OS features that are optionally present in
- * the operating system.
- * During boot, PROM is notified of these features via a series of calls:
- *
- *             ia64_sn_set_os_feature(feature1);
- *
- * Once enabled, a feature cannot be disabled.
- *
- * By default, features are disabled unless explicitly enabled.
- *
- * These defines must be kept in sync with the corresponding
- * PROM definitions in feature_sets.h.
- */
-#define  OSF_MCA_SLV_TO_OS_INIT_SLV    0
-#define  OSF_FEAT_LOG_SBES             1
-#define  OSF_ACPI_ENABLE               2
-#define  OSF_PCISEGMENT_ENABLE         3
-
-
-#endif /* _ASM_IA64_SN_FEATURE_SETS_H */
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
deleted file mode 100644 (file)
index 676b31a..0000000
+++ /dev/null
@@ -1,1188 +0,0 @@
-#ifndef _ASM_IA64_SN_SN_SAL_H
-#define _ASM_IA64_SN_SN_SAL_H
-
-/*
- * System Abstraction Layer definitions for IA64
- *
- * 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) 2000-2006 Silicon Graphics, Inc.  All rights reserved.
- */
-
-
-#include <asm/sal.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/arch.h>
-#include <asm/sn/geo.h>
-#include <asm/sn/nodepda.h>
-#include <asm/sn/shub_mmr.h>
-
-// SGI Specific Calls
-#define  SN_SAL_POD_MODE                           0x02000001
-#define  SN_SAL_SYSTEM_RESET                       0x02000002
-#define  SN_SAL_PROBE                              0x02000003
-#define  SN_SAL_GET_MASTER_NASID                   0x02000004
-#define         SN_SAL_GET_KLCONFIG_ADDR                  0x02000005
-#define  SN_SAL_LOG_CE                            0x02000006
-#define  SN_SAL_REGISTER_CE                       0x02000007
-#define  SN_SAL_GET_PARTITION_ADDR                0x02000009
-#define  SN_SAL_XP_ADDR_REGION                    0x0200000f
-#define  SN_SAL_NO_FAULT_ZONE_VIRTUAL             0x02000010
-#define  SN_SAL_NO_FAULT_ZONE_PHYSICAL            0x02000011
-#define  SN_SAL_PRINT_ERROR                       0x02000012
-#define  SN_SAL_REGISTER_PMI_HANDLER              0x02000014
-#define  SN_SAL_SET_ERROR_HANDLING_FEATURES       0x0200001a   // reentrant
-#define  SN_SAL_GET_FIT_COMPT                     0x0200001b   // reentrant
-#define  SN_SAL_GET_SAPIC_INFO                     0x0200001d
-#define  SN_SAL_GET_SN_INFO                        0x0200001e
-#define  SN_SAL_CONSOLE_PUTC                       0x02000021
-#define  SN_SAL_CONSOLE_GETC                       0x02000022
-#define  SN_SAL_CONSOLE_PUTS                       0x02000023
-#define  SN_SAL_CONSOLE_GETS                       0x02000024
-#define  SN_SAL_CONSOLE_GETS_TIMEOUT               0x02000025
-#define  SN_SAL_CONSOLE_POLL                       0x02000026
-#define  SN_SAL_CONSOLE_INTR                       0x02000027
-#define  SN_SAL_CONSOLE_PUTB                      0x02000028
-#define  SN_SAL_CONSOLE_XMIT_CHARS                0x0200002a
-#define  SN_SAL_CONSOLE_READC                     0x0200002b
-#define  SN_SAL_SYSCTL_OP                         0x02000030
-#define  SN_SAL_SYSCTL_MODID_GET                  0x02000031
-#define  SN_SAL_SYSCTL_GET                         0x02000032
-#define  SN_SAL_SYSCTL_IOBRICK_MODULE_GET          0x02000033
-#define  SN_SAL_SYSCTL_IO_PORTSPEED_GET            0x02000035
-#define  SN_SAL_SYSCTL_SLAB_GET                    0x02000036
-#define  SN_SAL_BUS_CONFIG                        0x02000037
-#define  SN_SAL_SYS_SERIAL_GET                    0x02000038
-#define  SN_SAL_PARTITION_SERIAL_GET              0x02000039
-#define  SN_SAL_SYSCTL_PARTITION_GET               0x0200003a
-#define  SN_SAL_SYSTEM_POWER_DOWN                 0x0200003b
-#define  SN_SAL_GET_MASTER_BASEIO_NASID                   0x0200003c
-#define  SN_SAL_COHERENCE                          0x0200003d
-#define  SN_SAL_MEMPROTECT                         0x0200003e
-#define  SN_SAL_SYSCTL_FRU_CAPTURE                0x0200003f
-
-#define  SN_SAL_SYSCTL_IOBRICK_PCI_OP             0x02000042   // reentrant
-#define         SN_SAL_IROUTER_OP                         0x02000043
-#define  SN_SAL_SYSCTL_EVENT                       0x02000044
-#define  SN_SAL_IOIF_INTERRUPT                    0x0200004a
-#define  SN_SAL_HWPERF_OP                         0x02000050   // lock
-#define  SN_SAL_IOIF_ERROR_INTERRUPT              0x02000051
-#define  SN_SAL_IOIF_PCI_SAFE                     0x02000052
-#define  SN_SAL_IOIF_SLOT_ENABLE                  0x02000053
-#define  SN_SAL_IOIF_SLOT_DISABLE                 0x02000054
-#define  SN_SAL_IOIF_GET_HUBDEV_INFO              0x02000055
-#define  SN_SAL_IOIF_GET_PCIBUS_INFO              0x02000056
-#define  SN_SAL_IOIF_GET_PCIDEV_INFO              0x02000057
-#define  SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST     0x02000058   // deprecated
-#define  SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST     0x0200005a
-
-#define SN_SAL_IOIF_INIT                          0x0200005f
-#define SN_SAL_HUB_ERROR_INTERRUPT                0x02000060
-#define SN_SAL_BTE_RECOVER                        0x02000061
-#define SN_SAL_RESERVED_DO_NOT_USE                0x02000062
-#define SN_SAL_IOIF_GET_PCI_TOPOLOGY              0x02000064
-
-#define  SN_SAL_GET_PROM_FEATURE_SET              0x02000065
-#define  SN_SAL_SET_OS_FEATURE_SET                0x02000066
-#define  SN_SAL_INJECT_ERROR                      0x02000067
-#define  SN_SAL_SET_CPU_NUMBER                    0x02000068
-
-#define  SN_SAL_KERNEL_LAUNCH_EVENT               0x02000069
-
-/*
- * Service-specific constants
- */
-
-/* Console interrupt manipulation */
-       /* action codes */
-#define SAL_CONSOLE_INTR_OFF    0       /* turn the interrupt off */
-#define SAL_CONSOLE_INTR_ON     1       /* turn the interrupt on */
-#define SAL_CONSOLE_INTR_STATUS 2      /* retrieve the interrupt status */
-       /* interrupt specification & status return codes */
-#define SAL_CONSOLE_INTR_XMIT  1       /* output interrupt */
-#define SAL_CONSOLE_INTR_RECV  2       /* input interrupt */
-
-/* interrupt handling */
-#define SAL_INTR_ALLOC         1
-#define SAL_INTR_FREE          2
-#define SAL_INTR_REDIRECT      3
-
-/*
- * operations available on the generic SN_SAL_SYSCTL_OP
- * runtime service
- */
-#define SAL_SYSCTL_OP_IOBOARD          0x0001  /*  retrieve board type */
-#define SAL_SYSCTL_OP_TIO_JLCK_RST      0x0002  /* issue TIO clock reset */
-
-/*
- * IRouter (i.e. generalized system controller) operations
- */
-#define SAL_IROUTER_OPEN       0       /* open a subchannel */
-#define SAL_IROUTER_CLOSE      1       /* close a subchannel */
-#define SAL_IROUTER_SEND       2       /* send part of an IRouter packet */
-#define SAL_IROUTER_RECV       3       /* receive part of an IRouter packet */
-#define SAL_IROUTER_INTR_STATUS        4       /* check the interrupt status for
-                                        * an open subchannel
-                                        */
-#define SAL_IROUTER_INTR_ON    5       /* enable an interrupt */
-#define SAL_IROUTER_INTR_OFF   6       /* disable an interrupt */
-#define SAL_IROUTER_INIT       7       /* initialize IRouter driver */
-
-/* IRouter interrupt mask bits */
-#define SAL_IROUTER_INTR_XMIT  SAL_CONSOLE_INTR_XMIT
-#define SAL_IROUTER_INTR_RECV  SAL_CONSOLE_INTR_RECV
-
-/*
- * Error Handling Features
- */
-#define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV    0x1     // obsolete
-#define SAL_ERR_FEAT_LOG_SBES                  0x2     // obsolete
-#define SAL_ERR_FEAT_MFR_OVERRIDE              0x4
-#define SAL_ERR_FEAT_SBE_THRESHOLD             0xffff0000
-
-/*
- * SAL Error Codes
- */
-#define SALRET_MORE_PASSES     1
-#define SALRET_OK              0
-#define SALRET_NOT_IMPLEMENTED (-1)
-#define SALRET_INVALID_ARG     (-2)
-#define SALRET_ERROR           (-3)
-
-#define SN_SAL_FAKE_PROM                          0x02009999
-
-/**
-  * sn_sal_revision - get the SGI SAL revision number
-  *
-  * The SGI PROM stores its version in the sal_[ab]_rev_(major|minor).
-  * This routine simply extracts the major and minor values and
-  * presents them in a u32 format.
-  *
-  * For example, version 4.05 would be represented at 0x0405.
-  */
-static inline u32
-sn_sal_rev(void)
-{
-       struct ia64_sal_systab *systab = __va(efi.sal_systab);
-
-       return (u32)(systab->sal_b_rev_major << 8 | systab->sal_b_rev_minor);
-}
-
-/*
- * Returns the master console nasid, if the call fails, return an illegal
- * value.
- */
-static inline u64
-ia64_sn_get_console_nasid(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL(ret_stuff, SN_SAL_GET_MASTER_NASID, 0, 0, 0, 0, 0, 0, 0);
-
-       if (ret_stuff.status < 0)
-               return ret_stuff.status;
-
-       /* Master console nasid is in 'v0' */
-       return ret_stuff.v0;
-}
-
-/*
- * Returns the master baseio nasid, if the call fails, return an illegal
- * value.
- */
-static inline u64
-ia64_sn_get_master_baseio_nasid(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL(ret_stuff, SN_SAL_GET_MASTER_BASEIO_NASID, 0, 0, 0, 0, 0, 0, 0);
-
-       if (ret_stuff.status < 0)
-               return ret_stuff.status;
-
-       /* Master baseio nasid is in 'v0' */
-       return ret_stuff.v0;
-}
-
-static inline void *
-ia64_sn_get_klconfig_addr(nasid_t nasid)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
-       return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
-}
-
-/*
- * Returns the next console character.
- */
-static inline u64
-ia64_sn_console_getc(int *ch)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_GETC, 0, 0, 0, 0, 0, 0, 0);
-
-       /* character is in 'v0' */
-       *ch = (int)ret_stuff.v0;
-
-       return ret_stuff.status;
-}
-
-/*
- * Read a character from the SAL console device, after a previous interrupt
- * or poll operation has given us to know that a character is available
- * to be read.
- */
-static inline u64
-ia64_sn_console_readc(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_READC, 0, 0, 0, 0, 0, 0, 0);
-
-       /* character is in 'v0' */
-       return ret_stuff.v0;
-}
-
-/*
- * Sends the given character to the console.
- */
-static inline u64
-ia64_sn_console_putc(char ch)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_PUTC, (u64)ch, 0, 0, 0, 0, 0, 0);
-
-       return ret_stuff.status;
-}
-
-/*
- * Sends the given buffer to the console.
- */
-static inline u64
-ia64_sn_console_putb(const char *buf, int len)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0; 
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_PUTB, (u64)buf, (u64)len, 0, 0, 0, 0, 0);
-
-       if ( ret_stuff.status == 0 ) {
-               return ret_stuff.v0;
-       }
-       return (u64)0;
-}
-
-/*
- * Print a platform error record
- */
-static inline u64
-ia64_sn_plat_specific_err_print(int (*hook)(const char*, ...), char *rec)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_REENTRANT(ret_stuff, SN_SAL_PRINT_ERROR, (u64)hook, (u64)rec, 0, 0, 0, 0, 0);
-
-       return ret_stuff.status;
-}
-
-/*
- * Check for Platform errors
- */
-static inline u64
-ia64_sn_plat_cpei_handler(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_LOG_CE, 0, 0, 0, 0, 0, 0, 0);
-
-       return ret_stuff.status;
-}
-
-/*
- * Set Error Handling Features (Obsolete)
- */
-static inline u64
-ia64_sn_plat_set_error_handling_features(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES,
-               SAL_ERR_FEAT_LOG_SBES,
-               0, 0, 0, 0, 0, 0);
-
-       return ret_stuff.status;
-}
-
-/*
- * Checks for console input.
- */
-static inline u64
-ia64_sn_console_check(int *result)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_POLL, 0, 0, 0, 0, 0, 0, 0);
-
-       /* result is in 'v0' */
-       *result = (int)ret_stuff.v0;
-
-       return ret_stuff.status;
-}
-
-/*
- * Checks console interrupt status
- */
-static inline u64
-ia64_sn_console_intr_status(void)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
-                0, SAL_CONSOLE_INTR_STATUS,
-                0, 0, 0, 0, 0);
-
-       if (ret_stuff.status == 0) {
-           return ret_stuff.v0;
-       }
-       
-       return 0;
-}
-
-/*
- * Enable an interrupt on the SAL console device.
- */
-static inline void
-ia64_sn_console_intr_enable(u64 intr)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
-                intr, SAL_CONSOLE_INTR_ON,
-                0, 0, 0, 0, 0);
-}
-
-/*
- * Disable an interrupt on the SAL console device.
- */
-static inline void
-ia64_sn_console_intr_disable(u64 intr)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_INTR, 
-                intr, SAL_CONSOLE_INTR_OFF,
-                0, 0, 0, 0, 0);
-}
-
-/*
- * Sends a character buffer to the console asynchronously.
- */
-static inline u64
-ia64_sn_console_xmit_chars(char *buf, int len)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_CONSOLE_XMIT_CHARS,
-                (u64)buf, (u64)len,
-                0, 0, 0, 0, 0);
-
-       if (ret_stuff.status == 0) {
-           return ret_stuff.v0;
-       }
-
-       return 0;
-}
-
-/*
- * Returns the iobrick module Id
- */
-static inline u64
-ia64_sn_sysctl_iobrick_module_get(nasid_t nasid, int *result)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SYSCTL_IOBRICK_MODULE_GET, nasid, 0, 0, 0, 0, 0, 0);
-
-       /* result is in 'v0' */
-       *result = (int)ret_stuff.v0;
-
-       return ret_stuff.status;
-}
-
-/**
- * ia64_sn_pod_mode - call the SN_SAL_POD_MODE function
- *
- * SN_SAL_POD_MODE actually takes an argument, but it's always
- * 0 when we call it from the kernel, so we don't have to expose
- * it to the caller.
- */
-static inline u64
-ia64_sn_pod_mode(void)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_REENTRANT(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0);
-       if (isrv.status)
-               return 0;
-       return isrv.v0;
-}
-
-/**
- * ia64_sn_probe_mem - read from memory safely
- * @addr: address to probe
- * @size: number bytes to read (1,2,4,8)
- * @data_ptr: address to store value read by probe (-1 returned if probe fails)
- *
- * Call into the SAL to do a memory read.  If the read generates a machine
- * check, this routine will recover gracefully and return -1 to the caller.
- * @addr is usually a kernel virtual address in uncached space (i.e. the
- * address starts with 0xc), but if called in physical mode, @addr should
- * be a physical address.
- *
- * Return values:
- *  0 - probe successful
- *  1 - probe failed (generated MCA)
- *  2 - Bad arg
- * <0 - PAL error
- */
-static inline u64
-ia64_sn_probe_mem(long addr, long size, void *data_ptr)
-{
-       struct ia64_sal_retval isrv;
-
-       SAL_CALL(isrv, SN_SAL_PROBE, addr, size, 0, 0, 0, 0, 0);
-
-       if (data_ptr) {
-               switch (size) {
-               case 1:
-                       *((u8*)data_ptr) = (u8)isrv.v0;
-                       break;
-               case 2:
-                       *((u16*)data_ptr) = (u16)isrv.v0;
-                       break;
-               case 4:
-                       *((u32*)data_ptr) = (u32)isrv.v0;
-                       break;
-               case 8:
-                       *((u64*)data_ptr) = (u64)isrv.v0;
-                       break;
-               default:
-                       isrv.status = 2;
-               }
-       }
-       return isrv.status;
-}
-
-/*
- * Retrieve the system serial number as an ASCII string.
- */
-static inline u64
-ia64_sn_sys_serial_get(char *buf)
-{
-       struct ia64_sal_retval ret_stuff;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SYS_SERIAL_GET, buf, 0, 0, 0, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-extern char sn_system_serial_number_string[];
-extern u64 sn_partition_serial_number;
-
-static inline char *
-sn_system_serial_number(void) {
-       if (sn_system_serial_number_string[0]) {
-               return(sn_system_serial_number_string);
-       } else {
-               ia64_sn_sys_serial_get(sn_system_serial_number_string);
-               return(sn_system_serial_number_string);
-       }
-}
-       
-
-/*
- * Returns a unique id number for this system and partition (suitable for
- * use with license managers), based in part on the system serial number.
- */
-static inline u64
-ia64_sn_partition_serial_get(void)
-{
-       struct ia64_sal_retval ret_stuff;
-       ia64_sal_oemcall_reentrant(&ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0,
-                                  0, 0, 0, 0, 0, 0);
-       if (ret_stuff.status != 0)
-           return 0;
-       return ret_stuff.v0;
-}
-
-static inline u64
-sn_partition_serial_number_val(void) {
-       if (unlikely(sn_partition_serial_number == 0)) {
-               sn_partition_serial_number = ia64_sn_partition_serial_get();
-       }
-       return sn_partition_serial_number;
-}
-
-/*
- * Returns the partition id of the nasid passed in as an argument,
- * or INVALID_PARTID if the partition id cannot be retrieved.
- */
-static inline partid_t
-ia64_sn_sysctl_partition_get(nasid_t nasid)
-{
-       struct ia64_sal_retval ret_stuff;
-       SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid,
-               0, 0, 0, 0, 0, 0);
-       if (ret_stuff.status != 0)
-           return -1;
-       return ((partid_t)ret_stuff.v0);
-}
-
-/*
- * Returns the physical address of the partition's reserved page through
- * an iterative number of calls.
- *
- * On first call, 'cookie' and 'len' should be set to 0, and 'addr'
- * set to the nasid of the partition whose reserved page's address is
- * being sought.
- * On subsequent calls, pass the values, that were passed back on the
- * previous call.
- *
- * While the return status equals SALRET_MORE_PASSES, keep calling
- * this function after first copying 'len' bytes starting at 'addr'
- * into 'buf'. Once the return status equals SALRET_OK, 'addr' will
- * be the physical address of the partition's reserved page. If the
- * return status equals neither of these, an error as occurred.
- */
-static inline s64
-sn_partition_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len)
-{
-       struct ia64_sal_retval rv;
-       ia64_sal_oemcall_reentrant(&rv, SN_SAL_GET_PARTITION_ADDR, *cookie,
-                                  *addr, buf, *len, 0, 0, 0);
-       *cookie = rv.v0;
-       *addr = rv.v1;
-       *len = rv.v2;
-       return rv.status;
-}
-
-/*
- * Register or unregister a physical address range being referenced across
- * a partition boundary for which certain SAL errors should be scanned for,
- * cleaned up and ignored.  This is of value for kernel partitioning code only.
- * Values for the operation argument:
- *     1 = register this address range with SAL
- *     0 = unregister this address range with SAL
- * 
- * SAL maintains a reference count on an address range in case it is registered
- * multiple times.
- * 
- * On success, returns the reference count of the address range after the SAL
- * call has performed the current registration/unregistration.  Returns a
- * negative value if an error occurred.
- */
-static inline int
-sn_register_xp_addr_region(u64 paddr, u64 len, int operation)
-{
-       struct ia64_sal_retval ret_stuff;
-       ia64_sal_oemcall(&ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len,
-                        (u64)operation, 0, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-/*
- * Register or unregister an instruction range for which SAL errors should
- * be ignored.  If an error occurs while in the registered range, SAL jumps
- * to return_addr after ignoring the error.  Values for the operation argument:
- *     1 = register this instruction range with SAL
- *     0 = unregister this instruction range with SAL
- *
- * Returns 0 on success, or a negative value if an error occurred.
- */
-static inline int
-sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr,
-                        int virtual, int operation)
-{
-       struct ia64_sal_retval ret_stuff;
-       u64 call;
-       if (virtual) {
-               call = SN_SAL_NO_FAULT_ZONE_VIRTUAL;
-       } else {
-               call = SN_SAL_NO_FAULT_ZONE_PHYSICAL;
-       }
-       ia64_sal_oemcall(&ret_stuff, call, start_addr, end_addr, return_addr,
-                        (u64)1, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-/*
- * Register or unregister a function to handle a PMI received by a CPU.
- * Before calling the registered handler, SAL sets r1 to the value that
- * was passed in as the global_pointer.
- *
- * If the handler pointer is NULL, then the currently registered handler
- * will be unregistered.
- *
- * Returns 0 on success, or a negative value if an error occurred.
- */
-static inline int
-sn_register_pmi_handler(u64 handler, u64 global_pointer)
-{
-       struct ia64_sal_retval ret_stuff;
-       ia64_sal_oemcall(&ret_stuff, SN_SAL_REGISTER_PMI_HANDLER, handler,
-                        global_pointer, 0, 0, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-/*
- * Change or query the coherence domain for this partition. Each cpu-based
- * nasid is represented by a bit in an array of 64-bit words:
- *      0 = not in this partition's coherency domain
- *      1 = in this partition's coherency domain
- *
- * It is not possible for the local system's nasids to be removed from
- * the coherency domain.  Purpose of the domain arguments:
- *      new_domain = set the coherence domain to the given nasids
- *      old_domain = return the current coherence domain
- *
- * Returns 0 on success, or a negative value if an error occurred.
- */
-static inline int
-sn_change_coherence(u64 *new_domain, u64 *old_domain)
-{
-       struct ia64_sal_retval ret_stuff;
-       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
-                               (u64)old_domain, 0, 0, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-/*
- * Change memory access protections for a physical address range.
- * nasid_array is not used on Altix, but may be in future architectures.
- * Available memory protection access classes are defined after the function.
- */
-static inline int
-sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
-                               (u64)nasid_array, perms, 0, 0, 0);
-       return ret_stuff.status;
-}
-#define SN_MEMPROT_ACCESS_CLASS_0              0x14a080
-#define SN_MEMPROT_ACCESS_CLASS_1              0x2520c2
-#define SN_MEMPROT_ACCESS_CLASS_2              0x14a1ca
-#define SN_MEMPROT_ACCESS_CLASS_3              0x14a290
-#define SN_MEMPROT_ACCESS_CLASS_6              0x084080
-#define SN_MEMPROT_ACCESS_CLASS_7              0x021080
-
-/*
- * Turns off system power.
- */
-static inline void
-ia64_sn_power_down(void)
-{
-       struct ia64_sal_retval ret_stuff;
-       SAL_CALL(ret_stuff, SN_SAL_SYSTEM_POWER_DOWN, 0, 0, 0, 0, 0, 0, 0);
-       while(1)
-               cpu_relax();
-       /* never returns */
-}
-
-/**
- * ia64_sn_fru_capture - tell the system controller to capture hw state
- *
- * This routine will call the SAL which will tell the system controller(s)
- * to capture hw mmr information from each SHub in the system.
- */
-static inline u64
-ia64_sn_fru_capture(void)
-{
-        struct ia64_sal_retval isrv;
-        SAL_CALL(isrv, SN_SAL_SYSCTL_FRU_CAPTURE, 0, 0, 0, 0, 0, 0, 0);
-        if (isrv.status)
-                return 0;
-        return isrv.v0;
-}
-
-/*
- * Performs an operation on a PCI bus or slot -- power up, power down
- * or reset.
- */
-static inline u64
-ia64_sn_sysctl_iobrick_pci_op(nasid_t n, u64 connection_type, 
-                             u64 bus, char slot, 
-                             u64 action)
-{
-       struct ia64_sal_retval rv = {0, 0, 0, 0};
-
-       SAL_CALL_NOLOCK(rv, SN_SAL_SYSCTL_IOBRICK_PCI_OP, connection_type, n, action,
-                bus, (u64) slot, 0, 0);
-       if (rv.status)
-               return rv.v0;
-       return 0;
-}
-
-
-/*
- * Open a subchannel for sending arbitrary data to the system
- * controller network via the system controller device associated with
- * 'nasid'.  Return the subchannel number or a negative error code.
- */
-static inline int
-ia64_sn_irtr_open(nasid_t nasid)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_OPEN, nasid,
-                          0, 0, 0, 0, 0);
-       return (int) rv.v0;
-}
-
-/*
- * Close system controller subchannel 'subch' previously opened on 'nasid'.
- */
-static inline int
-ia64_sn_irtr_close(nasid_t nasid, int subch)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_CLOSE,
-                          (u64) nasid, (u64) subch, 0, 0, 0, 0);
-       return (int) rv.status;
-}
-
-/*
- * Read data from system controller associated with 'nasid' on
- * subchannel 'subch'.  The buffer to be filled is pointed to by
- * 'buf', and its capacity is in the integer pointed to by 'len'.  The
- * referent of 'len' is set to the number of bytes read by the SAL
- * call.  The return value is either SALRET_OK (for bytes read) or
- * SALRET_ERROR (for error or "no data available").
- */
-static inline int
-ia64_sn_irtr_recv(nasid_t nasid, int subch, char *buf, int *len)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_RECV,
-                          (u64) nasid, (u64) subch, (u64) buf, (u64) len,
-                          0, 0);
-       return (int) rv.status;
-}
-
-/*
- * Write data to the system controller network via the system
- * controller associated with 'nasid' on suchannel 'subch'.  The
- * buffer to be written out is pointed to by 'buf', and 'len' is the
- * number of bytes to be written.  The return value is either the
- * number of bytes written (which could be zero) or a negative error
- * code.
- */
-static inline int
-ia64_sn_irtr_send(nasid_t nasid, int subch, char *buf, int len)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_SEND,
-                          (u64) nasid, (u64) subch, (u64) buf, (u64) len,
-                          0, 0);
-       return (int) rv.v0;
-}
-
-/*
- * Check whether any interrupts are pending for the system controller
- * associated with 'nasid' and its subchannel 'subch'.  The return
- * value is a mask of pending interrupts (SAL_IROUTER_INTR_XMIT and/or
- * SAL_IROUTER_INTR_RECV).
- */
-static inline int
-ia64_sn_irtr_intr(nasid_t nasid, int subch)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_STATUS,
-                          (u64) nasid, (u64) subch, 0, 0, 0, 0);
-       return (int) rv.v0;
-}
-
-/*
- * Enable the interrupt indicated by the intr parameter (either
- * SAL_IROUTER_INTR_XMIT or SAL_IROUTER_INTR_RECV).
- */
-static inline int
-ia64_sn_irtr_intr_enable(nasid_t nasid, int subch, u64 intr)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_ON,
-                          (u64) nasid, (u64) subch, intr, 0, 0, 0);
-       return (int) rv.v0;
-}
-
-/*
- * Disable the interrupt indicated by the intr parameter (either
- * SAL_IROUTER_INTR_XMIT or SAL_IROUTER_INTR_RECV).
- */
-static inline int
-ia64_sn_irtr_intr_disable(nasid_t nasid, int subch, u64 intr)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_OFF,
-                          (u64) nasid, (u64) subch, intr, 0, 0, 0);
-       return (int) rv.v0;
-}
-
-/*
- * Set up a node as the point of contact for system controller
- * environmental event delivery.
- */
-static inline int
-ia64_sn_sysctl_event_init(nasid_t nasid)
-{
-        struct ia64_sal_retval rv;
-        SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_EVENT, (u64) nasid,
-                          0, 0, 0, 0, 0, 0);
-        return (int) rv.v0;
-}
-
-/*
- * Ask the system controller on the specified nasid to reset
- * the CX corelet clock.  Only valid on TIO nodes.
- */
-static inline int
-ia64_sn_sysctl_tio_clock_reset(nasid_t nasid)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_TIO_JLCK_RST,
-                       nasid, 0, 0, 0, 0, 0);
-       if (rv.status != 0)
-               return (int)rv.status;
-       if (rv.v0 != 0)
-               return (int)rv.v0;
-
-       return 0;
-}
-
-/*
- * Get the associated ioboard type for a given nasid.
- */
-static inline s64
-ia64_sn_sysctl_ioboard_get(nasid_t nasid, u16 *ioboard)
-{
-       struct ia64_sal_retval isrv;
-       SAL_CALL_REENTRANT(isrv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD,
-                          nasid, 0, 0, 0, 0, 0);
-       if (isrv.v0 != 0) {
-               *ioboard = isrv.v0;
-               return isrv.status;
-       }
-       if (isrv.v1 != 0) {
-               *ioboard = isrv.v1;
-               return isrv.status;
-       }
-
-       return isrv.status;
-}
-
-/**
- * ia64_sn_get_fit_compt - read a FIT entry from the PROM header
- * @nasid: NASID of node to read
- * @index: FIT entry index to be retrieved (0..n)
- * @fitentry: 16 byte buffer where FIT entry will be stored.
- * @banbuf: optional buffer for retrieving banner
- * @banlen: length of banner buffer
- *
- * Access to the physical PROM chips needs to be serialized since reads and
- * writes can't occur at the same time, so we need to call into the SAL when
- * we want to look at the FIT entries on the chips.
- *
- * Returns:
- *     %SALRET_OK if ok
- *     %SALRET_INVALID_ARG if index too big
- *     %SALRET_NOT_IMPLEMENTED if running on older PROM
- *     ??? if nasid invalid OR banner buffer not large enough
- */
-static inline int
-ia64_sn_get_fit_compt(u64 nasid, u64 index, void *fitentry, void *banbuf,
-                     u64 banlen)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_NOLOCK(rv, SN_SAL_GET_FIT_COMPT, nasid, index, fitentry,
-                       banbuf, banlen, 0, 0);
-       return (int) rv.status;
-}
-
-/*
- * Initialize the SAL components of the system controller
- * communication driver; specifically pass in a sizable buffer that
- * can be used for allocation of subchannel queues as new subchannels
- * are opened.  "buf" points to the buffer, and "len" specifies its
- * length.
- */
-static inline int
-ia64_sn_irtr_init(nasid_t nasid, void *buf, int len)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INIT,
-                          (u64) nasid, (u64) buf, (u64) len, 0, 0, 0);
-       return (int) rv.status;
-}
-
-/*
- * Returns the nasid, subnode & slice corresponding to a SAPIC ID
- *
- *  In:
- *     arg0 - SN_SAL_GET_SAPIC_INFO
- *     arg1 - sapicid (lid >> 16) 
- *  Out:
- *     v0 - nasid
- *     v1 - subnode
- *     v2 - slice
- */
-static inline u64
-ia64_sn_get_sapic_info(int sapicid, int *nasid, int *subnode, int *slice)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SAPIC_INFO, sapicid, 0, 0, 0, 0, 0, 0);
-
-/***** BEGIN HACK - temp til old proms no longer supported ********/
-       if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) {
-               if (nasid) *nasid = sapicid & 0xfff;
-               if (subnode) *subnode = (sapicid >> 13) & 1;
-               if (slice) *slice = (sapicid >> 12) & 3;
-               return 0;
-       }
-/***** END HACK *******/
-
-       if (ret_stuff.status < 0)
-               return ret_stuff.status;
-
-       if (nasid) *nasid = (int) ret_stuff.v0;
-       if (subnode) *subnode = (int) ret_stuff.v1;
-       if (slice) *slice = (int) ret_stuff.v2;
-       return 0;
-}
-/*
- * Returns information about the HUB/SHUB.
- *  In:
- *     arg0 - SN_SAL_GET_SN_INFO
- *     arg1 - 0 (other values reserved for future use)
- *  Out:
- *     v0 
- *             [7:0]   - shub type (0=shub1, 1=shub2)
- *             [15:8]  - Log2 max number of nodes in entire system (includes
- *                       C-bricks, I-bricks, etc)
- *             [23:16] - Log2 of nodes per sharing domain                       
- *             [31:24] - partition ID
- *             [39:32] - coherency_id
- *             [47:40] - regionsize
- *     v1 
- *             [15:0]  - nasid mask (ex., 0x7ff for 11 bit nasid)
- *             [23:15] - bit position of low nasid bit
- */
-static inline u64
-ia64_sn_get_sn_info(int fc, u8 *shubtype, u16 *nasid_bitmask, u8 *nasid_shift, 
-               u8 *systemsize, u8 *sharing_domain_size, u8 *partid, u8 *coher, u8 *reg)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-       ret_stuff.v1 = 0;
-       ret_stuff.v2 = 0;
-       SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO, fc, 0, 0, 0, 0, 0, 0);
-
-/***** BEGIN HACK - temp til old proms no longer supported ********/
-       if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) {
-               int nasid = get_sapicid() & 0xfff;
-#define SH_SHUB_ID_NODES_PER_BIT_MASK 0x001f000000000000UL
-#define SH_SHUB_ID_NODES_PER_BIT_SHFT 48
-               if (shubtype) *shubtype = 0;
-               if (nasid_bitmask) *nasid_bitmask = 0x7ff;
-               if (nasid_shift) *nasid_shift = 38;
-               if (systemsize) *systemsize = 10;
-               if (sharing_domain_size) *sharing_domain_size = 8;
-               if (partid) *partid = ia64_sn_sysctl_partition_get(nasid);
-               if (coher) *coher = nasid >> 9;
-               if (reg) *reg = (HUB_L((u64 *) LOCAL_MMR_ADDR(SH1_SHUB_ID)) & SH_SHUB_ID_NODES_PER_BIT_MASK) >>
-                       SH_SHUB_ID_NODES_PER_BIT_SHFT;
-               return 0;
-       }
-/***** END HACK *******/
-
-       if (ret_stuff.status < 0)
-               return ret_stuff.status;
-
-       if (shubtype) *shubtype = ret_stuff.v0 & 0xff;
-       if (systemsize) *systemsize = (ret_stuff.v0 >> 8) & 0xff;
-       if (sharing_domain_size) *sharing_domain_size = (ret_stuff.v0 >> 16) & 0xff;
-       if (partid) *partid = (ret_stuff.v0 >> 24) & 0xff;
-       if (coher) *coher = (ret_stuff.v0 >> 32) & 0xff;
-       if (reg) *reg = (ret_stuff.v0 >> 40) & 0xff;
-       if (nasid_bitmask) *nasid_bitmask = (ret_stuff.v1 & 0xffff);
-       if (nasid_shift) *nasid_shift = (ret_stuff.v1 >> 16) & 0xff;
-       return 0;
-}
-/*
- * This is the access point to the Altix PROM hardware performance
- * and status monitoring interface. For info on using this, see
- * include/asm-ia64/sn/sn2/sn_hwperf.h
- */
-static inline int
-ia64_sn_hwperf_op(nasid_t nasid, u64 opcode, u64 a0, u64 a1, u64 a2,
-                  u64 a3, u64 a4, int *v0)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_NOLOCK(rv, SN_SAL_HWPERF_OP, (u64)nasid,
-               opcode, a0, a1, a2, a3, a4);
-       if (v0)
-               *v0 = (int) rv.v0;
-       return (int) rv.status;
-}
-
-static inline int
-ia64_sn_ioif_get_pci_topology(u64 buf, u64 len)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_NOLOCK(rv, SN_SAL_IOIF_GET_PCI_TOPOLOGY, buf, len, 0, 0, 0, 0, 0);
-       return (int) rv.status;
-}
-
-/*
- * BTE error recovery is implemented in SAL
- */
-static inline int
-ia64_sn_bte_recovery(nasid_t nasid)
-{
-       struct ia64_sal_retval rv;
-
-       rv.status = 0;
-       SAL_CALL_NOLOCK(rv, SN_SAL_BTE_RECOVER, (u64)nasid, 0, 0, 0, 0, 0, 0);
-       if (rv.status == SALRET_NOT_IMPLEMENTED)
-               return 0;
-       return (int) rv.status;
-}
-
-static inline int
-ia64_sn_is_fake_prom(void)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_NOLOCK(rv, SN_SAL_FAKE_PROM, 0, 0, 0, 0, 0, 0, 0);
-       return (rv.status == 0);
-}
-
-static inline int
-ia64_sn_get_prom_feature_set(int set, unsigned long *feature_set)
-{
-       struct ia64_sal_retval rv;
-
-       SAL_CALL_NOLOCK(rv, SN_SAL_GET_PROM_FEATURE_SET, set, 0, 0, 0, 0, 0, 0);
-       if (rv.status != 0)
-               return rv.status;
-       *feature_set = rv.v0;
-       return 0;
-}
-
-static inline int
-ia64_sn_set_os_feature(int feature)
-{
-       struct ia64_sal_retval rv;
-
-       SAL_CALL_NOLOCK(rv, SN_SAL_SET_OS_FEATURE_SET, feature, 0, 0, 0, 0, 0, 0);
-       return rv.status;
-}
-
-static inline int
-sn_inject_error(u64 paddr, u64 *data, u64 *ecc)
-{
-       struct ia64_sal_retval ret_stuff;
-
-       ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data,
-                               (u64)ecc, 0, 0, 0, 0);
-       return ret_stuff.status;
-}
-
-static inline int
-ia64_sn_set_cpu_number(int cpu)
-{
-       struct ia64_sal_retval rv;
-
-       SAL_CALL_NOLOCK(rv, SN_SAL_SET_CPU_NUMBER, cpu, 0, 0, 0, 0, 0, 0);
-       return rv.status;
-}
-static inline int
-ia64_sn_kernel_launch_event(void)
-{
-       struct ia64_sal_retval rv;
-       SAL_CALL_NOLOCK(rv, SN_SAL_KERNEL_LAUNCH_EVENT, 0, 0, 0, 0, 0, 0, 0);
-       return rv.status;
-}
-#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/sn/tioca.h b/include/asm-ia64/sn/tioca.h
deleted file mode 100644 (file)
index 666222d..0000000
+++ /dev/null
@@ -1,596 +0,0 @@
-#ifndef _ASM_IA64_SN_TIO_TIOCA_H
-#define _ASM_IA64_SN_TIO_TIOCA_H
-
-/*
- * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-
-#define TIOCA_PART_NUM 0xE020
-#define TIOCA_MFGR_NUM 0x24
-#define TIOCA_REV_A    0x1
-
-/*
- * Register layout for TIO:CA.  See below for bitmasks for each register.
- */
-
-struct tioca {
-       u64     ca_id;                          /* 0x000000 */
-       u64     ca_control1;                    /* 0x000008 */
-       u64     ca_control2;                    /* 0x000010 */
-       u64     ca_status1;                     /* 0x000018 */
-       u64     ca_status2;                     /* 0x000020 */
-       u64     ca_gart_aperature;              /* 0x000028 */
-       u64     ca_gfx_detach;                  /* 0x000030 */
-       u64     ca_inta_dest_addr;              /* 0x000038 */
-       u64     ca_intb_dest_addr;              /* 0x000040 */
-       u64     ca_err_int_dest_addr;           /* 0x000048 */
-       u64     ca_int_status;                  /* 0x000050 */
-       u64     ca_int_status_alias;            /* 0x000058 */
-       u64     ca_mult_error;                  /* 0x000060 */
-       u64     ca_mult_error_alias;            /* 0x000068 */
-       u64     ca_first_error;                 /* 0x000070 */
-       u64     ca_int_mask;                    /* 0x000078 */
-       u64     ca_crm_pkterr_type;             /* 0x000080 */
-       u64     ca_crm_pkterr_type_alias;       /* 0x000088 */
-       u64     ca_crm_ct_error_detail_1;       /* 0x000090 */
-       u64     ca_crm_ct_error_detail_2;       /* 0x000098 */
-       u64     ca_crm_tnumto;                  /* 0x0000A0 */
-       u64     ca_gart_err;                    /* 0x0000A8 */
-       u64     ca_pcierr_type;                 /* 0x0000B0 */
-       u64     ca_pcierr_addr;                 /* 0x0000B8 */
-
-       u64     ca_pad_0000C0[3];               /* 0x0000{C0..D0} */
-
-       u64     ca_pci_rd_buf_flush;            /* 0x0000D8 */
-       u64     ca_pci_dma_addr_extn;           /* 0x0000E0 */
-       u64     ca_agp_dma_addr_extn;           /* 0x0000E8 */
-       u64     ca_force_inta;                  /* 0x0000F0 */
-       u64     ca_force_intb;                  /* 0x0000F8 */
-       u64     ca_debug_vector_sel;            /* 0x000100 */
-       u64     ca_debug_mux_core_sel;          /* 0x000108 */
-       u64     ca_debug_mux_pci_sel;           /* 0x000110 */
-       u64     ca_debug_domain_sel;            /* 0x000118 */
-
-       u64     ca_pad_000120[28];              /* 0x0001{20..F8} */
-
-       u64     ca_gart_ptr_table;              /* 0x200 */
-       u64     ca_gart_tlb_addr[8];            /* 0x2{08..40} */
-};
-
-/*
- * Mask/shift definitions for TIO:CA registers.  The convention here is
- * to mainly use the names as they appear in the "TIO AEGIS Programmers'
- * Reference" with a CA_ prefix added.  Some exceptions were made to fix
- * duplicate field names or to generalize fields that are common to
- * different registers (ca_debug_mux_core_sel and ca_debug_mux_pci_sel for
- * example).
- *
- * Fields consisting of a single bit have a single #define have a single
- * macro declaration to mask the bit.  Fields consisting of multiple bits
- * have two declarations: one to mask the proper bits in a register, and 
- * a second with the suffix "_SHFT" to identify how far the mask needs to
- * be shifted right to get its base value.
- */
-
-/* ==== ca_control1 */
-#define CA_SYS_BIG_END                 (1ull << 0)
-#define CA_DMA_AGP_SWAP                        (1ull << 1)
-#define CA_DMA_PCI_SWAP                        (1ull << 2)
-#define CA_PIO_IO_SWAP                 (1ull << 3)
-#define CA_PIO_MEM_SWAP                        (1ull << 4)
-#define CA_GFX_WR_SWAP                 (1ull << 5)
-#define CA_AGP_FW_ENABLE               (1ull << 6)
-#define CA_AGP_CAL_CYCLE               (0x7ull << 7)
-#define CA_AGP_CAL_CYCLE_SHFT          7
-#define CA_AGP_CAL_PRSCL_BYP           (1ull << 10)
-#define CA_AGP_INIT_CAL_ENB            (1ull << 11)
-#define CA_INJ_ADDR_PERR               (1ull << 12)
-#define CA_INJ_DATA_PERR               (1ull << 13)
-       /* bits 15:14 unused */
-#define CA_PCIM_IO_NBE_AD              (0x7ull << 16)
-#define CA_PCIM_IO_NBE_AD_SHFT         16
-#define CA_PCIM_FAST_BTB_ENB           (1ull << 19)
-       /* bits 23:20 unused */
-#define CA_PIO_ADDR_OFFSET             (0xffull << 24)
-#define CA_PIO_ADDR_OFFSET_SHFT                24
-       /* bits 35:32 unused */
-#define CA_AGPDMA_OP_COMBDELAY         (0x1full << 36)
-#define CA_AGPDMA_OP_COMBDELAY_SHFT    36
-       /* bit 41 unused */
-#define CA_AGPDMA_OP_ENB_COMBDELAY     (1ull << 42)
-#define        CA_PCI_INT_LPCNT                (0xffull << 44)
-#define CA_PCI_INT_LPCNT_SHFT          44
-       /* bits 63:52 unused */
-
-/* ==== ca_control2 */
-#define CA_AGP_LATENCY_TO              (0xffull << 0)
-#define CA_AGP_LATENCY_TO_SHFT         0
-#define CA_PCI_LATENCY_TO              (0xffull << 8)
-#define CA_PCI_LATENCY_TO_SHFT         8
-#define CA_PCI_MAX_RETRY               (0x3ffull << 16)
-#define CA_PCI_MAX_RETRY_SHFT          16
-       /* bits 27:26 unused */
-#define CA_RT_INT_EN                   (0x3ull << 28)
-#define CA_RT_INT_EN_SHFT                      28
-#define CA_MSI_INT_ENB                 (1ull << 30)
-#define CA_PCI_ARB_ERR_ENB             (1ull << 31)
-#define CA_GART_MEM_PARAM              (0x3ull << 32)
-#define CA_GART_MEM_PARAM_SHFT         32
-#define CA_GART_RD_PREFETCH_ENB                (1ull << 34)
-#define CA_GART_WR_PREFETCH_ENB                (1ull << 35)
-#define CA_GART_FLUSH_TLB              (1ull << 36)
-       /* bits 39:37 unused */
-#define CA_CRM_TNUMTO_PERIOD           (0x1fffull << 40)
-#define CA_CRM_TNUMTO_PERIOD_SHFT      40
-       /* bits 55:53 unused */
-#define CA_CRM_TNUMTO_ENB              (1ull << 56)
-#define CA_CRM_PRESCALER_BYP           (1ull << 57)
-       /* bits 59:58 unused */
-#define CA_CRM_MAX_CREDIT              (0x7ull << 60)
-#define CA_CRM_MAX_CREDIT_SHFT         60
-       /* bit 63 unused */
-
-/* ==== ca_status1 */
-#define CA_CORELET_ID                  (0x3ull << 0)
-#define CA_CORELET_ID_SHFT             0
-#define CA_INTA_N                      (1ull << 2)
-#define CA_INTB_N                      (1ull << 3)
-#define CA_CRM_CREDIT_AVAIL            (0x7ull << 4)
-#define CA_CRM_CREDIT_AVAIL_SHFT       4
-       /* bit 7 unused */
-#define CA_CRM_SPACE_AVAIL             (0x7full << 8)
-#define CA_CRM_SPACE_AVAIL_SHFT                8
-       /* bit 15 unused */
-#define CA_GART_TLB_VAL                        (0xffull << 16)
-#define CA_GART_TLB_VAL_SHFT           16
-       /* bits 63:24 unused */
-
-/* ==== ca_status2 */
-#define CA_GFX_CREDIT_AVAIL            (0xffull << 0)
-#define CA_GFX_CREDIT_AVAIL_SHFT       0
-#define CA_GFX_OPQ_AVAIL               (0xffull << 8)
-#define CA_GFX_OPQ_AVAIL_SHFT          8
-#define CA_GFX_WRBUFF_AVAIL            (0xffull << 16)
-#define CA_GFX_WRBUFF_AVAIL_SHFT       16
-#define CA_ADMA_OPQ_AVAIL              (0xffull << 24)
-#define CA_ADMA_OPQ_AVAIL_SHFT         24
-#define CA_ADMA_WRBUFF_AVAIL           (0xffull << 32)
-#define CA_ADMA_WRBUFF_AVAIL_SHFT      32
-#define CA_ADMA_RDBUFF_AVAIL           (0x7full << 40)
-#define CA_ADMA_RDBUFF_AVAIL_SHFT      40
-#define CA_PCI_PIO_OP_STAT             (1ull << 47)
-#define CA_PDMA_OPQ_AVAIL              (0xfull << 48)
-#define CA_PDMA_OPQ_AVAIL_SHFT         48
-#define CA_PDMA_WRBUFF_AVAIL           (0xfull << 52)
-#define CA_PDMA_WRBUFF_AVAIL_SHFT      52
-#define CA_PDMA_RDBUFF_AVAIL           (0x3ull << 56)
-#define CA_PDMA_RDBUFF_AVAIL_SHFT      56
-       /* bits 63:58 unused */
-
-/* ==== ca_gart_aperature */
-#define CA_GART_AP_ENB_AGP             (1ull << 0)
-#define CA_GART_PAGE_SIZE              (1ull << 1)
-#define CA_GART_AP_ENB_PCI             (1ull << 2)
-       /* bits 11:3 unused */
-#define CA_GART_AP_SIZE                        (0x3ffull << 12)
-#define CA_GART_AP_SIZE_SHFT           12
-#define CA_GART_AP_BASE                        (0x3ffffffffffull << 22)
-#define CA_GART_AP_BASE_SHFT           22
-
-/* ==== ca_inta_dest_addr
-   ==== ca_intb_dest_addr 
-   ==== ca_err_int_dest_addr */
-       /* bits 2:0 unused */
-#define CA_INT_DEST_ADDR               (0x7ffffffffffffull << 3)
-#define CA_INT_DEST_ADDR_SHFT          3
-       /* bits 55:54 unused */
-#define CA_INT_DEST_VECT               (0xffull << 56)
-#define CA_INT_DEST_VECT_SHFT          56
-
-/* ==== ca_int_status */
-/* ==== ca_int_status_alias */
-/* ==== ca_mult_error */
-/* ==== ca_mult_error_alias */
-/* ==== ca_first_error */
-/* ==== ca_int_mask */
-#define CA_PCI_ERR                     (1ull << 0)
-       /* bits 3:1 unused */
-#define CA_GART_FETCH_ERR              (1ull << 4)
-#define CA_GFX_WR_OVFLW                        (1ull << 5)
-#define CA_PIO_REQ_OVFLW               (1ull << 6)
-#define CA_CRM_PKTERR                  (1ull << 7)
-#define CA_CRM_DVERR                   (1ull << 8)
-#define CA_TNUMTO                      (1ull << 9)
-#define CA_CXM_RSP_CRED_OVFLW          (1ull << 10)
-#define CA_CXM_REQ_CRED_OVFLW          (1ull << 11)
-#define CA_PIO_INVALID_ADDR            (1ull << 12)
-#define CA_PCI_ARB_TO                  (1ull << 13)
-#define CA_AGP_REQ_OFLOW               (1ull << 14)
-#define CA_SBA_TYPE1_ERR               (1ull << 15)
-       /* bit 16 unused */
-#define CA_INTA                                (1ull << 17)
-#define CA_INTB                                (1ull << 18)
-#define CA_MULT_INTA                   (1ull << 19)
-#define CA_MULT_INTB                   (1ull << 20)
-#define CA_GFX_CREDIT_OVFLW            (1ull << 21)
-       /* bits 63:22 unused */
-
-/* ==== ca_crm_pkterr_type */
-/* ==== ca_crm_pkterr_type_alias */
-#define CA_CRM_PKTERR_SBERR_HDR                (1ull << 0)
-#define CA_CRM_PKTERR_DIDN             (1ull << 1)
-#define CA_CRM_PKTERR_PACTYPE          (1ull << 2)
-#define CA_CRM_PKTERR_INV_TNUM         (1ull << 3)
-#define CA_CRM_PKTERR_ADDR_RNG         (1ull << 4)
-#define CA_CRM_PKTERR_ADDR_ALGN                (1ull << 5)
-#define CA_CRM_PKTERR_HDR_PARAM                (1ull << 6)
-#define CA_CRM_PKTERR_CW_ERR           (1ull << 7)
-#define CA_CRM_PKTERR_SBERR_NH         (1ull << 8)
-#define CA_CRM_PKTERR_EARLY_TERM       (1ull << 9)
-#define CA_CRM_PKTERR_EARLY_TAIL       (1ull << 10)
-#define CA_CRM_PKTERR_MSSNG_TAIL       (1ull << 11)
-#define CA_CRM_PKTERR_MSSNG_HDR                (1ull << 12)
-       /* bits 15:13 unused */
-#define CA_FIRST_CRM_PKTERR_SBERR_HDR  (1ull << 16)
-#define CA_FIRST_CRM_PKTERR_DIDN       (1ull << 17)
-#define CA_FIRST_CRM_PKTERR_PACTYPE    (1ull << 18)
-#define CA_FIRST_CRM_PKTERR_INV_TNUM   (1ull << 19)
-#define CA_FIRST_CRM_PKTERR_ADDR_RNG   (1ull << 20)
-#define CA_FIRST_CRM_PKTERR_ADDR_ALGN  (1ull << 21)
-#define CA_FIRST_CRM_PKTERR_HDR_PARAM  (1ull << 22)
-#define CA_FIRST_CRM_PKTERR_CW_ERR     (1ull << 23)
-#define CA_FIRST_CRM_PKTERR_SBERR_NH   (1ull << 24)
-#define CA_FIRST_CRM_PKTERR_EARLY_TERM (1ull << 25)
-#define CA_FIRST_CRM_PKTERR_EARLY_TAIL (1ull << 26)
-#define CA_FIRST_CRM_PKTERR_MSSNG_TAIL (1ull << 27)
-#define CA_FIRST_CRM_PKTERR_MSSNG_HDR  (1ull << 28)
-       /* bits 63:29 unused */
-
-/* ==== ca_crm_ct_error_detail_1 */
-#define CA_PKT_TYPE                    (0xfull << 0)
-#define CA_PKT_TYPE_SHFT               0
-#define CA_SRC_ID                      (0x3ull << 4)
-#define CA_SRC_ID_SHFT                 4
-#define CA_DATA_SZ                     (0x3ull << 6)
-#define CA_DATA_SZ_SHFT                        6
-#define CA_TNUM                                (0xffull << 8)
-#define CA_TNUM_SHFT                   8
-#define CA_DW_DATA_EN                  (0xffull << 16)
-#define CA_DW_DATA_EN_SHFT             16
-#define CA_GFX_CRED                    (0xffull << 24)
-#define CA_GFX_CRED_SHFT               24
-#define CA_MEM_RD_PARAM                        (0x3ull << 32)
-#define CA_MEM_RD_PARAM_SHFT           32
-#define CA_PIO_OP                      (1ull << 34)
-#define CA_CW_ERR                      (1ull << 35)
-       /* bits 62:36 unused */
-#define CA_VALID                       (1ull << 63)
-
-/* ==== ca_crm_ct_error_detail_2 */
-       /* bits 2:0 unused */
-#define CA_PKT_ADDR                    (0x1fffffffffffffull << 3)
-#define CA_PKT_ADDR_SHFT               3
-       /* bits 63:56 unused */
-
-/* ==== ca_crm_tnumto */
-#define CA_CRM_TNUMTO_VAL              (0xffull << 0)
-#define CA_CRM_TNUMTO_VAL_SHFT         0
-#define CA_CRM_TNUMTO_WR               (1ull << 8)
-       /* bits 63:9 unused */
-
-/* ==== ca_gart_err */
-#define CA_GART_ERR_SOURCE             (0x3ull << 0)
-#define CA_GART_ERR_SOURCE_SHFT                0
-       /* bits 3:2 unused */
-#define CA_GART_ERR_ADDR               (0xfffffffffull << 4)
-#define CA_GART_ERR_ADDR_SHFT          4
-       /* bits 63:40 unused */
-
-/* ==== ca_pcierr_type */
-#define CA_PCIERR_DATA                 (0xffffffffull << 0)
-#define CA_PCIERR_DATA_SHFT            0
-#define CA_PCIERR_ENB                  (0xfull << 32)
-#define CA_PCIERR_ENB_SHFT             32
-#define CA_PCIERR_CMD                  (0xfull << 36)
-#define CA_PCIERR_CMD_SHFT             36
-#define CA_PCIERR_A64                  (1ull << 40)
-#define CA_PCIERR_SLV_SERR             (1ull << 41)
-#define CA_PCIERR_SLV_WR_PERR          (1ull << 42)
-#define CA_PCIERR_SLV_RD_PERR          (1ull << 43)
-#define CA_PCIERR_MST_SERR             (1ull << 44)
-#define CA_PCIERR_MST_WR_PERR          (1ull << 45)
-#define CA_PCIERR_MST_RD_PERR          (1ull << 46)
-#define CA_PCIERR_MST_MABT             (1ull << 47)
-#define CA_PCIERR_MST_TABT             (1ull << 48)
-#define CA_PCIERR_MST_RETRY_TOUT       (1ull << 49)
-
-#define CA_PCIERR_TYPES \
-       (CA_PCIERR_A64|CA_PCIERR_SLV_SERR| \
-        CA_PCIERR_SLV_WR_PERR|CA_PCIERR_SLV_RD_PERR| \
-        CA_PCIERR_MST_SERR|CA_PCIERR_MST_WR_PERR|CA_PCIERR_MST_RD_PERR| \
-        CA_PCIERR_MST_MABT|CA_PCIERR_MST_TABT|CA_PCIERR_MST_RETRY_TOUT)
-
-       /* bits 63:50 unused */
-
-/* ==== ca_pci_dma_addr_extn */
-#define CA_UPPER_NODE_OFFSET           (0x3full << 0)
-#define CA_UPPER_NODE_OFFSET_SHFT      0
-       /* bits 7:6 unused */
-#define CA_CHIPLET_ID                  (0x3ull << 8)
-#define CA_CHIPLET_ID_SHFT             8
-       /* bits 11:10 unused */
-#define CA_PCI_DMA_NODE_ID             (0xffffull << 12)
-#define CA_PCI_DMA_NODE_ID_SHFT                12
-       /* bits 27:26 unused */
-#define CA_PCI_DMA_PIO_MEM_TYPE                (1ull << 28)
-       /* bits 63:29 unused */
-
-
-/* ==== ca_agp_dma_addr_extn */
-       /* bits 19:0 unused */
-#define CA_AGP_DMA_NODE_ID             (0xffffull << 20)
-#define CA_AGP_DMA_NODE_ID_SHFT                20
-       /* bits 27:26 unused */
-#define CA_AGP_DMA_PIO_MEM_TYPE                (1ull << 28)
-       /* bits 63:29 unused */
-
-/* ==== ca_debug_vector_sel */
-#define CA_DEBUG_MN_VSEL               (0xfull << 0)
-#define CA_DEBUG_MN_VSEL_SHFT          0
-#define CA_DEBUG_PP_VSEL               (0xfull << 4)
-#define CA_DEBUG_PP_VSEL_SHFT          4
-#define CA_DEBUG_GW_VSEL               (0xfull << 8)
-#define CA_DEBUG_GW_VSEL_SHFT          8
-#define CA_DEBUG_GT_VSEL               (0xfull << 12)
-#define CA_DEBUG_GT_VSEL_SHFT          12
-#define CA_DEBUG_PD_VSEL               (0xfull << 16)
-#define CA_DEBUG_PD_VSEL_SHFT          16
-#define CA_DEBUG_AD_VSEL               (0xfull << 20)
-#define CA_DEBUG_AD_VSEL_SHFT          20
-#define CA_DEBUG_CX_VSEL               (0xfull << 24)
-#define CA_DEBUG_CX_VSEL_SHFT          24
-#define CA_DEBUG_CR_VSEL               (0xfull << 28)
-#define CA_DEBUG_CR_VSEL_SHFT          28
-#define CA_DEBUG_BA_VSEL               (0xfull << 32)
-#define CA_DEBUG_BA_VSEL_SHFT          32
-#define CA_DEBUG_PE_VSEL               (0xfull << 36)
-#define CA_DEBUG_PE_VSEL_SHFT          36
-#define CA_DEBUG_BO_VSEL               (0xfull << 40)
-#define CA_DEBUG_BO_VSEL_SHFT          40
-#define CA_DEBUG_BI_VSEL               (0xfull << 44)
-#define CA_DEBUG_BI_VSEL_SHFT          44
-#define CA_DEBUG_AS_VSEL               (0xfull << 48)
-#define CA_DEBUG_AS_VSEL_SHFT          48
-#define CA_DEBUG_PS_VSEL               (0xfull << 52)
-#define CA_DEBUG_PS_VSEL_SHFT          52
-#define CA_DEBUG_PM_VSEL               (0xfull << 56)
-#define CA_DEBUG_PM_VSEL_SHFT          56
-       /* bits 63:60 unused */
-
-/* ==== ca_debug_mux_core_sel */
-/* ==== ca_debug_mux_pci_sel */
-#define CA_DEBUG_MSEL0                 (0x7ull << 0)
-#define CA_DEBUG_MSEL0_SHFT            0
-       /* bit 3 unused */
-#define CA_DEBUG_NSEL0                 (0x7ull << 4)
-#define CA_DEBUG_NSEL0_SHFT            4
-       /* bit 7 unused */
-#define CA_DEBUG_MSEL1                 (0x7ull << 8)
-#define CA_DEBUG_MSEL1_SHFT            8
-       /* bit 11 unused */
-#define CA_DEBUG_NSEL1                 (0x7ull << 12)
-#define CA_DEBUG_NSEL1_SHFT            12
-       /* bit 15 unused */
-#define CA_DEBUG_MSEL2                 (0x7ull << 16)
-#define CA_DEBUG_MSEL2_SHFT            16
-       /* bit 19 unused */
-#define CA_DEBUG_NSEL2                 (0x7ull << 20)
-#define CA_DEBUG_NSEL2_SHFT            20
-       /* bit 23 unused */
-#define CA_DEBUG_MSEL3                 (0x7ull << 24)
-#define CA_DEBUG_MSEL3_SHFT            24
-       /* bit 27 unused */
-#define CA_DEBUG_NSEL3                 (0x7ull << 28)
-#define CA_DEBUG_NSEL3_SHFT            28
-       /* bit 31 unused */
-#define CA_DEBUG_MSEL4                 (0x7ull << 32)
-#define CA_DEBUG_MSEL4_SHFT            32
-       /* bit 35 unused */
-#define CA_DEBUG_NSEL4                 (0x7ull << 36)
-#define CA_DEBUG_NSEL4_SHFT            36
-       /* bit 39 unused */
-#define CA_DEBUG_MSEL5                 (0x7ull << 40)
-#define CA_DEBUG_MSEL5_SHFT            40
-       /* bit 43 unused */
-#define CA_DEBUG_NSEL5                 (0x7ull << 44)
-#define CA_DEBUG_NSEL5_SHFT            44
-       /* bit 47 unused */
-#define CA_DEBUG_MSEL6                 (0x7ull << 48)
-#define CA_DEBUG_MSEL6_SHFT            48
-       /* bit 51 unused */
-#define CA_DEBUG_NSEL6                 (0x7ull << 52)
-#define CA_DEBUG_NSEL6_SHFT            52
-       /* bit 55 unused */
-#define CA_DEBUG_MSEL7                 (0x7ull << 56)
-#define CA_DEBUG_MSEL7_SHFT            56
-       /* bit 59 unused */
-#define CA_DEBUG_NSEL7                 (0x7ull << 60)
-#define CA_DEBUG_NSEL7_SHFT            60
-       /* bit 63 unused */
-
-
-/* ==== ca_debug_domain_sel */
-#define CA_DEBUG_DOMAIN_L              (1ull << 0)
-#define CA_DEBUG_DOMAIN_H              (1ull << 1)
-       /* bits 63:2 unused */
-
-/* ==== ca_gart_ptr_table */
-#define CA_GART_PTR_VAL                        (1ull << 0)
-       /* bits 11:1 unused */
-#define CA_GART_PTR_ADDR               (0xfffffffffffull << 12)
-#define CA_GART_PTR_ADDR_SHFT          12
-       /* bits 63:56 unused */
-
-/* ==== ca_gart_tlb_addr[0-7] */
-#define CA_GART_TLB_ADDR               (0xffffffffffffffull << 0)
-#define CA_GART_TLB_ADDR_SHFT          0
-       /* bits 62:56 unused */
-#define CA_GART_TLB_ENTRY_VAL          (1ull << 63)
-
-/*
- * PIO address space ranges for TIO:CA
- */
-
-/* CA internal registers */
-#define CA_PIO_ADMIN                   0x00000000
-#define CA_PIO_ADMIN_LEN               0x00010000
-
-/* GFX Write Buffer - Diagnostics */
-#define CA_PIO_GFX                     0x00010000
-#define CA_PIO_GFX_LEN                 0x00010000
-
-/* AGP DMA Write Buffer - Diagnostics */
-#define CA_PIO_AGP_DMAWRITE            0x00020000
-#define CA_PIO_AGP_DMAWRITE_LEN                0x00010000
-
-/* AGP DMA READ Buffer - Diagnostics */
-#define CA_PIO_AGP_DMAREAD             0x00030000
-#define CA_PIO_AGP_DMAREAD_LEN         0x00010000
-
-/* PCI Config Type 0 */
-#define CA_PIO_PCI_TYPE0_CONFIG                0x01000000
-#define CA_PIO_PCI_TYPE0_CONFIG_LEN    0x01000000
-
-/* PCI Config Type 1 */
-#define CA_PIO_PCI_TYPE1_CONFIG                0x02000000
-#define CA_PIO_PCI_TYPE1_CONFIG_LEN    0x01000000
-
-/* PCI I/O Cycles - mapped to PCI Address 0x00000000-0x04ffffff */
-#define CA_PIO_PCI_IO                  0x03000000
-#define CA_PIO_PCI_IO_LEN              0x05000000
-
-/* PCI MEM Cycles - mapped to PCI with CA_PIO_ADDR_OFFSET of ca_control1 */
-/*     use Fast Write if enabled and coretalk packet type is a GFX request */
-#define CA_PIO_PCI_MEM_OFFSET          0x08000000
-#define CA_PIO_PCI_MEM_OFFSET_LEN      0x08000000
-
-/* PCI MEM Cycles - mapped to PCI Address 0x00000000-0xbfffffff */
-/*     use Fast Write if enabled and coretalk packet type is a GFX request */
-#define CA_PIO_PCI_MEM                 0x40000000
-#define CA_PIO_PCI_MEM_LEN             0xc0000000
-
-/*
- * DMA space
- *
- * The CA aperature (ie. bus address range) mapped by the GART is segmented into
- * two parts.  The lower portion of the aperature is used for mapping 32 bit
- * PCI addresses which are managed by the dma interfaces in this file.  The
- * upper poprtion of the aperature is used for mapping 48 bit AGP addresses.
- * The AGP portion of the aperature is managed by the agpgart_be.c driver
- * in drivers/linux/agp.  There are ca-specific hooks in that driver to
- * manipulate the gart, but management of the AGP portion of the aperature
- * is the responsibility of that driver.
- *
- * CA allows three main types of DMA mapping:
- *
- * PCI 64-bit  Managed by this driver
- * PCI 32-bit  Managed by this driver
- * AGP 48-bit  Managed by hooks in the /dev/agpgart driver
- *
- * All of the above can optionally be remapped through the GART.  The following
- * table lists the combinations of addressing types and GART remapping that
- * is currently supported by the driver (h/w supports all, s/w limits this):
- *
- *             PCI64           PCI32           AGP48
- * GART                no              yes             yes
- * Direct      yes             yes             no
- *
- * GART remapping of PCI64 is not done because there is no need to.  The
- * 64 bit PCI address holds all of the information necessary to target any
- * memory in the system.
- *
- * AGP48 is always mapped through the GART.  Management of the AGP48 portion
- * of the aperature is the responsibility of code in the agpgart_be driver.
- *
- * The non-64 bit bus address space will currently be partitioned like this:
- *
- *     0xffff_ffff_ffff        +--------
- *                             | AGP48 direct
- *                             | Space managed by this driver
- *     CA_AGP_DIRECT_BASE      +--------
- *                             | AGP GART mapped (gfx aperature)
- *                             | Space managed by /dev/agpgart driver
- *                             | This range is exposed to the agpgart
- *                             | driver as the "graphics aperature"
- *     CA_AGP_MAPPED_BASE      +-----
- *                             | PCI GART mapped
- *                             | Space managed by this driver          
- *     CA_PCI32_MAPPED_BASE    +----
- *                             | PCI32 direct
- *                             | Space managed by this driver
- *     0xC000_0000             +--------
- *     (CA_PCI32_DIRECT_BASE)
- *
- * The bus address range CA_PCI32_MAPPED_BASE through CA_AGP_DIRECT_BASE
- * is what we call the CA aperature.  Addresses falling in this range will
- * be remapped using the GART.
- *
- * The bus address range CA_AGP_MAPPED_BASE through CA_AGP_DIRECT_BASE
- * is what we call the graphics aperature.  This is a subset of the CA
- * aperature and is under the control of the agpgart_be driver.
- *
- * CA_PCI32_MAPPED_BASE, CA_AGP_MAPPED_BASE, and CA_AGP_DIRECT_BASE are
- * somewhat arbitrary values.  The known constraints on choosing these is:
- *
- * 1)  CA_AGP_DIRECT_BASE-CA_PCI32_MAPPED_BASE+1 (the CA aperature size)
- *     must be one of the values supported by the ca_gart_aperature register.
- *     Currently valid values are: 4MB through 4096MB in powers of 2 increments
- *
- * 2)  CA_AGP_DIRECT_BASE-CA_AGP_MAPPED_BASE+1 (the gfx aperature size)
- *     must be in MB units since that's what the agpgart driver assumes.
- */
-
-/*
- * Define Bus DMA ranges.  These are configurable (see constraints above)
- * and will probably need tuning based on experience.
- */
-
-
-/*
- * 11/24/03
- * CA has an addressing glitch w.r.t. PCI direct 32 bit DMA that makes it
- * generally unusable.  The problem is that for PCI direct 32 
- * DMA's, all 32 bits of the bus address are used to form the lower 32 bits
- * of the coretalk address, and coretalk bits 38:32 come from a register.
- * Since only PCI bus addresses 0xC0000000-0xFFFFFFFF (1GB) are available
- * for DMA (the rest is allocated to PIO), host node addresses need to be
- * such that their lower 32 bits fall in the 0xC0000000-0xffffffff range
- * as well.  So there can be no PCI32 direct DMA below 3GB!!  For this
- * reason we set the CA_PCI32_DIRECT_SIZE to 0 which essentially makes
- * tioca_dma_direct32() a noop but preserves the code flow should this issue
- * be fixed in a respin.
- *
- * For now, all PCI32 DMA's must be mapped through the GART.
- */
-
-#define CA_PCI32_DIRECT_BASE   0xC0000000UL    /* BASE not configurable */
-#define CA_PCI32_DIRECT_SIZE   0x00000000UL    /* 0 MB */
-
-#define CA_PCI32_MAPPED_BASE   0xC0000000UL
-#define CA_PCI32_MAPPED_SIZE   0x40000000UL    /* 2GB */
-
-#define CA_AGP_MAPPED_BASE     0x80000000UL
-#define CA_AGP_MAPPED_SIZE     0x40000000UL    /* 2GB */
-
-#define CA_AGP_DIRECT_BASE     0x40000000UL    /* 2GB */
-#define CA_AGP_DIRECT_SIZE     0x40000000UL
-
-#define CA_APERATURE_BASE      (CA_AGP_MAPPED_BASE)
-#define CA_APERATURE_SIZE      (CA_AGP_MAPPED_SIZE+CA_PCI32_MAPPED_SIZE)
-
-#endif  /* _ASM_IA64_SN_TIO_TIOCA_H */
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h
deleted file mode 100644 (file)
index 9a820ac..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
-#define _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
-
-#include <asm/sn/tioca.h>
-
-/*
- * WAR enables
- * Defines for individual WARs. Each is a bitmask of applicable
- * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
- * (3 << 1) == (rev A or rev B), etc
- */
-
-#define TIOCA_WAR_ENABLED(pv, tioca_common) \
-       ((1 << tioca_common->ca_rev) & pv)
-
-  /* TIO:ICE:FRZ:Freezer loses a PIO data ucred on PIO RD RSP with CW error */
-#define PV907908 (1 << 1)
-  /* ATI config space problems after BIOS execution starts */
-#define PV908234 (1 << 1)
-  /* CA:AGPDMA write request data mismatch with ABC1CL merge */
-#define PV895469 (1 << 1)
-  /* TIO:CA TLB invalidate of written GART entries possibly not occurring in CA*/
-#define PV910244 (1 << 1)
-
-struct tioca_dmamap{
-       struct list_head        cad_list;       /* headed by ca_list */
-
-       dma_addr_t              cad_dma_addr;   /* Linux dma handle */
-       uint                    cad_gart_entry; /* start entry in ca_gart_pagemap */
-       uint                    cad_gart_size;  /* #entries for this map */
-};
-
-/*
- * Kernel only fields.  Prom may look at this stuff for debugging only.
- * Access this structure through the ca_kernel_private ptr.
- */
-
-struct tioca_common ;
-
-struct tioca_kernel {
-       struct tioca_common     *ca_common;     /* tioca this belongs to */
-       struct list_head        ca_list;        /* list of all ca's */
-       struct list_head        ca_dmamaps;
-       spinlock_t              ca_lock;        /* Kernel lock */
-       cnodeid_t               ca_closest_node;
-       struct list_head        *ca_devices;    /* bus->devices */
-
-       /*
-        * General GART stuff
-        */
-       u64     ca_ap_size;             /* size of aperature in bytes */
-       u32     ca_gart_entries;        /* # u64 entries in gart */
-       u32     ca_ap_pagesize;         /* aperature page size in bytes */
-       u64     ca_ap_bus_base;         /* bus address of CA aperature */
-       u64     ca_gart_size;           /* gart size in bytes */
-       u64     *ca_gart;               /* gart table vaddr */
-       u64     ca_gart_coretalk_addr;  /* gart coretalk addr */
-       u8              ca_gart_iscoherent;     /* used in tioca_tlbflush */
-
-       /* PCI GART convenience values */
-       u64     ca_pciap_base;          /* pci aperature bus base address */
-       u64     ca_pciap_size;          /* pci aperature size (bytes) */
-       u64     ca_pcigart_base;        /* gfx GART bus base address */
-       u64     *ca_pcigart;            /* gfx GART vm address */
-       u32     ca_pcigart_entries;
-       u32     ca_pcigart_start;       /* PCI start index in ca_gart */
-       void            *ca_pcigart_pagemap;
-
-       /* AGP GART convenience values */
-       u64     ca_gfxap_base;          /* gfx aperature bus base address */
-       u64     ca_gfxap_size;          /* gfx aperature size (bytes) */
-       u64     ca_gfxgart_base;        /* gfx GART bus base address */
-       u64     *ca_gfxgart;            /* gfx GART vm address */
-       u32     ca_gfxgart_entries;
-       u32     ca_gfxgart_start;       /* agpgart start index in ca_gart */
-};
-
-/*
- * Common tioca info shared between kernel and prom
- *
- * DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES
- * TO THE PROM VERSION.
- */
-
-struct tioca_common {
-       struct pcibus_bussoft   ca_common;      /* common pciio header */
-
-       u32             ca_rev;
-       u32             ca_closest_nasid;
-
-       u64             ca_prom_private;
-       u64             ca_kernel_private;
-};
-
-/**
- * tioca_paddr_to_gart - Convert an SGI coretalk address to a CA GART entry
- * @paddr: page address to convert
- *
- * Convert a system [coretalk] address to a GART entry.  GART entries are
- * formed using the following:
- *
- *     data = ( (1<<63) |  ( (REMAP_NODE_ID << 40) | (MD_CHIPLET_ID << 38) | 
- * (REMAP_SYS_ADDR) ) >> 12 )
- *
- * DATA written to 1 GART TABLE Entry in system memory is remapped system
- * addr for 1 page 
- *
- * The data is for coretalk address format right shifted 12 bits with a
- * valid bit.
- *
- *     GART_TABLE_ENTRY [ 25:0 ]  -- REMAP_SYS_ADDRESS[37:12].
- *     GART_TABLE_ENTRY [ 27:26 ] -- SHUB MD chiplet id.
- *     GART_TABLE_ENTRY [ 41:28 ] -- REMAP_NODE_ID.
- *     GART_TABLE_ENTRY [ 63 ]    -- Valid Bit 
- */
-static inline u64
-tioca_paddr_to_gart(unsigned long paddr)
-{
-       /*
-        * We are assuming right now that paddr already has the correct
-        * format since the address from xtalk_dmaXXX should already have
-        * NODE_ID, CHIPLET_ID, and SYS_ADDR in the correct locations.
-        */
-
-       return ((paddr) >> 12) | (1UL << 63);
-}
-
-/**
- * tioca_physpage_to_gart - Map a host physical page for SGI CA based DMA
- * @page_addr: system page address to map
- */
-
-static inline unsigned long
-tioca_physpage_to_gart(u64 page_addr)
-{
-       u64 coretalk_addr;
-
-       coretalk_addr = PHYS_TO_TIODMA(page_addr);
-       if (!coretalk_addr) {
-               return 0;
-       }
-
-       return tioca_paddr_to_gart(coretalk_addr);
-}
-
-/**
- * tioca_tlbflush - invalidate cached SGI CA GART TLB entries
- * @tioca_kernel: CA context 
- *
- * Invalidate tlb entries for a given CA GART.  Main complexity is to account
- * for revA bug.
- */
-static inline void
-tioca_tlbflush(struct tioca_kernel *tioca_kernel)
-{
-       volatile u64 tmp;
-       volatile struct tioca __iomem *ca_base;
-       struct tioca_common *tioca_common;
-
-       tioca_common = tioca_kernel->ca_common;
-       ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
-
-       /*
-        * Explicit flushes not needed if GART is in cached mode
-        */
-       if (tioca_kernel->ca_gart_iscoherent) {
-               if (TIOCA_WAR_ENABLED(PV910244, tioca_common)) {
-                       /*
-                        * PV910244:  RevA CA needs explicit flushes.
-                        * Need to put GART into uncached mode before
-                        * flushing otherwise the explicit flush is ignored.
-                        *
-                        * Alternate WAR would be to leave GART cached and
-                        * touch every CL aligned GART entry.
-                        */
-
-                       __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM);
-                       __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
-                       __sn_setq_relaxed(&ca_base->ca_control2,
-                           (0x2ull << CA_GART_MEM_PARAM_SHFT));
-                       tmp = __sn_readq_relaxed(&ca_base->ca_control2);
-               }
-
-               return;
-       }
-
-       /*
-        * Gart in uncached mode ... need an explicit flush.
-        */
-
-       __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB);
-       tmp = __sn_readq_relaxed(&ca_base->ca_control2);
-}
-
-extern u32     tioca_gart_found;
-extern struct list_head tioca_list;
-extern int tioca_init_provider(void);
-extern void tioca_fastwrite_enable(struct tioca_kernel *tioca_kern);
-#endif /* _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H */
diff --git a/include/asm-ia64/sn/tioce.h b/include/asm-ia64/sn/tioce.h
deleted file mode 100644 (file)
index 893468e..0000000
+++ /dev/null
@@ -1,760 +0,0 @@
-/*
- * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef __ASM_IA64_SN_TIOCE_H__
-#define __ASM_IA64_SN_TIOCE_H__
-
-/* CE ASIC part & mfgr information  */
-#define TIOCE_PART_NUM                 0xCE00
-#define TIOCE_SRC_ID                   0x01
-#define TIOCE_REV_A                    0x1
-
-/* CE Virtual PPB Vendor/Device IDs */
-#define CE_VIRT_PPB_VENDOR_ID          0x10a9
-#define CE_VIRT_PPB_DEVICE_ID          0x4002
-
-/* CE Host Bridge Vendor/Device IDs */
-#define CE_HOST_BRIDGE_VENDOR_ID       0x10a9
-#define CE_HOST_BRIDGE_DEVICE_ID       0x4001
-
-
-#define TIOCE_NUM_M40_ATES             4096
-#define TIOCE_NUM_M3240_ATES           2048
-#define TIOCE_NUM_PORTS                        2
-
-/*
- * Register layout for TIOCE.  MMR offsets are shown at the far right of the
- * structure definition.
- */
-typedef volatile struct tioce {
-       /*
-        * ADMIN : Administration Registers
-        */
-       u64     ce_adm_id;                              /* 0x000000 */
-       u64     ce_pad_000008;                          /* 0x000008 */
-       u64     ce_adm_dyn_credit_status;               /* 0x000010 */
-       u64     ce_adm_last_credit_status;              /* 0x000018 */
-       u64     ce_adm_credit_limit;                    /* 0x000020 */
-       u64     ce_adm_force_credit;                    /* 0x000028 */
-       u64     ce_adm_control;                         /* 0x000030 */
-       u64     ce_adm_mmr_chn_timeout;                 /* 0x000038 */
-       u64     ce_adm_ssp_ure_timeout;                 /* 0x000040 */
-       u64     ce_adm_ssp_dre_timeout;                 /* 0x000048 */
-       u64     ce_adm_ssp_debug_sel;                   /* 0x000050 */
-       u64     ce_adm_int_status;                      /* 0x000058 */
-       u64     ce_adm_int_status_alias;                /* 0x000060 */
-       u64     ce_adm_int_mask;                        /* 0x000068 */
-       u64     ce_adm_int_pending;                     /* 0x000070 */
-       u64     ce_adm_force_int;                       /* 0x000078 */
-       u64     ce_adm_ure_ups_buf_barrier_flush;       /* 0x000080 */
-       u64     ce_adm_int_dest[15];        /* 0x000088 -- 0x0000F8 */
-       u64     ce_adm_error_summary;                   /* 0x000100 */
-       u64     ce_adm_error_summary_alias;             /* 0x000108 */
-       u64     ce_adm_error_mask;                      /* 0x000110 */
-       u64     ce_adm_first_error;                     /* 0x000118 */
-       u64     ce_adm_error_overflow;                  /* 0x000120 */
-       u64     ce_adm_error_overflow_alias;            /* 0x000128 */
-       u64     ce_pad_000130[2];           /* 0x000130 -- 0x000138 */
-       u64     ce_adm_tnum_error;                      /* 0x000140 */
-       u64     ce_adm_mmr_err_detail;                  /* 0x000148 */
-       u64     ce_adm_msg_sram_perr_detail;            /* 0x000150 */
-       u64     ce_adm_bap_sram_perr_detail;            /* 0x000158 */
-       u64     ce_adm_ce_sram_perr_detail;             /* 0x000160 */
-       u64     ce_adm_ce_credit_oflow_detail;          /* 0x000168 */
-       u64     ce_adm_tx_link_idle_max_timer;          /* 0x000170 */
-       u64     ce_adm_pcie_debug_sel;                  /* 0x000178 */
-       u64     ce_pad_000180[16];          /* 0x000180 -- 0x0001F8 */
-
-       u64     ce_adm_pcie_debug_sel_top;              /* 0x000200 */
-       u64     ce_adm_pcie_debug_lat_sel_lo_top;       /* 0x000208 */
-       u64     ce_adm_pcie_debug_lat_sel_hi_top;       /* 0x000210 */
-       u64     ce_adm_pcie_debug_trig_sel_top;         /* 0x000218 */
-       u64     ce_adm_pcie_debug_trig_lat_sel_lo_top;  /* 0x000220 */
-       u64     ce_adm_pcie_debug_trig_lat_sel_hi_top;  /* 0x000228 */
-       u64     ce_adm_pcie_trig_compare_top;           /* 0x000230 */
-       u64     ce_adm_pcie_trig_compare_en_top;        /* 0x000238 */
-       u64     ce_adm_ssp_debug_sel_top;               /* 0x000240 */
-       u64     ce_adm_ssp_debug_lat_sel_lo_top;        /* 0x000248 */
-       u64     ce_adm_ssp_debug_lat_sel_hi_top;        /* 0x000250 */
-       u64     ce_adm_ssp_debug_trig_sel_top;          /* 0x000258 */
-       u64     ce_adm_ssp_debug_trig_lat_sel_lo_top;   /* 0x000260 */
-       u64     ce_adm_ssp_debug_trig_lat_sel_hi_top;   /* 0x000268 */
-       u64     ce_adm_ssp_trig_compare_top;            /* 0x000270 */
-       u64     ce_adm_ssp_trig_compare_en_top;         /* 0x000278 */
-       u64     ce_pad_000280[48];          /* 0x000280 -- 0x0003F8 */
-
-       u64     ce_adm_bap_ctrl;                        /* 0x000400 */
-       u64     ce_pad_000408[127];         /* 0x000408 -- 0x0007F8 */
-
-       u64     ce_msg_buf_data63_0[35];    /* 0x000800 -- 0x000918 */
-       u64     ce_pad_000920[29];          /* 0x000920 -- 0x0009F8 */
-
-       u64     ce_msg_buf_data127_64[35];  /* 0x000A00 -- 0x000B18 */
-       u64     ce_pad_000B20[29];          /* 0x000B20 -- 0x000BF8 */
-
-       u64     ce_msg_buf_parity[35];      /* 0x000C00 -- 0x000D18 */
-       u64     ce_pad_000D20[29];          /* 0x000D20 -- 0x000DF8 */
-
-       u64     ce_pad_000E00[576];         /* 0x000E00 -- 0x001FF8 */
-
-       /*
-        * LSI : LSI's PCI Express Link Registers (Link#1 and Link#2)
-        * Link#1 MMRs at start at 0x002000, Link#2 MMRs at 0x003000
-        * NOTE: the comment offsets at far right: let 'z' = {2 or 3}
-        */
-       #define ce_lsi(link_num)        ce_lsi[link_num-1]
-       struct ce_lsi_reg {
-               u64     ce_lsi_lpu_id;                  /* 0x00z000 */
-               u64     ce_lsi_rst;                     /* 0x00z008 */
-               u64     ce_lsi_dbg_stat;                /* 0x00z010 */
-               u64     ce_lsi_dbg_cfg;                 /* 0x00z018 */
-               u64     ce_lsi_ltssm_ctrl;              /* 0x00z020 */
-               u64     ce_lsi_lk_stat;                 /* 0x00z028 */
-               u64     ce_pad_00z030[2];   /* 0x00z030 -- 0x00z038 */
-               u64     ce_lsi_int_and_stat;            /* 0x00z040 */
-               u64     ce_lsi_int_mask;                /* 0x00z048 */
-               u64     ce_pad_00z050[22];  /* 0x00z050 -- 0x00z0F8 */
-               u64     ce_lsi_lk_perf_cnt_sel;         /* 0x00z100 */
-               u64     ce_pad_00z108;                  /* 0x00z108 */
-               u64     ce_lsi_lk_perf_cnt_ctrl;        /* 0x00z110 */
-               u64     ce_pad_00z118;                  /* 0x00z118 */
-               u64     ce_lsi_lk_perf_cnt1;            /* 0x00z120 */
-               u64     ce_lsi_lk_perf_cnt1_test;       /* 0x00z128 */
-               u64     ce_lsi_lk_perf_cnt2;            /* 0x00z130 */
-               u64     ce_lsi_lk_perf_cnt2_test;       /* 0x00z138 */
-               u64     ce_pad_00z140[24];  /* 0x00z140 -- 0x00z1F8 */
-               u64     ce_lsi_lk_lyr_cfg;              /* 0x00z200 */
-               u64     ce_lsi_lk_lyr_status;           /* 0x00z208 */
-               u64     ce_lsi_lk_lyr_int_stat;         /* 0x00z210 */
-               u64     ce_lsi_lk_ly_int_stat_test;     /* 0x00z218 */
-               u64     ce_lsi_lk_ly_int_stat_mask;     /* 0x00z220 */
-               u64     ce_pad_00z228[3];   /* 0x00z228 -- 0x00z238 */
-               u64     ce_lsi_fc_upd_ctl;              /* 0x00z240 */
-               u64     ce_pad_00z248[3];   /* 0x00z248 -- 0x00z258 */
-               u64     ce_lsi_flw_ctl_upd_to_timer;    /* 0x00z260 */
-               u64     ce_lsi_flw_ctl_upd_timer0;      /* 0x00z268 */
-               u64     ce_lsi_flw_ctl_upd_timer1;      /* 0x00z270 */
-               u64     ce_pad_00z278[49];  /* 0x00z278 -- 0x00z3F8 */
-               u64     ce_lsi_freq_nak_lat_thrsh;      /* 0x00z400 */
-               u64     ce_lsi_ack_nak_lat_tmr;         /* 0x00z408 */
-               u64     ce_lsi_rply_tmr_thr;            /* 0x00z410 */
-               u64     ce_lsi_rply_tmr;                /* 0x00z418 */
-               u64     ce_lsi_rply_num_stat;           /* 0x00z420 */
-               u64     ce_lsi_rty_buf_max_addr;        /* 0x00z428 */
-               u64     ce_lsi_rty_fifo_ptr;            /* 0x00z430 */
-               u64     ce_lsi_rty_fifo_rd_wr_ptr;      /* 0x00z438 */
-               u64     ce_lsi_rty_fifo_cred;           /* 0x00z440 */
-               u64     ce_lsi_seq_cnt;                 /* 0x00z448 */
-               u64     ce_lsi_ack_sent_seq_num;        /* 0x00z450 */
-               u64     ce_lsi_seq_cnt_fifo_max_addr;   /* 0x00z458 */
-               u64     ce_lsi_seq_cnt_fifo_ptr;        /* 0x00z460 */
-               u64     ce_lsi_seq_cnt_rd_wr_ptr;       /* 0x00z468 */
-               u64     ce_lsi_tx_lk_ts_ctl;            /* 0x00z470 */
-               u64     ce_pad_00z478;                  /* 0x00z478 */
-               u64     ce_lsi_mem_addr_ctl;            /* 0x00z480 */
-               u64     ce_lsi_mem_d_ld0;               /* 0x00z488 */
-               u64     ce_lsi_mem_d_ld1;               /* 0x00z490 */
-               u64     ce_lsi_mem_d_ld2;               /* 0x00z498 */
-               u64     ce_lsi_mem_d_ld3;               /* 0x00z4A0 */
-               u64     ce_lsi_mem_d_ld4;               /* 0x00z4A8 */
-               u64     ce_pad_00z4B0[2];   /* 0x00z4B0 -- 0x00z4B8 */
-               u64     ce_lsi_rty_d_cnt;               /* 0x00z4C0 */
-               u64     ce_lsi_seq_buf_cnt;             /* 0x00z4C8 */
-               u64     ce_lsi_seq_buf_bt_d;            /* 0x00z4D0 */
-               u64     ce_pad_00z4D8;                  /* 0x00z4D8 */
-               u64     ce_lsi_ack_lat_thr;             /* 0x00z4E0 */
-               u64     ce_pad_00z4E8[3];   /* 0x00z4E8 -- 0x00z4F8 */
-               u64     ce_lsi_nxt_rcv_seq_1_cntr;      /* 0x00z500 */
-               u64     ce_lsi_unsp_dllp_rcvd;          /* 0x00z508 */
-               u64     ce_lsi_rcv_lk_ts_ctl;           /* 0x00z510 */
-               u64     ce_pad_00z518[29];  /* 0x00z518 -- 0x00z5F8 */
-               u64     ce_lsi_phy_lyr_cfg;             /* 0x00z600 */
-               u64     ce_pad_00z608;                  /* 0x00z608 */
-               u64     ce_lsi_phy_lyr_int_stat;        /* 0x00z610 */
-               u64     ce_lsi_phy_lyr_int_stat_test;   /* 0x00z618 */
-               u64     ce_lsi_phy_lyr_int_mask;        /* 0x00z620 */
-               u64     ce_pad_00z628[11];  /* 0x00z628 -- 0x00z678 */
-               u64     ce_lsi_rcv_phy_cfg;             /* 0x00z680 */
-               u64     ce_lsi_rcv_phy_stat1;           /* 0x00z688 */
-               u64     ce_lsi_rcv_phy_stat2;           /* 0x00z690 */
-               u64     ce_lsi_rcv_phy_stat3;           /* 0x00z698 */
-               u64     ce_lsi_rcv_phy_int_stat;        /* 0x00z6A0 */
-               u64     ce_lsi_rcv_phy_int_stat_test;   /* 0x00z6A8 */
-               u64     ce_lsi_rcv_phy_int_mask;        /* 0x00z6B0 */
-               u64     ce_pad_00z6B8[9];   /* 0x00z6B8 -- 0x00z6F8 */
-               u64     ce_lsi_tx_phy_cfg;              /* 0x00z700 */
-               u64     ce_lsi_tx_phy_stat;             /* 0x00z708 */
-               u64     ce_lsi_tx_phy_int_stat;         /* 0x00z710 */
-               u64     ce_lsi_tx_phy_int_stat_test;    /* 0x00z718 */
-               u64     ce_lsi_tx_phy_int_mask;         /* 0x00z720 */
-               u64     ce_lsi_tx_phy_stat2;            /* 0x00z728 */
-               u64     ce_pad_00z730[10];  /* 0x00z730 -- 0x00z77F */
-               u64     ce_lsi_ltssm_cfg1;              /* 0x00z780 */
-               u64     ce_lsi_ltssm_cfg2;              /* 0x00z788 */
-               u64     ce_lsi_ltssm_cfg3;              /* 0x00z790 */
-               u64     ce_lsi_ltssm_cfg4;              /* 0x00z798 */
-               u64     ce_lsi_ltssm_cfg5;              /* 0x00z7A0 */
-               u64     ce_lsi_ltssm_stat1;             /* 0x00z7A8 */
-               u64     ce_lsi_ltssm_stat2;             /* 0x00z7B0 */
-               u64     ce_lsi_ltssm_int_stat;          /* 0x00z7B8 */
-               u64     ce_lsi_ltssm_int_stat_test;     /* 0x00z7C0 */
-               u64     ce_lsi_ltssm_int_mask;          /* 0x00z7C8 */
-               u64     ce_lsi_ltssm_stat_wr_en;        /* 0x00z7D0 */
-               u64     ce_pad_00z7D8[5];   /* 0x00z7D8 -- 0x00z7F8 */
-               u64     ce_lsi_gb_cfg1;                 /* 0x00z800 */
-               u64     ce_lsi_gb_cfg2;                 /* 0x00z808 */
-               u64     ce_lsi_gb_cfg3;                 /* 0x00z810 */
-               u64     ce_lsi_gb_cfg4;                 /* 0x00z818 */
-               u64     ce_lsi_gb_stat;                 /* 0x00z820 */
-               u64     ce_lsi_gb_int_stat;             /* 0x00z828 */
-               u64     ce_lsi_gb_int_stat_test;        /* 0x00z830 */
-               u64     ce_lsi_gb_int_mask;             /* 0x00z838 */
-               u64     ce_lsi_gb_pwr_dn1;              /* 0x00z840 */
-               u64     ce_lsi_gb_pwr_dn2;              /* 0x00z848 */
-               u64     ce_pad_00z850[246]; /* 0x00z850 -- 0x00zFF8 */
-       } ce_lsi[2];
-
-       u64     ce_pad_004000[10];          /* 0x004000 -- 0x004048 */
-
-       /*
-        * CRM: Coretalk Receive Module Registers
-        */
-       u64     ce_crm_debug_mux;                       /* 0x004050 */
-       u64     ce_pad_004058;                          /* 0x004058 */
-       u64     ce_crm_ssp_err_cmd_wrd;                 /* 0x004060 */
-       u64     ce_crm_ssp_err_addr;                    /* 0x004068 */
-       u64     ce_crm_ssp_err_syn;                     /* 0x004070 */
-
-       u64     ce_pad_004078[499];         /* 0x004078 -- 0x005008 */
-
-       /*
-         * CXM: Coretalk Xmit Module Registers
-         */
-       u64     ce_cxm_dyn_credit_status;               /* 0x005010 */
-       u64     ce_cxm_last_credit_status;              /* 0x005018 */
-       u64     ce_cxm_credit_limit;                    /* 0x005020 */
-       u64     ce_cxm_force_credit;                    /* 0x005028 */
-       u64     ce_cxm_disable_bypass;                  /* 0x005030 */
-       u64     ce_pad_005038[3];           /* 0x005038 -- 0x005048 */
-       u64     ce_cxm_debug_mux;                       /* 0x005050 */
-
-        u64        ce_pad_005058[501];         /* 0x005058 -- 0x005FF8 */
-
-       /*
-        * DTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
-        * DTL: Link#1 MMRs at start at 0x006000, Link#2 MMRs at 0x008000
-        * DTL: the comment offsets at far right: let 'y' = {6 or 8}
-        *
-        * UTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
-        * UTL: Link#1 MMRs at start at 0x007000, Link#2 MMRs at 0x009000
-        * UTL: the comment offsets at far right: let 'z' = {7 or 9}
-        */
-       #define ce_dtl(link_num)        ce_dtl_utl[link_num-1]
-       #define ce_utl(link_num)        ce_dtl_utl[link_num-1]
-       struct ce_dtl_utl_reg {
-               /* DTL */
-               u64     ce_dtl_dtdr_credit_limit;       /* 0x00y000 */
-               u64     ce_dtl_dtdr_credit_force;       /* 0x00y008 */
-               u64     ce_dtl_dyn_credit_status;       /* 0x00y010 */
-               u64     ce_dtl_dtl_last_credit_stat;    /* 0x00y018 */
-               u64     ce_dtl_dtl_ctrl;                /* 0x00y020 */
-               u64     ce_pad_00y028[5];   /* 0x00y028 -- 0x00y048 */
-               u64     ce_dtl_debug_sel;               /* 0x00y050 */
-               u64     ce_pad_00y058[501]; /* 0x00y058 -- 0x00yFF8 */
-
-               /* UTL */
-               u64     ce_utl_utl_ctrl;                /* 0x00z000 */
-               u64     ce_utl_debug_sel;               /* 0x00z008 */
-               u64     ce_pad_00z010[510]; /* 0x00z010 -- 0x00zFF8 */
-       } ce_dtl_utl[2];
-
-       u64     ce_pad_00A000[514];         /* 0x00A000 -- 0x00B008 */
-
-       /*
-        * URE: Upstream Request Engine
-         */
-       u64     ce_ure_dyn_credit_status;               /* 0x00B010 */
-       u64     ce_ure_last_credit_status;              /* 0x00B018 */
-       u64     ce_ure_credit_limit;                    /* 0x00B020 */
-       u64     ce_pad_00B028;                          /* 0x00B028 */
-       u64     ce_ure_control;                         /* 0x00B030 */
-       u64     ce_ure_status;                          /* 0x00B038 */
-       u64     ce_pad_00B040[2];           /* 0x00B040 -- 0x00B048 */
-       u64     ce_ure_debug_sel;                       /* 0x00B050 */
-       u64     ce_ure_pcie_debug_sel;                  /* 0x00B058 */
-       u64     ce_ure_ssp_err_cmd_wrd;                 /* 0x00B060 */
-       u64     ce_ure_ssp_err_addr;                    /* 0x00B068 */
-       u64     ce_ure_page_map;                        /* 0x00B070 */
-       u64     ce_ure_dir_map[TIOCE_NUM_PORTS];        /* 0x00B078 */
-       u64     ce_ure_pipe_sel1;                       /* 0x00B088 */
-       u64     ce_ure_pipe_mask1;                      /* 0x00B090 */
-       u64     ce_ure_pipe_sel2;                       /* 0x00B098 */
-       u64     ce_ure_pipe_mask2;                      /* 0x00B0A0 */
-       u64     ce_ure_pcie1_credits_sent;              /* 0x00B0A8 */
-       u64     ce_ure_pcie1_credits_used;              /* 0x00B0B0 */
-       u64     ce_ure_pcie1_credit_limit;              /* 0x00B0B8 */
-       u64     ce_ure_pcie2_credits_sent;              /* 0x00B0C0 */
-       u64     ce_ure_pcie2_credits_used;              /* 0x00B0C8 */
-       u64     ce_ure_pcie2_credit_limit;              /* 0x00B0D0 */
-       u64     ce_ure_pcie_force_credit;               /* 0x00B0D8 */
-       u64     ce_ure_rd_tnum_val;                     /* 0x00B0E0 */
-       u64     ce_ure_rd_tnum_rsp_rcvd;                /* 0x00B0E8 */
-       u64     ce_ure_rd_tnum_esent_timer;             /* 0x00B0F0 */
-       u64     ce_ure_rd_tnum_error;                   /* 0x00B0F8 */
-       u64     ce_ure_rd_tnum_first_cl;                /* 0x00B100 */
-       u64     ce_ure_rd_tnum_link_buf;                /* 0x00B108 */
-       u64     ce_ure_wr_tnum_val;                     /* 0x00B110 */
-       u64     ce_ure_sram_err_addr0;                  /* 0x00B118 */
-       u64     ce_ure_sram_err_addr1;                  /* 0x00B120 */
-       u64     ce_ure_sram_err_addr2;                  /* 0x00B128 */
-       u64     ce_ure_sram_rd_addr0;                   /* 0x00B130 */
-       u64     ce_ure_sram_rd_addr1;                   /* 0x00B138 */
-       u64     ce_ure_sram_rd_addr2;                   /* 0x00B140 */
-       u64     ce_ure_sram_wr_addr0;                   /* 0x00B148 */
-       u64     ce_ure_sram_wr_addr1;                   /* 0x00B150 */
-       u64     ce_ure_sram_wr_addr2;                   /* 0x00B158 */
-       u64     ce_ure_buf_flush10;                     /* 0x00B160 */
-       u64     ce_ure_buf_flush11;                     /* 0x00B168 */
-       u64     ce_ure_buf_flush12;                     /* 0x00B170 */
-       u64     ce_ure_buf_flush13;                     /* 0x00B178 */
-       u64     ce_ure_buf_flush20;                     /* 0x00B180 */
-       u64     ce_ure_buf_flush21;                     /* 0x00B188 */
-       u64     ce_ure_buf_flush22;                     /* 0x00B190 */
-       u64     ce_ure_buf_flush23;                     /* 0x00B198 */
-       u64     ce_ure_pcie_control1;                   /* 0x00B1A0 */
-       u64     ce_ure_pcie_control2;                   /* 0x00B1A8 */
-
-       u64     ce_pad_00B1B0[458];         /* 0x00B1B0 -- 0x00BFF8 */
-
-       /* Upstream Data Buffer, Port1 */
-       struct ce_ure_maint_ups_dat1_data {
-               u64     data63_0[512];      /* 0x00C000 -- 0x00CFF8 */
-               u64     data127_64[512];    /* 0x00D000 -- 0x00DFF8 */
-               u64     parity[512];        /* 0x00E000 -- 0x00EFF8 */
-       } ce_ure_maint_ups_dat1;
-
-       /* Upstream Header Buffer, Port1 */
-       struct ce_ure_maint_ups_hdr1_data {
-               u64     data63_0[512];      /* 0x00F000 -- 0x00FFF8 */
-               u64     data127_64[512];    /* 0x010000 -- 0x010FF8 */
-               u64     parity[512];        /* 0x011000 -- 0x011FF8 */
-       } ce_ure_maint_ups_hdr1;
-
-       /* Upstream Data Buffer, Port2 */
-       struct ce_ure_maint_ups_dat2_data {
-               u64     data63_0[512];      /* 0x012000 -- 0x012FF8 */
-               u64     data127_64[512];    /* 0x013000 -- 0x013FF8 */
-               u64     parity[512];        /* 0x014000 -- 0x014FF8 */
-       } ce_ure_maint_ups_dat2;
-
-       /* Upstream Header Buffer, Port2 */
-       struct ce_ure_maint_ups_hdr2_data {
-               u64     data63_0[512];      /* 0x015000 -- 0x015FF8 */
-               u64     data127_64[512];    /* 0x016000 -- 0x016FF8 */
-               u64     parity[512];        /* 0x017000 -- 0x017FF8 */
-       } ce_ure_maint_ups_hdr2;
-
-       /* Downstream Data Buffer */
-       struct ce_ure_maint_dns_dat_data {
-               u64     data63_0[512];      /* 0x018000 -- 0x018FF8 */
-               u64     data127_64[512];    /* 0x019000 -- 0x019FF8 */
-               u64     parity[512];        /* 0x01A000 -- 0x01AFF8 */
-       } ce_ure_maint_dns_dat;
-
-       /* Downstream Header Buffer */
-       struct  ce_ure_maint_dns_hdr_data {
-               u64     data31_0[64];       /* 0x01B000 -- 0x01B1F8 */
-               u64     data95_32[64];      /* 0x01B200 -- 0x01B3F8 */
-               u64     parity[64];         /* 0x01B400 -- 0x01B5F8 */
-       } ce_ure_maint_dns_hdr;
-
-       /* RCI Buffer Data */
-       struct  ce_ure_maint_rci_data {
-               u64     data41_0[64];       /* 0x01B600 -- 0x01B7F8 */
-               u64     data69_42[64];      /* 0x01B800 -- 0x01B9F8 */
-       } ce_ure_maint_rci;
-
-       /* Response Queue */
-       u64     ce_ure_maint_rspq[64];      /* 0x01BA00 -- 0x01BBF8 */
-
-       u64     ce_pad_01C000[4224];        /* 0x01BC00 -- 0x023FF8 */
-
-       /* Admin Build-a-Packet Buffer */
-       struct  ce_adm_maint_bap_buf_data {
-               u64     data63_0[258];      /* 0x024000 -- 0x024808 */
-               u64     data127_64[258];    /* 0x024810 -- 0x025018 */
-               u64     parity[258];        /* 0x025020 -- 0x025828 */
-       } ce_adm_maint_bap_buf;
-
-       u64     ce_pad_025830[5370];        /* 0x025830 -- 0x02FFF8 */
-
-       /* URE: 40bit PMU ATE Buffer */             /* 0x030000 -- 0x037FF8 */
-       u64     ce_ure_ate40[TIOCE_NUM_M40_ATES];
-
-       /* URE: 32/40bit PMU ATE Buffer */          /* 0x038000 -- 0x03BFF8 */
-       u64     ce_ure_ate3240[TIOCE_NUM_M3240_ATES];
-
-       u64     ce_pad_03C000[2050];        /* 0x03C000 -- 0x040008 */
-
-       /*
-        * DRE: Down Stream Request Engine
-         */
-       u64     ce_dre_dyn_credit_status1;              /* 0x040010 */
-       u64     ce_dre_dyn_credit_status2;              /* 0x040018 */
-       u64     ce_dre_last_credit_status1;             /* 0x040020 */
-       u64     ce_dre_last_credit_status2;             /* 0x040028 */
-       u64     ce_dre_credit_limit1;                   /* 0x040030 */
-       u64     ce_dre_credit_limit2;                   /* 0x040038 */
-       u64     ce_dre_force_credit1;                   /* 0x040040 */
-       u64     ce_dre_force_credit2;                   /* 0x040048 */
-       u64     ce_dre_debug_mux1;                      /* 0x040050 */
-       u64     ce_dre_debug_mux2;                      /* 0x040058 */
-       u64     ce_dre_ssp_err_cmd_wrd;                 /* 0x040060 */
-       u64     ce_dre_ssp_err_addr;                    /* 0x040068 */
-       u64     ce_dre_comp_err_cmd_wrd;                /* 0x040070 */
-       u64     ce_dre_comp_err_addr;                   /* 0x040078 */
-       u64     ce_dre_req_status;                      /* 0x040080 */
-       u64     ce_dre_config1;                         /* 0x040088 */
-       u64     ce_dre_config2;                         /* 0x040090 */
-       u64     ce_dre_config_req_status;               /* 0x040098 */
-       u64     ce_pad_0400A0[12];          /* 0x0400A0 -- 0x0400F8 */
-       u64     ce_dre_dyn_fifo;                        /* 0x040100 */
-       u64     ce_pad_040108[3];           /* 0x040108 -- 0x040118 */
-       u64     ce_dre_last_fifo;                       /* 0x040120 */
-
-       u64     ce_pad_040128[27];          /* 0x040128 -- 0x0401F8 */
-
-       /* DRE Downstream Head Queue */
-       struct  ce_dre_maint_ds_head_queue {
-               u64     data63_0[32];       /* 0x040200 -- 0x0402F8 */
-               u64     data127_64[32];     /* 0x040300 -- 0x0403F8 */
-               u64     parity[32];         /* 0x040400 -- 0x0404F8 */
-       } ce_dre_maint_ds_head_q;
-
-       u64     ce_pad_040500[352];         /* 0x040500 -- 0x040FF8 */
-
-       /* DRE Downstream Data Queue */
-       struct  ce_dre_maint_ds_data_queue {
-               u64     data63_0[256];      /* 0x041000 -- 0x0417F8 */
-               u64     ce_pad_041800[256]; /* 0x041800 -- 0x041FF8 */
-               u64     data127_64[256];    /* 0x042000 -- 0x0427F8 */
-               u64     ce_pad_042800[256]; /* 0x042800 -- 0x042FF8 */
-               u64     parity[256];        /* 0x043000 -- 0x0437F8 */
-               u64     ce_pad_043800[256]; /* 0x043800 -- 0x043FF8 */
-       } ce_dre_maint_ds_data_q;
-
-       /* DRE URE Upstream Response Queue */
-       struct  ce_dre_maint_ure_us_rsp_queue {
-               u64     data63_0[8];        /* 0x044000 -- 0x044038 */
-               u64     ce_pad_044040[24];  /* 0x044040 -- 0x0440F8 */
-               u64     data127_64[8];      /* 0x044100 -- 0x044138 */
-               u64     ce_pad_044140[24];  /* 0x044140 -- 0x0441F8 */
-               u64     parity[8];          /* 0x044200 -- 0x044238 */
-               u64     ce_pad_044240[24];  /* 0x044240 -- 0x0442F8 */
-       } ce_dre_maint_ure_us_rsp_q;
-
-       u64     ce_dre_maint_us_wrt_rsp[32];/* 0x044300 -- 0x0443F8 */
-
-       u64     ce_end_of_struct;                       /* 0x044400 */
-} tioce_t;
-
-/* ce_lsiX_gb_cfg1 register bit masks & shifts */
-#define CE_LSI_GB_CFG1_RXL0S_THS_SHFT  0
-#define CE_LSI_GB_CFG1_RXL0S_THS_MASK  (0xffULL << 0)
-#define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT  8
-#define CE_LSI_GB_CFG1_RXL0S_SMP_MASK  (0xfULL << 8);
-#define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT  12
-#define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK  (0x7ULL << 12)
-#define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT  15
-#define CE_LSI_GB_CFG1_RXL0S_FLT_MASK  (0x1ULL << 15)
-#define CE_LSI_GB_CFG1_LPBK_SEL_SHFT   16
-#define CE_LSI_GB_CFG1_LPBK_SEL_MASK   (0x3ULL << 16)
-#define CE_LSI_GB_CFG1_LPBK_EN_SHFT    18
-#define CE_LSI_GB_CFG1_LPBK_EN_MASK    (0x1ULL << 18)
-#define CE_LSI_GB_CFG1_RVRS_LB_SHFT    19
-#define CE_LSI_GB_CFG1_RVRS_LB_MASK    (0x1ULL << 19)
-#define CE_LSI_GB_CFG1_RVRS_CLK_SHFT   20
-#define CE_LSI_GB_CFG1_RVRS_CLK_MASK   (0x3ULL << 20)
-#define CE_LSI_GB_CFG1_SLF_TS_SHFT     24
-#define CE_LSI_GB_CFG1_SLF_TS_MASK     (0xfULL << 24)
-
-/* ce_adm_int_mask/ce_adm_int_status register bit defines */
-#define CE_ADM_INT_CE_ERROR_SHFT               0
-#define CE_ADM_INT_LSI1_IP_ERROR_SHFT          1
-#define CE_ADM_INT_LSI2_IP_ERROR_SHFT          2
-#define CE_ADM_INT_PCIE_ERROR_SHFT             3
-#define CE_ADM_INT_PORT1_HOTPLUG_EVENT_SHFT    4
-#define CE_ADM_INT_PORT2_HOTPLUG_EVENT_SHFT    5
-#define CE_ADM_INT_PCIE_PORT1_DEV_A_SHFT       6
-#define CE_ADM_INT_PCIE_PORT1_DEV_B_SHFT       7
-#define CE_ADM_INT_PCIE_PORT1_DEV_C_SHFT       8
-#define CE_ADM_INT_PCIE_PORT1_DEV_D_SHFT       9
-#define CE_ADM_INT_PCIE_PORT2_DEV_A_SHFT       10
-#define CE_ADM_INT_PCIE_PORT2_DEV_B_SHFT       11
-#define CE_ADM_INT_PCIE_PORT2_DEV_C_SHFT       12
-#define CE_ADM_INT_PCIE_PORT2_DEV_D_SHFT       13
-#define CE_ADM_INT_PCIE_MSG_SHFT               14 /*see int_dest_14*/
-#define CE_ADM_INT_PCIE_MSG_SLOT_0_SHFT                14
-#define CE_ADM_INT_PCIE_MSG_SLOT_1_SHFT                15
-#define CE_ADM_INT_PCIE_MSG_SLOT_2_SHFT                16
-#define CE_ADM_INT_PCIE_MSG_SLOT_3_SHFT                17
-#define CE_ADM_INT_PORT1_PM_PME_MSG_SHFT       22
-#define CE_ADM_INT_PORT2_PM_PME_MSG_SHFT       23
-
-/* ce_adm_force_int register bit defines */
-#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_A_SHFT 0
-#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_B_SHFT 1
-#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_C_SHFT 2
-#define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_D_SHFT 3
-#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_A_SHFT 4
-#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_B_SHFT 5
-#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_C_SHFT 6
-#define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_D_SHFT 7
-#define CE_ADM_FORCE_INT_ALWAYS_SHFT           8
-
-/* ce_adm_int_dest register bit masks & shifts */
-#define INTR_VECTOR_SHFT                       56
-
-/* ce_adm_error_mask and ce_adm_error_summary register bit masks */
-#define CE_ADM_ERR_CRM_SSP_REQ_INVALID                 (0x1ULL <<  0)
-#define CE_ADM_ERR_SSP_REQ_HEADER                      (0x1ULL <<  1)
-#define CE_ADM_ERR_SSP_RSP_HEADER                      (0x1ULL <<  2)
-#define CE_ADM_ERR_SSP_PROTOCOL_ERROR                  (0x1ULL <<  3)
-#define CE_ADM_ERR_SSP_SBE                             (0x1ULL <<  4)
-#define CE_ADM_ERR_SSP_MBE                             (0x1ULL <<  5)
-#define CE_ADM_ERR_CXM_CREDIT_OFLOW                    (0x1ULL <<  6)
-#define CE_ADM_ERR_DRE_SSP_REQ_INVAL                   (0x1ULL <<  7)
-#define CE_ADM_ERR_SSP_REQ_LONG                                (0x1ULL <<  8)
-#define CE_ADM_ERR_SSP_REQ_OFLOW                       (0x1ULL <<  9)
-#define CE_ADM_ERR_SSP_REQ_SHORT                       (0x1ULL << 10)
-#define CE_ADM_ERR_SSP_REQ_SIDEBAND                    (0x1ULL << 11)
-#define CE_ADM_ERR_SSP_REQ_ADDR_ERR                    (0x1ULL << 12)
-#define CE_ADM_ERR_SSP_REQ_BAD_BE                      (0x1ULL << 13)
-#define CE_ADM_ERR_PCIE_COMPL_TIMEOUT                  (0x1ULL << 14)
-#define CE_ADM_ERR_PCIE_UNEXP_COMPL                    (0x1ULL << 15)
-#define CE_ADM_ERR_PCIE_ERR_COMPL                      (0x1ULL << 16)
-#define CE_ADM_ERR_DRE_CREDIT_OFLOW                    (0x1ULL << 17)
-#define CE_ADM_ERR_DRE_SRAM_PE                         (0x1ULL << 18)
-#define CE_ADM_ERR_SSP_RSP_INVALID                     (0x1ULL << 19)
-#define CE_ADM_ERR_SSP_RSP_LONG                                (0x1ULL << 20)
-#define CE_ADM_ERR_SSP_RSP_SHORT                       (0x1ULL << 21)
-#define CE_ADM_ERR_SSP_RSP_SIDEBAND                    (0x1ULL << 22)
-#define CE_ADM_ERR_URE_SSP_RSP_UNEXP                   (0x1ULL << 23)
-#define CE_ADM_ERR_URE_SSP_WR_REQ_TIMEOUT              (0x1ULL << 24)
-#define CE_ADM_ERR_URE_SSP_RD_REQ_TIMEOUT              (0x1ULL << 25)
-#define CE_ADM_ERR_URE_ATE3240_PAGE_FAULT              (0x1ULL << 26)
-#define CE_ADM_ERR_URE_ATE40_PAGE_FAULT                        (0x1ULL << 27)
-#define CE_ADM_ERR_URE_CREDIT_OFLOW                    (0x1ULL << 28)
-#define CE_ADM_ERR_URE_SRAM_PE                         (0x1ULL << 29)
-#define CE_ADM_ERR_ADM_SSP_RSP_UNEXP                   (0x1ULL << 30)
-#define CE_ADM_ERR_ADM_SSP_REQ_TIMEOUT                 (0x1ULL << 31)
-#define CE_ADM_ERR_MMR_ACCESS_ERROR                    (0x1ULL << 32)
-#define CE_ADM_ERR_MMR_ADDR_ERROR                      (0x1ULL << 33)
-#define CE_ADM_ERR_ADM_CREDIT_OFLOW                    (0x1ULL << 34)
-#define CE_ADM_ERR_ADM_SRAM_PE                         (0x1ULL << 35)
-#define CE_ADM_ERR_DTL1_MIN_PDATA_CREDIT_ERR           (0x1ULL << 36)
-#define CE_ADM_ERR_DTL1_INF_COMPL_CRED_UPDT_ERR                (0x1ULL << 37)
-#define CE_ADM_ERR_DTL1_INF_POSTED_CRED_UPDT_ERR       (0x1ULL << 38)
-#define CE_ADM_ERR_DTL1_INF_NPOSTED_CRED_UPDT_ERR      (0x1ULL << 39)
-#define CE_ADM_ERR_DTL1_COMP_HD_CRED_MAX_ERR           (0x1ULL << 40)
-#define CE_ADM_ERR_DTL1_COMP_D_CRED_MAX_ERR            (0x1ULL << 41)
-#define CE_ADM_ERR_DTL1_NPOSTED_HD_CRED_MAX_ERR                (0x1ULL << 42)
-#define CE_ADM_ERR_DTL1_NPOSTED_D_CRED_MAX_ERR         (0x1ULL << 43)
-#define CE_ADM_ERR_DTL1_POSTED_HD_CRED_MAX_ERR         (0x1ULL << 44)
-#define CE_ADM_ERR_DTL1_POSTED_D_CRED_MAX_ERR          (0x1ULL << 45)
-#define CE_ADM_ERR_DTL2_MIN_PDATA_CREDIT_ERR           (0x1ULL << 46)
-#define CE_ADM_ERR_DTL2_INF_COMPL_CRED_UPDT_ERR                (0x1ULL << 47)
-#define CE_ADM_ERR_DTL2_INF_POSTED_CRED_UPDT_ERR       (0x1ULL << 48)
-#define CE_ADM_ERR_DTL2_INF_NPOSTED_CRED_UPDT_ERR      (0x1ULL << 49)
-#define CE_ADM_ERR_DTL2_COMP_HD_CRED_MAX_ERR           (0x1ULL << 50)
-#define CE_ADM_ERR_DTL2_COMP_D_CRED_MAX_ERR            (0x1ULL << 51)
-#define CE_ADM_ERR_DTL2_NPOSTED_HD_CRED_MAX_ERR                (0x1ULL << 52)
-#define CE_ADM_ERR_DTL2_NPOSTED_D_CRED_MAX_ERR         (0x1ULL << 53)
-#define CE_ADM_ERR_DTL2_POSTED_HD_CRED_MAX_ERR         (0x1ULL << 54)
-#define CE_ADM_ERR_DTL2_POSTED_D_CRED_MAX_ERR          (0x1ULL << 55)
-#define CE_ADM_ERR_PORT1_PCIE_COR_ERR                  (0x1ULL << 56)
-#define CE_ADM_ERR_PORT1_PCIE_NFAT_ERR                 (0x1ULL << 57)
-#define CE_ADM_ERR_PORT1_PCIE_FAT_ERR                  (0x1ULL << 58)
-#define CE_ADM_ERR_PORT2_PCIE_COR_ERR                  (0x1ULL << 59)
-#define CE_ADM_ERR_PORT2_PCIE_NFAT_ERR                 (0x1ULL << 60)
-#define CE_ADM_ERR_PORT2_PCIE_FAT_ERR                  (0x1ULL << 61)
-
-/* ce_adm_ure_ups_buf_barrier_flush register bit masks and shifts */
-#define FLUSH_SEL_PORT1_PIPE0_SHFT     0
-#define FLUSH_SEL_PORT1_PIPE1_SHFT     4
-#define FLUSH_SEL_PORT1_PIPE2_SHFT     8
-#define FLUSH_SEL_PORT1_PIPE3_SHFT     12
-#define FLUSH_SEL_PORT2_PIPE0_SHFT     16
-#define FLUSH_SEL_PORT2_PIPE1_SHFT     20
-#define FLUSH_SEL_PORT2_PIPE2_SHFT     24
-#define FLUSH_SEL_PORT2_PIPE3_SHFT     28
-
-/* ce_dre_config1 register bit masks and shifts */
-#define CE_DRE_RO_ENABLE               (0x1ULL << 0)
-#define CE_DRE_DYN_RO_ENABLE           (0x1ULL << 1)
-#define CE_DRE_SUP_CONFIG_COMP_ERROR   (0x1ULL << 2)
-#define CE_DRE_SUP_IO_COMP_ERROR       (0x1ULL << 3)
-#define CE_DRE_ADDR_MODE_SHFT          4
-
-/* ce_dre_config_req_status register bit masks */
-#define CE_DRE_LAST_CONFIG_COMPLETION  (0x7ULL << 0)
-#define CE_DRE_DOWNSTREAM_CONFIG_ERROR (0x1ULL << 3)
-#define CE_DRE_CONFIG_COMPLETION_VALID (0x1ULL << 4)
-#define CE_DRE_CONFIG_REQUEST_ACTIVE   (0x1ULL << 5)
-
-/* ce_ure_control register bit masks & shifts */
-#define CE_URE_RD_MRG_ENABLE           (0x1ULL << 0)
-#define CE_URE_WRT_MRG_ENABLE1         (0x1ULL << 4)
-#define CE_URE_WRT_MRG_ENABLE2         (0x1ULL << 5)
-#define CE_URE_WRT_MRG_TIMER_SHFT      12
-#define CE_URE_WRT_MRG_TIMER_MASK      (0x7FFULL << CE_URE_WRT_MRG_TIMER_SHFT)
-#define CE_URE_WRT_MRG_TIMER(x)                (((u64)(x) << \
-                                         CE_URE_WRT_MRG_TIMER_SHFT) & \
-                                        CE_URE_WRT_MRG_TIMER_MASK)
-#define CE_URE_RSPQ_BYPASS_DISABLE     (0x1ULL << 24)
-#define CE_URE_UPS_DAT1_PAR_DISABLE    (0x1ULL << 32)
-#define CE_URE_UPS_HDR1_PAR_DISABLE    (0x1ULL << 33)
-#define CE_URE_UPS_DAT2_PAR_DISABLE    (0x1ULL << 34)
-#define CE_URE_UPS_HDR2_PAR_DISABLE    (0x1ULL << 35)
-#define CE_URE_ATE_PAR_DISABLE         (0x1ULL << 36)
-#define CE_URE_RCI_PAR_DISABLE         (0x1ULL << 37)
-#define CE_URE_RSPQ_PAR_DISABLE                (0x1ULL << 38)
-#define CE_URE_DNS_DAT_PAR_DISABLE     (0x1ULL << 39)
-#define CE_URE_DNS_HDR_PAR_DISABLE     (0x1ULL << 40)
-#define CE_URE_MALFORM_DISABLE         (0x1ULL << 44)
-#define CE_URE_UNSUP_DISABLE           (0x1ULL << 45)
-
-/* ce_ure_page_map register bit masks & shifts */
-#define CE_URE_ATE3240_ENABLE          (0x1ULL << 0)
-#define CE_URE_ATE40_ENABLE            (0x1ULL << 1)
-#define CE_URE_PAGESIZE_SHFT           4
-#define CE_URE_PAGESIZE_MASK           (0x7ULL << CE_URE_PAGESIZE_SHFT)
-#define CE_URE_4K_PAGESIZE             (0x0ULL << CE_URE_PAGESIZE_SHFT)
-#define CE_URE_16K_PAGESIZE            (0x1ULL << CE_URE_PAGESIZE_SHFT)
-#define CE_URE_64K_PAGESIZE            (0x2ULL << CE_URE_PAGESIZE_SHFT)
-#define CE_URE_128K_PAGESIZE           (0x3ULL << CE_URE_PAGESIZE_SHFT)
-#define CE_URE_256K_PAGESIZE           (0x4ULL << CE_URE_PAGESIZE_SHFT)
-
-/* ce_ure_pipe_sel register bit masks & shifts */
-#define PKT_TRAFIC_SHRT                        16
-#define BUS_SRC_ID_SHFT                        8
-#define DEV_SRC_ID_SHFT                        3
-#define FNC_SRC_ID_SHFT                        0
-#define CE_URE_TC_MASK                 (0x07ULL << PKT_TRAFIC_SHRT)
-#define CE_URE_BUS_MASK                        (0xFFULL << BUS_SRC_ID_SHFT)
-#define CE_URE_DEV_MASK                        (0x1FULL << DEV_SRC_ID_SHFT)
-#define CE_URE_FNC_MASK                        (0x07ULL << FNC_SRC_ID_SHFT)
-#define CE_URE_PIPE_BUS(b)             (((u64)(b) << BUS_SRC_ID_SHFT) & \
-                                        CE_URE_BUS_MASK)
-#define CE_URE_PIPE_DEV(d)             (((u64)(d) << DEV_SRC_ID_SHFT) & \
-                                        CE_URE_DEV_MASK)
-#define CE_URE_PIPE_FNC(f)             (((u64)(f) << FNC_SRC_ID_SHFT) & \
-                                        CE_URE_FNC_MASK)
-
-#define CE_URE_SEL1_SHFT               0
-#define CE_URE_SEL2_SHFT               20
-#define CE_URE_SEL3_SHFT               40
-#define CE_URE_SEL1_MASK               (0x7FFFFULL << CE_URE_SEL1_SHFT)
-#define CE_URE_SEL2_MASK               (0x7FFFFULL << CE_URE_SEL2_SHFT)
-#define CE_URE_SEL3_MASK               (0x7FFFFULL << CE_URE_SEL3_SHFT)
-
-
-/* ce_ure_pipe_mask register bit masks & shifts */
-#define CE_URE_MASK1_SHFT              0
-#define CE_URE_MASK2_SHFT              20
-#define CE_URE_MASK3_SHFT              40
-#define CE_URE_MASK1_MASK              (0x7FFFFULL << CE_URE_MASK1_SHFT)
-#define CE_URE_MASK2_MASK              (0x7FFFFULL << CE_URE_MASK2_SHFT)
-#define CE_URE_MASK3_MASK              (0x7FFFFULL << CE_URE_MASK3_SHFT)
-
-
-/* ce_ure_pcie_control1 register bit masks & shifts */
-#define CE_URE_SI                      (0x1ULL << 0)
-#define CE_URE_ELAL_SHFT               4
-#define CE_URE_ELAL_MASK               (0x7ULL << CE_URE_ELAL_SHFT)
-#define CE_URE_ELAL_SET(n)             (((u64)(n) << CE_URE_ELAL_SHFT) & \
-                                        CE_URE_ELAL_MASK)
-#define CE_URE_ELAL1_SHFT              8
-#define CE_URE_ELAL1_MASK              (0x7ULL << CE_URE_ELAL1_SHFT)
-#define CE_URE_ELAL1_SET(n)            (((u64)(n) << CE_URE_ELAL1_SHFT) & \
-                                        CE_URE_ELAL1_MASK)
-#define CE_URE_SCC                     (0x1ULL << 12)
-#define CE_URE_PN1_SHFT                        16
-#define CE_URE_PN1_MASK                        (0xFFULL << CE_URE_PN1_SHFT)
-#define CE_URE_PN2_SHFT                        24
-#define CE_URE_PN2_MASK                        (0xFFULL << CE_URE_PN2_SHFT)
-#define CE_URE_PN1_SET(n)              (((u64)(n) << CE_URE_PN1_SHFT) & \
-                                        CE_URE_PN1_MASK)
-#define CE_URE_PN2_SET(n)              (((u64)(n) << CE_URE_PN2_SHFT) & \
-                                        CE_URE_PN2_MASK)
-
-/* ce_ure_pcie_control2 register bit masks & shifts */
-#define CE_URE_ABP                     (0x1ULL << 0)
-#define CE_URE_PCP                     (0x1ULL << 1)
-#define CE_URE_MSP                     (0x1ULL << 2)
-#define CE_URE_AIP                     (0x1ULL << 3)
-#define CE_URE_PIP                     (0x1ULL << 4)
-#define CE_URE_HPS                     (0x1ULL << 5)
-#define CE_URE_HPC                     (0x1ULL << 6)
-#define CE_URE_SPLV_SHFT               7
-#define CE_URE_SPLV_MASK               (0xFFULL << CE_URE_SPLV_SHFT)
-#define CE_URE_SPLV_SET(n)             (((u64)(n) << CE_URE_SPLV_SHFT) & \
-                                        CE_URE_SPLV_MASK)
-#define CE_URE_SPLS_SHFT               15
-#define CE_URE_SPLS_MASK               (0x3ULL << CE_URE_SPLS_SHFT)
-#define CE_URE_SPLS_SET(n)             (((u64)(n) << CE_URE_SPLS_SHFT) & \
-                                        CE_URE_SPLS_MASK)
-#define CE_URE_PSN1_SHFT               19
-#define CE_URE_PSN1_MASK               (0x1FFFULL << CE_URE_PSN1_SHFT)
-#define CE_URE_PSN2_SHFT               32
-#define CE_URE_PSN2_MASK               (0x1FFFULL << CE_URE_PSN2_SHFT)
-#define CE_URE_PSN1_SET(n)             (((u64)(n) << CE_URE_PSN1_SHFT) & \
-                                        CE_URE_PSN1_MASK)
-#define CE_URE_PSN2_SET(n)             (((u64)(n) << CE_URE_PSN2_SHFT) & \
-                                        CE_URE_PSN2_MASK)
-
-/*
- * PIO address space ranges for CE
- */
-
-/* Local CE Registers Space */
-#define CE_PIO_MMR                     0x00000000
-#define CE_PIO_MMR_LEN                 0x04000000
-
-/* PCI Compatible Config Space */
-#define CE_PIO_CONFIG_SPACE            0x04000000
-#define CE_PIO_CONFIG_SPACE_LEN                0x04000000
-
-/* PCI I/O Space Alias */
-#define CE_PIO_IO_SPACE_ALIAS          0x08000000
-#define CE_PIO_IO_SPACE_ALIAS_LEN      0x08000000
-
-/* PCI Enhanced Config Space */
-#define CE_PIO_E_CONFIG_SPACE          0x10000000
-#define CE_PIO_E_CONFIG_SPACE_LEN      0x10000000
-
-/* PCI I/O Space */
-#define CE_PIO_IO_SPACE                        0x100000000
-#define CE_PIO_IO_SPACE_LEN            0x100000000
-
-/* PCI MEM Space */
-#define CE_PIO_MEM_SPACE               0x200000000
-#define CE_PIO_MEM_SPACE_LEN           TIO_HWIN_SIZE
-
-
-/*
- * CE PCI Enhanced Config Space shifts & masks
- */
-#define CE_E_CONFIG_BUS_SHFT           20
-#define CE_E_CONFIG_BUS_MASK           (0xFF << CE_E_CONFIG_BUS_SHFT)
-#define CE_E_CONFIG_DEVICE_SHFT                15
-#define CE_E_CONFIG_DEVICE_MASK                (0x1F << CE_E_CONFIG_DEVICE_SHFT)
-#define CE_E_CONFIG_FUNC_SHFT          12
-#define CE_E_CONFIG_FUNC_MASK          (0x7  << CE_E_CONFIG_FUNC_SHFT)
-
-#endif /* __ASM_IA64_SN_TIOCE_H__ */
diff --git a/include/asm-ia64/sn/tioce_provider.h b/include/asm-ia64/sn/tioce_provider.h
deleted file mode 100644 (file)
index 32c32f3..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_CE_PROVIDER_H
-#define _ASM_IA64_SN_CE_PROVIDER_H
-
-#include <asm/sn/pcibus_provider_defs.h>
-#include <asm/sn/tioce.h>
-
-/*
- * Common TIOCE structure shared between the prom and kernel
- *
- * DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES TO THE
- * PROM VERSION.
- */
-struct tioce_common {
-       struct pcibus_bussoft   ce_pcibus;      /* common pciio header */
-
-       u32             ce_rev;
-       u64             ce_kernel_private;
-       u64             ce_prom_private;
-};
-
-struct tioce_kernel {
-       struct tioce_common     *ce_common;
-       spinlock_t              ce_lock;
-       struct list_head        ce_dmamap_list;
-
-       u64             ce_ate40_shadow[TIOCE_NUM_M40_ATES];
-       u64             ce_ate3240_shadow[TIOCE_NUM_M3240_ATES];
-       u32             ce_ate3240_pagesize;
-
-       u8                      ce_port1_secondary;
-
-       /* per-port resources */
-       struct {
-               int             dirmap_refcnt;
-               u64     dirmap_shadow;
-       } ce_port[TIOCE_NUM_PORTS];
-};
-
-struct tioce_dmamap {
-       struct list_head        ce_dmamap_list; /* headed by tioce_kernel */
-       u32             refcnt;
-
-       u64             nbytes;         /* # bytes mapped */
-
-       u64             ct_start;       /* coretalk start address */
-       u64             pci_start;      /* bus start address */
-
-       u64             __iomem *ate_hw;/* hw ptr of first ate in map */
-       u64             *ate_shadow;    /* shadow ptr of firat ate */
-       u16             ate_count;      /* # ate's in the map */
-};
-
-extern int tioce_init_provider(void);
-
-#endif  /* __ASM_IA64_SN_CE_PROVIDER_H */
diff --git a/include/asm-ia64/sn/tiocp.h b/include/asm-ia64/sn/tiocp.h
deleted file mode 100644 (file)
index e8ad0bb..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_PCI_TIOCP_H
-#define _ASM_IA64_SN_PCI_TIOCP_H
-
-#define TIOCP_HOST_INTR_ADDR            0x003FFFFFFFFFFFFFUL
-#define TIOCP_PCI64_CMDTYPE_MEM         (0x1ull << 60)
-#define TIOCP_PCI64_CMDTYPE_MSI         (0x3ull << 60)
-
-
-/*****************************************************************************
- *********************** TIOCP MMR structure mapping ***************************
- *****************************************************************************/
-
-struct tiocp{
-
-    /* 0x000000-0x00FFFF -- Local Registers */
-
-    /* 0x000000-0x000057 -- (Legacy Widget Space) Configuration */
-    u64                cp_id;                          /* 0x000000 */
-    u64                cp_stat;                        /* 0x000008 */
-    u64                cp_err_upper;                   /* 0x000010 */
-    u64                cp_err_lower;                   /* 0x000018 */
-    #define cp_err cp_err_lower
-    u64                cp_control;                     /* 0x000020 */
-    u64                cp_req_timeout;                 /* 0x000028 */
-    u64                cp_intr_upper;                  /* 0x000030 */
-    u64                cp_intr_lower;                  /* 0x000038 */
-    #define cp_intr cp_intr_lower
-    u64                cp_err_cmdword;                 /* 0x000040 */
-    u64                _pad_000048;                    /* 0x000048 */
-    u64                cp_tflush;                      /* 0x000050 */
-
-    /* 0x000058-0x00007F -- Bridge-specific Configuration */
-    u64                cp_aux_err;                     /* 0x000058 */
-    u64                cp_resp_upper;                  /* 0x000060 */
-    u64                cp_resp_lower;                  /* 0x000068 */
-    #define cp_resp cp_resp_lower
-    u64                cp_tst_pin_ctrl;                /* 0x000070 */
-    u64                cp_addr_lkerr;                  /* 0x000078 */
-
-    /* 0x000080-0x00008F -- PMU & MAP */
-    u64                cp_dir_map;                     /* 0x000080 */
-    u64                _pad_000088;                    /* 0x000088 */
-
-    /* 0x000090-0x00009F -- SSRAM */
-    u64                cp_map_fault;                   /* 0x000090 */
-    u64                _pad_000098;                    /* 0x000098 */
-
-    /* 0x0000A0-0x0000AF -- Arbitration */
-    u64                cp_arb;                         /* 0x0000A0 */
-    u64                _pad_0000A8;                    /* 0x0000A8 */
-
-    /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
-    u64                cp_ate_parity_err;              /* 0x0000B0 */
-    u64                _pad_0000B8;                    /* 0x0000B8 */
-
-    /* 0x0000C0-0x0000FF -- PCI/GIO */
-    u64                cp_bus_timeout;                 /* 0x0000C0 */
-    u64                cp_pci_cfg;                     /* 0x0000C8 */
-    u64                cp_pci_err_upper;               /* 0x0000D0 */
-    u64                cp_pci_err_lower;               /* 0x0000D8 */
-    #define cp_pci_err cp_pci_err_lower
-    u64                _pad_0000E0[4];                 /* 0x0000{E0..F8} */
-
-    /* 0x000100-0x0001FF -- Interrupt */
-    u64                cp_int_status;                  /* 0x000100 */
-    u64                cp_int_enable;                  /* 0x000108 */
-    u64                cp_int_rst_stat;                /* 0x000110 */
-    u64                cp_int_mode;                    /* 0x000118 */
-    u64                cp_int_device;                  /* 0x000120 */
-    u64                cp_int_host_err;                /* 0x000128 */
-    u64                cp_int_addr[8];                 /* 0x0001{30,,,68} */
-    u64                cp_err_int_view;                /* 0x000170 */
-    u64                cp_mult_int;                    /* 0x000178 */
-    u64                cp_force_always[8];             /* 0x0001{80,,,B8} */
-    u64                cp_force_pin[8];                /* 0x0001{C0,,,F8} */
-
-    /* 0x000200-0x000298 -- Device */
-    u64                cp_device[4];                   /* 0x0002{00,,,18} */
-    u64                _pad_000220[4];                 /* 0x0002{20,,,38} */
-    u64                cp_wr_req_buf[4];               /* 0x0002{40,,,58} */
-    u64                _pad_000260[4];                 /* 0x0002{60,,,78} */
-    u64                cp_rrb_map[2];                  /* 0x0002{80,,,88} */
-    #define cp_even_resp cp_rrb_map[0]                 /* 0x000280 */
-    #define cp_odd_resp  cp_rrb_map[1]                 /* 0x000288 */
-    u64                cp_resp_status;                 /* 0x000290 */
-    u64                cp_resp_clear;                  /* 0x000298 */
-
-    u64                _pad_0002A0[12];                /* 0x0002{A0..F8} */
-
-    /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
-    struct {
-       u64     upper;                          /* 0x0003{00,,,F0} */
-       u64     lower;                          /* 0x0003{08,,,F8} */
-    } cp_buf_addr_match[16];
-
-    /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
-    struct {
-       u64     flush_w_touch;                  /* 0x000{400,,,5C0} */
-       u64     flush_wo_touch;                 /* 0x000{408,,,5C8} */
-       u64     inflight;                       /* 0x000{410,,,5D0} */
-       u64     prefetch;                       /* 0x000{418,,,5D8} */
-       u64     total_pci_retry;                /* 0x000{420,,,5E0} */
-       u64     max_pci_retry;                  /* 0x000{428,,,5E8} */
-       u64     max_latency;                    /* 0x000{430,,,5F0} */
-       u64     clear_all;                      /* 0x000{438,,,5F8} */
-    } cp_buf_count[8];
-
-
-    /* 0x000600-0x0009FF -- PCI/X registers */
-    u64                cp_pcix_bus_err_addr;           /* 0x000600 */
-    u64                cp_pcix_bus_err_attr;           /* 0x000608 */
-    u64                cp_pcix_bus_err_data;           /* 0x000610 */
-    u64                cp_pcix_pio_split_addr;         /* 0x000618 */
-    u64                cp_pcix_pio_split_attr;         /* 0x000620 */
-    u64                cp_pcix_dma_req_err_attr;       /* 0x000628 */
-    u64                cp_pcix_dma_req_err_addr;       /* 0x000630 */
-    u64                cp_pcix_timeout;                /* 0x000638 */
-
-    u64                _pad_000640[24];                /* 0x000{640,,,6F8} */
-
-    /* 0x000700-0x000737 -- Debug Registers */
-    u64                cp_ct_debug_ctl;                /* 0x000700 */
-    u64                cp_br_debug_ctl;                /* 0x000708 */
-    u64                cp_mux3_debug_ctl;              /* 0x000710 */
-    u64                cp_mux4_debug_ctl;              /* 0x000718 */
-    u64                cp_mux5_debug_ctl;              /* 0x000720 */
-    u64                cp_mux6_debug_ctl;              /* 0x000728 */
-    u64                cp_mux7_debug_ctl;              /* 0x000730 */
-
-    u64                _pad_000738[89];                /* 0x000{738,,,9F8} */
-
-    /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
-    struct {
-       u64     cp_buf_addr;                    /* 0x000{A00,,,AF0} */
-       u64     cp_buf_attr;                    /* 0X000{A08,,,AF8} */
-    } cp_pcix_read_buf_64[16];
-
-    struct {
-       u64     cp_buf_addr;                    /* 0x000{B00,,,BE0} */
-       u64     cp_buf_attr;                    /* 0x000{B08,,,BE8} */
-       u64     cp_buf_valid;                   /* 0x000{B10,,,BF0} */
-       u64     __pad1;                         /* 0x000{B18,,,BF8} */
-    } cp_pcix_write_buf_64[8];
-
-    /* End of Local Registers -- Start of Address Map space */
-
-    char       _pad_000c00[0x010000 - 0x000c00];
-
-    /* 0x010000-0x011FF8 -- Internal ATE RAM (Auto Parity Generation) */
-    u64                cp_int_ate_ram[1024];           /* 0x010000-0x011FF8 */
-
-    char       _pad_012000[0x14000 - 0x012000];
-
-    /* 0x014000-0x015FF8 -- Internal ATE RAM (Manual Parity Generation) */
-    u64                cp_int_ate_ram_mp[1024];        /* 0x014000-0x015FF8 */
-
-    char       _pad_016000[0x18000 - 0x016000];
-
-    /* 0x18000-0x197F8 -- TIOCP Write Request Ram */
-    u64                cp_wr_req_lower[256];           /* 0x18000 - 0x187F8 */
-    u64                cp_wr_req_upper[256];           /* 0x18800 - 0x18FF8 */
-    u64                cp_wr_req_parity[256];          /* 0x19000 - 0x197F8 */
-
-    char       _pad_019800[0x1C000 - 0x019800];
-
-    /* 0x1C000-0x1EFF8 -- TIOCP Read Response Ram */
-    u64                cp_rd_resp_lower[512];          /* 0x1C000 - 0x1CFF8 */
-    u64                cp_rd_resp_upper[512];          /* 0x1D000 - 0x1DFF8 */
-    u64                cp_rd_resp_parity[512];         /* 0x1E000 - 0x1EFF8 */
-
-    char       _pad_01F000[0x20000 - 0x01F000];
-
-    /* 0x020000-0x021FFF -- Host Device (CP) Configuration Space (not used)  */
-    char       _pad_020000[0x021000 - 0x20000];
-
-    /* 0x021000-0x027FFF -- PCI Device Configuration Spaces */
-    union {
-       u8      c[0x1000 / 1];                  /* 0x02{0000,,,7FFF} */
-       u16     s[0x1000 / 2];                  /* 0x02{0000,,,7FFF} */
-       u32     l[0x1000 / 4];                  /* 0x02{0000,,,7FFF} */
-       u64     d[0x1000 / 8];                  /* 0x02{0000,,,7FFF} */
-       union {
-           u8  c[0x100 / 1];
-           u16 s[0x100 / 2];
-           u32 l[0x100 / 4];
-           u64 d[0x100 / 8];
-       } f[8];
-    } cp_type0_cfg_dev[7];                             /* 0x02{1000,,,7FFF} */
-
-    /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
-    union {
-       u8      c[0x1000 / 1];                  /* 0x028000-0x029000 */
-       u16     s[0x1000 / 2];                  /* 0x028000-0x029000 */
-       u32     l[0x1000 / 4];                  /* 0x028000-0x029000 */
-       u64     d[0x1000 / 8];                  /* 0x028000-0x029000 */
-       union {
-           u8  c[0x100 / 1];
-           u16 s[0x100 / 2];
-           u32 l[0x100 / 4];
-           u64 d[0x100 / 8];
-       } f[8];
-    } cp_type1_cfg;                                    /* 0x028000-0x029000 */
-
-    char               _pad_029000[0x030000-0x029000];
-
-    /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
-    union {
-       u8      c[8 / 1];
-       u16     s[8 / 2];
-       u32     l[8 / 4];
-       u64     d[8 / 8];
-    } cp_pci_iack;                                     /* 0x030000-0x030007 */
-
-    char               _pad_030007[0x040000-0x030008];
-
-    /* 0x040000-0x040007 -- PCIX Special Cycle */
-    union {
-       u8      c[8 / 1];
-       u16     s[8 / 2];
-       u32     l[8 / 4];
-       u64     d[8 / 8];
-    } cp_pcix_cycle;                                   /* 0x040000-0x040007 */
-
-    char               _pad_040007[0x200000-0x040008];
-
-    /* 0x200000-0x7FFFFF -- PCI/GIO Device Spaces */
-    union {
-       u8      c[0x100000 / 1];
-       u16     s[0x100000 / 2];
-       u32     l[0x100000 / 4];
-       u64     d[0x100000 / 8];
-    } cp_devio_raw[6];                                 /* 0x200000-0x7FFFFF */
-
-    #define cp_devio(n)  cp_devio_raw[((n)<2)?(n*2):(n+2)]
-
-    char               _pad_800000[0xA00000-0x800000];
-
-    /* 0xA00000-0xBFFFFF -- PCI/GIO Device Spaces w/flush  */
-    union {
-       u8      c[0x100000 / 1];
-       u16     s[0x100000 / 2];
-       u32     l[0x100000 / 4];
-       u64     d[0x100000 / 8];
-    } cp_devio_raw_flush[6];                           /* 0xA00000-0xBFFFFF */
-
-    #define cp_devio_flush(n)  cp_devio_raw_flush[((n)<2)?(n*2):(n+2)]
-
-};
-
-#endif         /* _ASM_IA64_SN_PCI_TIOCP_H */
diff --git a/include/asm-ia64/sn/tiocx.h b/include/asm-ia64/sn/tiocx.h
deleted file mode 100644 (file)
index d297284..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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) 2005 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef _ASM_IA64_SN_TIO_TIOCX_H
-#define _ASM_IA64_SN_TIO_TIOCX_H
-
-#ifdef __KERNEL__
-
-struct cx_id_s {
-       unsigned int part_num;
-       unsigned int mfg_num;
-       int nasid;
-};
-
-struct cx_dev {
-       struct cx_id_s cx_id;
-       int bt;                         /* board/blade type */
-       void *soft;                     /* driver specific */
-       struct hubdev_info *hubdev;
-       struct device dev;
-       struct cx_drv *driver;
-};
-
-struct cx_device_id {
-       unsigned int part_num;
-       unsigned int mfg_num;
-};
-
-struct cx_drv {
-       char *name;
-       const struct cx_device_id *id_table;
-       struct device_driver driver;
-       int (*probe) (struct cx_dev * dev, const struct cx_device_id * id);
-       int (*remove) (struct cx_dev * dev);
-};
-
-/* create DMA address by stripping AS bits */
-#define TIOCX_DMA_ADDR(a) (u64)((u64)(a) & 0xffffcfffffffffUL)
-
-#define TIOCX_TO_TIOCX_DMA_ADDR(a) (u64)(((u64)(a) & 0xfffffffff) |  \
-                                  ((((u64)(a)) & 0xffffc000000000UL) <<2))
-
-#define TIO_CE_ASIC_PARTNUM 0xce00
-#define TIOCX_CORELET 3
-
-/* These are taken from tio_mmr_as.h */
-#define TIO_ICE_FRZ_CFG               TIO_MMR_ADDR_MOD(0x00000000b0008100UL)
-#define TIO_ICE_PMI_TX_CFG            TIO_MMR_ADDR_MOD(0x00000000b000b100UL)
-#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3 TIO_MMR_ADDR_MOD(0x00000000b000be18UL)
-#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK 0x000000000000000fUL
-
-#define to_cx_dev(n) container_of(n, struct cx_dev, dev)
-#define to_cx_driver(drv) container_of(drv, struct cx_drv, driver)
-
-extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int);
-extern void tiocx_irq_free(struct sn_irq_info *);
-extern int cx_device_unregister(struct cx_dev *);
-extern int cx_device_register(nasid_t, int, int, struct hubdev_info *, int);
-extern int cx_driver_unregister(struct cx_drv *);
-extern int cx_driver_register(struct cx_drv *);
-extern u64 tiocx_dma_addr(u64 addr);
-extern u64 tiocx_swin_base(int nasid);
-extern void tiocx_mmr_store(int nasid, u64 offset, u64 value);
-extern u64 tiocx_mmr_load(int nasid, u64 offset);
-
-#endif                         //  __KERNEL__
-#endif                         // _ASM_IA64_SN_TIO_TIOCX__
diff --git a/include/asm-ia64/sn/types.h b/include/asm-ia64/sn/types.h
deleted file mode 100644 (file)
index 8e04ee2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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) 1999,2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
- * Copyright (C) 1999 by Ralf Baechle
- */
-#ifndef _ASM_IA64_SN_TYPES_H
-#define _ASM_IA64_SN_TYPES_H
-
-#include <linux/types.h>
-
-typedef unsigned long  cpuid_t;
-typedef signed short   nasid_t;        /* node id in numa-as-id space */
-typedef signed char    partid_t;       /* partition ID type */
-typedef unsigned int    moduleid_t;     /* user-visible module number type */
-typedef unsigned int    cmoduleid_t;    /* kernel compact module id type */
-typedef unsigned char  slotid_t;       /* slot (blade) within module */
-typedef unsigned char  slabid_t;       /* slab (asic) within slot */
-typedef u64 nic_t;
-typedef unsigned long iopaddr_t;
-typedef unsigned long paddr_t;
-typedef short cnodeid_t;
-
-#endif /* _ASM_IA64_SN_TYPES_H */
diff --git a/include/asm-ia64/socket.h b/include/asm-ia64/socket.h
deleted file mode 100644 (file)
index d5ef0aa..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _ASM_IA64_SOCKET_H
-#define _ASM_IA64_SOCKET_H
-
-/*
- * Socket related defines.
- *
- * Based on <asm-i386/socket.h>.
- *
- * Modified 1998-2000
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <asm/sockios.h>
-
-/* For setsockopt(2) */
-#define SOL_SOCKET     1
-
-#define SO_DEBUG       1
-#define SO_REUSEADDR   2
-#define SO_TYPE                3
-#define SO_ERROR       4
-#define SO_DONTROUTE   5
-#define SO_BROADCAST   6
-#define SO_SNDBUF      7
-#define SO_RCVBUF      8
-#define SO_SNDBUFFORCE 32
-#define SO_RCVBUFFORCE 33
-#define SO_KEEPALIVE   9
-#define SO_OOBINLINE   10
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_LINGER      13
-#define SO_BSDCOMPAT   14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED    16
-#define SO_PEERCRED    17
-#define SO_RCVLOWAT    18
-#define SO_SNDLOWAT    19
-#define SO_RCVTIMEO    20
-#define SO_SNDTIMEO    21
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
-#define SO_SECURITY_ENCRYPTION_NETWORK         24
-
-#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_ACCEPTCONN          30
-
-#define SO_PEERSEC             31
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-#define SO_MARK                        36
-
-#endif /* _ASM_IA64_SOCKET_H */
diff --git a/include/asm-ia64/sockios.h b/include/asm-ia64/sockios.h
deleted file mode 100644 (file)
index 15c9246..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ASM_IA64_SOCKIOS_H
-#define _ASM_IA64_SOCKIOS_H
-
-/*
- * Socket-level I/O control calls.
- *
- * Based on <asm-i386/sockios.h>.
- *
- * Modified 1998, 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-#define FIOSETOWN      0x8901
-#define SIOCSPGRP      0x8902
-#define FIOGETOWN      0x8903
-#define SIOCGPGRP      0x8904
-#define SIOCATMARK     0x8905
-#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
-
-#endif /* _ASM_IA64_SOCKIOS_H */
diff --git a/include/asm-ia64/sparsemem.h b/include/asm-ia64/sparsemem.h
deleted file mode 100644 (file)
index 67a7c40..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ASM_IA64_SPARSEMEM_H
-#define _ASM_IA64_SPARSEMEM_H
-
-#ifdef CONFIG_SPARSEMEM
-/*
- * SECTION_SIZE_BITS            2^N: how big each section will be
- * MAX_PHYSMEM_BITS             2^N: how much memory we can have in that space
- */
-
-#define SECTION_SIZE_BITS      (30)
-#define MAX_PHYSMEM_BITS       (50)
-#ifdef CONFIG_FORCE_MAX_ZONEORDER
-#if ((CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS)
-#undef SECTION_SIZE_BITS
-#define SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT)
-#endif
-#endif
-
-#endif /* CONFIG_SPARSEMEM */
-#endif /* _ASM_IA64_SPARSEMEM_H */
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
deleted file mode 100644 (file)
index 0229fb9..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-#ifndef _ASM_IA64_SPINLOCK_H
-#define _ASM_IA64_SPINLOCK_H
-
-/*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- *
- * This file is used for SMP configurations only.
- */
-
-#include <linux/compiler.h>
-#include <linux/kernel.h>
-#include <linux/bitops.h>
-
-#include <asm/atomic.h>
-#include <asm/intrinsics.h>
-#include <asm/system.h>
-
-#define __raw_spin_lock_init(x)                        ((x)->lock = 0)
-
-#ifdef ASM_SUPPORTED
-/*
- * Try to get the lock.  If we fail to get the lock, make a non-standard call to
- * ia64_spinlock_contention().  We do not use a normal call because that would force all
- * callers of __raw_spin_lock() to be non-leaf routines.  Instead, ia64_spinlock_contention() is
- * carefully coded to touch only those registers that __raw_spin_lock() marks "clobbered".
- */
-
-#define IA64_SPINLOCK_CLOBBERS "ar.ccv", "ar.pfs", "p14", "p15", "r27", "r28", "r29", "r30", "b6", "memory"
-
-static inline void
-__raw_spin_lock_flags (raw_spinlock_t *lock, unsigned long flags)
-{
-       register volatile unsigned int *ptr asm ("r31") = &lock->lock;
-
-#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
-# ifdef CONFIG_ITANIUM
-       /* don't use brl on Itanium... */
-       asm volatile ("{\n\t"
-                     "  mov ar.ccv = r0\n\t"
-                     "  mov r28 = ip\n\t"
-                     "  mov r30 = 1;;\n\t"
-                     "}\n\t"
-                     "cmpxchg4.acq r30 = [%1], r30, ar.ccv\n\t"
-                     "movl r29 = ia64_spinlock_contention_pre3_4;;\n\t"
-                     "cmp4.ne p14, p0 = r30, r0\n\t"
-                     "mov b6 = r29;;\n\t"
-                     "mov r27=%2\n\t"
-                     "(p14) br.cond.spnt.many b6"
-                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
-# else
-       asm volatile ("{\n\t"
-                     "  mov ar.ccv = r0\n\t"
-                     "  mov r28 = ip\n\t"
-                     "  mov r30 = 1;;\n\t"
-                     "}\n\t"
-                     "cmpxchg4.acq r30 = [%1], r30, ar.ccv;;\n\t"
-                     "cmp4.ne p14, p0 = r30, r0\n\t"
-                     "mov r27=%2\n\t"
-                     "(p14) brl.cond.spnt.many ia64_spinlock_contention_pre3_4;;"
-                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
-# endif /* CONFIG_MCKINLEY */
-#else
-# ifdef CONFIG_ITANIUM
-       /* don't use brl on Itanium... */
-       /* mis-declare, so we get the entry-point, not it's function descriptor: */
-       asm volatile ("mov r30 = 1\n\t"
-                     "mov r27=%2\n\t"
-                     "mov ar.ccv = r0;;\n\t"
-                     "cmpxchg4.acq r30 = [%0], r30, ar.ccv\n\t"
-                     "movl r29 = ia64_spinlock_contention;;\n\t"
-                     "cmp4.ne p14, p0 = r30, r0\n\t"
-                     "mov b6 = r29;;\n\t"
-                     "(p14) br.call.spnt.many b6 = b6"
-                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
-# else
-       asm volatile ("mov r30 = 1\n\t"
-                     "mov r27=%2\n\t"
-                     "mov ar.ccv = r0;;\n\t"
-                     "cmpxchg4.acq r30 = [%0], r30, ar.ccv;;\n\t"
-                     "cmp4.ne p14, p0 = r30, r0\n\t"
-                     "(p14) brl.call.spnt.many b6=ia64_spinlock_contention;;"
-                     : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
-# endif /* CONFIG_MCKINLEY */
-#endif
-}
-
-#define __raw_spin_lock(lock) __raw_spin_lock_flags(lock, 0)
-
-/* Unlock by doing an ordered store and releasing the cacheline with nta */
-static inline void __raw_spin_unlock(raw_spinlock_t *x) {
-       barrier();
-       asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(x));
-}
-
-#else /* !ASM_SUPPORTED */
-#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
-# define __raw_spin_lock(x)                                                            \
-do {                                                                                   \
-       __u32 *ia64_spinlock_ptr = (__u32 *) (x);                                       \
-       __u64 ia64_spinlock_val;                                                        \
-       ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0);                 \
-       if (unlikely(ia64_spinlock_val)) {                                              \
-               do {                                                                    \
-                       while (*ia64_spinlock_ptr)                                      \
-                               ia64_barrier();                                         \
-                       ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0); \
-               } while (ia64_spinlock_val);                                            \
-       }                                                                               \
-} while (0)
-#define __raw_spin_unlock(x)   do { barrier(); ((raw_spinlock_t *) x)->lock = 0; } while (0)
-#endif /* !ASM_SUPPORTED */
-
-#define __raw_spin_is_locked(x)                ((x)->lock != 0)
-#define __raw_spin_trylock(x)          (cmpxchg_acq(&(x)->lock, 0, 1) == 0)
-#define __raw_spin_unlock_wait(lock) \
-       do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
-
-#define __raw_read_can_lock(rw)                (*(volatile int *)(rw) >= 0)
-#define __raw_write_can_lock(rw)       (*(volatile int *)(rw) == 0)
-
-#define __raw_read_lock(rw)                                                            \
-do {                                                                                   \
-       raw_rwlock_t *__read_lock_ptr = (rw);                                           \
-                                                                                       \
-       while (unlikely(ia64_fetchadd(1, (int *) __read_lock_ptr, acq) < 0)) {          \
-               ia64_fetchadd(-1, (int *) __read_lock_ptr, rel);                        \
-               while (*(volatile int *)__read_lock_ptr < 0)                            \
-                       cpu_relax();                                                    \
-       }                                                                               \
-} while (0)
-
-#define __raw_read_unlock(rw)                                  \
-do {                                                           \
-       raw_rwlock_t *__read_lock_ptr = (rw);                   \
-       ia64_fetchadd(-1, (int *) __read_lock_ptr, rel);        \
-} while (0)
-
-#ifdef ASM_SUPPORTED
-#define __raw_write_lock(rw)                                                   \
-do {                                                                           \
-       __asm__ __volatile__ (                                                  \
-               "mov ar.ccv = r0\n"                                             \
-               "dep r29 = -1, r0, 31, 1;;\n"                                   \
-               "1:\n"                                                          \
-               "ld4 r2 = [%0];;\n"                                             \
-               "cmp4.eq p0,p7 = r0,r2\n"                                       \
-               "(p7) br.cond.spnt.few 1b \n"                                   \
-               "cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n"                       \
-               "cmp4.eq p0,p7 = r0, r2\n"                                      \
-               "(p7) br.cond.spnt.few 1b;;\n"                                  \
-               :: "r"(rw) : "ar.ccv", "p7", "r2", "r29", "memory");            \
-} while(0)
-
-#define __raw_write_trylock(rw)                                                        \
-({                                                                             \
-       register long result;                                                   \
-                                                                               \
-       __asm__ __volatile__ (                                                  \
-               "mov ar.ccv = r0\n"                                             \
-               "dep r29 = -1, r0, 31, 1;;\n"                                   \
-               "cmpxchg4.acq %0 = [%1], r29, ar.ccv\n"                         \
-               : "=r"(result) : "r"(rw) : "ar.ccv", "r29", "memory");          \
-       (result == 0);                                                          \
-})
-
-static inline void __raw_write_unlock(raw_rwlock_t *x)
-{
-       u8 *y = (u8 *)x;
-       barrier();
-       asm volatile ("st1.rel.nta [%0] = r0\n\t" :: "r"(y+3) : "memory" );
-}
-
-#else /* !ASM_SUPPORTED */
-
-#define __raw_write_lock(l)                                                            \
-({                                                                                     \
-       __u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1);                       \
-       __u32 *ia64_write_lock_ptr = (__u32 *) (l);                                     \
-       do {                                                                            \
-               while (*ia64_write_lock_ptr)                                            \
-                       ia64_barrier();                                                 \
-               ia64_val = ia64_cmpxchg4_acq(ia64_write_lock_ptr, ia64_set_val, 0);     \
-       } while (ia64_val);                                                             \
-})
-
-#define __raw_write_trylock(rw)                                                \
-({                                                                     \
-       __u64 ia64_val;                                                 \
-       __u64 ia64_set_val = ia64_dep_mi(-1, 0, 31,1);                  \
-       ia64_val = ia64_cmpxchg4_acq((__u32 *)(rw), ia64_set_val, 0);   \
-       (ia64_val == 0);                                                \
-})
-
-static inline void __raw_write_unlock(raw_rwlock_t *x)
-{
-       barrier();
-       x->write_lock = 0;
-}
-
-#endif /* !ASM_SUPPORTED */
-
-static inline int __raw_read_trylock(raw_rwlock_t *x)
-{
-       union {
-               raw_rwlock_t lock;
-               __u32 word;
-       } old, new;
-       old.lock = new.lock = *x;
-       old.lock.write_lock = new.lock.write_lock = 0;
-       ++new.lock.read_counter;
-       return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
-}
-
-#define _raw_spin_relax(lock)  cpu_relax()
-#define _raw_read_relax(lock)  cpu_relax()
-#define _raw_write_relax(lock) cpu_relax()
-
-#endif /*  _ASM_IA64_SPINLOCK_H */
diff --git a/include/asm-ia64/spinlock_types.h b/include/asm-ia64/spinlock_types.h
deleted file mode 100644 (file)
index 474e46f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _ASM_IA64_SPINLOCK_TYPES_H
-#define _ASM_IA64_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 read_counter      : 31;
-       volatile unsigned int write_lock        :  1;
-} raw_rwlock_t;
-
-#define __RAW_RW_LOCK_UNLOCKED         { 0, 0 }
-
-#endif
diff --git a/include/asm-ia64/stat.h b/include/asm-ia64/stat.h
deleted file mode 100644 (file)
index 367bb90..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _ASM_IA64_STAT_H
-#define _ASM_IA64_STAT_H
-
-/*
- * Modified 1998, 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-struct stat {
-       unsigned long   st_dev;
-       unsigned long   st_ino;
-       unsigned long   st_nlink;
-       unsigned int    st_mode;
-       unsigned int    st_uid;
-       unsigned int    st_gid;
-       unsigned int    __pad0;
-       unsigned long   st_rdev;
-       unsigned long   st_size;
-       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;
-       unsigned long   st_blksize;
-       long            st_blocks;
-       unsigned long   __unused[3];
-};
-
-#define STAT_HAVE_NSEC 1
-
-struct ia64_oldstat {
-       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;
-       unsigned int    __pad1;
-       unsigned long   st_size;
-       unsigned long   st_atime;
-       unsigned long   st_mtime;
-       unsigned long   st_ctime;
-       unsigned int    st_blksize;
-       int             st_blocks;
-       unsigned int    __unused1;
-       unsigned int    __unused2;
-};
-
-#endif /* _ASM_IA64_STAT_H */
diff --git a/include/asm-ia64/statfs.h b/include/asm-ia64/statfs.h
deleted file mode 100644 (file)
index 8110979..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _ASM_IA64_STATFS_H
-#define _ASM_IA64_STATFS_H
-
-/*
- * Based on <asm-i386/statfs.h>.
- *
- * Modified 1998, 1999, 2003
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#ifndef __KERNEL_STRICT_NAMES
-# include <linux/types.h>
-typedef __kernel_fsid_t        fsid_t;
-#endif
-
-/*
- * This is ugly --- we're already 64-bit, so just duplicate the definitions
- */
-struct statfs {
-       long f_type;
-       long f_bsize;
-       long f_blocks;
-       long f_bfree;
-       long f_bavail;
-       long f_files;
-       long f_ffree;
-       __kernel_fsid_t f_fsid;
-       long f_namelen;
-       long f_frsize;
-       long f_spare[5];
-};
-
-
-struct statfs64 {
-       long f_type;
-       long f_bsize;
-       long f_blocks;
-       long f_bfree;
-       long f_bavail;
-       long f_files;
-       long f_ffree;
-       __kernel_fsid_t f_fsid;
-       long f_namelen;
-       long f_frsize;
-       long f_spare[5];
-};
-
-struct compat_statfs64 {
-       __u32 f_type;
-       __u32 f_bsize;
-       __u64 f_blocks;
-       __u64 f_bfree;
-       __u64 f_bavail;
-       __u64 f_files;
-       __u64 f_ffree;
-       __kernel_fsid_t f_fsid;
-       __u32 f_namelen;
-       __u32 f_frsize;
-       __u32 f_spare[5];
-} __attribute__((packed));
-
-#endif /* _ASM_IA64_STATFS_H */
diff --git a/include/asm-ia64/string.h b/include/asm-ia64/string.h
deleted file mode 100644 (file)
index 85fd65c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _ASM_IA64_STRING_H
-#define _ASM_IA64_STRING_H
-
-/*
- * Here is where we want to put optimized versions of the string
- * routines.
- *
- * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#define __HAVE_ARCH_STRLEN     1 /* see arch/ia64/lib/strlen.S */
-#define __HAVE_ARCH_MEMSET     1 /* see arch/ia64/lib/memset.S */
-#define __HAVE_ARCH_MEMCPY     1 /* see arch/ia64/lib/memcpy.S */
-
-extern __kernel_size_t strlen (const char *);
-extern void *memcpy (void *, const void *, __kernel_size_t);
-extern void *memset (void *, int, __kernel_size_t);
-
-#endif /* _ASM_IA64_STRING_H */
diff --git a/include/asm-ia64/suspend.h b/include/asm-ia64/suspend.h
deleted file mode 100644 (file)
index b05bbb6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* dummy (must be non-empty to prevent prejudicial removal...) */
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
deleted file mode 100644 (file)
index 927a381..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-#ifndef _ASM_IA64_SYSTEM_H
-#define _ASM_IA64_SYSTEM_H
-
-/*
- * System defines. Note that this is included both from .c and .S
- * files, so it does only defines, not any C code.  This is based
- * on information published in the Processor Abstraction Layer
- * and the System Abstraction Layer manual.
- *
- * Copyright (C) 1998-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
- * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
- */
-
-#include <asm/kregs.h>
-#include <asm/page.h>
-#include <asm/pal.h>
-#include <asm/percpu.h>
-
-#define GATE_ADDR              RGN_BASE(RGN_GATE)
-
-/*
- * 0xa000000000000000+2*PERCPU_PAGE_SIZE
- * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
- */
-#define KERNEL_START            (GATE_ADDR+__IA64_UL_CONST(0x100000000))
-#define PERCPU_ADDR            (-PERCPU_PAGE_SIZE)
-#define LOAD_OFFSET            (KERNEL_START - KERNEL_TR_PAGE_SIZE)
-
-#ifndef __ASSEMBLY__
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
-
-struct pci_vector_struct {
-       __u16 segment;  /* PCI Segment number */
-       __u16 bus;      /* PCI Bus number */
-       __u32 pci_id;   /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */
-       __u8 pin;       /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */
-       __u32 irq;      /* IRQ assigned */
-};
-
-extern struct ia64_boot_param {
-       __u64 command_line;             /* physical address of command line arguments */
-       __u64 efi_systab;               /* physical address of EFI system table */
-       __u64 efi_memmap;               /* physical address of EFI memory map */
-       __u64 efi_memmap_size;          /* size of EFI memory map */
-       __u64 efi_memdesc_size;         /* size of an EFI memory map descriptor */
-       __u32 efi_memdesc_version;      /* memory descriptor version */
-       struct {
-               __u16 num_cols; /* number of columns on console output device */
-               __u16 num_rows; /* number of rows on console output device */
-               __u16 orig_x;   /* cursor's x position */
-               __u16 orig_y;   /* cursor's y position */
-       } console_info;
-       __u64 fpswa;            /* physical address of the fpswa interface */
-       __u64 initrd_start;
-       __u64 initrd_size;
-} *ia64_boot_param;
-
-/*
- * Macros to force memory ordering.  In these descriptions, "previous"
- * and "subsequent" refer to program order; "visible" means that all
- * architecturally visible effects of a memory access have occurred
- * (at a minimum, this means the memory has been read or written).
- *
- *   wmb():    Guarantees that all preceding stores to memory-
- *             like regions are visible before any subsequent
- *             stores and that all following stores will be
- *             visible only after all previous stores.
- *   rmb():    Like wmb(), but for reads.
- *   mb():     wmb()/rmb() combo, i.e., all previous memory
- *             accesses are visible before all subsequent
- *             accesses and vice versa.  This is also known as
- *             a "fence."
- *
- * Note: "mb()" and its variants cannot be used as a fence to order
- * accesses to memory mapped I/O registers.  For that, mf.a needs to
- * be used.  However, we don't want to always use mf.a because (a)
- * it's (presumably) much slower than mf and (b) mf.a is supported for
- * sequential memory pages only.
- */
-#define mb()   ia64_mf()
-#define rmb()  mb()
-#define wmb()  mb()
-#define read_barrier_depends() do { } while(0)
-
-#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
-
-/*
- * XXX check on this ---I suspect what Linus really wants here is
- * acquire vs release semantics but we can't discuss this stuff with
- * Linus just yet.  Grrr...
- */
-#define set_mb(var, value)     do { (var) = (value); mb(); } while (0)
-
-#define safe_halt()         ia64_pal_halt_light()    /* PAL_HALT_LIGHT */
-
-/*
- * The group barrier in front of the rsm & ssm are necessary to ensure
- * that none of the previous instructions in the same group are
- * affected by the rsm/ssm.
- */
-/* For spinlocks etc */
-
-/*
- * - clearing psr.i is implicitly serialized (visible by next insn)
- * - setting psr.i requires data serialization
- * - we need a stop-bit before reading PSR because we sometimes
- *   write a floating-point register right before reading the PSR
- *   and that writes to PSR.mfl
- */
-#ifdef CONFIG_PARAVIRT
-#define __local_save_flags()   ia64_get_psr_i()
-#else
-#define __local_save_flags()   ia64_getreg(_IA64_REG_PSR)
-#endif
-
-#define __local_irq_save(x)                    \
-do {                                           \
-       ia64_stop();                            \
-       (x) = __local_save_flags();             \
-       ia64_stop();                            \
-       ia64_rsm(IA64_PSR_I);                   \
-} while (0)
-
-#define __local_irq_disable()                  \
-do {                                           \
-       ia64_stop();                            \
-       ia64_rsm(IA64_PSR_I);                   \
-} while (0)
-
-#define __local_irq_restore(x) ia64_intrin_local_irq_restore((x) & IA64_PSR_I)
-
-#ifdef CONFIG_IA64_DEBUG_IRQ
-
-  extern unsigned long last_cli_ip;
-
-# define __save_ip()           last_cli_ip = ia64_getreg(_IA64_REG_IP)
-
-# define local_irq_save(x)                                     \
-do {                                                           \
-       unsigned long __psr;                                    \
-                                                               \
-       __local_irq_save(__psr);                                \
-       if (__psr & IA64_PSR_I)                                 \
-               __save_ip();                                    \
-       (x) = __psr;                                            \
-} while (0)
-
-# define local_irq_disable()   do { unsigned long __x; local_irq_save(__x); } while (0)
-
-# define local_irq_restore(x)                                  \
-do {                                                           \
-       unsigned long __old_psr, __psr = (x);                   \
-                                                               \
-       local_save_flags(__old_psr);                            \
-       __local_irq_restore(__psr);                             \
-       if ((__old_psr & IA64_PSR_I) && !(__psr & IA64_PSR_I))  \
-               __save_ip();                                    \
-} while (0)
-
-#else /* !CONFIG_IA64_DEBUG_IRQ */
-# define local_irq_save(x)     __local_irq_save(x)
-# define local_irq_disable()   __local_irq_disable()
-# define local_irq_restore(x)  __local_irq_restore(x)
-#endif /* !CONFIG_IA64_DEBUG_IRQ */
-
-#define local_irq_enable()     ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
-#define local_save_flags(flags)        ({ ia64_stop(); (flags) = __local_save_flags(); })
-
-#define irqs_disabled()                                \
-({                                             \
-       unsigned long __ia64_id_flags;          \
-       local_save_flags(__ia64_id_flags);      \
-       (__ia64_id_flags & IA64_PSR_I) == 0;    \
-})
-
-#ifdef __KERNEL__
-
-#ifdef CONFIG_IA32_SUPPORT
-# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0)
-#else
-# define IS_IA32_PROCESS(regs)         0
-struct task_struct;
-static inline void ia32_save_state(struct task_struct *t __attribute__((unused))){}
-static inline void ia32_load_state(struct task_struct *t __attribute__((unused))){}
-#endif
-
-/*
- * Context switch from one thread to another.  If the two threads have
- * different address spaces, schedule() has already taken care of
- * switching to the new address space by calling switch_mm().
- *
- * Disabling access to the fph partition and the debug-register
- * context switch MUST be done before calling ia64_switch_to() since a
- * newly created thread returns directly to
- * ia64_ret_from_syscall_clear_r8.
- */
-extern struct task_struct *ia64_switch_to (void *next_task);
-
-struct task_struct;
-
-extern void ia64_save_extra (struct task_struct *task);
-extern void ia64_load_extra (struct task_struct *task);
-
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next);
-# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n)
-#else
-# define IA64_ACCOUNT_ON_SWITCH(p,n)
-#endif
-
-#ifdef CONFIG_PERFMON
-  DECLARE_PER_CPU(unsigned long, pfm_syst_info);
-# define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1)
-#else
-# define PERFMON_IS_SYSWIDE() (0)
-#endif
-
-#define IA64_HAS_EXTRA_STATE(t)                                                        \
-       ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)       \
-        || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE())
-
-#define __switch_to(prev,next,last) do {                                                        \
-       IA64_ACCOUNT_ON_SWITCH(prev, next);                                                      \
-       if (IA64_HAS_EXTRA_STATE(prev))                                                          \
-               ia64_save_extra(prev);                                                           \
-       if (IA64_HAS_EXTRA_STATE(next))                                                          \
-               ia64_load_extra(next);                                                           \
-       ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next);                      \
-       (last) = ia64_switch_to((next));                                                         \
-} while (0)
-
-#ifdef CONFIG_SMP
-/*
- * In the SMP case, we save the fph state when context-switching away from a thread that
- * modified fph.  This way, when the thread gets scheduled on another CPU, the CPU can
- * pick up the state from task->thread.fph, avoiding the complication of having to fetch
- * the latest fph state from another CPU.  In other words: eager save, lazy restore.
- */
-# define switch_to(prev,next,last) do {                                                \
-       if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) {                               \
-               ia64_psr(task_pt_regs(prev))->mfh = 0;                  \
-               (prev)->thread.flags |= IA64_THREAD_FPH_VALID;                  \
-               __ia64_save_fpu((prev)->thread.fph);                            \
-       }                                                                       \
-       __switch_to(prev, next, last);                                          \
-       /* "next" in old context is "current" in new context */                 \
-       if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) &&        \
-                    (task_cpu(current) !=                                     \
-                                     task_thread_info(current)->last_cpu))) { \
-               platform_migrate(current);                                     \
-               task_thread_info(current)->last_cpu = task_cpu(current);       \
-       }                                                                      \
-} while (0)
-#else
-# define switch_to(prev,next,last)     __switch_to(prev, next, last)
-#endif
-
-#define __ARCH_WANT_UNLOCKED_CTXSW
-#define ARCH_HAS_PREFETCH_SWITCH_STACK
-#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
-
-void cpu_idle_wait(void);
-
-#define arch_align_stack(x) (x)
-
-void default_idle(void);
-
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_system_vtime(struct task_struct *);
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _ASM_IA64_SYSTEM_H */
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h
deleted file mode 100644 (file)
index 9f162e0..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-#ifndef _ASM_IA64_TERMBITS_H
-#define _ASM_IA64_TERMBITS_H
-
-/*
- * Based on <asm-i386/termbits.h>.
- *
- * Modified 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- *
- * 99/01/28    Added new baudrates
- */
-
-#include <linux/posix_types.h>
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-};
-
-struct termios2 {
-       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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* 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 IUCLC  0001000
-#define IXON   0002000
-#define IXANY  0004000
-#define IXOFF  0010000
-#define IMAXBEL        0020000
-#define IUTF8  0040000
-
-/* c_oflag bits */
-#define OPOST  0000001
-#define OLCUC  0000002
-#define ONLCR  0000004
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-#define OFILL  0000100
-#define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
-#define VTDLY  0040000
-#define   VT0  0000000
-#define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
-
-/* c_cflag bit meaning */
-#define CBAUD  0010017
-#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 CSIZE  0000060
-#define   CS5  0000000
-#define   CS6  0000020
-#define   CS7  0000040
-#define   CS8  0000060
-#define CSTOPB 0000100
-#define CREAD  0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL  0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define    BOTHER 0010000
-#define    B57600 0010001
-#define   B115200 0010002
-#define   B230400 0010003
-#define   B460800 0010004
-#define   B500000 0010005
-#define   B576000 0010006
-#define   B921600 0010007
-#define  B1000000 0010010
-#define  B1152000 0010011
-#define  B1500000 0010012
-#define  B2000000 0010013
-#define  B2500000 0010014
-#define  B3000000 0010015
-#define  B3500000 0010016
-#define  B4000000 0010017
-#define CIBAUD   002003600000          /* input baud rate */
-#define CMSPAR   010000000000          /* mark or space (stick) parity */
-#define CRTSCTS          020000000000          /* flow control */
-
-#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
-
-/* c_lflag bits */
-#define ISIG   0000001
-#define ICANON 0000002
-#define XCASE  0000004
-#define ECHO   0000010
-#define ECHOE  0000020
-#define ECHOK  0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL        0001000
-#define ECHOPRT        0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif /* _ASM_IA64_TERMBITS_H */
diff --git a/include/asm-ia64/termios.h b/include/asm-ia64/termios.h
deleted file mode 100644 (file)
index 689d218..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef _ASM_IA64_TERMIOS_H
-#define _ASM_IA64_TERMIOS_H
-
-/*
- * Modified 1999
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- *
- * 99/01/28    Added N_IRDA and N_SMSBLOCK
- */
-
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
-
-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 */
-};
-
-/* modem lines */
-#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
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-# ifdef __KERNEL__
-
-/*     intr=^C         quit=^\         erase=del       kill=^U
-       eof=^D          vtime=\0        vmin=\1         sxtc=\0
-       start=^Q        stop=^S         susp=^Z         eol=\0
-       reprint=^R      discard=^U      werase=^W       lnext=^V
-       eol2=\0
-*/
-#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
-
-/*
- * Translate a "termio" structure into a "termios". Ugh.
- */
-#define SET_LOW_TERMIOS_BITS(termios, termio, x) {     \
-       unsigned short __tmp;                           \
-       get_user(__tmp,&(termio)->x);                   \
-       *(unsigned short *) &(termios)->x = __tmp;      \
-}
-
-#define user_termio_to_kernel_termios(termios, termio)         \
-({                                                             \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag);         \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag);         \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag);         \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag);         \
-       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC);   \
-})
-
-/*
- * Translate a "termios" structure into a "termio". Ugh.
- */
-#define kernel_termios_to_user_termio(termio, termios)         \
-({                                                             \
-       put_user((termios)->c_iflag, &(termio)->c_iflag);       \
-       put_user((termios)->c_oflag, &(termio)->c_oflag);       \
-       put_user((termios)->c_cflag, &(termio)->c_cflag);       \
-       put_user((termios)->c_lflag, &(termio)->c_lflag);       \
-       put_user((termios)->c_line,  &(termio)->c_line);        \
-       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC);     \
-})
-
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
-#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
-
-# endif /* __KERNEL__ */
-
-#endif /* _ASM_IA64_TERMIOS_H */
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
deleted file mode 100644 (file)
index 7c60fcd..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-#ifndef _ASM_IA64_THREAD_INFO_H
-#define _ASM_IA64_THREAD_INFO_H
-
-#ifndef ASM_OFFSETS_C
-#include <asm/asm-offsets.h>
-#endif
-#include <asm/processor.h>
-#include <asm/ptrace.h>
-
-#define PREEMPT_ACTIVE_BIT 30
-#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
-
-#ifndef __ASSEMBLY__
-
-/*
- * On IA-64, we want to keep the task structure and kernel stack together, so they can be
- * mapped by a single TLB entry and so they can be addressed by the "current" pointer
- * without having to do pointer masking.
- */
-struct thread_info {
-       struct task_struct *task;       /* XXX not really needed, except for dup_task_struct() */
-       struct exec_domain *exec_domain;/* execution domain */
-       __u32 flags;                    /* thread_info flags (see TIF_*) */
-       __u32 cpu;                      /* current CPU */
-       __u32 last_cpu;                 /* Last CPU thread ran on */
-       __u32 status;                   /* Thread synchronous flags */
-       mm_segment_t addr_limit;        /* user-level address space limit */
-       int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
-       struct restart_block restart_block;
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       __u64 ac_stamp;
-       __u64 ac_leave;
-       __u64 ac_stime;
-       __u64 ac_utime;
-#endif
-};
-
-#define THREAD_SIZE                    KERNEL_STACK_SIZE
-
-#define INIT_THREAD_INFO(tsk)                  \
-{                                              \
-       .task           = &tsk,                 \
-       .exec_domain    = &default_exec_domain, \
-       .flags          = 0,                    \
-       .cpu            = 0,                    \
-       .addr_limit     = KERNEL_DS,            \
-       .preempt_count  = 0,                    \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
-}
-
-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
-#ifndef ASM_OFFSETS_C
-/* how to get the thread information struct from C */
-#define current_thread_info()  ((struct thread_info *) ((char *) current + IA64_TASK_SIZE))
-#define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
-#define task_thread_info(tsk)  ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
-#else
-#define current_thread_info()  ((struct thread_info *) 0)
-#define alloc_thread_info(tsk) ((struct thread_info *) 0)
-#define task_thread_info(tsk)  ((struct thread_info *) 0)
-#endif
-#define free_thread_info(ti)   /* nothing */
-#define task_stack_page(tsk)   ((void *)(tsk))
-
-#define __HAVE_THREAD_FUNCTIONS
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-#define setup_thread_stack(p, org)                     \
-       *task_thread_info(p) = *task_thread_info(org);  \
-       task_thread_info(p)->ac_stime = 0;              \
-       task_thread_info(p)->ac_utime = 0;              \
-       task_thread_info(p)->task = (p);
-#else
-#define setup_thread_stack(p, org) \
-       *task_thread_info(p) = *task_thread_info(org); \
-       task_thread_info(p)->task = (p);
-#endif
-#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)
-
-#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
-#define alloc_task_struct()    ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
-#define free_task_struct(tsk)  free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
-
-#define tsk_set_notify_resume(tsk) \
-       set_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME)
-extern void tsk_clear_notify_resume(struct task_struct *tsk);
-#endif /* !__ASSEMBLY */
-
-/*
- * thread information flags
- * - these are process state flags that various assembly files may need to access
- * - pending work-to-be-done flags are in least-significant 16 bits, other flags
- *   in top 16 bits
- */
-#define TIF_SIGPENDING         0       /* signal pending */
-#define TIF_NEED_RESCHED       1       /* rescheduling necessary */
-#define TIF_SYSCALL_TRACE      2       /* syscall trace active */
-#define TIF_SYSCALL_AUDIT      3       /* syscall auditing active */
-#define TIF_SINGLESTEP         4       /* restore singlestep on return to user mode */
-#define TIF_NOTIFY_RESUME      6       /* resumption notification requested */
-#define TIF_POLLING_NRFLAG     16      /* true if poll_idle() is polling TIF_NEED_RESCHED */
-#define TIF_MEMDIE             17
-#define TIF_MCA_INIT           18      /* this task is processing MCA or INIT */
-#define TIF_DB_DISABLED                19      /* debug trap disabled for fsyscall */
-#define TIF_FREEZE             20      /* is freezing for suspend */
-#define TIF_RESTORE_RSE                21      /* user RBS is newer than kernel RBS */
-
-#define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
-#define _TIF_SYSCALL_AUDIT     (1 << TIF_SYSCALL_AUDIT)
-#define _TIF_SINGLESTEP                (1 << TIF_SINGLESTEP)
-#define _TIF_SYSCALL_TRACEAUDIT        (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
-#define _TIF_NOTIFY_RESUME     (1 << TIF_NOTIFY_RESUME)
-#define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
-#define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
-#define _TIF_POLLING_NRFLAG    (1 << TIF_POLLING_NRFLAG)
-#define _TIF_MCA_INIT          (1 << TIF_MCA_INIT)
-#define _TIF_DB_DISABLED       (1 << TIF_DB_DISABLED)
-#define _TIF_FREEZE            (1 << TIF_FREEZE)
-#define _TIF_RESTORE_RSE       (1 << TIF_RESTORE_RSE)
-
-/* "work to do on user-return" bits */
-#define TIF_ALLWORK_MASK       (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
-                                _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
-/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
-#define TIF_WORK_MASK          (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
-
-#define TS_POLLING             1       /* true if in idle loop and not sleeping */
-#define TS_RESTORE_SIGMASK     2       /* restore signal mask in do_signal() */
-
-#define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING)
-
-#ifndef __ASSEMBLY__
-#define HAVE_SET_RESTORE_SIGMASK       1
-static inline void set_restore_sigmask(void)
-{
-       struct thread_info *ti = current_thread_info();
-       ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, &ti->flags);
-}
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_THREAD_INFO_H */
diff --git a/include/asm-ia64/timex.h b/include/asm-ia64/timex.h
deleted file mode 100644 (file)
index 05a6baf..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ASM_IA64_TIMEX_H
-#define _ASM_IA64_TIMEX_H
-
-/*
- * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-/*
- * 2001/01/18 davidm   Removed CLOCK_TICK_RATE.  It makes no sense on IA-64.
- *                     Also removed cacheflush_time as it's entirely unused.
- */
-
-#include <asm/intrinsics.h>
-#include <asm/processor.h>
-
-typedef unsigned long cycles_t;
-
-extern void (*ia64_udelay)(unsigned long usecs);
-
-/*
- * For performance reasons, we don't want to define CLOCK_TICK_TRATE as
- * local_cpu_data->itc_rate.  Fortunately, we don't have to, either: according to George
- * Anzinger, 1/CLOCK_TICK_RATE is taken as the resolution of the timer clock.  The time
- * calculation assumes that you will use enough of these so that your tick size <= 1/HZ.
- * If the calculation shows that your CLOCK_TICK_RATE can not supply exactly 1/HZ ticks,
- * the actual value is calculated and used to update the wall clock each jiffie.  Setting
- * the CLOCK_TICK_RATE to x*HZ insures that the calculation will find no errors.  Hence we
- * pick a multiple of HZ which gives us a (totally virtual) CLOCK_TICK_RATE of about
- * 100MHz.
- */
-#define CLOCK_TICK_RATE                (HZ * 100000UL)
-
-static inline cycles_t
-get_cycles (void)
-{
-       cycles_t ret;
-
-       ret = ia64_getreg(_IA64_REG_AR_ITC);
-       return ret;
-}
-
-#endif /* _ASM_IA64_TIMEX_H */
diff --git a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h
deleted file mode 100644 (file)
index 20d8a39..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-#ifndef _ASM_IA64_TLB_H
-#define _ASM_IA64_TLB_H
-/*
- * Based on <asm-generic/tlb.h>.
- *
- * Copyright (C) 2002-2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-/*
- * Removing a translation from a page table (including TLB-shootdown) is a four-step
- * procedure:
- *
- *     (1) Flush (virtual) caches --- ensures virtual memory is coherent with kernel memory
- *         (this is a no-op on ia64).
- *     (2) Clear the relevant portions of the page-table
- *     (3) Flush the TLBs --- ensures that stale content is gone from CPU TLBs
- *     (4) Release the pages that were freed up in step (2).
- *
- * Note that the ordering of these steps is crucial to avoid races on MP machines.
- *
- * The Linux kernel defines several platform-specific hooks for TLB-shootdown.  When
- * unmapping a portion of the virtual address space, these hooks are called according to
- * the following template:
- *
- *     tlb <- tlb_gather_mmu(mm, full_mm_flush);       // start unmap for address space MM
- *     {
- *       for each vma that needs a shootdown do {
- *         tlb_start_vma(tlb, vma);
- *           for each page-table-entry PTE that needs to be removed do {
- *             tlb_remove_tlb_entry(tlb, pte, address);
- *             if (pte refers to a normal page) {
- *               tlb_remove_page(tlb, page);
- *             }
- *           }
- *         tlb_end_vma(tlb, vma);
- *       }
- *     }
- *     tlb_finish_mmu(tlb, start, end);        // finish unmap for address space MM
- */
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-#include <linux/swap.h>
-
-#include <asm/pgalloc.h>
-#include <asm/processor.h>
-#include <asm/tlbflush.h>
-#include <asm/machvec.h>
-
-#ifdef CONFIG_SMP
-# define FREE_PTE_NR           2048
-# define tlb_fast_mode(tlb)    ((tlb)->nr == ~0U)
-#else
-# define FREE_PTE_NR           0
-# define tlb_fast_mode(tlb)    (1)
-#endif
-
-struct mmu_gather {
-       struct mm_struct        *mm;
-       unsigned int            nr;             /* == ~0U => fast mode */
-       unsigned char           fullmm;         /* non-zero means full mm flush */
-       unsigned char           need_flush;     /* really unmapped some PTEs? */
-       unsigned long           start_addr;
-       unsigned long           end_addr;
-       struct page             *pages[FREE_PTE_NR];
-};
-
-struct ia64_tr_entry {
-       u64 ifa;
-       u64 itir;
-       u64 pte;
-       u64 rr;
-}; /*Record for tr entry!*/
-
-extern int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size);
-extern void ia64_ptr_entry(u64 target_mask, int slot);
-
-extern struct ia64_tr_entry __per_cpu_idtrs[NR_CPUS][2][IA64_TR_ALLOC_MAX];
-
-/*
- region register macros
-*/
-#define RR_TO_VE(val)   (((val) >> 0) & 0x0000000000000001)
-#define RR_VE(val)     (((val) & 0x0000000000000001) << 0)
-#define RR_VE_MASK     0x0000000000000001L
-#define RR_VE_SHIFT    0
-#define RR_TO_PS(val)  (((val) >> 2) & 0x000000000000003f)
-#define RR_PS(val)     (((val) & 0x000000000000003f) << 2)
-#define RR_PS_MASK     0x00000000000000fcL
-#define RR_PS_SHIFT    2
-#define RR_RID_MASK    0x00000000ffffff00L
-#define RR_TO_RID(val)         ((val >> 8) & 0xffffff)
-
-/* Users of the generic TLB shootdown code must declare this storage space. */
-DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
-
-/*
- * Flush the TLB for address range START to END and, if not in fast mode, release the
- * freed pages that where gathered up to this point.
- */
-static inline void
-ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
-{
-       unsigned int nr;
-
-       if (!tlb->need_flush)
-               return;
-       tlb->need_flush = 0;
-
-       if (tlb->fullmm) {
-               /*
-                * Tearing down the entire address space.  This happens both as a result
-                * of exit() and execve().  The latter case necessitates the call to
-                * flush_tlb_mm() here.
-                */
-               flush_tlb_mm(tlb->mm);
-       } else if (unlikely (end - start >= 1024*1024*1024*1024UL
-                            || REGION_NUMBER(start) != REGION_NUMBER(end - 1)))
-       {
-               /*
-                * If we flush more than a tera-byte or across regions, we're probably
-                * better off just flushing the entire TLB(s).  This should be very rare
-                * and is not worth optimizing for.
-                */
-               flush_tlb_all();
-       } else {
-               /*
-                * XXX fix me: flush_tlb_range() should take an mm pointer instead of a
-                * vma pointer.
-                */
-               struct vm_area_struct vma;
-
-               vma.vm_mm = tlb->mm;
-               /* flush the address range from the tlb: */
-               flush_tlb_range(&vma, start, end);
-               /* now flush the virt. page-table area mapping the address range: */
-               flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end));
-       }
-
-       /* lastly, release the freed pages */
-       nr = tlb->nr;
-       if (!tlb_fast_mode(tlb)) {
-               unsigned long i;
-               tlb->nr = 0;
-               tlb->start_addr = ~0UL;
-               for (i = 0; i < nr; ++i)
-                       free_page_and_swap_cache(tlb->pages[i]);
-       }
-}
-
-/*
- * Return a pointer to an initialized struct mmu_gather.
- */
-static inline struct mmu_gather *
-tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush)
-{
-       struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
-
-       tlb->mm = mm;
-       /*
-        * Use fast mode if only 1 CPU is online.
-        *
-        * It would be tempting to turn on fast-mode for full_mm_flush as well.  But this
-        * doesn't work because of speculative accesses and software prefetching: the page
-        * table of "mm" may (and usually is) the currently active page table and even
-        * though the kernel won't do any user-space accesses during the TLB shoot down, a
-        * compiler might use speculation or lfetch.fault on what happens to be a valid
-        * user-space address.  This in turn could trigger a TLB miss fault (or a VHPT
-        * walk) and re-insert a TLB entry we just removed.  Slow mode avoids such
-        * problems.  (We could make fast-mode work by switching the current task to a
-        * different "mm" during the shootdown.) --davidm 08/02/2002
-        */
-       tlb->nr = (num_online_cpus() == 1) ? ~0U : 0;
-       tlb->fullmm = full_mm_flush;
-       tlb->start_addr = ~0UL;
-       return tlb;
-}
-
-/*
- * Called at the end of the shootdown operation to free up any resources that were
- * collected.
- */
-static inline void
-tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end)
-{
-       /*
-        * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and
-        * tlb->end_addr.
-        */
-       ia64_tlb_flush_mmu(tlb, start, end);
-
-       /* keep the page table cache within bounds */
-       check_pgt_cache();
-
-       put_cpu_var(mmu_gathers);
-}
-
-/*
- * Logically, this routine frees PAGE.  On MP machines, the actual freeing of the page
- * must be delayed until after the TLB has been flushed (see comments at the beginning of
- * this file).
- */
-static inline void
-tlb_remove_page (struct mmu_gather *tlb, struct page *page)
-{
-       tlb->need_flush = 1;
-
-       if (tlb_fast_mode(tlb)) {
-               free_page_and_swap_cache(page);
-               return;
-       }
-       tlb->pages[tlb->nr++] = page;
-       if (tlb->nr >= FREE_PTE_NR)
-               ia64_tlb_flush_mmu(tlb, tlb->start_addr, tlb->end_addr);
-}
-
-/*
- * Remove TLB entry for PTE mapped at virtual address ADDRESS.  This is called for any
- * PTE, not just those pointing to (normal) physical memory.
- */
-static inline void
-__tlb_remove_tlb_entry (struct mmu_gather *tlb, pte_t *ptep, unsigned long address)
-{
-       if (tlb->start_addr == ~0UL)
-               tlb->start_addr = address;
-       tlb->end_addr = address + PAGE_SIZE;
-}
-
-#define tlb_migrate_finish(mm) platform_tlb_migrate_finish(mm)
-
-#define tlb_start_vma(tlb, vma)                        do { } while (0)
-#define tlb_end_vma(tlb, vma)                  do { } while (0)
-
-#define tlb_remove_tlb_entry(tlb, ptep, addr)          \
-do {                                                   \
-       tlb->need_flush = 1;                            \
-       __tlb_remove_tlb_entry(tlb, ptep, addr);        \
-} while (0)
-
-#define pte_free_tlb(tlb, ptep)                                \
-do {                                                   \
-       tlb->need_flush = 1;                            \
-       __pte_free_tlb(tlb, ptep);                      \
-} while (0)
-
-#define pmd_free_tlb(tlb, ptep)                                \
-do {                                                   \
-       tlb->need_flush = 1;                            \
-       __pmd_free_tlb(tlb, ptep);                      \
-} while (0)
-
-#define pud_free_tlb(tlb, pudp)                                \
-do {                                                   \
-       tlb->need_flush = 1;                            \
-       __pud_free_tlb(tlb, pudp);                      \
-} while (0)
-
-#endif /* _ASM_IA64_TLB_H */
diff --git a/include/asm-ia64/tlbflush.h b/include/asm-ia64/tlbflush.h
deleted file mode 100644 (file)
index 3be25df..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _ASM_IA64_TLBFLUSH_H
-#define _ASM_IA64_TLBFLUSH_H
-
-/*
- * Copyright (C) 2002 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-
-#include <linux/mm.h>
-
-#include <asm/intrinsics.h>
-#include <asm/mmu_context.h>
-#include <asm/page.h>
-
-/*
- * Now for some TLB flushing routines.  This is the kind of stuff that
- * can be very expensive, so try to avoid them whenever possible.
- */
-extern void setup_ptcg_sem(int max_purges, int from_palo);
-
-/*
- * Flush everything (kernel mapping may also have changed due to
- * vmalloc/vfree).
- */
-extern void local_flush_tlb_all (void);
-
-#ifdef CONFIG_SMP
-  extern void smp_flush_tlb_all (void);
-  extern void smp_flush_tlb_mm (struct mm_struct *mm);
-  extern void smp_flush_tlb_cpumask (cpumask_t xcpumask);
-# define flush_tlb_all()       smp_flush_tlb_all()
-#else
-# define flush_tlb_all()       local_flush_tlb_all()
-# define smp_flush_tlb_cpumask(m) local_flush_tlb_all()
-#endif
-
-static inline void
-local_finish_flush_tlb_mm (struct mm_struct *mm)
-{
-       if (mm == current->active_mm)
-               activate_context(mm);
-}
-
-/*
- * Flush a specified user mapping.  This is called, e.g., as a result of fork() and
- * exit().  fork() ends up here because the copy-on-write mechanism needs to write-protect
- * the PTEs of the parent task.
- */
-static inline void
-flush_tlb_mm (struct mm_struct *mm)
-{
-       if (!mm)
-               return;
-
-       set_bit(mm->context, ia64_ctx.flushmap);
-       mm->context = 0;
-
-       if (atomic_read(&mm->mm_users) == 0)
-               return;         /* happens as a result of exit_mmap() */
-
-#ifdef CONFIG_SMP
-       smp_flush_tlb_mm(mm);
-#else
-       local_finish_flush_tlb_mm(mm);
-#endif
-}
-
-extern void flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end);
-
-/*
- * Page-granular tlb flush.
- */
-static inline void
-flush_tlb_page (struct vm_area_struct *vma, unsigned long addr)
-{
-#ifdef CONFIG_SMP
-       flush_tlb_range(vma, (addr & PAGE_MASK), (addr & PAGE_MASK) + PAGE_SIZE);
-#else
-       if (vma->vm_mm == current->active_mm)
-               ia64_ptcl(addr, (PAGE_SHIFT << 2));
-       else
-               vma->vm_mm->context = 0;
-#endif
-}
-
-/*
- * Flush the local TLB. Invoked from another cpu using an IPI.
- */
-#ifdef CONFIG_SMP
-void smp_local_flush_tlb(void);
-#else
-#define smp_local_flush_tlb()
-#endif
-
-static inline void flush_tlb_kernel_range(unsigned long start,
-                                         unsigned long end)
-{
-       flush_tlb_all();        /* XXX fix me */
-}
-
-#endif /* _ASM_IA64_TLBFLUSH_H */
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
deleted file mode 100644 (file)
index 32863b3..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * linux/include/asm-ia64/topology.h
- *
- * Copyright (C) 2002, Erich Focht, NEC
- *
- * All rights reserved.
- *
- * 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.
- */
-#ifndef _ASM_IA64_TOPOLOGY_H
-#define _ASM_IA64_TOPOLOGY_H
-
-#include <asm/acpi.h>
-#include <asm/numa.h>
-#include <asm/smp.h>
-
-#ifdef CONFIG_NUMA
-
-/* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
-#define PENALTY_FOR_NODE_WITH_CPUS 255
-
-/*
- * Distance above which we begin to use zone reclaim
- */
-#define RECLAIM_DISTANCE 15
-
-/*
- * Returns the number of the node containing CPU 'cpu'
- */
-#define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
-
-/*
- * Returns a bitmask of CPUs on Node 'node'.
- */
-#define node_to_cpumask(node) (node_to_cpu_mask[node])
-
-/*
- * Returns the number of the node containing Node 'nid'.
- * Not implemented here. Multi-level hierarchies detected with
- * the help of node_distance().
- */
-#define parent_node(nid) (nid)
-
-/*
- * Returns the number of the first CPU on Node 'node'.
- */
-#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
-
-/*
- * Determines the node for a given pci bus
- */
-#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
-
-void build_cpu_to_node_map(void);
-
-#define SD_CPU_INIT (struct sched_domain) {            \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
-       .min_interval           = 1,                    \
-       .max_interval           = 4,                    \
-       .busy_factor            = 64,                   \
-       .imbalance_pct          = 125,                  \
-       .cache_nice_tries       = 2,                    \
-       .busy_idx               = 2,                    \
-       .idle_idx               = 1,                    \
-       .newidle_idx            = 2,                    \
-       .wake_idx               = 1,                    \
-       .forkexec_idx           = 1,                    \
-       .flags                  = SD_LOAD_BALANCE       \
-                               | SD_BALANCE_NEWIDLE    \
-                               | SD_BALANCE_EXEC       \
-                               | SD_WAKE_AFFINE,       \
-       .last_balance           = jiffies,              \
-       .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
-}
-
-/* sched_domains SD_NODE_INIT for IA64 NUMA machines */
-#define SD_NODE_INIT (struct sched_domain) {           \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
-       .min_interval           = 8,                    \
-       .max_interval           = 8*(min(num_online_cpus(), 32)), \
-       .busy_factor            = 64,                   \
-       .imbalance_pct          = 125,                  \
-       .cache_nice_tries       = 2,                    \
-       .busy_idx               = 3,                    \
-       .idle_idx               = 2,                    \
-       .newidle_idx            = 2,                    \
-       .wake_idx               = 1,                    \
-       .forkexec_idx           = 1,                    \
-       .flags                  = SD_LOAD_BALANCE       \
-                               | SD_BALANCE_EXEC       \
-                               | SD_BALANCE_FORK       \
-                               | SD_SERIALIZE          \
-                               | SD_WAKE_BALANCE,      \
-       .last_balance           = jiffies,              \
-       .balance_interval       = 64,                   \
-       .nr_balance_failed      = 0,                    \
-}
-
-#endif /* CONFIG_NUMA */
-
-#ifdef CONFIG_SMP
-#define topology_physical_package_id(cpu)      (cpu_data(cpu)->socket_id)
-#define topology_core_id(cpu)                  (cpu_data(cpu)->core_id)
-#define topology_core_siblings(cpu)            (cpu_core_map[cpu])
-#define topology_thread_siblings(cpu)          (per_cpu(cpu_sibling_map, cpu))
-#define smt_capable()                          (smp_num_siblings > 1)
-#endif
-
-extern void arch_fix_phys_package_id(int num, u32 slot);
-
-#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
-                                       CPU_MASK_ALL : \
-                                       node_to_cpumask(pcibus_to_node(bus)) \
-                               )
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h
deleted file mode 100644 (file)
index e36b371..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _ASM_IA64_TYPES_H
-#define _ASM_IA64_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.
- *
- * Based on <asm-alpha/types.h>.
- *
- * Modified 1998-2000, 2002
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <asm-generic/int-l64.h>
-
-#ifdef __ASSEMBLY__
-# define __IA64_UL(x)          (x)
-# define __IA64_UL_CONST(x)    x
-
-# ifdef __KERNEL__
-#  define BITS_PER_LONG 64
-# endif
-
-#else
-# define __IA64_UL(x)          ((unsigned long)(x))
-# define __IA64_UL_CONST(x)    x##UL
-
-typedef unsigned int umode_t;
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-# ifdef __KERNEL__
-
-#define BITS_PER_LONG 64
-
-/* DMA addresses are 64-bits wide, in general.  */
-
-typedef u64 dma_addr_t;
-
-# endif /* __KERNEL__ */
-#endif /* !__ASSEMBLY__ */
-
-#endif /* _ASM_IA64_TYPES_H */
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h
deleted file mode 100644 (file)
index 449c8c0..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-#ifndef _ASM_IA64_UACCESS_H
-#define _ASM_IA64_UACCESS_H
-
-/*
- * This file defines various macros to transfer memory areas across
- * the user/kernel boundary.  This needs to be done carefully because
- * this code is executed in kernel mode and uses user-specified
- * addresses.  Thus, we need to be careful not to let the user to
- * trick us into accessing kernel memory that would normally be
- * inaccessible.  This code is also fairly performance sensitive,
- * so we want to spend as little time doing safety checks as
- * possible.
- *
- * To make matters a bit more interesting, these macros sometimes also
- * called from within the kernel itself, in which case the address
- * validity check must be skipped.  The get_fs() macro tells us what
- * to do: if get_fs()==USER_DS, checking is performed, if
- * get_fs()==KERNEL_DS, checking is bypassed.
- *
- * Note that even if the memory area specified by the user is in a
- * valid address range, it is still possible that we'll get a page
- * fault while accessing it.  This is handled by filling out an
- * exception handler fixup entry for each instruction that has the
- * potential to fault.  When such a fault occurs, the page fault
- * handler checks to see whether the faulting instruction has a fixup
- * associated and, if so, sets r8 to -EFAULT and clears r9 to 0 and
- * then resumes execution at the continuation point.
- *
- * Based on <asm-alpha/uaccess.h>.
- *
- * Copyright (C) 1998, 1999, 2001-2004 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <linux/compiler.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/page-flags.h>
-#include <linux/mm.h>
-
-#include <asm/intrinsics.h>
-#include <asm/pgtable.h>
-#include <asm/io.h>
-
-/*
- * For historical reasons, the following macros are grossly misnamed:
- */
-#define KERNEL_DS      ((mm_segment_t) { ~0UL })               /* cf. access_ok() */
-#define USER_DS                ((mm_segment_t) { TASK_SIZE-1 })        /* cf. access_ok() */
-
-#define VERIFY_READ    0
-#define VERIFY_WRITE   1
-
-#define get_ds()  (KERNEL_DS)
-#define get_fs()  (current_thread_info()->addr_limit)
-#define set_fs(x) (current_thread_info()->addr_limit = (x))
-
-#define segment_eq(a, b)       ((a).seg == (b).seg)
-
-/*
- * When accessing user memory, we need to make sure the entire area really is in
- * user-level space.  In order to do this efficiently, we make sure that the page at
- * address TASK_SIZE is never valid.  We also need to make sure that the address doesn't
- * point inside the virtually mapped linear page table.
- */
-#define __access_ok(addr, size, segment)                                               \
-({                                                                                     \
-       __chk_user_ptr(addr);                                                           \
-       (likely((unsigned long) (addr) <= (segment).seg)                                \
-        && ((segment).seg == KERNEL_DS.seg                                             \
-            || likely(REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT)));        \
-})
-#define access_ok(type, addr, size)    __access_ok((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.
- *
- * 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)))
-
-extern long __put_user_unaligned_unknown (void);
-
-#define __put_user_unaligned(x, ptr)                                                           \
-({                                                                                             \
-       long __ret;                                                                             \
-       switch (sizeof(*(ptr))) {                                                               \
-               case 1: __ret = __put_user((x), (ptr)); break;                                  \
-               case 2: __ret = (__put_user((x), (u8 __user *)(ptr)))                           \
-                       | (__put_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break;              \
-               case 4: __ret = (__put_user((x), (u16 __user *)(ptr)))                          \
-                       | (__put_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break;            \
-               case 8: __ret = (__put_user((x), (u32 __user *)(ptr)))                          \
-                       | (__put_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break;            \
-               default: __ret = __put_user_unaligned_unknown();                                \
-       }                                                                                       \
-       __ret;                                                                                  \
-})
-
-extern long __get_user_unaligned_unknown (void);
-
-#define __get_user_unaligned(x, ptr)                                                           \
-({                                                                                             \
-       long __ret;                                                                             \
-       switch (sizeof(*(ptr))) {                                                               \
-               case 1: __ret = __get_user((x), (ptr)); break;                                  \
-               case 2: __ret = (__get_user((x), (u8 __user *)(ptr)))                           \
-                       | (__get_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break;              \
-               case 4: __ret = (__get_user((x), (u16 __user *)(ptr)))                          \
-                       | (__get_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break;            \
-               case 8: __ret = (__get_user((x), (u32 __user *)(ptr)))                          \
-                       | (__get_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break;            \
-               default: __ret = __get_user_unaligned_unknown();                                \
-       }                                                                                       \
-       __ret;                                                                                  \
-})
-
-#ifdef ASM_SUPPORTED
-  struct __large_struct { unsigned long buf[100]; };
-# define __m(x) (*(struct __large_struct __user *)(x))
-
-/* We need to declare the __ex_table section before we can use it in .xdata.  */
-asm (".section \"__ex_table\", \"a\"\n\t.previous");
-
-# define __get_user_size(val, addr, n, err)                                                    \
-do {                                                                                           \
-       register long __gu_r8 asm ("r8") = 0;                                                   \
-       register long __gu_r9 asm ("r9");                                                       \
-       asm ("\n[1:]\tld"#n" %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n"     \
-            "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n"                                         \
-            "[1:]"                                                                             \
-            : "=r"(__gu_r9), "=r"(__gu_r8) : "m"(__m(addr)), "1"(__gu_r8));                    \
-       (err) = __gu_r8;                                                                        \
-       (val) = __gu_r9;                                                                        \
-} while (0)
-
-/*
- * The "__put_user_size()" macro tells gcc it reads from memory instead of writing it.  This
- * is because they do not write to any memory gcc knows about, so there are no aliasing
- * issues.
- */
-# define __put_user_size(val, addr, n, err)                                                    \
-do {                                                                                           \
-       register long __pu_r8 asm ("r8") = 0;                                                   \
-       asm volatile ("\n[1:]\tst"#n" %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
-                     "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n"                                  \
-                     "[1:]"                                                                    \
-                     : "=r"(__pu_r8) : "m"(__m(addr)), "rO"(val), "0"(__pu_r8));               \
-       (err) = __pu_r8;                                                                        \
-} while (0)
-
-#else /* !ASM_SUPPORTED */
-# define RELOC_TYPE    2       /* ip-rel */
-# define __get_user_size(val, addr, n, err)                            \
-do {                                                                   \
-       __ld_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE);   \
-       (err) = ia64_getreg(_IA64_REG_R8);                              \
-       (val) = ia64_getreg(_IA64_REG_R9);                              \
-} while (0)
-# define __put_user_size(val, addr, n, err)                                                    \
-do {                                                                                           \
-       __st_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE, (unsigned long) (val));    \
-       (err) = ia64_getreg(_IA64_REG_R8);                                                      \
-} while (0)
-#endif /* !ASM_SUPPORTED */
-
-extern void __get_user_unknown (void);
-
-/*
- * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
- * could clobber r8 and r9 (among others).  Thus, be careful not to evaluate it while
- * using r8/r9.
- */
-#define __do_get_user(check, x, ptr, size, segment)                                    \
-({                                                                                     \
-       const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);                              \
-       __typeof__ (size) __gu_size = (size);                                           \
-       long __gu_err = -EFAULT;                                                        \
-       unsigned long __gu_val = 0;                                                     \
-       if (!check || __access_ok(__gu_ptr, size, segment))                             \
-               switch (__gu_size) {                                                    \
-                     case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break;  \
-                     case 2: __get_user_size(__gu_val, __gu_ptr, 2, __gu_err); break;  \
-                     case 4: __get_user_size(__gu_val, __gu_ptr, 4, __gu_err); break;  \
-                     case 8: __get_user_size(__gu_val, __gu_ptr, 8, __gu_err); break;  \
-                     default: __get_user_unknown(); break;                             \
-               }                                                                       \
-       (x) = (__typeof__(*(__gu_ptr))) __gu_val;                                       \
-       __gu_err;                                                                       \
-})
-
-#define __get_user_nocheck(x, ptr, size)       __do_get_user(0, x, ptr, size, KERNEL_DS)
-#define __get_user_check(x, ptr, size, segment)        __do_get_user(1, x, ptr, size, segment)
-
-extern void __put_user_unknown (void);
-
-/*
- * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
- * could clobber r8 (among others).  Thus, be careful not to evaluate them while using r8.
- */
-#define __do_put_user(check, x, ptr, size, segment)                                    \
-({                                                                                     \
-       __typeof__ (x) __pu_x = (x);                                                    \
-       __typeof__ (*(ptr)) __user *__pu_ptr = (ptr);                                   \
-       __typeof__ (size) __pu_size = (size);                                           \
-       long __pu_err = -EFAULT;                                                        \
-                                                                                       \
-       if (!check || __access_ok(__pu_ptr, __pu_size, segment))                        \
-               switch (__pu_size) {                                                    \
-                     case 1: __put_user_size(__pu_x, __pu_ptr, 1, __pu_err); break;    \
-                     case 2: __put_user_size(__pu_x, __pu_ptr, 2, __pu_err); break;    \
-                     case 4: __put_user_size(__pu_x, __pu_ptr, 4, __pu_err); break;    \
-                     case 8: __put_user_size(__pu_x, __pu_ptr, 8, __pu_err); break;    \
-                     default: __put_user_unknown(); break;                             \
-               }                                                                       \
-       __pu_err;                                                                       \
-})
-
-#define __put_user_nocheck(x, ptr, size)       __do_put_user(0, x, ptr, size, KERNEL_DS)
-#define __put_user_check(x, ptr, size, segment)        __do_put_user(1, x, ptr, size, segment)
-
-/*
- * Complex access routines
- */
-extern unsigned long __must_check __copy_user (void __user *to, const void __user *from,
-                                              unsigned long count);
-
-static inline unsigned long
-__copy_to_user (void __user *to, const void *from, unsigned long count)
-{
-       return __copy_user(to, (__force void __user *) from, count);
-}
-
-static inline unsigned long
-__copy_from_user (void *to, const void __user *from, unsigned long count)
-{
-       return __copy_user((__force void __user *) to, from, count);
-}
-
-#define __copy_to_user_inatomic                __copy_to_user
-#define __copy_from_user_inatomic      __copy_from_user
-#define copy_to_user(to, from, n)                                                      \
-({                                                                                     \
-       void __user *__cu_to = (to);                                                    \
-       const void *__cu_from = (from);                                                 \
-       long __cu_len = (n);                                                            \
-                                                                                       \
-       if (__access_ok(__cu_to, __cu_len, get_fs()))                                   \
-               __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len);   \
-       __cu_len;                                                                       \
-})
-
-#define copy_from_user(to, from, n)                                                    \
-({                                                                                     \
-       void *__cu_to = (to);                                                           \
-       const void __user *__cu_from = (from);                                          \
-       long __cu_len = (n);                                                            \
-                                                                                       \
-       __chk_user_ptr(__cu_from);                                                      \
-       if (__access_ok(__cu_from, __cu_len, get_fs()))                                 \
-               __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len);   \
-       __cu_len;                                                                       \
-})
-
-#define __copy_in_user(to, from, size) __copy_user((to), (from), (size))
-
-static inline unsigned long
-copy_in_user (void __user *to, const void __user *from, unsigned long n)
-{
-       if (likely(access_ok(VERIFY_READ, from, n) && access_ok(VERIFY_WRITE, to, n)))
-               n = __copy_user(to, from, n);
-       return n;
-}
-
-extern unsigned long __do_clear_user (void __user *, unsigned long);
-
-#define __clear_user(to, n)            __do_clear_user(to, n)
-
-#define clear_user(to, n)                                      \
-({                                                             \
-       unsigned long __cu_len = (n);                           \
-       if (__access_ok(to, __cu_len, get_fs()))                \
-               __cu_len = __do_clear_user(to, __cu_len);       \
-       __cu_len;                                               \
-})
-
-
-/*
- * Returns: -EFAULT if exception before terminator, N if the entire buffer filled, else
- * strlen.
- */
-extern long __must_check __strncpy_from_user (char *to, const char __user *from, long to_len);
-
-#define strncpy_from_user(to, from, n)                                 \
-({                                                                     \
-       const char __user * __sfu_from = (from);                        \
-       long __sfu_ret = -EFAULT;                                       \
-       if (__access_ok(__sfu_from, 0, get_fs()))                       \
-               __sfu_ret = __strncpy_from_user((to), __sfu_from, (n)); \
-       __sfu_ret;                                                      \
-})
-
-/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
-extern unsigned long __strlen_user (const char __user *);
-
-#define strlen_user(str)                               \
-({                                                     \
-       const char __user *__su_str = (str);            \
-       unsigned long __su_ret = 0;                     \
-       if (__access_ok(__su_str, 0, get_fs()))         \
-               __su_ret = __strlen_user(__su_str);     \
-       __su_ret;                                       \
-})
-
-/*
- * 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 unsigned long __strnlen_user (const char __user *, long);
-
-#define strnlen_user(str, len)                                 \
-({                                                             \
-       const char __user *__su_str = (str);                    \
-       unsigned long __su_ret = 0;                             \
-       if (__access_ok(__su_str, 0, get_fs()))                 \
-               __su_ret = __strnlen_user(__su_str, len);       \
-       __su_ret;                                               \
-})
-
-/* Generic code can't deal with the location-relative format that we use for compactness.  */
-#define ARCH_HAS_SORT_EXTABLE
-#define ARCH_HAS_SEARCH_EXTABLE
-
-struct exception_table_entry {
-       int addr;       /* location-relative address of insn this fixup is for */
-       int cont;       /* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */
-};
-
-extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
-extern const struct exception_table_entry *search_exception_tables (unsigned long addr);
-
-static inline int
-ia64_done_with_exception (struct pt_regs *regs)
-{
-       const struct exception_table_entry *e;
-       e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
-       if (e) {
-               ia64_handle_exception(regs, e);
-               return 1;
-       }
-       return 0;
-}
-
-#define ARCH_HAS_TRANSLATE_MEM_PTR     1
-static __inline__ char *
-xlate_dev_mem_ptr (unsigned long p)
-{
-       struct page *page;
-       char * ptr;
-
-       page = pfn_to_page(p >> PAGE_SHIFT);
-       if (PageUncached(page))
-               ptr = (char *)p + __IA64_UNCACHED_OFFSET;
-       else
-               ptr = __va(p);
-
-       return ptr;
-}
-
-/*
- * Convert a virtual cached kernel memory pointer to an uncached pointer
- */
-static __inline__ char *
-xlate_dev_kmem_ptr (char * p)
-{
-       struct page *page;
-       char * ptr;
-
-       page = virt_to_page((unsigned long)p);
-       if (PageUncached(page))
-               ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
-       else
-               ptr = p;
-
-       return ptr;
-}
-
-#endif /* _ASM_IA64_UACCESS_H */
diff --git a/include/asm-ia64/ucontext.h b/include/asm-ia64/ucontext.h
deleted file mode 100644 (file)
index bf573dc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_IA64_UCONTEXT_H
-#define _ASM_IA64_UCONTEXT_H
-
-struct ucontext {
-       struct sigcontext uc_mcontext;
-};
-
-#define uc_link                uc_mcontext.sc_gr[0]    /* wrong type; nobody cares */
-#define uc_sigmask     uc_mcontext.sc_sigmask
-#define uc_stack       uc_mcontext.sc_stack
-
-#endif /* _ASM_IA64_UCONTEXT_H */
diff --git a/include/asm-ia64/unaligned.h b/include/asm-ia64/unaligned.h
deleted file mode 100644 (file)
index 7bddc7f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_IA64_UNALIGNED_H
-#define _ASM_IA64_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_IA64_UNALIGNED_H */
diff --git a/include/asm-ia64/uncached.h b/include/asm-ia64/uncached.h
deleted file mode 100644 (file)
index 13d7e65..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (C) 2001-2008 Silicon Graphics, Inc.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License
- * as published by the Free Software Foundation.
- *
- * Prototypes for the uncached page allocator
- */
-
-extern unsigned long uncached_alloc_page(int starting_nid, int n_pages);
-extern void uncached_free_page(unsigned long uc_addr, int n_pages);
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
deleted file mode 100644 (file)
index d535833..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-#ifndef _ASM_IA64_UNISTD_H
-#define _ASM_IA64_UNISTD_H
-
-/*
- * IA-64 Linux syscall numbers and inline-functions.
- *
- * Copyright (C) 1998-2005 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <asm/break.h>
-
-#define __BREAK_SYSCALL                        __IA64_BREAK_SYSCALL
-
-#define __NR_ni_syscall                        1024
-#define __NR_exit                      1025
-#define __NR_read                      1026
-#define __NR_write                     1027
-#define __NR_open                      1028
-#define __NR_close                     1029
-#define __NR_creat                     1030
-#define __NR_link                      1031
-#define __NR_unlink                    1032
-#define __NR_execve                    1033
-#define __NR_chdir                     1034
-#define __NR_fchdir                    1035
-#define __NR_utimes                    1036
-#define __NR_mknod                     1037
-#define __NR_chmod                     1038
-#define __NR_chown                     1039
-#define __NR_lseek                     1040
-#define __NR_getpid                    1041
-#define __NR_getppid                   1042
-#define __NR_mount                     1043
-#define __NR_umount                    1044
-#define __NR_setuid                    1045
-#define __NR_getuid                    1046
-#define __NR_geteuid                   1047
-#define __NR_ptrace                    1048
-#define __NR_access                    1049
-#define __NR_sync                      1050
-#define __NR_fsync                     1051
-#define __NR_fdatasync                 1052
-#define __NR_kill                      1053
-#define __NR_rename                    1054
-#define __NR_mkdir                     1055
-#define __NR_rmdir                     1056
-#define __NR_dup                       1057
-#define __NR_pipe                      1058
-#define __NR_times                     1059
-#define __NR_brk                       1060
-#define __NR_setgid                    1061
-#define __NR_getgid                    1062
-#define __NR_getegid                   1063
-#define __NR_acct                      1064
-#define __NR_ioctl                     1065
-#define __NR_fcntl                     1066
-#define __NR_umask                     1067
-#define __NR_chroot                    1068
-#define __NR_ustat                     1069
-#define __NR_dup2                      1070
-#define __NR_setreuid                  1071
-#define __NR_setregid                  1072
-#define __NR_getresuid                 1073
-#define __NR_setresuid                 1074
-#define __NR_getresgid                 1075
-#define __NR_setresgid                 1076
-#define __NR_getgroups                 1077
-#define __NR_setgroups                 1078
-#define __NR_getpgid                   1079
-#define __NR_setpgid                   1080
-#define __NR_setsid                    1081
-#define __NR_getsid                    1082
-#define __NR_sethostname               1083
-#define __NR_setrlimit                 1084
-#define __NR_getrlimit                 1085
-#define __NR_getrusage                 1086
-#define __NR_gettimeofday              1087
-#define __NR_settimeofday              1088
-#define __NR_select                    1089
-#define __NR_poll                      1090
-#define __NR_symlink                   1091
-#define __NR_readlink                  1092
-#define __NR_uselib                    1093
-#define __NR_swapon                    1094
-#define __NR_swapoff                   1095
-#define __NR_reboot                    1096
-#define __NR_truncate                  1097
-#define __NR_ftruncate                 1098
-#define __NR_fchmod                    1099
-#define __NR_fchown                    1100
-#define __NR_getpriority               1101
-#define __NR_setpriority               1102
-#define __NR_statfs                    1103
-#define __NR_fstatfs                   1104
-#define __NR_gettid                    1105
-#define __NR_semget                    1106
-#define __NR_semop                     1107
-#define __NR_semctl                    1108
-#define __NR_msgget                    1109
-#define __NR_msgsnd                    1110
-#define __NR_msgrcv                    1111
-#define __NR_msgctl                    1112
-#define __NR_shmget                    1113
-#define __NR_shmat                     1114
-#define __NR_shmdt                     1115
-#define __NR_shmctl                    1116
-/* also known as klogctl() in GNU libc: */
-#define __NR_syslog                    1117
-#define __NR_setitimer                 1118
-#define __NR_getitimer                 1119
-/* 1120 was __NR_old_stat */
-/* 1121 was __NR_old_lstat */
-/* 1122 was __NR_old_fstat */
-#define __NR_vhangup                   1123
-#define __NR_lchown                    1124
-#define __NR_remap_file_pages          1125
-#define __NR_wait4                     1126
-#define __NR_sysinfo                   1127
-#define __NR_clone                     1128
-#define __NR_setdomainname             1129
-#define __NR_uname                     1130
-#define __NR_adjtimex                  1131
-/* 1132 was __NR_create_module */
-#define __NR_init_module               1133
-#define __NR_delete_module             1134
-/* 1135 was __NR_get_kernel_syms */
-/* 1136 was __NR_query_module */
-#define __NR_quotactl                  1137
-#define __NR_bdflush                   1138
-#define __NR_sysfs                     1139
-#define __NR_personality               1140
-#define __NR_afs_syscall               1141
-#define __NR_setfsuid                  1142
-#define __NR_setfsgid                  1143
-#define __NR_getdents                  1144
-#define __NR_flock                     1145
-#define __NR_readv                     1146
-#define __NR_writev                    1147
-#define __NR_pread64                   1148
-#define __NR_pwrite64                  1149
-#define __NR__sysctl                   1150
-#define __NR_mmap                      1151
-#define __NR_munmap                    1152
-#define __NR_mlock                     1153
-#define __NR_mlockall                  1154
-#define __NR_mprotect                  1155
-#define __NR_mremap                    1156
-#define __NR_msync                     1157
-#define __NR_munlock                   1158
-#define __NR_munlockall                        1159
-#define __NR_sched_getparam            1160
-#define __NR_sched_setparam            1161
-#define __NR_sched_getscheduler                1162
-#define __NR_sched_setscheduler                1163
-#define __NR_sched_yield               1164
-#define __NR_sched_get_priority_max    1165
-#define __NR_sched_get_priority_min    1166
-#define __NR_sched_rr_get_interval     1167
-#define __NR_nanosleep                 1168
-#define __NR_nfsservctl                        1169
-#define __NR_prctl                     1170
-/* 1171 is reserved for backwards compatibility with old __NR_getpagesize */
-#define __NR_mmap2                     1172
-#define __NR_pciconfig_read            1173
-#define __NR_pciconfig_write           1174
-#define __NR_perfmonctl                        1175
-#define __NR_sigaltstack               1176
-#define __NR_rt_sigaction              1177
-#define __NR_rt_sigpending             1178
-#define __NR_rt_sigprocmask            1179
-#define __NR_rt_sigqueueinfo           1180
-#define __NR_rt_sigreturn              1181
-#define __NR_rt_sigsuspend             1182
-#define __NR_rt_sigtimedwait           1183
-#define __NR_getcwd                    1184
-#define __NR_capget                    1185
-#define __NR_capset                    1186
-#define __NR_sendfile                  1187
-#define __NR_getpmsg                   1188
-#define __NR_putpmsg                   1189
-#define __NR_socket                    1190
-#define __NR_bind                      1191
-#define __NR_connect                   1192
-#define __NR_listen                    1193
-#define __NR_accept                    1194
-#define __NR_getsockname               1195
-#define __NR_getpeername               1196
-#define __NR_socketpair                        1197
-#define __NR_send                      1198
-#define __NR_sendto                    1199
-#define __NR_recv                      1200
-#define __NR_recvfrom                  1201
-#define __NR_shutdown                  1202
-#define __NR_setsockopt                        1203
-#define __NR_getsockopt                        1204
-#define __NR_sendmsg                   1205
-#define __NR_recvmsg                   1206
-#define __NR_pivot_root                        1207
-#define __NR_mincore                   1208
-#define __NR_madvise                   1209
-#define __NR_stat                      1210
-#define __NR_lstat                     1211
-#define __NR_fstat                     1212
-#define __NR_clone2                    1213
-#define __NR_getdents64                        1214
-#define __NR_getunwind                 1215
-#define __NR_readahead                 1216
-#define __NR_setxattr                  1217
-#define __NR_lsetxattr                 1218
-#define __NR_fsetxattr                 1219
-#define __NR_getxattr                  1220
-#define __NR_lgetxattr                 1221
-#define __NR_fgetxattr                 1222
-#define __NR_listxattr                 1223
-#define __NR_llistxattr                        1224
-#define __NR_flistxattr                        1225
-#define __NR_removexattr               1226
-#define __NR_lremovexattr              1227
-#define __NR_fremovexattr              1228
-#define __NR_tkill                     1229
-#define __NR_futex                     1230
-#define __NR_sched_setaffinity         1231
-#define __NR_sched_getaffinity         1232
-#define __NR_set_tid_address           1233
-#define __NR_fadvise64                 1234
-#define __NR_tgkill                    1235
-#define __NR_exit_group                        1236
-#define __NR_lookup_dcookie            1237
-#define __NR_io_setup                  1238
-#define __NR_io_destroy                        1239
-#define __NR_io_getevents              1240
-#define __NR_io_submit                 1241
-#define __NR_io_cancel                 1242
-#define __NR_epoll_create              1243
-#define __NR_epoll_ctl                 1244
-#define __NR_epoll_wait                        1245
-#define __NR_restart_syscall           1246
-#define __NR_semtimedop                        1247
-#define __NR_timer_create              1248
-#define __NR_timer_settime             1249
-#define __NR_timer_gettime             1250
-#define __NR_timer_getoverrun          1251
-#define __NR_timer_delete              1252
-#define __NR_clock_settime             1253
-#define __NR_clock_gettime             1254
-#define __NR_clock_getres              1255
-#define __NR_clock_nanosleep           1256
-#define __NR_fstatfs64                 1257
-#define __NR_statfs64                  1258
-#define __NR_mbind                     1259
-#define __NR_get_mempolicy             1260
-#define __NR_set_mempolicy             1261
-#define __NR_mq_open                   1262
-#define __NR_mq_unlink                 1263
-#define __NR_mq_timedsend              1264
-#define __NR_mq_timedreceive           1265
-#define __NR_mq_notify                 1266
-#define __NR_mq_getsetattr             1267
-#define __NR_kexec_load                        1268
-#define __NR_vserver                   1269
-#define __NR_waitid                    1270
-#define __NR_add_key                   1271
-#define __NR_request_key               1272
-#define __NR_keyctl                    1273
-#define __NR_ioprio_set                        1274
-#define __NR_ioprio_get                        1275
-#define __NR_move_pages                        1276
-#define __NR_inotify_init              1277
-#define __NR_inotify_add_watch         1278
-#define __NR_inotify_rm_watch          1279
-#define __NR_migrate_pages             1280
-#define __NR_openat                    1281
-#define __NR_mkdirat                   1282
-#define __NR_mknodat                   1283
-#define __NR_fchownat                  1284
-#define __NR_futimesat                 1285
-#define __NR_newfstatat                        1286
-#define __NR_unlinkat                  1287
-#define __NR_renameat                  1288
-#define __NR_linkat                    1289
-#define __NR_symlinkat                 1290
-#define __NR_readlinkat                        1291
-#define __NR_fchmodat                  1292
-#define __NR_faccessat                 1293
-#define __NR_pselect6                  1294
-#define __NR_ppoll                     1295
-#define __NR_unshare                   1296
-#define __NR_splice                    1297
-#define __NR_set_robust_list           1298
-#define __NR_get_robust_list           1299
-#define __NR_sync_file_range           1300
-#define __NR_tee                       1301
-#define __NR_vmsplice                  1302
-#define __NR_fallocate                 1303
-#define __NR_getcpu                    1304
-#define __NR_epoll_pwait               1305
-#define __NR_utimensat                 1306
-#define __NR_signalfd                  1307
-#define __NR_timerfd                   1308
-#define __NR_eventfd                   1309
-#define __NR_timerfd_create            1310
-#define __NR_timerfd_settime           1311
-#define __NR_timerfd_gettime           1312
-#define __NR_signalfd4                 1313
-#define __NR_eventfd2                  1314
-#define __NR_epoll_create1             1315
-#define __NR_dup3                      1316
-#define __NR_pipe2                     1317
-#define __NR_inotify_init1             1318
-
-#ifdef __KERNEL__
-
-
-#define NR_syscalls                    295 /* length of syscall table */
-
-/*
- * The following defines stop scripts/checksyscalls.sh from complaining about
- * unimplemented system calls.  Glibc provides for each of these by using
- * more modern equivalent system calls.
- */
-#define __IGNORE_fork          /* clone() */
-#define __IGNORE_time          /* gettimeofday() */
-#define __IGNORE_alarm         /* setitimer(ITIMER_REAL, ... */
-#define __IGNORE_pause         /* rt_sigprocmask(), rt_sigsuspend() */
-#define __IGNORE_utime         /* utimes() */
-#define __IGNORE_getpgrp       /* getpgid() */
-#define __IGNORE_vfork         /* clone() */
-
-#define __ARCH_WANT_SYS_RT_SIGACTION
-#define __ARCH_WANT_SYS_RT_SIGSUSPEND
-
-#ifdef CONFIG_IA32_SUPPORT
-# define __ARCH_WANT_SYS_FADVISE64
-# define __ARCH_WANT_SYS_GETPGRP
-# define __ARCH_WANT_SYS_LLSEEK
-# define __ARCH_WANT_SYS_NICE
-# define __ARCH_WANT_SYS_OLD_GETRLIMIT
-# define __ARCH_WANT_SYS_OLDUMOUNT
-# define __ARCH_WANT_SYS_SIGPENDING
-# define __ARCH_WANT_SYS_SIGPROCMASK
-# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
-# define __ARCH_WANT_COMPAT_SYS_TIME
-#endif
-
-#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
-
-#include <linux/types.h>
-#include <linux/linkage.h>
-#include <linux/compiler.h>
-
-extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
-
-asmlinkage unsigned long sys_mmap(
-                               unsigned long addr, unsigned long len,
-                               int prot, int flags,
-                               int fd, long off);
-asmlinkage unsigned long sys_mmap2(
-                               unsigned long addr, unsigned long len,
-                               int prot, int flags,
-                               int fd, long pgoff);
-struct pt_regs;
-struct sigaction;
-long sys_execve(char __user *filename, char __user * __user *argv,
-                          char __user * __user *envp, struct pt_regs *regs);
-asmlinkage long sys_pipe(void);
-asmlinkage long sys_rt_sigaction(int sig,
-                                const struct sigaction __user *act,
-                                struct sigaction __user *oact,
-                                size_t sigsetsize);
-
-/*
- * "Conditional" syscalls
- *
- * Note, this macro can only be used in the file which defines sys_ni_syscall, i.e., in
- * kernel/sys_ni.c.  This version causes warnings because the declaration isn't a
- * proper prototype, but we can't use __typeof__ either, because not all cond_syscall()
- * declarations have prototypes at the moment.
- */
-#define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall")))
-
-#endif /* !__ASSEMBLY__ */
-#endif /* __KERNEL__ */
-#endif /* _ASM_IA64_UNISTD_H */
diff --git a/include/asm-ia64/unwind.h b/include/asm-ia64/unwind.h
deleted file mode 100644 (file)
index 1af3875..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-#ifndef _ASM_IA64_UNWIND_H
-#define _ASM_IA64_UNWIND_H
-
-/*
- * Copyright (C) 1999-2000, 2003 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * A simple API for unwinding kernel stacks.  This is used for
- * debugging and error reporting purposes.  The kernel doesn't need
- * full-blown stack unwinding with all the bells and whitles, so there
- * is not much point in implementing the full IA-64 unwind API (though
- * it would of course be possible to implement the kernel API on top
- * of it).
- */
-
-struct task_struct;    /* forward declaration */
-struct switch_stack;   /* forward declaration */
-
-enum unw_application_register {
-       UNW_AR_BSP,
-       UNW_AR_BSPSTORE,
-       UNW_AR_PFS,
-       UNW_AR_RNAT,
-       UNW_AR_UNAT,
-       UNW_AR_LC,
-       UNW_AR_EC,
-       UNW_AR_FPSR,
-       UNW_AR_RSC,
-       UNW_AR_CCV,
-       UNW_AR_CSD,
-       UNW_AR_SSD
-};
-
-/*
- * The following declarations are private to the unwind
- * implementation:
- */
-
-struct unw_stack {
-       unsigned long limit;
-       unsigned long top;
-};
-
-#define UNW_FLAG_INTERRUPT_FRAME       (1UL << 0)
-
-/*
- * No user of this module should every access this structure directly
- * as it is subject to change.  It is declared here solely so we can
- * use automatic variables.
- */
-struct unw_frame_info {
-       struct unw_stack regstk;
-       struct unw_stack memstk;
-       unsigned int flags;
-       short hint;
-       short prev_script;
-
-       /* current frame info: */
-       unsigned long bsp;              /* backing store pointer value */
-       unsigned long sp;               /* stack pointer value */
-       unsigned long psp;              /* previous sp value */
-       unsigned long ip;               /* instruction pointer value */
-       unsigned long pr;               /* current predicate values */
-       unsigned long *cfm_loc;         /* cfm save location (or NULL) */
-       unsigned long pt;               /* struct pt_regs location */
-
-       struct task_struct *task;
-       struct switch_stack *sw;
-
-       /* preserved state: */
-       unsigned long *bsp_loc;         /* previous bsp save location */
-       unsigned long *bspstore_loc;
-       unsigned long *pfs_loc;
-       unsigned long *rnat_loc;
-       unsigned long *rp_loc;
-       unsigned long *pri_unat_loc;
-       unsigned long *unat_loc;
-       unsigned long *pr_loc;
-       unsigned long *lc_loc;
-       unsigned long *fpsr_loc;
-       struct unw_ireg {
-               unsigned long *loc;
-               struct unw_ireg_nat {
-                       unsigned long type : 3;         /* enum unw_nat_type */
-                       signed long off : 61;           /* NaT word is at loc+nat.off */
-               } nat;
-       } r4, r5, r6, r7;
-       unsigned long *b1_loc, *b2_loc, *b3_loc, *b4_loc, *b5_loc;
-       struct ia64_fpreg *f2_loc, *f3_loc, *f4_loc, *f5_loc, *fr_loc[16];
-};
-
-/*
- * The official API follows below:
- */
-
-struct unw_table_entry {
-       u64 start_offset;
-       u64 end_offset;
-       u64 info_offset;
-};
-
-/*
- * Initialize unwind support.
- */
-extern void unw_init (void);
-
-extern void *unw_add_unwind_table (const char *name, unsigned long segment_base, unsigned long gp,
-                                  const void *table_start, const void *table_end);
-
-extern void unw_remove_unwind_table (void *handle);
-
-/*
- * Prepare to unwind blocked task t.
- */
-extern void unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t);
-
-extern void unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t,
-                                struct switch_stack *sw);
-
-/*
- * Prepare to unwind the currently running thread.
- */
-extern void unw_init_running (void (*callback)(struct unw_frame_info *info, void *arg), void *arg);
-
-/*
- * Unwind to previous to frame.  Returns 0 if successful, negative
- * number in case of an error.
- */
-extern int unw_unwind (struct unw_frame_info *info);
-
-/*
- * Unwind until the return pointer is in user-land (or until an error
- * occurs).  Returns 0 if successful, negative number in case of
- * error.
- */
-extern int unw_unwind_to_user (struct unw_frame_info *info);
-
-#define unw_is_intr_frame(info)        (((info)->flags & UNW_FLAG_INTERRUPT_FRAME) != 0)
-
-static inline int
-unw_get_ip (struct unw_frame_info *info, unsigned long *valp)
-{
-       *valp = (info)->ip;
-       return 0;
-}
-
-static inline int
-unw_get_sp (struct unw_frame_info *info, unsigned long *valp)
-{
-       *valp = (info)->sp;
-       return 0;
-}
-
-static inline int
-unw_get_psp (struct unw_frame_info *info, unsigned long *valp)
-{
-       *valp = (info)->psp;
-       return 0;
-}
-
-static inline int
-unw_get_bsp (struct unw_frame_info *info, unsigned long *valp)
-{
-       *valp = (info)->bsp;
-       return 0;
-}
-
-static inline int
-unw_get_cfm (struct unw_frame_info *info, unsigned long *valp)
-{
-       *valp = *(info)->cfm_loc;
-       return 0;
-}
-
-static inline int
-unw_set_cfm (struct unw_frame_info *info, unsigned long val)
-{
-       *(info)->cfm_loc = val;
-       return 0;
-}
-
-static inline int
-unw_get_rp (struct unw_frame_info *info, unsigned long *val)
-{
-       if (!info->rp_loc)
-               return -1;
-       *val = *info->rp_loc;
-       return 0;
-}
-
-extern int unw_access_gr (struct unw_frame_info *, int, unsigned long *, char *, int);
-extern int unw_access_br (struct unw_frame_info *, int, unsigned long *, int);
-extern int unw_access_fr (struct unw_frame_info *, int, struct ia64_fpreg *, int);
-extern int unw_access_ar (struct unw_frame_info *, int, unsigned long *, int);
-extern int unw_access_pr (struct unw_frame_info *, unsigned long *, int);
-
-static inline int
-unw_set_gr (struct unw_frame_info *i, int n, unsigned long v, char nat)
-{
-       return unw_access_gr(i, n, &v, &nat, 1);
-}
-
-static inline int
-unw_set_br (struct unw_frame_info *i, int n, unsigned long v)
-{
-       return unw_access_br(i, n, &v, 1);
-}
-
-static inline int
-unw_set_fr (struct unw_frame_info *i, int n, struct ia64_fpreg v)
-{
-       return unw_access_fr(i, n, &v, 1);
-}
-
-static inline int
-unw_set_ar (struct unw_frame_info *i, int n, unsigned long v)
-{
-       return unw_access_ar(i, n, &v, 1);
-}
-
-static inline int
-unw_set_pr (struct unw_frame_info *i, unsigned long v)
-{
-       return unw_access_pr(i, &v, 1);
-}
-
-#define unw_get_gr(i,n,v,nat)  unw_access_gr(i,n,v,nat,0)
-#define unw_get_br(i,n,v)      unw_access_br(i,n,v,0)
-#define unw_get_fr(i,n,v)      unw_access_fr(i,n,v,0)
-#define unw_get_ar(i,n,v)      unw_access_ar(i,n,v,0)
-#define unw_get_pr(i,v)                unw_access_pr(i,v,0)
-
-#endif /* _ASM_UNWIND_H */
diff --git a/include/asm-ia64/user.h b/include/asm-ia64/user.h
deleted file mode 100644 (file)
index 8b98211..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _ASM_IA64_USER_H
-#define _ASM_IA64_USER_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).  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.
- *
- * Modified 1998, 1999, 2001
- *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
- */
-
-#include <linux/ptrace.h>
-#include <linux/types.h>
-
-#include <asm/page.h>
-
-#define EF_SIZE                3072    /* XXX fix me */
-
-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 /* _ASM_IA64_USER_H */
diff --git a/include/asm-ia64/ustack.h b/include/asm-ia64/ustack.h
deleted file mode 100644 (file)
index 504167c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ASM_IA64_USTACK_H
-#define _ASM_IA64_USTACK_H
-
-/*
- * Constants for the user stack size
- */
-
-#ifdef __KERNEL__
-#include <asm/page.h>
-
-/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
-#define MAX_USER_STACK_SIZE    (RGN_MAP_LIMIT/2)
-#define STACK_TOP              (0x6000000000000000UL + RGN_MAP_LIMIT)
-#define STACK_TOP_MAX          STACK_TOP
-#endif
-
-/* Make a default stack size of 2GiB */
-#define DEFAULT_USER_STACK_SIZE        (1UL << 31)
-
-#endif /* _ASM_IA64_USTACK_H */
diff --git a/include/asm-ia64/uv/uv_hub.h b/include/asm-ia64/uv/uv_hub.h
deleted file mode 100644 (file)
index f607018..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * 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.
- *
- * SGI UV architectural definitions
- *
- * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef __ASM_IA64_UV_HUB_H__
-#define __ASM_IA64_UV_HUB_H__
-
-#include <linux/numa.h>
-#include <linux/percpu.h>
-#include <asm/types.h>
-#include <asm/percpu.h>
-
-
-/*
- * Addressing Terminology
- *
- *     M       - The low M bits of a physical address represent the offset
- *               into the blade local memory. RAM memory on a blade is physically
- *               contiguous (although various IO spaces may punch holes in
- *               it)..
- *
- *     N       - Number of bits in the node portion of a socket physical
- *               address.
- *
- *     NASID   - network ID of a router, Mbrick or Cbrick. Nasid values of
- *               routers always have low bit of 1, C/MBricks have low bit
- *               equal to 0. Most addressing macros that target UV hub chips
- *               right shift the NASID by 1 to exclude the always-zero bit.
- *               NASIDs contain up to 15 bits.
- *
- *     GNODE   - NASID right shifted by 1 bit. Most mmrs contain gnodes instead
- *               of nasids.
- *
- *     PNODE   - the low N bits of the GNODE. The PNODE is the most useful variant
- *               of the nasid for socket usage.
- *
- *
- *  NumaLink Global Physical Address Format:
- *  +--------------------------------+---------------------+
- *  |00..000|      GNODE             |      NodeOffset     |
- *  +--------------------------------+---------------------+
- *          |<-------53 - M bits --->|<--------M bits ----->
- *
- *     M - number of node offset bits (35 .. 40)
- *
- *
- *  Memory/UV-HUB Processor Socket Address Format:
- *  +----------------+---------------+---------------------+
- *  |00..000000000000|   PNODE       |      NodeOffset     |
- *  +----------------+---------------+---------------------+
- *                   <--- N bits --->|<--------M bits ----->
- *
- *     M - number of node offset bits (35 .. 40)
- *     N - number of PNODE bits (0 .. 10)
- *
- *             Note: M + N cannot currently exceed 44 (x86_64) or 46 (IA64).
- *             The actual values are configuration dependent and are set at
- *             boot time. M & N values are set by the hardware/BIOS at boot.
- */
-
-
-/*
- * Maximum number of bricks in all partitions and in all coherency domains.
- * This is the total number of bricks accessible in the numalink fabric. It
- * includes all C & M bricks. Routers are NOT included.
- *
- * This value is also the value of the maximum number of non-router NASIDs
- * in the numalink fabric.
- *
- * NOTE: a brick may contain 1 or 2 OS nodes. Don't get these confused.
- */
-#define UV_MAX_NUMALINK_BLADES 16384
-
-/*
- * Maximum number of C/Mbricks within a software SSI (hardware may support
- * more).
- */
-#define UV_MAX_SSI_BLADES      1
-
-/*
- * The largest possible NASID of a C or M brick (+ 2)
- */
-#define UV_MAX_NASID_VALUE     (UV_MAX_NUMALINK_NODES * 2)
-
-/*
- * The following defines attributes of the HUB chip. These attributes are
- * frequently referenced and are kept in the per-cpu data areas of each cpu.
- * They are kept together in a struct to minimize cache misses.
- */
-struct uv_hub_info_s {
-       unsigned long   global_mmr_base;
-       unsigned long   gpa_mask;
-       unsigned long   gnode_upper;
-       unsigned long   lowmem_remap_top;
-       unsigned long   lowmem_remap_base;
-       unsigned short  pnode;
-       unsigned short  pnode_mask;
-       unsigned short  coherency_domain_number;
-       unsigned short  numa_blade_id;
-       unsigned char   blade_processor_id;
-       unsigned char   m_val;
-       unsigned char   n_val;
-};
-DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
-#define uv_hub_info            (&__get_cpu_var(__uv_hub_info))
-#define uv_cpu_hub_info(cpu)   (&per_cpu(__uv_hub_info, cpu))
-
-/*
- * Local & Global MMR space macros.
- *     Note: macros are intended to be used ONLY by inline functions
- *     in this file - not by other kernel code.
- *             n -  NASID (full 15-bit global nasid)
- *             g -  GNODE (full 15-bit global nasid, right shifted 1)
- *             p -  PNODE (local part of nsids, right shifted 1)
- */
-#define UV_NASID_TO_PNODE(n)           (((n) >> 1) & uv_hub_info->pnode_mask)
-#define UV_PNODE_TO_NASID(p)           (((p) << 1) | uv_hub_info->gnode_upper)
-
-#define UV_LOCAL_MMR_BASE              0xf4000000UL
-#define UV_GLOBAL_MMR32_BASE           0xf8000000UL
-#define UV_GLOBAL_MMR64_BASE           (uv_hub_info->global_mmr_base)
-
-#define UV_GLOBAL_MMR32_PNODE_SHIFT    15
-#define UV_GLOBAL_MMR64_PNODE_SHIFT    26
-
-#define UV_GLOBAL_MMR32_PNODE_BITS(p)  ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
-
-#define UV_GLOBAL_MMR64_PNODE_BITS(p)                                  \
-       ((unsigned long)(p) << UV_GLOBAL_MMR64_PNODE_SHIFT)
-
-/*
- * Macros for converting between kernel virtual addresses, socket local physical
- * addresses, and UV global physical addresses.
- *     Note: use the standard __pa() & __va() macros for converting
- *           between socket virtual and socket physical addresses.
- */
-
-/* socket phys RAM --> UV global physical address */
-static inline unsigned long uv_soc_phys_ram_to_gpa(unsigned long paddr)
-{
-       if (paddr < uv_hub_info->lowmem_remap_top)
-               paddr += uv_hub_info->lowmem_remap_base;
-       return paddr | uv_hub_info->gnode_upper;
-}
-
-
-/* socket virtual --> UV global physical address */
-static inline unsigned long uv_gpa(void *v)
-{
-       return __pa(v) | uv_hub_info->gnode_upper;
-}
-
-/* socket virtual --> UV global physical address */
-static inline void *uv_vgpa(void *v)
-{
-       return (void *)uv_gpa(v);
-}
-
-/* UV global physical address --> socket virtual */
-static inline void *uv_va(unsigned long gpa)
-{
-       return __va(gpa & uv_hub_info->gpa_mask);
-}
-
-/* pnode, offset --> socket virtual */
-static inline void *uv_pnode_offset_to_vaddr(int pnode, unsigned long offset)
-{
-       return __va(((unsigned long)pnode << uv_hub_info->m_val) | offset);
-}
-
-
-/*
- * Access global MMRs using the low memory MMR32 space. This region supports
- * faster MMR access but not all MMRs are accessible in this space.
- */
-static inline unsigned long *uv_global_mmr32_address(int pnode,
-                               unsigned long offset)
-{
-       return __va(UV_GLOBAL_MMR32_BASE |
-                      UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset);
-}
-
-static inline void uv_write_global_mmr32(int pnode, unsigned long offset,
-                                unsigned long val)
-{
-       *uv_global_mmr32_address(pnode, offset) = val;
-}
-
-static inline unsigned long uv_read_global_mmr32(int pnode,
-                                                unsigned long offset)
-{
-       return *uv_global_mmr32_address(pnode, offset);
-}
-
-/*
- * Access Global MMR space using the MMR space located at the top of physical
- * memory.
- */
-static inline unsigned long *uv_global_mmr64_address(int pnode,
-                               unsigned long offset)
-{
-       return __va(UV_GLOBAL_MMR64_BASE |
-                   UV_GLOBAL_MMR64_PNODE_BITS(pnode) | offset);
-}
-
-static inline void uv_write_global_mmr64(int pnode, unsigned long offset,
-                               unsigned long val)
-{
-       *uv_global_mmr64_address(pnode, offset) = val;
-}
-
-static inline unsigned long uv_read_global_mmr64(int pnode,
-                                                unsigned long offset)
-{
-       return *uv_global_mmr64_address(pnode, offset);
-}
-
-/*
- * Access hub local MMRs. Faster than using global space but only local MMRs
- * are accessible.
- */
-static inline unsigned long *uv_local_mmr_address(unsigned long offset)
-{
-       return __va(UV_LOCAL_MMR_BASE | offset);
-}
-
-static inline unsigned long uv_read_local_mmr(unsigned long offset)
-{
-       return *uv_local_mmr_address(offset);
-}
-
-static inline void uv_write_local_mmr(unsigned long offset, unsigned long val)
-{
-       *uv_local_mmr_address(offset) = val;
-}
-
-/*
- * Structures and definitions for converting between cpu, node, pnode, and blade
- * numbers.
- */
-
-/* Blade-local cpu number of current cpu. Numbered 0 .. <# cpus on the blade> */
-static inline int uv_blade_processor_id(void)
-{
-       return smp_processor_id();
-}
-
-/* Blade number of current cpu. Numnbered 0 .. <#blades -1> */
-static inline int uv_numa_blade_id(void)
-{
-       return 0;
-}
-
-/* Convert a cpu number to the the UV blade number */
-static inline int uv_cpu_to_blade_id(int cpu)
-{
-       return 0;
-}
-
-/* Convert linux node number to the UV blade number */
-static inline int uv_node_to_blade_id(int nid)
-{
-       return 0;
-}
-
-/* Convert a blade id to the PNODE of the blade */
-static inline int uv_blade_to_pnode(int bid)
-{
-       return 0;
-}
-
-/* Determine the number of possible cpus on a blade */
-static inline int uv_blade_nr_possible_cpus(int bid)
-{
-       return num_possible_cpus();
-}
-
-/* Determine the number of online cpus on a blade */
-static inline int uv_blade_nr_online_cpus(int bid)
-{
-       return num_online_cpus();
-}
-
-/* Convert a cpu id to the PNODE of the blade containing the cpu */
-static inline int uv_cpu_to_pnode(int cpu)
-{
-       return 0;
-}
-
-/* Convert a linux node number to the PNODE of the blade */
-static inline int uv_node_to_pnode(int nid)
-{
-       return 0;
-}
-
-/* Maximum possible number of blades */
-static inline int uv_num_possible_blades(void)
-{
-       return 1;
-}
-
-#endif /* __ASM_IA64_UV_HUB__ */
-
diff --git a/include/asm-ia64/uv/uv_mmrs.h b/include/asm-ia64/uv/uv_mmrs.h
deleted file mode 100644 (file)
index c149ef0..0000000
+++ /dev/null
@@ -1,673 +0,0 @@
-/*
- * 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.
- *
- * SGI UV MMR definitions
- *
- * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
- */
-
-#ifndef __ASM_IA64_UV_MMRS__
-#define __ASM_IA64_UV_MMRS__
-
-#define UV_MMR_ENABLE          (1UL << 63)
-
-/* ========================================================================= */
-/*                           UVH_BAU_DATA_CONFIG                             */
-/* ========================================================================= */
-#define UVH_BAU_DATA_CONFIG 0x61680UL
-#define UVH_BAU_DATA_CONFIG_32 0x0438
-
-#define UVH_BAU_DATA_CONFIG_VECTOR_SHFT 0
-#define UVH_BAU_DATA_CONFIG_VECTOR_MASK 0x00000000000000ffUL
-#define UVH_BAU_DATA_CONFIG_DM_SHFT 8
-#define UVH_BAU_DATA_CONFIG_DM_MASK 0x0000000000000700UL
-#define UVH_BAU_DATA_CONFIG_DESTMODE_SHFT 11
-#define UVH_BAU_DATA_CONFIG_DESTMODE_MASK 0x0000000000000800UL
-#define UVH_BAU_DATA_CONFIG_STATUS_SHFT 12
-#define UVH_BAU_DATA_CONFIG_STATUS_MASK 0x0000000000001000UL
-#define UVH_BAU_DATA_CONFIG_P_SHFT 13
-#define UVH_BAU_DATA_CONFIG_P_MASK 0x0000000000002000UL
-#define UVH_BAU_DATA_CONFIG_T_SHFT 15
-#define UVH_BAU_DATA_CONFIG_T_MASK 0x0000000000008000UL
-#define UVH_BAU_DATA_CONFIG_M_SHFT 16
-#define UVH_BAU_DATA_CONFIG_M_MASK 0x0000000000010000UL
-#define UVH_BAU_DATA_CONFIG_APIC_ID_SHFT 32
-#define UVH_BAU_DATA_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
-
-union uvh_bau_data_config_u {
-    unsigned long      v;
-    struct uvh_bau_data_config_s {
-       unsigned long   vector_  :  8;  /* RW */
-       unsigned long   dm       :  3;  /* RW */
-       unsigned long   destmode :  1;  /* RW */
-       unsigned long   status   :  1;  /* RO */
-       unsigned long   p        :  1;  /* RO */
-       unsigned long   rsvd_14  :  1;  /*    */
-       unsigned long   t        :  1;  /* RO */
-       unsigned long   m        :  1;  /* RW */
-       unsigned long   rsvd_17_31: 15;  /*    */
-       unsigned long   apic_id  : 32;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                           UVH_EVENT_OCCURRED0                             */
-/* ========================================================================= */
-#define UVH_EVENT_OCCURRED0 0x70000UL
-#define UVH_EVENT_OCCURRED0_32 0x005e8
-
-#define UVH_EVENT_OCCURRED0_LB_HCERR_SHFT 0
-#define UVH_EVENT_OCCURRED0_LB_HCERR_MASK 0x0000000000000001UL
-#define UVH_EVENT_OCCURRED0_GR0_HCERR_SHFT 1
-#define UVH_EVENT_OCCURRED0_GR0_HCERR_MASK 0x0000000000000002UL
-#define UVH_EVENT_OCCURRED0_GR1_HCERR_SHFT 2
-#define UVH_EVENT_OCCURRED0_GR1_HCERR_MASK 0x0000000000000004UL
-#define UVH_EVENT_OCCURRED0_LH_HCERR_SHFT 3
-#define UVH_EVENT_OCCURRED0_LH_HCERR_MASK 0x0000000000000008UL
-#define UVH_EVENT_OCCURRED0_RH_HCERR_SHFT 4
-#define UVH_EVENT_OCCURRED0_RH_HCERR_MASK 0x0000000000000010UL
-#define UVH_EVENT_OCCURRED0_XN_HCERR_SHFT 5
-#define UVH_EVENT_OCCURRED0_XN_HCERR_MASK 0x0000000000000020UL
-#define UVH_EVENT_OCCURRED0_SI_HCERR_SHFT 6
-#define UVH_EVENT_OCCURRED0_SI_HCERR_MASK 0x0000000000000040UL
-#define UVH_EVENT_OCCURRED0_LB_AOERR0_SHFT 7
-#define UVH_EVENT_OCCURRED0_LB_AOERR0_MASK 0x0000000000000080UL
-#define UVH_EVENT_OCCURRED0_GR0_AOERR0_SHFT 8
-#define UVH_EVENT_OCCURRED0_GR0_AOERR0_MASK 0x0000000000000100UL
-#define UVH_EVENT_OCCURRED0_GR1_AOERR0_SHFT 9
-#define UVH_EVENT_OCCURRED0_GR1_AOERR0_MASK 0x0000000000000200UL
-#define UVH_EVENT_OCCURRED0_LH_AOERR0_SHFT 10
-#define UVH_EVENT_OCCURRED0_LH_AOERR0_MASK 0x0000000000000400UL
-#define UVH_EVENT_OCCURRED0_RH_AOERR0_SHFT 11
-#define UVH_EVENT_OCCURRED0_RH_AOERR0_MASK 0x0000000000000800UL
-#define UVH_EVENT_OCCURRED0_XN_AOERR0_SHFT 12
-#define UVH_EVENT_OCCURRED0_XN_AOERR0_MASK 0x0000000000001000UL
-#define UVH_EVENT_OCCURRED0_SI_AOERR0_SHFT 13
-#define UVH_EVENT_OCCURRED0_SI_AOERR0_MASK 0x0000000000002000UL
-#define UVH_EVENT_OCCURRED0_LB_AOERR1_SHFT 14
-#define UVH_EVENT_OCCURRED0_LB_AOERR1_MASK 0x0000000000004000UL
-#define UVH_EVENT_OCCURRED0_GR0_AOERR1_SHFT 15
-#define UVH_EVENT_OCCURRED0_GR0_AOERR1_MASK 0x0000000000008000UL
-#define UVH_EVENT_OCCURRED0_GR1_AOERR1_SHFT 16
-#define UVH_EVENT_OCCURRED0_GR1_AOERR1_MASK 0x0000000000010000UL
-#define UVH_EVENT_OCCURRED0_LH_AOERR1_SHFT 17
-#define UVH_EVENT_OCCURRED0_LH_AOERR1_MASK 0x0000000000020000UL
-#define UVH_EVENT_OCCURRED0_RH_AOERR1_SHFT 18
-#define UVH_EVENT_OCCURRED0_RH_AOERR1_MASK 0x0000000000040000UL
-#define UVH_EVENT_OCCURRED0_XN_AOERR1_SHFT 19
-#define UVH_EVENT_OCCURRED0_XN_AOERR1_MASK 0x0000000000080000UL
-#define UVH_EVENT_OCCURRED0_SI_AOERR1_SHFT 20
-#define UVH_EVENT_OCCURRED0_SI_AOERR1_MASK 0x0000000000100000UL
-#define UVH_EVENT_OCCURRED0_RH_VPI_INT_SHFT 21
-#define UVH_EVENT_OCCURRED0_RH_VPI_INT_MASK 0x0000000000200000UL
-#define UVH_EVENT_OCCURRED0_SYSTEM_SHUTDOWN_INT_SHFT 22
-#define UVH_EVENT_OCCURRED0_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000400000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_0_SHFT 23
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_0_MASK 0x0000000000800000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_1_SHFT 24
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_1_MASK 0x0000000001000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_2_SHFT 25
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_2_MASK 0x0000000002000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_3_SHFT 26
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_3_MASK 0x0000000004000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_4_SHFT 27
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_4_MASK 0x0000000008000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_5_SHFT 28
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_5_MASK 0x0000000010000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_6_SHFT 29
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_6_MASK 0x0000000020000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_7_SHFT 30
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_7_MASK 0x0000000040000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_8_SHFT 31
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_8_MASK 0x0000000080000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_9_SHFT 32
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_9_MASK 0x0000000100000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_10_SHFT 33
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_10_MASK 0x0000000200000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_11_SHFT 34
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_11_MASK 0x0000000400000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_12_SHFT 35
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_12_MASK 0x0000000800000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_13_SHFT 36
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_13_MASK 0x0000001000000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_14_SHFT 37
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_14_MASK 0x0000002000000000UL
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_15_SHFT 38
-#define UVH_EVENT_OCCURRED0_LB_IRQ_INT_15_MASK 0x0000004000000000UL
-#define UVH_EVENT_OCCURRED0_L1_NMI_INT_SHFT 39
-#define UVH_EVENT_OCCURRED0_L1_NMI_INT_MASK 0x0000008000000000UL
-#define UVH_EVENT_OCCURRED0_STOP_CLOCK_SHFT 40
-#define UVH_EVENT_OCCURRED0_STOP_CLOCK_MASK 0x0000010000000000UL
-#define UVH_EVENT_OCCURRED0_ASIC_TO_L1_SHFT 41
-#define UVH_EVENT_OCCURRED0_ASIC_TO_L1_MASK 0x0000020000000000UL
-#define UVH_EVENT_OCCURRED0_L1_TO_ASIC_SHFT 42
-#define UVH_EVENT_OCCURRED0_L1_TO_ASIC_MASK 0x0000040000000000UL
-#define UVH_EVENT_OCCURRED0_LTC_INT_SHFT 43
-#define UVH_EVENT_OCCURRED0_LTC_INT_MASK 0x0000080000000000UL
-#define UVH_EVENT_OCCURRED0_LA_SEQ_TRIGGER_SHFT 44
-#define UVH_EVENT_OCCURRED0_LA_SEQ_TRIGGER_MASK 0x0000100000000000UL
-#define UVH_EVENT_OCCURRED0_IPI_INT_SHFT 45
-#define UVH_EVENT_OCCURRED0_IPI_INT_MASK 0x0000200000000000UL
-#define UVH_EVENT_OCCURRED0_EXTIO_INT0_SHFT 46
-#define UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK 0x0000400000000000UL
-#define UVH_EVENT_OCCURRED0_EXTIO_INT1_SHFT 47
-#define UVH_EVENT_OCCURRED0_EXTIO_INT1_MASK 0x0000800000000000UL
-#define UVH_EVENT_OCCURRED0_EXTIO_INT2_SHFT 48
-#define UVH_EVENT_OCCURRED0_EXTIO_INT2_MASK 0x0001000000000000UL
-#define UVH_EVENT_OCCURRED0_EXTIO_INT3_SHFT 49
-#define UVH_EVENT_OCCURRED0_EXTIO_INT3_MASK 0x0002000000000000UL
-#define UVH_EVENT_OCCURRED0_PROFILE_INT_SHFT 50
-#define UVH_EVENT_OCCURRED0_PROFILE_INT_MASK 0x0004000000000000UL
-#define UVH_EVENT_OCCURRED0_RTC0_SHFT 51
-#define UVH_EVENT_OCCURRED0_RTC0_MASK 0x0008000000000000UL
-#define UVH_EVENT_OCCURRED0_RTC1_SHFT 52
-#define UVH_EVENT_OCCURRED0_RTC1_MASK 0x0010000000000000UL
-#define UVH_EVENT_OCCURRED0_RTC2_SHFT 53
-#define UVH_EVENT_OCCURRED0_RTC2_MASK 0x0020000000000000UL
-#define UVH_EVENT_OCCURRED0_RTC3_SHFT 54
-#define UVH_EVENT_OCCURRED0_RTC3_MASK 0x0040000000000000UL
-#define UVH_EVENT_OCCURRED0_BAU_DATA_SHFT 55
-#define UVH_EVENT_OCCURRED0_BAU_DATA_MASK 0x0080000000000000UL
-#define UVH_EVENT_OCCURRED0_POWER_MANAGEMENT_REQ_SHFT 56
-#define UVH_EVENT_OCCURRED0_POWER_MANAGEMENT_REQ_MASK 0x0100000000000000UL
-union uvh_event_occurred0_u {
-    unsigned long      v;
-    struct uvh_event_occurred0_s {
-       unsigned long   lb_hcerr             :  1;  /* RW, W1C */
-       unsigned long   gr0_hcerr            :  1;  /* RW, W1C */
-       unsigned long   gr1_hcerr            :  1;  /* RW, W1C */
-       unsigned long   lh_hcerr             :  1;  /* RW, W1C */
-       unsigned long   rh_hcerr             :  1;  /* RW, W1C */
-       unsigned long   xn_hcerr             :  1;  /* RW, W1C */
-       unsigned long   si_hcerr             :  1;  /* RW, W1C */
-       unsigned long   lb_aoerr0            :  1;  /* RW, W1C */
-       unsigned long   gr0_aoerr0           :  1;  /* RW, W1C */
-       unsigned long   gr1_aoerr0           :  1;  /* RW, W1C */
-       unsigned long   lh_aoerr0            :  1;  /* RW, W1C */
-       unsigned long   rh_aoerr0            :  1;  /* RW, W1C */
-       unsigned long   xn_aoerr0            :  1;  /* RW, W1C */
-       unsigned long   si_aoerr0            :  1;  /* RW, W1C */
-       unsigned long   lb_aoerr1            :  1;  /* RW, W1C */
-       unsigned long   gr0_aoerr1           :  1;  /* RW, W1C */
-       unsigned long   gr1_aoerr1           :  1;  /* RW, W1C */
-       unsigned long   lh_aoerr1            :  1;  /* RW, W1C */
-       unsigned long   rh_aoerr1            :  1;  /* RW, W1C */
-       unsigned long   xn_aoerr1            :  1;  /* RW, W1C */
-       unsigned long   si_aoerr1            :  1;  /* RW, W1C */
-       unsigned long   rh_vpi_int           :  1;  /* RW, W1C */
-       unsigned long   system_shutdown_int  :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_0         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_1         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_2         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_3         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_4         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_5         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_6         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_7         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_8         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_9         :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_10        :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_11        :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_12        :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_13        :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_14        :  1;  /* RW, W1C */
-       unsigned long   lb_irq_int_15        :  1;  /* RW, W1C */
-       unsigned long   l1_nmi_int           :  1;  /* RW, W1C */
-       unsigned long   stop_clock           :  1;  /* RW, W1C */
-       unsigned long   asic_to_l1           :  1;  /* RW, W1C */
-       unsigned long   l1_to_asic           :  1;  /* RW, W1C */
-       unsigned long   ltc_int              :  1;  /* RW, W1C */
-       unsigned long   la_seq_trigger       :  1;  /* RW, W1C */
-       unsigned long   ipi_int              :  1;  /* RW, W1C */
-       unsigned long   extio_int0           :  1;  /* RW, W1C */
-       unsigned long   extio_int1           :  1;  /* RW, W1C */
-       unsigned long   extio_int2           :  1;  /* RW, W1C */
-       unsigned long   extio_int3           :  1;  /* RW, W1C */
-       unsigned long   profile_int          :  1;  /* RW, W1C */
-       unsigned long   rtc0                 :  1;  /* RW, W1C */
-       unsigned long   rtc1                 :  1;  /* RW, W1C */
-       unsigned long   rtc2                 :  1;  /* RW, W1C */
-       unsigned long   rtc3                 :  1;  /* RW, W1C */
-       unsigned long   bau_data             :  1;  /* RW, W1C */
-       unsigned long   power_management_req :  1;  /* RW, W1C */
-       unsigned long   rsvd_57_63           :  7;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                        UVH_EVENT_OCCURRED0_ALIAS                          */
-/* ========================================================================= */
-#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
-#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
-
-/* ========================================================================= */
-/*                               UVH_INT_CMPB                                */
-/* ========================================================================= */
-#define UVH_INT_CMPB 0x22080UL
-
-#define UVH_INT_CMPB_REAL_TIME_CMPB_SHFT 0
-#define UVH_INT_CMPB_REAL_TIME_CMPB_MASK 0x00ffffffffffffffUL
-
-union uvh_int_cmpb_u {
-    unsigned long      v;
-    struct uvh_int_cmpb_s {
-       unsigned long   real_time_cmpb : 56;  /* RW */
-       unsigned long   rsvd_56_63     :  8;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                               UVH_INT_CMPC                                */
-/* ========================================================================= */
-#define UVH_INT_CMPC 0x22100UL
-
-#define UVH_INT_CMPC_REAL_TIME_CMPC_SHFT 0
-#define UVH_INT_CMPC_REAL_TIME_CMPC_MASK 0x00ffffffffffffffUL
-
-union uvh_int_cmpc_u {
-    unsigned long      v;
-    struct uvh_int_cmpc_s {
-       unsigned long   real_time_cmpc : 56;  /* RW */
-       unsigned long   rsvd_56_63     :  8;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                               UVH_INT_CMPD                                */
-/* ========================================================================= */
-#define UVH_INT_CMPD 0x22180UL
-
-#define UVH_INT_CMPD_REAL_TIME_CMPD_SHFT 0
-#define UVH_INT_CMPD_REAL_TIME_CMPD_MASK 0x00ffffffffffffffUL
-
-union uvh_int_cmpd_u {
-    unsigned long      v;
-    struct uvh_int_cmpd_s {
-       unsigned long   real_time_cmpd : 56;  /* RW */
-       unsigned long   rsvd_56_63     :  8;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                               UVH_NODE_ID                                 */
-/* ========================================================================= */
-#define UVH_NODE_ID 0x0UL
-
-#define UVH_NODE_ID_FORCE1_SHFT 0
-#define UVH_NODE_ID_FORCE1_MASK 0x0000000000000001UL
-#define UVH_NODE_ID_MANUFACTURER_SHFT 1
-#define UVH_NODE_ID_MANUFACTURER_MASK 0x0000000000000ffeUL
-#define UVH_NODE_ID_PART_NUMBER_SHFT 12
-#define UVH_NODE_ID_PART_NUMBER_MASK 0x000000000ffff000UL
-#define UVH_NODE_ID_REVISION_SHFT 28
-#define UVH_NODE_ID_REVISION_MASK 0x00000000f0000000UL
-#define UVH_NODE_ID_NODE_ID_SHFT 32
-#define UVH_NODE_ID_NODE_ID_MASK 0x00007fff00000000UL
-#define UVH_NODE_ID_NODES_PER_BIT_SHFT 48
-#define UVH_NODE_ID_NODES_PER_BIT_MASK 0x007f000000000000UL
-#define UVH_NODE_ID_NI_PORT_SHFT 56
-#define UVH_NODE_ID_NI_PORT_MASK 0x0f00000000000000UL
-
-union uvh_node_id_u {
-    unsigned long      v;
-    struct uvh_node_id_s {
-       unsigned long   force1        :  1;  /* RO */
-       unsigned long   manufacturer  : 11;  /* RO */
-       unsigned long   part_number   : 16;  /* RO */
-       unsigned long   revision      :  4;  /* RO */
-       unsigned long   node_id       : 15;  /* RW */
-       unsigned long   rsvd_47       :  1;  /*    */
-       unsigned long   nodes_per_bit :  7;  /* RW */
-       unsigned long   rsvd_55       :  1;  /*    */
-       unsigned long   ni_port       :  4;  /* RO */
-       unsigned long   rsvd_60_63    :  4;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR                  */
-/* ========================================================================= */
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR 0x16000d0UL
-
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT 24
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_MASK 0x00003fffff000000UL
-
-union uvh_rh_gam_alias210_redirect_config_0_mmr_u {
-    unsigned long      v;
-    struct uvh_rh_gam_alias210_redirect_config_0_mmr_s {
-       unsigned long   rsvd_0_23 : 24;  /*    */
-       unsigned long   dest_base : 22;  /* RW */
-       unsigned long   rsvd_46_63: 18;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR                  */
-/* ========================================================================= */
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR 0x16000e0UL
-
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR_DEST_BASE_SHFT 24
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR_DEST_BASE_MASK 0x00003fffff000000UL
-
-union uvh_rh_gam_alias210_redirect_config_1_mmr_u {
-    unsigned long      v;
-    struct uvh_rh_gam_alias210_redirect_config_1_mmr_s {
-       unsigned long   rsvd_0_23 : 24;  /*    */
-       unsigned long   dest_base : 22;  /* RW */
-       unsigned long   rsvd_46_63: 18;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR                  */
-/* ========================================================================= */
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR 0x16000f0UL
-
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR_DEST_BASE_SHFT 24
-#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR_DEST_BASE_MASK 0x00003fffff000000UL
-
-union uvh_rh_gam_alias210_redirect_config_2_mmr_u {
-    unsigned long      v;
-    struct uvh_rh_gam_alias210_redirect_config_2_mmr_s {
-       unsigned long   rsvd_0_23 : 24;  /*    */
-       unsigned long   dest_base : 22;  /* RW */
-       unsigned long   rsvd_46_63: 18;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                    UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR                      */
-/* ========================================================================= */
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR 0x1600010UL
-
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_SHFT 28
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_MASK 0x00003ffff0000000UL
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_GR4_SHFT 48
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_GR4_MASK 0x0001000000000000UL
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_N_GRU_SHFT 52
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_N_GRU_MASK 0x00f0000000000000UL
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_ENABLE_SHFT 63
-#define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_ENABLE_MASK 0x8000000000000000UL
-
-union uvh_rh_gam_gru_overlay_config_mmr_u {
-    unsigned long      v;
-    struct uvh_rh_gam_gru_overlay_config_mmr_s {
-       unsigned long   rsvd_0_27: 28;  /*    */
-       unsigned long   base   : 18;  /* RW */
-       unsigned long   rsvd_46_47:  2;  /*    */
-       unsigned long   gr4    :  1;  /* RW */
-       unsigned long   rsvd_49_51:  3;  /*    */
-       unsigned long   n_gru  :  4;  /* RW */
-       unsigned long   rsvd_56_62:  7;  /*    */
-       unsigned long   enable :  1;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                    UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR                      */
-/* ========================================================================= */
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR 0x1600028UL
-
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT 26
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_MASK 0x00003ffffc000000UL
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_DUAL_HUB_SHFT 46
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_DUAL_HUB_MASK 0x0000400000000000UL
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_ENABLE_SHFT 63
-#define UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_ENABLE_MASK 0x8000000000000000UL
-
-union uvh_rh_gam_mmr_overlay_config_mmr_u {
-    unsigned long      v;
-    struct uvh_rh_gam_mmr_overlay_config_mmr_s {
-       unsigned long   rsvd_0_25: 26;  /*    */
-       unsigned long   base     : 20;  /* RW */
-       unsigned long   dual_hub :  1;  /* RW */
-       unsigned long   rsvd_47_62: 16;  /*    */
-       unsigned long   enable   :  1;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                                 UVH_RTC                                   */
-/* ========================================================================= */
-#define UVH_RTC 0x340000UL
-
-#define UVH_RTC_REAL_TIME_CLOCK_SHFT 0
-#define UVH_RTC_REAL_TIME_CLOCK_MASK 0x00ffffffffffffffUL
-
-union uvh_rtc_u {
-    unsigned long      v;
-    struct uvh_rtc_s {
-       unsigned long   real_time_clock : 56;  /* RW */
-       unsigned long   rsvd_56_63      :  8;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                           UVH_RTC1_INT_CONFIG                             */
-/* ========================================================================= */
-#define UVH_RTC1_INT_CONFIG 0x615c0UL
-
-#define UVH_RTC1_INT_CONFIG_VECTOR_SHFT 0
-#define UVH_RTC1_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
-#define UVH_RTC1_INT_CONFIG_DM_SHFT 8
-#define UVH_RTC1_INT_CONFIG_DM_MASK 0x0000000000000700UL
-#define UVH_RTC1_INT_CONFIG_DESTMODE_SHFT 11
-#define UVH_RTC1_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
-#define UVH_RTC1_INT_CONFIG_STATUS_SHFT 12
-#define UVH_RTC1_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
-#define UVH_RTC1_INT_CONFIG_P_SHFT 13
-#define UVH_RTC1_INT_CONFIG_P_MASK 0x0000000000002000UL
-#define UVH_RTC1_INT_CONFIG_T_SHFT 15
-#define UVH_RTC1_INT_CONFIG_T_MASK 0x0000000000008000UL
-#define UVH_RTC1_INT_CONFIG_M_SHFT 16
-#define UVH_RTC1_INT_CONFIG_M_MASK 0x0000000000010000UL
-#define UVH_RTC1_INT_CONFIG_APIC_ID_SHFT 32
-#define UVH_RTC1_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
-
-union uvh_rtc1_int_config_u {
-    unsigned long      v;
-    struct uvh_rtc1_int_config_s {
-       unsigned long   vector_  :  8;  /* RW */
-       unsigned long   dm       :  3;  /* RW */
-       unsigned long   destmode :  1;  /* RW */
-       unsigned long   status   :  1;  /* RO */
-       unsigned long   p        :  1;  /* RO */
-       unsigned long   rsvd_14  :  1;  /*    */
-       unsigned long   t        :  1;  /* RO */
-       unsigned long   m        :  1;  /* RW */
-       unsigned long   rsvd_17_31: 15;  /*    */
-       unsigned long   apic_id  : 32;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                           UVH_RTC2_INT_CONFIG                             */
-/* ========================================================================= */
-#define UVH_RTC2_INT_CONFIG 0x61600UL
-
-#define UVH_RTC2_INT_CONFIG_VECTOR_SHFT 0
-#define UVH_RTC2_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
-#define UVH_RTC2_INT_CONFIG_DM_SHFT 8
-#define UVH_RTC2_INT_CONFIG_DM_MASK 0x0000000000000700UL
-#define UVH_RTC2_INT_CONFIG_DESTMODE_SHFT 11
-#define UVH_RTC2_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
-#define UVH_RTC2_INT_CONFIG_STATUS_SHFT 12
-#define UVH_RTC2_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
-#define UVH_RTC2_INT_CONFIG_P_SHFT 13
-#define UVH_RTC2_INT_CONFIG_P_MASK 0x0000000000002000UL
-#define UVH_RTC2_INT_CONFIG_T_SHFT 15
-#define UVH_RTC2_INT_CONFIG_T_MASK 0x0000000000008000UL
-#define UVH_RTC2_INT_CONFIG_M_SHFT 16
-#define UVH_RTC2_INT_CONFIG_M_MASK 0x0000000000010000UL
-#define UVH_RTC2_INT_CONFIG_APIC_ID_SHFT 32
-#define UVH_RTC2_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
-
-union uvh_rtc2_int_config_u {
-    unsigned long      v;
-    struct uvh_rtc2_int_config_s {
-       unsigned long   vector_  :  8;  /* RW */
-       unsigned long   dm       :  3;  /* RW */
-       unsigned long   destmode :  1;  /* RW */
-       unsigned long   status   :  1;  /* RO */
-       unsigned long   p        :  1;  /* RO */
-       unsigned long   rsvd_14  :  1;  /*    */
-       unsigned long   t        :  1;  /* RO */
-       unsigned long   m        :  1;  /* RW */
-       unsigned long   rsvd_17_31: 15;  /*    */
-       unsigned long   apic_id  : 32;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                           UVH_RTC3_INT_CONFIG                             */
-/* ========================================================================= */
-#define UVH_RTC3_INT_CONFIG 0x61640UL
-
-#define UVH_RTC3_INT_CONFIG_VECTOR_SHFT 0
-#define UVH_RTC3_INT_CONFIG_VECTOR_MASK 0x00000000000000ffUL
-#define UVH_RTC3_INT_CONFIG_DM_SHFT 8
-#define UVH_RTC3_INT_CONFIG_DM_MASK 0x0000000000000700UL
-#define UVH_RTC3_INT_CONFIG_DESTMODE_SHFT 11
-#define UVH_RTC3_INT_CONFIG_DESTMODE_MASK 0x0000000000000800UL
-#define UVH_RTC3_INT_CONFIG_STATUS_SHFT 12
-#define UVH_RTC3_INT_CONFIG_STATUS_MASK 0x0000000000001000UL
-#define UVH_RTC3_INT_CONFIG_P_SHFT 13
-#define UVH_RTC3_INT_CONFIG_P_MASK 0x0000000000002000UL
-#define UVH_RTC3_INT_CONFIG_T_SHFT 15
-#define UVH_RTC3_INT_CONFIG_T_MASK 0x0000000000008000UL
-#define UVH_RTC3_INT_CONFIG_M_SHFT 16
-#define UVH_RTC3_INT_CONFIG_M_MASK 0x0000000000010000UL
-#define UVH_RTC3_INT_CONFIG_APIC_ID_SHFT 32
-#define UVH_RTC3_INT_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
-
-union uvh_rtc3_int_config_u {
-    unsigned long      v;
-    struct uvh_rtc3_int_config_s {
-       unsigned long   vector_  :  8;  /* RW */
-       unsigned long   dm       :  3;  /* RW */
-       unsigned long   destmode :  1;  /* RW */
-       unsigned long   status   :  1;  /* RO */
-       unsigned long   p        :  1;  /* RO */
-       unsigned long   rsvd_14  :  1;  /*    */
-       unsigned long   t        :  1;  /* RO */
-       unsigned long   m        :  1;  /* RW */
-       unsigned long   rsvd_17_31: 15;  /*    */
-       unsigned long   apic_id  : 32;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                            UVH_RTC_INC_RATIO                              */
-/* ========================================================================= */
-#define UVH_RTC_INC_RATIO 0x350000UL
-
-#define UVH_RTC_INC_RATIO_FRACTION_SHFT 0
-#define UVH_RTC_INC_RATIO_FRACTION_MASK 0x00000000000fffffUL
-#define UVH_RTC_INC_RATIO_RATIO_SHFT 20
-#define UVH_RTC_INC_RATIO_RATIO_MASK 0x0000000000700000UL
-
-union uvh_rtc_inc_ratio_u {
-    unsigned long      v;
-    struct uvh_rtc_inc_ratio_s {
-       unsigned long   fraction : 20;  /* RW */
-       unsigned long   ratio    :  3;  /* RW */
-       unsigned long   rsvd_23_63: 41;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                          UVH_SI_ADDR_MAP_CONFIG                           */
-/* ========================================================================= */
-#define UVH_SI_ADDR_MAP_CONFIG 0xc80000UL
-
-#define UVH_SI_ADDR_MAP_CONFIG_M_SKT_SHFT 0
-#define UVH_SI_ADDR_MAP_CONFIG_M_SKT_MASK 0x000000000000003fUL
-#define UVH_SI_ADDR_MAP_CONFIG_N_SKT_SHFT 8
-#define UVH_SI_ADDR_MAP_CONFIG_N_SKT_MASK 0x0000000000000f00UL
-
-union uvh_si_addr_map_config_u {
-    unsigned long      v;
-    struct uvh_si_addr_map_config_s {
-       unsigned long   m_skt :  6;  /* RW */
-       unsigned long   rsvd_6_7:  2;  /*    */
-       unsigned long   n_skt :  4;  /* RW */
-       unsigned long   rsvd_12_63: 52;  /*    */
-    } s;
-};
-
-/* ========================================================================= */
-/*                       UVH_SI_ALIAS0_OVERLAY_CONFIG                        */
-/* ========================================================================= */
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG 0xc80008UL
-
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_SHFT 24
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_SHFT 48
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_SHFT 63
-#define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
-
-union uvh_si_alias0_overlay_config_u {
-    unsigned long      v;
-    struct uvh_si_alias0_overlay_config_s {
-       unsigned long   rsvd_0_23: 24;  /*    */
-       unsigned long   base    :  8;  /* RW */
-       unsigned long   rsvd_32_47: 16;  /*    */
-       unsigned long   m_alias :  5;  /* RW */
-       unsigned long   rsvd_53_62: 10;  /*    */
-       unsigned long   enable  :  1;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                       UVH_SI_ALIAS1_OVERLAY_CONFIG                        */
-/* ========================================================================= */
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG 0xc80010UL
-
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_SHFT 24
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_SHFT 48
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_SHFT 63
-#define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
-
-union uvh_si_alias1_overlay_config_u {
-    unsigned long      v;
-    struct uvh_si_alias1_overlay_config_s {
-       unsigned long   rsvd_0_23: 24;  /*    */
-       unsigned long   base    :  8;  /* RW */
-       unsigned long   rsvd_32_47: 16;  /*    */
-       unsigned long   m_alias :  5;  /* RW */
-       unsigned long   rsvd_53_62: 10;  /*    */
-       unsigned long   enable  :  1;  /* RW */
-    } s;
-};
-
-/* ========================================================================= */
-/*                       UVH_SI_ALIAS2_OVERLAY_CONFIG                        */
-/* ========================================================================= */
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG 0xc80018UL
-
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_SHFT 24
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_SHFT 48
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_SHFT 63
-#define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL
-
-union uvh_si_alias2_overlay_config_u {
-    unsigned long      v;
-    struct uvh_si_alias2_overlay_config_s {
-       unsigned long   rsvd_0_23: 24;  /*    */
-       unsigned long   base    :  8;  /* RW */
-       unsigned long   rsvd_32_47: 16;  /*    */
-       unsigned long   m_alias :  5;  /* RW */
-       unsigned long   rsvd_53_62: 10;  /*    */
-       unsigned long   enable  :  1;  /* RW */
-    } s;
-};
-
-
-#endif /* __ASM_IA64_UV_MMRS__ */
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h
deleted file mode 100644 (file)
index 02184ec..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *     Access to VGA videoram
- *
- *     (c) 1998 Martin Mares <mj@ucw.cz>
- *     (c) 1999 Asit Mallick <asit.k.mallick@intel.com>
- *     (c) 1999 Don Dugger <don.dugger@intel.com>
- */
-
-#ifndef __ASM_IA64_VGA_H_
-#define __ASM_IA64_VGA_H_
-
-/*
- * On the PC, we can just recalculate addresses and then access the
- * videoram directly without any black magic.
- */
-
-extern unsigned long vga_console_iobase;
-extern unsigned long vga_console_membase;
-
-#define VGA_MAP_MEM(x,s)       ((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
-
-#define vga_readb(x)   (*(x))
-#define vga_writeb(x,y)        (*(y) = (x))
-
-#endif /* __ASM_IA64_VGA_H_ */
diff --git a/include/asm-ia64/xor.h b/include/asm-ia64/xor.h
deleted file mode 100644 (file)
index 41fb874..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * include/asm-ia64/xor.h
- *
- * Optimized RAID-5 checksumming functions for IA-64.
- *
- * 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_ia64_2(unsigned long, unsigned long *, unsigned long *);
-extern void xor_ia64_3(unsigned long, unsigned long *, unsigned long *,
-                      unsigned long *);
-extern void xor_ia64_4(unsigned long, unsigned long *, unsigned long *,
-                      unsigned long *, unsigned long *);
-extern void xor_ia64_5(unsigned long, unsigned long *, unsigned long *,
-                      unsigned long *, unsigned long *, unsigned long *);
-
-static struct xor_block_template xor_block_ia64 = {
-       .name = "ia64",
-       .do_2 = xor_ia64_2,
-       .do_3 = xor_ia64_3,
-       .do_4 = xor_ia64_4,
-       .do_5 = xor_ia64_5,
-};
-
-#define XOR_TRY_TEMPLATES      xor_speed(&xor_block_ia64)
diff --git a/include/asm-mips/gdb-stub.h b/include/asm-mips/gdb-stub.h
deleted file mode 100644 (file)
index 22f67d4..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * 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 Andreas Busse
- * Copyright (C) 2003 Ralf Baechle
- */
-#ifndef _ASM_GDB_STUB_H
-#define _ASM_GDB_STUB_H
-
-
-/*
- * important register numbers
- */
-
-#define REG_EPC                        37
-#define REG_FP                 72
-#define REG_SP                 29
-
-/*
- * Stack layout for the GDB exception handler
- * Derived from the stack layout described in asm-mips/stackframe.h
- *
- * The first PTRSIZE*6 bytes are argument save space for C subroutines.
- */
-#define NUMREGS                        90
-
-#define GDB_FR_REG0            (PTRSIZE*6)                     /* 0 */
-#define GDB_FR_REG1            ((GDB_FR_REG0) + LONGSIZE)      /* 1 */
-#define GDB_FR_REG2            ((GDB_FR_REG1) + LONGSIZE)      /* 2 */
-#define GDB_FR_REG3            ((GDB_FR_REG2) + LONGSIZE)      /* 3 */
-#define GDB_FR_REG4            ((GDB_FR_REG3) + LONGSIZE)      /* 4 */
-#define GDB_FR_REG5            ((GDB_FR_REG4) + LONGSIZE)      /* 5 */
-#define GDB_FR_REG6            ((GDB_FR_REG5) + LONGSIZE)      /* 6 */
-#define GDB_FR_REG7            ((GDB_FR_REG6) + LONGSIZE)      /* 7 */
-#define GDB_FR_REG8            ((GDB_FR_REG7) + LONGSIZE)      /* 8 */
-#define GDB_FR_REG9            ((GDB_FR_REG8) + LONGSIZE)      /* 9 */
-#define GDB_FR_REG10           ((GDB_FR_REG9) + LONGSIZE)      /* 10 */
-#define GDB_FR_REG11           ((GDB_FR_REG10) + LONGSIZE)     /* 11 */
-#define GDB_FR_REG12           ((GDB_FR_REG11) + LONGSIZE)     /* 12 */
-#define GDB_FR_REG13           ((GDB_FR_REG12) + LONGSIZE)     /* 13 */
-#define GDB_FR_REG14           ((GDB_FR_REG13) + LONGSIZE)     /* 14 */
-#define GDB_FR_REG15           ((GDB_FR_REG14) + LONGSIZE)     /* 15 */
-#define GDB_FR_REG16           ((GDB_FR_REG15) + LONGSIZE)     /* 16 */
-#define GDB_FR_REG17           ((GDB_FR_REG16) + LONGSIZE)     /* 17 */
-#define GDB_FR_REG18           ((GDB_FR_REG17) + LONGSIZE)     /* 18 */
-#define GDB_FR_REG19           ((GDB_FR_REG18) + LONGSIZE)     /* 19 */
-#define GDB_FR_REG20           ((GDB_FR_REG19) + LONGSIZE)     /* 20 */
-#define GDB_FR_REG21           ((GDB_FR_REG20) + LONGSIZE)     /* 21 */
-#define GDB_FR_REG22           ((GDB_FR_REG21) + LONGSIZE)     /* 22 */
-#define GDB_FR_REG23           ((GDB_FR_REG22) + LONGSIZE)     /* 23 */
-#define GDB_FR_REG24           ((GDB_FR_REG23) + LONGSIZE)     /* 24 */
-#define GDB_FR_REG25           ((GDB_FR_REG24) + LONGSIZE)     /* 25 */
-#define GDB_FR_REG26           ((GDB_FR_REG25) + LONGSIZE)     /* 26 */
-#define GDB_FR_REG27           ((GDB_FR_REG26) + LONGSIZE)     /* 27 */
-#define GDB_FR_REG28           ((GDB_FR_REG27) + LONGSIZE)     /* 28 */
-#define GDB_FR_REG29           ((GDB_FR_REG28) + LONGSIZE)     /* 29 */
-#define GDB_FR_REG30           ((GDB_FR_REG29) + LONGSIZE)     /* 30 */
-#define GDB_FR_REG31           ((GDB_FR_REG30) + LONGSIZE)     /* 31 */
-
-/*
- * Saved special registers
- */
-#define GDB_FR_STATUS          ((GDB_FR_REG31) + LONGSIZE)     /* 32 */
-#define GDB_FR_LO              ((GDB_FR_STATUS) + LONGSIZE)    /* 33 */
-#define GDB_FR_HI              ((GDB_FR_LO) + LONGSIZE)        /* 34 */
-#define GDB_FR_BADVADDR                ((GDB_FR_HI) + LONGSIZE)        /* 35 */
-#define GDB_FR_CAUSE           ((GDB_FR_BADVADDR) + LONGSIZE)  /* 36 */
-#define GDB_FR_EPC             ((GDB_FR_CAUSE) + LONGSIZE)     /* 37 */
-
-/*
- * Saved floating point registers
- */
-#define GDB_FR_FPR0            ((GDB_FR_EPC) + LONGSIZE)       /* 38 */
-#define GDB_FR_FPR1            ((GDB_FR_FPR0) + LONGSIZE)      /* 39 */
-#define GDB_FR_FPR2            ((GDB_FR_FPR1) + LONGSIZE)      /* 40 */
-#define GDB_FR_FPR3            ((GDB_FR_FPR2) + LONGSIZE)      /* 41 */
-#define GDB_FR_FPR4            ((GDB_FR_FPR3) + LONGSIZE)      /* 42 */
-#define GDB_FR_FPR5            ((GDB_FR_FPR4) + LONGSIZE)      /* 43 */
-#define GDB_FR_FPR6            ((GDB_FR_FPR5) + LONGSIZE)      /* 44 */
-#define GDB_FR_FPR7            ((GDB_FR_FPR6) + LONGSIZE)      /* 45 */
-#define GDB_FR_FPR8            ((GDB_FR_FPR7) + LONGSIZE)      /* 46 */
-#define GDB_FR_FPR9            ((GDB_FR_FPR8) + LONGSIZE)      /* 47 */
-#define GDB_FR_FPR10           ((GDB_FR_FPR9) + LONGSIZE)      /* 48 */
-#define GDB_FR_FPR11           ((GDB_FR_FPR10) + LONGSIZE)     /* 49 */
-#define GDB_FR_FPR12           ((GDB_FR_FPR11) + LONGSIZE)     /* 50 */
-#define GDB_FR_FPR13           ((GDB_FR_FPR12) + LONGSIZE)     /* 51 */
-#define GDB_FR_FPR14           ((GDB_FR_FPR13) + LONGSIZE)     /* 52 */
-#define GDB_FR_FPR15           ((GDB_FR_FPR14) + LONGSIZE)     /* 53 */
-#define GDB_FR_FPR16           ((GDB_FR_FPR15) + LONGSIZE)     /* 54 */
-#define GDB_FR_FPR17           ((GDB_FR_FPR16) + LONGSIZE)     /* 55 */
-#define GDB_FR_FPR18           ((GDB_FR_FPR17) + LONGSIZE)     /* 56 */
-#define GDB_FR_FPR19           ((GDB_FR_FPR18) + LONGSIZE)     /* 57 */
-#define GDB_FR_FPR20           ((GDB_FR_FPR19) + LONGSIZE)     /* 58 */
-#define GDB_FR_FPR21           ((GDB_FR_FPR20) + LONGSIZE)     /* 59 */
-#define GDB_FR_FPR22           ((GDB_FR_FPR21) + LONGSIZE)     /* 60 */
-#define GDB_FR_FPR23           ((GDB_FR_FPR22) + LONGSIZE)     /* 61 */
-#define GDB_FR_FPR24           ((GDB_FR_FPR23) + LONGSIZE)     /* 62 */
-#define GDB_FR_FPR25           ((GDB_FR_FPR24) + LONGSIZE)     /* 63 */
-#define GDB_FR_FPR26           ((GDB_FR_FPR25) + LONGSIZE)     /* 64 */
-#define GDB_FR_FPR27           ((GDB_FR_FPR26) + LONGSIZE)     /* 65 */
-#define GDB_FR_FPR28           ((GDB_FR_FPR27) + LONGSIZE)     /* 66 */
-#define GDB_FR_FPR29           ((GDB_FR_FPR28) + LONGSIZE)     /* 67 */
-#define GDB_FR_FPR30           ((GDB_FR_FPR29) + LONGSIZE)     /* 68 */
-#define GDB_FR_FPR31           ((GDB_FR_FPR30) + LONGSIZE)     /* 69 */
-
-#define GDB_FR_FSR             ((GDB_FR_FPR31) + LONGSIZE)     /* 70 */
-#define GDB_FR_FIR             ((GDB_FR_FSR) + LONGSIZE)       /* 71 */
-#define GDB_FR_FRP             ((GDB_FR_FIR) + LONGSIZE)       /* 72 */
-
-#define GDB_FR_DUMMY           ((GDB_FR_FRP) + LONGSIZE)       /* 73, unused ??? */
-
-/*
- * Again, CP0 registers
- */
-#define GDB_FR_CP0_INDEX       ((GDB_FR_DUMMY) + LONGSIZE)     /* 74 */
-#define GDB_FR_CP0_RANDOM      ((GDB_FR_CP0_INDEX) + LONGSIZE) /* 75 */
-#define GDB_FR_CP0_ENTRYLO0    ((GDB_FR_CP0_RANDOM) + LONGSIZE)/* 76 */
-#define GDB_FR_CP0_ENTRYLO1    ((GDB_FR_CP0_ENTRYLO0) + LONGSIZE)/* 77 */
-#define GDB_FR_CP0_CONTEXT     ((GDB_FR_CP0_ENTRYLO1) + LONGSIZE)/* 78 */
-#define GDB_FR_CP0_PAGEMASK    ((GDB_FR_CP0_CONTEXT) + LONGSIZE)/* 79 */
-#define GDB_FR_CP0_WIRED       ((GDB_FR_CP0_PAGEMASK) + LONGSIZE)/* 80 */
-#define GDB_FR_CP0_REG7                ((GDB_FR_CP0_WIRED) + LONGSIZE) /* 81 */
-#define GDB_FR_CP0_REG8                ((GDB_FR_CP0_REG7) + LONGSIZE)  /* 82 */
-#define GDB_FR_CP0_REG9                ((GDB_FR_CP0_REG8) + LONGSIZE)  /* 83 */
-#define GDB_FR_CP0_ENTRYHI     ((GDB_FR_CP0_REG9) + LONGSIZE)  /* 84 */
-#define GDB_FR_CP0_REG11       ((GDB_FR_CP0_ENTRYHI) + LONGSIZE)/* 85 */
-#define GDB_FR_CP0_REG12       ((GDB_FR_CP0_REG11) + LONGSIZE) /* 86 */
-#define GDB_FR_CP0_REG13       ((GDB_FR_CP0_REG12) + LONGSIZE) /* 87 */
-#define GDB_FR_CP0_REG14       ((GDB_FR_CP0_REG13) + LONGSIZE) /* 88 */
-#define GDB_FR_CP0_PRID                ((GDB_FR_CP0_REG14) + LONGSIZE) /* 89 */
-
-#define GDB_FR_SIZE            ((((GDB_FR_CP0_PRID) + LONGSIZE) + (PTRSIZE-1)) & ~(PTRSIZE-1))
-
-#ifndef __ASSEMBLY__
-
-/*
- * This is the same as above, but for the high-level
- * part of the GDB stub.
- */
-
-struct gdb_regs {
-       /*
-        * Pad bytes for argument save space on the stack
-        * 24/48 Bytes for 32/64 bit code
-        */
-       unsigned long pad0[6];
-
-       /*
-        * saved main processor registers
-        */
-       long     reg0,  reg1,  reg2,  reg3,  reg4,  reg5,  reg6,  reg7;
-       long     reg8,  reg9, reg10, reg11, reg12, reg13, reg14, reg15;
-       long    reg16, reg17, reg18, reg19, reg20, reg21, reg22, reg23;
-       long    reg24, reg25, reg26, reg27, reg28, reg29, reg30, reg31;
-
-       /*
-        * Saved special registers
-        */
-       long    cp0_status;
-       long    lo;
-       long    hi;
-       long    cp0_badvaddr;
-       long    cp0_cause;
-       long    cp0_epc;
-
-       /*
-        * Saved floating point registers
-        */
-       long    fpr0,  fpr1,  fpr2,  fpr3,  fpr4,  fpr5,  fpr6,  fpr7;
-       long    fpr8,  fpr9,  fpr10, fpr11, fpr12, fpr13, fpr14, fpr15;
-       long    fpr16, fpr17, fpr18, fpr19, fpr20, fpr21, fpr22, fpr23;
-       long    fpr24, fpr25, fpr26, fpr27, fpr28, fpr29, fpr30, fpr31;
-
-       long    cp1_fsr;
-       long    cp1_fir;
-
-       /*
-        * Frame pointer
-        */
-       long    frame_ptr;
-       long    dummy;          /* unused */
-
-       /*
-        * saved cp0 registers
-        */
-       long    cp0_index;
-       long    cp0_random;
-       long    cp0_entrylo0;
-       long    cp0_entrylo1;
-       long    cp0_context;
-       long    cp0_pagemask;
-       long    cp0_wired;
-       long    cp0_reg7;
-       long    cp0_reg8;
-       long    cp0_reg9;
-       long    cp0_entryhi;
-       long    cp0_reg11;
-       long    cp0_reg12;
-       long    cp0_reg13;
-       long    cp0_reg14;
-       long    cp0_prid;
-};
-
-/*
- * Prototypes
- */
-
-extern int kgdb_enabled;
-void set_debug_traps(void);
-void set_async_breakpoint(unsigned long *epc);
-
-#endif /* !__ASSEMBLY__ */
-#endif /* _ASM_GDB_STUB_H */
index 6ece1b0376655be5d6ab0fbcdbc6369f7f68acac..5bf62aafc8909308c40d3de0452f764eab88a55c 100644 (file)
@@ -1 +1,13 @@
-#include <asm-generic/kdebug.h>
+#ifndef _ASM_MIPS_KDEBUG_H
+#define _ASM_MIPS_KDEBUG_H
+
+#include <linux/notifier.h>
+
+enum die_val {
+       DIE_OOPS = 1,
+       DIE_FP,
+       DIE_TRAP,
+       DIE_RI,
+};
+
+#endif /* _ASM_MIPS_KDEBUG_H */
diff --git a/include/asm-mips/kgdb.h b/include/asm-mips/kgdb.h
new file mode 100644 (file)
index 0000000..48223b0
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __ASM_KGDB_H_
+#define __ASM_KGDB_H_
+
+#ifdef __KERNEL__
+
+#include <asm/sgidefs.h>
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
+       (_MIPS_ISA == _MIPS_ISA_MIPS32)
+
+#define KGDB_GDB_REG_SIZE 32
+
+#elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
+       (_MIPS_ISA == _MIPS_ISA_MIPS64)
+
+#ifdef CONFIG_32BIT
+#define KGDB_GDB_REG_SIZE 32
+#else /* CONFIG_CPU_32BIT */
+#define KGDB_GDB_REG_SIZE 64
+#endif
+#else
+#error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA"
+#endif /* _MIPS_ISA */
+
+#define BUFMAX                 2048
+#if (KGDB_GDB_REG_SIZE == 32)
+#define NUMREGBYTES            (90*sizeof(u32))
+#define NUMCRITREGBYTES                (12*sizeof(u32))
+#else
+#define NUMREGBYTES            (90*sizeof(u64))
+#define NUMCRITREGBYTES                (12*sizeof(u64))
+#endif
+#define BREAK_INSTR_SIZE       4
+#define CACHE_FLUSH_IS_SAFE    0
+
+extern void arch_kgdb_breakpoint(void);
+extern int kgdb_early_setup;
+extern void *saved_vectors[32];
+extern void handle_exception(struct pt_regs *regs);
+extern void breakinst(void);
+
+#endif                         /* __KERNEL__ */
+
+#endif /* __ASM_KGDB_H_ */
index c205875d7f31001efd3fe0bbd553322d2097a259..5510c53b7feb7f5b7d2e721b70c763d055f8ef0d 100644 (file)
@@ -174,4 +174,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
 
 extern int pci_probe_only;
 
+extern char * (*pcibios_plat_setup)(char *str);
+
 #endif /* _ASM_PCI_H */
index cbae37ec3d8824fba82ec886e1eaa305b75c6b1b..5b1ccf901c625a99931e6ed8e6e3a34c622c3312 100644 (file)
@@ -44,5 +44,19 @@ extern struct txx9_board_vec *txx9_board_vec;
 extern int (*txx9_irq_dispatch)(int pending);
 void prom_init_cmdline(void);
 char *prom_getcmdline(void);
+void txx9_wdt_init(unsigned long base);
+void txx9_spi_init(int busid, unsigned long base, int irq);
+void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
+void txx9_sio_init(unsigned long baseaddr, int irq,
+                  unsigned int line, unsigned int sclk, int nocts);
+void prom_putchar(char c);
+#ifdef CONFIG_EARLY_PRINTK
+extern void (*txx9_prom_putchar)(char c);
+void txx9_sio_putchar_init(unsigned long baseaddr);
+#else
+static inline void txx9_sio_putchar_init(unsigned long baseaddr)
+{
+}
+#endif
 
 #endif /* __ASM_TXX9_GENERIC_H */
index d6eb1b6a54eb002724ea5b22b61ecd3eb40686c5..a409c446bf18772c629d0711d654db2656c6d78a 100644 (file)
 
 /* Clocks */
 #define JMR3927_CORECLK        132710400       /* 132.7MHz */
-#define JMR3927_GBUSCLK        (JMR3927_CORECLK / 2)   /* 66.35MHz */
-#define JMR3927_IMCLK  (JMR3927_CORECLK / 4)   /* 33.17MHz */
 
 /*
  * TX3927 Pin Configuration:
index d89a45091e2403cd8aeec2197248a31c5fcf21f3..3d32529060aaf999090253b3b86b117364e5204b 100644 (file)
@@ -33,4 +33,7 @@ enum txx9_pci_err_action {
 };
 extern enum txx9_pci_err_action txx9_pci_err_action;
 
+extern char * (*txx9_board_pcibios_setup)(char *str);
+char *txx9_pcibios_setup(char *str);
+
 #endif /* __ASM_TXX9_PCI_H */
index 9375e4fc2289bd6132cd68009ff7715ab3e8b9d3..02e161d0755d3d62de502c86796270c65fcfe86b 100644 (file)
@@ -56,7 +56,7 @@
 #define SMSC_FDC37M81X_CONFIG_EXIT   0xaa
 #define SMSC_FDC37M81X_CHIP_ID       0x4d
 
-unsigned long __init smsc_fdc37m81x_init(unsigned long port);
+unsigned long smsc_fdc37m81x_init(unsigned long port);
 
 void smsc_fdc37m81x_config_beg(void);
 
index ea79e1b16e713753f8268f5a016c192710b6f0ef..587deb9592d2a300ae280cec12b1c90b680e76f0 100644 (file)
@@ -8,9 +8,8 @@
 #ifndef __ASM_TXX9_TX3927_H
 #define __ASM_TXX9_TX3927_H
 
-#include <asm/txx9/txx927.h>
-
 #define TX3927_REG_BASE        0xfffe0000UL
+#define TX3927_REG_SIZE        0x00010000
 #define TX3927_SDRAMC_REG      (TX3927_REG_BASE + 0x8000)
 #define TX3927_ROMC_REG                (TX3927_REG_BASE + 0x9000)
 #define TX3927_DMA_REG         (TX3927_REG_BASE + 0xb000)
@@ -236,11 +235,17 @@ struct tx3927_ccfg_reg {
 /* see PCI_STATUS_XXX in linux/pci.h */
 #define PCI_STATUS_NEW_CAP     0x0010
 
+/* bits for ISTAT/IIM */
+#define TX3927_PCIC_IIM_ALL    0x00001600
+
 /* bits for TC */
 #define TX3927_PCIC_TC_OF16E   0x00000020
 #define TX3927_PCIC_TC_IF8E    0x00000010
 #define TX3927_PCIC_TC_OF8E    0x00000008
 
+/* bits for TSTAT/TIM */
+#define TX3927_PCIC_TIM_ALL    0x0003ffff
+
 /* bits for IOBA/MBA */
 /* see PCI_BASE_ADDRESS_XXX in linux/pci.h */
 
@@ -313,12 +318,22 @@ struct tx3927_ccfg_reg {
 #define tx3927_dmaptr          ((struct tx3927_dma_reg *)TX3927_DMA_REG)
 #define tx3927_pcicptr         ((struct tx3927_pcic_reg *)TX3927_PCIC_REG)
 #define tx3927_ccfgptr         ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG)
-#define tx3927_tmrptr(ch)      ((struct txx927_tmr_reg *)TX3927_TMR_REG(ch))
 #define tx3927_sioptr(ch)      ((struct txx927_sio_reg *)TX3927_SIO_REG(ch))
 #define tx3927_pioptr          ((struct txx9_pio_reg __iomem *)TX3927_PIO_REG)
 
+#define TX3927_REV_PCODE()     (tx3927_ccfgptr->crir >> 16)
+#define TX3927_ROMC_BA(ch)     (tx3927_romcptr->cr[(ch)] & 0xfff00000)
+#define TX3927_ROMC_SIZE(ch)   \
+       (0x00100000 << ((tx3927_romcptr->cr[(ch)] >> 8) & 0xf))
+
+void tx3927_wdt_init(void);
+void tx3927_setup(void);
+void tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr);
+void tx3927_sio_init(unsigned int sclk, unsigned int cts_mask);
 struct pci_controller;
-void __init tx3927_pcic_setup(struct pci_controller *channel,
-                             unsigned long sdram_size, int extarb);
+void tx3927_pcic_setup(struct pci_controller *channel,
+                      unsigned long sdram_size, int extarb);
+void tx3927_setup_pcierr_irq(void);
+void tx3927_irq_init(void);
 
 #endif /* __ASM_TXX9_TX3927_H */
index ceb4b79ff4e365f335b08861946e02f5e03d8c0c..195f6515db9aeabe50eab868640f655f4e8abd3d 100644 (file)
@@ -243,12 +243,13 @@ static inline void tx4927_ccfg_change(__u64 change, __u64 new)
 }
 
 unsigned int tx4927_get_mem_size(void);
-void tx4927_wdr_init(void);
+void tx4927_wdt_init(void);
 void tx4927_setup(void);
 void tx4927_time_init(unsigned int tmrnr);
-void tx4927_setup_serial(void);
+void tx4927_sio_init(unsigned int sclk, unsigned int cts_mask);
 int tx4927_report_pciclk(void);
 int tx4927_pciclk66_setup(void);
+void tx4927_setup_pcierr_irq(void);
 void tx4927_irq_init(void);
 
 #endif /* __ASM_TXX9_TX4927_H */
index d61c3d09c4a222ce584ec053dcde3b9d8a7828aa..c470b8a5fe570dfa79807f746697643e2633f3f0 100644 (file)
@@ -10,6 +10,7 @@
 #define __ASM_TXX9_TX4927PCIC_H
 
 #include <linux/pci.h>
+#include <linux/irqreturn.h>
 
 struct tx4927_pcic_reg {
        u32 pciid;
@@ -192,8 +193,11 @@ struct tx4927_pcic_reg {
 
 struct tx4927_pcic_reg __iomem *get_tx4927_pcicptr(
        struct pci_controller *channel);
-void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr,
-                             struct pci_controller *channel, int extarb);
+void tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr,
+                      struct pci_controller *channel, int extarb);
 void tx4927_report_pcic_status(void);
+char *tx4927_pcibios_setup(char *str);
+void tx4927_dump_pcic_settings(void);
+irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id);
 
 #endif /* __ASM_TXX9_TX4927PCIC_H */
index 1ed969d381d6949a0ee74e44fc137509e0a84272..8175d4ccbc39f08d5a22936b779da452a8adeea9 100644 (file)
@@ -276,15 +276,18 @@ struct tx4938_ccfg_reg {
 #define TX4938_EBUSC_SIZE(ch)  TX4927_EBUSC_SIZE(ch)
 
 #define tx4938_get_mem_size() tx4927_get_mem_size()
-void tx4938_wdr_init(void);
+void tx4938_wdt_init(void);
 void tx4938_setup(void);
 void tx4938_time_init(unsigned int tmrnr);
-void tx4938_setup_serial(void);
+void tx4938_sio_init(unsigned int sclk, unsigned int cts_mask);
+void tx4938_spi_init(int busid);
+void tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1);
 int tx4938_report_pciclk(void);
 void tx4938_report_pci1clk(void);
 int tx4938_pciclk66_setup(void);
 struct pci_dev;
 int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot);
+void tx4938_setup_pcierr_irq(void);
 void tx4938_irq_init(void);
 
 #endif
diff --git a/include/asm-mips/txx9/txx927.h b/include/asm-mips/txx9/txx927.h
deleted file mode 100644 (file)
index 97dd7ad..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Common definitions for TX3927/TX4927
- *
- * 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) 2000 Toshiba Corporation
- */
-#ifndef __ASM_TXX9_TXX927_H
-#define __ASM_TXX9_TXX927_H
-
-struct txx927_sio_reg {
-       volatile unsigned long lcr;
-       volatile unsigned long dicr;
-       volatile unsigned long disr;
-       volatile unsigned long cisr;
-       volatile unsigned long fcr;
-       volatile unsigned long flcr;
-       volatile unsigned long bgr;
-       volatile unsigned long tfifo;
-       volatile unsigned long rfifo;
-};
-
-/*
- * SIO
- */
-/* SILCR : Line Control */
-#define TXx927_SILCR_SCS_MASK  0x00000060
-#define TXx927_SILCR_SCS_IMCLK 0x00000000
-#define TXx927_SILCR_SCS_IMCLK_BG      0x00000020
-#define TXx927_SILCR_SCS_SCLK  0x00000040
-#define TXx927_SILCR_SCS_SCLK_BG       0x00000060
-#define TXx927_SILCR_UEPS      0x00000010
-#define TXx927_SILCR_UPEN      0x00000008
-#define TXx927_SILCR_USBL_MASK 0x00000004
-#define TXx927_SILCR_USBL_1BIT 0x00000004
-#define TXx927_SILCR_USBL_2BIT 0x00000000
-#define TXx927_SILCR_UMODE_MASK        0x00000003
-#define TXx927_SILCR_UMODE_8BIT        0x00000000
-#define TXx927_SILCR_UMODE_7BIT        0x00000001
-
-/* SIDICR : DMA/Int. Control */
-#define TXx927_SIDICR_TDE      0x00008000
-#define TXx927_SIDICR_RDE      0x00004000
-#define TXx927_SIDICR_TIE      0x00002000
-#define TXx927_SIDICR_RIE      0x00001000
-#define TXx927_SIDICR_SPIE     0x00000800
-#define TXx927_SIDICR_CTSAC    0x00000600
-#define TXx927_SIDICR_STIE_MASK        0x0000003f
-#define TXx927_SIDICR_STIE_OERS                0x00000020
-#define TXx927_SIDICR_STIE_CTSS                0x00000010
-#define TXx927_SIDICR_STIE_RBRKD       0x00000008
-#define TXx927_SIDICR_STIE_TRDY                0x00000004
-#define TXx927_SIDICR_STIE_TXALS       0x00000002
-#define TXx927_SIDICR_STIE_UBRKD       0x00000001
-
-/* SIDISR : DMA/Int. Status */
-#define TXx927_SIDISR_UBRK     0x00008000
-#define TXx927_SIDISR_UVALID   0x00004000
-#define TXx927_SIDISR_UFER     0x00002000
-#define TXx927_SIDISR_UPER     0x00001000
-#define TXx927_SIDISR_UOER     0x00000800
-#define TXx927_SIDISR_ERI      0x00000400
-#define TXx927_SIDISR_TOUT     0x00000200
-#define TXx927_SIDISR_TDIS     0x00000100
-#define TXx927_SIDISR_RDIS     0x00000080
-#define TXx927_SIDISR_STIS     0x00000040
-#define TXx927_SIDISR_RFDN_MASK        0x0000001f
-
-/* SICISR : Change Int. Status */
-#define TXx927_SICISR_OERS     0x00000020
-#define TXx927_SICISR_CTSS     0x00000010
-#define TXx927_SICISR_RBRKD    0x00000008
-#define TXx927_SICISR_TRDY     0x00000004
-#define TXx927_SICISR_TXALS    0x00000002
-#define TXx927_SICISR_UBRKD    0x00000001
-
-/* SIFCR : FIFO Control */
-#define TXx927_SIFCR_SWRST     0x00008000
-#define TXx927_SIFCR_RDIL_MASK 0x00000180
-#define TXx927_SIFCR_RDIL_1    0x00000000
-#define TXx927_SIFCR_RDIL_4    0x00000080
-#define TXx927_SIFCR_RDIL_8    0x00000100
-#define TXx927_SIFCR_RDIL_12   0x00000180
-#define TXx927_SIFCR_RDIL_MAX  0x00000180
-#define TXx927_SIFCR_TDIL_MASK 0x00000018
-#define TXx927_SIFCR_TDIL_MASK 0x00000018
-#define TXx927_SIFCR_TDIL_1    0x00000000
-#define TXx927_SIFCR_TDIL_4    0x00000001
-#define TXx927_SIFCR_TDIL_8    0x00000010
-#define TXx927_SIFCR_TDIL_MAX  0x00000010
-#define TXx927_SIFCR_TFRST     0x00000004
-#define TXx927_SIFCR_RFRST     0x00000002
-#define TXx927_SIFCR_FRSTE     0x00000001
-#define TXx927_SIO_TX_FIFO     8
-#define TXx927_SIO_RX_FIFO     16
-
-/* SIFLCR : Flow Control */
-#define TXx927_SIFLCR_RCS      0x00001000
-#define TXx927_SIFLCR_TES      0x00000800
-#define TXx927_SIFLCR_RTSSC    0x00000200
-#define TXx927_SIFLCR_RSDE     0x00000100
-#define TXx927_SIFLCR_TSDE     0x00000080
-#define TXx927_SIFLCR_RTSTL_MASK       0x0000001e
-#define TXx927_SIFLCR_RTSTL_MAX        0x0000001e
-#define TXx927_SIFLCR_TBRK     0x00000001
-
-/* SIBGR : Baudrate Control */
-#define TXx927_SIBGR_BCLK_MASK 0x00000300
-#define TXx927_SIBGR_BCLK_T0   0x00000000
-#define TXx927_SIBGR_BCLK_T2   0x00000100
-#define TXx927_SIBGR_BCLK_T4   0x00000200
-#define TXx927_SIBGR_BCLK_T6   0x00000300
-#define TXx927_SIBGR_BRD_MASK  0x000000ff
-
-/*
- * PIO
- */
-
-#endif /* __ASM_TXX9_TXX927_H */
index 1c439e51b875ed8d6b427334f16579aff23e2273..5620879be37fb632310fe137264e2ef525cf3b9d 100644 (file)
 #ifdef CONFIG_IRQ_CPU
 #define TXX9_IRQ_BASE  (MIPS_CPU_IRQ_BASE + 8)
 #else
+#ifdef CONFIG_I8259
+#define TXX9_IRQ_BASE  (I8259A_IRQ_BASE + 16)
+#else
 #define TXX9_IRQ_BASE  0
 #endif
+#endif
 
 #ifdef CONFIG_CPU_TX39XX
 #define TXx9_MAX_IR 16
index 3721aa9e195d1007a9c6e57dd286803a5a486a5b..543a4f98695d052cef96e355a20220c27d6f253a 100644 (file)
 #define __NR_fallocate         325
 #define __NR_timerfd_settime   326
 #define __NR_timerfd_gettime   327
+#define __NR_signalfd4         328
+#define __NR_eventfd2          329
+#define __NR_epoll_create1     330
+#define __NR_dup3              331
+#define __NR_pipe2             332
+#define __NR_inotify_init1     333
 
 #ifdef __KERNEL__
 
diff --git a/include/asm-sh/.gitignore b/include/asm-sh/.gitignore
deleted file mode 100644 (file)
index 9218ef8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-cpu
-mach
-machtypes.h
diff --git a/include/asm-sh/Kbuild b/include/asm-sh/Kbuild
deleted file mode 100644 (file)
index 43910cd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-include include/asm-generic/Kbuild.asm
-
-header-y += cpu-features.h
-
-unifdef-y += unistd_32.h
-unifdef-y += unistd_64.h
-unifdef-y += posix_types_32.h
-unifdef-y += posix_types_64.h
diff --git a/include/asm-sh/a.out.h b/include/asm-sh/a.out.h
deleted file mode 100644 (file)
index 1f93130..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SH_A_OUT_H
-#define __ASM_SH_A_OUT_H
-
-struct exec
-{
-  unsigned long a_info;                /* Use macros N_MAGIC, etc for access */
-  unsigned a_text;             /* length of text, in bytes */
-  unsigned a_data;             /* length of data, in bytes */
-  unsigned a_bss;              /* length of uninitialized data area for file, in bytes */
-  unsigned a_syms;             /* length of symbol table data in file, in bytes */
-  unsigned a_entry;            /* start address */
-  unsigned a_trsize;           /* length of relocation info for text, in bytes */
-  unsigned a_drsize;           /* length of relocation info for data, in bytes */
-};
-
-#define N_TRSIZE(a)    ((a).a_trsize)
-#define N_DRSIZE(a)    ((a).a_drsize)
-#define N_SYMSIZE(a)   ((a).a_syms)
-
-#endif /* __ASM_SH_A_OUT_H */
diff --git a/include/asm-sh/adc.h b/include/asm-sh/adc.h
deleted file mode 100644 (file)
index 5f85cf7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_ADC_H
-#define __ASM_ADC_H
-#ifdef __KERNEL__
-/*
- * Copyright (C) 2004  Andriy Skulysh
- */
-
-#include <asm/cpu/adc.h>
-
-int adc_single(unsigned int channel);
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_ADC_H */
diff --git a/include/asm-sh/addrspace.h b/include/asm-sh/addrspace.h
deleted file mode 100644 (file)
index fa544fc..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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) 1999 by Kaz Kojima
- *
- * Defitions for the address spaces of the SH CPUs.
- */
-#ifndef __ASM_SH_ADDRSPACE_H
-#define __ASM_SH_ADDRSPACE_H
-
-#ifdef __KERNEL__
-
-#include <asm/cpu/addrspace.h>
-
-/* If this CPU supports segmentation, hook up the helpers */
-#ifdef P1SEG
-
-/*
-   [ P0/U0 (virtual) ]         0x00000000     <------ User space
-   [ P1 (fixed)   cached ]     0x80000000     <------ Kernel space
-   [ P2 (fixed)  non-cachable] 0xA0000000     <------ Physical access
-   [ P3 (virtual) cached]      0xC0000000     <------ vmalloced area
-   [ P4 control   ]            0xE0000000
- */
-
-/* Returns the privileged segment base of a given address  */
-#define PXSEG(a)       (((unsigned long)(a)) & 0xe0000000)
-
-/* Returns the physical address of a PnSEG (n=1,2) address   */
-#define PHYSADDR(a)    (((unsigned long)(a)) & 0x1fffffff)
-
-#ifdef CONFIG_29BIT
-/*
- * Map an address to a certain privileged segment
- */
-#define P1SEGADDR(a)   \
-       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P1SEG))
-#define P2SEGADDR(a)   \
-       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P2SEG))
-#define P3SEGADDR(a)   \
-       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
-#define P4SEGADDR(a)   \
-       ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))
-#endif /* 29BIT */
-#endif /* P1SEG */
-
-/* Check if an address can be reached in 29 bits */
-#define IS_29BIT(a)    (((unsigned long)(a)) < 0x20000000)
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_ADDRSPACE_H */
diff --git a/include/asm-sh/atomic-grb.h b/include/asm-sh/atomic-grb.h
deleted file mode 100644 (file)
index 4c5b7db..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef __ASM_SH_ATOMIC_GRB_H
-#define __ASM_SH_ATOMIC_GRB_H
-
-static inline void atomic_add(int i, atomic_t *v)
-{
-       int tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   add     %2,   %0      \n\t" /* add */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (i)
-               : "memory" , "r0", "r1");
-}
-
-static inline void atomic_sub(int i, atomic_t *v)
-{
-       int tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov     r15,  r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   sub     %2,   %0      \n\t" /* sub */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (i)
-               : "memory" , "r0", "r1");
-}
-
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       int tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   add     %2,   %0      \n\t" /* add */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (i)
-               : "memory" , "r0", "r1");
-
-       return tmp;
-}
-
-static inline int atomic_sub_return(int i, atomic_t *v)
-{
-       int tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   sub     %2,   %0      \n\t" /* sub */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (i)
-               : "memory", "r0", "r1");
-
-       return tmp;
-}
-
-static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
-{
-       int tmp;
-       unsigned int _mask = ~mask;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   and     %2,   %0      \n\t" /* add */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (_mask)
-               : "memory" , "r0", "r1");
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
-       int tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   or      %2,   %0      \n\t" /* or */
-               "   mov.l   %0,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "+r"  (v)
-               : "r"   (mask)
-               : "memory" , "r0", "r1");
-}
-
-static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-{
-       int ret;
-
-       __asm__ __volatile__ (
-               "   .align 2            \n\t"
-               "   mova     1f,  r0    \n\t"
-               "   nop                 \n\t"
-               "   mov     r15,  r1    \n\t"
-               "   mov    #-8,  r15    \n\t"
-               "   mov.l   @%1,  %0    \n\t"
-               "   cmp/eq   %2,  %0    \n\t"
-               "   bf       1f         \n\t"
-               "   mov.l    %3, @%1    \n\t"
-               "1: mov      r1,  r15   \n\t"
-               : "=&r" (ret)
-               : "r" (v), "r" (old), "r" (new)
-               : "memory" , "r0", "r1" , "t");
-
-       return ret;
-}
-
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int ret;
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-               "   .align 2            \n\t"
-               "   mova    1f,   r0    \n\t"
-               "   nop                 \n\t"
-               "   mov    r15,   r1    \n\t"
-               "   mov    #-12,  r15   \n\t"
-               "   mov.l  @%2,   %1    \n\t"
-               "   mov     %1,   %0    \n\t"
-               "   cmp/eq  %4,   %0    \n\t"
-               "   bt/s    1f          \n\t"
-               "    add    %3,   %1    \n\t"
-               "   mov.l   %1,  @%2    \n\t"
-               "1: mov     r1,   r15   \n\t"
-               : "=&r" (ret), "=&r" (tmp)
-               : "r" (v), "r" (a), "r" (u)
-               : "memory" , "r0", "r1" , "t");
-
-       return ret != u;
-}
-#endif /* __ASM_SH_ATOMIC_GRB_H */
diff --git a/include/asm-sh/atomic-irq.h b/include/asm-sh/atomic-irq.h
deleted file mode 100644 (file)
index 74f7943..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef __ASM_SH_ATOMIC_IRQ_H
-#define __ASM_SH_ATOMIC_IRQ_H
-
-/*
- * 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 flags;
-
-       local_irq_save(flags);
-       *(long *)v += i;
-       local_irq_restore(flags);
-}
-
-static inline void atomic_sub(int i, atomic_t *v)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-       *(long *)v -= i;
-       local_irq_restore(flags);
-}
-
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       unsigned long temp, flags;
-
-       local_irq_save(flags);
-       temp = *(long *)v;
-       temp += i;
-       *(long *)v = temp;
-       local_irq_restore(flags);
-
-       return temp;
-}
-
-static inline int atomic_sub_return(int i, atomic_t *v)
-{
-       unsigned long temp, flags;
-
-       local_irq_save(flags);
-       temp = *(long *)v;
-       temp -= i;
-       *(long *)v = temp;
-       local_irq_restore(flags);
-
-       return temp;
-}
-
-static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-       *(long *)v &= ~mask;
-       local_irq_restore(flags);
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-       *(long *)v |= mask;
-       local_irq_restore(flags);
-}
-
-#endif /* __ASM_SH_ATOMIC_IRQ_H */
diff --git a/include/asm-sh/atomic-llsc.h b/include/asm-sh/atomic-llsc.h
deleted file mode 100644 (file)
index 4b00b78..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef __ASM_SH_ATOMIC_LLSC_H
-#define __ASM_SH_ATOMIC_LLSC_H
-
-/*
- * 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 tmp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_add    \n"
-"      add     %1, %0                          \n"
-"      movco.l %0, @%2                         \n"
-"      bf      1b                              \n"
-       : "=&z" (tmp)
-       : "r" (i), "r" (&v->counter)
-       : "t");
-}
-
-static inline void atomic_sub(int i, atomic_t *v)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_sub    \n"
-"      sub     %1, %0                          \n"
-"      movco.l %0, @%2                         \n"
-"      bf      1b                              \n"
-       : "=&z" (tmp)
-       : "r" (i), "r" (&v->counter)
-       : "t");
-}
-
-/*
- * SH-4A note:
- *
- * We basically get atomic_xxx_return() for free compared with
- * atomic_xxx(). movli.l/movco.l require r0 due to the instruction
- * encoding, so the retval is automatically set without having to
- * do any special work.
- */
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       unsigned long temp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_add_return     \n"
-"      add     %1, %0                                  \n"
-"      movco.l %0, @%2                                 \n"
-"      bf      1b                                      \n"
-"      synco                                           \n"
-       : "=&z" (temp)
-       : "r" (i), "r" (&v->counter)
-       : "t");
-
-       return temp;
-}
-
-static inline int atomic_sub_return(int i, atomic_t *v)
-{
-       unsigned long temp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_sub_return     \n"
-"      sub     %1, %0                                  \n"
-"      movco.l %0, @%2                                 \n"
-"      bf      1b                                      \n"
-"      synco                                           \n"
-       : "=&z" (temp)
-       : "r" (i), "r" (&v->counter)
-       : "t");
-
-       return temp;
-}
-
-static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_clear_mask     \n"
-"      and     %1, %0                                  \n"
-"      movco.l %0, @%2                                 \n"
-"      bf      1b                                      \n"
-       : "=&z" (tmp)
-       : "r" (~mask), "r" (&v->counter)
-       : "t");
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-"1:    movli.l @%2, %0         ! atomic_set_mask       \n"
-"      or      %1, %0                                  \n"
-"      movco.l %0, @%2                                 \n"
-"      bf      1b                                      \n"
-       : "=&z" (tmp)
-       : "r" (mask), "r" (&v->counter)
-       : "t");
-}
-
-#endif /* __ASM_SH_ATOMIC_LLSC_H */
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
deleted file mode 100644 (file)
index c043ef0..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef __ASM_SH_ATOMIC_H
-#define __ASM_SH_ATOMIC_H
-
-/*
- * Atomic operations that C can't guarantee us.  Useful for
- * resource counting etc..
- *
- */
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
-
-#define atomic_read(v)         ((v)->counter)
-#define atomic_set(v,i)                ((v)->counter = (i))
-
-#include <linux/compiler.h>
-#include <asm/system.h>
-
-#if defined(CONFIG_GUSA_RB)
-#include <asm/atomic-grb.h>
-#elif defined(CONFIG_CPU_SH4A)
-#include <asm/atomic-llsc.h>
-#else
-#include <asm/atomic-irq.h>
-#endif
-
-#define atomic_add_negative(a, v)      (atomic_add_return((a), (v)) < 0)
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-
-/*
- * atomic_inc_and_test - increment and test
- * @v: pointer of type atomic_t
- *
- * Atomically increments @v by 1
- * and returns true if the result is zero, or false for all
- * other cases.
- */
-#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-
-#define atomic_inc(v) atomic_add(1,(v))
-#define atomic_dec(v) atomic_sub(1,(v))
-
-#ifndef CONFIG_GUSA_RB
-static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-{
-       int ret;
-       unsigned long flags;
-
-       local_irq_save(flags);
-       ret = v->counter;
-       if (likely(ret == old))
-               v->counter = new;
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int ret;
-       unsigned long flags;
-
-       local_irq_save(flags);
-       ret = v->counter;
-       if (ret != u)
-               v->counter += a;
-       local_irq_restore(flags);
-
-       return ret != u;
-}
-#endif
-
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
-/* Atomic operations are already serializing on SH */
-#define smp_mb__before_atomic_dec()    barrier()
-#define smp_mb__after_atomic_dec()     barrier()
-#define smp_mb__before_atomic_inc()    barrier()
-#define smp_mb__after_atomic_inc()     barrier()
-
-#include <asm-generic/atomic.h>
-#endif /* __ASM_SH_ATOMIC_H */
diff --git a/include/asm-sh/auxvec.h b/include/asm-sh/auxvec.h
deleted file mode 100644 (file)
index a6b9d4f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef __ASM_SH_AUXVEC_H
-#define __ASM_SH_AUXVEC_H
-
-/*
- * Architecture-neutral AT_ values in 0-17, leave some room
- * for more of them.
- */
-
-/*
- * This entry gives some information about the FPU initialization
- * performed by the kernel.
- */
-#define AT_FPUCW               18      /* Used FPU control word.  */
-
-#ifdef CONFIG_VSYSCALL
-/*
- * Only define this in the vsyscall case, the entry point to
- * the vsyscall page gets placed here. The kernel will attempt
- * to build a gate VMA we don't care about otherwise..
- */
-#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.
- */
-#define AT_L1I_CACHESHAPE      34
-#define AT_L1D_CACHESHAPE      35
-#define AT_L2_CACHESHAPE       36
-
-#endif /* __ASM_SH_AUXVEC_H */
diff --git a/include/asm-sh/bitops-grb.h b/include/asm-sh/bitops-grb.h
deleted file mode 100644 (file)
index a5907b9..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef __ASM_SH_BITOPS_GRB_H
-#define __ASM_SH_BITOPS_GRB_H
-
-static inline void set_bit(int nr, volatile void * addr)
-{
-       int     mask;
-       volatile unsigned int *a = addr;
-       unsigned long tmp;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-                "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-                "   mov.l  @%1,   %0      \n\t" /* load  old value */
-                "   or      %2,   %0      \n\t" /* or */
-                "   mov.l   %0,   @%1     \n\t" /* store new value */
-                "1: mov     r1,   r15     \n\t" /* LOGOUT */
-                : "=&r" (tmp),
-                  "+r"  (a)
-                : "r"   (mask)
-                : "memory" , "r0", "r1");
-}
-
-static inline void clear_bit(int nr, volatile void * addr)
-{
-       int     mask;
-       volatile unsigned int *a = addr;
-        unsigned long tmp;
-
-       a += nr >> 5;
-        mask = ~(1 << (nr & 0x1f));
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-                "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-                "   mov.l  @%1,   %0      \n\t" /* load  old value */
-                "   and     %2,   %0      \n\t" /* and */
-                "   mov.l   %0,   @%1     \n\t" /* store new value */
-                "1: mov     r1,   r15     \n\t" /* LOGOUT */
-                : "=&r" (tmp),
-                  "+r"  (a)
-                : "r"   (mask)
-                : "memory" , "r0", "r1");
-}
-
-static inline void change_bit(int nr, volatile void * addr)
-{
-        int     mask;
-        volatile unsigned int *a = addr;
-        unsigned long tmp;
-
-        a += nr >> 5;
-        mask = 1 << (nr & 0x1f);
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-                "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-                "   mov    #-6,   r15     \n\t" /* LOGIN: r15 = size */
-                "   mov.l  @%1,   %0      \n\t" /* load  old value */
-                "   xor     %2,   %0      \n\t" /* xor */
-                "   mov.l   %0,   @%1     \n\t" /* store new value */
-                "1: mov     r1,   r15     \n\t" /* LOGOUT */
-                : "=&r" (tmp),
-                  "+r"  (a)
-                : "r"   (mask)
-                : "memory" , "r0", "r1");
-}
-
-static inline int test_and_set_bit(int nr, volatile void * addr)
-{
-        int     mask, retval;
-       volatile unsigned int *a = addr;
-        unsigned long tmp;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-                "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-                "   mov   #-14,   r15     \n\t" /* LOGIN: r15 = size */
-                "   mov.l  @%2,   %0      \n\t" /* load old value */
-                "   mov     %0,   %1      \n\t"
-                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
-                "   mov    #-1,   %1      \n\t" /* retvat = -1 */
-                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
-                "   or      %3,   %0      \n\t"
-                "   mov.l   %0,  @%2      \n\t" /* store new value */
-                "1: mov     r1,  r15      \n\t" /* LOGOUT */
-                : "=&r" (tmp),
-                  "=&r" (retval),
-                  "+r"  (a)
-                : "r"   (mask)
-                : "memory" , "r0", "r1" ,"t");
-
-        return retval;
-}
-
-static inline int test_and_clear_bit(int nr, volatile void * addr)
-{
-        int     mask, retval,not_mask;
-        volatile unsigned int *a = addr;
-        unsigned long tmp;
-
-        a += nr >> 5;
-        mask = 1 << (nr & 0x1f);
-
-       not_mask = ~mask;
-
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov   #-14,   r15     \n\t" /* LOGIN */
-               "   mov.l  @%2,   %0      \n\t" /* load old value */
-                "   mov     %0,   %1      \n\t" /* %1 = *a */
-                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
-               "   mov    #-1,   %1      \n\t" /* retvat = -1 */
-                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
-                "   and     %4,   %0      \n\t"
-                "   mov.l   %0,  @%2      \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (tmp),
-                 "=&r" (retval),
-                 "+r"  (a)
-               : "r"   (mask),
-                 "r"   (not_mask)
-               : "memory" , "r0", "r1", "t");
-
-        return retval;
-}
-
-static inline int test_and_change_bit(int nr, volatile void * addr)
-{
-        int     mask, retval;
-        volatile unsigned int *a = addr;
-        unsigned long tmp;
-
-        a += nr >> 5;
-        mask = 1 << (nr & 0x1f);
-
-        __asm__ __volatile__ (
-                "   .align 2              \n\t"
-                "   mova    1f,   r0      \n\t" /* r0 = end point */
-                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-                "   mov   #-14,   r15     \n\t" /* LOGIN */
-                "   mov.l  @%2,   %0      \n\t" /* load old value */
-                "   mov     %0,   %1      \n\t" /* %1 = *a */
-                "   tst     %1,   %3      \n\t" /* T = ((*a & mask) == 0) */
-                "   mov    #-1,   %1      \n\t" /* retvat = -1 */
-                "   negc    %1,   %1      \n\t" /* retval = (mask & *a) != 0 */
-                "   xor     %3,   %0      \n\t"
-                "   mov.l   %0,  @%2      \n\t" /* store new value */
-                "1: mov     r1,   r15     \n\t" /* LOGOUT */
-                : "=&r" (tmp),
-                  "=&r" (retval),
-                  "+r"  (a)
-                : "r"   (mask)
-                : "memory" , "r0", "r1", "t");
-
-        return retval;
-}
-#endif /* __ASM_SH_BITOPS_GRB_H */
diff --git a/include/asm-sh/bitops-irq.h b/include/asm-sh/bitops-irq.h
deleted file mode 100644 (file)
index 653a127..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef __ASM_SH_BITOPS_IRQ_H
-#define __ASM_SH_BITOPS_IRQ_H
-
-static inline void set_bit(int nr, volatile void *addr)
-{
-       int     mask;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       *a |= mask;
-       local_irq_restore(flags);
-}
-
-static inline void clear_bit(int nr, volatile void *addr)
-{
-       int     mask;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       *a &= ~mask;
-       local_irq_restore(flags);
-}
-
-static inline void change_bit(int nr, volatile void *addr)
-{
-       int     mask;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       *a ^= mask;
-       local_irq_restore(flags);
-}
-
-static inline int test_and_set_bit(int nr, volatile void *addr)
-{
-       int     mask, retval;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       retval = (mask & *a) != 0;
-       *a |= mask;
-       local_irq_restore(flags);
-
-       return retval;
-}
-
-static inline int test_and_clear_bit(int nr, volatile void *addr)
-{
-       int     mask, retval;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       retval = (mask & *a) != 0;
-       *a &= ~mask;
-       local_irq_restore(flags);
-
-       return retval;
-}
-
-static inline int test_and_change_bit(int nr, volatile void *addr)
-{
-       int     mask, retval;
-       volatile unsigned int *a = addr;
-       unsigned long flags;
-
-       a += nr >> 5;
-       mask = 1 << (nr & 0x1f);
-       local_irq_save(flags);
-       retval = (mask & *a) != 0;
-       *a ^= mask;
-       local_irq_restore(flags);
-
-       return retval;
-}
-
-#endif /* __ASM_SH_BITOPS_IRQ_H */
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h
deleted file mode 100644 (file)
index d7d382f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef __ASM_SH_BITOPS_H
-#define __ASM_SH_BITOPS_H
-
-#ifdef __KERNEL__
-
-#ifndef _LINUX_BITOPS_H
-#error only <linux/bitops.h> can be included directly
-#endif
-
-#include <asm/system.h>
-/* For __swab32 */
-#include <asm/byteorder.h>
-
-#ifdef CONFIG_GUSA_RB
-#include <asm/bitops-grb.h>
-#else
-#include <asm/bitops-irq.h>
-#endif
-
-
-/*
- * clear_bit() doesn't provide any barrier for the compiler.
- */
-#define smp_mb__before_clear_bit()     barrier()
-#define smp_mb__after_clear_bit()      barrier()
-
-#include <asm-generic/bitops/non-atomic.h>
-
-#ifdef CONFIG_SUPERH32
-static inline unsigned long ffz(unsigned long word)
-{
-       unsigned long result;
-
-       __asm__("1:\n\t"
-               "shlr   %1\n\t"
-               "bt/s   1b\n\t"
-               " add   #1, %0"
-               : "=r" (result), "=r" (word)
-               : "0" (~0L), "1" (word)
-               : "t");
-       return result;
-}
-
-/**
- * __ffs - find first bit in word.
- * @word: The word to search
- *
- * Undefined if no bit exists, so code should check against 0 first.
- */
-static inline unsigned long __ffs(unsigned long word)
-{
-       unsigned long result;
-
-       __asm__("1:\n\t"
-               "shlr   %1\n\t"
-               "bf/s   1b\n\t"
-               " add   #1, %0"
-               : "=r" (result), "=r" (word)
-               : "0" (~0L), "1" (word)
-               : "t");
-       return result;
-}
-#else
-static inline unsigned long ffz(unsigned long word)
-{
-       unsigned long result, __d2, __d3;
-
-        __asm__("gettr  tr0, %2\n\t"
-                "pta    $+32, tr0\n\t"
-                "andi   %1, 1, %3\n\t"
-                "beq    %3, r63, tr0\n\t"
-                "pta    $+4, tr0\n"
-                "0:\n\t"
-                "shlri.l        %1, 1, %1\n\t"
-                "addi   %0, 1, %0\n\t"
-                "andi   %1, 1, %3\n\t"
-                "beqi   %3, 1, tr0\n"
-                "1:\n\t"
-                "ptabs  %2, tr0\n\t"
-                : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3)
-                : "0" (0L), "1" (word));
-
-       return result;
-}
-
-#include <asm-generic/bitops/__ffs.h>
-#endif
-
-#include <asm-generic/bitops/find.h>
-#include <asm-generic/bitops/ffs.h>
-#include <asm-generic/bitops/hweight.h>
-#include <asm-generic/bitops/lock.h>
-#include <asm-generic/bitops/sched.h>
-#include <asm-generic/bitops/ext2-non-atomic.h>
-#include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
-#include <asm-generic/bitops/fls.h>
-#include <asm-generic/bitops/__fls.h>
-#include <asm-generic/bitops/fls64.h>
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_BITOPS_H */
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
deleted file mode 100644 (file)
index c017180..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef __ASM_SH_BUG_H
-#define __ASM_SH_BUG_H
-
-#define TRAPA_BUG_OPCODE       0xc33e  /* trapa #0x3e */
-
-#ifdef CONFIG_GENERIC_BUG
-#define HAVE_ARCH_BUG
-#define HAVE_ARCH_WARN_ON
-
-/**
- * _EMIT_BUG_ENTRY
- * %1 - __FILE__
- * %2 - __LINE__
- * %3 - trap type
- * %4 - sizeof(struct bug_entry)
- *
- * The trapa opcode itself sits in %0.
- * The %O notation is used to avoid # generation.
- *
- * The offending file and line are encoded in the __bug_table section.
- */
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-#define _EMIT_BUG_ENTRY                                \
-       "\t.pushsection __bug_table,\"a\"\n"    \
-       "2:\t.long 1b, %O1\n"                   \
-       "\t.short %O2, %O3\n"                   \
-       "\t.org 2b+%O4\n"                       \
-       "\t.popsection\n"
-#else
-#define _EMIT_BUG_ENTRY                                \
-       "\t.pushsection __bug_table,\"a\"\n"    \
-       "2:\t.long 1b\n"                        \
-       "\t.short %O3\n"                        \
-       "\t.org 2b+%O4\n"                       \
-       "\t.popsection\n"
-#endif
-
-#define BUG()                                          \
-do {                                                   \
-       __asm__ __volatile__ (                          \
-               "1:\t.short %O0\n"                      \
-               _EMIT_BUG_ENTRY                         \
-                :                                      \
-                : "n" (TRAPA_BUG_OPCODE),              \
-                  "i" (__FILE__),                      \
-                  "i" (__LINE__), "i" (0),             \
-                  "i" (sizeof(struct bug_entry)));     \
-} while (0)
-
-#define __WARN()                                       \
-do {                                                   \
-       __asm__ __volatile__ (                          \
-               "1:\t.short %O0\n"                      \
-                _EMIT_BUG_ENTRY                        \
-                :                                      \
-                : "n" (TRAPA_BUG_OPCODE),              \
-                  "i" (__FILE__),                      \
-                  "i" (__LINE__),                      \
-                  "i" (BUGFLAG_WARNING),               \
-                  "i" (sizeof(struct bug_entry)));     \
-} while (0)
-
-#define WARN_ON(x) ({                                          \
-       int __ret_warn_on = !!(x);                              \
-       if (__builtin_constant_p(__ret_warn_on)) {              \
-               if (__ret_warn_on)                              \
-                       __WARN();                               \
-       } else {                                                \
-               if (unlikely(__ret_warn_on))                    \
-                       __WARN();                               \
-       }                                                       \
-       unlikely(__ret_warn_on);                                \
-})
-
-#endif /* CONFIG_GENERIC_BUG */
-
-#include <asm-generic/bug.h>
-
-#endif /* __ASM_SH_BUG_H */
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
deleted file mode 100644 (file)
index 121b2ec..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __ASM_SH_BUGS_H
-#define __ASM_SH_BUGS_H
-
-/*
- * This is included by init/main.c to check for architecture-dependent bugs.
- *
- * Needs:
- *     void check_bugs(void);
- */
-
-/*
- * I don't know of any Super-H bugs yet.
- */
-
-#include <asm/processor.h>
-
-static void __init check_bugs(void)
-{
-       extern unsigned long loops_per_jiffy;
-       char *p = &init_utsname()->machine[2]; /* "sh" */
-
-       current_cpu_data.loops_per_jiffy = loops_per_jiffy;
-
-       switch (current_cpu_data.type) {
-       case CPU_SH7619:
-               *p++ = '2';
-               break;
-       case CPU_SH7203 ... CPU_MXG:
-               *p++ = '2';
-               *p++ = 'a';
-               break;
-       case CPU_SH7705 ... CPU_SH7729:
-               *p++ = '3';
-               break;
-       case CPU_SH7750 ... CPU_SH4_501:
-               *p++ = '4';
-               break;
-       case CPU_SH7763 ... CPU_SHX3:
-               *p++ = '4';
-               *p++ = 'a';
-               break;
-       case CPU_SH7343 ... CPU_SH7366:
-               *p++ = '4';
-               *p++ = 'a';
-               *p++ = 'l';
-               *p++ = '-';
-               *p++ = 'd';
-               *p++ = 's';
-               *p++ = 'p';
-               break;
-       case CPU_SH5_101 ... CPU_SH5_103:
-               *p++ = '6';
-               *p++ = '4';
-               break;
-       case CPU_SH_NONE:
-               /*
-                * Specifically use CPU_SH_NONE rather than default:,
-                * so we're able to have the compiler whine about
-                * unhandled enumerations.
-                */
-               break;
-       }
-
-       printk("CPU: %s\n", get_cpu_subtype(&current_cpu_data));
-
-#ifndef __LITTLE_ENDIAN__
-       /* 'eb' means 'Endian Big' */
-       *p++ = 'e';
-       *p++ = 'b';
-#endif
-       *p = '\0';
-}
-#endif /* __ASM_SH_BUGS_H */
diff --git a/include/asm-sh/byteorder.h b/include/asm-sh/byteorder.h
deleted file mode 100644 (file)
index 4c13e61..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __ASM_SH_BYTEORDER_H
-#define __ASM_SH_BYTEORDER_H
-
-/*
- * Copyright (C) 1999  Niibe Yutaka
- * Copyright (C) 2000, 2001  Paolo Alberelli
- */
-#include <linux/compiler.h>
-#include <linux/types.h>
-
-static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
-{
-       __asm__(
-#ifdef __SH5__
-               "byterev        %0, %0\n\t"
-               "shari          %0, 32, %0"
-#else
-               "swap.b         %0, %0\n\t"
-               "swap.w         %0, %0\n\t"
-               "swap.b         %0, %0"
-#endif
-               : "=r" (x)
-               : "0" (x));
-
-       return x;
-}
-
-static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
-{
-       __asm__(
-#ifdef __SH5__
-               "byterev        %0, %0\n\t"
-               "shari          %0, 32, %0"
-#else
-               "swap.b         %0, %0"
-#endif
-               : "=r" (x)
-               :  "0" (x));
-
-       return x;
-}
-
-static inline __u64 ___arch__swab64(__u64 val)
-{
-       union {
-               struct { __u32 a,b; } s;
-               __u64 u;
-       } v, w;
-       v.u = val;
-       w.s.b = ___arch__swab32(v.s.a);
-       w.s.a = ___arch__swab32(v.s.b);
-       return w.u;
-}
-
-#define __arch__swab64(x) ___arch__swab64(x)
-#define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab16(x) ___arch__swab16(x)
-
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
-
-#ifdef __LITTLE_ENDIAN__
-#include <linux/byteorder/little_endian.h>
-#else
-#include <linux/byteorder/big_endian.h>
-#endif
-
-#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
deleted file mode 100644 (file)
index 083419f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $Id: cache.h,v 1.6 2004/03/11 18:08:05 lethal Exp $
- *
- * include/asm-sh/cache.h
- *
- * Copyright 1999 (C) Niibe Yutaka
- * Copyright 2002, 2003 (C) Paul Mundt
- */
-#ifndef __ASM_SH_CACHE_H
-#define __ASM_SH_CACHE_H
-#ifdef __KERNEL__
-
-#include <linux/init.h>
-#include <asm/cpu/cache.h>
-
-#define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
-
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
-#ifndef __ASSEMBLY__
-struct cache_info {
-       unsigned int ways;              /* Number of cache ways */
-       unsigned int sets;              /* Number of cache sets */
-       unsigned int linesz;            /* Cache line size (bytes) */
-
-       unsigned int way_size;          /* sets * line size */
-
-       /*
-        * way_incr is the address offset for accessing the next way
-        * in memory mapped cache array ops.
-        */
-       unsigned int way_incr;
-       unsigned int entry_shift;
-       unsigned int entry_mask;
-
-       /*
-        * Compute a mask which selects the address bits which overlap between
-        * 1. those used to select the cache set during indexing
-        * 2. those in the physical page number.
-        */
-       unsigned int alias_mask;
-
-       unsigned int n_aliases;         /* Number of aliases */
-
-       unsigned long flags;
-};
-
-int __init detect_cpu_and_cache_system(void);
-
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_CACHE_H */
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h
deleted file mode 100644 (file)
index e034c36..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef __ASM_SH_CACHEFLUSH_H
-#define __ASM_SH_CACHEFLUSH_H
-
-#ifdef __KERNEL__
-
-#ifdef CONFIG_CACHE_OFF
-/*
- * Nothing to do when the cache is disabled, initial flush and explicit
- * disabling is handled at CPU init time.
- *
- * See arch/sh/kernel/cpu/init.c:cache_init().
- */
-#define p3_cache_init()                                do { } while (0)
-#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_icache_range(start, end)         do { } while (0)
-#define flush_icache_page(vma,pg)              do { } while (0)
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-#define flush_cache_sigtramp(vaddr)            do { } while (0)
-#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
-#define __flush_wback_region(start, size)      do { (void)(start); } while (0)
-#define __flush_purge_region(start, size)      do { (void)(start); } while (0)
-#define __flush_invalidate_region(start, size) do { (void)(start); } while (0)
-#else
-#include <asm/cpu/cacheflush.h>
-
-/*
- * Consistent DMA requires that the __flush_xxx() primitives must be set
- * for any of the enabled non-coherent caches (most of the UP CPUs),
- * regardless of PIPT or VIPT cache configurations.
- */
-
-/* Flush (write-back only) a region (smaller than a page) */
-extern void __flush_wback_region(void *start, int size);
-/* Flush (write-back & invalidate) a region (smaller than a page) */
-extern void __flush_purge_region(void *start, int size);
-/* Flush (invalidate only) a region (smaller than a page) */
-extern void __flush_invalidate_region(void *start, int size);
-#endif
-
-#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
-static inline void flush_kernel_dcache_page(struct page *page)
-{
-       flush_dcache_page(page);
-}
-
-#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
-extern void copy_to_user_page(struct vm_area_struct *vma,
-       struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len);
-
-extern void copy_from_user_page(struct vm_area_struct *vma,
-       struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len);
-#else
-#define copy_to_user_page(vma, page, vaddr, dst, src, len)     \
-       do {                                                    \
-               flush_cache_page(vma, vaddr, page_to_pfn(page));\
-               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)   \
-       do {                                                    \
-               flush_cache_page(vma, vaddr, page_to_pfn(page));\
-               memcpy(dst, src, len);                          \
-       } while (0)
-#endif
-
-#define flush_cache_vmap(start, end)           flush_cache_all()
-#define flush_cache_vunmap(start, end)         flush_cache_all()
-
-#define HAVE_ARCH_UNMAPPED_AREA
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_CACHEFLUSH_H */
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
deleted file mode 100644 (file)
index 67496ab..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef CONFIG_SUPERH32
-# include "checksum_32.h"
-#else
-# include "checksum_64.h"
-#endif
diff --git a/include/asm-sh/checksum_32.h b/include/asm-sh/checksum_32.h
deleted file mode 100644 (file)
index 14b7ac2..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-#ifndef __ASM_SH_CHECKSUM_H
-#define __ASM_SH_CHECKSUM_H
-
-/*
- * 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) 1999 by Kaz Kojima & Niibe Yutaka
- */
-
-#include <linux/in6.h>
-
-/*
- * 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
- */
-asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
-
-/*
- * the same as csum_partial, but copies from src while it
- * checksums, and handles user-space pointer exceptions correctly, when needed.
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- */
-
-asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
-                                           int len, __wsum sum,
-                                           int *src_err_ptr, int *dst_err_ptr);
-
-/*
- *     Note: when you get a NULL pointer exception here this means someone
- *     passed in an incorrect kernel address to one of these functions.
- *
- *     If you use these functions directly please don't forget the
- *     access_ok().
- */
-static inline
-__wsum csum_partial_copy_nocheck(const void *src, void *dst,
-                                int len, __wsum sum)
-{
-       return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
-}
-
-static inline
-__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
-                                  int len, __wsum sum, int *err_ptr)
-{
-       return csum_partial_copy_generic((__force const void *)src, dst,
-                                       len, sum, err_ptr, NULL);
-}
-
-/*
- *     Fold a partial checksum
- */
-
-static inline __sum16 csum_fold(__wsum sum)
-{
-       unsigned int __dummy;
-       __asm__("swap.w %0, %1\n\t"
-               "extu.w %0, %0\n\t"
-               "extu.w %1, %1\n\t"
-               "add    %1, %0\n\t"
-               "swap.w %0, %1\n\t"
-               "add    %1, %0\n\t"
-               "not    %0, %0\n\t"
-               : "=r" (sum), "=&r" (__dummy)
-               : "0" (sum)
-               : "t");
-       return (__force __sum16)sum;
-}
-
-/*
- *     This is a version of ip_compute_csum() optimized for IP headers,
- *     which always checksum on 4 octet boundaries.
- *
- *      i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted
- *      for linux by * Arnt Gulbrandsen.
- */
-static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
-{
-       unsigned int sum, __dummy0, __dummy1;
-
-       __asm__ __volatile__(
-               "mov.l  @%1+, %0\n\t"
-               "mov.l  @%1+, %3\n\t"
-               "add    #-2, %2\n\t"
-               "clrt\n\t"
-               "1:\t"
-               "addc   %3, %0\n\t"
-               "movt   %4\n\t"
-               "mov.l  @%1+, %3\n\t"
-               "dt     %2\n\t"
-               "bf/s   1b\n\t"
-               " cmp/eq #1, %4\n\t"
-               "addc   %3, %0\n\t"
-               "addc   %2, %0"     /* Here %2 is 0, add carry-bit */
-       /* Since the input registers which are loaded with iph and ihl
-          are modified, we must also specify them as outputs, or gcc
-          will assume they contain their original values. */
-       : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1)
-       : "1" (iph), "2" (ihl)
-       : "t", "memory");
-
-       return  csum_fold(sum);
-}
-
-static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
-                                       unsigned short len,
-                                       unsigned short proto,
-                                       __wsum sum)
-{
-#ifdef __LITTLE_ENDIAN__
-       unsigned long len_proto = (proto + len) << 8;
-#else
-       unsigned long len_proto = proto + len;
-#endif
-       __asm__("clrt\n\t"
-               "addc   %0, %1\n\t"
-               "addc   %2, %1\n\t"
-               "addc   %3, %1\n\t"
-               "movt   %0\n\t"
-               "add    %1, %0"
-               : "=r" (sum), "=r" (len_proto)
-               : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum)
-               : "t");
-
-       return sum;
-}
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
-                                       unsigned short len,
-                                       unsigned short proto,
-                                       __wsum sum)
-{
-       return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline __sum16 ip_compute_csum(const void *buff, int len)
-{
-    return csum_fold(csum_partial(buff, len, 0));
-}
-
-#define _HAVE_ARCH_IPV6_CSUM
-static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
-                                     const struct in6_addr *daddr,
-                                     __u32 len, unsigned short proto,
-                                     __wsum sum)
-{
-       unsigned int __dummy;
-       __asm__("clrt\n\t"
-               "mov.l  @(0,%2), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(4,%2), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(8,%2), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(12,%2), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(0,%3), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(4,%3), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(8,%3), %1\n\t"
-               "addc   %1, %0\n\t"
-               "mov.l  @(12,%3), %1\n\t"
-               "addc   %1, %0\n\t"
-               "addc   %4, %0\n\t"
-               "addc   %5, %0\n\t"
-               "movt   %1\n\t"
-               "add    %1, %0\n"
-               : "=r" (sum), "=&r" (__dummy)
-               : "r" (saddr), "r" (daddr),
-                 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
-               : "t");
-
-       return csum_fold(sum);
-}
-
-/*
- *     Copy and checksum to user
- */
-#define HAVE_CSUM_COPY_USER
-static inline __wsum csum_and_copy_to_user(const void *src,
-                                          void __user *dst,
-                                          int len, __wsum sum,
-                                          int *err_ptr)
-{
-       if (access_ok(VERIFY_WRITE, dst, len))
-               return csum_partial_copy_generic((__force const void *)src,
-                                               dst, len, sum, NULL, err_ptr);
-
-       if (len)
-               *err_ptr = -EFAULT;
-
-       return (__force __wsum)-1; /* invalid checksum */
-}
-#endif /* __ASM_SH_CHECKSUM_H */
diff --git a/include/asm-sh/checksum_64.h b/include/asm-sh/checksum_64.h
deleted file mode 100644 (file)
index 9c62a03..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __ASM_SH_CHECKSUM_64_H
-#define __ASM_SH_CHECKSUM_64_H
-
-/*
- * include/asm-sh/checksum_64.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- *
- * 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.
- */
-
-/*
- * 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
- */
-asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
-
-/*
- *     Note: when you get a NULL pointer exception here this means someone
- *     passed in an incorrect kernel address to one of these functions.
- *
- *     If you use these functions directly please don't forget the
- *     access_ok().
- */
-
-
-__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len,
-                                      __wsum sum);
-
-__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
-                                        int len, __wsum sum, int *err_ptr);
-
-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;
-}
-
-__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
-
-__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
-                                unsigned short len, unsigned short proto,
-                                __wsum sum);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
-                                                  unsigned short len,
-                                                  unsigned short proto,
-                                                  __wsum sum)
-{
-       return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline __sum16 ip_compute_csum(const void *buff, int len)
-{
-       return csum_fold(csum_partial(buff, len, 0));
-}
-
-#endif /* __ASM_SH_CHECKSUM_64_H */
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
deleted file mode 100644 (file)
index 720dfab..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __ASM_SH_CLOCK_H
-#define __ASM_SH_CLOCK_H
-
-#include <linux/kref.h>
-#include <linux/list.h>
-#include <linux/seq_file.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-
-struct clk;
-
-struct clk_ops {
-       void (*init)(struct clk *clk);
-       void (*enable)(struct clk *clk);
-       void (*disable)(struct clk *clk);
-       void (*recalc)(struct clk *clk);
-       int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
-       long (*round_rate)(struct clk *clk, unsigned long rate);
-};
-
-struct clk {
-       struct list_head        node;
-       const char              *name;
-       int                     id;
-       struct module           *owner;
-
-       struct clk              *parent;
-       struct clk_ops          *ops;
-
-       struct kref             kref;
-
-       unsigned long           rate;
-       unsigned long           flags;
-       unsigned long           arch_flags;
-};
-
-#define CLK_ALWAYS_ENABLED     (1 << 0)
-#define CLK_RATE_PROPAGATES    (1 << 1)
-
-/* Should be defined by processor-specific code */
-void arch_init_clk_ops(struct clk_ops **, int type);
-
-/* arch/sh/kernel/cpu/clock.c */
-int clk_init(void);
-
-void clk_recalc_rate(struct clk *);
-
-int clk_register(struct clk *);
-void clk_unregister(struct clk *);
-
-static inline int clk_always_enable(const char *id)
-{
-       struct clk *clk;
-       int ret;
-
-       clk = clk_get(NULL, id);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
-
-       ret = clk_enable(clk);
-       if (ret)
-               clk_put(clk);
-
-       return ret;
-}
-
-/* the exported API, in addition to clk_set_rate */
-/**
- * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
- * @clk: clock source
- * @rate: desired clock rate in Hz
- * @algo_id: algorithm id to be passed down to ops->set_rate
- *
- * Returns success (0) or negative errno.
- */
-int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
-
-enum clk_sh_algo_id {
-       NO_CHANGE = 0,
-
-       IUS_N1_N1,
-       IUS_322,
-       IUS_522,
-       IUS_N11,
-
-       SB_N1,
-
-       SB3_N1,
-       SB3_32,
-       SB3_43,
-       SB3_54,
-
-       BP_N1,
-
-       IP_N1,
-};
-#endif /* __ASM_SH_CLOCK_H */
diff --git a/include/asm-sh/cmpxchg-grb.h b/include/asm-sh/cmpxchg-grb.h
deleted file mode 100644 (file)
index e2681ab..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __ASM_SH_CMPXCHG_GRB_H
-#define __ASM_SH_CMPXCHG_GRB_H
-
-static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
-{
-       unsigned long retval;
-
-       __asm__ __volatile__ (
-               "   .align 2              \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   nop                   \n\t"
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-4,   r15     \n\t" /* LOGIN */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   mov.l   %2,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (retval),
-                 "+r"  (m)
-               : "r"   (val)
-               : "memory", "r0", "r1");
-
-       return retval;
-}
-
-static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
-{
-       unsigned long retval;
-
-       __asm__ __volatile__ (
-               "   .align  2             \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-6,   r15     \n\t" /* LOGIN */
-               "   mov.b  @%1,   %0      \n\t" /* load  old value */
-               "   extu.b  %0,   %0      \n\t" /* extend as unsigned */
-               "   mov.b   %2,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (retval),
-                 "+r"  (m)
-               : "r"   (val)
-               : "memory" , "r0", "r1");
-
-       return retval;
-}
-
-static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
-                                         unsigned long new)
-{
-       unsigned long retval;
-
-       __asm__ __volatile__ (
-               "   .align  2             \n\t"
-               "   mova    1f,   r0      \n\t" /* r0 = end point */
-               "   nop                   \n\t"
-               "   mov    r15,   r1      \n\t" /* r1 = saved sp */
-               "   mov    #-8,   r15     \n\t" /* LOGIN */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   cmp/eq  %0,   %2      \n\t"
-               "   bf            1f      \n\t" /* if not equal */
-               "   mov.l   %2,   @%1     \n\t" /* store new value */
-               "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (retval),
-                 "+r"  (m)
-               : "r"   (new)
-               : "memory" , "r0", "r1", "t");
-
-       return retval;
-}
-
-#endif /* __ASM_SH_CMPXCHG_GRB_H */
diff --git a/include/asm-sh/cmpxchg-irq.h b/include/asm-sh/cmpxchg-irq.h
deleted file mode 100644 (file)
index 43049ec..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef __ASM_SH_CMPXCHG_IRQ_H
-#define __ASM_SH_CMPXCHG_IRQ_H
-
-static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
-{
-       unsigned long flags, retval;
-
-       local_irq_save(flags);
-       retval = *m;
-       *m = val;
-       local_irq_restore(flags);
-       return retval;
-}
-
-static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
-{
-       unsigned long flags, retval;
-
-       local_irq_save(flags);
-       retval = *m;
-       *m = val & 0xff;
-       local_irq_restore(flags);
-       return retval;
-}
-
-static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
-       unsigned long new)
-{
-       __u32 retval;
-       unsigned long flags;
-
-       local_irq_save(flags);
-       retval = *m;
-       if (retval == old)
-               *m = new;
-       local_irq_restore(flags);       /* implies memory barrier  */
-       return retval;
-}
-
-#endif /* __ASM_SH_CMPXCHG_IRQ_H */
diff --git a/include/asm-sh/cpu-features.h b/include/asm-sh/cpu-features.h
deleted file mode 100644 (file)
index 86308aa..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __ASM_SH_CPU_FEATURES_H
-#define __ASM_SH_CPU_FEATURES_H
-
-/*
- * Processor flags
- *
- * Note: When adding a new flag, keep cpu_flags[] in
- * arch/sh/kernel/setup.c in sync so symbolic name
- * mapping of the processor flags has a chance of being
- * reasonably accurate.
- *
- * These flags are also available through the ELF
- * auxiliary vector as AT_HWCAP.
- */
-#define CPU_HAS_FPU            0x0001  /* Hardware FPU support */
-#define CPU_HAS_P2_FLUSH_BUG   0x0002  /* Need to flush the cache in P2 area */
-#define CPU_HAS_MMU_PAGE_ASSOC 0x0004  /* SH3: TLB way selection bit support */
-#define CPU_HAS_DSP            0x0008  /* SH-DSP: DSP support */
-#define CPU_HAS_PERF_COUNTER   0x0010  /* Hardware performance counters */
-#define CPU_HAS_PTEA           0x0020  /* PTEA register */
-#define CPU_HAS_LLSC           0x0040  /* movli.l/movco.l */
-#define CPU_HAS_L2_CACHE       0x0080  /* Secondary cache / URAM */
-#define CPU_HAS_OP32           0x0100  /* 32-bit instruction support */
-
-#endif /* __ASM_SH_CPU_FEATURES_H */
diff --git a/include/asm-sh/cpu-sh2/addrspace.h b/include/asm-sh/cpu-sh2/addrspace.h
deleted file mode 100644 (file)
index 2b9ab93..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Definitions for the address spaces of the SH-2 CPUs.
- *
- * Copyright (C) 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_ADDRSPACE_H
-#define __ASM_CPU_SH2_ADDRSPACE_H
-
-#define P0SEG          0x00000000
-#define P1SEG          0x80000000
-#define P2SEG          0xa0000000
-#define P3SEG          0xc0000000
-#define P4SEG          0xe0000000
-
-#endif /* __ASM_CPU_SH2_ADDRSPACE_H */
diff --git a/include/asm-sh/cpu-sh2/cache.h b/include/asm-sh/cpu-sh2/cache.h
deleted file mode 100644 (file)
index 4e0b165..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/cache.h
- *
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_CACHE_H
-#define __ASM_CPU_SH2_CACHE_H
-
-#define L1_CACHE_SHIFT 4
-
-#define SH_CACHE_VALID         1
-#define SH_CACHE_UPDATED       2
-#define SH_CACHE_COMBINED      4
-#define SH_CACHE_ASSOC         8
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7619)
-#define CCR            0xffffffec
-
-#define CCR_CACHE_CE   0x01    /* Cache enable */
-#define CCR_CACHE_WT   0x06    /* CCR[bit1=1,bit2=1] */
-                               /* 0x00000000-0x7fffffff: Write-through  */
-                               /* 0x80000000-0x9fffffff: Write-back     */
-                                /* 0xc0000000-0xdfffffff: Write-through  */
-#define CCR_CACHE_CB   0x00    /* CCR[bit1=0,bit2=0] */
-                               /* 0x00000000-0x7fffffff: Write-back     */
-                               /* 0x80000000-0x9fffffff: Write-through  */
-                                /* 0xc0000000-0xdfffffff: Write-back     */
-#define CCR_CACHE_CF   0x08    /* Cache invalidate */
-
-#define CACHE_OC_ADDRESS_ARRAY 0xf0000000
-#define CACHE_OC_DATA_ARRAY    0xf1000000
-
-#define CCR_CACHE_ENABLE       CCR_CACHE_CE
-#define CCR_CACHE_INVALIDATE   CCR_CACHE_CF
-#endif
-
-#endif /* __ASM_CPU_SH2_CACHE_H */
diff --git a/include/asm-sh/cpu-sh2/cacheflush.h b/include/asm-sh/cpu-sh2/cacheflush.h
deleted file mode 100644 (file)
index 2979efb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/cacheflush.h
- *
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_CACHEFLUSH_H
-#define __ASM_CPU_SH2_CACHEFLUSH_H
-
-/* 
- * Cache flushing:
- *
- *  - flush_cache_all() flushes entire cache
- *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
- *  - flush_cache_dup mm(mm) handles cache flushing when forking
- *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
- *  - flush_cache_range(vma, start, end) flushes a range of pages
- *
- *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
- *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
- *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
- *
- *  Caches are indexed (effectively) by physical address on SH-2, so
- *  we don't need them.
- */
-#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_icache_range(start, end)         do { } while (0)
-#define flush_icache_page(vma,pg)              do { } while (0)
-#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
-#define flush_cache_sigtramp(vaddr)            do { } while (0)
-
-#define p3_cache_init()                                do { } while (0)
-#endif /* __ASM_CPU_SH2_CACHEFLUSH_H */
-
diff --git a/include/asm-sh/cpu-sh2/dma.h b/include/asm-sh/cpu-sh2/dma.h
deleted file mode 100644 (file)
index d66b43c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Definitions for the SH-2 DMAC.
- *
- * Copyright (C) 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_DMA_H
-#define __ASM_CPU_SH2_DMA_H
-
-#define SH_MAX_DMA_CHANNELS    2
-
-#define SAR    ((unsigned long[]){ 0xffffff80, 0xffffff90 })
-#define DAR    ((unsigned long[]){ 0xffffff84, 0xffffff94 })
-#define DMATCR ((unsigned long[]){ 0xffffff88, 0xffffff98 })
-#define CHCR   ((unsigned long[]){ 0xfffffffc, 0xffffff9c })
-
-#define DMAOR  0xffffffb0
-
-#endif /* __ASM_CPU_SH2_DMA_H */
-
diff --git a/include/asm-sh/cpu-sh2/freq.h b/include/asm-sh/cpu-sh2/freq.h
deleted file mode 100644 (file)
index 31de475..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/freq.h
- *
- * Copyright (C) 2006  Yoshinori Sato
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_FREQ_H
-#define __ASM_CPU_SH2_FREQ_H
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7619)
-#define FREQCR 0xf815ff80
-#endif
-
-#endif /* __ASM_CPU_SH2_FREQ_H */
-
diff --git a/include/asm-sh/cpu-sh2/mmu_context.h b/include/asm-sh/cpu-sh2/mmu_context.h
deleted file mode 100644 (file)
index beeb299..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/mmu_context.h
- *
- * Copyright (C) 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_MMU_CONTEXT_H
-#define __ASM_CPU_SH2_MMU_CONTEXT_H
-
-/* No MMU */
-
-#endif /* __ASM_CPU_SH2_MMU_CONTEXT_H */
-
diff --git a/include/asm-sh/cpu-sh2/rtc.h b/include/asm-sh/cpu-sh2/rtc.h
deleted file mode 100644 (file)
index 39e2d6e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_CPU_SH2_RTC_H
-#define __ASM_SH_CPU_SH2_RTC_H
-
-#define rtc_reg_size           sizeof(u16)
-#define RTC_BIT_INVERTED       0
-#define RTC_DEF_CAPABILITIES   0UL
-
-#endif /* __ASM_SH_CPU_SH2_RTC_H */
diff --git a/include/asm-sh/cpu-sh2/sigcontext.h b/include/asm-sh/cpu-sh2/sigcontext.h
deleted file mode 100644 (file)
index fe5c15d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ASM_CPU_SH2_SIGCONTEXT_H
-#define __ASM_CPU_SH2_SIGCONTEXT_H
-
-struct sigcontext {
-       unsigned long   oldmask;
-
-       /* CPU registers */
-       unsigned long sc_regs[16];
-       unsigned long sc_pc;
-       unsigned long sc_pr;
-       unsigned long sc_sr;
-       unsigned long sc_gbr;
-       unsigned long sc_mach;
-       unsigned long sc_macl;
-};
-
-#endif /* __ASM_CPU_SH2_SIGCONTEXT_H */
diff --git a/include/asm-sh/cpu-sh2/timer.h b/include/asm-sh/cpu-sh2/timer.h
deleted file mode 100644 (file)
index a39c241..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_CPU_SH2_TIMER_H
-#define __ASM_CPU_SH2_TIMER_H
-
-/* Nothing needed yet */
-
-#endif /* __ASM_CPU_SH2_TIMER_H */
diff --git a/include/asm-sh/cpu-sh2/ubc.h b/include/asm-sh/cpu-sh2/ubc.h
deleted file mode 100644 (file)
index ba0e87f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/ubc.h
- *
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_UBC_H
-#define __ASM_CPU_SH2_UBC_H
-
-#define UBC_BARA                0xffffff40
-#define UBC_BAMRA               0xffffff44
-#define UBC_BBRA                0xffffff48
-#define UBC_BARB                0xffffff60
-#define UBC_BAMRB               0xffffff64
-#define UBC_BBRB                0xffffff68
-#define UBC_BDRB                0xffffff70
-#define UBC_BDMRB               0xffffff74
-#define UBC_BRCR                0xffffff78
-
-/*
- * We don't have any ASID changes to make in the UBC on the SH-2.
- *
- * Make these purposely invalid to track misuse.
- */
-#define UBC_BASRA              0x00000000
-#define UBC_BASRB              0x00000000
-
-#endif /* __ASM_CPU_SH2_UBC_H */
-
diff --git a/include/asm-sh/cpu-sh2/watchdog.h b/include/asm-sh/cpu-sh2/watchdog.h
deleted file mode 100644 (file)
index 393161c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2/watchdog.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2_WATCHDOG_H
-#define __ASM_CPU_SH2_WATCHDOG_H
-
-/*
- * More SH-2 brilliance .. its not good enough that we can't read
- * and write the same sizes to WTCNT, now we have to read and write
- * with different sizes at different addresses for WTCNT _and_ RSTCSR.
- *
- * At least on the bright side no one has managed to screw over WTCSR
- * in this fashion .. yet.
- */
-/* Register definitions */
-#define WTCNT          0xfffffe80
-#define WTCSR          0xfffffe80
-#define RSTCSR         0xfffffe82
-
-#define WTCNT_R                (WTCNT + 1)
-#define RSTCSR_R       (RSTCSR + 1)
-
-/* Bit definitions */
-#define WTCSR_IOVF     0x80
-#define WTCSR_WT       0x40
-#define WTCSR_TME      0x20
-#define WTCSR_RSTS     0x00
-
-#define RSTCSR_RSTS    0x20
-
-/**
- *     sh_wdt_read_rstcsr - Read from Reset Control/Status Register
- *
- *     Reads back the RSTCSR value.
- */
-static inline __u8 sh_wdt_read_rstcsr(void)
-{
-       /*
-        * Same read/write brain-damage as for WTCNT here..
-        */
-       return ctrl_inb(RSTCSR_R);
-}
-
-/**
- *     sh_wdt_write_csr - Write to Reset Control/Status Register
- *
- *     @val: Value to write
- *
- *     Writes the given value @val to the lower byte of the control/status
- *     register. The upper byte is set manually on each write.
- */
-static inline void sh_wdt_write_rstcsr(__u8 val)
-{
-       /*
-        * Note: Due to the brain-damaged nature of this register,
-        * we can't presently touch the WOVF bit, since the upper byte
-        * has to be swapped for this. So just leave it alone..
-        */
-       ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, RSTCSR);
-}
-
-#endif /* __ASM_CPU_SH2_WATCHDOG_H */
-
diff --git a/include/asm-sh/cpu-sh2a/addrspace.h b/include/asm-sh/cpu-sh2a/addrspace.h
deleted file mode 100644 (file)
index 795ddd6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H
-#define __ASM_SH_CPU_SH2A_ADDRSPACE_H
-
-#define P0SEG          0x00000000
-#define P1SEG          0x00000000
-#define P2SEG          0x20000000
-#define P3SEG          0x00000000
-#define P4SEG          0x80000000
-
-#endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */
diff --git a/include/asm-sh/cpu-sh2a/cache.h b/include/asm-sh/cpu-sh2a/cache.h
deleted file mode 100644 (file)
index afe228b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2a/cache.h
- *
- * Copyright (C) 2004 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2A_CACHE_H
-#define __ASM_CPU_SH2A_CACHE_H
-
-#define L1_CACHE_SHIFT 4
-
-#define SH_CACHE_VALID         1
-#define SH_CACHE_UPDATED       2
-#define SH_CACHE_COMBINED      4
-#define SH_CACHE_ASSOC         8
-
-#define CCR            0xfffc1000 /* CCR1 */
-#define CCR2           0xfffc1004
-
-/*
- * Most of the SH-2A CCR1 definitions resemble the SH-4 ones. All others not
- * listed here are reserved.
- */
-#define CCR_CACHE_CB   0x0000  /* Hack */
-#define CCR_CACHE_OCE  0x0001
-#define CCR_CACHE_WT   0x0002
-#define CCR_CACHE_OCI  0x0008  /* OCF */
-#define CCR_CACHE_ICE  0x0100
-#define CCR_CACHE_ICI  0x0800  /* ICF */
-
-#define CACHE_IC_ADDRESS_ARRAY 0xf0000000
-#define CACHE_OC_ADDRESS_ARRAY 0xf0800000
-
-#define CCR_CACHE_ENABLE       (CCR_CACHE_OCE | CCR_CACHE_ICE)
-#define CCR_CACHE_INVALIDATE   (CCR_CACHE_OCI | CCR_CACHE_ICI)
-
-#endif /* __ASM_CPU_SH2A_CACHE_H */
diff --git a/include/asm-sh/cpu-sh2a/cacheflush.h b/include/asm-sh/cpu-sh2a/cacheflush.h
deleted file mode 100644 (file)
index fa3186c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/cacheflush.h>
diff --git a/include/asm-sh/cpu-sh2a/dma.h b/include/asm-sh/cpu-sh2a/dma.h
deleted file mode 100644 (file)
index 0d5ad85..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/dma.h>
diff --git a/include/asm-sh/cpu-sh2a/freq.h b/include/asm-sh/cpu-sh2a/freq.h
deleted file mode 100644 (file)
index 830fd43..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-sh/cpu-sh2a/freq.h
- *
- * Copyright (C) 2006  Yoshinori Sato
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH2A_FREQ_H
-#define __ASM_CPU_SH2A_FREQ_H
-
-#define FREQCR 0xfffe0010
-
-#endif /* __ASM_CPU_SH2A_FREQ_H */
-
diff --git a/include/asm-sh/cpu-sh2a/mmu_context.h b/include/asm-sh/cpu-sh2a/mmu_context.h
deleted file mode 100644 (file)
index cd2387f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/mmu_context.h>
diff --git a/include/asm-sh/cpu-sh2a/rtc.h b/include/asm-sh/cpu-sh2a/rtc.h
deleted file mode 100644 (file)
index afb511e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_CPU_SH2A_RTC_H
-#define __ASM_SH_CPU_SH2A_RTC_H
-
-#define rtc_reg_size           sizeof(u16)
-#define RTC_BIT_INVERTED       0
-#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
-
-#endif /* __ASM_SH_CPU_SH2A_RTC_H */
diff --git a/include/asm-sh/cpu-sh2a/timer.h b/include/asm-sh/cpu-sh2a/timer.h
deleted file mode 100644 (file)
index fee504a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/timer.h>
diff --git a/include/asm-sh/cpu-sh2a/ubc.h b/include/asm-sh/cpu-sh2a/ubc.h
deleted file mode 100644 (file)
index cf28062..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/ubc.h>
diff --git a/include/asm-sh/cpu-sh2a/watchdog.h b/include/asm-sh/cpu-sh2a/watchdog.h
deleted file mode 100644 (file)
index c1b3e24..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm/cpu-sh2/watchdog.h>
diff --git a/include/asm-sh/cpu-sh3/adc.h b/include/asm-sh/cpu-sh3/adc.h
deleted file mode 100644 (file)
index b289e3c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __ASM_CPU_SH3_ADC_H
-#define __ASM_CPU_SH3_ADC_H
-
-/*
- * Copyright (C) 2004  Andriy Skulysh
- */
-
-
-#define ADDRAH 0xa4000080
-#define ADDRAL 0xa4000082
-#define ADDRBH 0xa4000084
-#define ADDRBL 0xa4000086
-#define ADDRCH 0xa4000088
-#define ADDRCL 0xa400008a
-#define ADDRDH 0xa400008c
-#define ADDRDL 0xa400008e
-#define ADCSR  0xa4000090
-
-#define ADCSR_ADF      0x80
-#define ADCSR_ADIE     0x40
-#define ADCSR_ADST     0x20
-#define ADCSR_MULTI    0x10
-#define ADCSR_CKS      0x08
-#define ADCSR_CH_MASK  0x07
-
-#define ADCR   0xa4000092
-
-#endif /* __ASM_CPU_SH3_ADC_H */
diff --git a/include/asm-sh/cpu-sh3/addrspace.h b/include/asm-sh/cpu-sh3/addrspace.h
deleted file mode 100644 (file)
index 0f94726..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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) 1999 by Kaz Kojima
- *
- * Defitions for the address spaces of the SH-3 CPUs.
- */
-#ifndef __ASM_CPU_SH3_ADDRSPACE_H
-#define __ASM_CPU_SH3_ADDRSPACE_H
-
-#define P0SEG          0x00000000
-#define P1SEG          0x80000000
-#define P2SEG          0xa0000000
-#define P3SEG          0xc0000000
-#define P4SEG          0xe0000000
-
-#endif /* __ASM_CPU_SH3_ADDRSPACE_H */
diff --git a/include/asm-sh/cpu-sh3/cache.h b/include/asm-sh/cpu-sh3/cache.h
deleted file mode 100644 (file)
index bee2d81..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/cache.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_CACHE_H
-#define __ASM_CPU_SH3_CACHE_H
-
-#define L1_CACHE_SHIFT 4
-
-#define SH_CACHE_VALID         1
-#define SH_CACHE_UPDATED       2
-#define SH_CACHE_COMBINED      4
-#define SH_CACHE_ASSOC         8
-
-#define CCR            0xffffffec      /* Address of Cache Control Register */
-
-#define CCR_CACHE_CE   0x01    /* Cache Enable */
-#define CCR_CACHE_WT   0x02    /* Write-Through (for P0,U0,P3) (else writeback) */
-#define CCR_CACHE_CB   0x04    /* Write-Back (for P1) (else writethrough) */
-#define CCR_CACHE_CF   0x08    /* Cache Flush */
-#define CCR_CACHE_ORA  0x20    /* RAM mode */
-
-#define CACHE_OC_ADDRESS_ARRAY 0xf0000000
-#define CACHE_PHYSADDR_MASK    0x1ffffc00
-
-#define CCR_CACHE_ENABLE       CCR_CACHE_CE
-#define CCR_CACHE_INVALIDATE   CCR_CACHE_CF
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7710) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define CCR3_REG       0xa40000b4
-#define CCR_CACHE_16KB  0x00010000
-#define CCR_CACHE_32KB 0x00020000
-#endif
-
-#endif /* __ASM_CPU_SH3_CACHE_H */
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h
deleted file mode 100644 (file)
index f70d8ef..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/cacheflush.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_CACHEFLUSH_H
-#define __ASM_CPU_SH3_CACHEFLUSH_H
-
-/*
- * Cache flushing:
- *
- *  - flush_cache_all() flushes entire cache
- *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
- *  - flush_cache_dup mm(mm) handles cache flushing when forking
- *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
- *  - flush_cache_range(vma, start, end) flushes a range of pages
- *
- *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
- *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
- *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
- *
- *  Caches are indexed (effectively) by physical address on SH-3, so
- *  we don't need them.
- */
-
-#if defined(CONFIG_SH7705_CACHE_32KB)
-
-/* SH7705 is an SH3 processor with 32KB cache. This has alias issues like the
- * SH4. Unlike the SH4 this is a unified cache so we need to do some work
- * in mmap when 'exec'ing a new binary
- */
- /* 32KB cache, 4kb PAGE sizes need to check bit 12 */
-#define CACHE_ALIAS 0x00001000
-
-#define PG_mapped      PG_arch_1
-
-void flush_cache_all(void);
-void flush_cache_mm(struct mm_struct *mm);
-#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
-void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
-                              unsigned long end);
-void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);
-void flush_dcache_page(struct page *pg);
-void flush_icache_range(unsigned long start, unsigned long end);
-void flush_icache_page(struct vm_area_struct *vma, struct page *page);
-#else
-#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_icache_range(start, end)         do { } while (0)
-#define flush_icache_page(vma,pg)              do { } while (0)
-#endif
-
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-
-/* SH3 has unified cache so no special action needed here */
-#define flush_cache_sigtramp(vaddr)            do { } while (0)
-#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
-
-#define p3_cache_init()                                do { } while (0)
-
-#endif /* __ASM_CPU_SH3_CACHEFLUSH_H */
diff --git a/include/asm-sh/cpu-sh3/dac.h b/include/asm-sh/cpu-sh3/dac.h
deleted file mode 100644 (file)
index 05fda83..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef __ASM_CPU_SH3_DAC_H
-#define __ASM_CPU_SH3_DAC_H
-
-/*
- * Copyright (C) 2003  Andriy Skulysh
- */
-
-
-#define DADR0  0xa40000a0
-#define DADR1  0xa40000a2
-#define DACR   0xa40000a4
-#define DACR_DAOE1     0x80
-#define DACR_DAOE0     0x40
-#define DACR_DAE       0x20
-
-
-static __inline__ void sh_dac_enable(int channel)
-{
-       unsigned char v;
-       v = ctrl_inb(DACR);
-       if(channel) v |= DACR_DAOE1;
-       else v |= DACR_DAOE0;
-       ctrl_outb(v,DACR);
-}
-
-static __inline__ void sh_dac_disable(int channel)
-{
-       unsigned char v;
-       v = ctrl_inb(DACR);
-       if(channel) v &= ~DACR_DAOE1;
-       else v &= ~DACR_DAOE0;
-       ctrl_outb(v,DACR);
-}
-
-static __inline__ void sh_dac_output(u8 value, int channel)
-{
-       if(channel) ctrl_outb(value,DADR1);
-       else ctrl_outb(value,DADR0);
-}
-
-#endif /* __ASM_CPU_SH3_DAC_H */
diff --git a/include/asm-sh/cpu-sh3/dma.h b/include/asm-sh/cpu-sh3/dma.h
deleted file mode 100644 (file)
index 6813c32..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef __ASM_CPU_SH3_DMA_H
-#define __ASM_CPU_SH3_DMA_H
-
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define SH_DMAC_BASE   0xa4010020
-#else
-#define SH_DMAC_BASE   0xa4000020
-#endif
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7709)
-#define DMTE0_IRQ      48
-#define DMTE1_IRQ      49
-#define DMTE2_IRQ      50
-#define DMTE3_IRQ      51
-#define DMTE4_IRQ      76
-#define DMTE5_IRQ      77
-#endif
-
-/* Definitions for the SuperH DMAC */
-#define TM_BURST       0x00000020
-#define TS_8           0x00000000
-#define TS_16          0x00000008
-#define TS_32          0x00000010
-#define TS_128         0x00000018
-
-#define CHCR_TS_MASK   0x18
-#define CHCR_TS_SHIFT  3
-
-#define DMAOR_INIT     DMAOR_DME
-
-/*
- * The SuperH DMAC supports a number of transmit sizes, we list them here,
- * with their respective values as they appear in the CHCR registers.
- */
-enum {
-       XMIT_SZ_8BIT,
-       XMIT_SZ_16BIT,
-       XMIT_SZ_32BIT,
-       XMIT_SZ_128BIT,
-};
-
-static unsigned int ts_shift[] __maybe_unused = {
-       [XMIT_SZ_8BIT]          = 0,
-       [XMIT_SZ_16BIT]         = 1,
-       [XMIT_SZ_32BIT]         = 2,
-       [XMIT_SZ_128BIT]        = 4,
-};
-
-#endif /* __ASM_CPU_SH3_DMA_H */
diff --git a/include/asm-sh/cpu-sh3/freq.h b/include/asm-sh/cpu-sh3/freq.h
deleted file mode 100644 (file)
index 53c6230..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/freq.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_FREQ_H
-#define __ASM_CPU_SH3_FREQ_H
-
-#ifdef CONFIG_CPU_SUBTYPE_SH7712
-#define FRQCR                  0xA415FF80
-#else
-#define FRQCR                  0xffffff80
-#endif
-
-#define MIN_DIVISOR_NR         0
-#define MAX_DIVISOR_NR         4
-
-#define FRQCR_CKOEN    0x0100
-#define FRQCR_PLLEN    0x0080
-#define FRQCR_PSTBY    0x0040
-
-#endif /* __ASM_CPU_SH3_FREQ_H */
-
diff --git a/include/asm-sh/cpu-sh3/gpio.h b/include/asm-sh/cpu-sh3/gpio.h
deleted file mode 100644 (file)
index 4e53eb3..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  include/asm-sh/cpu-sh3/gpio.h
- *
- *  Copyright (C) 2007  Markus Brunner, Mark Jonas
- *
- *  Addresses for the Pin Function Controller
- *
- * 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.
- */
-#ifndef _CPU_SH3_GPIO_H
-#define _CPU_SH3_GPIO_H
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-
-/* Control registers */
-#define PORT_PACR      0xA4050100UL
-#define PORT_PBCR      0xA4050102UL
-#define PORT_PCCR      0xA4050104UL
-#define PORT_PDCR      0xA4050106UL
-#define PORT_PECR      0xA4050108UL
-#define PORT_PFCR      0xA405010AUL
-#define PORT_PGCR      0xA405010CUL
-#define PORT_PHCR      0xA405010EUL
-#define PORT_PJCR      0xA4050110UL
-#define PORT_PKCR      0xA4050112UL
-#define PORT_PLCR      0xA4050114UL
-#define PORT_PMCR      0xA4050116UL
-#define PORT_PPCR      0xA4050118UL
-#define PORT_PRCR      0xA405011AUL
-#define PORT_PSCR      0xA405011CUL
-#define PORT_PTCR      0xA405011EUL
-#define PORT_PUCR      0xA4050120UL
-#define PORT_PVCR      0xA4050122UL
-
-/* Data registers */
-#define PORT_PADR      0xA4050140UL
-/* Address of PORT_PBDR is wrong in the datasheet, see errata 2005-09-21 */
-#define PORT_PBDR      0xA4050142UL
-#define PORT_PCDR      0xA4050144UL
-#define PORT_PDDR      0xA4050146UL
-#define PORT_PEDR      0xA4050148UL
-#define PORT_PFDR      0xA405014AUL
-#define PORT_PGDR      0xA405014CUL
-#define PORT_PHDR      0xA405014EUL
-#define PORT_PJDR      0xA4050150UL
-#define PORT_PKDR      0xA4050152UL
-#define PORT_PLDR      0xA4050154UL
-#define PORT_PMDR      0xA4050156UL
-#define PORT_PPDR      0xA4050158UL
-#define PORT_PRDR      0xA405015AUL
-#define PORT_PSDR      0xA405015CUL
-#define PORT_PTDR      0xA405015EUL
-#define PORT_PUDR      0xA4050160UL
-#define PORT_PVDR      0xA4050162UL
-
-/* Pin Select Registers */
-#define PORT_PSELA     0xA4050124UL
-#define PORT_PSELB     0xA4050126UL
-#define PORT_PSELC     0xA4050128UL
-#define PORT_PSELD     0xA405012AUL
-
-#endif
-
-#endif
diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
deleted file mode 100644 (file)
index ab09da7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/mmu_context.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_MMU_CONTEXT_H
-#define __ASM_CPU_SH3_MMU_CONTEXT_H
-
-#define MMU_PTEH       0xFFFFFFF0      /* Page table entry register HIGH */
-#define MMU_PTEL       0xFFFFFFF4      /* Page table entry register LOW */
-#define MMU_TTB                0xFFFFFFF8      /* Translation table base register */
-#define MMU_TEA                0xFFFFFFFC      /* TLB Exception Address */
-
-#define MMUCR          0xFFFFFFE0      /* MMU Control Register */
-
-#define MMU_TLB_ADDRESS_ARRAY  0xF2000000
-#define MMU_PAGE_ASSOC_BIT     0x80
-
-#define MMU_NTLB_ENTRIES       128     /* for 7708 */
-#define MMU_NTLB_WAYS          4
-#define MMU_CONTROL_INIT       0x007   /* SV=0, TF=1, IX=1, AT=1 */
-
-#define TRA    0xffffffd0
-#define EXPEVT 0xffffffd4
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7706) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7707) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7709) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7710) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7712) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define INTEVT 0xa4000000      /* INTEVTE2(0xa4000000) */
-#else
-#define INTEVT 0xffffffd8
-#endif
-
-#endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */
-
diff --git a/include/asm-sh/cpu-sh3/rtc.h b/include/asm-sh/cpu-sh3/rtc.h
deleted file mode 100644 (file)
index 319404a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_CPU_SH3_RTC_H
-#define __ASM_SH_CPU_SH3_RTC_H
-
-#define rtc_reg_size           sizeof(u16)
-#define RTC_BIT_INVERTED       0       /* No bug on SH7708, SH7709A */
-#define RTC_DEF_CAPABILITIES   0UL
-
-#endif /* __ASM_SH_CPU_SH3_RTC_H */
diff --git a/include/asm-sh/cpu-sh3/sigcontext.h b/include/asm-sh/cpu-sh3/sigcontext.h
deleted file mode 100644 (file)
index 17310dc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ASM_CPU_SH3_SIGCONTEXT_H
-#define __ASM_CPU_SH3_SIGCONTEXT_H
-
-struct sigcontext {
-       unsigned long   oldmask;
-
-       /* CPU registers */
-       unsigned long sc_regs[16];
-       unsigned long sc_pc;
-       unsigned long sc_pr;
-       unsigned long sc_sr;
-       unsigned long sc_gbr;
-       unsigned long sc_mach;
-       unsigned long sc_macl;
-};
-
-#endif /* __ASM_CPU_SH3_SIGCONTEXT_H */
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h
deleted file mode 100644 (file)
index 793acf1..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/timer.h
- *
- * Copyright (C) 2004 Lineo Solutions, Inc.
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_TIMER_H
-#define __ASM_CPU_SH3_TIMER_H
-
-/*
- * ---------------------------------------------------------------------------
- * TMU Common definitions for SH3 processors
- *     SH7706
- *     SH7709S
- *     SH7727
- *     SH7729R
- *     SH7710
- *     SH7720
- *     SH7710
- * ---------------------------------------------------------------------------
- */
-
-#if  !defined(CONFIG_CPU_SUBTYPE_SH7720) && !defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define TMU_TOCR       0xfffffe90      /* Byte access */
-#endif
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define TMU_012_TSTR   0xa412fe92      /* Byte access */
-
-#define TMU0_TCOR      0xa412fe94      /* Long access */
-#define TMU0_TCNT      0xa412fe98      /* Long access */
-#define TMU0_TCR       0xa412fe9c      /* Word access */
-
-#define TMU1_TCOR      0xa412fea0      /* Long access */
-#define TMU1_TCNT      0xa412fea4      /* Long access */
-#define TMU1_TCR       0xa412fea8      /* Word access */
-
-#define TMU2_TCOR      0xa412feac      /* Long access */
-#define TMU2_TCNT      0xa412feb0      /* Long access */
-#define TMU2_TCR       0xa412feb4      /* Word access */
-
-#else
-#define TMU_012_TSTR   0xfffffe92      /* Byte access */
-
-#define TMU0_TCOR      0xfffffe94      /* Long access */
-#define TMU0_TCNT      0xfffffe98      /* Long access */
-#define TMU0_TCR       0xfffffe9c      /* Word access */
-
-#define TMU1_TCOR      0xfffffea0      /* Long access */
-#define TMU1_TCNT      0xfffffea4      /* Long access */
-#define TMU1_TCR       0xfffffea8      /* Word access */
-
-#define TMU2_TCOR      0xfffffeac      /* Long access */
-#define TMU2_TCNT      0xfffffeb0      /* Long access */
-#define TMU2_TCR       0xfffffeb4      /* Word access */
-#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && !defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define TMU2_TCPR2     0xfffffeb8      /* Long access */
-#endif
-#endif
-
-#endif /* __ASM_CPU_SH3_TIMER_H */
-
diff --git a/include/asm-sh/cpu-sh3/ubc.h b/include/asm-sh/cpu-sh3/ubc.h
deleted file mode 100644 (file)
index 4e6381d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/ubc.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_UBC_H
-#define __ASM_CPU_SH3_UBC_H
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7721)
-#define UBC_BARA               0xa4ffffb0
-#define UBC_BAMRA              0xa4ffffb4
-#define UBC_BBRA               0xa4ffffb8
-#define UBC_BASRA              0xffffffe4
-#define UBC_BARB               0xa4ffffa0
-#define UBC_BAMRB              0xa4ffffa4
-#define UBC_BBRB               0xa4ffffa8
-#define UBC_BASRB              0xffffffe8
-#define UBC_BDRB               0xa4ffff90
-#define UBC_BDMRB              0xa4ffff94
-#define UBC_BRCR               0xa4ffff98
-#else
-#define UBC_BARA                0xffffffb0
-#define UBC_BAMRA               0xffffffb4
-#define UBC_BBRA                0xffffffb8
-#define UBC_BASRA               0xffffffe4
-#define UBC_BARB                0xffffffa0
-#define UBC_BAMRB               0xffffffa4
-#define UBC_BBRB                0xffffffa8
-#define UBC_BASRB               0xffffffe8
-#define UBC_BDRB                0xffffff90
-#define UBC_BDMRB               0xffffff94
-#define UBC_BRCR                0xffffff98
-#endif
-
-#endif /* __ASM_CPU_SH3_UBC_H */
diff --git a/include/asm-sh/cpu-sh3/watchdog.h b/include/asm-sh/cpu-sh3/watchdog.h
deleted file mode 100644 (file)
index 4ee0347..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * include/asm-sh/cpu-sh3/watchdog.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH3_WATCHDOG_H
-#define __ASM_CPU_SH3_WATCHDOG_H
-
-/* Register definitions */
-#define WTCNT          0xffffff84
-#define WTCSR          0xffffff86
-
-/* Bit definitions */
-#define WTCSR_TME      0x80
-#define WTCSR_WT       0x40
-#define WTCSR_RSTS     0x20
-#define WTCSR_WOVF     0x10
-#define WTCSR_IOVF     0x08
-
-#endif /* __ASM_CPU_SH3_WATCHDOG_H */
-
diff --git a/include/asm-sh/cpu-sh4/addrspace.h b/include/asm-sh/cpu-sh4/addrspace.h
deleted file mode 100644 (file)
index a3fa733..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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) 1999 by Kaz Kojima
- *
- * Defitions for the address spaces of the SH-4 CPUs.
- */
-#ifndef __ASM_CPU_SH4_ADDRSPACE_H
-#define __ASM_CPU_SH4_ADDRSPACE_H
-
-#define P0SEG          0x00000000
-#define P1SEG          0x80000000
-#define P2SEG          0xa0000000
-#define P3SEG          0xc0000000
-#define P4SEG          0xe0000000
-
-/* Detailed P4SEG  */
-#define P4SEG_STORE_QUE        (P4SEG)
-#define P4SEG_IC_ADDR  0xf0000000
-#define P4SEG_IC_DATA  0xf1000000
-#define P4SEG_ITLB_ADDR        0xf2000000
-#define P4SEG_ITLB_DATA        0xf3000000
-#define P4SEG_OC_ADDR  0xf4000000
-#define P4SEG_OC_DATA  0xf5000000
-#define P4SEG_TLB_ADDR 0xf6000000
-#define P4SEG_TLB_DATA 0xf7000000
-#define P4SEG_REG_BASE 0xff000000
-
-#define PA_AREA5_IO    0xb4000000      /* Area 5 IO Memory */
-#define PA_AREA6_IO    0xb8000000      /* Area 6 IO Memory */
-
-#endif /* __ASM_CPU_SH4_ADDRSPACE_H */
-
diff --git a/include/asm-sh/cpu-sh4/cache.h b/include/asm-sh/cpu-sh4/cache.h
deleted file mode 100644 (file)
index 1c61ebf..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/cache.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_CACHE_H
-#define __ASM_CPU_SH4_CACHE_H
-
-#define L1_CACHE_SHIFT 5
-
-#define SH_CACHE_VALID         1
-#define SH_CACHE_UPDATED       2
-#define SH_CACHE_COMBINED      4
-#define SH_CACHE_ASSOC         8
-
-#define CCR            0xff00001c      /* Address of Cache Control Register */
-#define CCR_CACHE_OCE  0x0001  /* Operand Cache Enable */
-#define CCR_CACHE_WT   0x0002  /* Write-Through (for P0,U0,P3) (else writeback)*/
-#define CCR_CACHE_CB   0x0004  /* Copy-Back (for P1) (else writethrough) */
-#define CCR_CACHE_OCI  0x0008  /* OC Invalidate */
-#define CCR_CACHE_ORA  0x0020  /* OC RAM Mode */
-#define CCR_CACHE_OIX  0x0080  /* OC Index Enable */
-#define CCR_CACHE_ICE  0x0100  /* Instruction Cache Enable */
-#define CCR_CACHE_ICI  0x0800  /* IC Invalidate */
-#define CCR_CACHE_IIX  0x8000  /* IC Index Enable */
-#ifndef CONFIG_CPU_SH4A
-#define CCR_CACHE_EMODE        0x80000000      /* EMODE Enable */
-#endif
-
-/* Default CCR setup: 8k+16k-byte cache,P1-wb,enable */
-#define CCR_CACHE_ENABLE       (CCR_CACHE_OCE|CCR_CACHE_ICE)
-#define CCR_CACHE_INVALIDATE   (CCR_CACHE_OCI|CCR_CACHE_ICI)
-
-#define CACHE_IC_ADDRESS_ARRAY 0xf0000000
-#define CACHE_OC_ADDRESS_ARRAY 0xf4000000
-
-#endif /* __ASM_CPU_SH4_CACHE_H */
-
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h
deleted file mode 100644 (file)
index 065306d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/cacheflush.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_CACHEFLUSH_H
-#define __ASM_CPU_SH4_CACHEFLUSH_H
-
-/*
- *  Caches are broken on SH-4 (unless we use write-through
- *  caching; in which case they're only semi-broken),
- *  so we need them.
- */
-void flush_cache_all(void);
-void flush_dcache_all(void);
-void flush_cache_mm(struct mm_struct *mm);
-#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
-void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
-                      unsigned long end);
-void flush_cache_page(struct vm_area_struct *vma, unsigned long addr,
-                     unsigned long pfn);
-void flush_dcache_page(struct page *pg);
-
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-
-void flush_icache_range(unsigned long start, unsigned long end);
-void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
-                            unsigned long addr, int len);
-
-#define flush_icache_page(vma,pg)              do { } while (0)
-
-/* Initialization of P3 area for copy_user_page */
-void p3_cache_init(void);
-
-#define PG_mapped      PG_arch_1
-
-#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */
diff --git a/include/asm-sh/cpu-sh4/dma-sh7780.h b/include/asm-sh/cpu-sh4/dma-sh7780.h
deleted file mode 100644 (file)
index 71b426a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
-#define __ASM_SH_CPU_SH4_DMA_SH7780_H
-
-#define REQ_HE 0x000000C0
-#define REQ_H  0x00000080
-#define REQ_LE 0x00000040
-#define TM_BURST 0x0000020
-#define TS_8   0x00000000
-#define TS_16  0x00000008
-#define TS_32  0x00000010
-#define TS_16BLK       0x00000018
-#define TS_32BLK       0x00100000
-
-/*
- * The SuperH DMAC supports a number of transmit sizes, we list them here,
- * with their respective values as they appear in the CHCR registers.
- *
- * Defaults to a 64-bit transfer size.
- */
-enum {
-       XMIT_SZ_8BIT,
-       XMIT_SZ_16BIT,
-       XMIT_SZ_32BIT,
-       XMIT_SZ_128BIT,
-       XMIT_SZ_256BIT,
-};
-
-/*
- * The DMA count is defined as the number of bytes to transfer.
- */
-static unsigned int ts_shift[] __maybe_unused = {
-       [XMIT_SZ_8BIT]          = 0,
-       [XMIT_SZ_16BIT]         = 1,
-       [XMIT_SZ_32BIT]         = 2,
-       [XMIT_SZ_128BIT]        = 4,
-       [XMIT_SZ_256BIT]        = 5,
-};
-
-#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */
diff --git a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h
deleted file mode 100644 (file)
index aaf71b0..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef __ASM_CPU_SH4_DMA_H
-#define __ASM_CPU_SH4_DMA_H
-
-#define DMAOR_INIT     ( 0x8000 | DMAOR_DME )
-
-/* SH7751/7760/7780 DMA IRQ sources */
-#define DMTE0_IRQ      34
-#define DMTE1_IRQ      35
-#define DMTE2_IRQ      36
-#define DMTE3_IRQ      37
-#define DMTE4_IRQ      44
-#define DMTE5_IRQ      45
-#define DMTE6_IRQ      46
-#define DMTE7_IRQ      47
-#define DMAE_IRQ       38
-
-#ifdef CONFIG_CPU_SH4A
-#define SH_DMAC_BASE   0xfc808020
-
-#define CHCR_TS_MASK   0x18
-#define CHCR_TS_SHIFT  3
-
-#include <asm/cpu/dma-sh7780.h>
-#else
-#define SH_DMAC_BASE   0xffa00000
-
-/* Definitions for the SuperH DMAC */
-#define TM_BURST       0x0000080
-#define TS_8           0x00000010
-#define TS_16          0x00000020
-#define TS_32          0x00000030
-#define TS_64          0x00000000
-
-#define CHCR_TS_MASK   0x70
-#define CHCR_TS_SHIFT  4
-
-#define DMAOR_COD      0x00000008
-
-/*
- * The SuperH DMAC supports a number of transmit sizes, we list them here,
- * with their respective values as they appear in the CHCR registers.
- *
- * Defaults to a 64-bit transfer size.
- */
-enum {
-       XMIT_SZ_64BIT,
-       XMIT_SZ_8BIT,
-       XMIT_SZ_16BIT,
-       XMIT_SZ_32BIT,
-       XMIT_SZ_256BIT,
-};
-
-/*
- * The DMA count is defined as the number of bytes to transfer.
- */
-static unsigned int ts_shift[] __maybe_unused = {
-       [XMIT_SZ_64BIT]         = 3,
-       [XMIT_SZ_8BIT]          = 0,
-       [XMIT_SZ_16BIT]         = 1,
-       [XMIT_SZ_32BIT]         = 2,
-       [XMIT_SZ_256BIT]        = 5,
-};
-#endif
-
-#endif /* __ASM_CPU_SH4_DMA_H */
diff --git a/include/asm-sh/cpu-sh4/fpu.h b/include/asm-sh/cpu-sh4/fpu.h
deleted file mode 100644 (file)
index febef73..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * linux/arch/sh/kernel/cpu/sh4/sh4_fpu.h
- *
- * Copyright (C) 2006 STMicroelectronics Limited
- * Author: Carl Shaw <carl.shaw@st.com>
- *
- * May be copied or modified under the terms of the GNU General Public
- * License Version 2.  See linux/COPYING for more information.
- *
- * Definitions for SH4 FPU operations
- */
-
-#ifndef __CPU_SH4_FPU_H
-#define __CPU_SH4_FPU_H
-
-#define FPSCR_ENABLE_MASK      0x00000f80UL
-
-#define FPSCR_FMOV_DOUBLE      (1<<1)
-
-#define FPSCR_CAUSE_INEXACT    (1<<12)
-#define FPSCR_CAUSE_UNDERFLOW  (1<<13)
-#define FPSCR_CAUSE_OVERFLOW   (1<<14)
-#define FPSCR_CAUSE_DIVZERO    (1<<15)
-#define FPSCR_CAUSE_INVALID    (1<<16)
-#define FPSCR_CAUSE_ERROR      (1<<17)
-
-#define FPSCR_DBL_PRECISION    (1<<19)
-#define FPSCR_ROUNDING_MODE(x) ((x >> 20) & 3)
-#define FPSCR_RM_NEAREST       (0)
-#define FPSCR_RM_ZERO          (1)
-
-#endif
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
deleted file mode 100644 (file)
index c23af81..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/freq.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_FREQ_H
-#define __ASM_CPU_SH4_FREQ_H
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7722) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7723) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7343) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7366)
-#define FRQCR                  0xa4150000
-#define VCLKCR                 0xa4150004
-#define SCLKACR                        0xa4150008
-#define SCLKBCR                        0xa415000c
-#define IrDACLKCR              0xa4150010
-#define MSTPCR0                        0xa4150030
-#define MSTPCR1                        0xa4150034
-#define MSTPCR2                        0xa4150038
-#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-      defined(CONFIG_CPU_SUBTYPE_SH7780)
-#define        FRQCR                   0xffc80000
-#elif defined(CONFIG_CPU_SUBTYPE_SH7785)
-#define FRQCR0                 0xffc80000
-#define FRQCR1                 0xffc80004
-#define FRQMR1                 0xffc80014
-#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
-#define FRQCR                  0xffc00014
-#else
-#define FRQCR                  0xffc00000
-#define FRQCR_PSTBY            0x0200
-#define FRQCR_PLLEN            0x0400
-#define FRQCR_CKOEN            0x0800
-#endif
-#define MIN_DIVISOR_NR         0
-#define MAX_DIVISOR_NR         3
-
-#endif /* __ASM_CPU_SH4_FREQ_H */
-
diff --git a/include/asm-sh/cpu-sh4/mmu_context.h b/include/asm-sh/cpu-sh4/mmu_context.h
deleted file mode 100644 (file)
index 9ea8eb2..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/mmu_context.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_MMU_CONTEXT_H
-#define __ASM_CPU_SH4_MMU_CONTEXT_H
-
-#define MMU_PTEH       0xFF000000      /* Page table entry register HIGH */
-#define MMU_PTEL       0xFF000004      /* Page table entry register LOW */
-#define MMU_TTB                0xFF000008      /* Translation table base register */
-#define MMU_TEA                0xFF00000C      /* TLB Exception Address */
-#define MMU_PTEA       0xFF000034      /* Page table entry assistance register */
-
-#define MMUCR          0xFF000010      /* MMU Control Register */
-
-#define MMU_ITLB_ADDRESS_ARRAY 0xF2000000
-#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000
-#define MMU_PAGE_ASSOC_BIT     0x80
-
-#define MMUCR_TI               (1<<2)
-
-#ifdef CONFIG_X2TLB
-#define MMUCR_ME               (1 << 7)
-#else
-#define MMUCR_ME               (0)
-#endif
-
-#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
-#define MMUCR_SE               (1 << 4)
-#else
-#define MMUCR_SE               (0)
-#endif
-
-#ifdef CONFIG_SH_STORE_QUEUES
-#define MMUCR_SQMD             (1 << 9)
-#else
-#define MMUCR_SQMD             (0)
-#endif
-
-#define MMU_NTLB_ENTRIES       64
-#define MMU_CONTROL_INIT       (0x05|MMUCR_SQMD|MMUCR_ME|MMUCR_SE)
-
-#define MMU_ITLB_DATA_ARRAY    0xF3000000
-#define MMU_UTLB_DATA_ARRAY    0xF7000000
-
-#define MMU_UTLB_ENTRIES          64
-#define MMU_U_ENTRY_SHIFT          8
-#define MMU_UTLB_VALID         0x100
-#define MMU_ITLB_ENTRIES           4
-#define MMU_I_ENTRY_SHIFT          8
-#define MMU_ITLB_VALID         0x100
-
-#define TRA    0xff000020
-#define EXPEVT 0xff000024
-#define INTEVT 0xff000028
-
-#endif /* __ASM_CPU_SH4_MMU_CONTEXT_H */
-
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h
deleted file mode 100644 (file)
index 25b1e6a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_SH_CPU_SH4_RTC_H
-#define __ASM_SH_CPU_SH4_RTC_H
-
-#ifdef CONFIG_CPU_SUBTYPE_SH7723
-#define rtc_reg_size           sizeof(u16)
-#else
-#define rtc_reg_size           sizeof(u32)
-#endif
-
-#define RTC_BIT_INVERTED       0x40    /* bug on SH7750, SH7750S */
-#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
-
-#endif /* __ASM_SH_CPU_SH4_RTC_H */
diff --git a/include/asm-sh/cpu-sh4/sigcontext.h b/include/asm-sh/cpu-sh4/sigcontext.h
deleted file mode 100644 (file)
index ab392f1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __ASM_CPU_SH4_SIGCONTEXT_H
-#define __ASM_CPU_SH4_SIGCONTEXT_H
-
-struct sigcontext {
-       unsigned long   oldmask;
-
-       /* CPU registers */
-       unsigned long sc_regs[16];
-       unsigned long sc_pc;
-       unsigned long sc_pr;
-       unsigned long sc_sr;
-       unsigned long sc_gbr;
-       unsigned long sc_mach;
-       unsigned long sc_macl;
-
-       /* FPU registers */
-       unsigned long sc_fpregs[16];
-       unsigned long sc_xfpregs[16];
-       unsigned int sc_fpscr;
-       unsigned int sc_fpul;
-       unsigned int sc_ownedfp;
-};
-
-#endif /* __ASM_CPU_SH4_SIGCONTEXT_H */
diff --git a/include/asm-sh/cpu-sh4/sq.h b/include/asm-sh/cpu-sh4/sq.h
deleted file mode 100644 (file)
index 586d649..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/sq.h
- *
- * Copyright (C) 2001, 2002, 2003  Paul Mundt
- * Copyright (C) 2001, 2002  M. R. Brown
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_SQ_H
-#define __ASM_CPU_SH4_SQ_H
-
-#include <asm/addrspace.h>
-
-/*
- * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be
- * mapped to any physical address space. Since data is written (and aligned)
- * to 32-byte boundaries, we need to be sure that all allocations are aligned.
- */
-#define SQ_SIZE                 32
-#define SQ_ALIGN_MASK           (~(SQ_SIZE - 1))
-#define SQ_ALIGN(addr)          (((addr)+SQ_SIZE-1) & SQ_ALIGN_MASK)
-
-#define SQ_QACR0               (P4SEG_REG_BASE  + 0x38)
-#define SQ_QACR1               (P4SEG_REG_BASE  + 0x3c)
-#define SQ_ADDRMAX              (P4SEG_STORE_QUE + 0x04000000)
-
-/* arch/sh/kernel/cpu/sh4/sq.c */
-unsigned long sq_remap(unsigned long phys, unsigned int size,
-                      const char *name, unsigned long flags);
-void sq_unmap(unsigned long vaddr);
-void sq_flush_range(unsigned long start, unsigned int len);
-
-#endif /* __ASM_CPU_SH4_SQ_H */
diff --git a/include/asm-sh/cpu-sh4/timer.h b/include/asm-sh/cpu-sh4/timer.h
deleted file mode 100644 (file)
index d1e796b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/timer.h
- *
- * Copyright (C) 2004 Lineo Solutions, Inc.
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_TIMER_H
-#define __ASM_CPU_SH4_TIMER_H
-
-/*
- * ---------------------------------------------------------------------------
- * TMU Common definitions for SH4 processors
- *     SH7750S/SH7750R
- *     SH7751/SH7751R
- *     SH7760
- *     SH-X3
- * ---------------------------------------------------------------------------
- */
-#ifdef CONFIG_CPU_SUBTYPE_SHX3
-#define TMU_012_BASE   0xffc10000
-#define TMU_345_BASE   0xffc20000
-#else
-#define TMU_012_BASE   0xffd80000
-#define TMU_345_BASE   0xfe100000
-#endif
-
-#define TMU_TOCR       TMU_012_BASE    /* Not supported on all CPUs */
-
-#define TMU_012_TSTR   (TMU_012_BASE + 0x04)
-#define TMU_345_TSTR   (TMU_345_BASE + 0x04)
-
-#define TMU0_TCOR      (TMU_012_BASE + 0x08)
-#define TMU0_TCNT      (TMU_012_BASE + 0x0c)
-#define TMU0_TCR       (TMU_012_BASE + 0x10)
-
-#define TMU1_TCOR       (TMU_012_BASE + 0x14)
-#define TMU1_TCNT       (TMU_012_BASE + 0x18)
-#define TMU1_TCR        (TMU_012_BASE + 0x1c)
-
-#define TMU2_TCOR       (TMU_012_BASE + 0x20)
-#define TMU2_TCNT       (TMU_012_BASE + 0x24)
-#define TMU2_TCR       (TMU_012_BASE + 0x28)
-#define TMU2_TCPR      (TMU_012_BASE + 0x2c)
-
-#define TMU3_TCOR      (TMU_345_BASE + 0x08)
-#define TMU3_TCNT      (TMU_345_BASE + 0x0c)
-#define TMU3_TCR       (TMU_345_BASE + 0x10)
-
-#define TMU4_TCOR      (TMU_345_BASE + 0x14)
-#define TMU4_TCNT      (TMU_345_BASE + 0x18)
-#define TMU4_TCR       (TMU_345_BASE + 0x1c)
-
-#define TMU5_TCOR      (TMU_345_BASE + 0x20)
-#define TMU5_TCNT      (TMU_345_BASE + 0x24)
-#define TMU5_TCR       (TMU_345_BASE + 0x28)
-
-#endif /* __ASM_CPU_SH4_TIMER_H */
diff --git a/include/asm-sh/cpu-sh4/ubc.h b/include/asm-sh/cpu-sh4/ubc.h
deleted file mode 100644 (file)
index c86e170..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/ubc.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2003 Paul Mundt
- * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_UBC_H
-#define __ASM_CPU_SH4_UBC_H
-
-#if defined(CONFIG_CPU_SH4A)
-#define UBC_CBR0               0xff200000
-#define UBC_CRR0               0xff200004
-#define UBC_CAR0               0xff200008
-#define UBC_CAMR0              0xff20000c
-#define UBC_CBR1               0xff200020
-#define UBC_CRR1               0xff200024
-#define UBC_CAR1               0xff200028
-#define UBC_CAMR1              0xff20002c
-#define UBC_CDR1               0xff200030
-#define UBC_CDMR1              0xff200034
-#define UBC_CETR1              0xff200038
-#define UBC_CCMFR              0xff200600
-#define UBC_CBCR               0xff200620
-
-/* CBR */
-#define UBC_CBR_AIE            (0x01<<30)
-#define UBC_CBR_ID_INST                (0x01<<4)
-#define UBC_CBR_RW_READ                (0x01<<1)
-#define UBC_CBR_CE             (0x01)
-
-#define        UBC_CBR_AIV_MASK        (0x00FF0000)
-#define        UBC_CBR_AIV_SHIFT       (16)
-#define UBC_CBR_AIV_SET(asid)  (((asid)<<UBC_CBR_AIV_SHIFT) & UBC_CBR_AIV_MASK)
-
-#define UBC_CBR_INIT           0x20000000
-
-/* CRR */
-#define UBC_CRR_RES            (0x01<<13)
-#define UBC_CRR_PCB            (0x01<<1)
-#define UBC_CRR_BIE            (0x01)
-
-#define UBC_CRR_INIT           0x00002000
-
-#else  /* CONFIG_CPU_SH4 */
-#define UBC_BARA               0xff200000
-#define UBC_BAMRA              0xff200004
-#define UBC_BBRA               0xff200008
-#define UBC_BASRA              0xff000014
-#define UBC_BARB               0xff20000c
-#define UBC_BAMRB              0xff200010
-#define UBC_BBRB               0xff200014
-#define UBC_BASRB              0xff000018
-#define UBC_BDRB               0xff200018
-#define UBC_BDMRB              0xff20001c
-#define UBC_BRCR               0xff200020
-#endif /* CONFIG_CPU_SH4 */
-
-#endif /* __ASM_CPU_SH4_UBC_H */
-
diff --git a/include/asm-sh/cpu-sh4/watchdog.h b/include/asm-sh/cpu-sh4/watchdog.h
deleted file mode 100644 (file)
index 259f6a0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * include/asm-sh/cpu-sh4/watchdog.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_CPU_SH4_WATCHDOG_H
-#define __ASM_CPU_SH4_WATCHDOG_H
-
-/* Register definitions */
-#define WTCNT          0xffc00008
-#define WTCSR          0xffc0000c
-
-/* Bit definitions */
-#define WTCSR_TME      0x80
-#define WTCSR_WT       0x40
-#define WTCSR_RSTS     0x20
-#define WTCSR_WOVF     0x10
-#define WTCSR_IOVF     0x08
-
-#endif /* __ASM_CPU_SH4_WATCHDOG_H */
-
diff --git a/include/asm-sh/cpu-sh5/addrspace.h b/include/asm-sh/cpu-sh5/addrspace.h
deleted file mode 100644 (file)
index dc36b9a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_ADDRSPACE_H
-#define __ASM_SH_CPU_SH5_ADDRSPACE_H
-
-#define        PHYS_PERIPHERAL_BLOCK   0x09000000
-#define PHYS_DMAC_BLOCK                0x0e000000
-#define PHYS_PCI_BLOCK         0x60000000
-#define PHYS_EMI_BLOCK         0xff000000
-
-/* No segmentation.. */
-
-#endif /* __ASM_SH_CPU_SH5_ADDRSPACE_H */
diff --git a/include/asm-sh/cpu-sh5/cache.h b/include/asm-sh/cpu-sh5/cache.h
deleted file mode 100644 (file)
index ed050ab..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_CACHE_H
-#define __ASM_SH_CPU_SH5_CACHE_H
-
-/*
- * include/asm-sh/cpu-sh5/cache.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003, 2004  Paul Mundt
- *
- * 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.
- */
-
-#define L1_CACHE_SHIFT         5
-
-/* Valid and Dirty bits */
-#define SH_CACHE_VALID         (1LL<<0)
-#define SH_CACHE_UPDATED       (1LL<<57)
-
-/* Unimplemented compat bits.. */
-#define SH_CACHE_COMBINED      0
-#define SH_CACHE_ASSOC         0
-
-/* Cache flags */
-#define SH_CACHE_MODE_WT       (1LL<<0)
-#define SH_CACHE_MODE_WB       (1LL<<1)
-
-/*
- * Control Registers.
- */
-#define ICCR_BASE      0x01600000      /* Instruction Cache Control Register */
-#define ICCR_REG0      0               /* Register 0 offset */
-#define ICCR_REG1      1               /* Register 1 offset */
-#define ICCR0          ICCR_BASE+ICCR_REG0
-#define ICCR1          ICCR_BASE+ICCR_REG1
-
-#define ICCR0_OFF      0x0             /* Set ICACHE off */
-#define ICCR0_ON       0x1             /* Set ICACHE on */
-#define ICCR0_ICI      0x2             /* Invalidate all in IC */
-
-#define ICCR1_NOLOCK   0x0             /* Set No Locking */
-
-#define OCCR_BASE      0x01E00000      /* Operand Cache Control Register */
-#define OCCR_REG0      0               /* Register 0 offset */
-#define OCCR_REG1      1               /* Register 1 offset */
-#define OCCR0          OCCR_BASE+OCCR_REG0
-#define OCCR1          OCCR_BASE+OCCR_REG1
-
-#define OCCR0_OFF      0x0             /* Set OCACHE off */
-#define OCCR0_ON       0x1             /* Set OCACHE on */
-#define OCCR0_OCI      0x2             /* Invalidate all in OC */
-#define OCCR0_WT       0x4             /* Set OCACHE in WT Mode */
-#define OCCR0_WB       0x0             /* Set OCACHE in WB Mode */
-
-#define OCCR1_NOLOCK   0x0             /* Set No Locking */
-
-/*
- * SH-5
- * A bit of description here, for neff=32.
- *
- *                               |<--- tag  (19 bits) --->|
- * +-----------------------------+-----------------+------+----------+------+
- * |                             |                 | ways |set index |offset|
- * +-----------------------------+-----------------+------+----------+------+
- *                                ^                 2 bits   8 bits   5 bits
- *                                +- Bit 31
- *
- * Cacheline size is based on offset: 5 bits = 32 bytes per line
- * A cache line is identified by a tag + set but OCACHETAG/ICACHETAG
- * have a broader space for registers. These are outlined by
- * CACHE_?C_*_STEP below.
- *
- */
-
-/* Instruction cache */
-#define CACHE_IC_ADDRESS_ARRAY 0x01000000
-
-/* Operand Cache */
-#define CACHE_OC_ADDRESS_ARRAY 0x01800000
-
-/* These declarations relate to cache 'synonyms' in the operand cache.  A
-   'synonym' occurs where effective address bits overlap between those used for
-   indexing the cache sets and those passed to the MMU for translation.  In the
-   case of SH5-101 & SH5-103, only bit 12 is affected for 4k pages. */
-
-#define CACHE_OC_N_SYNBITS  1               /* Number of synonym bits */
-#define CACHE_OC_SYN_SHIFT  12
-/* Mask to select synonym bit(s) */
-#define CACHE_OC_SYN_MASK   (((1UL<<CACHE_OC_N_SYNBITS)-1)<<CACHE_OC_SYN_SHIFT)
-
-/*
- * Instruction cache can't be invalidated based on physical addresses.
- * No Instruction Cache defines required, then.
- */
-
-#endif /* __ASM_SH_CPU_SH5_CACHE_H */
diff --git a/include/asm-sh/cpu-sh5/cacheflush.h b/include/asm-sh/cpu-sh5/cacheflush.h
deleted file mode 100644 (file)
index 5a11f0b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_CACHEFLUSH_H
-#define __ASM_SH_CPU_SH5_CACHEFLUSH_H
-
-#ifndef __ASSEMBLY__
-
-struct vm_area_struct;
-struct page;
-struct mm_struct;
-
-extern void flush_cache_all(void);
-extern void flush_cache_mm(struct mm_struct *mm);
-extern void flush_cache_sigtramp(unsigned long vaddr);
-extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
-                             unsigned long end);
-extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);
-extern void flush_dcache_page(struct page *pg);
-extern void flush_icache_range(unsigned long start, unsigned long end);
-extern void flush_icache_user_range(struct vm_area_struct *vma,
-                                   struct page *page, unsigned long addr,
-                                   int len);
-
-#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
-
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-
-#define flush_icache_page(vma, page)   do { } while (0)
-void p3_cache_init(void);
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_SH_CPU_SH5_CACHEFLUSH_H */
-
diff --git a/include/asm-sh/cpu-sh5/dma.h b/include/asm-sh/cpu-sh5/dma.h
deleted file mode 100644 (file)
index 7bf6bb3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_DMA_H
-#define __ASM_SH_CPU_SH5_DMA_H
-
-/* Nothing yet */
-
-#endif /* __ASM_SH_CPU_SH5_DMA_H */
diff --git a/include/asm-sh/cpu-sh5/irq.h b/include/asm-sh/cpu-sh5/irq.h
deleted file mode 100644 (file)
index f0f0756..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_IRQ_H
-#define __ASM_SH_CPU_SH5_IRQ_H
-
-/*
- * include/asm-sh/cpu-sh5/irq.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- *
- * 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.
- */
-
-
-/*
- * Encoded IRQs are not considered worth to be supported.
- * Main reason is that there's no per-encoded-interrupt
- * enable/disable mechanism (as there was in SH3/4).
- * An all enabled/all disabled is worth only if there's
- * a cascaded IC to disable/enable/ack on. Until such
- * IC is available there's no such support.
- *
- * Presumably Encoded IRQs may use extra IRQs beyond 64,
- * below. Some logic must be added to cope with IRQ_IRL?
- * in an exclusive way.
- *
- * Priorities are set at Platform level, when IRQ_IRL0-3
- * are set to 0 Encoding is allowed. Otherwise it's not
- * allowed.
- */
-
-/* Independent IRQs */
-#define IRQ_IRL0       0
-#define IRQ_IRL1       1
-#define IRQ_IRL2       2
-#define IRQ_IRL3       3
-
-#define IRQ_INTA       4
-#define IRQ_INTB       5
-#define IRQ_INTC       6
-#define IRQ_INTD       7
-
-#define IRQ_SERR       12
-#define IRQ_ERR                13
-#define IRQ_PWR3       14
-#define IRQ_PWR2       15
-#define IRQ_PWR1       16
-#define IRQ_PWR0       17
-
-#define IRQ_DMTE0      18
-#define IRQ_DMTE1      19
-#define IRQ_DMTE2      20
-#define IRQ_DMTE3      21
-#define IRQ_DAERR      22
-
-#define IRQ_TUNI0      32
-#define IRQ_TUNI1      33
-#define IRQ_TUNI2      34
-#define IRQ_TICPI2     35
-
-#define IRQ_ATI                36
-#define IRQ_PRI                37
-#define IRQ_CUI                38
-
-#define IRQ_ERI                39
-#define IRQ_RXI                40
-#define IRQ_BRI                41
-#define IRQ_TXI                42
-
-#define IRQ_ITI                63
-
-#define NR_INTC_IRQS   64
-
-#ifdef CONFIG_SH_CAYMAN
-#define NR_EXT_IRQS     32
-#define START_EXT_IRQS  64
-
-/* PCI bus 2 uses encoded external interrupts on the Cayman board */
-#define IRQ_P2INTA      (START_EXT_IRQS + (3*8) + 0)
-#define IRQ_P2INTB      (START_EXT_IRQS + (3*8) + 1)
-#define IRQ_P2INTC      (START_EXT_IRQS + (3*8) + 2)
-#define IRQ_P2INTD      (START_EXT_IRQS + (3*8) + 3)
-
-#define I8042_KBD_IRQ  (START_EXT_IRQS + 2)
-#define I8042_AUX_IRQ  (START_EXT_IRQS + 6)
-
-#define IRQ_CFCARD     (START_EXT_IRQS + 7)
-#define IRQ_PCMCIA     (0)
-
-#else
-#define NR_EXT_IRQS    0
-#endif
-
-/* Default IRQs, fixed */
-#define TIMER_IRQ      IRQ_TUNI0
-#define RTC_IRQ                IRQ_CUI
-
-/* Default Priorities, Platform may choose differently */
-#define        NO_PRIORITY     0       /* Disabled */
-#define TIMER_PRIORITY 2
-#define RTC_PRIORITY   TIMER_PRIORITY
-#define SCIF_PRIORITY  3
-#define INTD_PRIORITY  3
-#define        IRL3_PRIORITY   4
-#define INTC_PRIORITY  6
-#define        IRL2_PRIORITY   7
-#define INTB_PRIORITY  9
-#define        IRL1_PRIORITY   10
-#define INTA_PRIORITY  12
-#define        IRL0_PRIORITY   13
-#define TOP_PRIORITY   15
-
-extern int intc_evt_to_irq[(0xE20/0x20)+1];
-int intc_irq_describe(char* p, int irq);
-extern int platform_int_priority[NR_INTC_IRQS];
-
-#endif /* __ASM_SH_CPU_SH5_IRQ_H */
diff --git a/include/asm-sh/cpu-sh5/mmu_context.h b/include/asm-sh/cpu-sh5/mmu_context.h
deleted file mode 100644 (file)
index 68a1d2c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_MMU_CONTEXT_H
-#define __ASM_SH_CPU_SH5_MMU_CONTEXT_H
-
-/* Common defines */
-#define TLB_STEP       0x00000010
-#define TLB_PTEH       0x00000000
-#define TLB_PTEL       0x00000008
-
-/* PTEH defines */
-#define PTEH_ASID_SHIFT        2
-#define PTEH_VALID     0x0000000000000001
-#define PTEH_SHARED    0x0000000000000002
-#define PTEH_MATCH_ASID        0x00000000000003ff
-
-#ifndef __ASSEMBLY__
-/* This has to be a common function because the next location to fill
- * information is shared. */
-extern void __do_tlb_refill(unsigned long address, unsigned long long is_text_not_data, pte_t *pte);
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_SH_CPU_SH5_MMU_CONTEXT_H */
diff --git a/include/asm-sh/cpu-sh5/registers.h b/include/asm-sh/cpu-sh5/registers.h
deleted file mode 100644 (file)
index 6664ea6..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_REGISTERS_H
-#define __ASM_SH_CPU_SH5_REGISTERS_H
-
-/*
- * include/asm-sh/cpu-sh5/registers.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2004  Richard Curnow
- *
- * 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.
- */
-
-#ifdef __ASSEMBLY__
-/* =====================================================================
-**
-** Section 1: acts on assembly sources pre-processed by GPP ( <source.S>).
-**           Assigns symbolic names to control & target registers.
-*/
-
-/*
- * Define some useful aliases for control registers.
- */
-#define SR     cr0
-#define SSR    cr1
-#define PSSR   cr2
-                       /* cr3 UNDEFINED */
-#define INTEVT cr4
-#define EXPEVT cr5
-#define PEXPEVT        cr6
-#define TRA    cr7
-#define SPC    cr8
-#define PSPC   cr9
-#define RESVEC cr10
-#define VBR    cr11
-                       /* cr12 UNDEFINED */
-#define TEA    cr13
-                       /* cr14-cr15 UNDEFINED */
-#define DCR    cr16
-#define KCR0   cr17
-#define KCR1   cr18
-                       /* cr19-cr31 UNDEFINED */
-                       /* cr32-cr61 RESERVED */
-#define CTC    cr62
-#define USR    cr63
-
-/*
- * ABI dependent registers (general purpose set)
- */
-#define RET    r2
-#define ARG1   r2
-#define ARG2   r3
-#define ARG3   r4
-#define ARG4   r5
-#define ARG5   r6
-#define ARG6   r7
-#define SP     r15
-#define LINK   r18
-#define ZERO   r63
-
-/*
- * Status register defines: used only by assembly sources (and
- *                         syntax independednt)
- */
-#define SR_RESET_VAL   0x0000000050008000
-#define SR_HARMLESS    0x00000000500080f0      /* Write ignores for most */
-#define SR_ENABLE_FPU  0xffffffffffff7fff      /* AND with this */
-
-#if defined (CONFIG_SH64_SR_WATCH)
-#define SR_ENABLE_MMU  0x0000000084000000      /* OR with this */
-#else
-#define SR_ENABLE_MMU  0x0000000080000000      /* OR with this */
-#endif
-
-#define SR_UNBLOCK_EXC 0xffffffffefffffff      /* AND with this */
-#define SR_BLOCK_EXC   0x0000000010000000      /* OR with this */
-
-#else  /* Not __ASSEMBLY__ syntax */
-
-/*
-** Stringify reg. name
-*/
-#define __str(x)  #x
-
-/* Stringify control register names for use in inline assembly */
-#define __SR __str(SR)
-#define __SSR __str(SSR)
-#define __PSSR __str(PSSR)
-#define __INTEVT __str(INTEVT)
-#define __EXPEVT __str(EXPEVT)
-#define __PEXPEVT __str(PEXPEVT)
-#define __TRA __str(TRA)
-#define __SPC __str(SPC)
-#define __PSPC __str(PSPC)
-#define __RESVEC __str(RESVEC)
-#define __VBR __str(VBR)
-#define __TEA __str(TEA)
-#define __DCR __str(DCR)
-#define __KCR0 __str(KCR0)
-#define __KCR1 __str(KCR1)
-#define __CTC __str(CTC)
-#define __USR __str(USR)
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_CPU_SH5_REGISTERS_H */
diff --git a/include/asm-sh/cpu-sh5/rtc.h b/include/asm-sh/cpu-sh5/rtc.h
deleted file mode 100644 (file)
index 12ea0ed..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_RTC_H
-#define __ASM_SH_CPU_SH5_RTC_H
-
-#define rtc_reg_size           sizeof(u32)
-#define RTC_BIT_INVERTED       0       /* The SH-5 RTC is surprisingly sane! */
-#define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
-
-#endif /* __ASM_SH_CPU_SH5_RTC_H */
diff --git a/include/asm-sh/cpu-sh5/timer.h b/include/asm-sh/cpu-sh5/timer.h
deleted file mode 100644 (file)
index 88da9b3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASM_SH_CPU_SH5_TIMER_H
-#define __ASM_SH_CPU_SH5_TIMER_H
-
-#endif /* __ASM_SH_CPU_SH5_TIMER_H */
diff --git a/include/asm-sh/cputime.h b/include/asm-sh/cputime.h
deleted file mode 100644 (file)
index 6ca395d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __SH_CPUTIME_H
-#define __SH_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* __SH_CPUTIME_H */
diff --git a/include/asm-sh/current.h b/include/asm-sh/current.h
deleted file mode 100644 (file)
index 62b6388..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SH_CURRENT_H
-#define __ASM_SH_CURRENT_H
-
-/*
- * Copyright (C) 1999 Niibe Yutaka
- *
- */
-
-#include <linux/thread_info.h>
-
-struct task_struct;
-
-static __inline__ struct task_struct * get_current(void)
-{
-       return current_thread_info()->task;
-}
-
-#define current get_current()
-
-#endif /* __ASM_SH_CURRENT_H */
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
deleted file mode 100644 (file)
index 4b16bf9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __ASM_SH_DELAY_H
-#define __ASM_SH_DELAY_H
-
-/*
- * Copyright (C) 1993 Linus Torvalds
- *
- * Delay routines calling functions in arch/sh/lib/delay.c
- */
-
-extern void __bad_udelay(void);
-extern void __bad_ndelay(void);
-
-extern void __udelay(unsigned long usecs);
-extern void __ndelay(unsigned long nsecs);
-extern void __const_udelay(unsigned long xloops);
-extern void __delay(unsigned long loops);
-
-#define udelay(n) (__builtin_constant_p(n) ? \
-       ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
-       __udelay(n))
-
-#define ndelay(n) (__builtin_constant_p(n) ? \
-       ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
-       __ndelay(n))
-
-#endif /* __ASM_SH_DELAY_H */
diff --git a/include/asm-sh/device.h b/include/asm-sh/device.h
deleted file mode 100644 (file)
index efd511d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#include <asm-generic/device.h>
-
-struct platform_device;
-/* allocate contiguous memory chunk and fill in struct resource */
-int platform_resource_setup_memory(struct platform_device *pdev,
-                                  char *name, unsigned long memsize);
-
diff --git a/include/asm-sh/div64.h b/include/asm-sh/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-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
deleted file mode 100644 (file)
index 627315e..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-#ifndef __ASM_SH_DMA_MAPPING_H
-#define __ASM_SH_DMA_MAPPING_H
-
-#include <linux/mm.h>
-#include <linux/scatterlist.h>
-#include <asm/cacheflush.h>
-#include <asm/io.h>
-#include <asm-generic/dma-coherent.h>
-
-extern struct bus_type pci_bus_type;
-
-#define dma_supported(dev, mask)       (1)
-
-static inline int dma_set_mask(struct device *dev, u64 mask)
-{
-       if (!dev->dma_mask || !dma_supported(dev, mask))
-               return -EIO;
-
-       *dev->dma_mask = mask;
-
-       return 0;
-}
-
-void *dma_alloc_coherent(struct device *dev, size_t size,
-                        dma_addr_t *dma_handle, gfp_t flag);
-
-void dma_free_coherent(struct device *dev, size_t size,
-                      void *vaddr, dma_addr_t dma_handle);
-
-void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
-                   enum dma_data_direction dir);
-
-#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)
-
-static inline dma_addr_t dma_map_single(struct device *dev,
-                                       void *ptr, size_t size,
-                                       enum dma_data_direction dir)
-{
-#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-       if (dev->bus == &pci_bus_type)
-               return virt_to_phys(ptr);
-#endif
-       dma_cache_sync(dev, ptr, size, dir);
-
-       return virt_to_phys(ptr);
-}
-
-#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
-
-static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
-                            int nents, enum dma_data_direction dir)
-{
-       int i;
-
-       for (i = 0; i < nents; i++) {
-#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-               dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
-#endif
-               sg[i].dma_address = sg_phys(&sg[i]);
-       }
-
-       return nents;
-}
-
-#define dma_unmap_sg(dev, sg, nents, dir)      do { } while (0)
-
-static inline dma_addr_t 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, dir);
-}
-
-static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
-                                 size_t size, enum dma_data_direction dir)
-{
-       dma_unmap_single(dev, dma_address, size, dir);
-}
-
-static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
-                                  size_t size, enum dma_data_direction dir)
-{
-#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-       if (dev->bus == &pci_bus_type)
-               return;
-#endif
-       dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir);
-}
-
-static inline void dma_sync_single_range(struct device *dev,
-                                        dma_addr_t dma_handle,
-                                        unsigned long offset, size_t size,
-                                        enum dma_data_direction dir)
-{
-#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-       if (dev->bus == &pci_bus_type)
-               return;
-#endif
-       dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
-}
-
-static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
-                              int nelems, enum dma_data_direction dir)
-{
-       int i;
-
-       for (i = 0; i < nelems; i++) {
-#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-               dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
-#endif
-               sg[i].dma_address = sg_phys(&sg[i]);
-       }
-}
-
-static inline void dma_sync_single_for_cpu(struct device *dev,
-                                          dma_addr_t dma_handle, size_t size,
-                                          enum dma_data_direction dir)
-{
-       dma_sync_single(dev, dma_handle, size, dir);
-}
-
-static inline void dma_sync_single_for_device(struct device *dev,
-                                             dma_addr_t dma_handle,
-                                             size_t size,
-                                             enum dma_data_direction dir)
-{
-       dma_sync_single(dev, dma_handle, size, dir);
-}
-
-static inline void dma_sync_single_range_for_cpu(struct device *dev,
-                                                dma_addr_t dma_handle,
-                                                unsigned long offset,
-                                                size_t size,
-                                                enum dma_data_direction direction)
-{
-       dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
-}
-
-static inline void dma_sync_single_range_for_device(struct device *dev,
-                                                   dma_addr_t dma_handle,
-                                                   unsigned long offset,
-                                                   size_t size,
-                                                   enum dma_data_direction direction)
-{
-       dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
-}
-
-
-static inline void dma_sync_sg_for_cpu(struct device *dev,
-                                      struct scatterlist *sg, int nelems,
-                                      enum dma_data_direction dir)
-{
-       dma_sync_sg(dev, sg, nelems, dir);
-}
-
-static inline void dma_sync_sg_for_device(struct device *dev,
-                                         struct scatterlist *sg, int nelems,
-                                         enum dma_data_direction dir)
-{
-       dma_sync_sg(dev, sg, nelems, dir);
-}
-
-
-static inline int dma_get_cache_alignment(void)
-{
-       /*
-        * Each processor family will define its own L1_CACHE_SHIFT,
-        * L1_CACHE_BYTES wraps to this, so this is always safe.
-        */
-       return L1_CACHE_BYTES;
-}
-
-static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-{
-       return dma_addr == 0;
-}
-
-#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
-
-extern int
-dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
-                           dma_addr_t device_addr, size_t size, int flags);
-
-extern void
-dma_release_declared_memory(struct device *dev);
-
-extern void *
-dma_mark_declared_memory_occupied(struct device *dev,
-                                 dma_addr_t device_addr, size_t size);
-
-#endif /* __ASM_SH_DMA_MAPPING_H */
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
deleted file mode 100644 (file)
index a65b02f..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * include/asm-sh/dma.h
- *
- * Copyright (C) 2003, 2004  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_DMA_H
-#define __ASM_SH_DMA_H
-#ifdef __KERNEL__
-
-#include <linux/spinlock.h>
-#include <linux/wait.h>
-#include <linux/sched.h>
-#include <linux/sysdev.h>
-#include <asm/cpu/dma.h>
-
-/* The maximum address that we can perform a DMA transfer to on this platform */
-/* Don't define MAX_DMA_ADDRESS; it's useless on the SuperH and any
-   occurrence should be flagged as an error.  */
-/* But... */
-/* XXX: This is not applicable to SuperH, just needed for alloc_bootmem */
-#define MAX_DMA_ADDRESS                (PAGE_OFFSET+0x10000000)
-
-#ifdef CONFIG_NR_DMA_CHANNELS
-#  define MAX_DMA_CHANNELS     (CONFIG_NR_DMA_CHANNELS)
-#else
-#  define MAX_DMA_CHANNELS     (CONFIG_NR_ONCHIP_DMA_CHANNELS)
-#endif
-
-/*
- * Read and write modes can mean drastically different things depending on the
- * channel configuration. Consult your DMAC documentation and module
- * implementation for further clues.
- */
-#define DMA_MODE_READ          0x00
-#define DMA_MODE_WRITE         0x01
-#define DMA_MODE_MASK          0x01
-
-#define DMA_AUTOINIT           0x10
-
-/*
- * DMAC (dma_info) flags
- */
-enum {
-       DMAC_CHANNELS_CONFIGURED        = 0x01,
-       DMAC_CHANNELS_TEI_CAPABLE       = 0x02, /* Transfer end interrupt */
-};
-
-/*
- * DMA channel capabilities / flags
- */
-enum {
-       DMA_CONFIGURED                  = 0x01,
-
-       /*
-        * Transfer end interrupt, inherited from DMAC.
-        * wait_queue used in dma_wait_for_completion.
-        */
-       DMA_TEI_CAPABLE                 = 0x02,
-};
-
-extern spinlock_t dma_spin_lock;
-
-struct dma_channel;
-
-struct dma_ops {
-       int (*request)(struct dma_channel *chan);
-       void (*free)(struct dma_channel *chan);
-
-       int (*get_residue)(struct dma_channel *chan);
-       int (*xfer)(struct dma_channel *chan);
-       int (*configure)(struct dma_channel *chan, unsigned long flags);
-       int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
-};
-
-struct dma_channel {
-       char dev_id[16];                /* unique name per DMAC of channel */
-
-       unsigned int chan;              /* DMAC channel number */
-       unsigned int vchan;             /* Virtual channel number */
-
-       unsigned int mode;
-       unsigned int count;
-
-       unsigned long sar;
-       unsigned long dar;
-
-       const char **caps;
-
-       unsigned long flags;
-       atomic_t busy;
-
-       wait_queue_head_t wait_queue;
-
-       struct sys_device dev;
-       void *priv_data;
-};
-
-struct dma_info {
-       struct platform_device *pdev;
-
-       const char *name;
-       unsigned int nr_channels;
-       unsigned long flags;
-
-       struct dma_ops *ops;
-       struct dma_channel *channels;
-
-       struct list_head list;
-       int first_channel_nr;
-       int first_vchannel_nr;
-};
-
-struct dma_chan_caps {
-       int ch_num;
-       const char **caplist;
-};
-
-#define to_dma_channel(channel) container_of(channel, struct dma_channel, dev)
-
-/* arch/sh/drivers/dma/dma-api.c */
-extern int dma_xfer(unsigned int chan, unsigned long from,
-                   unsigned long to, size_t size, unsigned int mode);
-
-#define dma_write(chan, from, to, size)        \
-       dma_xfer(chan, from, to, size, DMA_MODE_WRITE)
-#define dma_write_page(chan, from, to) \
-       dma_write(chan, from, to, PAGE_SIZE)
-
-#define dma_read(chan, from, to, size) \
-       dma_xfer(chan, from, to, size, DMA_MODE_READ)
-#define dma_read_page(chan, from, to)  \
-       dma_read(chan, from, to, PAGE_SIZE)
-
-extern int request_dma_bycap(const char **dmac, const char **caps,
-                            const char *dev_id);
-extern int request_dma(unsigned int chan, const char *dev_id);
-extern void free_dma(unsigned int chan);
-extern int get_dma_residue(unsigned int chan);
-extern struct dma_info *get_dma_info(unsigned int chan);
-extern struct dma_channel *get_dma_channel(unsigned int chan);
-extern void dma_wait_for_completion(unsigned int chan);
-extern void dma_configure_channel(unsigned int chan, unsigned long flags);
-
-extern int register_dmac(struct dma_info *info);
-extern void unregister_dmac(struct dma_info *info);
-extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
-
-extern int dma_extend(unsigned int chan, unsigned long op, void *param);
-extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
-
-/* arch/sh/drivers/dma/dma-sysfs.c */
-extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);
-extern void dma_remove_sysfs_files(struct dma_channel *, struct dma_info *);
-
-#ifdef CONFIG_PCI
-extern int isa_dma_bridge_buggy;
-#else
-#define isa_dma_bridge_buggy   (0)
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_DMA_H */
diff --git a/include/asm-sh/dmabrg.h b/include/asm-sh/dmabrg.h
deleted file mode 100644 (file)
index c5edba2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SH7760 DMABRG (USB/Audio) support
- */
-
-#ifndef _DMABRG_H_
-#define _DMABRG_H_
-
-/* IRQ sources */
-#define DMABRGIRQ_USBDMA       0
-#define DMABRGIRQ_USBDMAERR    1
-#define DMABRGIRQ_A0TXF                2
-#define DMABRGIRQ_A0TXH                3
-#define DMABRGIRQ_A0RXF                4
-#define DMABRGIRQ_A0RXH                5
-#define DMABRGIRQ_A1TXF                6
-#define DMABRGIRQ_A1TXH                7
-#define DMABRGIRQ_A1RXF                8
-#define DMABRGIRQ_A1RXH                9
-
-extern int dmabrg_request_irq(unsigned int, void(*)(void *), void *);
-extern void dmabrg_free_irq(unsigned int);
-
-#endif
diff --git a/include/asm-sh/dreamcast/dma.h b/include/asm-sh/dreamcast/dma.h
deleted file mode 100644 (file)
index ddd68e7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * include/asm-sh/dreamcast/dma.h
- *
- * Copyright (C) 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_DREAMCAST_DMA_H
-#define __ASM_SH_DREAMCAST_DMA_H
-
-/* Number of DMA channels */
-#define ONCHIP_NR_DMA_CHANNELS 4
-#define G2_NR_DMA_CHANNELS     4
-#define PVR2_NR_DMA_CHANNELS   1
-
-/* Channels for cascading */
-#define PVR2_CASCADE_CHAN      2
-#define G2_CASCADE_CHAN                3
-
-/* PVR2 DMA Registers */
-#define PVR2_DMA_BASE          0xa05f6800
-#define PVR2_DMA_ADDR          (PVR2_DMA_BASE + 0)
-#define PVR2_DMA_COUNT         (PVR2_DMA_BASE + 4)
-#define PVR2_DMA_MODE          (PVR2_DMA_BASE + 8)
-#define PVR2_DMA_LMMODE0       (PVR2_DMA_BASE + 132)
-#define PVR2_DMA_LMMODE1       (PVR2_DMA_BASE + 136)
-
-/* G2 DMA Register */
-#define G2_DMA_BASE            0xa05f7800
-
-#endif /* __ASM_SH_DREAMCAST_DMA_H */
-
diff --git a/include/asm-sh/dreamcast/maple.h b/include/asm-sh/dreamcast/maple.h
deleted file mode 100644 (file)
index 51f6a87..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __ASM_MAPLE_H
-#define __ASM_MAPLE_H
-
-#define MAPLE_PORTS 4
-#define MAPLE_PNP_INTERVAL HZ
-#define MAPLE_MAXPACKETS 8
-#define MAPLE_DMA_ORDER 14
-#define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER)
-#define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \
-                         MAPLE_DMA_ORDER - PAGE_SHIFT : 0)
-
-/* Maple Bus registers */
-#define MAPLE_BASE     0xa05f6c00
-#define MAPLE_DMAADDR  (MAPLE_BASE+0x04)
-#define MAPLE_TRIGTYPE (MAPLE_BASE+0x10)
-#define MAPLE_ENABLE   (MAPLE_BASE+0x14)
-#define MAPLE_STATE    (MAPLE_BASE+0x18)
-#define MAPLE_SPEED    (MAPLE_BASE+0x80)
-#define MAPLE_RESET    (MAPLE_BASE+0x8c)
-
-#define MAPLE_MAGIC    0x6155404f
-#define MAPLE_2MBPS    0
-#define MAPLE_TIMEOUT(n) ((n)<<15)
-
-/* Function codes */
-#define MAPLE_FUNC_CONTROLLER 0x001
-#define MAPLE_FUNC_MEMCARD    0x002
-#define MAPLE_FUNC_LCD        0x004
-#define MAPLE_FUNC_CLOCK      0x008
-#define MAPLE_FUNC_MICROPHONE 0x010
-#define MAPLE_FUNC_ARGUN      0x020
-#define MAPLE_FUNC_KEYBOARD   0x040
-#define MAPLE_FUNC_LIGHTGUN   0x080
-#define MAPLE_FUNC_PURUPURU   0x100
-#define MAPLE_FUNC_MOUSE      0x200
-
-#endif /* __ASM_MAPLE_H */
diff --git a/include/asm-sh/dreamcast/pci.h b/include/asm-sh/dreamcast/pci.h
deleted file mode 100644 (file)
index e401b24..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * include/asm-sh/dreamcast/pci.h
- *
- * Copyright (C) 2001, 2002  M. R. Brown
- * Copyright (C) 2002, 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_DREAMCAST_PCI_H
-#define __ASM_SH_DREAMCAST_PCI_H
-
-#include <asm/mach/sysasic.h>
-
-#define        GAPSPCI_REGS            0x01001400
-#define GAPSPCI_DMA_BASE       0x01840000
-#define GAPSPCI_DMA_SIZE       32768
-#define GAPSPCI_BBA_CONFIG     0x01001600
-#define GAPSPCI_BBA_CONFIG_SIZE        0x2000
-
-#define        GAPSPCI_IRQ             HW_EVENT_EXTERNAL
-
-#endif /* __ASM_SH_DREAMCAST_PCI_H */
-
diff --git a/include/asm-sh/dreamcast/sysasic.h b/include/asm-sh/dreamcast/sysasic.h
deleted file mode 100644 (file)
index f334266..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* include/asm-sh/dreamcast/sysasic.h
- *
- * Definitions for the Dreamcast System ASIC and related peripherals.
- *
- * Copyright (c) 2001 M. R. Brown <mrbrown@linuxdc.org>
- * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- */
-#ifndef __ASM_SH_DREAMCAST_SYSASIC_H
-#define __ASM_SH_DREAMCAST_SYSASIC_H
-
-#include <asm/irq.h>
-
-/* Hardware events -
-
-   Each of these events correspond to a bit within the Event Mask Registers/
-   Event Status Registers.  Because of the virtual IRQ numbering scheme, a
-   base offset must be used when calculating the virtual IRQ that each event
-   takes.
-*/
-
-#define HW_EVENT_IRQ_BASE  48
-
-/* IRQ 13 */
-#define HW_EVENT_VSYNC     (HW_EVENT_IRQ_BASE +  5) /* VSync */
-#define HW_EVENT_MAPLE_DMA (HW_EVENT_IRQ_BASE + 12) /* Maple DMA complete */
-#define HW_EVENT_GDROM_DMA (HW_EVENT_IRQ_BASE + 14) /* GD-ROM DMA complete */
-#define HW_EVENT_G2_DMA    (HW_EVENT_IRQ_BASE + 15) /* G2 DMA complete */
-#define HW_EVENT_PVR2_DMA  (HW_EVENT_IRQ_BASE + 19) /* PVR2 DMA complete */
-
-/* IRQ 11 */
-#define HW_EVENT_GDROM_CMD (HW_EVENT_IRQ_BASE + 32) /* GD-ROM cmd. complete */
-#define HW_EVENT_AICA_SYS  (HW_EVENT_IRQ_BASE + 33) /* AICA-related */
-#define HW_EVENT_EXTERNAL  (HW_EVENT_IRQ_BASE + 35) /* Ext. (expansion) */
-
-#define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95)
-
-#endif /* __ASM_SH_DREAMCAST_SYSASIC_H */
-
diff --git a/include/asm-sh/edosk7705.h b/include/asm-sh/edosk7705.h
deleted file mode 100644 (file)
index 5bdc9d9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * include/asm-sh/edosk7705.h
- *
- * Modified version of io_se.h for the EDOSK7705 specific functions.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an Hitachi EDOSK7705 development board
- */
-
-#ifndef __ASM_SH_EDOSK7705_IO_H
-#define __ASM_SH_EDOSK7705_IO_H
-
-#include <asm/io_generic.h>
-
-extern unsigned char sh_edosk7705_inb(unsigned long port);
-extern unsigned int sh_edosk7705_inl(unsigned long port);
-
-extern void sh_edosk7705_outb(unsigned char value, unsigned long port);
-extern void sh_edosk7705_outl(unsigned int value, unsigned long port);
-
-extern void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned long sh_edosk7705_isa_port2addr(unsigned long offset);
-
-#endif /* __ASM_SH_EDOSK7705_IO_H */
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h
deleted file mode 100644 (file)
index f01449a..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-#ifndef __ASM_SH_ELF_H
-#define __ASM_SH_ELF_H
-
-#include <linux/utsname.h>
-#include <asm/auxvec.h>
-#include <asm/ptrace.h>
-#include <asm/user.h>
-
-/* ELF header e_flags defines */
-#define EF_SH_PIC              0x100   /* -fpic */
-#define EF_SH_FDPIC            0x8000  /* -mfdpic */
-
-/* SH (particularly SHcompact) relocation types  */
-#define        R_SH_NONE               0
-#define        R_SH_DIR32              1
-#define        R_SH_REL32              2
-#define        R_SH_DIR8WPN            3
-#define        R_SH_IND12W             4
-#define        R_SH_DIR8WPL            5
-#define        R_SH_DIR8WPZ            6
-#define        R_SH_DIR8BP             7
-#define        R_SH_DIR8W              8
-#define        R_SH_DIR8L              9
-#define        R_SH_SWITCH16           25
-#define        R_SH_SWITCH32           26
-#define        R_SH_USES               27
-#define        R_SH_COUNT              28
-#define        R_SH_ALIGN              29
-#define        R_SH_CODE               30
-#define        R_SH_DATA               31
-#define        R_SH_LABEL              32
-#define        R_SH_SWITCH8            33
-#define        R_SH_GNU_VTINHERIT      34
-#define        R_SH_GNU_VTENTRY        35
-#define        R_SH_TLS_GD_32          144
-#define        R_SH_TLS_LD_32          145
-#define        R_SH_TLS_LDO_32         146
-#define        R_SH_TLS_IE_32          147
-#define        R_SH_TLS_LE_32          148
-#define        R_SH_TLS_DTPMOD32       149
-#define        R_SH_TLS_DTPOFF32       150
-#define        R_SH_TLS_TPOFF32        151
-#define        R_SH_GOT32              160
-#define        R_SH_PLT32              161
-#define        R_SH_COPY               162
-#define        R_SH_GLOB_DAT           163
-#define        R_SH_JMP_SLOT           164
-#define        R_SH_RELATIVE           165
-#define        R_SH_GOTOFF             166
-#define        R_SH_GOTPC              167
-
-/* FDPIC relocs */
-#define R_SH_GOT20             70
-#define R_SH_GOTOFF20          71
-#define R_SH_GOTFUNCDESC       72
-#define R_SH_GOTFUNCDESC20     73
-#define R_SH_GOTOFFFUNCDESC    74
-#define R_SH_GOTOFFFUNCDESC20  75
-#define R_SH_FUNCDESC          76
-#define R_SH_FUNCDESC_VALUE    77
-
-#if 0 /* XXX - later .. */
-#define R_SH_GOT20             198
-#define R_SH_GOTOFF20          199
-#define R_SH_GOTFUNCDESC       200
-#define R_SH_GOTFUNCDESC20     201
-#define R_SH_GOTOFFFUNCDESC    202
-#define R_SH_GOTOFFFUNCDESC20  203
-#define R_SH_FUNCDESC          204
-#define R_SH_FUNCDESC_VALUE    205
-#endif
-
-/* SHmedia relocs */
-#define R_SH_IMM_LOW16         246
-#define R_SH_IMM_LOW16_PCREL   247
-#define R_SH_IMM_MEDLOW16      248
-#define R_SH_IMM_MEDLOW16_PCREL        249
-/* Keep this the last entry.  */
-#define        R_SH_NUM                256
-
-/*
- * ELF register definitions..
- */
-
-typedef unsigned long elf_greg_t;
-
-#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-typedef struct user_fpu_struct elf_fpregset_t;
-
-/*
- * These are used to set parameters in the core dumps.
- */
-#define ELF_CLASS      ELFCLASS32
-#ifdef __LITTLE_ENDIAN__
-#define ELF_DATA       ELFDATA2LSB
-#else
-#define ELF_DATA       ELFDATA2MSB
-#endif
-#define ELF_ARCH       EM_SH
-
-#ifdef __KERNEL__
-/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x)              ((x)->e_machine == EM_SH)
-#define elf_check_fdpic(x)             ((x)->e_flags & EF_SH_FDPIC)
-#define elf_check_const_displacement(x)        ((x)->e_flags & EF_SH_PIC)
-
-#define USE_ELF_CORE_DUMP
-#define ELF_FDPIC_CORE_EFLAGS  EF_SH_FDPIC
-#define ELF_EXEC_PAGESIZE      PAGE_SIZE
-
-/* 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         (2 * TASK_SIZE / 3)
-
-#define ELF_CORE_COPY_REGS(_dest,_regs)                                \
-       memcpy((char *) &_dest, (char *) _regs,                 \
-              sizeof(struct pt_regs));
-
-/* This yields a mask that user programs can use to figure out what
-   instruction set this CPU supports.  This could be done in user space,
-   but it's not easy, and we've already done it here.  */
-
-#define ELF_HWCAP      (boot_cpu_data.flags)
-
-/* 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.
-
-   For the moment, we have only optimizations for the Intel generations,
-   but that could change... */
-
-#define ELF_PLATFORM   (utsname()->machine)
-
-#ifdef __SH5__
-#define ELF_PLAT_INIT(_r, load_addr) \
-  do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
-       _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
-       _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
-       _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; _r->regs[15]=0; \
-       _r->regs[16]=0; _r->regs[17]=0; _r->regs[18]=0; _r->regs[19]=0; \
-       _r->regs[20]=0; _r->regs[21]=0; _r->regs[22]=0; _r->regs[23]=0; \
-       _r->regs[24]=0; _r->regs[25]=0; _r->regs[26]=0; _r->regs[27]=0; \
-       _r->regs[28]=0; _r->regs[29]=0; _r->regs[30]=0; _r->regs[31]=0; \
-       _r->regs[32]=0; _r->regs[33]=0; _r->regs[34]=0; _r->regs[35]=0; \
-       _r->regs[36]=0; _r->regs[37]=0; _r->regs[38]=0; _r->regs[39]=0; \
-       _r->regs[40]=0; _r->regs[41]=0; _r->regs[42]=0; _r->regs[43]=0; \
-       _r->regs[44]=0; _r->regs[45]=0; _r->regs[46]=0; _r->regs[47]=0; \
-       _r->regs[48]=0; _r->regs[49]=0; _r->regs[50]=0; _r->regs[51]=0; \
-       _r->regs[52]=0; _r->regs[53]=0; _r->regs[54]=0; _r->regs[55]=0; \
-       _r->regs[56]=0; _r->regs[57]=0; _r->regs[58]=0; _r->regs[59]=0; \
-       _r->regs[60]=0; _r->regs[61]=0; _r->regs[62]=0; \
-       _r->tregs[0]=0; _r->tregs[1]=0; _r->tregs[2]=0; _r->tregs[3]=0; \
-       _r->tregs[4]=0; _r->tregs[5]=0; _r->tregs[6]=0; _r->tregs[7]=0; \
-       _r->sr = SR_FD | SR_MMU; } while (0)
-#else
-#define ELF_PLAT_INIT(_r, load_addr) \
-  do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
-       _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
-       _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
-       _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; \
-       _r->sr = SR_FD; } while (0)
-
-#define ELF_FDPIC_PLAT_INIT(_r, _exec_map_addr, _interp_map_addr,      \
-                           _dynamic_addr)                              \
-do {                                                                   \
-       _r->regs[0]     = 0;                                            \
-       _r->regs[1]     = 0;                                            \
-       _r->regs[2]     = 0;                                            \
-       _r->regs[3]     = 0;                                            \
-       _r->regs[4]     = 0;                                            \
-       _r->regs[5]     = 0;                                            \
-       _r->regs[6]     = 0;                                            \
-       _r->regs[7]     = 0;                                            \
-       _r->regs[8]     = _exec_map_addr;                               \
-       _r->regs[9]     = _interp_map_addr;                             \
-       _r->regs[10]    = _dynamic_addr;                                \
-       _r->regs[11]    = 0;                                            \
-       _r->regs[12]    = 0;                                            \
-       _r->regs[13]    = 0;                                            \
-       _r->regs[14]    = 0;                                            \
-       _r->sr          = SR_FD;                                        \
-} while (0)
-#endif
-
-#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT)
-struct task_struct;
-extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
-extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
-
-#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
-#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
-
-#ifdef CONFIG_VSYSCALL
-/* vDSO has arch_setup_additional_pages */
-#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
-struct linux_binprm;
-extern int arch_setup_additional_pages(struct linux_binprm *bprm,
-                                      int executable_stack);
-
-extern unsigned int vdso_enabled;
-extern void __kernel_vsyscall;
-
-#define VDSO_BASE              ((unsigned long)current->mm->context.vdso)
-#define VDSO_SYM(x)            (VDSO_BASE + (unsigned long)(x))
-
-#define VSYSCALL_AUX_ENT                                       \
-       if (vdso_enabled)                                       \
-               NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
-#else
-#define VSYSCALL_AUX_ENT
-#endif /* CONFIG_VSYSCALL */
-
-#ifdef CONFIG_SH_FPU
-#define FPU_AUX_ENT    NEW_AUX_ENT(AT_FPUCW, FPSCR_INIT)
-#else
-#define FPU_AUX_ENT
-#endif
-
-extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;
-
-/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
-#define ARCH_DLINFO                                            \
-do {                                                           \
-       /* Optional FPU initialization */                       \
-       FPU_AUX_ENT;                                            \
-                                                               \
-       /* Optional vsyscall entry */                           \
-       VSYSCALL_AUX_ENT;                                       \
-                                                               \
-       /* Cache desc */                                        \
-       NEW_AUX_ENT(AT_L1I_CACHESHAPE, l1i_cache_shape);        \
-       NEW_AUX_ENT(AT_L1D_CACHESHAPE, l1d_cache_shape);        \
-       NEW_AUX_ENT(AT_L2_CACHESHAPE, l2_cache_shape);          \
-} while (0)
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_ELF_H */
diff --git a/include/asm-sh/emergency-restart.h b/include/asm-sh/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-sh/entry-macros.S b/include/asm-sh/entry-macros.S
deleted file mode 100644 (file)
index 2dab0b8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-! entry.S macro define
-       
-       .macro  cli
-       stc     sr, r0
-       or      #0xf0, r0
-       ldc     r0, sr
-       .endm
-
-       .macro  sti
-       mov     #0xf0, r11
-       extu.b  r11, r11
-       not     r11, r11
-       stc     sr, r10
-       and     r11, r10
-#ifdef CONFIG_CPU_HAS_SR_RB
-       stc     k_g_imask, r11
-       or      r11, r10
-#endif
-       ldc     r10, sr
-       .endm
-
-       .macro  get_current_thread_info, ti, tmp
-#ifdef CONFIG_CPU_HAS_SR_RB
-       stc     r7_bank, \ti
-#else
-       mov     #((THREAD_SIZE - 1) >> 10) ^ 0xff, \tmp
-       shll8   \tmp
-       shll2   \tmp
-       mov     r15, \ti
-       and     \tmp, \ti
-#endif 
-       .endm
-
diff --git a/include/asm-sh/errno.h b/include/asm-sh/errno.h
deleted file mode 100644 (file)
index 51cf6f9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_ERRNO_H
-#define __ASM_SH_ERRNO_H
-
-#include <asm-generic/errno.h>
-
-#endif /* __ASM_SH_ERRNO_H */
diff --git a/include/asm-sh/fb.h b/include/asm-sh/fb.h
deleted file mode 100644 (file)
index d92e99c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
-
-#include <linux/fb.h>
-#include <linux/fs.h>
-#include <asm/page.h>
-
-static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
-                               unsigned long off)
-{
-       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
-}
-
-static inline int fb_is_primary_device(struct fb_info *info)
-{
-       return 0;
-}
-
-#endif /* _ASM_FB_H_ */
diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h
deleted file mode 100644 (file)
index 46ab12d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/fcntl.h>
diff --git a/include/asm-sh/fixmap.h b/include/asm-sh/fixmap.h
deleted file mode 100644 (file)
index 721fcc4..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * fixmap.h: compile-time virtual memory allocation
- *
- * 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) 1998 Ingo Molnar
- *
- * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
- */
-
-#ifndef _ASM_FIXMAP_H
-#define _ASM_FIXMAP_H
-
-#include <linux/kernel.h>
-#include <asm/page.h>
-#ifdef CONFIG_HIGHMEM
-#include <linux/threads.h>
-#include <asm/kmap_types.h>
-#endif
-
-/*
- * Here we define all the compile-time 'special' virtual
- * addresses. The point is to have a constant address at
- * compile time, but to set the physical address only
- * in the boot process. We allocate these special  addresses
- * from the end of P3 backwards.
- * Also this lets us do fail-safe vmalloc(), we
- * can guarantee that these special addresses and
- * vmalloc()-ed addresses never overlap.
- *
- * these 'compile-time allocated' memory buffers are
- * fixed-size 4k pages. (or larger if used with an increment
- * highger than 1) use fixmap_set(idx,phys) to associate
- * physical memory with fixmap indices.
- *
- * TLB entries of such buffers will not be flushed across
- * task switches.
- */
-
-/*
- * on UP currently we will have no trace of the fixmap mechanizm,
- * no page table allocations, etc. This might change in the
- * future, say framebuffers for the console driver(s) could be
- * fix-mapped?
- */
-enum fixed_addresses {
-#define FIX_N_COLOURS 16
-       FIX_CMAP_BEGIN,
-       FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
-       FIX_UNCACHED,
-#ifdef CONFIG_HIGHMEM
-       FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
-       FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
-#endif
-       __end_of_fixed_addresses
-};
-
-extern void __set_fixmap(enum fixed_addresses idx,
-                        unsigned long phys, pgprot_t flags);
-
-#define set_fixmap(idx, phys) \
-               __set_fixmap(idx, phys, PAGE_KERNEL)
-/*
- * Some hardware wants to get fixmapped without caching.
- */
-#define set_fixmap_nocache(idx, phys) \
-               __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
-/*
- * used by vmalloc.c.
- *
- * Leave one empty page between vmalloc'ed areas and
- * the start of the fixmap, and leave one page empty
- * at the top of mem..
- */
-#ifdef CONFIG_SUPERH32
-#define FIXADDR_TOP    (P4SEG - PAGE_SIZE)
-#else
-#define FIXADDR_TOP    (0xff000000 - PAGE_SIZE)
-#endif
-#define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
-#define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
-
-#define __fix_to_virt(x)       (FIXADDR_TOP - ((x) << PAGE_SHIFT))
-#define __virt_to_fix(x)       ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
-
-extern void __this_fixmap_does_not_exist(void);
-
-/*
- * 'index to address' translation. If anyone tries to use the idx
- * directly without tranlation, we catch the bug with a NULL-deference
- * kernel oops. Illegal ranges of incoming indices are caught too.
- */
-static inline unsigned long fix_to_virt(const unsigned int idx)
-{
-       /*
-        * this branch gets completely eliminated after inlining,
-        * except when someone tries to use fixaddr indices in an
-        * illegal way. (such as mixing up address types or using
-        * out-of-range indices).
-        *
-        * If it doesn't get removed, the linker will complain
-        * loudly with a reasonably clear error message..
-        */
-       if (idx >= __end_of_fixed_addresses)
-               __this_fixmap_does_not_exist();
-
-        return __fix_to_virt(idx);
-}
-
-static inline unsigned long virt_to_fix(const unsigned long vaddr)
-{
-       BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
-       return __virt_to_fix(vaddr);
-}
-#endif
diff --git a/include/asm-sh/flat.h b/include/asm-sh/flat.h
deleted file mode 100644 (file)
index 0cc8002..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * include/asm-sh/flat.h
- *
- * uClinux flat-format executables
- *
- * Copyright (C) 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_FLAT_H
-#define __ASM_SH_FLAT_H
-
-#define        flat_stack_align(sp)                    /* nothing needed */
-#define        flat_argvp_envp_on_stack()              0
-#define        flat_old_ram_flag(flags)                (flags)
-#define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
-#define        flat_get_addr_from_rp(rp, relval, flags, p)     get_unaligned(rp)
-#define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
-#define        flat_get_relocate_addr(rel)             (rel)
-#define        flat_set_persistent(relval, p)          ({ (void)p; 0; })
-
-#endif /* __ASM_SH_FLAT_H */
diff --git a/include/asm-sh/fpu.h b/include/asm-sh/fpu.h
deleted file mode 100644 (file)
index 91462fe..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef __ASM_SH_FPU_H
-#define __ASM_SH_FPU_H
-
-#ifndef __ASSEMBLY__
-#include <linux/preempt.h>
-#include <asm/ptrace.h>
-
-#ifdef CONFIG_SH_FPU
-static inline void release_fpu(struct pt_regs *regs)
-{
-       regs->sr |= SR_FD;
-}
-
-static inline void grab_fpu(struct pt_regs *regs)
-{
-       regs->sr &= ~SR_FD;
-}
-
-struct task_struct;
-
-extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
-#else
-
-#define release_fpu(regs)      do { } while (0)
-#define grab_fpu(regs)         do { } while (0)
-
-static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
-{
-       clear_tsk_thread_flag(tsk, TIF_USEDFPU);
-}
-#endif
-
-extern int do_fpu_inst(unsigned short, struct pt_regs *);
-
-static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
-{
-       preempt_disable();
-       if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
-               save_fpu(tsk, regs);
-       preempt_enable();
-}
-
-static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
-{
-       preempt_disable();
-       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
-               clear_tsk_thread_flag(tsk, TIF_USEDFPU);
-               release_fpu(regs);
-       }
-       preempt_enable();
-}
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_SH_FPU_H */
diff --git a/include/asm-sh/freq.h b/include/asm-sh/freq.h
deleted file mode 100644 (file)
index 39c0e09..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * include/asm-sh/freq.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_FREQ_H
-#define __ASM_SH_FREQ_H
-#ifdef __KERNEL__
-
-#include <asm/cpu/freq.h>
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_FREQ_H */
diff --git a/include/asm-sh/futex-irq.h b/include/asm-sh/futex-irq.h
deleted file mode 100644 (file)
index a9f16a7..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef __ASM_SH_FUTEX_IRQ_H
-#define __ASM_SH_FUTEX_IRQ_H
-
-#include <asm/system.h>
-
-static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr,
-                                          int *oldval)
-{
-       unsigned long flags;
-       int ret;
-
-       local_irq_save(flags);
-
-       ret = get_user(*oldval, uaddr);
-       if (!ret)
-               ret = put_user(oparg, uaddr);
-
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr,
-                                          int *oldval)
-{
-       unsigned long flags;
-       int ret;
-
-       local_irq_save(flags);
-
-       ret = get_user(*oldval, uaddr);
-       if (!ret)
-               ret = put_user(*oldval + oparg, uaddr);
-
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr,
-                                         int *oldval)
-{
-       unsigned long flags;
-       int ret;
-
-       local_irq_save(flags);
-
-       ret = get_user(*oldval, uaddr);
-       if (!ret)
-               ret = put_user(*oldval | oparg, uaddr);
-
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr,
-                                          int *oldval)
-{
-       unsigned long flags;
-       int ret;
-
-       local_irq_save(flags);
-
-       ret = get_user(*oldval, uaddr);
-       if (!ret)
-               ret = put_user(*oldval & oparg, uaddr);
-
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr,
-                                          int *oldval)
-{
-       unsigned long flags;
-       int ret;
-
-       local_irq_save(flags);
-
-       ret = get_user(*oldval, uaddr);
-       if (!ret)
-               ret = put_user(*oldval ^ oparg, uaddr);
-
-       local_irq_restore(flags);
-
-       return ret;
-}
-
-static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr,
-                                                  int oldval, int newval)
-{
-       unsigned long flags;
-       int ret, prev = 0;
-
-       local_irq_save(flags);
-
-       ret = get_user(prev, uaddr);
-       if (!ret && oldval == prev)
-               ret = put_user(newval, uaddr);
-
-       local_irq_restore(flags);
-
-       if (ret)
-               return ret;
-
-       return prev;
-}
-
-#endif /* __ASM_SH_FUTEX_IRQ_H */
diff --git a/include/asm-sh/futex.h b/include/asm-sh/futex.h
deleted file mode 100644 (file)
index 68256ec..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef __ASM_SH_FUTEX_H
-#define __ASM_SH_FUTEX_H
-
-#ifdef __KERNEL__
-
-#include <linux/futex.h>
-#include <linux/uaccess.h>
-#include <asm/errno.h>
-
-/* XXX: UP variants, fix for SH-4A and SMP.. */
-#include <asm/futex-irq.h>
-
-static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
-{
-       int op = (encoded_op >> 28) & 7;
-       int cmp = (encoded_op >> 24) & 15;
-       int oparg = (encoded_op << 8) >> 20;
-       int cmparg = (encoded_op << 20) >> 20;
-       int oldval = 0, ret;
-
-       if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
-               oparg = 1 << oparg;
-
-       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
-               return -EFAULT;
-
-       pagefault_disable();
-
-       switch (op) {
-       case FUTEX_OP_SET:
-               ret = atomic_futex_op_xchg_set(oparg, uaddr, &oldval);
-               break;
-       case FUTEX_OP_ADD:
-               ret = atomic_futex_op_xchg_add(oparg, uaddr, &oldval);
-               break;
-       case FUTEX_OP_OR:
-               ret = atomic_futex_op_xchg_or(oparg, uaddr, &oldval);
-               break;
-       case FUTEX_OP_ANDN:
-               ret = atomic_futex_op_xchg_and(~oparg, uaddr, &oldval);
-               break;
-       case FUTEX_OP_XOR:
-               ret = atomic_futex_op_xchg_xor(oparg, uaddr, &oldval);
-               break;
-       default:
-               ret = -ENOSYS;
-               break;
-       }
-
-       pagefault_enable();
-
-       if (!ret) {
-               switch (cmp) {
-               case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
-               case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
-               case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
-               case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
-               case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
-               case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
-               default: ret = -ENOSYS;
-               }
-       }
-
-       return ret;
-}
-
-static inline int
-futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
-{
-       if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
-               return -EFAULT;
-
-       return atomic_futex_op_cmpxchg_inatomic(uaddr, oldval, newval);
-}
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_FUTEX_H */
diff --git a/include/asm-sh/gpio.h b/include/asm-sh/gpio.h
deleted file mode 100644 (file)
index 9bb27e0..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- *  include/asm-sh/gpio.h
- *
- *  Copyright (C) 2007 Markus Brunner, Mark Jonas
- *
- *  Addresses for the Pin Function Controller
- *
- * 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.
- */
-#ifndef __ASM_SH_GPIO_H
-#define __ASM_SH_GPIO_H
-
-#if defined(CONFIG_CPU_SH3)
-#include <asm/cpu/gpio.h>
-#endif
-
-#endif /* __ASM_SH_GPIO_H */
diff --git a/include/asm-sh/hardirq.h b/include/asm-sh/hardirq.h
deleted file mode 100644 (file)
index 715ee23..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef __ASM_SH_HARDIRQ_H
-#define __ASM_SH_HARDIRQ_H
-
-#include <linux/threads.h>
-#include <linux/irq.h>
-
-/* entry.S is sensitive to the offsets of these fields */
-typedef struct {
-       unsigned int __softirq_pending;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
-
-extern void ack_bad_irq(unsigned int irq);
-
-#endif /* __ASM_SH_HARDIRQ_H */
diff --git a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h
deleted file mode 100644 (file)
index 8c1353b..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-#ifndef __ASM_SH_HD64461
-#define __ASM_SH_HD64461
-/*
- *     Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
- *     Copyright (C) 2004 Paul Mundt
- *     Copyright (C) 2000 YAEGASHI Takeshi
- *
- *             Hitachi HD64461 companion chip support
- *     (please note manual reference 0x10000000 = 0xb0000000)
- */
-
-/* Constants for PCMCIA mappings */
-#define        HD64461_PCC_WINDOW      0x01000000
-
-/* Area 6 - Slot 0 - memory and/or IO card */
-#define        HD64461_PCC0_BASE       (CONFIG_HD64461_IOBASE + 0x8000000)
-#define        HD64461_PCC0_ATTR       (HD64461_PCC0_BASE)                             /* 0xb80000000 */
-#define        HD64461_PCC0_COMM       (HD64461_PCC0_BASE+HD64461_PCC_WINDOW)          /* 0xb90000000 */
-#define        HD64461_PCC0_IO         (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW)        /* 0xba0000000 */
-
-/* Area 5 - Slot 1 - memory card only */
-#define        HD64461_PCC1_BASE       (CONFIG_HD64461_IOBASE + 0x4000000)
-#define        HD64461_PCC1_ATTR       (HD64461_PCC1_BASE)                             /* 0xb4000000 */
-#define        HD64461_PCC1_COMM       (HD64461_PCC1_BASE+HD64461_PCC_WINDOW)          /* 0xb5000000 */
-
-/* Standby Control Register for HD64461 */
-#define        HD64461_STBCR                   CONFIG_HD64461_IOBASE
-#define        HD64461_STBCR_CKIO_STBY         0x2000
-#define        HD64461_STBCR_SAFECKE_IST       0x1000
-#define        HD64461_STBCR_SLCKE_IST         0x0800
-#define        HD64461_STBCR_SAFECKE_OST       0x0400
-#define        HD64461_STBCR_SLCKE_OST         0x0200
-#define        HD64461_STBCR_SMIAST            0x0100
-#define        HD64461_STBCR_SLCDST            0x0080
-#define        HD64461_STBCR_SPC0ST            0x0040
-#define        HD64461_STBCR_SPC1ST            0x0020
-#define        HD64461_STBCR_SAFEST            0x0010
-#define        HD64461_STBCR_STM0ST            0x0008
-#define        HD64461_STBCR_STM1ST            0x0004
-#define        HD64461_STBCR_SIRST             0x0002
-#define        HD64461_STBCR_SURTST            0x0001
-
-/* System Configuration Register */
-#define        HD64461_SYSCR           (CONFIG_HD64461_IOBASE + 0x02)
-
-/* CPU Data Bus Control Register */
-#define        HD64461_SCPUCR          (CONFIG_HD64461_IOBASE + 0x04)
-
-/* Base Address Register */
-#define        HD64461_LCDCBAR         (CONFIG_HD64461_IOBASE + 0x1000)
-
-/* Line increment address */
-#define        HD64461_LCDCLOR         (CONFIG_HD64461_IOBASE + 0x1002)
-
-/* Controls LCD controller */
-#define        HD64461_LCDCCR          (CONFIG_HD64461_IOBASE + 0x1004)
-
-/* LCCDR control bits */
-#define        HD64461_LCDCCR_STBACK   0x0400  /* Standby Back */
-#define        HD64461_LCDCCR_STREQ    0x0100  /* Standby Request */
-#define        HD64461_LCDCCR_MOFF     0x0080  /* Memory Off */
-#define        HD64461_LCDCCR_REFSEL   0x0040  /* Refresh Select */
-#define        HD64461_LCDCCR_EPON     0x0020  /* End Power On */
-#define        HD64461_LCDCCR_SPON     0x0010  /* Start Power On */
-
-/* Controls LCD (1) */
-#define        HD64461_LDR1            (CONFIG_HD64461_IOBASE + 0x1010)
-#define        HD64461_LDR1_DON        0x01    /* Display On */
-#define        HD64461_LDR1_DINV       0x80    /* Display Invert */
-
-/* Controls LCD (2) */
-#define        HD64461_LDR2            (CONFIG_HD64461_IOBASE + 0x1012)
-#define        HD64461_LDHNCR          (CONFIG_HD64461_IOBASE + 0x1014)        /* Number of horizontal characters */
-#define        HD64461_LDHNSR          (CONFIG_HD64461_IOBASE + 0x1016)        /* Specify output start position + width of CL1 */
-#define        HD64461_LDVNTR          (CONFIG_HD64461_IOBASE + 0x1018)        /* Specify total vertical lines */
-#define        HD64461_LDVNDR          (CONFIG_HD64461_IOBASE + 0x101a)        /* specify number of display vertical lines */
-#define        HD64461_LDVSPR          (CONFIG_HD64461_IOBASE + 0x101c)        /* specify vertical synchronization pos and AC nr */
-
-/* Controls LCD (3) */
-#define        HD64461_LDR3            (CONFIG_HD64461_IOBASE + 0x101e)
-
-/* Palette Registers */
-#define        HD64461_CPTWAR          (CONFIG_HD64461_IOBASE + 0x1030)        /* Color Palette Write Address Register */
-#define        HD64461_CPTWDR          (CONFIG_HD64461_IOBASE + 0x1032)        /* Color Palette Write Data Register */
-#define        HD64461_CPTRAR          (CONFIG_HD64461_IOBASE + 0x1034)        /* Color Palette Read Address Register */
-#define        HD64461_CPTRDR          (CONFIG_HD64461_IOBASE + 0x1036)        /* Color Palette Read Data Register */
-
-#define        HD64461_GRDOR           (CONFIG_HD64461_IOBASE + 0x1040)        /* Display Resolution Offset Register */
-#define        HD64461_GRSCR           (CONFIG_HD64461_IOBASE + 0x1042)        /* Solid Color Register */
-#define        HD64461_GRCFGR          (CONFIG_HD64461_IOBASE + 0x1044)        /* Accelerator Configuration Register */
-
-#define        HD64461_GRCFGR_ACCSTATUS        0x10    /* Accelerator Status */
-#define        HD64461_GRCFGR_ACCRESET         0x08    /* Accelerator Reset */
-#define        HD64461_GRCFGR_ACCSTART_BITBLT  0x06    /* Accelerator Start BITBLT */
-#define        HD64461_GRCFGR_ACCSTART_LINE    0x04    /* Accelerator Start Line Drawing */
-#define        HD64461_GRCFGR_COLORDEPTH16     0x01    /* Sets Colordepth 16 for Accelerator */
-#define        HD64461_GRCFGR_COLORDEPTH8      0x01    /* Sets Colordepth 8 for Accelerator */
-
-/* Line Drawing Registers */
-#define        HD64461_LNSARH          (CONFIG_HD64461_IOBASE + 0x1046)        /* Line Start Address Register (H) */
-#define        HD64461_LNSARL          (CONFIG_HD64461_IOBASE + 0x1048)        /* Line Start Address Register (L) */
-#define        HD64461_LNAXLR          (CONFIG_HD64461_IOBASE + 0x104a)        /* Axis Pixel Length Register */
-#define        HD64461_LNDGR           (CONFIG_HD64461_IOBASE + 0x104c)        /* Diagonal Register */
-#define        HD64461_LNAXR           (CONFIG_HD64461_IOBASE + 0x104e)        /* Axial Register */
-#define        HD64461_LNERTR          (CONFIG_HD64461_IOBASE + 0x1050)        /* Start Error Term Register */
-#define        HD64461_LNMDR           (CONFIG_HD64461_IOBASE + 0x1052)        /* Line Mode Register */
-
-/* BitBLT Registers */
-#define        HD64461_BBTSSARH        (CONFIG_HD64461_IOBASE + 0x1054)        /* Source Start Address Register (H) */
-#define        HD64461_BBTSSARL        (CONFIG_HD64461_IOBASE + 0x1056)        /* Source Start Address Register (L) */
-#define        HD64461_BBTDSARH        (CONFIG_HD64461_IOBASE + 0x1058)        /* Destination Start Address Register (H) */
-#define        HD64461_BBTDSARL        (CONFIG_HD64461_IOBASE + 0x105a)        /* Destination Start Address Register (L) */
-#define        HD64461_BBTDWR          (CONFIG_HD64461_IOBASE + 0x105c)        /* Destination Block Width Register */
-#define        HD64461_BBTDHR          (CONFIG_HD64461_IOBASE + 0x105e)        /* Destination Block Height Register */
-#define        HD64461_BBTPARH         (CONFIG_HD64461_IOBASE + 0x1060)        /* Pattern Start Address Register (H) */
-#define        HD64461_BBTPARL         (CONFIG_HD64461_IOBASE + 0x1062)        /* Pattern Start Address Register (L) */
-#define        HD64461_BBTMARH         (CONFIG_HD64461_IOBASE + 0x1064)        /* Mask Start Address Register (H) */
-#define        HD64461_BBTMARL         (CONFIG_HD64461_IOBASE + 0x1066)        /* Mask Start Address Register (L) */
-#define        HD64461_BBTROPR         (CONFIG_HD64461_IOBASE + 0x1068)        /* ROP Register */
-#define        HD64461_BBTMDR          (CONFIG_HD64461_IOBASE + 0x106a)        /* BitBLT Mode Register */
-
-/* PC Card Controller Registers */
-/* Maps to Physical Area 6 */
-#define        HD64461_PCC0ISR         (CONFIG_HD64461_IOBASE + 0x2000)        /* socket 0 interface status */
-#define        HD64461_PCC0GCR         (CONFIG_HD64461_IOBASE + 0x2002)        /* socket 0 general control */
-#define        HD64461_PCC0CSCR        (CONFIG_HD64461_IOBASE + 0x2004)        /* socket 0 card status change */
-#define        HD64461_PCC0CSCIER      (CONFIG_HD64461_IOBASE + 0x2006)        /* socket 0 card status change interrupt enable */
-#define        HD64461_PCC0SCR         (CONFIG_HD64461_IOBASE + 0x2008)        /* socket 0 software control */
-/* Maps to Physical Area 5 */
-#define        HD64461_PCC1ISR         (CONFIG_HD64461_IOBASE + 0x2010)        /* socket 1 interface status */
-#define        HD64461_PCC1GCR         (CONFIG_HD64461_IOBASE + 0x2012)        /* socket 1 general control */
-#define        HD64461_PCC1CSCR        (CONFIG_HD64461_IOBASE + 0x2014)        /* socket 1 card status change */
-#define        HD64461_PCC1CSCIER      (CONFIG_HD64461_IOBASE + 0x2016)        /* socket 1 card status change interrupt enable */
-#define        HD64461_PCC1SCR         (CONFIG_HD64461_IOBASE + 0x2018)        /* socket 1 software control */
-
-/* PCC Interface Status Register */
-#define        HD64461_PCCISR_READY            0x80    /* card ready */
-#define        HD64461_PCCISR_MWP              0x40    /* card write-protected */
-#define        HD64461_PCCISR_VS2              0x20    /* voltage select pin 2 */
-#define        HD64461_PCCISR_VS1              0x10    /* voltage select pin 1 */
-#define        HD64461_PCCISR_CD2              0x08    /* card detect 2 */
-#define        HD64461_PCCISR_CD1              0x04    /* card detect 1 */
-#define        HD64461_PCCISR_BVD2             0x02    /* battery 1 */
-#define        HD64461_PCCISR_BVD1             0x01    /* battery 1 */
-
-#define        HD64461_PCCISR_PCD_MASK         0x0c    /* card detect */
-#define        HD64461_PCCISR_BVD_MASK         0x03    /* battery voltage */
-#define        HD64461_PCCISR_BVD_BATGOOD      0x03    /* battery good */
-#define        HD64461_PCCISR_BVD_BATWARN      0x01    /* battery low warning */
-#define        HD64461_PCCISR_BVD_BATDEAD1     0x02    /* battery dead */
-#define        HD64461_PCCISR_BVD_BATDEAD2     0x00    /* battery dead */
-
-/* PCC General Control Register */
-#define        HD64461_PCCGCR_DRVE             0x80    /* output drive */
-#define        HD64461_PCCGCR_PCCR             0x40    /* PC card reset */
-#define        HD64461_PCCGCR_PCCT             0x20    /* PC card type, 1=IO&mem, 0=mem */
-#define        HD64461_PCCGCR_VCC0             0x10    /* voltage control pin VCC0SEL0 */
-#define        HD64461_PCCGCR_PMMOD            0x08    /* memory mode */
-#define        HD64461_PCCGCR_PA25             0x04    /* pin A25 */
-#define        HD64461_PCCGCR_PA24             0x02    /* pin A24 */
-#define        HD64461_PCCGCR_REG              0x01    /* pin PCC0REG# */
-
-/* PCC Card Status Change Register */
-#define        HD64461_PCCCSCR_SCDI            0x80    /* sw card detect intr */
-#define        HD64461_PCCCSCR_SRV1            0x40    /* reserved */
-#define        HD64461_PCCCSCR_IREQ            0x20    /* IREQ intr req */
-#define        HD64461_PCCCSCR_SC              0x10    /* STSCHG (status change) pin */
-#define        HD64461_PCCCSCR_CDC             0x08    /* CD (card detect) change */
-#define        HD64461_PCCCSCR_RC              0x04    /* READY change */
-#define        HD64461_PCCCSCR_BW              0x02    /* battery warning change */
-#define        HD64461_PCCCSCR_BD              0x01    /* battery dead change */
-
-/* PCC Card Status Change Interrupt Enable Register */
-#define        HD64461_PCCCSCIER_CRE           0x80    /* change reset enable */
-#define        HD64461_PCCCSCIER_IREQE_MASK    0x60    /* IREQ enable */
-#define        HD64461_PCCCSCIER_IREQE_DISABLED 0x00   /* IREQ disabled */
-#define        HD64461_PCCCSCIER_IREQE_LEVEL   0x20    /* IREQ level-triggered */
-#define        HD64461_PCCCSCIER_IREQE_FALLING 0x40    /* IREQ falling-edge-trig */
-#define        HD64461_PCCCSCIER_IREQE_RISING  0x60    /* IREQ rising-edge-trig */
-
-#define        HD64461_PCCCSCIER_SCE           0x10    /* status change enable */
-#define        HD64461_PCCCSCIER_CDE           0x08    /* card detect change enable */
-#define        HD64461_PCCCSCIER_RE            0x04    /* ready change enable */
-#define        HD64461_PCCCSCIER_BWE           0x02    /* battery warn change enable */
-#define        HD64461_PCCCSCIER_BDE           0x01    /* battery dead change enable*/
-
-/* PCC Software Control Register */
-#define        HD64461_PCCSCR_VCC1             0x02    /* voltage control pin 1 */
-#define        HD64461_PCCSCR_SWP              0x01    /* write protect */
-
-/* PCC0 Output Pins Control Register */
-#define        HD64461_P0OCR           (CONFIG_HD64461_IOBASE + 0x202a)
-
-/* PCC1 Output Pins Control Register */
-#define        HD64461_P1OCR           (CONFIG_HD64461_IOBASE + 0x202c)
-
-/* PC Card General Control Register */
-#define        HD64461_PGCR            (CONFIG_HD64461_IOBASE + 0x202e)
-
-/* Port Control Registers */
-#define        HD64461_GPACR           (CONFIG_HD64461_IOBASE + 0x4000)        /* Port A - Handles IRDA/TIMER */
-#define        HD64461_GPBCR           (CONFIG_HD64461_IOBASE + 0x4002)        /* Port B - Handles UART */
-#define        HD64461_GPCCR           (CONFIG_HD64461_IOBASE + 0x4004)        /* Port C - Handles PCMCIA 1 */
-#define        HD64461_GPDCR           (CONFIG_HD64461_IOBASE + 0x4006)        /* Port D - Handles PCMCIA 1 */
-
-/* Port Control Data Registers */
-#define        HD64461_GPADR           (CONFIG_HD64461_IOBASE + 0x4010)        /* A */
-#define        HD64461_GPBDR           (CONFIG_HD64461_IOBASE + 0x4012)        /* B */
-#define        HD64461_GPCDR           (CONFIG_HD64461_IOBASE + 0x4014)        /* C */
-#define        HD64461_GPDDR           (CONFIG_HD64461_IOBASE + 0x4016)        /* D */
-
-/* Interrupt Control Registers */
-#define        HD64461_GPAICR          (CONFIG_HD64461_IOBASE + 0x4020)        /* A */
-#define        HD64461_GPBICR          (CONFIG_HD64461_IOBASE + 0x4022)        /* B */
-#define        HD64461_GPCICR          (CONFIG_HD64461_IOBASE + 0x4024)        /* C */
-#define        HD64461_GPDICR          (CONFIG_HD64461_IOBASE + 0x4026)        /* D */
-
-/* Interrupt Status Registers */
-#define        HD64461_GPAISR          (CONFIG_HD64461_IOBASE + 0x4040)        /* A */
-#define        HD64461_GPBISR          (CONFIG_HD64461_IOBASE + 0x4042)        /* B */
-#define        HD64461_GPCISR          (CONFIG_HD64461_IOBASE + 0x4044)        /* C */
-#define        HD64461_GPDISR          (CONFIG_HD64461_IOBASE + 0x4046)        /* D */
-
-/* Interrupt Request Register & Interrupt Mask Register */
-#define        HD64461_NIRR            (CONFIG_HD64461_IOBASE + 0x5000)
-#define        HD64461_NIMR            (CONFIG_HD64461_IOBASE + 0x5002)
-
-#define        HD64461_IRQBASE         OFFCHIP_IRQ_BASE
-#define        OFFCHIP_IRQ_BASE        64
-#define        HD64461_IRQ_NUM         16
-
-#define        HD64461_IRQ_UART        (HD64461_IRQBASE+5)
-#define        HD64461_IRQ_IRDA        (HD64461_IRQBASE+6)
-#define        HD64461_IRQ_TMU1        (HD64461_IRQBASE+9)
-#define        HD64461_IRQ_TMU0        (HD64461_IRQBASE+10)
-#define        HD64461_IRQ_GPIO        (HD64461_IRQBASE+11)
-#define        HD64461_IRQ_AFE         (HD64461_IRQBASE+12)
-#define        HD64461_IRQ_PCC1        (HD64461_IRQBASE+13)
-#define        HD64461_IRQ_PCC0        (HD64461_IRQBASE+14)
-
-#define __IO_PREFIX    hd64461
-#include <asm/io_generic.h>
-
-/* arch/sh/cchips/hd6446x/hd64461/setup.c */
-int hd64461_irq_demux(int irq);
-void hd64461_register_irq_demux(int irq,
-                               int (*demux) (int irq, void *dev), void *dev);
-void hd64461_unregister_irq_demux(int irq);
-
-#endif
diff --git a/include/asm-sh/hd64465/gpio.h b/include/asm-sh/hd64465/gpio.h
deleted file mode 100644 (file)
index a3cdca2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _ASM_SH_HD64465_GPIO_
-#define _ASM_SH_HD64465_GPIO_ 1
-/*
- * $Id: gpio.h,v 1.3 2003/05/04 19:30:14 lethal Exp $
- *
- * Hitachi HD64465 companion chip: General Purpose IO pins support.
- * This layer enables other device drivers to configure GPIO
- * pins, get and set their values, and register an interrupt
- * routine for when input pins change in hardware.
- *
- * by Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- */
-#include <asm/hd64465.h>
-
-/* Macro to construct a portpin number (used in all
- * subsequent functions) from a port letter and a pin
- * number, e.g. HD64465_GPIO_PORTPIN('A', 5).
- */
-#define HD64465_GPIO_PORTPIN(port,pin) (((port)-'A')<<3|(pin))
-
-/* Pin configuration constants for _configure() */
-#define HD64465_GPIO_FUNCTION2 0       /* use the pin's *other* function */
-#define HD64465_GPIO_OUT       1       /* output */
-#define HD64465_GPIO_IN_PULLUP 2       /* input, pull-up MOS on */
-#define HD64465_GPIO_IN                3       /* input */
-
-/* Configure a pin's direction */
-extern void hd64465_gpio_configure(int portpin, int direction);
-
-/* Get, set value */
-extern void hd64465_gpio_set_pin(int portpin, unsigned int value);
-extern unsigned int hd64465_gpio_get_pin(int portpin);
-extern void hd64465_gpio_set_port(int port, unsigned int value);
-extern unsigned int hd64465_gpio_get_port(int port);
-
-/* mode constants for _register_irq() */
-#define HD64465_GPIO_FALLING   0
-#define HD64465_GPIO_RISING    1
-
-/* Interrupt on external value change */
-extern void hd64465_gpio_register_irq(int portpin, int mode,
-       void (*handler)(int portpin, void *dev), void *dev);
-extern void hd64465_gpio_unregister_irq(int portpin);
-
-#endif /* _ASM_SH_HD64465_GPIO_  */
diff --git a/include/asm-sh/hd64465/hd64465.h b/include/asm-sh/hd64465/hd64465.h
deleted file mode 100644 (file)
index cfd0e80..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-#ifndef _ASM_SH_HD64465_
-#define _ASM_SH_HD64465_ 1
-/*
- * $Id: hd64465.h,v 1.3 2003/05/04 19:30:15 lethal Exp $
- *
- * Hitachi HD64465 companion chip support
- *
- * by Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- *
- * Derived from <asm/hd64461.h> which bore the message:
- * Copyright (C) 2000 YAEGASHI Takeshi
- */
-#include <asm/io.h>
-#include <asm/irq.h>
-
-/*
- * Note that registers are defined here as virtual port numbers,
- * which have no meaning except to get translated by hd64465_isa_port2addr()
- * to an address in the range 0xb0000000-0xb3ffffff.  Note that
- * this translation happens to consist of adding the lower 16 bits
- * of the virtual port number to 0xb0000000.  Note also that the manual
- * shows addresses as absolute physical addresses starting at 0x10000000,
- * so e.g. the NIRR register is listed as 0x15000 here, 0x10005000 in the
- * manual, and accessed using address 0xb0005000 - Greg.
- */
-
-/* System registers */
-#define HD64465_REG_SRR     0x1000c    /* System Revision Register */
-#define HD64465_REG_SDID    0x10010    /* System Device ID Reg */
-#define     HD64465_SDID            0x8122  /* 64465 device ID */
-
-/* Power Management registers */
-#define HD64465_REG_SMSCR   0x10000    /* System Module Standby Control Reg */
-#define            HD64465_SMSCR_PS2ST     0x4000  /* PS/2 Standby */
-#define            HD64465_SMSCR_ADCST     0x1000  /* ADC Standby */
-#define            HD64465_SMSCR_UARTST    0x0800  /* UART Standby */
-#define            HD64465_SMSCR_SCDIST    0x0200  /* Serial Codec Standby */
-#define            HD64465_SMSCR_PPST      0x0100  /* Parallel Port Standby */
-#define            HD64465_SMSCR_PC0ST     0x0040  /* PCMCIA0 Standby */
-#define            HD64465_SMSCR_PC1ST     0x0020  /* PCMCIA1 Standby */
-#define            HD64465_SMSCR_AFEST     0x0010  /* AFE Standby */
-#define            HD64465_SMSCR_TM0ST     0x0008  /* Timer0 Standby */
-#define            HD64465_SMSCR_TM1ST     0x0004  /* Timer1 Standby */
-#define            HD64465_SMSCR_IRDAST    0x0002  /* IRDA Standby */
-#define            HD64465_SMSCR_KBCST     0x0001  /* Keyboard Controller Standby */
-/* Interrupt Controller registers */
-#define HD64465_REG_NIRR    0x15000    /* Interrupt Request Register */
-#define HD64465_REG_NIMR    0x15002    /* Interrupt Mask Register */
-#define HD64465_REG_NITR    0x15004    /* Interrupt Trigger Mode Register */
-
-/* Timer registers */
-#define HD64465_REG_TCVR1   0x16000    /* Timer 1 constant value register  */
-#define HD64465_REG_TCVR0   0x16002    /* Timer 0 constant value register  */
-#define HD64465_REG_TRVR1   0x16004    /* Timer 1 read value register  */
-#define HD64465_REG_TRVR0   0x16006    /* Timer 0 read value register  */
-#define HD64465_REG_TCR1    0x16008    /* Timer 1 control register  */
-#define HD64465_REG_TCR0    0x1600A    /* Timer 0 control register  */
-#define            HD64465_TCR_EADT    0x10        /* Enable ADTRIG# signal */
-#define            HD64465_TCR_ETMO    0x08        /* Enable TMO signal */
-#define            HD64465_TCR_PST_MASK 0x06       /* Clock Prescale */
-#define            HD64465_TCR_PST_1   0x06        /* 1:1 */
-#define            HD64465_TCR_PST_4   0x04        /* 1:4 */
-#define            HD64465_TCR_PST_8   0x02        /* 1:8 */
-#define            HD64465_TCR_PST_16  0x00        /* 1:16 */
-#define            HD64465_TCR_TSTP    0x01        /* Start/Stop timer */
-#define HD64465_REG_TIRR    0x1600C    /* Timer interrupt request register  */
-#define HD64465_REG_TIDR    0x1600E    /* Timer interrupt disable register  */
-#define HD64465_REG_PWM1CS  0x16010    /* PWM 1 clock scale register  */
-#define HD64465_REG_PWM1LPC 0x16012    /* PWM 1 low pulse width counter register  */
-#define HD64465_REG_PWM1HPC 0x16014    /* PWM 1 high pulse width counter register  */
-#define HD64465_REG_PWM0CS  0x16018    /* PWM 0 clock scale register  */
-#define HD64465_REG_PWM0LPC 0x1601A    /* PWM 0 low pulse width counter register  */
-#define HD64465_REG_PWM0HPC 0x1601C    /* PWM 0 high pulse width counter register  */
-
-/* Analog/Digital Converter registers */
-#define HD64465_REG_ADDRA   0x1E000    /* A/D data register A */
-#define HD64465_REG_ADDRB   0x1E002    /* A/D data register B */
-#define HD64465_REG_ADDRC   0x1E004    /* A/D data register C */
-#define HD64465_REG_ADDRD   0x1E006    /* A/D data register D */
-#define HD64465_REG_ADCSR   0x1E008    /* A/D control/status register */
-#define     HD64465_ADCSR_ADF      0x80    /* A/D End Flag */
-#define     HD64465_ADCSR_ADST     0x40    /* A/D Start Flag */
-#define     HD64465_ADCSR_ADIS     0x20    /* A/D Interrupt Status */
-#define     HD64465_ADCSR_TRGE     0x10    /* A/D Trigger Enable */
-#define     HD64465_ADCSR_ADIE     0x08    /* A/D Interrupt Enable */
-#define     HD64465_ADCSR_SCAN     0x04    /* A/D Scan Mode */
-#define     HD64465_ADCSR_CH_MASK   0x03    /* A/D Channel */
-#define HD64465_REG_ADCALCR 0x1E00A    /* A/D calibration sample control */
-#define HD64465_REG_ADCAL   0x1E00C    /* A/D calibration data register */
-
-
-/* General Purpose I/O ports registers */
-#define HD64465_REG_GPACR   0x14000    /* Port A Control Register */
-#define HD64465_REG_GPBCR   0x14002    /* Port B Control Register */
-#define HD64465_REG_GPCCR   0x14004    /* Port C Control Register */
-#define HD64465_REG_GPDCR   0x14006    /* Port D Control Register */
-#define HD64465_REG_GPECR   0x14008    /* Port E Control Register */
-#define HD64465_REG_GPADR   0x14010    /* Port A Data Register */
-#define HD64465_REG_GPBDR   0x14012    /* Port B Data Register */
-#define HD64465_REG_GPCDR   0x14014    /* Port C Data Register */
-#define HD64465_REG_GPDDR   0x14016    /* Port D Data Register */
-#define HD64465_REG_GPEDR   0x14018    /* Port E Data Register */
-#define HD64465_REG_GPAICR  0x14020    /* Port A Interrupt Control Register */
-#define HD64465_REG_GPBICR  0x14022    /* Port B Interrupt Control Register */
-#define HD64465_REG_GPCICR  0x14024    /* Port C Interrupt Control Register */
-#define HD64465_REG_GPDICR  0x14026    /* Port D Interrupt Control Register */
-#define HD64465_REG_GPEICR  0x14028    /* Port E Interrupt Control Register */
-#define HD64465_REG_GPAISR  0x14040    /* Port A Interrupt Status Register */
-#define HD64465_REG_GPBISR  0x14042    /* Port B Interrupt Status Register */
-#define HD64465_REG_GPCISR  0x14044    /* Port C Interrupt Status Register */
-#define HD64465_REG_GPDISR  0x14046    /* Port D Interrupt Status Register */
-#define HD64465_REG_GPEISR  0x14048    /* Port E Interrupt Status Register */
-
-/* PCMCIA bridge interface */
-#define HD64465_REG_PCC0ISR    0x12000 /* socket 0 interface status */ 
-#define     HD64465_PCCISR_PREADY       0x80    /* mem card ready / io card IREQ */
-#define     HD64465_PCCISR_PIREQ        0x80
-#define     HD64465_PCCISR_PMWP         0x40    /* mem card write-protected */
-#define     HD64465_PCCISR_PVS2         0x20    /* voltage select pin 2 */
-#define     HD64465_PCCISR_PVS1         0x10    /* voltage select pin 1 */
-#define     HD64465_PCCISR_PCD_MASK     0x0c    /* card detect */
-#define     HD64465_PCCISR_PBVD_MASK     0x03    /* battery voltage */
-#define     HD64465_PCCISR_PBVD_BATGOOD  0x03    /* battery good */
-#define     HD64465_PCCISR_PBVD_BATWARN  0x01    /* battery low warning */
-#define     HD64465_PCCISR_PBVD_BATDEAD1 0x02    /* battery dead */
-#define     HD64465_PCCISR_PBVD_BATDEAD2 0x00    /* battery dead */
-#define HD64465_REG_PCC0GCR    0x12002 /* socket 0 general control */ 
-#define     HD64465_PCCGCR_PDRV         0x80    /* output drive */
-#define     HD64465_PCCGCR_PCCR         0x40    /* PC card reset */
-#define     HD64465_PCCGCR_PCCT         0x20    /* PC card type, 1=IO&mem, 0=mem */
-#define     HD64465_PCCGCR_PVCC0        0x10    /* voltage control pin VCC0SEL0 */
-#define     HD64465_PCCGCR_PMMOD        0x08    /* memory mode */
-#define     HD64465_PCCGCR_PPA25        0x04    /* pin A25 */
-#define     HD64465_PCCGCR_PPA24        0x02    /* pin A24 */
-#define     HD64465_PCCGCR_PREG         0x01    /* ping PCC0REG# */
-#define HD64465_REG_PCC0CSCR   0x12004 /* socket 0 card status change */ 
-#define     HD64465_PCCCSCR_PSCDI       0x80    /* sw card detect intr */
-#define     HD64465_PCCCSCR_PSWSEL      0x40    /* power select */
-#define     HD64465_PCCCSCR_PIREQ       0x20    /* IREQ intr req */
-#define     HD64465_PCCCSCR_PSC         0x10    /* STSCHG (status change) pin */
-#define     HD64465_PCCCSCR_PCDC        0x08    /* CD (card detect) change */
-#define     HD64465_PCCCSCR_PRC         0x04    /* ready change */
-#define     HD64465_PCCCSCR_PBW         0x02    /* battery warning change */
-#define     HD64465_PCCCSCR_PBD         0x01    /* battery dead change */
-#define HD64465_REG_PCC0CSCIER 0x12006 /* socket 0 card status change interrupt enable */ 
-#define     HD64465_PCCCSCIER_PCRE      0x80    /* change reset enable */
-#define     HD64465_PCCCSCIER_PIREQE_MASK      0x60   /* IREQ enable */
-#define     HD64465_PCCCSCIER_PIREQE_DISABLED  0x00   /* IREQ disabled */
-#define     HD64465_PCCCSCIER_PIREQE_LEVEL     0x20   /* IREQ level-triggered */
-#define     HD64465_PCCCSCIER_PIREQE_FALLING   0x40   /* IREQ falling-edge-trig */
-#define     HD64465_PCCCSCIER_PIREQE_RISING    0x60   /* IREQ rising-edge-trig */
-#define     HD64465_PCCCSCIER_PSCE      0x10    /* status change enable */
-#define     HD64465_PCCCSCIER_PCDE      0x08    /* card detect change enable */
-#define     HD64465_PCCCSCIER_PRE       0x04    /* ready change enable */
-#define     HD64465_PCCCSCIER_PBWE      0x02    /* battery warn change enable */
-#define     HD64465_PCCCSCIER_PBDE      0x01    /* battery dead change enable*/
-#define HD64465_REG_PCC0SCR    0x12008 /* socket 0 software control */ 
-#define     HD64465_PCCSCR_SHDN         0x10    /* TPS2206 SHutDowN pin */
-#define     HD64465_PCCSCR_SWP          0x01    /* write protect */
-#define HD64465_REG_PCCPSR     0x1200A /* serial power switch control */ 
-#define HD64465_REG_PCC1ISR    0x12010 /* socket 1 interface status */ 
-#define HD64465_REG_PCC1GCR    0x12012 /* socket 1 general control */ 
-#define HD64465_REG_PCC1CSCR   0x12014 /* socket 1 card status change */ 
-#define HD64465_REG_PCC1CSCIER 0x12016 /* socket 1 card status change interrupt enable */ 
-#define HD64465_REG_PCC1SCR    0x12018 /* socket 1 software control */ 
-
-
-/* PS/2 Keyboard and mouse controller -- *not* register compatible */
-#define HD64465_REG_KBCSR      0x1dc00 /* Keyboard Control/Status reg */
-#define     HD64465_KBCSR_KBCIE         0x8000    /* KBCK Input Enable */
-#define     HD64465_KBCSR_KBCOE         0x4000    /* KBCK Output Enable */
-#define     HD64465_KBCSR_KBDOE         0x2000    /* KB DATA Output Enable */
-#define     HD64465_KBCSR_KBCD          0x1000    /* KBCK Driven */
-#define     HD64465_KBCSR_KBDD          0x0800    /* KB DATA Driven */
-#define     HD64465_KBCSR_KBCS          0x0400    /* KBCK pin Status */
-#define     HD64465_KBCSR_KBDS          0x0200    /* KB DATA pin Status */
-#define     HD64465_KBCSR_KBDP          0x0100    /* KB DATA Parity bit */
-#define     HD64465_KBCSR_KBD_MASK      0x00ff    /* KD DATA shift reg */
-#define HD64465_REG_KBISR      0x1dc04 /* Keyboard Interrupt Status reg */
-#define     HD64465_KBISR_KBRDF         0x0001    /* KB Received Data Full */
-#define HD64465_REG_MSCSR      0x1dc10 /* Mouse Control/Status reg */
-#define HD64465_REG_MSISR      0x1dc14 /* Mouse Interrupt Status reg */
-
-
-/*
- * Logical address at which the HD64465 is mapped.  Note that this
- * should always be in the P2 segment (uncached and untranslated).
- */
-#ifndef CONFIG_HD64465_IOBASE
-#define CONFIG_HD64465_IOBASE  0xb0000000
-#endif
-/*
- * The HD64465 multiplexes all its modules' interrupts onto
- * this single interrupt.
- */
-#ifndef CONFIG_HD64465_IRQ
-#define CONFIG_HD64465_IRQ     5
-#endif
-
-
-#define _HD64465_IO_MASK       0xf8000000
-#define is_hd64465_addr(addr) \
-       ((addr & _HD64465_IO_MASK) == (CONFIG_HD64465_IOBASE & _HD64465_IO_MASK))
-
-/*
- * A range of 16 virtual interrupts generated by
- * demuxing the HD64465 muxed interrupt.
- */
-#define HD64465_IRQ_BASE       OFFCHIP_IRQ_BASE
-#define HD64465_IRQ_NUM        16
-#define HD64465_IRQ_ADC        (HD64465_IRQ_BASE+0)
-#define HD64465_IRQ_USB        (HD64465_IRQ_BASE+1)
-#define HD64465_IRQ_SCDI       (HD64465_IRQ_BASE+2)
-#define HD64465_IRQ_PARALLEL   (HD64465_IRQ_BASE+3)
-/* bit 4 is reserved */
-#define HD64465_IRQ_UART       (HD64465_IRQ_BASE+5)
-#define HD64465_IRQ_IRDA       (HD64465_IRQ_BASE+6)
-#define HD64465_IRQ_PS2MOUSE   (HD64465_IRQ_BASE+7)
-#define HD64465_IRQ_KBC        (HD64465_IRQ_BASE+8)
-#define HD64465_IRQ_TIMER1     (HD64465_IRQ_BASE+9)
-#define HD64465_IRQ_TIMER0     (HD64465_IRQ_BASE+10)
-#define HD64465_IRQ_GPIO       (HD64465_IRQ_BASE+11)
-#define HD64465_IRQ_AFE        (HD64465_IRQ_BASE+12)
-#define HD64465_IRQ_PCMCIA1    (HD64465_IRQ_BASE+13)
-#define HD64465_IRQ_PCMCIA0    (HD64465_IRQ_BASE+14)
-#define HD64465_IRQ_PS2KBD             (HD64465_IRQ_BASE+15)
-
-/* Constants for PCMCIA mappings */
-#define HD64465_PCC_WINDOW     0x01000000
-
-#define HD64465_PCC0_BASE      0xb8000000      /* area 6 */
-#define HD64465_PCC0_ATTR      (HD64465_PCC0_BASE)
-#define HD64465_PCC0_COMM      (HD64465_PCC0_BASE+HD64465_PCC_WINDOW)
-#define HD64465_PCC0_IO                (HD64465_PCC0_BASE+2*HD64465_PCC_WINDOW)
-
-#define HD64465_PCC1_BASE      0xb4000000      /* area 5 */
-#define HD64465_PCC1_ATTR      (HD64465_PCC1_BASE)
-#define HD64465_PCC1_COMM      (HD64465_PCC1_BASE+HD64465_PCC_WINDOW)
-#define HD64465_PCC1_IO                (HD64465_PCC1_BASE+2*HD64465_PCC_WINDOW)
-
-/*
- * Base of USB controller interface (as memory)
- */
-#define HD64465_USB_BASE       (CONFIG_HD64465_IOBASE+0xb000)
-#define HD64465_USB_LEN        0x1000
-/*
- * Base of embedded SRAM, used for USB controller.
- */
-#define HD64465_SRAM_BASE      (CONFIG_HD64465_IOBASE+0x9000)
-#define HD64465_SRAM_LEN       0x1000
-
-
-
-#endif /* _ASM_SH_HD64465_  */
diff --git a/include/asm-sh/hd64465/io.h b/include/asm-sh/hd64465/io.h
deleted file mode 100644 (file)
index 139f147..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-sh/hd64465/io.h
- *
- * By Greg Banks <gbanks@pocketpenguins.com>
- * (c) 2000 PocketPenguins Inc.
- *
- * Derived from io_hd64461.h, which bore the message:
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an HD64465 "Windows CE Intelligent Peripheral Controller".
- */
-
-#ifndef _ASM_SH_IO_HD64465_H
-#define _ASM_SH_IO_HD64465_H
-
-extern unsigned char hd64465_inb(unsigned long port);
-extern unsigned short hd64465_inw(unsigned long port);
-extern unsigned int hd64465_inl(unsigned long port);
-
-extern void hd64465_outb(unsigned char value, unsigned long port);
-extern void hd64465_outw(unsigned short value, unsigned long port);
-extern void hd64465_outl(unsigned int value, unsigned long port);
-
-extern unsigned char hd64465_inb_p(unsigned long port);
-extern void hd64465_outb_p(unsigned char value, unsigned long port);
-
-extern unsigned long hd64465_isa_port2addr(unsigned long offset);
-extern int hd64465_irq_demux(int irq);
-/* Provision for generic secondary demux step -- used by PCMCIA code */
-extern void hd64465_register_irq_demux(int irq,
-               int (*demux)(int irq, void *dev), void *dev);
-extern void hd64465_unregister_irq_demux(int irq);
-/* Set this variable to 1 to see port traffic */
-extern int hd64465_io_debug;
-/* Map a range of ports to a range of kernel virtual memory.
- */
-extern void hd64465_port_map(unsigned short baseport, unsigned int nports,
-                            unsigned long addr, unsigned char shift);
-extern void hd64465_port_unmap(unsigned short baseport, unsigned int nports);
-
-#endif /* _ASM_SH_IO_HD64465_H */
diff --git a/include/asm-sh/heartbeat.h b/include/asm-sh/heartbeat.h
deleted file mode 100644 (file)
index 724a43e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ASM_SH_HEARTBEAT_H
-#define __ASM_SH_HEARTBEAT_H
-
-#include <linux/timer.h>
-
-#define HEARTBEAT_INVERTED     (1 << 0)
-
-struct heartbeat_data {
-       void __iomem *base;
-       unsigned char *bit_pos;
-       unsigned int nr_bits;
-       struct timer_list timer;
-       unsigned int regsize;
-       unsigned long flags;
-};
-
-#endif /* __ASM_SH_HEARTBEAT_H */
diff --git a/include/asm-sh/hp6xx.h b/include/asm-sh/hp6xx.h
deleted file mode 100644 (file)
index 0d4165a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef __ASM_SH_HP6XX_H
-#define __ASM_SH_HP6XX_H
-
-/*
- * Copyright (C) 2003, 2004, 2005  Andriy Skulysh
- *
- * 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.
- *
- */
-
-#define HP680_BTN_IRQ          32      /* IRQ0_IRQ */
-#define HP680_TS_IRQ           35      /* IRQ3_IRQ */
-#define HP680_HD64461_IRQ      36      /* IRQ4_IRQ */
-
-#define DAC_LCD_BRIGHTNESS     0
-#define DAC_SPEAKER_VOLUME     1
-
-#define PGDR_OPENED            0x01
-#define PGDR_MAIN_BATTERY_OUT  0x04
-#define PGDR_PLAY_BUTTON       0x08
-#define PGDR_REWIND_BUTTON     0x10
-#define PGDR_RECORD_BUTTON     0x20
-
-#define PHDR_TS_PEN_DOWN       0x08
-
-#define PJDR_LED_BLINK         0x02
-
-#define PKDR_LED_GREEN         0x10
-
-#define SCPDR_TS_SCAN_ENABLE   0x20
-#define SCPDR_TS_SCAN_Y                0x02
-#define SCPDR_TS_SCAN_X                0x01
-
-#define SCPCR_TS_ENABLE                0x405
-#define SCPCR_TS_MASK          0xc0f
-
-#define ADC_CHANNEL_TS_Y       1
-#define ADC_CHANNEL_TS_X       2
-#define ADC_CHANNEL_BATTERY    3
-#define ADC_CHANNEL_BACKUP     4
-#define ADC_CHANNEL_CHARGE     5
-
-#define HD64461_GPADR_SPEAKER  0x01
-#define HD64461_GPADR_PCMCIA0  (0x02|0x08)
-
-#define HD64461_GPBDR_LCDOFF   0x01
-#define HD64461_GPBDR_LCD_CONTRAST_MASK        0x78
-#define HD64461_GPBDR_LED_RED  0x80
-
-#include <asm/hd64461.h>
-#include <asm/io.h>
-
-#define PJDR   0xa4000130
-#define PKDR   0xa4000132
-
-#endif /* __ASM_SH_HP6XX_H */
diff --git a/include/asm-sh/hugetlb.h b/include/asm-sh/hugetlb.h
deleted file mode 100644 (file)
index 967068f..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef _ASM_SH_HUGETLB_H
-#define _ASM_SH_HUGETLB_H
-
-#include <asm/page.h>
-
-
-static inline int is_hugepage_only_range(struct mm_struct *mm,
-                                        unsigned long addr,
-                                        unsigned long len) {
-       return 0;
-}
-
-/*
- * If the arch doesn't supply something else, assume that hugepage
- * size aligned regions are ok without further preparation.
- */
-static inline int prepare_hugepage_range(struct file *file,
-                       unsigned long addr, unsigned long len)
-{
-       if (len & ~HPAGE_MASK)
-               return -EINVAL;
-       if (addr & ~HPAGE_MASK)
-               return -EINVAL;
-       return 0;
-}
-
-static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) {
-}
-
-static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
-                                         unsigned long addr, unsigned long end,
-                                         unsigned long floor,
-                                         unsigned long ceiling)
-{
-       free_pgd_range(tlb, addr, end, floor, ceiling);
-}
-
-static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
-                                  pte_t *ptep, pte_t pte)
-{
-       set_pte_at(mm, addr, ptep, pte);
-}
-
-static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
-                                           unsigned long addr, pte_t *ptep)
-{
-       return ptep_get_and_clear(mm, addr, ptep);
-}
-
-static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
-                                        unsigned long addr, pte_t *ptep)
-{
-}
-
-static inline int huge_pte_none(pte_t pte)
-{
-       return pte_none(pte);
-}
-
-static inline pte_t huge_pte_wrprotect(pte_t pte)
-{
-       return pte_wrprotect(pte);
-}
-
-static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
-                                          unsigned long addr, pte_t *ptep)
-{
-       ptep_set_wrprotect(mm, addr, ptep);
-}
-
-static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
-                                            unsigned long addr, pte_t *ptep,
-                                            pte_t pte, int dirty)
-{
-       return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
-}
-
-static inline pte_t huge_ptep_get(pte_t *ptep)
-{
-       return *ptep;
-}
-
-static inline int arch_prepare_hugepage(struct page *page)
-{
-       return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
-#endif /* _ASM_SH_HUGETLB_H */
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h
deleted file mode 100644 (file)
index d557b00..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef __ASM_SH_HW_IRQ_H
-#define __ASM_SH_HW_IRQ_H
-
-#include <linux/init.h>
-#include <asm/atomic.h>
-
-extern atomic_t irq_err_count;
-
-struct ipr_data {
-       unsigned char irq;
-       unsigned char ipr_idx;          /* Index for the IPR registered */
-       unsigned char shift;            /* Number of bits to shift the data */
-       unsigned char priority;         /* The priority */
-};
-
-struct ipr_desc {
-       unsigned long *ipr_offsets;
-       unsigned int nr_offsets;
-       struct ipr_data *ipr_data;
-       unsigned int nr_irqs;
-       struct irq_chip chip;
-};
-
-void register_ipr_controller(struct ipr_desc *);
-
-typedef unsigned char intc_enum;
-
-struct intc_vect {
-       intc_enum enum_id;
-       unsigned short vect;
-};
-
-#define INTC_VECT(enum_id, vect) { enum_id, vect }
-#define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq))
-
-struct intc_group {
-       intc_enum enum_id;
-       intc_enum enum_ids[32];
-};
-
-#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
-
-struct intc_mask_reg {
-       unsigned long set_reg, clr_reg, reg_width;
-       intc_enum enum_ids[32];
-#ifdef CONFIG_SMP
-       unsigned long smp;
-#endif
-};
-
-struct intc_prio_reg {
-       unsigned long set_reg, clr_reg, reg_width, field_width;
-       intc_enum enum_ids[16];
-#ifdef CONFIG_SMP
-       unsigned long smp;
-#endif
-};
-
-struct intc_sense_reg {
-       unsigned long reg, reg_width, field_width;
-       intc_enum enum_ids[16];
-};
-
-#ifdef CONFIG_SMP
-#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
-#else
-#define INTC_SMP(stride, nr)
-#endif
-
-struct intc_desc {
-       struct intc_vect *vectors;
-       unsigned int nr_vectors;
-       struct intc_group *groups;
-       unsigned int nr_groups;
-       struct intc_mask_reg *mask_regs;
-       unsigned int nr_mask_regs;
-       struct intc_prio_reg *prio_regs;
-       unsigned int nr_prio_regs;
-       struct intc_sense_reg *sense_regs;
-       unsigned int nr_sense_regs;
-       char *name;
-#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
-       struct intc_mask_reg *ack_regs;
-       unsigned int nr_ack_regs;
-#endif
-};
-
-#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
-#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups,           \
-       mask_regs, prio_regs, sense_regs)                               \
-struct intc_desc symbol __initdata = {                                 \
-       _INTC_ARRAY(vectors), _INTC_ARRAY(groups),                      \
-       _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs),                 \
-       _INTC_ARRAY(sense_regs),                                        \
-       chipname,                                                       \
-}
-
-#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
-#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups,       \
-       mask_regs, prio_regs, sense_regs, ack_regs)                     \
-struct intc_desc symbol __initdata = {                                 \
-       _INTC_ARRAY(vectors), _INTC_ARRAY(groups),                      \
-       _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs),                 \
-       _INTC_ARRAY(sense_regs),                                        \
-       chipname,                                                       \
-       _INTC_ARRAY(ack_regs),                                          \
-}
-#endif
-
-void __init register_intc_controller(struct intc_desc *desc);
-int intc_set_priority(unsigned int irq, unsigned int prio);
-
-void __init plat_irq_setup(void);
-#ifdef CONFIG_CPU_SH3
-void __init plat_irq_setup_sh3(void);
-#endif
-
-enum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210,
-       IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK,
-       IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
-void __init plat_irq_setup_pins(int mode);
-
-#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/include/asm-sh/i2c-sh7760.h b/include/asm-sh/i2c-sh7760.h
deleted file mode 100644 (file)
index 2418211..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * MMIO/IRQ and platform data for SH7760 I2C channels
- */
-
-#ifndef _I2C_SH7760_H_
-#define _I2C_SH7760_H_
-
-#define SH7760_I2C_DEVNAME     "sh7760-i2c"
-
-#define SH7760_I2C0_MMIO       0xFE140000
-#define SH7760_I2C0_MMIOEND    0xFE14003B
-#define SH7760_I2C0_IRQ                62
-
-#define SH7760_I2C1_MMIO       0xFE150000
-#define SH7760_I2C1_MMIOEND    0xFE15003B
-#define SH7760_I2C1_IRQ                63
-
-struct sh7760_i2c_platdata {
-       unsigned int speed_khz;
-};
-
-#endif
diff --git a/include/asm-sh/ilsel.h b/include/asm-sh/ilsel.h
deleted file mode 100644 (file)
index e3d304b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef __ASM_SH_ILSEL_H
-#define __ASM_SH_ILSEL_H
-
-typedef enum {
-       ILSEL_NONE,
-       ILSEL_LAN,
-       ILSEL_USBH_I,
-       ILSEL_USBH_S,
-       ILSEL_USBH_V,
-       ILSEL_RTC,
-       ILSEL_USBP_I,
-       ILSEL_USBP_S,
-       ILSEL_USBP_V,
-       ILSEL_KEY,
-
-       /*
-        * ILSEL Aliases - corner cases for interleaved level tables.
-        *
-        * Someone thought this was a good idea and less hassle than
-        * demuxing a shared vector, really.
-        */
-
-       /* ILSEL0 and 2 */
-       ILSEL_FPGA0,
-       ILSEL_FPGA1,
-       ILSEL_EX1,
-       ILSEL_EX2,
-       ILSEL_EX3,
-       ILSEL_EX4,
-
-       /* ILSEL1 and 3 */
-       ILSEL_FPGA2 = ILSEL_FPGA0,
-       ILSEL_FPGA3 = ILSEL_FPGA1,
-       ILSEL_EX5 = ILSEL_EX1,
-       ILSEL_EX6 = ILSEL_EX2,
-       ILSEL_EX7 = ILSEL_EX3,
-       ILSEL_EX8 = ILSEL_EX4,
-} ilsel_source_t;
-
-/* arch/sh/boards/renesas/x3proto/ilsel.c */
-int ilsel_enable(ilsel_source_t set);
-int ilsel_enable_fixed(ilsel_source_t set, unsigned int level);
-void ilsel_disable(unsigned int irq);
-
-#endif /* __ASM_SH_ILSEL_H */
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
deleted file mode 100644 (file)
index a4fbf0c..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-#ifndef __ASM_SH_IO_H
-#define __ASM_SH_IO_H
-
-/*
- * Convention:
- *    read{b,w,l}/write{b,w,l} are for PCI,
- *    while in{b,w,l}/out{b,w,l} are for ISA
- * These may (will) be platform specific function.
- * In addition we have 'pausing' versions: in{b,w,l}_p/out{b,w,l}_p
- * and 'string' versions: ins{b,w,l}/outs{b,w,l}
- * For read{b,w,l} and write{b,w,l} there are also __raw versions, which
- * do not have a memory barrier after them.
- *
- * In addition, we have
- *   ctrl_in{b,w,l}/ctrl_out{b,w,l} for SuperH specific I/O.
- *   which are processor specific.
- */
-
-/*
- * We follow the Alpha convention here:
- *  __inb expands to an inline function call (which calls via the mv)
- *  _inb  is a real function call (note ___raw fns are _ version of __raw)
- *  inb   by default expands to _inb, but the machine specific code may
- *        define it to __inb if it chooses.
- */
-#include <asm/cache.h>
-#include <asm/system.h>
-#include <asm/addrspace.h>
-#include <asm/machvec.h>
-#include <asm/pgtable.h>
-#include <asm-generic/iomap.h>
-
-#ifdef __KERNEL__
-
-/*
- * Depending on which platform we are running on, we need different
- * I/O functions.
- */
-#define __IO_PREFIX    generic
-#include <asm/io_generic.h>
-#include <asm/io_trapped.h>
-
-#define maybebadio(port) \
-  printk(KERN_ERR "bad PC-like io %s:%u for port 0x%lx at 0x%08x\n", \
-        __FUNCTION__, __LINE__, (port), (u32)__builtin_return_address(0))
-
-/*
- * Since boards are able to define their own set of I/O routines through
- * their respective machine vector, we always wrap through the mv.
- *
- * Also, in the event that a board hasn't provided its own definition for
- * a given routine, it will be wrapped to generic code at run-time.
- */
-
-#define __inb(p)       sh_mv.mv_inb((p))
-#define __inw(p)       sh_mv.mv_inw((p))
-#define __inl(p)       sh_mv.mv_inl((p))
-#define __outb(x,p)    sh_mv.mv_outb((x),(p))
-#define __outw(x,p)    sh_mv.mv_outw((x),(p))
-#define __outl(x,p)    sh_mv.mv_outl((x),(p))
-
-#define __inb_p(p)     sh_mv.mv_inb_p((p))
-#define __inw_p(p)     sh_mv.mv_inw_p((p))
-#define __inl_p(p)     sh_mv.mv_inl_p((p))
-#define __outb_p(x,p)  sh_mv.mv_outb_p((x),(p))
-#define __outw_p(x,p)  sh_mv.mv_outw_p((x),(p))
-#define __outl_p(x,p)  sh_mv.mv_outl_p((x),(p))
-
-#define __insb(p,b,c)  sh_mv.mv_insb((p), (b), (c))
-#define __insw(p,b,c)  sh_mv.mv_insw((p), (b), (c))
-#define __insl(p,b,c)  sh_mv.mv_insl((p), (b), (c))
-#define __outsb(p,b,c) sh_mv.mv_outsb((p), (b), (c))
-#define __outsw(p,b,c) sh_mv.mv_outsw((p), (b), (c))
-#define __outsl(p,b,c) sh_mv.mv_outsl((p), (b), (c))
-
-#define __readb(a)     sh_mv.mv_readb((a))
-#define __readw(a)     sh_mv.mv_readw((a))
-#define __readl(a)     sh_mv.mv_readl((a))
-#define __writeb(v,a)  sh_mv.mv_writeb((v),(a))
-#define __writew(v,a)  sh_mv.mv_writew((v),(a))
-#define __writel(v,a)  sh_mv.mv_writel((v),(a))
-
-#define inb            __inb
-#define inw            __inw
-#define inl            __inl
-#define outb           __outb
-#define outw           __outw
-#define outl           __outl
-
-#define inb_p          __inb_p
-#define inw_p          __inw_p
-#define inl_p          __inl_p
-#define outb_p         __outb_p
-#define outw_p         __outw_p
-#define outl_p         __outl_p
-
-#define insb           __insb
-#define insw           __insw
-#define insl           __insl
-#define outsb          __outsb
-#define outsw          __outsw
-#define outsl          __outsl
-
-#define __raw_readb(a)         __readb((void __iomem *)(a))
-#define __raw_readw(a)         __readw((void __iomem *)(a))
-#define __raw_readl(a)         __readl((void __iomem *)(a))
-#define __raw_writeb(v, a)     __writeb(v, (void __iomem *)(a))
-#define __raw_writew(v, a)     __writew(v, (void __iomem *)(a))
-#define __raw_writel(v, a)     __writel(v, (void __iomem *)(a))
-
-void __raw_writesl(unsigned long addr, const void *data, int longlen);
-void __raw_readsl(unsigned long addr, void *data, int longlen);
-
-/*
- * The platform header files may define some of these macros to use
- * the inlined versions where appropriate.  These macros may also be
- * redefined by userlevel programs.
- */
-#ifdef __readb
-# define readb(a)      ({ unsigned int r_ = __raw_readb(a); mb(); r_; })
-#endif
-#ifdef __raw_readw
-# define readw(a)      ({ unsigned int r_ = __raw_readw(a); mb(); r_; })
-#endif
-#ifdef __raw_readl
-# define readl(a)      ({ unsigned int r_ = __raw_readl(a); mb(); r_; })
-#endif
-
-#ifdef __raw_writeb
-# define writeb(v,a)   ({ __raw_writeb((v),(a)); mb(); })
-#endif
-#ifdef __raw_writew
-# define writew(v,a)   ({ __raw_writew((v),(a)); mb(); })
-#endif
-#ifdef __raw_writel
-# define writel(v,a)   ({ __raw_writel((v),(a)); mb(); })
-#endif
-
-#define __BUILD_MEMORY_STRING(bwlq, type)                              \
-                                                                       \
-static inline void writes##bwlq(volatile void __iomem *mem,            \
-                               const void *addr, unsigned int count)   \
-{                                                                      \
-       const volatile type *__addr = addr;                             \
-                                                                       \
-       while (count--) {                                               \
-               __raw_write##bwlq(*__addr, mem);                        \
-               __addr++;                                               \
-       }                                                               \
-}                                                                      \
-                                                                       \
-static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
-                              unsigned int count)                      \
-{                                                                      \
-       volatile type *__addr = addr;                                   \
-                                                                       \
-       while (count--) {                                               \
-               *__addr = __raw_read##bwlq(mem);                        \
-               __addr++;                                               \
-       }                                                               \
-}
-
-__BUILD_MEMORY_STRING(b, u8)
-__BUILD_MEMORY_STRING(w, u16)
-#define writesl __raw_writesl
-#define readsl  __raw_readsl
-
-#define readb_relaxed(a) readb(a)
-#define readw_relaxed(a) readw(a)
-#define readl_relaxed(a) readl(a)
-
-/* Simple MMIO */
-#define ioread8(a)             readb(a)
-#define ioread16(a)            readw(a)
-#define ioread16be(a)          be16_to_cpu(__raw_readw((a)))
-#define ioread32(a)            readl(a)
-#define ioread32be(a)          be32_to_cpu(__raw_readl((a)))
-
-#define iowrite8(v,a)          writeb((v),(a))
-#define iowrite16(v,a)         writew((v),(a))
-#define iowrite16be(v,a)       __raw_writew(cpu_to_be16((v)),(a))
-#define iowrite32(v,a)         writel((v),(a))
-#define iowrite32be(v,a)       __raw_writel(cpu_to_be32((v)),(a))
-
-#define ioread8_rep(a, d, c)   readsb((a), (d), (c))
-#define ioread16_rep(a, d, c)  readsw((a), (d), (c))
-#define ioread32_rep(a, d, c)  readsl((a), (d), (c))
-
-#define iowrite8_rep(a, s, c)  writesb((a), (s), (c))
-#define iowrite16_rep(a, s, c) writesw((a), (s), (c))
-#define iowrite32_rep(a, s, c) writesl((a), (s), (c))
-
-#define mmiowb()       wmb()   /* synco on SH-4A, otherwise a nop */
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * This function provides a method for the generic case where a board-specific
- * ioport_map simply needs to return the port + some arbitrary port base.
- *
- * We use this at board setup time to implicitly set the port base, and
- * as a result, we can use the generic ioport_map.
- */
-static inline void __set_io_port_base(unsigned long pbase)
-{
-       extern unsigned long generic_io_base;
-
-       generic_io_base = pbase;
-}
-
-#define __ioport_map(p, n) sh_mv.mv_ioport_map((p), (n))
-
-/* We really want to try and get these to memcpy etc */
-extern void memcpy_fromio(void *, volatile void __iomem *, unsigned long);
-extern void memcpy_toio(volatile void __iomem *, const void *, unsigned long);
-extern void memset_io(volatile void __iomem *, int, unsigned long);
-
-/* SuperH on-chip I/O functions */
-static inline unsigned char ctrl_inb(unsigned long addr)
-{
-       return *(volatile unsigned char*)addr;
-}
-
-static inline unsigned short ctrl_inw(unsigned long addr)
-{
-       return *(volatile unsigned short*)addr;
-}
-
-static inline unsigned int ctrl_inl(unsigned long addr)
-{
-       return *(volatile unsigned long*)addr;
-}
-
-static inline unsigned long long ctrl_inq(unsigned long addr)
-{
-       return *(volatile unsigned long long*)addr;
-}
-
-static inline void ctrl_outb(unsigned char b, unsigned long addr)
-{
-       *(volatile unsigned char*)addr = b;
-}
-
-static inline void ctrl_outw(unsigned short b, unsigned long addr)
-{
-       *(volatile unsigned short*)addr = b;
-}
-
-static inline void ctrl_outl(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned long*)addr = b;
-}
-
-static inline void ctrl_outq(unsigned long long b, unsigned long addr)
-{
-       *(volatile unsigned long long*)addr = b;
-}
-
-static inline void ctrl_delay(void)
-{
-#ifdef P2SEG
-       ctrl_inw(P2SEG);
-#endif
-}
-
-/* Quad-word real-mode I/O, don't ask.. */
-unsigned long long peek_real_address_q(unsigned long long addr);
-unsigned long long poke_real_address_q(unsigned long long addr,
-                                      unsigned long long val);
-
-#if !defined(CONFIG_MMU)
-#define virt_to_phys(address)  ((unsigned long)(address))
-#define phys_to_virt(address)  ((void *)(address))
-#else
-#define virt_to_phys(address)  (__pa(address))
-#define phys_to_virt(address)  (__va(address))
-#endif
-
-/*
- * On 32-bit SH, we traditionally have the whole physical address space
- * mapped at all times (as MIPS does), so "ioremap()" and "iounmap()" do
- * not need to do anything but place the address in the proper segment.
- * This is true for P1 and P2 addresses, as well as some P3 ones.
- * However, most of the P3 addresses and newer cores using extended
- * addressing need to map through page tables, so the ioremap()
- * implementation becomes a bit more complicated.
- *
- * See arch/sh/mm/ioremap.c for additional notes on this.
- *
- * We cheat a bit and always return uncachable areas until we've fixed
- * the drivers to handle caching properly.
- *
- * On the SH-5 the concept of segmentation in the 1:1 PXSEG sense simply
- * doesn't exist, so everything must go through page tables.
- */
-#ifdef CONFIG_MMU
-void __iomem *__ioremap(unsigned long offset, unsigned long size,
-                       unsigned long flags);
-void __iounmap(void __iomem *addr);
-
-/* arch/sh/mm/ioremap_64.c */
-unsigned long onchip_remap(unsigned long addr, unsigned long size,
-                          const char *name);
-extern void onchip_unmap(unsigned long vaddr);
-#else
-#define __ioremap(offset, size, flags) ((void __iomem *)(offset))
-#define __iounmap(addr)                        do { } while (0)
-#define onchip_remap(addr, size, name) (addr)
-#define onchip_unmap(addr)             do { } while (0)
-#endif /* CONFIG_MMU */
-
-static inline void __iomem *
-__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
-{
-#ifdef CONFIG_SUPERH32
-       unsigned long last_addr = offset + size - 1;
-#endif
-       void __iomem *ret;
-
-       ret = __ioremap_trapped(offset, size);
-       if (ret)
-               return ret;
-
-#ifdef CONFIG_SUPERH32
-       /*
-        * For P1 and P2 space this is trivial, as everything is already
-        * mapped. Uncached access for P1 addresses are done through P2.
-        * In the P3 case or for addresses outside of the 29-bit space,
-        * mapping must be done by the PMB or by using page tables.
-        */
-       if (likely(PXSEG(offset) < P3SEG && PXSEG(last_addr) < P3SEG)) {
-               if (unlikely(flags & _PAGE_CACHABLE))
-                       return (void __iomem *)P1SEGADDR(offset);
-
-               return (void __iomem *)P2SEGADDR(offset);
-       }
-#endif
-
-       return __ioremap(offset, size, flags);
-}
-
-#define ioremap(offset, size)                          \
-       __ioremap_mode((offset), (size), 0)
-#define ioremap_nocache(offset, size)                  \
-       __ioremap_mode((offset), (size), 0)
-#define ioremap_cache(offset, size)                    \
-       __ioremap_mode((offset), (size), _PAGE_CACHABLE)
-#define p3_ioremap(offset, size, flags)                        \
-       __ioremap((offset), (size), (flags))
-#define iounmap(addr)                                  \
-       __iounmap((addr))
-
-/*
- * 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 /* __ASM_SH_IO_H */
diff --git a/include/asm-sh/io_generic.h b/include/asm-sh/io_generic.h
deleted file mode 100644 (file)
index 92fc607..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Trivial I/O routine definitions, intentionally meant to be included
- * multiple times. Ugly I/O routine concatenation helpers taken from
- * alpha. Must be included _before_ io.h to avoid preprocessor-induced
- * routine mismatch.
- */
-#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
-#define _IO_CONCAT(a,b)        a ## _ ## b
-
-#ifndef __IO_PREFIX
-#error "Don't include this header without a valid system prefix"
-#endif
-
-u8 IO_CONCAT(__IO_PREFIX,inb)(unsigned long);
-u16 IO_CONCAT(__IO_PREFIX,inw)(unsigned long);
-u32 IO_CONCAT(__IO_PREFIX,inl)(unsigned long);
-
-void IO_CONCAT(__IO_PREFIX,outb)(u8, unsigned long);
-void IO_CONCAT(__IO_PREFIX,outw)(u16, unsigned long);
-void IO_CONCAT(__IO_PREFIX,outl)(u32, unsigned long);
-
-u8 IO_CONCAT(__IO_PREFIX,inb_p)(unsigned long);
-u16 IO_CONCAT(__IO_PREFIX,inw_p)(unsigned long);
-u32 IO_CONCAT(__IO_PREFIX,inl_p)(unsigned long);
-void IO_CONCAT(__IO_PREFIX,outb_p)(u8, unsigned long);
-void IO_CONCAT(__IO_PREFIX,outw_p)(u16, unsigned long);
-void IO_CONCAT(__IO_PREFIX,outl_p)(u32, unsigned long);
-
-void IO_CONCAT(__IO_PREFIX,insb)(unsigned long, void *dst, unsigned long count);
-void IO_CONCAT(__IO_PREFIX,insw)(unsigned long, void *dst, unsigned long count);
-void IO_CONCAT(__IO_PREFIX,insl)(unsigned long, void *dst, unsigned long count);
-void IO_CONCAT(__IO_PREFIX,outsb)(unsigned long, const void *src, unsigned long count);
-void IO_CONCAT(__IO_PREFIX,outsw)(unsigned long, const void *src, unsigned long count);
-void IO_CONCAT(__IO_PREFIX,outsl)(unsigned long, const void *src, unsigned long count);
-
-u8 IO_CONCAT(__IO_PREFIX,readb)(void __iomem *);
-u16 IO_CONCAT(__IO_PREFIX,readw)(void __iomem *);
-u32 IO_CONCAT(__IO_PREFIX,readl)(void __iomem *);
-void IO_CONCAT(__IO_PREFIX,writeb)(u8, void __iomem *);
-void IO_CONCAT(__IO_PREFIX,writew)(u16, void __iomem *);
-void IO_CONCAT(__IO_PREFIX,writel)(u32, void __iomem *);
-
-void *IO_CONCAT(__IO_PREFIX,ioremap)(unsigned long offset, unsigned long size);
-void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr);
-
-void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size);
-void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr);
-
-#undef __IO_PREFIX
diff --git a/include/asm-sh/io_trapped.h b/include/asm-sh/io_trapped.h
deleted file mode 100644 (file)
index f1251d4..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef __ASM_SH_IO_TRAPPED_H
-#define __ASM_SH_IO_TRAPPED_H
-
-#include <linux/list.h>
-#include <linux/ioport.h>
-#include <asm/page.h>
-
-#define IO_TRAPPED_MAGIC 0xfeedbeef
-
-struct trapped_io {
-       unsigned int magic;
-       struct resource *resource;
-       unsigned int num_resources;
-       unsigned int minimum_bus_width;
-       struct list_head list;
-       void __iomem *virt_base;
-} __aligned(PAGE_SIZE);
-
-#ifdef CONFIG_IO_TRAPPED
-int register_trapped_io(struct trapped_io *tiop);
-int handle_trapped_io(struct pt_regs *regs, unsigned long address);
-
-void __iomem *match_trapped_io_handler(struct list_head *list,
-                                      unsigned long offset,
-                                      unsigned long size);
-
-#ifdef CONFIG_HAS_IOMEM
-extern struct list_head trapped_mem;
-
-static inline void __iomem *
-__ioremap_trapped(unsigned long offset, unsigned long size)
-{
-       return match_trapped_io_handler(&trapped_mem, offset, size);
-}
-#else
-#define __ioremap_trapped(offset, size) NULL
-#endif
-
-#ifdef CONFIG_HAS_IOPORT
-extern struct list_head trapped_io;
-
-static inline void __iomem *
-__ioport_map_trapped(unsigned long offset, unsigned long size)
-{
-       return match_trapped_io_handler(&trapped_io, offset, size);
-}
-#else
-#define __ioport_map_trapped(offset, size) NULL
-#endif
-
-#else
-#define register_trapped_io(tiop) (-1)
-#define handle_trapped_io(tiop, address) 0
-#define __ioremap_trapped(offset, size) NULL
-#define __ioport_map_trapped(offset, size) NULL
-#endif
-
-#endif /* __ASM_SH_IO_TRAPPED_H */
diff --git a/include/asm-sh/ioctl.h b/include/asm-sh/ioctl.h
deleted file mode 100644 (file)
index b279fe0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/ioctl.h>
diff --git a/include/asm-sh/ioctls.h b/include/asm-sh/ioctls.h
deleted file mode 100644 (file)
index c212c37..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef __ASM_SH_IOCTLS_H
-#define __ASM_SH_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 TCGETS         0x5401
-#define TCSETS         0x5402
-#define TCSETSW                0x5403
-#define TCSETSF                0x5404
-
-#define TCGETA         0x80127417      /* _IOR('t', 23, struct termio) */
-#define TCSETA         0x40127418      /* _IOW('t', 24, struct termio) */
-#define TCSETAW                0x40127419      /* _IOW('t', 25, struct termio) */
-#define TCSETAF                0x4012741C      /* _IOW('t', 28, struct termio) */
-
-#define TCSBRK         _IO('t', 29)
-#define TCXONC         _IO('t', 30)
-#define TCFLSH         _IO('t', 31)
-
-#define TIOCSWINSZ     0x40087467      /* _IOW('t', 103, struct winsize) */
-#define TIOCGWINSZ     0x80087468      /* _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 TIOCSPGRP      _IOW('t', 118, int)
-#define TIOCGPGRP      _IOR('t', 119, int)
-
-#define TIOCEXCL       _IO('T', 12) /* 0x540C */
-#define TIOCNXCL       _IO('T', 13) /* 0x540D */
-#define TIOCSCTTY      _IO('T', 14) /* 0x540E */
-
-#define TIOCSTI                _IOW('T', 18, char) /* 0x5412 */
-#define TIOCMGET       _IOR('T', 21, unsigned int) /* 0x5415 */
-#define TIOCMBIS       _IOW('T', 22, unsigned int) /* 0x5416 */
-#define TIOCMBIC       _IOW('T', 23, unsigned int) /* 0x5417 */
-#define TIOCMSET       _IOW('T', 24, unsigned int) /* 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 TIOCGSOFTCAR   _IOR('T', 25, unsigned int) /* 0x5419 */
-#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int) /* 0x541A */
-#define TIOCLINUX      _IOW('T', 28, char) /* 0x541C */
-#define TIOCCONS       _IO('T', 29) /* 0x541D */
-#define TIOCGSERIAL    0x803C541E      /* _IOR('T', 30, struct serial_struct) 0x541E */
-#define TIOCSSERIAL    0x403C541F      /* _IOW('T', 31, struct serial_struct) 0x541F */
-#define TIOCPKT                _IOW('T', 32, int) /* 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      _IO('T', 34) /* 0x5422 */
-#define TIOCSETD       _IOW('T', 35, int) /* 0x5423 */
-#define TIOCGETD       _IOR('T', 36, int) /* 0x5424 */
-#define TCSBRKP                _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
-#define TIOCSBRK       _IO('T', 39) /* 0x5427 */ /* BSD compatibility */
-#define TIOCCBRK       _IO('T', 40) /* 0x5428 */ /* BSD compatibility */
-#define TIOCGSID       _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
-#define TCGETS2                _IOR('T', 42, struct termios2)
-#define TCSETS2                _IOW('T', 43, struct termios2)
-#define TCSETSW2       _IOW('T', 44, struct termios2)
-#define TCSETSF2       _IOW('T', 45, struct termios2)
-#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  _IO('T', 83) /* 0x5453 */
-#define TIOCSERGWILD   _IOR('T', 84,  int) /* 0x5454 */
-#define TIOCSERSWILD   _IOW('T', 85,  int) /* 0x5455 */
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x80d85458      /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
-#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
-  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#define TIOCSERGETMULTI 0x80A8545A     /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
-#define TIOCSERSETMULTI 0x40A8545B     /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
-
-#define TIOCMIWAIT     _IO('T', 92) /* 0x545C */       /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
-
-#endif /* __ASM_SH_IOCTLS_H */
diff --git a/include/asm-sh/ipcbuf.h b/include/asm-sh/ipcbuf.h
deleted file mode 100644 (file)
index 5ffc997..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __ASM_SH_IPCBUF_H__
-#define __ASM_SH_IPCBUF_H__
-
-/*
- * The ipc64_perm structure for i386 architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 32-bit mode_t and seq
- * - 2 miscellaneous 32-bit values
- */
-
-struct ipc64_perm
-{
-       __kernel_key_t          key;
-       __kernel_uid32_t        uid;
-       __kernel_gid32_t        gid;
-       __kernel_uid32_t        cuid;
-       __kernel_gid32_t        cgid;
-       __kernel_mode_t         mode;
-       unsigned short          __pad1;
-       unsigned short          seq;
-       unsigned short          __pad2;
-       unsigned long           __unused1;
-       unsigned long           __unused2;
-};
-
-#endif /* __ASM_SH_IPCBUF_H__ */
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
deleted file mode 100644 (file)
index ca66e5d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef __ASM_SH_IRQ_H
-#define __ASM_SH_IRQ_H
-
-#include <asm/machvec.h>
-
-/*
- * A sane default based on a reasonable vector table size, platforms are
- * advised to cap this at the hard limit that they're interested in
- * through the machvec.
- */
-#define NR_IRQS 256
-
-/*
- * Convert back and forth between INTEVT and IRQ values.
- */
-#ifdef CONFIG_CPU_HAS_INTEVT
-#define evt2irq(evt)           (((evt) >> 5) - 16)
-#define irq2evt(irq)           (((irq) + 16) << 5)
-#else
-#define evt2irq(evt)           (evt)
-#define irq2evt(irq)           (irq)
-#endif
-
-/*
- * Simple Mask Register Support
- */
-extern void make_maskreg_irq(unsigned int irq);
-extern unsigned short *irq_mask_register;
-
-/*
- * PINT IRQs
- */
-void init_IRQ_pint(void);
-void make_imask_irq(unsigned int irq);
-
-static inline int generic_irq_demux(int irq)
-{
-       return irq;
-}
-
-#define irq_canonicalize(irq)  (irq)
-#define irq_demux(irq)         sh_mv.mv_irq_demux(irq)
-
-#ifdef CONFIG_IRQSTACKS
-extern void irq_ctx_init(int cpu);
-extern void irq_ctx_exit(int cpu);
-# define __ARCH_HAS_DO_SOFTIRQ
-#else
-# define irq_ctx_init(cpu) do { } while (0)
-# define irq_ctx_exit(cpu) do { } while (0)
-#endif
-
-#ifdef CONFIG_CPU_SH5
-#include <asm/cpu/irq.h>
-#endif
-
-#endif /* __ASM_SH_IRQ_H */
diff --git a/include/asm-sh/irq_regs.h b/include/asm-sh/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-sh/irqflags.h b/include/asm-sh/irqflags.h
deleted file mode 100644 (file)
index 46e71da..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __ASM_SH_IRQFLAGS_H
-#define __ASM_SH_IRQFLAGS_H
-
-#ifdef CONFIG_SUPERH32
-#include "irqflags_32.h"
-#else
-#include "irqflags_64.h"
-#endif
-
-#define raw_local_save_flags(flags) \
-               do { (flags) = __raw_local_save_flags(); } while (0)
-
-static inline int raw_irqs_disabled_flags(unsigned long flags)
-{
-       return (flags != 0);
-}
-
-static inline int raw_irqs_disabled(void)
-{
-       unsigned long flags = __raw_local_save_flags();
-
-       return raw_irqs_disabled_flags(flags);
-}
-
-#define raw_local_irq_save(flags) \
-               do { (flags) = __raw_local_irq_save(); } while (0)
-
-static inline void raw_local_irq_restore(unsigned long flags)
-{
-       if ((flags & 0xf0) != 0xf0)
-               raw_local_irq_enable();
-}
-
-#endif /* __ASM_SH_IRQFLAGS_H */
diff --git a/include/asm-sh/irqflags_32.h b/include/asm-sh/irqflags_32.h
deleted file mode 100644 (file)
index 60218f5..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef __ASM_SH_IRQFLAGS_32_H
-#define __ASM_SH_IRQFLAGS_32_H
-
-static inline void raw_local_irq_enable(void)
-{
-       unsigned long __dummy0, __dummy1;
-
-       __asm__ __volatile__ (
-               "stc    sr, %0\n\t"
-               "and    %1, %0\n\t"
-#ifdef CONFIG_CPU_HAS_SR_RB
-               "stc    r6_bank, %1\n\t"
-               "or     %1, %0\n\t"
-#endif
-               "ldc    %0, sr\n\t"
-               : "=&r" (__dummy0), "=r" (__dummy1)
-               : "1" (~0x000000f0)
-               : "memory"
-       );
-}
-
-static inline void raw_local_irq_disable(void)
-{
-       unsigned long flags;
-
-       __asm__ __volatile__ (
-               "stc    sr, %0\n\t"
-               "or     #0xf0, %0\n\t"
-               "ldc    %0, sr\n\t"
-               : "=&z" (flags)
-               : /* no inputs */
-               : "memory"
-       );
-}
-
-static inline void set_bl_bit(void)
-{
-       unsigned long __dummy0, __dummy1;
-
-       __asm__ __volatile__ (
-               "stc    sr, %0\n\t"
-               "or     %2, %0\n\t"
-               "and    %3, %0\n\t"
-               "ldc    %0, sr\n\t"
-               : "=&r" (__dummy0), "=r" (__dummy1)
-               : "r" (0x10000000), "r" (0xffffff0f)
-               : "memory"
-       );
-}
-
-static inline void clear_bl_bit(void)
-{
-       unsigned long __dummy0, __dummy1;
-
-       __asm__ __volatile__ (
-               "stc    sr, %0\n\t"
-               "and    %2, %0\n\t"
-               "ldc    %0, sr\n\t"
-               : "=&r" (__dummy0), "=r" (__dummy1)
-               : "1" (~0x10000000)
-               : "memory"
-       );
-}
-
-static inline unsigned long __raw_local_save_flags(void)
-{
-       unsigned long flags;
-
-       __asm__ __volatile__ (
-               "stc    sr, %0\n\t"
-               "and    #0xf0, %0\n\t"
-               : "=&z" (flags)
-               : /* no inputs */
-               : "memory"
-       );
-
-       return flags;
-}
-
-static inline unsigned long __raw_local_irq_save(void)
-{
-       unsigned long flags, __dummy;
-
-       __asm__ __volatile__ (
-               "stc    sr, %1\n\t"
-               "mov    %1, %0\n\t"
-               "or     #0xf0, %0\n\t"
-               "ldc    %0, sr\n\t"
-               "mov    %1, %0\n\t"
-               "and    #0xf0, %0\n\t"
-               : "=&z" (flags), "=&r" (__dummy)
-               : /* no inputs */
-               : "memory"
-       );
-
-       return flags;
-}
-
-#endif /* __ASM_SH_IRQFLAGS_32_H */
diff --git a/include/asm-sh/irqflags_64.h b/include/asm-sh/irqflags_64.h
deleted file mode 100644 (file)
index 4f6b8a5..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef __ASM_SH_IRQFLAGS_64_H
-#define __ASM_SH_IRQFLAGS_64_H
-
-#include <asm/cpu/registers.h>
-
-#define SR_MASK_LL     0x00000000000000f0LL
-#define SR_BL_LL       0x0000000010000000LL
-
-static inline void raw_local_irq_enable(void)
-{
-       unsigned long long __dummy0, __dummy1 = ~SR_MASK_LL;
-
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "and       %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy0)
-                            : "r" (__dummy1));
-}
-
-static inline void raw_local_irq_disable(void)
-{
-       unsigned long long __dummy0, __dummy1 = SR_MASK_LL;
-
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "or        %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy0)
-                            : "r" (__dummy1));
-}
-
-static inline void set_bl_bit(void)
-{
-       unsigned long long __dummy0, __dummy1 = SR_BL_LL;
-
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "or        %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy0)
-                            : "r" (__dummy1));
-
-}
-
-static inline void clear_bl_bit(void)
-{
-       unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
-
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "and       %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy0)
-                            : "r" (__dummy1));
-}
-
-static inline unsigned long __raw_local_save_flags(void)
-{
-       unsigned long long __dummy = SR_MASK_LL;
-       unsigned long flags;
-
-       __asm__ __volatile__ (
-               "getcon " __SR ", %0\n\t"
-               "and    %0, %1, %0"
-               : "=&r" (flags)
-               : "r" (__dummy));
-
-       return flags;
-}
-
-static inline unsigned long __raw_local_irq_save(void)
-{
-       unsigned long long __dummy0, __dummy1 = SR_MASK_LL;
-       unsigned long flags;
-
-       __asm__ __volatile__ (
-               "getcon " __SR ", %1\n\t"
-               "or     %1, r63, %0\n\t"
-               "or     %1, %2, %1\n\t"
-               "putcon %1, " __SR "\n\t"
-               "and    %0, %2, %0"
-               : "=&r" (flags), "=&r" (__dummy0)
-               : "r" (__dummy1));
-
-       return flags;
-}
-
-#endif /* __ASM_SH_IRQFLAGS_64_H */
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h
deleted file mode 100644 (file)
index 49cd690..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_SH_KDEBUG_H
-#define __ASM_SH_KDEBUG_H
-
-/* Grossly misnamed. */
-enum die_val {
-       DIE_TRAP,
-};
-
-#endif /* __ASM_SH_KDEBUG_H */
diff --git a/include/asm-sh/kexec.h b/include/asm-sh/kexec.h
deleted file mode 100644 (file)
index 00f4260..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef __ASM_SH_KEXEC_H
-#define __ASM_SH_KEXEC_H
-
-#include <asm/ptrace.h>
-#include <asm/string.h>
-
-/*
- * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
- * I.e. Maximum page that is mapped directly into kernel memory,
- * and kmap is not required.
- *
- * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
- * calculation for the amount of memory directly mappable into the
- * kernel memory space.
- */
-
-/* Maximum physical address we can use pages from */
-#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
-/* Maximum address we can reach in physical address mode */
-#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
-/* Maximum address we can use for the control code buffer */
-#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
-
-#define KEXEC_CONTROL_CODE_SIZE        4096
-
-/* The native architecture */
-#define KEXEC_ARCH KEXEC_ARCH_SH
-
-static inline void crash_setup_regs(struct pt_regs *newregs,
-                                   struct pt_regs *oldregs)
-{
-       if (oldregs)
-               memcpy(newregs, oldregs, sizeof(*newregs));
-       else {
-               __asm__ __volatile__ ("mov r0, %0" : "=r" (newregs->regs[0]));
-               __asm__ __volatile__ ("mov r1, %0" : "=r" (newregs->regs[1]));
-               __asm__ __volatile__ ("mov r2, %0" : "=r" (newregs->regs[2]));
-               __asm__ __volatile__ ("mov r3, %0" : "=r" (newregs->regs[3]));
-               __asm__ __volatile__ ("mov r4, %0" : "=r" (newregs->regs[4]));
-               __asm__ __volatile__ ("mov r5, %0" : "=r" (newregs->regs[5]));
-               __asm__ __volatile__ ("mov r6, %0" : "=r" (newregs->regs[6]));
-               __asm__ __volatile__ ("mov r7, %0" : "=r" (newregs->regs[7]));
-               __asm__ __volatile__ ("mov r8, %0" : "=r" (newregs->regs[8]));
-               __asm__ __volatile__ ("mov r9, %0" : "=r" (newregs->regs[9]));
-               __asm__ __volatile__ ("mov r10, %0" : "=r" (newregs->regs[10]));
-               __asm__ __volatile__ ("mov r11, %0" : "=r" (newregs->regs[11]));
-               __asm__ __volatile__ ("mov r12, %0" : "=r" (newregs->regs[12]));
-               __asm__ __volatile__ ("mov r13, %0" : "=r" (newregs->regs[13]));
-               __asm__ __volatile__ ("mov r14, %0" : "=r" (newregs->regs[14]));
-               __asm__ __volatile__ ("mov r15, %0" : "=r" (newregs->regs[15]));
-
-               __asm__ __volatile__ ("sts pr, %0" : "=r" (newregs->pr));
-               __asm__ __volatile__ ("sts macl, %0" : "=r" (newregs->macl));
-               __asm__ __volatile__ ("sts mach, %0" : "=r" (newregs->mach));
-
-               __asm__ __volatile__ ("stc gbr, %0" : "=r" (newregs->gbr));
-               __asm__ __volatile__ ("stc sr, %0" : "=r" (newregs->sr));
-
-               newregs->pc = (unsigned long)current_text_addr();
-       }
-}
-#endif /* __ASM_SH_KEXEC_H */
diff --git a/include/asm-sh/kgdb.h b/include/asm-sh/kgdb.h
deleted file mode 100644 (file)
index 24e4207..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Based on original code by Glenn Engel, Jim Kingdon,
- * David Grothe <dave@gcom.com>, Tigran Aivazian, <tigran@sco.com> and
- * Amit S. Kale <akale@veritas.com>
- * 
- * Super-H port based on sh-stub.c (Ben Lee and Steve Chamberlain) by
- * Henry Bell <henry.bell@st.com>
- * 
- * Header file for low-level support for remote debug using GDB. 
- *
- */
-
-#ifndef __KGDB_H
-#define __KGDB_H
-
-#include <asm/ptrace.h>
-
-/* Same as pt_regs but has vbr in place of syscall_nr */
-struct kgdb_regs {
-        unsigned long regs[16];
-        unsigned long pc;
-        unsigned long pr;
-        unsigned long sr;
-        unsigned long gbr;
-        unsigned long mach;
-        unsigned long macl;
-        unsigned long vbr;
-};
-
-/* State info */
-extern char kgdb_in_gdb_mode;
-extern int kgdb_nofault;       /* Ignore bus errors (in gdb mem access) */
-extern char in_nmi;            /* Debounce flag to prevent NMI reentry*/
-
-/* SCI */
-extern int kgdb_portnum;
-extern int kgdb_baud;
-extern char kgdb_parity;
-extern char kgdb_bits;
-
-/* Init and interface stuff */
-extern int kgdb_init(void);
-extern int (*kgdb_getchar)(void);
-extern void (*kgdb_putchar)(int);
-
-/* Trap functions */
-typedef void (kgdb_debug_hook_t)(struct pt_regs *regs);
-typedef void (kgdb_bus_error_hook_t)(void);
-extern kgdb_debug_hook_t  *kgdb_debug_hook;
-extern kgdb_bus_error_hook_t *kgdb_bus_err_hook;
-
-/* Console */
-struct console;
-void kgdb_console_write(struct console *co, const char *s, unsigned count);
-extern int kgdb_console_setup(struct console *, char *);
-
-/* Prototypes for jmp fns */
-#define _JBLEN 9
-typedef        int jmp_buf[_JBLEN];
-extern void    longjmp(jmp_buf __jmpb, int __retval);
-extern int     setjmp(jmp_buf __jmpb);
-
-/* Forced breakpoint */
-#define breakpoint()   __asm__ __volatile__("trapa   #0x3c")
-
-#endif
diff --git a/include/asm-sh/kmap_types.h b/include/asm-sh/kmap_types.h
deleted file mode 100644 (file)
index 84d565c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __SH_KMAP_TYPES_H
-#define __SH_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-sh/landisk/gio.h b/include/asm-sh/landisk/gio.h
deleted file mode 100644 (file)
index 35d7368..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __ASM_SH_LANDISK_GIO_H
-#define __ASM_SH_LANDISK_GIO_H
-
-#include <linux/ioctl.h>
-
-/* version */
-#define VERSION_STR    "1.00"
-
-/* Driver name */
-#define GIO_DRIVER_NAME                "/dev/giodrv"
-
-/* Use 'k' as magic number */
-#define GIODRV_IOC_MAGIC  'k'
-
-#define GIODRV_IOCRESET    _IO(GIODRV_IOC_MAGIC, 0)
-/*
- * S means "Set" through a ptr,
- * T means "Tell" directly
- * G means "Get" (to a pointed var)
- * Q means "Query", response is on the return value
- * X means "eXchange": G and S atomically
- * H means "sHift": T and Q atomically
- */
-#define GIODRV_IOCSGIODATA1   _IOW(GIODRV_IOC_MAGIC,  1, unsigned char *)
-#define GIODRV_IOCGGIODATA1   _IOR(GIODRV_IOC_MAGIC,  2, unsigned char *)
-#define GIODRV_IOCSGIODATA2   _IOW(GIODRV_IOC_MAGIC,  3, unsigned short *)
-#define GIODRV_IOCGGIODATA2   _IOR(GIODRV_IOC_MAGIC,  4, unsigned short *)
-#define GIODRV_IOCSGIODATA4   _IOW(GIODRV_IOC_MAGIC,  5, unsigned long *)
-#define GIODRV_IOCGGIODATA4   _IOR(GIODRV_IOC_MAGIC,  6, unsigned long *)
-#define GIODRV_IOCSGIOSETADDR _IOW(GIODRV_IOC_MAGIC,  7, unsigned long *)
-#define GIODRV_IOCHARDRESET   _IO(GIODRV_IOC_MAGIC, 8) /* debugging tool */
-#define GIODRV_IOC_MAXNR 8
-
-#define GIO_READ 0x00000000
-#define GIO_WRITE 0x00000001
-
-#endif /* __ASM_SH_LANDISK_GIO_H  */
diff --git a/include/asm-sh/landisk/iodata_landisk.h b/include/asm-sh/landisk/iodata_landisk.h
deleted file mode 100644 (file)
index 6fb04ab..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __ASM_SH_IODATA_LANDISK_H
-#define __ASM_SH_IODATA_LANDISK_H
-
-/*
- * linux/include/asm-sh/landisk/iodata_landisk.h
- *
- * Copyright (C) 2000  Atom Create Engineering Co., Ltd.
- *
- * IO-DATA LANDISK support
- */
-
-/* Box specific addresses.  */
-
-#define PA_USB         0xa4000000      /* USB Controller M66590 */
-
-#define PA_ATARST      0xb0000000      /* ATA/FATA Access Control Register */
-#define PA_LED         0xb0000001      /* LED Control Register */
-#define PA_STATUS      0xb0000002      /* Switch Status Register */
-#define PA_SHUTDOWN    0xb0000003      /* Shutdown Control Register */
-#define PA_PCIPME      0xb0000004      /* PCI PME Status Register */
-#define PA_IMASK       0xb0000005      /* Interrupt Mask Register */
-/* 2003.10.31 I-O DATA NSD NWG add.    for shutdown port clear */
-#define PA_PWRINT_CLR  0xb0000006      /* Shutdown Interrupt clear Register */
-
-#define PA_PIDE_OFFSET 0x40            /* CF IDE Offset */
-#define PA_SIDE_OFFSET 0x40            /* HDD IDE Offset */
-
-#define IRQ_PCIINTA    5               /* PCI INTA IRQ */
-#define IRQ_PCIINTB    6               /* PCI INTB IRQ */
-#define IRQ_PCIINDC    7               /* PCI INTC IRQ */
-#define IRQ_PCIINTD    8               /* PCI INTD IRQ */
-#define IRQ_ATA                9               /* ATA IRQ */
-#define IRQ_FATA       10              /* FATA IRQ */
-#define IRQ_POWER      11              /* Power Switch IRQ */
-#define IRQ_BUTTON     12              /* USL-5P Button IRQ */
-#define IRQ_FAULT      13              /* USL-5P Fault  IRQ */
-
-#define __IO_PREFIX landisk
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_IODATA_LANDISK_H */
-
diff --git a/include/asm-sh/lboxre2.h b/include/asm-sh/lboxre2.h
deleted file mode 100644 (file)
index e6d1605..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_SH_LBOXRE2_H
-#define __ASM_SH_LBOXRE2_H
-
-/*
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 support
- *
- * 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.
- *
- */
-
-#define IRQ_CF1                9       /* CF1 */
-#define IRQ_CF0                10      /* CF0 */
-#define IRQ_INTD       11      /* INTD */
-#define IRQ_ETH1       12      /* Ether1 */
-#define IRQ_ETH0       13      /* Ether0 */
-#define IRQ_INTA       14      /* INTA */
-
-void init_lboxre2_IRQ(void);
-
-#define __IO_PREFIX    lboxre2
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_LBOXRE2_H */
diff --git a/include/asm-sh/linkage.h b/include/asm-sh/linkage.h
deleted file mode 100644 (file)
index 3565a4f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
-
-#define __ALIGN .balign 4
-#define __ALIGN_STR ".balign 4"
-
-#endif
diff --git a/include/asm-sh/local.h b/include/asm-sh/local.h
deleted file mode 100644 (file)
index 9ed9b9c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_SH_LOCAL_H
-#define __ASM_SH_LOCAL_H
-
-#include <asm-generic/local.h>
-
-#endif /* __ASM_SH_LOCAL_H */
-
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
deleted file mode 100644 (file)
index b2e4124..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * include/asm-sh/machvec.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-
-#ifndef _ASM_SH_MACHVEC_H
-#define _ASM_SH_MACHVEC_H
-
-#include <linux/types.h>
-#include <linux/time.h>
-#include <asm/machtypes.h>
-
-struct device;
-
-struct sh_machine_vector {
-       void (*mv_setup)(char **cmdline_p);
-       const char *mv_name;
-       int mv_nr_irqs;
-
-       u8 (*mv_inb)(unsigned long);
-       u16 (*mv_inw)(unsigned long);
-       u32 (*mv_inl)(unsigned long);
-       void (*mv_outb)(u8, unsigned long);
-       void (*mv_outw)(u16, unsigned long);
-       void (*mv_outl)(u32, unsigned long);
-
-       u8 (*mv_inb_p)(unsigned long);
-       u16 (*mv_inw_p)(unsigned long);
-       u32 (*mv_inl_p)(unsigned long);
-       void (*mv_outb_p)(u8, unsigned long);
-       void (*mv_outw_p)(u16, unsigned long);
-       void (*mv_outl_p)(u32, unsigned long);
-
-       void (*mv_insb)(unsigned long, void *dst, unsigned long count);
-       void (*mv_insw)(unsigned long, void *dst, unsigned long count);
-       void (*mv_insl)(unsigned long, void *dst, unsigned long count);
-       void (*mv_outsb)(unsigned long, const void *src, unsigned long count);
-       void (*mv_outsw)(unsigned long, const void *src, unsigned long count);
-       void (*mv_outsl)(unsigned long, const void *src, unsigned long count);
-
-       u8 (*mv_readb)(void __iomem *);
-       u16 (*mv_readw)(void __iomem *);
-       u32 (*mv_readl)(void __iomem *);
-       void (*mv_writeb)(u8, void __iomem *);
-       void (*mv_writew)(u16, void __iomem *);
-       void (*mv_writel)(u32, void __iomem *);
-
-       int (*mv_irq_demux)(int irq);
-
-       void (*mv_init_irq)(void);
-       void (*mv_init_pci)(void);
-
-       void (*mv_heartbeat)(void);
-
-       void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
-       void (*mv_ioport_unmap)(void __iomem *);
-};
-
-extern struct sh_machine_vector sh_mv;
-
-#define get_system_type()      sh_mv.mv_name
-
-#define __initmv \
-       __used __section(.machvec.init)
-
-#endif /* _ASM_SH_MACHVEC_H */
diff --git a/include/asm-sh/magicpanelr2.h b/include/asm-sh/magicpanelr2.h
deleted file mode 100644 (file)
index c644a77..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  include/asm-sh/magicpanelr2.h
- *
- *  Copyright (C) 2007  Markus Brunner, Mark Jonas
- *
- *  I/O addresses and bitmasks for Magic Panel Release 2 board
- *
- * 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.
- */
-
-#ifndef __ASM_SH_MAGICPANELR2_H
-#define __ASM_SH_MAGICPANELR2_H
-
-#include <asm/gpio.h>
-
-#define __IO_PREFIX mpr2
-#include <asm/io_generic.h>
-
-
-#define SETBITS_OUTB(mask, reg)   ctrl_outb(ctrl_inb(reg) | mask, reg)
-#define SETBITS_OUTW(mask, reg)   ctrl_outw(ctrl_inw(reg) | mask, reg)
-#define SETBITS_OUTL(mask, reg)   ctrl_outl(ctrl_inl(reg) | mask, reg)
-#define CLRBITS_OUTB(mask, reg)   ctrl_outb(ctrl_inb(reg) & ~mask, reg)
-#define CLRBITS_OUTW(mask, reg)   ctrl_outw(ctrl_inw(reg) & ~mask, reg)
-#define CLRBITS_OUTL(mask, reg)   ctrl_outl(ctrl_inl(reg) & ~mask, reg)
-
-
-#define PA_LED          PORT_PADR      /* LED */
-
-
-/* BSC */
-#define CMNCR           0xA4FD0000UL
-#define CS0BCR          0xA4FD0004UL
-#define CS2BCR          0xA4FD0008UL
-#define CS3BCR          0xA4FD000CUL
-#define CS4BCR          0xA4FD0010UL
-#define CS5ABCR         0xA4FD0014UL
-#define CS5BBCR         0xA4FD0018UL
-#define CS6ABCR         0xA4FD001CUL
-#define CS6BBCR         0xA4FD0020UL
-#define CS0WCR          0xA4FD0024UL
-#define CS2WCR          0xA4FD0028UL
-#define CS3WCR          0xA4FD002CUL
-#define CS4WCR          0xA4FD0030UL
-#define CS5AWCR         0xA4FD0034UL
-#define CS5BWCR         0xA4FD0038UL
-#define CS6AWCR         0xA4FD003CUL
-#define CS6BWCR         0xA4FD0040UL
-
-
-/* usb */
-
-#define PORT_UTRCTL            0xA405012CUL
-#define PORT_UCLKCR_W          0xA40A0008UL
-
-#define INTC_ICR0              0xA414FEE0UL
-#define INTC_ICR1              0xA4140010UL
-#define INTC_ICR2              0xA4140012UL
-
-/* MTD */
-
-#define MPR2_MTD_BOOTLOADER_SIZE       0x00060000UL
-#define MPR2_MTD_KERNEL_SIZE           0x00200000UL
-
-#endif  /* __ASM_SH_MAGICPANELR2_H */
diff --git a/include/asm-sh/mc146818rtc.h b/include/asm-sh/mc146818rtc.h
deleted file mode 100644 (file)
index 0aee96a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Machine dependent access functions for RTC registers.
- */
-#ifndef _ASM_MC146818RTC_H
-#define _ASM_MC146818RTC_H
-
-#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-sh/microdev.h b/include/asm-sh/microdev.h
deleted file mode 100644 (file)
index 1aed158..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * linux/include/asm-sh/microdev.h
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- *
- * Definitions for the SuperH SH4-202 MicroDev board.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-#ifndef __ASM_SH_MICRODEV_H
-#define __ASM_SH_MICRODEV_H
-
-extern void init_microdev_irq(void);
-extern void microdev_print_fpga_intc_status(void);
-
-/*
- * The following are useful macros for manipulating the interrupt
- * controller (INTC) on the CPU-board FPGA.  should be noted that there
- * is an INTC on the FPGA, and a separate INTC on the SH4-202 core -
- * these are two different things, both of which need to be prorammed to
- * correctly route - unfortunately, they have the same name and
- * abbreviations!
- */
-#define        MICRODEV_FPGA_INTC_BASE         0xa6110000ul                            /* INTC base address on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTENB_REG        (MICRODEV_FPGA_INTC_BASE+0ul)           /* Interrupt Enable Register on INTC on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTDSB_REG        (MICRODEV_FPGA_INTC_BASE+8ul)           /* Interrupt Disable Register on INTC on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTC_MASK(n)      (1ul<<(n))                              /* Interrupt mask to enable/disable INTC in CPU-board FPGA */
-#define        MICRODEV_FPGA_INTPRI_REG(n)     (MICRODEV_FPGA_INTC_BASE+0x10+((n)/8)*8)/* Interrupt Priority Register on INTC on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTPRI_LEVEL(n,x) ((x)<<(((n)%8)*4))                      /* MICRODEV_FPGA_INTPRI_LEVEL(int_number, int_level) */
-#define        MICRODEV_FPGA_INTPRI_MASK(n)    (MICRODEV_FPGA_INTPRI_LEVEL((n),0xful)) /* Interrupt Priority Mask on INTC on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTSRC_REG        (MICRODEV_FPGA_INTC_BASE+0x30ul)        /* Interrupt Source Register on INTC on CPU-board FPGA */
-#define        MICRODEV_FPGA_INTREQ_REG        (MICRODEV_FPGA_INTC_BASE+0x38ul)        /* Interrupt Request Register on INTC on CPU-board FPGA */
-
-
-/*
- * The following are the IRQ numbers for the Linux Kernel for external
- * interrupts.  i.e. the numbers seen by 'cat /proc/interrupt'.
- */
-#define MICRODEV_LINUX_IRQ_KEYBOARD     1      /* SuperIO Keyboard */
-#define MICRODEV_LINUX_IRQ_SERIAL1      2      /* SuperIO Serial #1 */
-#define MICRODEV_LINUX_IRQ_ETHERNET     3      /* on-board Ethnernet */
-#define MICRODEV_LINUX_IRQ_SERIAL2      4      /* SuperIO Serial #2 */
-#define MICRODEV_LINUX_IRQ_USB_HC       7      /* on-board USB HC */
-#define MICRODEV_LINUX_IRQ_MOUSE       12      /* SuperIO PS/2 Mouse */
-#define MICRODEV_LINUX_IRQ_IDE2                13      /* SuperIO IDE #2 */
-#define MICRODEV_LINUX_IRQ_IDE1                14      /* SuperIO IDE #1 */
-
-/*
- * The following are the IRQ numbers for the INTC on the FPGA for
- * external interrupts.  i.e. the bits in the INTC registers in the
- * FPGA.
- */
-#define MICRODEV_FPGA_IRQ_KEYBOARD      1      /* SuperIO Keyboard */
-#define MICRODEV_FPGA_IRQ_SERIAL1       3      /* SuperIO Serial #1 */
-#define MICRODEV_FPGA_IRQ_SERIAL2       4      /* SuperIO Serial #2 */
-#define MICRODEV_FPGA_IRQ_MOUSE                12      /* SuperIO PS/2 Mouse */
-#define MICRODEV_FPGA_IRQ_IDE1         14      /* SuperIO IDE #1 */
-#define MICRODEV_FPGA_IRQ_IDE2         15      /* SuperIO IDE #2 */
-#define MICRODEV_FPGA_IRQ_USB_HC       16      /* on-board USB HC */
-#define MICRODEV_FPGA_IRQ_ETHERNET     18      /* on-board Ethnernet */
-
-#define MICRODEV_IRQ_PCI_INTA           8
-#define MICRODEV_IRQ_PCI_INTB           9
-#define MICRODEV_IRQ_PCI_INTC          10
-#define MICRODEV_IRQ_PCI_INTD          11
-
-#define __IO_PREFIX microdev
-#include <asm/io_generic.h>
-
-#if defined(CONFIG_PCI)
-unsigned char  microdev_pci_inb(unsigned long port);
-unsigned short microdev_pci_inw(unsigned long port);
-unsigned long  microdev_pci_inl(unsigned long port);
-void           microdev_pci_outb(unsigned char  data, unsigned long port);
-void           microdev_pci_outw(unsigned short data, unsigned long port);
-void           microdev_pci_outl(unsigned long  data, unsigned long port);
-#endif
-
-#endif /* __ASM_SH_MICRODEV_H */
diff --git a/include/asm-sh/migor.h b/include/asm-sh/migor.h
deleted file mode 100644 (file)
index 10016e0..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef __ASM_SH_MIGOR_H
-#define __ASM_SH_MIGOR_H
-
-/*
- * linux/include/asm-sh/migor.h
- *
- * Copyright (C) 2008 Renesas Solutions
- *
- * Portions Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * 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.
- *
- */
-#include <asm/addrspace.h>
-
-/* GPIO */
-#define PORT_PACR 0xa4050100
-#define PORT_PDCR 0xa4050106
-#define PORT_PECR 0xa4050108
-#define PORT_PHCR 0xa405010e
-#define PORT_PJCR 0xa4050110
-#define PORT_PKCR 0xa4050112
-#define PORT_PLCR 0xa4050114
-#define PORT_PMCR 0xa4050116
-#define PORT_PRCR 0xa405011c
-#define PORT_PTCR 0xa4050140
-#define PORT_PUCR 0xa4050142
-#define PORT_PVCR 0xa4050144
-#define PORT_PWCR 0xa4050146
-#define PORT_PXCR 0xa4050148
-#define PORT_PYCR 0xa405014a
-#define PORT_PZCR 0xa405014c
-#define PORT_PADR 0xa4050120
-#define PORT_PHDR 0xa405012e
-#define PORT_PTDR 0xa4050160
-#define PORT_PWDR 0xa4050166
-
-#define PORT_HIZCRA 0xa4050158
-#define PORT_HIZCRC 0xa405015c
-
-#define PORT_MSELCRB 0xa4050182
-
-#define MSTPCR1 0xa4150034
-#define MSTPCR2 0xa4150038
-
-#define PORT_PSELA 0xa405014e
-#define PORT_PSELB 0xa4050150
-#define PORT_PSELC 0xa4050152
-#define PORT_PSELD 0xa4050154
-#define PORT_PSELE 0xa4050156
-
-#define PORT_HIZCRA 0xa4050158
-#define PORT_HIZCRB 0xa405015a
-#define PORT_HIZCRC 0xa405015c
-
-#define BSC_CS6ABCR 0xfec1001c
-
-#include <asm/sh_mobile_lcdc.h>
-
-int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle,
-                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-
-#endif /* __ASM_SH_MIGOR_H */
diff --git a/include/asm-sh/mman.h b/include/asm-sh/mman.h
deleted file mode 100644 (file)
index 156eb02..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ASM_SH_MMAN_H
-#define __ASM_SH_MMAN_H
-
-#include <asm-generic/mman.h>
-
-#define MAP_GROWSDOWN  0x0100          /* stack-like segment */
-#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
-#define MAP_LOCKED     0x2000          /* pages are locked */
-#define MAP_NORESERVE  0x4000          /* don't check for reservations */
-#define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
-#define MAP_NONBLOCK   0x10000         /* do not block on IO */
-
-#define MCL_CURRENT    1               /* lock all current mappings */
-#define MCL_FUTURE     2               /* lock all future mappings */
-
-#endif /* __ASM_SH_MMAN_H */
diff --git a/include/asm-sh/mmu.h b/include/asm-sh/mmu.h
deleted file mode 100644 (file)
index fdcb93b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef __MMU_H
-#define __MMU_H
-
-/* Default "unsigned long" context */
-typedef unsigned long mm_context_id_t[NR_CPUS];
-
-typedef struct {
-#ifdef CONFIG_MMU
-       mm_context_id_t         id;
-       void                    *vdso;
-#else
-       struct vm_list_struct   *vmlist;
-       unsigned long           end_brk;
-#endif
-#ifdef CONFIG_BINFMT_ELF_FDPIC
-       unsigned long           exec_fdpic_loadmap;
-       unsigned long           interp_fdpic_loadmap;
-#endif
-} mm_context_t;
-
-/*
- * Privileged Space Mapping Buffer (PMB) definitions
- */
-#define PMB_PASCR              0xff000070
-#define PMB_IRMCR              0xff000078
-
-#define PMB_ADDR               0xf6100000
-#define PMB_DATA               0xf7100000
-#define PMB_ENTRY_MAX          16
-#define PMB_E_MASK             0x0000000f
-#define PMB_E_SHIFT            8
-
-#define PMB_SZ_16M             0x00000000
-#define PMB_SZ_64M             0x00000010
-#define PMB_SZ_128M            0x00000080
-#define PMB_SZ_512M            0x00000090
-#define PMB_SZ_MASK            PMB_SZ_512M
-#define PMB_C                  0x00000008
-#define PMB_WT                 0x00000001
-#define PMB_UB                 0x00000200
-#define PMB_V                  0x00000100
-
-#define PMB_NO_ENTRY           (-1)
-
-struct pmb_entry;
-
-struct pmb_entry {
-       unsigned long vpn;
-       unsigned long ppn;
-       unsigned long flags;
-
-       /*
-        * 0 .. NR_PMB_ENTRIES for specific entry selection, or
-        * PMB_NO_ENTRY to search for a free one
-        */
-       int entry;
-
-       struct pmb_entry *next;
-       /* Adjacent entry link for contiguous multi-entry mappings */
-       struct pmb_entry *link;
-};
-
-/* arch/sh/mm/pmb.c */
-int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
-                   unsigned long flags, int *entry);
-int set_pmb_entry(struct pmb_entry *pmbe);
-void clear_pmb_entry(struct pmb_entry *pmbe);
-struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
-                           unsigned long flags);
-void pmb_free(struct pmb_entry *pmbe);
-long pmb_remap(unsigned long virt, unsigned long phys,
-              unsigned long size, unsigned long flags);
-void pmb_unmap(unsigned long addr);
-
-#endif /* __MMU_H */
-
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h
deleted file mode 100644 (file)
index 8589a50..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2003 - 2007 Paul Mundt
- *
- * ASID handling idea taken from MIPS implementation.
- */
-#ifndef __ASM_SH_MMU_CONTEXT_H
-#define __ASM_SH_MMU_CONTEXT_H
-
-#ifdef __KERNEL__
-#include <asm/cpu/mmu_context.h>
-#include <asm/tlbflush.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm-generic/mm_hooks.h>
-
-/*
- * The MMU "context" consists of two things:
- *    (a) TLB cache version (or round, cycle whatever expression you like)
- *    (b) ASID (Address Space IDentifier)
- */
-#define MMU_CONTEXT_ASID_MASK          0x000000ff
-#define MMU_CONTEXT_VERSION_MASK       0xffffff00
-#define MMU_CONTEXT_FIRST_VERSION      0x00000100
-#define NO_CONTEXT                     0
-
-/* ASID is 8-bit value, so it can't be 0x100 */
-#define MMU_NO_ASID                    0x100
-
-#define asid_cache(cpu)                (cpu_data[cpu].asid_cache)
-
-#ifdef CONFIG_MMU
-#define cpu_context(cpu, mm)   ((mm)->context.id[cpu])
-
-#define cpu_asid(cpu, mm)      \
-       (cpu_context((cpu), (mm)) & MMU_CONTEXT_ASID_MASK)
-
-/*
- * Virtual Page Number mask
- */
-#define MMU_VPN_MASK   0xfffff000
-
-#if defined(CONFIG_SUPERH32)
-#include "mmu_context_32.h"
-#else
-#include "mmu_context_64.h"
-#endif
-
-/*
- * Get MMU context if needed.
- */
-static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu)
-{
-       unsigned long asid = asid_cache(cpu);
-
-       /* Check if we have old version of context. */
-       if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0)
-               /* It's up to date, do nothing */
-               return;
-
-       /* It's old, we need to get new context with new version. */
-       if (!(++asid & MMU_CONTEXT_ASID_MASK)) {
-               /*
-                * We exhaust ASID of this version.
-                * Flush all TLB and start new cycle.
-                */
-               flush_tlb_all();
-
-#ifdef CONFIG_SUPERH64
-               /*
-                * The SH-5 cache uses the ASIDs, requiring both the I and D
-                * cache to be flushed when the ASID is exhausted. Weak.
-                */
-               flush_cache_all();
-#endif
-
-               /*
-                * Fix version; Note that we avoid version #0
-                * to distingush NO_CONTEXT.
-                */
-               if (!asid)
-                       asid = MMU_CONTEXT_FIRST_VERSION;
-       }
-
-       cpu_context(cpu, mm) = asid_cache(cpu) = asid;
-}
-
-/*
- * Initialize the context related info for a new mm_struct
- * instance.
- */
-static inline int init_new_context(struct task_struct *tsk,
-                                  struct mm_struct *mm)
-{
-       int i;
-
-       for (i = 0; i < num_online_cpus(); i++)
-               cpu_context(i, mm) = NO_CONTEXT;
-
-       return 0;
-}
-
-/*
- * After we have set current->mm to a new value, this activates
- * the context for the new mm so we see the new mappings.
- */
-static inline void activate_context(struct mm_struct *mm, unsigned int cpu)
-{
-       get_mmu_context(mm, cpu);
-       set_asid(cpu_asid(cpu, mm));
-}
-
-static inline void switch_mm(struct mm_struct *prev,
-                            struct mm_struct *next,
-                            struct task_struct *tsk)
-{
-       unsigned int cpu = smp_processor_id();
-
-       if (likely(prev != next)) {
-               cpu_set(cpu, next->cpu_vm_mask);
-               set_TTB(next->pgd);
-               activate_context(next, cpu);
-       } else
-               if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
-                       activate_context(next, cpu);
-}
-#else
-#define get_mmu_context(mm)            do { } while (0)
-#define init_new_context(tsk,mm)       (0)
-#define destroy_context(mm)            do { } while (0)
-#define set_asid(asid)                 do { } while (0)
-#define get_asid()                     (0)
-#define cpu_asid(cpu, mm)              ({ (void)cpu; 0; })
-#define switch_and_save_asid(asid)     (0)
-#define set_TTB(pgd)                   do { } while (0)
-#define get_TTB()                      (0)
-#define activate_context(mm,cpu)       do { } while (0)
-#define switch_mm(prev,next,tsk)       do { } while (0)
-#endif /* CONFIG_MMU */
-
-#define activate_mm(prev, next)                switch_mm((prev),(next),NULL)
-#define deactivate_mm(tsk,mm)          do { } while (0)
-#define enter_lazy_tlb(mm,tsk)         do { } while (0)
-
-#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
-/*
- * If this processor has an MMU, we need methods to turn it off/on ..
- * paging_init() will also have to be updated for the processor in
- * question.
- */
-static inline void enable_mmu(void)
-{
-       unsigned int cpu = smp_processor_id();
-
-       /* Enable MMU */
-       ctrl_outl(MMU_CONTROL_INIT, MMUCR);
-       ctrl_barrier();
-
-       if (asid_cache(cpu) == NO_CONTEXT)
-               asid_cache(cpu) = MMU_CONTEXT_FIRST_VERSION;
-
-       set_asid(asid_cache(cpu) & MMU_CONTEXT_ASID_MASK);
-}
-
-static inline void disable_mmu(void)
-{
-       unsigned long cr;
-
-       cr = ctrl_inl(MMUCR);
-       cr &= ~MMU_CONTROL_INIT;
-       ctrl_outl(cr, MMUCR);
-
-       ctrl_barrier();
-}
-#else
-/*
- * MMU control handlers for processors lacking memory
- * management hardware.
- */
-#define enable_mmu()   do { } while (0)
-#define disable_mmu()  do { } while (0)
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_MMU_CONTEXT_H */
diff --git a/include/asm-sh/mmu_context_32.h b/include/asm-sh/mmu_context_32.h
deleted file mode 100644 (file)
index f4f9aeb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef __ASM_SH_MMU_CONTEXT_32_H
-#define __ASM_SH_MMU_CONTEXT_32_H
-
-/*
- * Destroy context related info for an mm_struct that is about
- * to be put to rest.
- */
-static inline void destroy_context(struct mm_struct *mm)
-{
-       /* Do nothing */
-}
-
-static inline void set_asid(unsigned long asid)
-{
-       unsigned long __dummy;
-
-       __asm__ __volatile__ ("mov.l    %2, %0\n\t"
-                             "and      %3, %0\n\t"
-                             "or       %1, %0\n\t"
-                             "mov.l    %0, %2"
-                             : "=&r" (__dummy)
-                             : "r" (asid), "m" (__m(MMU_PTEH)),
-                               "r" (0xffffff00));
-}
-
-static inline unsigned long get_asid(void)
-{
-       unsigned long asid;
-
-       __asm__ __volatile__ ("mov.l    %1, %0"
-                             : "=r" (asid)
-                             : "m" (__m(MMU_PTEH)));
-       asid &= MMU_CONTEXT_ASID_MASK;
-       return asid;
-}
-
-/* MMU_TTB is used for optimizing the fault handling. */
-static inline void set_TTB(pgd_t *pgd)
-{
-       ctrl_outl((unsigned long)pgd, MMU_TTB);
-}
-
-static inline pgd_t *get_TTB(void)
-{
-       return (pgd_t *)ctrl_inl(MMU_TTB);
-}
-#endif /* __ASM_SH_MMU_CONTEXT_32_H */
diff --git a/include/asm-sh/mmu_context_64.h b/include/asm-sh/mmu_context_64.h
deleted file mode 100644 (file)
index 9649f1c..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __ASM_SH_MMU_CONTEXT_64_H
-#define __ASM_SH_MMU_CONTEXT_64_H
-
-/*
- * sh64-specific mmu_context interface.
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003 - 2007  Paul Mundt
- *
- * 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.
- */
-#include <asm/cpu/registers.h>
-#include <asm/cacheflush.h>
-
-#define SR_ASID_MASK           0xffffffffff00ffffULL
-#define SR_ASID_SHIFT          16
-
-/*
- * Destroy context related info for an mm_struct that is about
- * to be put to rest.
- */
-static inline void destroy_context(struct mm_struct *mm)
-{
-       /* Well, at least free TLB entries */
-       flush_tlb_mm(mm);
-}
-
-static inline unsigned long get_asid(void)
-{
-       unsigned long long sr;
-
-       asm volatile ("getcon   " __SR ", %0\n\t"
-                     : "=r" (sr));
-
-       sr = (sr >> SR_ASID_SHIFT) & MMU_CONTEXT_ASID_MASK;
-       return (unsigned long) sr;
-}
-
-/* Set ASID into SR */
-static inline void set_asid(unsigned long asid)
-{
-       unsigned long long sr, pc;
-
-       asm volatile ("getcon   " __SR ", %0" : "=r" (sr));
-
-       sr = (sr & SR_ASID_MASK) | (asid << SR_ASID_SHIFT);
-
-       /*
-        * It is possible that this function may be inlined and so to avoid
-        * the assembler reporting duplicate symbols we make use of the
-        * gas trick of generating symbols using numerics and forward
-        * reference.
-        */
-       asm volatile ("movi     1, %1\n\t"
-                     "shlli    %1, 28, %1\n\t"
-                     "or       %0, %1, %1\n\t"
-                     "putcon   %1, " __SR "\n\t"
-                     "putcon   %0, " __SSR "\n\t"
-                     "movi     1f, %1\n\t"
-                     "ori      %1, 1 , %1\n\t"
-                     "putcon   %1, " __SPC "\n\t"
-                     "rte\n"
-                     "1:\n\t"
-                     : "=r" (sr), "=r" (pc) : "0" (sr));
-}
-
-/* arch/sh/kernel/cpu/sh5/entry.S */
-extern unsigned long switch_and_save_asid(unsigned long new_asid);
-
-/* No spare register to twiddle, so use a software cache */
-extern pgd_t *mmu_pdtp_cache;
-
-#define set_TTB(pgd)   (mmu_pdtp_cache = (pgd))
-#define get_TTB()      (mmu_pdtp_cache)
-
-#endif /* __ASM_SH_MMU_CONTEXT_64_H */
diff --git a/include/asm-sh/mmzone.h b/include/asm-sh/mmzone.h
deleted file mode 100644 (file)
index 2969253..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __ASM_SH_MMZONE_H
-#define __ASM_SH_MMZONE_H
-
-#ifdef __KERNEL__
-
-#ifdef CONFIG_NEED_MULTIPLE_NODES
-extern struct pglist_data *node_data[];
-#define NODE_DATA(nid)         (node_data[nid])
-
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)      (NODE_DATA(nid)->node_start_pfn + \
-                                NODE_DATA(nid)->node_spanned_pages)
-
-static inline int pfn_to_nid(unsigned long pfn)
-{
-       int nid;
-
-       for (nid = 0; nid < MAX_NUMNODES; nid++)
-               if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
-                       break;
-
-       return nid;
-}
-
-static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
-{
-       return NODE_DATA(pfn_to_nid(pfn));
-}
-
-/* arch/sh/mm/numa.c */
-void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
-#else
-static inline void
-setup_bootmem_node(int nid, unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_NEED_MULTIPLE_NODES */
-
-/* Platform specific mem init */
-void __init plat_mem_setup(void);
-
-/* arch/sh/kernel/setup.c */
-void __init setup_bootmem_allocator(unsigned long start_pfn);
-void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
-                              unsigned long end_pfn);
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_MMZONE_H */
diff --git a/include/asm-sh/module.h b/include/asm-sh/module.h
deleted file mode 100644 (file)
index 46eccd3..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _ASM_SH_MODULE_H
-#define _ASM_SH_MODULE_H
-
-/*
- * This file contains the SH architecture specific module code.
- */
-
-struct mod_arch_specific {
-       /* Nothing to see here .. */
-};
-
-#define Elf_Shdr               Elf32_Shdr
-#define Elf_Sym                        Elf32_Sym
-#define Elf_Ehdr               Elf32_Ehdr
-
-#ifdef CONFIG_CPU_LITTLE_ENDIAN
-# ifdef CONFIG_CPU_SH2
-#  define MODULE_PROC_FAMILY "SH2LE "
-# elif defined  CONFIG_CPU_SH3
-#  define MODULE_PROC_FAMILY "SH3LE "
-# elif defined  CONFIG_CPU_SH4
-#  define MODULE_PROC_FAMILY "SH4LE "
-# elif defined  CONFIG_CPU_SH5
-#  define MODULE_PROC_FAMILY "SH5LE "
-# else
-#  error unknown processor family
-# endif
-#else
-# ifdef CONFIG_CPU_SH2
-#  define MODULE_PROC_FAMILY "SH2BE "
-# elif defined  CONFIG_CPU_SH3
-#  define MODULE_PROC_FAMILY "SH3BE "
-# elif defined  CONFIG_CPU_SH4
-#  define MODULE_PROC_FAMILY "SH4BE "
-# elif defined  CONFIG_CPU_SH5
-#  define MODULE_PROC_FAMILY "SH5BE "
-# else
-#  error unknown processor family
-# endif
-#endif
-
-#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
-
-#endif /* _ASM_SH_MODULE_H */
diff --git a/include/asm-sh/msgbuf.h b/include/asm-sh/msgbuf.h
deleted file mode 100644 (file)
index 5174323..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __ASM_SH_MSGBUF_H
-#define __ASM_SH_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for i386 architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       unsigned long   __unused1;
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       unsigned long   __unused2;
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned long   __unused3;
-       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  __unused4;
-       unsigned long  __unused5;
-};
-
-#endif /* __ASM_SH_MSGBUF_H */
diff --git a/include/asm-sh/mutex.h b/include/asm-sh/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-sh/page.h b/include/asm-sh/page.h
deleted file mode 100644 (file)
index 77fb8bf..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#ifndef __ASM_SH_PAGE_H
-#define __ASM_SH_PAGE_H
-
-/*
- * Copyright (C) 1999  Niibe Yutaka
- */
-
-#include <linux/const.h>
-
-/* PAGE_SHIFT determines the page size */
-#if defined(CONFIG_PAGE_SIZE_4KB)
-# define PAGE_SHIFT    12
-#elif defined(CONFIG_PAGE_SIZE_8KB)
-# define PAGE_SHIFT    13
-#elif defined(CONFIG_PAGE_SIZE_16KB)
-# define PAGE_SHIFT    14
-#elif defined(CONFIG_PAGE_SIZE_64KB)
-# define PAGE_SHIFT    16
-#else
-# error "Bogus kernel page size?"
-#endif
-
-#define PAGE_SIZE      (_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK      (~(PAGE_SIZE-1))
-#define PTE_MASK       PAGE_MASK
-
-#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
-#define HPAGE_SHIFT    16
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
-#define HPAGE_SHIFT    18
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
-#define HPAGE_SHIFT    20
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
-#define HPAGE_SHIFT    22
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
-#define HPAGE_SHIFT    26
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
-#define HPAGE_SHIFT    29
-#endif
-
-#ifdef CONFIG_HUGETLB_PAGE
-#define HPAGE_SIZE             (1UL << HPAGE_SHIFT)
-#define HPAGE_MASK             (~(HPAGE_SIZE-1))
-#define HUGETLB_PAGE_ORDER     (HPAGE_SHIFT-PAGE_SHIFT)
-#endif
-
-#ifndef __ASSEMBLY__
-
-extern unsigned long shm_align_mask;
-extern unsigned long max_low_pfn, min_low_pfn;
-extern unsigned long memory_start, memory_end;
-
-extern void clear_page(void *to);
-extern void copy_page(void *to, void *from);
-
-#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
-       (defined(CONFIG_CPU_SH5) || defined(CONFIG_CPU_SH4) || \
-        defined(CONFIG_SH7705_CACHE_32KB))
-struct page;
-struct vm_area_struct;
-extern void clear_user_page(void *to, unsigned long address, struct page *page);
-extern void copy_user_page(void *to, void *from, unsigned long address,
-                          struct page *page);
-#if defined(CONFIG_CPU_SH4)
-extern void copy_user_highpage(struct page *to, struct page *from,
-                              unsigned long vaddr, struct vm_area_struct *vma);
-#define __HAVE_ARCH_COPY_USER_HIGHPAGE
-#endif
-#else
-#define clear_user_page(page, vaddr, pg)       clear_page(page)
-#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
-#endif
-
-/*
- * These are used to make use of C type-checking..
- */
-#ifdef CONFIG_X2TLB
-typedef struct { unsigned long pte_low, pte_high; } pte_t;
-typedef struct { unsigned long long pgprot; } pgprot_t;
-typedef struct { unsigned long long pgd; } pgd_t;
-#define pte_val(x) \
-       ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
-#define __pte(x) \
-       ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
-#elif defined(CONFIG_SUPERH32)
-typedef struct { unsigned long pte_low; } pte_t;
-typedef struct { unsigned long pgprot; } pgprot_t;
-typedef struct { unsigned long pgd; } pgd_t;
-#define pte_val(x)     ((x).pte_low)
-#define __pte(x)       ((pte_t) { (x) } )
-#else
-typedef struct { unsigned long long pte_low; } pte_t;
-typedef struct { unsigned long pgprot; } pgprot_t;
-typedef struct { unsigned long pgd; } pgd_t;
-#define pte_val(x)     ((x).pte_low)
-#define __pte(x)       ((pte_t) { (x) } )
-#endif
-
-#define pgd_val(x)     ((x).pgd)
-#define pgprot_val(x)  ((x).pgprot)
-
-#define __pgd(x) ((pgd_t) { (x) } )
-#define __pgprot(x)    ((pgprot_t) { (x) } )
-
-typedef struct page *pgtable_t;
-
-#endif /* !__ASSEMBLY__ */
-
-/*
- * __MEMORY_START and SIZE are the physical addresses and size of RAM.
- */
-#define __MEMORY_START         CONFIG_MEMORY_START
-#define __MEMORY_SIZE          CONFIG_MEMORY_SIZE
-
-/*
- * PAGE_OFFSET is the virtual address of the start of kernel address
- * space.
- */
-#define PAGE_OFFSET            CONFIG_PAGE_OFFSET
-
-/*
- * Virtual to physical RAM address translation.
- *
- * In 29 bit mode, the physical offset of RAM from address 0 is visible in
- * the kernel virtual address space, and thus we don't have to take
- * this into account when translating. However in 32 bit mode this offset
- * is not visible (it is part of the PMB mapping) and so needs to be
- * added or subtracted as required.
- */
-#ifdef CONFIG_32BIT
-#define __pa(x)        ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START)
-#define __va(x)        ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START))
-#else
-#define __pa(x)        ((unsigned long)(x)-PAGE_OFFSET)
-#define __va(x)        ((void *)((unsigned long)(x)+PAGE_OFFSET))
-#endif
-
-#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
-#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
-
-/*
- * PFN = physical frame number (ie PFN 0 == physical address 0)
- * PFN_START is the PFN of the first page of RAM. By defining this we
- * don't have struct page entries for the portion of address space
- * between physical address 0 and the start of RAM.
- */
-#define PFN_START              (__MEMORY_START >> PAGE_SHIFT)
-#define ARCH_PFN_OFFSET                (PFN_START)
-#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-#ifdef CONFIG_FLATMEM
-#define pfn_valid(pfn)         ((pfn) >= min_low_pfn && (pfn) < max_low_pfn)
-#endif
-#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
-
-#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>
-
-/* vDSO support */
-#ifdef CONFIG_VSYSCALL
-#define __HAVE_ARCH_GATE_AREA
-#endif
-
-/*
- * Some drivers need to perform DMA into kmalloc'ed buffers
- * and so we have to increase the kmalloc minalign for this.
- */
-#define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
-
-#ifdef CONFIG_SUPERH64
-/*
- * While BYTES_PER_WORD == 4 on the current sh64 ABI, GCC will still
- * happily generate {ld/st}.q pairs, requiring us to have 8-byte
- * alignment to avoid traps. The kmalloc alignment is gauranteed by
- * virtue of L1_CACHE_BYTES, requiring this to only be special cased
- * for slab caches.
- */
-#define ARCH_SLAB_MINALIGN     8
-#endif
-
-#endif /* __ASM_SH_PAGE_H */
diff --git a/include/asm-sh/param.h b/include/asm-sh/param.h
deleted file mode 100644 (file)
index ae245af..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_SH_PARAM_H
-#define __ASM_SH_PARAM_H
-
-#ifdef __KERNEL__
-# define HZ            CONFIG_HZ
-# define USER_HZ       100             /* User interfaces are in "ticks" */
-# define CLOCKS_PER_SEC        (USER_HZ)       /* frequency at which times() counts */
-#endif
-
-#ifndef HZ
-#define HZ 100
-#endif
-
-#define EXEC_PAGESIZE  4096
-
-#ifndef NOGROUP
-#define NOGROUP                (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
-
-#endif /* __ASM_SH_PARAM_H */
diff --git a/include/asm-sh/parport.h b/include/asm-sh/parport.h
deleted file mode 100644 (file)
index f67ba60..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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_SH_PARPORT_H
-#define __ASM_SH_PARPORT_H
-
-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_SH_PARPORT_H */
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
deleted file mode 100644 (file)
index df1d383..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef __ASM_SH_PCI_H
-#define __ASM_SH_PCI_H
-
-#ifdef __KERNEL__
-
-#include <linux/dma-mapping.h>
-
-/* Can be used to override the logic in pci_scan_bus for skipping
-   already-configured bus numbers - to be used for buggy BIOSes
-   or architectures with incomplete PCI setup by the loader */
-
-#define pcibios_assign_all_busses()    1
-#define pcibios_scan_all_fns(a, b)     0
-
-/*
- * A board can define one or more PCI channels that represent built-in (or
- * external) PCI controllers.
- */
-struct pci_channel {
-       struct pci_ops *pci_ops;
-       struct resource *io_resource;
-       struct resource *mem_resource;
-       int first_devfn;
-       int last_devfn;
-};
-
-/*
- * Each board initializes this array and terminates it with a NULL entry.
- */
-extern struct pci_channel board_pci_channels[];
-
-#define PCIBIOS_MIN_IO         board_pci_channels->io_resource->start
-#define PCIBIOS_MIN_MEM                board_pci_channels->mem_resource->start
-
-/*
- * I/O routine helpers
- */
-#if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785)
-#define PCI_IO_AREA            0xFE400000
-#define PCI_IO_SIZE            0x00400000
-#elif defined(CONFIG_CPU_SH5)
-extern unsigned long PCI_IO_AREA;
-#define PCI_IO_SIZE            0x00010000
-#else
-#define PCI_IO_AREA            0xFE240000
-#define PCI_IO_SIZE            0x00040000
-#endif
-
-#define PCI_MEM_SIZE           0x01000000
-
-#define SH4_PCIIOBR_MASK       0xFFFC0000
-#define pci_ioaddr(addr)       (PCI_IO_AREA + (addr & ~SH4_PCIIOBR_MASK))
-
-#if defined(CONFIG_PCI)
-#define is_pci_ioaddr(port)            \
-       (((port) >= PCIBIOS_MIN_IO) &&  \
-        ((port) < (PCIBIOS_MIN_IO + PCI_IO_SIZE)))
-#define is_pci_memaddr(port)           \
-       (((port) >= PCIBIOS_MIN_MEM) && \
-        ((port) < (PCIBIOS_MIN_MEM + PCI_MEM_SIZE)))
-#else
-#define is_pci_ioaddr(port)    (0)
-#define is_pci_memaddr(port)   (0)
-#endif
-
-struct pci_dev;
-
-extern void pcibios_set_master(struct pci_dev *dev);
-
-static inline void pcibios_penalize_isa_irq(int irq, int active)
-{
-       /* We don't do dynamic PCI IRQ allocation */
-}
-
-/* Dynamic DMA mapping stuff.
- * SuperH has everything mapped statically like x86.
- */
-
-/* The PCI address space does 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    (1)
-
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <asm/scatterlist.h>
-#include <linux/string.h>
-#include <asm/io.h>
-
-/* pci_unmap_{single,page} being a nop depends upon the
- * configuration.
- */
-#ifdef CONFIG_SH_PCIDMA_NONCOHERENT
-#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))
-#else
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME)         (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)        do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME)           (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL)  do { } while (0)
-#endif
-
-#ifdef CONFIG_PCI
-static inline void pci_dma_burst_advice(struct pci_dev *pdev,
-                                       enum pci_dma_burst_strategy *strat,
-                                       unsigned long *strategy_parameter)
-{
-       *strat = PCI_DMA_BURST_INFINITY;
-       *strategy_parameter = ~0UL;
-}
-#endif
-
-/* Board-specific fixup routines. */
-void pcibios_fixup(void);
-int pcibios_init_platform(void);
-int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin);
-
-#ifdef CONFIG_PCI_AUTO
-int pciauto_assign_resources(int busno, struct pci_channel *hose);
-#endif
-
-#endif /* __KERNEL__ */
-
-/* generic pci stuff */
-#include <asm-generic/pci.h>
-
-/* generic DMA-mapping stuff */
-#include <asm-generic/pci-dma-compat.h>
-
-#endif /* __ASM_SH_PCI_H */
-
diff --git a/include/asm-sh/percpu.h b/include/asm-sh/percpu.h
deleted file mode 100644 (file)
index 4db4b39..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ARCH_SH_PERCPU
-#define __ARCH_SH_PERCPU
-
-#include <asm-generic/percpu.h>
-
-#endif /* __ARCH_SH_PERCPU */
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
deleted file mode 100644 (file)
index 84dd2db..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef __ASM_SH_PGALLOC_H
-#define __ASM_SH_PGALLOC_H
-
-#include <linux/quicklist.h>
-#include <asm/page.h>
-
-#define QUICK_PGD 0    /* We preserve special mappings over free */
-#define QUICK_PT 1     /* Other page table pages that are zero on free */
-
-static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
-                                      pte_t *pte)
-{
-       set_pmd(pmd, __pmd((unsigned long)pte));
-}
-
-static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
-                               pgtable_t pte)
-{
-       set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
-}
-#define pmd_pgtable(pmd) pmd_page(pmd)
-
-static inline void pgd_ctor(void *x)
-{
-       pgd_t *pgd = x;
-
-       memcpy(pgd + USER_PTRS_PER_PGD,
-              swapper_pg_dir + USER_PTRS_PER_PGD,
-              (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
-}
-
-/*
- * Allocate and free page tables.
- */
-static inline pgd_t *pgd_alloc(struct mm_struct *mm)
-{
-       return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
-}
-
-static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
-{
-       quicklist_free(QUICK_PGD, NULL, pgd);
-}
-
-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
-                                         unsigned long address)
-{
-       return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
-}
-
-static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
-                                       unsigned long address)
-{
-       struct page *page;
-       void *pg;
-
-       pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
-       if (!pg)
-               return NULL;
-       page = virt_to_page(pg);
-       pgtable_page_ctor(page);
-       return page;
-}
-
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
-{
-       quicklist_free(QUICK_PT, NULL, pte);
-}
-
-static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
-{
-       pgtable_page_dtor(pte);
-       quicklist_free_page(QUICK_PT, NULL, pte);
-}
-
-#define __pte_free_tlb(tlb,pte)                                \
-do {                                                   \
-       pgtable_page_dtor(pte);                         \
-       tlb_remove_page((tlb), (pte));                  \
-} while (0)
-
-/*
- * allocating and freeing a pmd is trivial: the 1-entry pmd is
- * inside the pgd, so has no extra memory associated with it.
- */
-
-#define pmd_free(mm, x)                        do { } while (0)
-#define __pmd_free_tlb(tlb,x)          do { } while (0)
-
-static inline void check_pgt_cache(void)
-{
-       quicklist_trim(QUICK_PGD, NULL, 25, 16);
-       quicklist_trim(QUICK_PT, NULL, 25, 16);
-}
-
-#endif /* __ASM_SH_PGALLOC_H */
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
deleted file mode 100644 (file)
index a4a8f8b..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * This file contains the functions and defines necessary to modify and
- * use the SuperH page table tree.
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2002 - 2007 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_PGTABLE_H
-#define __ASM_SH_PGTABLE_H
-
-#include <asm-generic/pgtable-nopmd.h>
-#include <asm/page.h>
-
-#ifndef __ASSEMBLY__
-#include <asm/addrspace.h>
-#include <asm/fixmap.h>
-
-/*
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
-#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
-
-#endif /* !__ASSEMBLY__ */
-
-/*
- * Effective and physical address definitions, to aid with sign
- * extension.
- */
-#define NEFF           32
-#define        NEFF_SIGN       (1LL << (NEFF - 1))
-#define        NEFF_MASK       (-1LL << NEFF)
-
-#ifdef CONFIG_29BIT
-#define NPHYS          29
-#else
-#define NPHYS          32
-#endif
-
-#define        NPHYS_SIGN      (1LL << (NPHYS - 1))
-#define        NPHYS_MASK      (-1LL << NPHYS)
-
-/*
- * traditional two-level paging structure
- */
-/* PTE bits */
-#if defined(CONFIG_X2TLB) || defined(CONFIG_SUPERH64)
-# define PTE_MAGNITUDE 3       /* 64-bit PTEs on extended mode SH-X2 TLB */
-#else
-# define PTE_MAGNITUDE 2       /* 32-bit PTEs */
-#endif
-#define PTE_SHIFT      PAGE_SHIFT
-#define PTE_BITS       (PTE_SHIFT - PTE_MAGNITUDE)
-
-/* PGD bits */
-#define PGDIR_SHIFT    (PTE_SHIFT + PTE_BITS)
-#define PGDIR_SIZE     (1UL << PGDIR_SHIFT)
-#define PGDIR_MASK     (~(PGDIR_SIZE-1))
-
-/* Entries per level */
-#define PTRS_PER_PTE   (PAGE_SIZE / (1 << PTE_MAGNITUDE))
-#define PTRS_PER_PGD   (PAGE_SIZE / sizeof(pgd_t))
-
-#define USER_PTRS_PER_PGD      (TASK_SIZE/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
-
-#ifdef CONFIG_32BIT
-#define PHYS_ADDR_MASK         0xffffffff
-#else
-#define PHYS_ADDR_MASK         0x1fffffff
-#endif
-
-#define PTE_PHYS_MASK          (PHYS_ADDR_MASK & PAGE_MASK)
-
-#ifdef CONFIG_SUPERH32
-#define VMALLOC_START  (P3SEG)
-#else
-#define VMALLOC_START  (0xf0000000)
-#endif
-#define VMALLOC_END    (FIXADDR_START-2*PAGE_SIZE)
-
-#if defined(CONFIG_SUPERH32)
-#include <asm/pgtable_32.h>
-#else
-#include <asm/pgtable_64.h>
-#endif
-
-/*
- * SH-X and lower (legacy) SuperH parts (SH-3, SH-4, some SH-4A) can't do page
- * protection for execute, and considers it the same as a read. Also, write
- * permission implies read permission. This is the closest we can get..
- *
- * SH-X2 (SH7785) and later parts take this to the opposite end of the extreme,
- * not only supporting separate execute, read, and write bits, but having
- * completely separate permission bits for user and kernel space.
- */
-        /*xwr*/
-#define __P000 PAGE_NONE
-#define __P001 PAGE_READONLY
-#define __P010 PAGE_COPY
-#define __P011 PAGE_COPY
-#define __P100 PAGE_EXECREAD
-#define __P101 PAGE_EXECREAD
-#define __P110 PAGE_COPY
-#define __P111 PAGE_COPY
-
-#define __S000 PAGE_NONE
-#define __S001 PAGE_READONLY
-#define __S010 PAGE_WRITEONLY
-#define __S011 PAGE_SHARED
-#define __S100 PAGE_EXECREAD
-#define __S101 PAGE_EXECREAD
-#define __S110 PAGE_RWX
-#define __S111 PAGE_RWX
-
-typedef pte_t *pte_addr_t;
-
-#define kern_addr_valid(addr)  (1)
-
-#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)                \
-               remap_pfn_range(vma, vaddr, pfn, size, prot)
-
-#define pte_pfn(x)             ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
-
-/*
- * No page table caches to initialise
- */
-#define pgtable_cache_init()   do { } while (0)
-
-#if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
-       defined(CONFIG_SH7705_CACHE_32KB))
-struct mm_struct;
-#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
-#endif
-
-struct vm_area_struct;
-extern void update_mmu_cache(struct vm_area_struct * vma,
-                            unsigned long address, pte_t pte);
-extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-extern void paging_init(void);
-extern void page_table_range_init(unsigned long start, unsigned long end,
-                                 pgd_t *pgd);
-
-#include <asm-generic/pgtable.h>
-
-#endif /* __ASM_SH_PGTABLE_H */
diff --git a/include/asm-sh/pgtable_32.h b/include/asm-sh/pgtable_32.h
deleted file mode 100644 (file)
index 72ea209..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-#ifndef __ASM_SH_PGTABLE_32_H
-#define __ASM_SH_PGTABLE_32_H
-
-/*
- * Linux PTEL encoding.
- *
- * Hardware and software bit definitions for the PTEL value (see below for
- * notes on SH-X2 MMUs and 64-bit PTEs):
- *
- * - Bits 0 and 7 are reserved on SH-3 (_PAGE_WT and _PAGE_SZ1 on SH-4).
- *
- * - Bit 1 is the SH-bit, but is unused on SH-3 due to an MMU bug (the
- *   hardware PTEL value can't have the SH-bit set when MMUCR.IX is set,
- *   which is the default in cpu-sh3/mmu_context.h:MMU_CONTROL_INIT).
- *
- *   In order to keep this relatively clean, do not use these for defining
- *   SH-3 specific flags until all of the other unused bits have been
- *   exhausted.
- *
- * - Bit 9 is reserved by everyone and used by _PAGE_PROTNONE.
- *
- * - Bits 10 and 11 are low bits of the PPN that are reserved on >= 4K pages.
- *   Bit 10 is used for _PAGE_ACCESSED, bit 11 remains unused.
- *
- * - On 29 bit platforms, bits 31 to 29 are used for the space attributes
- *   and timing control which (together with bit 0) are moved into the
- *   old-style PTEA on the parts that support it.
- *
- * XXX: Leave the _PAGE_FILE and _PAGE_WT overhaul for a rainy day.
- *
- * SH-X2 MMUs and extended PTEs
- *
- * SH-X2 supports an extended mode TLB with split data arrays due to the
- * number of bits needed for PR and SZ (now EPR and ESZ) encodings. The PR and
- * SZ bit placeholders still exist in data array 1, but are implemented as
- * reserved bits, with the real logic existing in data array 2.
- *
- * The downside to this is that we can no longer fit everything in to a 32-bit
- * PTE encoding, so a 64-bit pte_t is necessary for these parts. On the plus
- * side, this gives us quite a few spare bits to play with for future usage.
- */
-/* Legacy and compat mode bits */
-#define        _PAGE_WT        0x001           /* WT-bit on SH-4, 0 on SH-3 */
-#define _PAGE_HW_SHARED        0x002           /* SH-bit  : shared among processes */
-#define _PAGE_DIRTY    0x004           /* D-bit   : page changed */
-#define _PAGE_CACHABLE 0x008           /* C-bit   : cachable */
-#define _PAGE_SZ0      0x010           /* SZ0-bit : Size of page */
-#define _PAGE_RW       0x020           /* PR0-bit : write access allowed */
-#define _PAGE_USER     0x040           /* PR1-bit : user space access allowed*/
-#define _PAGE_SZ1      0x080           /* SZ1-bit : Size of page (on SH-4) */
-#define _PAGE_PRESENT  0x100           /* V-bit   : page is valid */
-#define _PAGE_PROTNONE 0x200           /* software: if not present  */
-#define _PAGE_ACCESSED 0x400           /* software: page referenced */
-#define _PAGE_FILE     _PAGE_WT        /* software: pagecache or swap? */
-
-#define _PAGE_SZ_MASK  (_PAGE_SZ0 | _PAGE_SZ1)
-#define _PAGE_PR_MASK  (_PAGE_RW | _PAGE_USER)
-
-/* Extended mode bits */
-#define _PAGE_EXT_ESZ0         0x0010  /* ESZ0-bit: Size of page */
-#define _PAGE_EXT_ESZ1         0x0020  /* ESZ1-bit: Size of page */
-#define _PAGE_EXT_ESZ2         0x0040  /* ESZ2-bit: Size of page */
-#define _PAGE_EXT_ESZ3         0x0080  /* ESZ3-bit: Size of page */
-
-#define _PAGE_EXT_USER_EXEC    0x0100  /* EPR0-bit: User space executable */
-#define _PAGE_EXT_USER_WRITE   0x0200  /* EPR1-bit: User space writable */
-#define _PAGE_EXT_USER_READ    0x0400  /* EPR2-bit: User space readable */
-
-#define _PAGE_EXT_KERN_EXEC    0x0800  /* EPR3-bit: Kernel space executable */
-#define _PAGE_EXT_KERN_WRITE   0x1000  /* EPR4-bit: Kernel space writable */
-#define _PAGE_EXT_KERN_READ    0x2000  /* EPR5-bit: Kernel space readable */
-
-/* Wrapper for extended mode pgprot twiddling */
-#define _PAGE_EXT(x)           ((unsigned long long)(x) << 32)
-
-/* software: moves to PTEA.TC (Timing Control) */
-#define _PAGE_PCC_AREA5        0x00000000      /* use BSC registers for area5 */
-#define _PAGE_PCC_AREA6        0x80000000      /* use BSC registers for area6 */
-
-/* software: moves to PTEA.SA[2:0] (Space Attributes) */
-#define _PAGE_PCC_IODYN 0x00000001     /* IO space, dynamically sized bus */
-#define _PAGE_PCC_IO8  0x20000000      /* IO space, 8 bit bus */
-#define _PAGE_PCC_IO16 0x20000001      /* IO space, 16 bit bus */
-#define _PAGE_PCC_COM8 0x40000000      /* Common Memory space, 8 bit bus */
-#define _PAGE_PCC_COM16        0x40000001      /* Common Memory space, 16 bit bus */
-#define _PAGE_PCC_ATR8 0x60000000      /* Attribute Memory space, 8 bit bus */
-#define _PAGE_PCC_ATR16        0x60000001      /* Attribute Memory space, 6 bit bus */
-
-/* Mask which drops unused bits from the PTEL value */
-#if defined(CONFIG_CPU_SH3)
-#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED| \
-                                _PAGE_FILE     | _PAGE_SZ1     | \
-                                _PAGE_HW_SHARED)
-#elif defined(CONFIG_X2TLB)
-/* Get rid of the legacy PR/SZ bits when using extended mode */
-#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED | \
-                                _PAGE_FILE | _PAGE_PR_MASK | _PAGE_SZ_MASK)
-#else
-#define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)
-#endif
-
-#define _PAGE_FLAGS_HARDWARE_MASK      (PHYS_ADDR_MASK & ~(_PAGE_CLEAR_FLAGS))
-
-/* Hardware flags, page size encoding */
-#if !defined(CONFIG_MMU)
-# define _PAGE_FLAGS_HARD      0ULL
-#elif defined(CONFIG_X2TLB)
-# if defined(CONFIG_PAGE_SIZE_4KB)
-#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ0)
-# elif defined(CONFIG_PAGE_SIZE_8KB)
-#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ1)
-# elif defined(CONFIG_PAGE_SIZE_64KB)
-#  define _PAGE_FLAGS_HARD     _PAGE_EXT(_PAGE_EXT_ESZ2)
-# endif
-#else
-# if defined(CONFIG_PAGE_SIZE_4KB)
-#  define _PAGE_FLAGS_HARD     _PAGE_SZ0
-# elif defined(CONFIG_PAGE_SIZE_64KB)
-#  define _PAGE_FLAGS_HARD     _PAGE_SZ1
-# endif
-#endif
-
-#if defined(CONFIG_X2TLB)
-# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
-#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ2)
-# elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
-#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ0 | _PAGE_EXT_ESZ2)
-# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
-#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ0 | _PAGE_EXT_ESZ1 | _PAGE_EXT_ESZ2)
-# elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
-#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ3)
-# elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
-#  define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3)
-# endif
-#else
-# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
-#  define _PAGE_SZHUGE (_PAGE_SZ1)
-# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
-#  define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1)
-# endif
-#endif
-
-/*
- * Stub out _PAGE_SZHUGE if we don't have a good definition for it,
- * to make pte_mkhuge() happy.
- */
-#ifndef _PAGE_SZHUGE
-# define _PAGE_SZHUGE  (_PAGE_FLAGS_HARD)
-#endif
-
-#define _PAGE_CHG_MASK \
-       (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | _PAGE_DIRTY)
-
-#ifndef __ASSEMBLY__
-
-#if defined(CONFIG_X2TLB) /* SH-X2 TLB */
-#define PAGE_NONE      __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
-
-#define PAGE_SHARED    __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ  | \
-                                          _PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_USER_READ  | \
-                                          _PAGE_EXT_USER_WRITE))
-
-#define PAGE_EXECREAD  __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_EXEC | \
-                                          _PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_USER_EXEC | \
-                                          _PAGE_EXT_USER_READ))
-
-#define PAGE_COPY      PAGE_EXECREAD
-
-#define PAGE_READONLY  __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_USER_READ))
-
-#define PAGE_WRITEONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_USER_WRITE))
-
-#define PAGE_RWX       __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-                                _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_KERN_READ  | \
-                                          _PAGE_EXT_KERN_EXEC  | \
-                                          _PAGE_EXT_USER_WRITE | \
-                                          _PAGE_EXT_USER_READ  | \
-                                          _PAGE_EXT_USER_EXEC))
-
-#define PAGE_KERNEL    __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
-                                _PAGE_DIRTY | _PAGE_ACCESSED | \
-                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_KERN_EXEC))
-
-#define PAGE_KERNEL_NOCACHE \
-                       __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | \
-                                _PAGE_ACCESSED | _PAGE_HW_SHARED | \
-                                _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_KERN_EXEC))
-
-#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
-                                _PAGE_DIRTY | _PAGE_ACCESSED | \
-                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_KERN_EXEC))
-
-#define PAGE_KERNEL_PCC(slot, type) \
-                       __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD | \
-                                _PAGE_EXT(_PAGE_EXT_KERN_READ | \
-                                          _PAGE_EXT_KERN_WRITE | \
-                                          _PAGE_EXT_KERN_EXEC) \
-                                (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | \
-                                (type))
-
-#elif defined(CONFIG_MMU) /* SH-X TLB */
-#define PAGE_NONE      __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
-
-#define PAGE_SHARED    __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
-                                _PAGE_CACHABLE | _PAGE_ACCESSED | \
-                                _PAGE_FLAGS_HARD)
-
-#define PAGE_COPY      __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
-
-#define PAGE_READONLY  __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
-
-#define PAGE_EXECREAD  PAGE_READONLY
-#define PAGE_RWX       PAGE_SHARED
-#define PAGE_WRITEONLY PAGE_SHARED
-
-#define PAGE_KERNEL    __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | \
-                                _PAGE_DIRTY | _PAGE_ACCESSED | \
-                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
-
-#define PAGE_KERNEL_NOCACHE \
-                       __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
-                                _PAGE_ACCESSED | _PAGE_HW_SHARED | \
-                                _PAGE_FLAGS_HARD)
-
-#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | \
-                                _PAGE_DIRTY | _PAGE_ACCESSED | \
-                                _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
-
-#define PAGE_KERNEL_PCC(slot, type) \
-                       __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | \
-                                _PAGE_ACCESSED | _PAGE_FLAGS_HARD | \
-                                (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | \
-                                (type))
-#else /* no mmu */
-#define PAGE_NONE              __pgprot(0)
-#define PAGE_SHARED            __pgprot(0)
-#define PAGE_COPY              __pgprot(0)
-#define PAGE_EXECREAD          __pgprot(0)
-#define PAGE_RWX               __pgprot(0)
-#define PAGE_READONLY          __pgprot(0)
-#define PAGE_WRITEONLY         __pgprot(0)
-#define PAGE_KERNEL            __pgprot(0)
-#define PAGE_KERNEL_NOCACHE    __pgprot(0)
-#define PAGE_KERNEL_RO         __pgprot(0)
-
-#define PAGE_KERNEL_PCC(slot, type) \
-                               __pgprot(0)
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#ifndef __ASSEMBLY__
-
-/*
- * Certain architectures need to do special things when PTEs
- * within a page table are directly modified.  Thus, the following
- * hook is made available.
- */
-#ifdef CONFIG_X2TLB
-static inline void set_pte(pte_t *ptep, pte_t pte)
-{
-       ptep->pte_high = pte.pte_high;
-       smp_wmb();
-       ptep->pte_low = pte.pte_low;
-}
-#else
-#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
-#endif
-
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
-
-/*
- * (pmds are folded into pgds so this doesn't get actually called,
- * but the define is needed for a generic inline function.)
- */
-#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
-
-#define pfn_pte(pfn, prot) \
-       __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
-#define pfn_pmd(pfn, prot) \
-       __pmd(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
-
-#define pte_none(x)            (!pte_val(x))
-#define pte_present(x)         ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
-
-#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
-
-#define pmd_none(x)    (!pmd_val(x))
-#define pmd_present(x) (pmd_val(x))
-#define pmd_clear(xp)  do { set_pmd(xp, __pmd(0)); } while (0)
-#define        pmd_bad(x)      (pmd_val(x) & ~PAGE_MASK)
-
-#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-#define pte_page(x)    pfn_to_page(pte_pfn(x))
-
-/*
- * The following only work if pte_present() is true.
- * Undefined behaviour if not..
- */
-#define pte_not_present(pte)   (!((pte).pte_low & _PAGE_PRESENT))
-#define pte_dirty(pte)         ((pte).pte_low & _PAGE_DIRTY)
-#define pte_young(pte)         ((pte).pte_low & _PAGE_ACCESSED)
-#define pte_file(pte)          ((pte).pte_low & _PAGE_FILE)
-#define pte_special(pte)       (0)
-
-#ifdef CONFIG_X2TLB
-#define pte_write(pte)         ((pte).pte_high & _PAGE_EXT_USER_WRITE)
-#else
-#define pte_write(pte)         ((pte).pte_low & _PAGE_RW)
-#endif
-
-#define PTE_BIT_FUNC(h,fn,op) \
-static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; }
-
-#ifdef CONFIG_X2TLB
-/*
- * We cheat a bit in the SH-X2 TLB case. As the permission bits are
- * individually toggled (and user permissions are entirely decoupled from
- * kernel permissions), we attempt to couple them a bit more sanely here.
- */
-PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE);
-PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE);
-PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE);
-#else
-PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW);
-PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW);
-PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE);
-#endif
-
-PTE_BIT_FUNC(low, mkclean, &= ~_PAGE_DIRTY);
-PTE_BIT_FUNC(low, mkdirty, |= _PAGE_DIRTY);
-PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED);
-PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED);
-
-static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
-
-/*
- * Macro and implementation to make a page protection as uncachable.
- */
-#define pgprot_writecombine(prot) \
-       __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
-
-#define pgprot_noncached        pgprot_writecombine
-
-/*
- * Conversion functions: convert a page and protection to a page entry,
- * and a page entry and page directory to the page they refer to.
- *
- * extern pte_t mk_pte(struct page *page, pgprot_t pgprot)
- */
-#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
-
-static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{
-       pte.pte_low &= _PAGE_CHG_MASK;
-       pte.pte_low |= pgprot_val(newprot);
-
-#ifdef CONFIG_X2TLB
-       pte.pte_high |= pgprot_val(newprot) >> 32;
-#endif
-
-       return pte;
-}
-
-#define pmd_page_vaddr(pmd)    ((unsigned long)pmd_val(pmd))
-#define pmd_page(pmd)          (virt_to_page(pmd_val(pmd)))
-
-/* 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))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address)  pgd_offset(&init_mm, address)
-
-/* Find an entry in the third-level page table.. */
-#define pte_index(address)     ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset_kernel(dir, address) \
-       ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address)           pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address)    pte_offset_kernel(dir, address)
-
-#define pte_unmap(pte)         do { } while (0)
-#define pte_unmap_nested(pte)  do { } while (0)
-
-#ifdef CONFIG_X2TLB
-#define pte_ERROR(e) \
-       printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, \
-              &(e), (e).pte_high, (e).pte_low)
-#define pgd_ERROR(e) \
-       printk("%s:%d: bad pgd %016llx.\n", __FILE__, __LINE__, pgd_val(e))
-#else
-#define pte_ERROR(e) \
-       printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
-#define pgd_ERROR(e) \
-       printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
-#endif
-
-/*
- * Encode and de-code a swap entry
- *
- * Constraints:
- *     _PAGE_FILE at bit 0
- *     _PAGE_PRESENT at bit 8
- *     _PAGE_PROTNONE at bit 9
- *
- * For the normal case, we encode the swap type into bits 0:7 and the
- * swap offset into bits 10:30. For the 64-bit PTE case, we keep the
- * preserved bits in the low 32-bits and use the upper 32 as the swap
- * offset (along with a 5-bit type), following the same approach as x86
- * PAE. This keeps the logic quite simple, and allows for a full 32
- * PTE_FILE_MAX_BITS, as opposed to the 29-bits we're constrained with
- * in the pte_low case.
- *
- * As is evident by the Alpha code, if we ever get a 64-bit unsigned
- * long (swp_entry_t) to match up with the 64-bit PTEs, this all becomes
- * much cleaner..
- *
- * NOTE: We should set ZEROs at the position of _PAGE_PRESENT
- *       and _PAGE_PROTNONE bits
- */
-#ifdef CONFIG_X2TLB
-#define __swp_type(x)                  ((x).val & 0x1f)
-#define __swp_offset(x)                        ((x).val >> 5)
-#define __swp_entry(type, offset)      ((swp_entry_t){ (type) | (offset) << 5})
-#define __pte_to_swp_entry(pte)                ((swp_entry_t){ (pte).pte_high })
-#define __swp_entry_to_pte(x)          ((pte_t){ 0, (x).val })
-
-/*
- * Encode and decode a nonlinear file mapping entry
- */
-#define pte_to_pgoff(pte)              ((pte).pte_high)
-#define pgoff_to_pte(off)              ((pte_t) { _PAGE_FILE, (off) })
-
-#define PTE_FILE_MAX_BITS              32
-#else
-#define __swp_type(x)                  ((x).val & 0xff)
-#define __swp_offset(x)                        ((x).val >> 10)
-#define __swp_entry(type, offset)      ((swp_entry_t){(type) | (offset) <<10})
-
-#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) >> 1 })
-#define __swp_entry_to_pte(x)          ((pte_t) { (x).val << 1 })
-
-/*
- * Encode and decode a nonlinear file mapping entry
- */
-#define PTE_FILE_MAX_BITS      29
-#define pte_to_pgoff(pte)      (pte_val(pte) >> 1)
-#define pgoff_to_pte(off)      ((pte_t) { ((off) << 1) | _PAGE_FILE })
-#endif
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_PGTABLE_32_H */
diff --git a/include/asm-sh/pgtable_64.h b/include/asm-sh/pgtable_64.h
deleted file mode 100644 (file)
index c78990c..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-#ifndef __ASM_SH_PGTABLE_64_H
-#define __ASM_SH_PGTABLE_64_H
-
-/*
- * include/asm-sh/pgtable_64.h
- *
- * This file contains the functions and defines necessary to modify and use
- * the SuperH page table tree.
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003, 2004  Paul Mundt
- * Copyright (C) 2003, 2004  Richard Curnow
- *
- * 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.
- */
-#include <linux/threads.h>
-#include <asm/processor.h>
-#include <asm/page.h>
-
-/*
- * Error outputs.
- */
-#define pte_ERROR(e) \
-       printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
-#define pgd_ERROR(e) \
-       printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
-
-/*
- * Table setting routines. Used within arch/mm only.
- */
-#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
-
-static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
-{
-       unsigned long long x = ((unsigned long long) pteval.pte_low);
-       unsigned long long *xp = (unsigned long long *) pteptr;
-       /*
-        * Sign-extend based on NPHYS.
-        */
-       *(xp) = (x & NPHYS_SIGN) ? (x | NPHYS_MASK) : x;
-}
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
-
-static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
-{
-       pmd_val(*pmdp) = (unsigned long) ptep;
-}
-
-/*
- * PGD defines. Top level.
- */
-
-/* To find an entry in a generic PGD. */
-#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define __pgd_offset(address) pgd_index(address)
-#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
-
-/* To find an entry in a kernel PGD. */
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-
-/*
- * PMD level access routines. Same notes as above.
- */
-#define _PMD_EMPTY             0x0
-/* Either the PMD is empty or present, it's not paged out */
-#define pmd_present(pmd_entry) (pmd_val(pmd_entry) & _PAGE_PRESENT)
-#define pmd_clear(pmd_entry_p) (set_pmd((pmd_entry_p), __pmd(_PMD_EMPTY)))
-#define pmd_none(pmd_entry)    (pmd_val((pmd_entry)) == _PMD_EMPTY)
-#define pmd_bad(pmd_entry)     ((pmd_val(pmd_entry) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
-
-#define pmd_page_vaddr(pmd_entry) \
-       ((unsigned long) __va(pmd_val(pmd_entry) & PAGE_MASK))
-
-#define pmd_page(pmd) \
-       (virt_to_page(pmd_val(pmd)))
-
-/* PMD to PTE dereferencing */
-#define pte_index(address) \
-               ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-
-#define pte_offset_kernel(dir, addr) \
-               ((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr)))
-
-#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)
-
-#ifndef __ASSEMBLY__
-#define IOBASE_VADDR   0xff000000
-#define IOBASE_END     0xffffffff
-
-/*
- * PTEL coherent flags.
- * See Chapter 17 ST50 CPU Core Volume 1, Architecture.
- */
-/* The bits that are required in the SH-5 TLB are placed in the h/w-defined
-   positions, to avoid expensive bit shuffling on every refill.  The remaining
-   bits are used for s/w purposes and masked out on each refill.
-
-   Note, the PTE slots are used to hold data of type swp_entry_t when a page is
-   swapped out.  Only the _PAGE_PRESENT flag is significant when the page is
-   swapped out, and it must be placed so that it doesn't overlap either the
-   type or offset fields of swp_entry_t.  For x86, offset is at [31:8] and type
-   at [6:1], with _PAGE_PRESENT at bit 0 for both pte_t and swp_entry_t.  This
-   scheme doesn't map to SH-5 because bit [0] controls cacheability.  So bit
-   [2] is used for _PAGE_PRESENT and the type field of swp_entry_t is split
-   into 2 pieces.  That is handled by SWP_ENTRY and SWP_TYPE below. */
-#define _PAGE_WT       0x001  /* CB0: if cacheable, 1->write-thru, 0->write-back */
-#define _PAGE_DEVICE   0x001  /* CB0: if uncacheable, 1->device (i.e. no write-combining or reordering at bus level) */
-#define _PAGE_CACHABLE 0x002  /* CB1: uncachable/cachable */
-#define _PAGE_PRESENT  0x004  /* software: page referenced */
-#define _PAGE_FILE     0x004  /* software: only when !present */
-#define _PAGE_SIZE0    0x008  /* SZ0-bit : size of page */
-#define _PAGE_SIZE1    0x010  /* SZ1-bit : size of page */
-#define _PAGE_SHARED   0x020  /* software: reflects PTEH's SH */
-#define _PAGE_READ     0x040  /* PR0-bit : read access allowed */
-#define _PAGE_EXECUTE  0x080  /* PR1-bit : execute access allowed */
-#define _PAGE_WRITE    0x100  /* PR2-bit : write access allowed */
-#define _PAGE_USER     0x200  /* PR3-bit : user space access allowed */
-#define _PAGE_DIRTY    0x400  /* software: page accessed in write */
-#define _PAGE_ACCESSED 0x800  /* software: page referenced */
-
-/* Mask which drops software flags */
-#define _PAGE_FLAGS_HARDWARE_MASK      0xfffffffffffff3dbLL
-
-/*
- * HugeTLB support
- */
-#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
-#define _PAGE_SZHUGE   (_PAGE_SIZE0)
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
-#define _PAGE_SZHUGE   (_PAGE_SIZE1)
-#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
-#define _PAGE_SZHUGE   (_PAGE_SIZE0 | _PAGE_SIZE1)
-#endif
-
-/*
- * Stub out _PAGE_SZHUGE if we don't have a good definition for it,
- * to make pte_mkhuge() happy.
- */
-#ifndef _PAGE_SZHUGE
-# define _PAGE_SZHUGE  (0)
-#endif
-
-/*
- * Default flags for a Kernel page.
- * This is fundametally also SHARED because the main use of this define
- * (other than for PGD/PMD entries) is for the VMALLOC pool which is
- * contextless.
- *
- * _PAGE_EXECUTE is required for modules
- *
- */
-#define _KERNPG_TABLE  (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
-                        _PAGE_EXECUTE | \
-                        _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_DIRTY | \
-                        _PAGE_SHARED)
-
-/* Default flags for a User page */
-#define _PAGE_TABLE    (_KERNPG_TABLE | _PAGE_USER)
-
-#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
-
-/*
- * We have full permissions (Read/Write/Execute/Shared).
- */
-#define _PAGE_COMMON   (_PAGE_PRESENT | _PAGE_USER | \
-                        _PAGE_CACHABLE | _PAGE_ACCESSED)
-
-#define PAGE_NONE      __pgprot(_PAGE_CACHABLE | _PAGE_ACCESSED)
-#define PAGE_SHARED    __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_WRITE | \
-                                _PAGE_SHARED)
-#define PAGE_EXECREAD  __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_EXECUTE)
-
-/*
- * We need to include PAGE_EXECUTE in PAGE_COPY because it is the default
- * protection mode for the stack.
- */
-#define PAGE_COPY      PAGE_EXECREAD
-
-#define PAGE_READONLY  __pgprot(_PAGE_COMMON | _PAGE_READ)
-#define PAGE_WRITEONLY __pgprot(_PAGE_COMMON | _PAGE_WRITE)
-#define PAGE_RWX       __pgprot(_PAGE_COMMON | _PAGE_READ | \
-                                _PAGE_WRITE | _PAGE_EXECUTE)
-#define PAGE_KERNEL    __pgprot(_KERNPG_TABLE)
-
-#define PAGE_KERNEL_NOCACHE \
-                       __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
-                                _PAGE_EXECUTE | _PAGE_ACCESSED | \
-                                _PAGE_DIRTY | _PAGE_SHARED)
-
-/* Make it a device mapping for maximum safety (e.g. for mapping device
-   registers into user-space via /dev/map).  */
-#define pgprot_noncached(x) __pgprot(((x).pgprot & ~(_PAGE_CACHABLE)) | _PAGE_DEVICE)
-#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
-
-/*
- * Handling allocation failures during page table setup.
- */
-extern void __handle_bad_pmd_kernel(pmd_t * pmd);
-#define __handle_bad_pmd(x)    __handle_bad_pmd_kernel(x)
-
-/*
- * PTE level access routines.
- *
- * Note1:
- * It's the tree walk leaf. This is physical address to be stored.
- *
- * Note 2:
- * Regarding the choice of _PTE_EMPTY:
-
-   We must choose a bit pattern that cannot be valid, whether or not the page
-   is present.  bit[2]==1 => present, bit[2]==0 => swapped out.  If swapped
-   out, bits [31:8], [6:3], [1:0] are under swapper control, so only bit[7] is
-   left for us to select.  If we force bit[7]==0 when swapped out, we could use
-   the combination bit[7,2]=2'b10 to indicate an empty PTE.  Alternatively, if
-   we force bit[7]==1 when swapped out, we can use all zeroes to indicate
-   empty.  This is convenient, because the page tables get cleared to zero
-   when they are allocated.
-
- */
-#define _PTE_EMPTY     0x0
-#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
-#define pte_clear(mm,addr,xp)  (set_pte_at(mm, addr, xp, __pte(_PTE_EMPTY)))
-#define pte_none(x)    (pte_val(x) == _PTE_EMPTY)
-
-/*
- * Some definitions to translate between mem_map, PTEs, and page
- * addresses:
- */
-
-/*
- * Given a PTE, return the index of the mem_map[] entry corresponding
- * to the page frame the PTE. Get the absolute physical address, make
- * a relative physical address and translate it to an index.
- */
-#define pte_pagenr(x)          (((unsigned long) (pte_val(x)) - \
-                                __MEMORY_START) >> PAGE_SHIFT)
-
-/*
- * Given a PTE, return the "struct page *".
- */
-#define pte_page(x)            (mem_map + pte_pagenr(x))
-
-/*
- * Return number of (down rounded) MB corresponding to x pages.
- */
-#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-
-
-/*
- * The following have defined behavior only work if pte_present() is true.
- */
-static inline int pte_dirty(pte_t pte)  { return pte_val(pte) & _PAGE_DIRTY; }
-static inline int pte_young(pte_t pte)  { return pte_val(pte) & _PAGE_ACCESSED; }
-static inline int pte_file(pte_t pte)   { return pte_val(pte) & _PAGE_FILE; }
-static inline int pte_write(pte_t pte)  { return pte_val(pte) & _PAGE_WRITE; }
-static inline int pte_special(pte_t pte){ return 0; }
-
-static inline pte_t pte_wrprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; }
-static inline pte_t pte_mkclean(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
-static inline pte_t pte_mkold(pte_t pte)       { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
-static inline pte_t pte_mkwrite(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; }
-static inline pte_t pte_mkdirty(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
-static inline pte_t pte_mkyoung(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
-static inline pte_t pte_mkhuge(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; }
-static inline pte_t pte_mkspecial(pte_t pte)   { return pte; }
-
-
-/*
- * Conversion functions: convert a page and protection to a page entry.
- *
- * extern pte_t mk_pte(struct page *page, pgprot_t pgprot)
- */
-#define mk_pte(page,pgprot)                                                    \
-({                                                                             \
-       pte_t __pte;                                                            \
-                                                                               \
-       set_pte(&__pte, __pte((((page)-mem_map) << PAGE_SHIFT) |                \
-               __MEMORY_START | pgprot_val((pgprot))));                        \
-       __pte;                                                                  \
-})
-
-/*
- * This takes a (absolute) physical page address that is used
- * by the remapping functions
- */
-#define mk_pte_phys(physpage, pgprot) \
-({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; })
-
-static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; }
-
-/* Encode and decode a swap entry */
-#define __swp_type(x)                  (((x).val & 3) + (((x).val >> 1) & 0x3c))
-#define __swp_offset(x)                        ((x).val >> 8)
-#define __swp_entry(type, offset)      ((swp_entry_t) { ((offset << 8) + ((type & 0x3c) << 1) + (type & 3)) })
-#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
-
-/* Encode and decode a nonlinear file mapping entry */
-#define PTE_FILE_MAX_BITS              29
-#define pte_to_pgoff(pte)              (pte_val(pte))
-#define pgoff_to_pte(off)              ((pte_t) { (off) | _PAGE_FILE })
-
-#endif /* !__ASSEMBLY__ */
-
-#define pfn_pte(pfn, prot)     __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
-#define pfn_pmd(pfn, prot)     __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
-
-#endif /* __ASM_SH_PGTABLE_64_H */
diff --git a/include/asm-sh/pm.h b/include/asm-sh/pm.h
deleted file mode 100644 (file)
index 56fdbd6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * 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 2006 (c) Andriy Skulysh <askulysh@gmail.com>
- *
- */
-#ifndef __ASM_SH_PM_H
-#define __ASM_SH_PM_H
-
-extern u8 wakeup_start;
-extern u8 wakeup_end;
-
-void pm_enter(void);
-
-#endif
diff --git a/include/asm-sh/poll.h b/include/asm-sh/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-sh/posix_types.h b/include/asm-sh/posix_types.h
deleted file mode 100644 (file)
index 4eeb723..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifdef __KERNEL__
-# ifdef CONFIG_SUPERH32
-#  include "posix_types_32.h"
-# else
-#  include "posix_types_64.h"
-# endif
-#else
-# ifdef __SH5__
-#  include "posix_types_64.h"
-# else
-#  include "posix_types_32.h"
-# endif
-#endif /* __KERNEL__ */
diff --git a/include/asm-sh/posix_types_32.h b/include/asm-sh/posix_types_32.h
deleted file mode 100644 (file)
index 0a3d2f5..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef __ASM_SH_POSIX_TYPES_H
-#define __ASM_SH_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 long  __kernel_ino_t;
-typedef unsigned short __kernel_mode_t;
-typedef unsigned short __kernel_nlink_t;
-typedef long           __kernel_off_t;
-typedef int            __kernel_pid_t;
-typedef unsigned short __kernel_ipc_pid_t;
-typedef unsigned short __kernel_uid_t;
-typedef unsigned short __kernel_gid_t;
-typedef unsigned int   __kernel_size_t;
-typedef int            __kernel_ssize_t;
-typedef int            __kernel_ptrdiff_t;
-typedef long           __kernel_time_t;
-typedef long           __kernel_suseconds_t;
-typedef long           __kernel_clock_t;
-typedef int            __kernel_timer_t;
-typedef int            __kernel_clockid_t;
-typedef int            __kernel_daddr_t;
-typedef char *         __kernel_caddr_t;
-typedef unsigned short __kernel_uid16_t;
-typedef unsigned short __kernel_gid16_t;
-typedef unsigned int   __kernel_uid32_t;
-typedef unsigned int   __kernel_gid32_t;
-
-typedef unsigned short __kernel_old_uid_t;
-typedef unsigned short __kernel_old_gid_t;
-typedef unsigned short __kernel_old_dev_t;
-
-#ifdef __GNUC__
-typedef long long      __kernel_loff_t;
-#endif
-
-typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
-       int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
-       int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
-} __kernel_fsid_t;
-
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
-
-#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 /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
-
-#endif /* __ASM_SH_POSIX_TYPES_H */
diff --git a/include/asm-sh/posix_types_64.h b/include/asm-sh/posix_types_64.h
deleted file mode 100644 (file)
index 0620317..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef __ASM_SH64_POSIX_TYPES_H
-#define __ASM_SH64_POSIX_TYPES_H
-
-/*
- * 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.
- *
- * include/asm-sh64/posix_types.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003  Paul Mundt
- *
- * 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 long  __kernel_ino_t;
-typedef unsigned short __kernel_mode_t;
-typedef unsigned short __kernel_nlink_t;
-typedef long           __kernel_off_t;
-typedef int            __kernel_pid_t;
-typedef unsigned short __kernel_ipc_pid_t;
-typedef unsigned short __kernel_uid_t;
-typedef unsigned short __kernel_gid_t;
-typedef long unsigned int      __kernel_size_t;
-typedef int            __kernel_ssize_t;
-typedef int            __kernel_ptrdiff_t;
-typedef long           __kernel_time_t;
-typedef long           __kernel_suseconds_t;
-typedef long           __kernel_clock_t;
-typedef int            __kernel_timer_t;
-typedef int            __kernel_clockid_t;
-typedef int            __kernel_daddr_t;
-typedef char *         __kernel_caddr_t;
-typedef unsigned short __kernel_uid16_t;
-typedef unsigned short __kernel_gid16_t;
-typedef unsigned int   __kernel_uid32_t;
-typedef unsigned int   __kernel_gid32_t;
-
-typedef unsigned short __kernel_old_uid_t;
-typedef unsigned short __kernel_old_gid_t;
-typedef unsigned short __kernel_old_dev_t;
-
-#ifdef __GNUC__
-typedef long long      __kernel_loff_t;
-#endif
-
-typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
-       int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
-       int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
-} __kernel_fsid_t;
-
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
-
-#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 /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
-
-#endif /* __ASM_SH64_POSIX_TYPES_H */
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
deleted file mode 100644 (file)
index 15d9f92..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __ASM_SH_PROCESSOR_H
-#define __ASM_SH_PROCESSOR_H
-
-#include <asm/cpu-features.h>
-#include <asm/segment.h>
-
-#ifndef __ASSEMBLY__
-/*
- *  CPU type and hardware bug flags. Kept separately for each CPU.
- *
- *  Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
- *  in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
- *  for parsing the subtype in get_cpu_subtype().
- */
-enum cpu_type {
-       /* SH-2 types */
-       CPU_SH7619,
-
-       /* SH-2A types */
-       CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
-
-       /* SH-3 types */
-       CPU_SH7705, CPU_SH7706, CPU_SH7707,
-       CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
-       CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
-       CPU_SH7720, CPU_SH7721, CPU_SH7729,
-
-       /* SH-4 types */
-       CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
-       CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
-
-       /* SH-4A types */
-       CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
-       CPU_SH7723, CPU_SHX3,
-
-       /* SH4AL-DSP types */
-       CPU_SH7343, CPU_SH7722, CPU_SH7366,
-
-       /* SH-5 types */
-        CPU_SH5_101, CPU_SH5_103,
-
-       /* Unknown subtype */
-       CPU_SH_NONE
-};
-
-/* Forward decl */
-struct sh_cpuinfo;
-
-/* arch/sh/kernel/setup.c */
-const char *get_cpu_subtype(struct sh_cpuinfo *c);
-
-#ifdef CONFIG_VSYSCALL
-int vsyscall_init(void);
-#else
-#define vsyscall_init() do { } while (0)
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#ifdef CONFIG_SUPERH32
-# include "processor_32.h"
-#else
-# include "processor_64.h"
-#endif
-
-#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/include/asm-sh/processor_32.h b/include/asm-sh/processor_32.h
deleted file mode 100644 (file)
index c6583f2..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * include/asm-sh/processor.h
- *
- * Copyright (C) 1999, 2000  Niibe Yutaka
- * Copyright (C) 2002, 2003  Paul Mundt
- */
-
-#ifndef __ASM_SH_PROCESSOR_32_H
-#define __ASM_SH_PROCESSOR_32_H
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-#include <asm/page.h>
-#include <asm/types.h>
-#include <asm/cache.h>
-#include <asm/ptrace.h>
-
-/*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ void *pc; __asm__("mova 1f, %0\n1:":"=z" (pc)); pc; })
-
-/* Core Processor Version Register */
-#define CCN_PVR                0xff000030
-#define CCN_CVR                0xff000040
-#define CCN_PRR                0xff000044
-
-struct sh_cpuinfo {
-       unsigned int type;
-       int cut_major, cut_minor;
-       unsigned long loops_per_jiffy;
-       unsigned long asid_cache;
-
-       struct cache_info icache;       /* Primary I-cache */
-       struct cache_info dcache;       /* Primary D-cache */
-       struct cache_info scache;       /* Secondary cache */
-
-       unsigned long flags;
-} __attribute__ ((aligned(L1_CACHE_BYTES)));
-
-extern struct sh_cpuinfo cpu_data[];
-#define boot_cpu_data cpu_data[0]
-#define current_cpu_data cpu_data[smp_processor_id()]
-#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
-
-/*
- * User space process size: 2GB.
- *
- * Since SH7709 and SH7750 have "area 7", we can't use 0x7c000000--0x7fffffff
- */
-#define TASK_SIZE      0x7c000000UL
-
-#define STACK_TOP      TASK_SIZE
-#define STACK_TOP_MAX  STACK_TOP
-
-/* This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE     (TASK_SIZE / 3)
-
-/*
- * Bit of SR register
- *
- * FD-bit:
- *     When it's set, it means the processor doesn't have right to use FPU,
- *     and it results exception when the floating operation is executed.
- *
- * IMASK-bit:
- *     Interrupt level mask
- */
-#define SR_DSP         0x00001000
-#define SR_IMASK       0x000000f0
-#define SR_FD          0x00008000
-
-/*
- * FPU structure and data
- */
-
-struct sh_fpu_hard_struct {
-       unsigned long fp_regs[16];
-       unsigned long xfp_regs[16];
-       unsigned long fpscr;
-       unsigned long fpul;
-
-       long status; /* software status information */
-};
-
-/* Dummy fpu emulator  */
-struct sh_fpu_soft_struct {
-       unsigned long fp_regs[16];
-       unsigned long xfp_regs[16];
-       unsigned long fpscr;
-       unsigned long fpul;
-
-       unsigned char lookahead;
-       unsigned long entry_pc;
-};
-
-union sh_fpu_union {
-       struct sh_fpu_hard_struct hard;
-       struct sh_fpu_soft_struct soft;
-};
-
-struct thread_struct {
-       /* Saved registers when thread is descheduled */
-       unsigned long sp;
-       unsigned long pc;
-
-       /* Hardware debugging registers */
-       unsigned long ubc_pc;
-
-       /* floating point info */
-       union sh_fpu_union fpu;
-};
-
-/* Count of active tasks with UBC settings */
-extern int ubc_usercnt;
-
-#define INIT_THREAD  {                                         \
-       .sp = sizeof(init_stack) + (long) &init_stack,          \
-}
-
-/*
- * Do necessary setup to start up a newly executed thread.
- */
-#define start_thread(regs, new_pc, new_sp)      \
-       set_fs(USER_DS);                         \
-       regs->pr = 0;                            \
-       regs->sr = SR_FD;       /* User mode. */ \
-       regs->pc = new_pc;                       \
-       regs->regs[15] = new_sp
-
-/* Forward declaration, a strange C thing */
-struct task_struct;
-struct mm_struct;
-
-/* 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 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-
-/* Copy and release all segment info associated with a VM */
-#define copy_segments(p, mm)   do { } while(0)
-#define release_segments(mm)   do { } while(0)
-
-/*
- * FPU lazy state save handling.
- */
-
-static __inline__ void disable_fpu(void)
-{
-       unsigned long __dummy;
-
-       /* Set FD flag in SR */
-       __asm__ __volatile__("stc       sr, %0\n\t"
-                            "or        %1, %0\n\t"
-                            "ldc       %0, sr"
-                            : "=&r" (__dummy)
-                            : "r" (SR_FD));
-}
-
-static __inline__ void enable_fpu(void)
-{
-       unsigned long __dummy;
-
-       /* Clear out FD flag in SR */
-       __asm__ __volatile__("stc       sr, %0\n\t"
-                            "and       %1, %0\n\t"
-                            "ldc       %0, sr"
-                            : "=&r" (__dummy)
-                            : "r" (~SR_FD));
-}
-
-/* Double presision, NANS as NANS, rounding to nearest, no exceptions */
-#define FPSCR_INIT  0x00080000
-
-#define        FPSCR_CAUSE_MASK        0x0001f000      /* Cause bits */
-#define        FPSCR_FLAG_MASK         0x0000007c      /* Flag bits */
-
-/*
- * Return saved PC of a blocked thread.
- */
-#define thread_saved_pc(tsk)   (tsk->thread.pc)
-
-void show_trace(struct task_struct *tsk, unsigned long *sp,
-               struct pt_regs *regs);
-extern unsigned long get_wchan(struct task_struct *p);
-
-#define KSTK_EIP(tsk)  (task_pt_regs(tsk)->pc)
-#define KSTK_ESP(tsk)  (task_pt_regs(tsk)->regs[15])
-
-#define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
-#define cpu_relax()    barrier()
-
-#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH3) || \
-    defined(CONFIG_CPU_SH4)
-#define PREFETCH_STRIDE                L1_CACHE_BYTES
-#define ARCH_HAS_PREFETCH
-#define ARCH_HAS_PREFETCHW
-static inline void prefetch(void *x)
-{
-       __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory");
-}
-
-#define prefetchw(x)   prefetch(x)
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_PROCESSOR_32_H */
diff --git a/include/asm-sh/processor_64.h b/include/asm-sh/processor_64.h
deleted file mode 100644 (file)
index fc7fc68..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-#ifndef __ASM_SH_PROCESSOR_64_H
-#define __ASM_SH_PROCESSOR_64_H
-
-/*
- * include/asm-sh/processor_64.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003  Paul Mundt
- * Copyright (C) 2004  Richard Curnow
- *
- * 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.
- */
-#ifndef __ASSEMBLY__
-
-#include <linux/compiler.h>
-#include <asm/page.h>
-#include <asm/types.h>
-#include <asm/cache.h>
-#include <asm/ptrace.h>
-#include <asm/cpu/registers.h>
-
-/*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ \
-void *pc; \
-unsigned long long __dummy = 0; \
-__asm__("gettr tr0, %1\n\t" \
-       "pta    4, tr0\n\t" \
-       "gettr  tr0, %0\n\t" \
-       "ptabs  %1, tr0\n\t"    \
-       :"=r" (pc), "=r" (__dummy) \
-       : "1" (__dummy)); \
-pc; })
-
-/*
- * TLB information structure
- *
- * Defined for both I and D tlb, per-processor.
- */
-struct tlb_info {
-       unsigned long long next;
-       unsigned long long first;
-       unsigned long long last;
-
-       unsigned int entries;
-       unsigned int step;
-
-       unsigned long flags;
-};
-
-struct sh_cpuinfo {
-       enum cpu_type type;
-       unsigned long loops_per_jiffy;
-       unsigned long asid_cache;
-
-       unsigned int cpu_clock, master_clock, bus_clock, module_clock;
-
-       /* Cache info */
-       struct cache_info icache;
-       struct cache_info dcache;
-       struct cache_info scache;
-
-       /* TLB info */
-       struct tlb_info itlb;
-       struct tlb_info dtlb;
-
-       unsigned long flags;
-};
-
-extern struct sh_cpuinfo cpu_data[];
-#define boot_cpu_data cpu_data[0]
-#define current_cpu_data cpu_data[smp_processor_id()]
-#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
-
-#endif
-
-/*
- * User space process size: 2GB - 4k.
- */
-#define TASK_SIZE      0x7ffff000UL
-
-#define STACK_TOP      TASK_SIZE
-#define STACK_TOP_MAX  STACK_TOP
-
-/* This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE     (TASK_SIZE / 3)
-
-/*
- * Bit of SR register
- *
- * FD-bit:
- *     When it's set, it means the processor doesn't have right to use FPU,
- *     and it results exception when the floating operation is executed.
- *
- * IMASK-bit:
- *     Interrupt level mask
- *
- * STEP-bit:
- *     Single step bit
- *
- */
-#if defined(CONFIG_SH64_SR_WATCH)
-#define SR_MMU   0x84000000
-#else
-#define SR_MMU   0x80000000
-#endif
-
-#define SR_IMASK 0x000000f0
-#define SR_FD    0x00008000
-#define SR_SSTEP 0x08000000
-
-#ifndef __ASSEMBLY__
-
-/*
- * FPU structure and data : require 8-byte alignment as we need to access it
-   with fld.p, fst.p
- */
-
-struct sh_fpu_hard_struct {
-       unsigned long fp_regs[64];
-       unsigned int fpscr;
-       /* long status; * software status information */
-};
-
-#if 0
-/* Dummy fpu emulator  */
-struct sh_fpu_soft_struct {
-       unsigned long long fp_regs[32];
-       unsigned int fpscr;
-       unsigned char lookahead;
-       unsigned long entry_pc;
-};
-#endif
-
-union sh_fpu_union {
-       struct sh_fpu_hard_struct hard;
-       /* 'hard' itself only produces 32 bit alignment, yet we need
-          to access it using 64 bit load/store as well. */
-       unsigned long long alignment_dummy;
-};
-
-struct thread_struct {
-       unsigned long sp;
-       unsigned long pc;
-       /* This stores the address of the pt_regs built during a context
-          switch, or of the register save area built for a kernel mode
-          exception.  It is used for backtracing the stack of a sleeping task
-          or one that traps in kernel mode. */
-        struct pt_regs *kregs;
-       /* This stores the address of the pt_regs constructed on entry from
-          user mode.  It is a fixed value over the lifetime of a process, or
-          NULL for a kernel thread. */
-       struct pt_regs *uregs;
-
-       unsigned long trap_no, error_code;
-       unsigned long address;
-       /* Hardware debugging registers may come here */
-
-       /* floating point info */
-       union sh_fpu_union fpu;
-};
-
-#define INIT_MMAP \
-{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
-
-extern  struct pt_regs fake_swapper_regs;
-
-#define INIT_THREAD  {                         \
-       .sp             = sizeof(init_stack) +  \
-                         (long) &init_stack,   \
-       .pc             = 0,                    \
-        .kregs         = &fake_swapper_regs,   \
-       .uregs          = NULL,                 \
-       .trap_no        = 0,                    \
-       .error_code     = 0,                    \
-       .address        = 0,                    \
-       .fpu            = { { { 0, } }, }       \
-}
-
-/*
- * Do necessary setup to start up a newly executed thread.
- */
-#define SR_USER (SR_MMU | SR_FD)
-
-#define start_thread(regs, new_pc, new_sp)                     \
-       set_fs(USER_DS);                                        \
-       regs->sr = SR_USER;     /* User mode. */                \
-       regs->pc = new_pc - 4;  /* Compensate syscall exit */   \
-       regs->pc |= 1;          /* Set SHmedia ! */             \
-       regs->regs[18] = 0;                                     \
-       regs->regs[15] = new_sp
-
-/* Forward declaration, a strange C thing */
-struct task_struct;
-struct mm_struct;
-
-/* Free all resources held by a thread. */
-extern void release_thread(struct task_struct *);
-/*
- * create a kernel thread without removing it from tasklists
- */
-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-
-
-/* Copy and release all segment info associated with a VM */
-#define copy_segments(p, mm)   do { } while (0)
-#define release_segments(mm)   do { } while (0)
-#define forget_segments()      do { } while (0)
-#define prepare_to_copy(tsk)   do { } while (0)
-/*
- * FPU lazy state save handling.
- */
-
-static inline void disable_fpu(void)
-{
-       unsigned long long __dummy;
-
-       /* Set FD flag in SR */
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "or        %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy)
-                            : "r" (SR_FD));
-}
-
-static inline void enable_fpu(void)
-{
-       unsigned long long __dummy;
-
-       /* Clear out FD flag in SR */
-       __asm__ __volatile__("getcon    " __SR ", %0\n\t"
-                            "and       %0, %1, %0\n\t"
-                            "putcon    %0, " __SR "\n\t"
-                            : "=&r" (__dummy)
-                            : "r" (~SR_FD));
-}
-
-/* Round to nearest, no exceptions on inexact, overflow, underflow,
-   zero-divide, invalid.  Configure option for whether to flush denorms to
-   zero, or except if a denorm is encountered.  */
-#if defined(CONFIG_SH64_FPU_DENORM_FLUSH)
-#define FPSCR_INIT  0x00040000
-#else
-#define FPSCR_INIT  0x00000000
-#endif
-
-#ifdef CONFIG_SH_FPU
-/* Initialise the FP state of a task */
-void fpinit(struct sh_fpu_hard_struct *fpregs);
-#else
-#define fpinit(fpregs) do { } while (0)
-#endif
-
-extern struct task_struct *last_task_used_math;
-
-/*
- * Return saved PC of a blocked thread.
- */
-#define thread_saved_pc(tsk)   (tsk->thread.pc)
-
-extern unsigned long get_wchan(struct task_struct *p);
-
-#define KSTK_EIP(tsk)  ((tsk)->thread.pc)
-#define KSTK_ESP(tsk)  ((tsk)->thread.sp)
-
-#define cpu_relax()    barrier()
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_PROCESSOR_64_H */
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
deleted file mode 100644 (file)
index 643ab5a..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef __ASM_SH_PTRACE_H
-#define __ASM_SH_PTRACE_H
-
-/*
- * Copyright (C) 1999, 2000  Niibe Yutaka
- *
- */
-#if defined(__SH5__)
-struct pt_regs {
-       unsigned long long pc;
-       unsigned long long sr;
-       unsigned long long syscall_nr;
-       unsigned long long regs[63];
-       unsigned long long tregs[8];
-       unsigned long long pad[2];
-};
-#else
-/*
- * GCC defines register number like this:
- * -----------------------------
- *      0 - 15 are integer registers
- *     17 - 22 are control/special registers
- *     24 - 39 fp registers
- *     40 - 47 xd registers
- *     48 -    fpscr register
- * -----------------------------
- *
- * We follows above, except:
- *     16 --- program counter (PC)
- *     22 --- syscall #
- *     23 --- floating point communication register
- */
-#define REG_REG0        0
-#define REG_REG15      15
-
-#define REG_PC         16
-
-#define REG_PR         17
-#define REG_SR         18
-#define REG_GBR                19
-#define REG_MACH       20
-#define REG_MACL       21
-
-#define REG_SYSCALL    22
-
-#define REG_FPREG0     23
-#define REG_FPREG15    38
-#define REG_XFREG0     39
-#define REG_XFREG15    54
-
-#define REG_FPSCR      55
-#define REG_FPUL       56
-
-/*
- * This struct defines the way the registers are stored on the
- * kernel stack during a system call or other kernel entry.
- */
-struct pt_regs {
-       unsigned long regs[16];
-       unsigned long pc;
-       unsigned long pr;
-       unsigned long sr;
-       unsigned long gbr;
-       unsigned long mach;
-       unsigned long macl;
-       long tra;
-};
-
-/*
- * This struct defines the way the DSP registers are stored on the
- * kernel stack during a system call or other kernel entry.
- */
-struct pt_dspregs {
-       unsigned long   a1;
-       unsigned long   a0g;
-       unsigned long   a1g;
-       unsigned long   m0;
-       unsigned long   m1;
-       unsigned long   a0;
-       unsigned long   x0;
-       unsigned long   x1;
-       unsigned long   y0;
-       unsigned long   y1;
-       unsigned long   dsr;
-       unsigned long   rs;
-       unsigned long   re;
-       unsigned long   mod;
-};
-
-#define PTRACE_GETFDPIC                31      /* get the ELF fdpic loadmap address */
-
-#define PTRACE_GETFDPIC_EXEC   0       /* [addr] request the executable loadmap */
-#define PTRACE_GETFDPIC_INTERP 1       /* [addr] request the interpreter loadmap */
-
-#define        PTRACE_GETDSPREGS       55
-#define        PTRACE_SETDSPREGS       56
-#endif
-
-#ifdef __KERNEL__
-#include <asm/addrspace.h>
-
-#define user_mode(regs)                        (((regs)->sr & 0x40000000)==0)
-#define instruction_pointer(regs)      ((unsigned long)(regs)->pc)
-
-extern void show_regs(struct pt_regs *);
-
-#ifdef CONFIG_SH_DSP
-#define task_pt_regs(task) \
-       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
-                - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1)
-#else
-#define task_pt_regs(task) \
-       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
-                - sizeof(unsigned long)) - 1)
-#endif
-
-static inline unsigned long profile_pc(struct pt_regs *regs)
-{
-       unsigned long pc = instruction_pointer(regs);
-
-#ifdef P2SEG
-       if (pc >= P2SEG && pc < P3SEG)
-               pc -= 0x20000000;
-#endif
-
-       return pc;
-}
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_PTRACE_H */
diff --git a/include/asm-sh/push-switch.h b/include/asm-sh/push-switch.h
deleted file mode 100644 (file)
index 4903f9e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __ASM_SH_PUSH_SWITCH_H
-#define __ASM_SH_PUSH_SWITCH_H
-
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-#include <linux/platform_device.h>
-
-struct push_switch {
-       /* switch state */
-       unsigned int            state:1;
-       /* debounce timer */
-       struct timer_list       debounce;
-       /* workqueue */
-       struct work_struct      work;
-       /* platform device, for workqueue handler */
-       struct platform_device  *pdev;
-};
-
-struct push_switch_platform_info {
-       /* IRQ handler */
-       irqreturn_t             (*irq_handler)(int irq, void *data);
-       /* Special IRQ flags */
-       unsigned int            irq_flags;
-       /* Bit location of switch */
-       unsigned int            bit;
-       /* Symbolic switch name */
-       const char              *name;
-};
-
-#endif /* __ASM_SH_PUSH_SWITCH_H */
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h
deleted file mode 100644 (file)
index 306f735..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef __ASM_SH_RENESAS_R7780RP_H
-#define __ASM_SH_RENESAS_R7780RP_H
-
-/* Box specific addresses.  */
-#if defined(CONFIG_SH_R7780MP)
-#define PA_BCR          0xa4000000      /* FPGA */
-#define PA_SDPOW       (-1)
-
-#define PA_IRLMSK       (PA_BCR+0x0000) /* Interrupt Mask control */
-#define PA_IRLMON       (PA_BCR+0x0002) /* Interrupt Status control */
-#define PA_IRLPRI1      (PA_BCR+0x0004) /* Interrupt Priorty 1 */
-#define PA_IRLPRI2      (PA_BCR+0x0006) /* Interrupt Priorty 2 */
-#define PA_IRLPRI3      (PA_BCR+0x0008) /* Interrupt Priorty 3 */
-#define PA_IRLPRI4      (PA_BCR+0x000a) /* Interrupt Priorty 4 */
-#define PA_RSTCTL       (PA_BCR+0x000c) /* Reset Control */
-#define PA_PCIBD        (PA_BCR+0x000e) /* PCI Board detect control */
-#define PA_PCICD        (PA_BCR+0x0010) /* PCI Conector detect control */
-#define PA_EXTGIO       (PA_BCR+0x0016) /* Extension GPIO Control */
-#define PA_IVDRMON      (PA_BCR+0x0018) /* iVDR Moniter control */
-#define PA_IVDRCTL      (PA_BCR+0x001a) /* iVDR control */
-#define PA_OBLED        (PA_BCR+0x001c) /* On Board LED control */
-#define PA_OBSW         (PA_BCR+0x001e) /* On Board Switch control */
-#define PA_AUDIOSEL     (PA_BCR+0x0020) /* Sound Interface Select control */
-#define PA_EXTPLR       (PA_BCR+0x001e) /* Extention Pin Polarity control */
-#define PA_TPCTL        (PA_BCR+0x0100) /* Touch Panel Access control */
-#define PA_TPDCKCTL     (PA_BCR+0x0102) /* Touch Panel Access data control */
-#define PA_TPCTLCLR     (PA_BCR+0x0104) /* Touch Panel Access control */
-#define PA_TPXPOS       (PA_BCR+0x0106) /* Touch Panel X position control */
-#define PA_TPYPOS       (PA_BCR+0x0108) /* Touch Panel Y position control */
-#define PA_DBSW         (PA_BCR+0x0200) /* Debug Board Switch control */
-#define PA_CFCTL        (PA_BCR+0x0300) /* CF Timing control */
-#define PA_CFPOW        (PA_BCR+0x0302) /* CF Power control */
-#define PA_CFCDINTCLR   (PA_BCR+0x0304) /* CF Insert Interrupt clear */
-#define PA_SCSMR0       (PA_BCR+0x0400) /* SCIF0 Serial mode control */
-#define PA_SCBRR0       (PA_BCR+0x0404) /* SCIF0 Bit rate control */
-#define PA_SCSCR0       (PA_BCR+0x0408) /* SCIF0 Serial control */
-#define PA_SCFTDR0      (PA_BCR+0x040c) /* SCIF0 Send FIFO control */
-#define PA_SCFSR0       (PA_BCR+0x0410) /* SCIF0 Serial status control */
-#define PA_SCFRDR0      (PA_BCR+0x0414) /* SCIF0 Receive FIFO control */
-#define PA_SCFCR0       (PA_BCR+0x0418) /* SCIF0 FIFO control */
-#define PA_SCTFDR0      (PA_BCR+0x041c) /* SCIF0 Send FIFO data control */
-#define PA_SCRFDR0      (PA_BCR+0x0420) /* SCIF0 Receive FIFO data control */
-#define PA_SCSPTR0      (PA_BCR+0x0424) /* SCIF0 Serial Port control */
-#define PA_SCLSR0       (PA_BCR+0x0428) /* SCIF0 Line Status control */
-#define PA_SCRER0       (PA_BCR+0x042c) /* SCIF0 Serial Error control */
-#define PA_SCSMR1       (PA_BCR+0x0500) /* SCIF1 Serial mode control */
-#define PA_SCBRR1       (PA_BCR+0x0504) /* SCIF1 Bit rate control */
-#define PA_SCSCR1       (PA_BCR+0x0508) /* SCIF1 Serial control */
-#define PA_SCFTDR1      (PA_BCR+0x050c) /* SCIF1 Send FIFO control */
-#define PA_SCFSR1       (PA_BCR+0x0510) /* SCIF1 Serial status control */
-#define PA_SCFRDR1      (PA_BCR+0x0514) /* SCIF1 Receive FIFO control */
-#define PA_SCFCR1       (PA_BCR+0x0518) /* SCIF1 FIFO control */
-#define PA_SCTFDR1      (PA_BCR+0x051c) /* SCIF1 Send FIFO data control */
-#define PA_SCRFDR1      (PA_BCR+0x0520) /* SCIF1 Receive FIFO data control */
-#define PA_SCSPTR1      (PA_BCR+0x0524) /* SCIF1 Serial Port control */
-#define PA_SCLSR1       (PA_BCR+0x0528) /* SCIF1 Line Status control */
-#define PA_SCRER1       (PA_BCR+0x052c) /* SCIF1 Serial Error control */
-#define PA_SMCR         (PA_BCR+0x0600) /* 2-wire Serial control */
-#define PA_SMSMADR      (PA_BCR+0x0602) /* 2-wire Serial Slave control */
-#define PA_SMMR         (PA_BCR+0x0604) /* 2-wire Serial Mode control */
-#define PA_SMSADR1      (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
-#define PA_SMTRDR1      (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
-#define PA_VERREG       (PA_BCR+0x0700) /* FPGA Version Register */
-#define PA_POFF         (PA_BCR+0x0800) /* System Power Off control */
-#define PA_PMR          (PA_BCR+0x0900) /*  */
-
-#define IRLCNTR1        (PA_BCR + 0)    /* Interrupt Control Register1 */
-#define IVDR_CK_ON     8               /* iVDR Clock ON */
-
-#elif defined(CONFIG_SH_R7780RP)
-#define PA_POFF                (-1)
-
-#define PA_BCR         0xa5000000      /* FPGA */
-#define        PA_IRLMSK       (PA_BCR+0x0000) /* Interrupt Mask control */
-#define PA_IRLMON      (PA_BCR+0x0002) /* Interrupt Status control */
-#define        PA_SDPOW        (PA_BCR+0x0004) /* SD Power control */
-#define        PA_RSTCTL       (PA_BCR+0x0006) /* Device Reset control */
-#define        PA_PCIBD        (PA_BCR+0x0008) /* PCI Board detect control */
-#define        PA_PCICD        (PA_BCR+0x000a) /* PCI Conector detect control */
-#define        PA_ZIGIO1       (PA_BCR+0x000c) /* Zigbee IO control 1 */
-#define        PA_ZIGIO2       (PA_BCR+0x000e) /* Zigbee IO control 2 */
-#define        PA_ZIGIO3       (PA_BCR+0x0010) /* Zigbee IO control 3 */
-#define        PA_ZIGIO4       (PA_BCR+0x0012) /* Zigbee IO control 4 */
-#define        PA_IVDRMON      (PA_BCR+0x0014) /* iVDR Moniter control */
-#define        PA_IVDRCTL      (PA_BCR+0x0016) /* iVDR control */
-#define PA_OBLED       (PA_BCR+0x0018) /* On Board LED control */
-#define PA_OBSW                (PA_BCR+0x001a) /* On Board Switch control */
-#define PA_AUDIOSEL    (PA_BCR+0x001c) /* Sound Interface Select control */
-#define PA_EXTPLR      (PA_BCR+0x001e) /* Extention Pin Polarity control */
-#define PA_TPCTL       (PA_BCR+0x0100) /* Touch Panel Access control */
-#define PA_TPDCKCTL    (PA_BCR+0x0102) /* Touch Panel Access data control */
-#define PA_TPCTLCLR    (PA_BCR+0x0104) /* Touch Panel Access control */
-#define PA_TPXPOS      (PA_BCR+0x0106) /* Touch Panel X position control */
-#define PA_TPYPOS      (PA_BCR+0x0108) /* Touch Panel Y position control */
-#define PA_DBDET       (PA_BCR+0x0200) /* Debug Board detect control */
-#define PA_DBDISPCTL   (PA_BCR+0x0202) /* Debug Board Dot timing control */
-#define PA_DBSW                (PA_BCR+0x0204) /* Debug Board Switch control */
-#define PA_CFCTL       (PA_BCR+0x0300) /* CF Timing control */
-#define PA_CFPOW       (PA_BCR+0x0302) /* CF Power control */
-#define PA_CFCDINTCLR  (PA_BCR+0x0304) /* CF Insert Interrupt clear */
-#define PA_SCSMR       (PA_BCR+0x0400) /* SCIF Serial mode control */
-#define PA_SCBRR       (PA_BCR+0x0402) /* SCIF Bit rate control */
-#define PA_SCSCR       (PA_BCR+0x0404) /* SCIF Serial control */
-#define PA_SCFDTR      (PA_BCR+0x0406) /* SCIF Send FIFO control */
-#define PA_SCFSR       (PA_BCR+0x0408) /* SCIF Serial status control */
-#define PA_SCFRDR      (PA_BCR+0x040a) /* SCIF Receive FIFO control */
-#define PA_SCFCR       (PA_BCR+0x040c) /* SCIF FIFO control */
-#define PA_SCFDR       (PA_BCR+0x040e) /* SCIF FIFO data control */
-#define PA_SCLSR       (PA_BCR+0x0412) /* SCIF Line Status control */
-#define PA_SMCR                (PA_BCR+0x0500) /* 2-wire Serial control */
-#define PA_SMSMADR     (PA_BCR+0x0502) /* 2-wire Serial Slave control */
-#define PA_SMMR                (PA_BCR+0x0504) /* 2-wire Serial Mode control */
-#define PA_SMSADR1     (PA_BCR+0x0506) /* 2-wire Serial Address1 control */
-#define PA_SMTRDR1     (PA_BCR+0x0546) /* 2-wire Serial Data1 control */
-#define PA_VERREG      (PA_BCR+0x0600) /* FPGA Version Register */
-
-#define PA_AX88796L    0xa5800400      /* AX88796L Area */
-#define PA_SC1602BSLB  0xa6000000      /* SC1602BSLB Area */
-#define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
-#define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
-
-#define IRLCNTR1       (PA_BCR + 0)    /* Interrupt Control Register1 */
-
-#define IVDR_CK_ON     8               /* iVDR Clock ON */
-
-#elif defined(CONFIG_SH_R7785RP)
-#define PA_BCR         0xa4000000      /* FPGA */
-#define PA_SDPOW       (-1)
-
-#define        PA_PCISCR       (PA_BCR+0x0000)
-#define PA_IRLPRA      (PA_BCR+0x0002)
-#define        PA_IRLPRB       (PA_BCR+0x0004)
-#define        PA_IRLPRC       (PA_BCR+0x0006)
-#define        PA_IRLPRD       (PA_BCR+0x0008)
-#define IRLCNTR1       (PA_BCR+0x0010)
-#define        PA_IRLPRE       (PA_BCR+0x000a)
-#define        PA_IRLPRF       (PA_BCR+0x000c)
-#define        PA_EXIRLCR      (PA_BCR+0x000e)
-#define        PA_IRLMCR1      (PA_BCR+0x0010)
-#define        PA_IRLMCR2      (PA_BCR+0x0012)
-#define        PA_IRLSSR1      (PA_BCR+0x0014)
-#define        PA_IRLSSR2      (PA_BCR+0x0016)
-#define PA_CFTCR       (PA_BCR+0x0100)
-#define PA_CFPCR       (PA_BCR+0x0102)
-#define PA_PCICR       (PA_BCR+0x0110)
-#define PA_IVDRCTL     (PA_BCR+0x0112)
-#define PA_IVDRSR      (PA_BCR+0x0114)
-#define PA_PDRSTCR     (PA_BCR+0x0116)
-#define PA_POFF                (PA_BCR+0x0120)
-#define PA_LCDCR       (PA_BCR+0x0130)
-#define PA_TPCR                (PA_BCR+0x0140)
-#define PA_TPCKCR      (PA_BCR+0x0142)
-#define PA_TPRSTR      (PA_BCR+0x0144)
-#define PA_TPXPDR      (PA_BCR+0x0146)
-#define PA_TPYPDR      (PA_BCR+0x0148)
-#define PA_GPIOPFR     (PA_BCR+0x0150)
-#define PA_GPIODR      (PA_BCR+0x0152)
-#define PA_OBLED       (PA_BCR+0x0154)
-#define PA_SWSR                (PA_BCR+0x0156)
-#define PA_VERREG      (PA_BCR+0x0158)
-#define PA_SMCR                (PA_BCR+0x0200)
-#define PA_SMSMADR     (PA_BCR+0x0202)
-#define PA_SMMR                (PA_BCR+0x0204)
-#define PA_SMSADR1     (PA_BCR+0x0206)
-#define PA_SMSADR32    (PA_BCR+0x0244)
-#define PA_SMTRDR1     (PA_BCR+0x0246)
-#define PA_SMTRDR16    (PA_BCR+0x0264)
-#define PA_CU3MDR      (PA_BCR+0x0300)
-#define PA_CU5MDR      (PA_BCR+0x0302)
-#define PA_MMSR                (PA_BCR+0x0400)
-
-#define IVDR_CK_ON     4               /* iVDR Clock ON */
-#endif
-
-#define HL_FPGA_IRQ_BASE       200
-#define HL_NR_IRL              15
-
-#define IRQ_AX88796            (HL_FPGA_IRQ_BASE + 0)
-#define IRQ_CF                 (HL_FPGA_IRQ_BASE + 1)
-#define IRQ_PSW                        (HL_FPGA_IRQ_BASE + 2)
-#define IRQ_EXT0               (HL_FPGA_IRQ_BASE + 3)
-#define IRQ_EXT1               (HL_FPGA_IRQ_BASE + 4)
-#define IRQ_EXT2               (HL_FPGA_IRQ_BASE + 5)
-#define IRQ_EXT3               (HL_FPGA_IRQ_BASE + 6)
-#define IRQ_EXT4               (HL_FPGA_IRQ_BASE + 7)
-#define IRQ_EXT5               (HL_FPGA_IRQ_BASE + 8)
-#define IRQ_EXT6               (HL_FPGA_IRQ_BASE + 9)
-#define IRQ_EXT7               (HL_FPGA_IRQ_BASE + 10)
-#define IRQ_SMBUS              (HL_FPGA_IRQ_BASE + 11)
-#define IRQ_TP                 (HL_FPGA_IRQ_BASE + 12)
-#define IRQ_RTC                        (HL_FPGA_IRQ_BASE + 13)
-#define IRQ_TH_ALERT           (HL_FPGA_IRQ_BASE + 14)
-#define IRQ_SCIF0              (HL_FPGA_IRQ_BASE + 15)
-#define IRQ_SCIF1              (HL_FPGA_IRQ_BASE + 16)
-
-unsigned char *highlander_plat_irq_setup(void);
-
-#endif  /* __ASM_SH_RENESAS_R7780RP */
diff --git a/include/asm-sh/resource.h b/include/asm-sh/resource.h
deleted file mode 100644 (file)
index 9c2499a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_RESOURCE_H
-#define __ASM_SH_RESOURCE_H
-
-#include <asm-generic/resource.h>
-
-#endif /* __ASM_SH_RESOURCE_H */
diff --git a/include/asm-sh/rtc.h b/include/asm-sh/rtc.h
deleted file mode 100644 (file)
index ec45ba8..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_RTC_H
-#define _ASM_RTC_H
-
-extern void (*board_time_init)(void);
-extern void (*rtc_sh_get_time)(struct timespec *);
-extern int (*rtc_sh_set_time)(const time_t);
-
-#define RTC_CAP_4_DIGIT_YEAR   (1 << 0)
-
-struct sh_rtc_platform_info {
-       unsigned long capabilities;
-};
-
-#include <asm/cpu/rtc.h>
-
-#endif /* _ASM_RTC_H */
diff --git a/include/asm-sh/rts7751r2d.h b/include/asm-sh/rts7751r2d.h
deleted file mode 100644 (file)
index 0a80015..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __ASM_SH_RENESAS_RTS7751R2D_H
-#define __ASM_SH_RENESAS_RTS7751R2D_H
-
-/*
- * linux/include/asm-sh/renesas_rts7751r2d.h
- *
- * Copyright (C) 2000  Atom Create Engineering Co., Ltd.
- *
- * Renesas Technology Sales RTS7751R2D support
- */
-
-/* Board specific addresses.  */
-
-#define PA_BCR         0xa4000000      /* FPGA */
-#define PA_IRLMON      0xa4000002      /* Interrupt Status control */
-#define PA_CFCTL       0xa4000004      /* CF Timing control */
-#define PA_CFPOW       0xa4000006      /* CF Power control */
-#define PA_DISPCTL     0xa4000008      /* Display Timing control */
-#define PA_SDMPOW      0xa400000a      /* SD Power control */
-#define PA_RTCCE       0xa400000c      /* RTC(9701) Enable control */
-#define PA_PCICD       0xa400000e      /* PCI Extention detect control */
-#define PA_VOYAGERRTS  0xa4000020      /* VOYAGER Reset control */
-
-#define PA_R2D1_AXRST          0xa4000022      /* AX_LAN Reset control */
-#define PA_R2D1_CFRST          0xa4000024      /* CF Reset control */
-#define PA_R2D1_ADMRTS         0xa4000026      /* SD Reset control */
-#define PA_R2D1_EXTRST         0xa4000028      /* Extention Reset control */
-#define PA_R2D1_CFCDINTCLR     0xa400002a      /* CF Insert Interrupt clear */
-
-#define PA_R2DPLUS_CFRST       0xa4000022      /* CF Reset control */
-#define PA_R2DPLUS_ADMRTS      0xa4000024      /* SD Reset control */
-#define PA_R2DPLUS_EXTRST      0xa4000026      /* Extention Reset control */
-#define PA_R2DPLUS_CFCDINTCLR  0xa4000028      /* CF Insert Interrupt clear */
-#define PA_R2DPLUS_KEYCTLCLR   0xa400002a      /* Key Interrupt clear */
-
-#define PA_POWOFF      0xa4000030      /* Board Power OFF control */
-#define PA_VERREG      0xa4000032      /* FPGA Version Register */
-#define PA_INPORT      0xa4000034      /* KEY Input Port control */
-#define PA_OUTPORT     0xa4000036      /* LED control */
-#define PA_BVERREG     0xa4000038      /* Board Revision Register */
-
-#define PA_AX88796L    0xaa000400      /* AX88796L Area */
-#define PA_VOYAGER     0xab000000      /* VOYAGER GX Area */
-#define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
-#define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
-
-#define IRLCNTR1       (PA_BCR + 0)    /* Interrupt Control Register1 */
-
-#define R2D_FPGA_IRQ_BASE      100
-
-#define IRQ_VOYAGER            (R2D_FPGA_IRQ_BASE + 0)
-#define IRQ_EXT                        (R2D_FPGA_IRQ_BASE + 1)
-#define IRQ_TP                 (R2D_FPGA_IRQ_BASE + 2)
-#define IRQ_RTC_T              (R2D_FPGA_IRQ_BASE + 3)
-#define IRQ_RTC_A              (R2D_FPGA_IRQ_BASE + 4)
-#define IRQ_SDCARD             (R2D_FPGA_IRQ_BASE + 5)
-#define IRQ_CF_CD              (R2D_FPGA_IRQ_BASE + 6)
-#define IRQ_CF_IDE             (R2D_FPGA_IRQ_BASE + 7)
-#define IRQ_AX88796            (R2D_FPGA_IRQ_BASE + 8)
-#define IRQ_KEY                        (R2D_FPGA_IRQ_BASE + 9)
-#define IRQ_PCI_INTA           (R2D_FPGA_IRQ_BASE + 10)
-#define IRQ_PCI_INTB           (R2D_FPGA_IRQ_BASE + 11)
-#define IRQ_PCI_INTC           (R2D_FPGA_IRQ_BASE + 12)
-#define IRQ_PCI_INTD           (R2D_FPGA_IRQ_BASE + 13)
-
-/* arch/sh/boards/renesas/rts7751r2d/irq.c */
-void init_rts7751r2d_IRQ(void);
-int rts7751r2d_irq_demux(int);
-
-#endif  /* __ASM_SH_RENESAS_RTS7751R2D */
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h
deleted file mode 100644 (file)
index 1987f3e..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * include/asm-sh/rwsem.h: R/W semaphores for SH using the stuff
- * in lib/rwsem.c.
- */
-
-#ifndef _ASM_SH_RWSEM_H
-#define _ASM_SH_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/list.h>
-#include <linux/spinlock.h>
-#include <asm/atomic.h>
-#include <asm/system.h>
-
-/*
- * the semaphore definition
- */
-struct rw_semaphore {
-       long            count;
-#define RWSEM_UNLOCKED_VALUE           0x00000000
-#define RWSEM_ACTIVE_BIAS              0x00000001
-#define RWSEM_ACTIVE_MASK              0x0000ffff
-#define RWSEM_WAITING_BIAS             (-0x00010000)
-#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;
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-       struct lockdep_map      dep_map;
-#endif
-};
-
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
-#else
-# define __RWSEM_DEP_MAP_INIT(lockname)
-#endif
-
-#define __RWSEM_INITIALIZER(name) \
-       { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) \
-         __RWSEM_DEP_MAP_INIT(name) }
-
-#define DECLARE_RWSEM(name)            \
-       struct rw_semaphore name = __RWSEM_INITIALIZER(name)
-
-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 *sem);
-extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
-
-extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
-                        struct lock_class_key *key);
-
-#define init_rwsem(sem)                                \
-do {                                           \
-       static struct lock_class_key __key;     \
-                                               \
-       __init_rwsem((sem), #sem, &__key);      \
-} while (0)
-
-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);
-}
-
-/*
- * lock for reading
- */
-static inline void __down_read(struct rw_semaphore *sem)
-{
-       if (atomic_inc_return((atomic_t *)(&sem->count)) > 0)
-               smp_wmb();
-       else
-               rwsem_down_read_failed(sem);
-}
-
-static inline int __down_read_trylock(struct rw_semaphore *sem)
-{
-       int tmp;
-
-       while ((tmp = sem->count) >= 0) {
-               if (tmp == cmpxchg(&sem->count, tmp,
-                                  tmp + RWSEM_ACTIVE_READ_BIAS)) {
-                       smp_wmb();
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-/*
- * lock for writing
- */
-static inline void __down_write(struct rw_semaphore *sem)
-{
-       int tmp;
-
-       tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS,
-                               (atomic_t *)(&sem->count));
-       if (tmp == RWSEM_ACTIVE_WRITE_BIAS)
-               smp_wmb();
-       else
-               rwsem_down_write_failed(sem);
-}
-
-static inline int __down_write_trylock(struct rw_semaphore *sem)
-{
-       int tmp;
-
-       tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
-                     RWSEM_ACTIVE_WRITE_BIAS);
-       smp_wmb();
-       return tmp == RWSEM_UNLOCKED_VALUE;
-}
-
-/*
- * unlock after reading
- */
-static inline void __up_read(struct rw_semaphore *sem)
-{
-       int tmp;
-
-       smp_wmb();
-       tmp = atomic_dec_return((atomic_t *)(&sem->count));
-       if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)
-               rwsem_wake(sem);
-}
-
-/*
- * unlock after writing
- */
-static inline void __up_write(struct rw_semaphore *sem)
-{
-       smp_wmb();
-       if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
-                             (atomic_t *)(&sem->count)) < 0)
-               rwsem_wake(sem);
-}
-
-/*
- * implement atomic add functionality
- */
-static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
-{
-       atomic_add(delta, (atomic_t *)(&sem->count));
-}
-
-/*
- * downgrade write lock to read lock
- */
-static inline void __downgrade_write(struct rw_semaphore *sem)
-{
-       int tmp;
-
-       smp_wmb();
-       tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count));
-       if (tmp < 0)
-               rwsem_downgrade_wake(sem);
-}
-
-static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
-{
-       __down_write(sem);
-}
-
-/*
- * implement exchange and add functionality
- */
-static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
-{
-       smp_mb();
-       return atomic_add_return(delta, (atomic_t *)(&sem->count));
-}
-
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
-{
-       return (sem->count != 0);
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_SH_RWSEM_H */
diff --git a/include/asm-sh/scatterlist.h b/include/asm-sh/scatterlist.h
deleted file mode 100644 (file)
index 2084d03..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_SH_SCATTERLIST_H
-#define __ASM_SH_SCATTERLIST_H
-
-#include <asm/types.h>
-
-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
-    unsigned long sg_magic;
-#endif
-    unsigned long page_link;
-    unsigned int offset;/* for highmem, page offset */
-    dma_addr_t dma_address;
-    unsigned int length;
-};
-
-#define ISA_DMA_THRESHOLD      PHYS_ADDR_MASK
-
-/* These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->length)
-
-#endif /* !(__ASM_SH_SCATTERLIST_H) */
diff --git a/include/asm-sh/sdk7780.h b/include/asm-sh/sdk7780.h
deleted file mode 100644 (file)
index 697dc86..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef __ASM_SH_RENESAS_SDK7780_H
-#define __ASM_SH_RENESAS_SDK7780_H
-
-/*
- * linux/include/asm-sh/sdk7780.h
- *
- * Renesas Solutions SH7780 SDK Support
- * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
- *
- * 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.
- */
-#include <asm/addrspace.h>
-
-/* Box specific addresses.  */
-#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
-#define PA_ROM                 0xa0000000      /* EPROM */
-#define PA_ROM_SIZE            0x00400000      /* EPROM size 4M byte */
-#define PA_FROM                        0xa0800000      /* Flash-ROM */
-#define PA_FROM_SIZE   0x00400000      /* Flash-ROM size 4M byte */
-#define PA_EXT1                        0xa4000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_SDRAM               0xa8000000      /* DDR-SDRAM(Area2/3) 128MB */
-#define PA_SDRAM_SIZE  0x08000000
-
-#define PA_EXT4                        0xb0000000
-#define PA_EXT4_SIZE   0x04000000
-#define PA_EXT_USER            PA_EXT4         /* User Expansion Space */
-
-#define PA_PERIPHERAL  PA_AREA5_IO
-
-/* SRAM/Reserved */
-#define PA_RESERVED    (PA_PERIPHERAL + 0)
-/* FPGA base address */
-#define PA_FPGA                (PA_PERIPHERAL + 0x01000000)
-/* SMC LAN91C111 */
-#define PA_LAN         (PA_PERIPHERAL + 0x01800000)
-
-
-#define FPGA_SRSTR      (PA_FPGA + 0x000)      /* System reset */
-#define FPGA_IRQ0SR     (PA_FPGA + 0x010)      /* IRQ0 status */
-#define FPGA_IRQ0MR     (PA_FPGA + 0x020)      /* IRQ0 mask */
-#define FPGA_BDMR       (PA_FPGA + 0x030)      /* Board operating mode */
-#define FPGA_INTT0PRTR  (PA_FPGA + 0x040)      /* Interrupt test mode0 port */
-#define FPGA_INTT0SELR  (PA_FPGA + 0x050)      /* Int. test mode0 select */
-#define FPGA_INTT1POLR  (PA_FPGA + 0x060)      /* Int. test mode0 polarity */
-#define FPGA_NMIR       (PA_FPGA + 0x070)      /* NMI source */
-#define FPGA_NMIMR      (PA_FPGA + 0x080)      /* NMI mask */
-#define FPGA_IRQR       (PA_FPGA + 0x090)      /* IRQX source */
-#define FPGA_IRQMR      (PA_FPGA + 0x0A0)      /* IRQX mask */
-#define FPGA_SLEDR      (PA_FPGA + 0x0B0)      /* LED control */
-#define PA_LED                 FPGA_SLEDR
-#define FPGA_MAPSWR     (PA_FPGA + 0x0C0)      /* Map switch */
-#define FPGA_FPVERR     (PA_FPGA + 0x0D0)      /* FPGA version */
-#define FPGA_FPDATER    (PA_FPGA + 0x0E0)      /* FPGA date */
-#define FPGA_RSE        (PA_FPGA + 0x100)      /* Reset source */
-#define FPGA_EASR       (PA_FPGA + 0x110)      /* External area select */
-#define FPGA_SPER       (PA_FPGA + 0x120)      /* Serial port enable */
-#define FPGA_IMSR       (PA_FPGA + 0x130)      /* Interrupt mode select */
-#define FPGA_PCIMR      (PA_FPGA + 0x140)      /* PCI Mode */
-#define FPGA_DIPSWMR    (PA_FPGA + 0x150)      /* DIPSW monitor */
-#define FPGA_FPODR      (PA_FPGA + 0x160)      /* Output port data */
-#define FPGA_ATAESR     (PA_FPGA + 0x170)      /* ATA extended bus status */
-#define FPGA_IRQPOLR    (PA_FPGA + 0x180)      /* IRQx polarity */
-
-
-#define SDK7780_NR_IRL                 15
-/* IDE/ATA interrupt */
-#define IRQ_CFCARD                             14
-/* SMC interrupt */
-#define IRQ_ETHERNET                   6
-
-
-/* arch/sh/boards/renesas/sdk7780/irq.c */
-void init_sdk7780_IRQ(void);
-
-#define __IO_PREFIX            sdk7780
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_RENESAS_SDK7780_H */
diff --git a/include/asm-sh/se.h b/include/asm-sh/se.h
deleted file mode 100644 (file)
index eb23000..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef __ASM_SH_HITACHI_SE_H
-#define __ASM_SH_HITACHI_SE_H
-
-/*
- * linux/include/asm-sh/hitachi_se.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine support
- */
-
-/* Box specific addresses.  */
-
-#define PA_ROM         0x00000000      /* EPROM */
-#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
-#define PA_FROM                0x01000000      /* EPROM */
-#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
-#define PA_EXT1                0x04000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_EXT2                0x08000000
-#define PA_EXT2_SIZE   0x04000000
-#define PA_SDRAM       0x0c000000
-#define PA_SDRAM_SIZE  0x04000000
-
-#define PA_EXT4                0x12000000
-#define PA_EXT4_SIZE   0x02000000
-#define PA_EXT5                0x14000000
-#define PA_EXT5_SIZE   0x04000000
-#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
-
-#define PA_83902       0xb0000000      /* DP83902A */
-#define PA_83902_IF    0xb0040000      /* DP83902A remote io port */
-#define PA_83902_RST   0xb0080000      /* DP83902A reset port */
-
-#define PA_SUPERIO     0xb0400000      /* SMC37C935A super io chip */
-#define PA_DIPSW0      0xb0800000      /* Dip switch 5,6 */
-#define PA_DIPSW1      0xb0800002      /* Dip switch 7,8 */
-#define PA_LED         0xb0c00000      /* LED */
-#if defined(CONFIG_CPU_SUBTYPE_SH7705)
-#define PA_BCR         0xb0e00000
-#else
-#define PA_BCR         0xb1400000      /* FPGA */
-#endif
-
-#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define BCR_ILCRA      (PA_BCR + 0)
-#define BCR_ILCRB      (PA_BCR + 2)
-#define BCR_ILCRC      (PA_BCR + 4)
-#define BCR_ILCRD      (PA_BCR + 6)
-#define BCR_ILCRE      (PA_BCR + 8)
-#define BCR_ILCRF      (PA_BCR + 10)
-#define BCR_ILCRG      (PA_BCR + 12)
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7705)
-#define IRQ_STNIC      12
-#define IRQ_CFCARD     14
-#else
-#define IRQ_STNIC      10
-#define IRQ_CFCARD     7
-#endif
-
-/* SH Ether support (SH7710/SH7712) */
-/* Base address */
-#define SH_ETH0_BASE 0xA7000000
-#define SH_ETH1_BASE 0xA7000400
-/* PHY ID */
-#if defined(CONFIG_CPU_SUBTYPE_SH7710)
-# define PHY_ID 0x00
-#elif defined(CONFIG_CPU_SUBTYPE_SH7712)
-# define PHY_ID 0x01
-#endif
-/* Ether IRQ */
-#define SH_ETH0_IRQ    80
-#define SH_ETH1_IRQ    81
-#define SH_TSU_IRQ     82
-
-void init_se_IRQ(void);
-
-#define __IO_PREFIX    se
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_HITACHI_SE_H */
diff --git a/include/asm-sh/se7206.h b/include/asm-sh/se7206.h
deleted file mode 100644 (file)
index 698eb80..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_SH_SE7206_H
-#define __ASM_SH_SE7206_H
-
-#define PA_SMSC                0x30000000
-#define PA_MRSHPC      0x34000000
-#define PA_LED         0x31400000
-
-void init_se7206_IRQ(void);
-
-#define __IO_PREFIX    se7206
-#include <asm/io_generic.h>
-
-#endif /* __ASM_SH_SE7206_H */
diff --git a/include/asm-sh/se7343.h b/include/asm-sh/se7343.h
deleted file mode 100644 (file)
index 9845846..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#ifndef __ASM_SH_HITACHI_SE7343_H
-#define __ASM_SH_HITACHI_SE7343_H
-
-/*
- * include/asm-sh/se/se7343.h
- *
- * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
- *
- * SH-Mobile SolutionEngine 7343 support
- */
-
-/* Box specific addresses.  */
-
-/* Area 0 */
-#define PA_ROM         0x00000000      /* EPROM */
-#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte(Actually 2MB) */
-#define PA_FROM                0x00400000      /* Flash ROM */
-#define PA_FROM_SIZE   0x00400000      /* Flash size 4M byte */
-#define PA_SRAM                0x00800000      /* SRAM */
-#define PA_FROM_SIZE   0x00400000      /* SRAM size 4M byte */
-/* Area 1 */
-#define PA_EXT1                0x04000000
-#define PA_EXT1_SIZE   0x04000000
-/* Area 2 */
-#define PA_EXT2                0x08000000
-#define PA_EXT2_SIZE   0x04000000
-/* Area 3 */
-#define PA_SDRAM       0x0c000000
-#define PA_SDRAM_SIZE  0x04000000
-/* Area 4 */
-#define PA_PCIC                0x10000000      /* MR-SHPC-01 PCMCIA */
-#define PA_MRSHPC       0xb03fffe0      /* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1   0xb0400000      /* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2   0xb0500000      /* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO    0xb0600000      /* MR-SHPC-01 I/O window base */
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-#define PA_LED         0xb0C00000      /* LED */
-#define LED_SHIFT       0
-#define PA_DIPSW       0xb0900000      /* Dip switch 31 */
-#define PA_CPLD_MODESET        0xb1400004      /* CPLD Mode set register */
-#define PA_CPLD_ST     0xb1400008      /* CPLD Interrupt status register */
-#define PA_CPLD_IMSK   0xb140000a      /* CPLD Interrupt mask register */
-/* Area 5 */
-#define PA_EXT5                0x14000000
-#define PA_EXT5_SIZE   0x04000000
-/* Area 6 */
-#define PA_LCD1                0xb8000000
-#define PA_LCD2                0xb8800000
-
-#define PORT_PACR      0xA4050100
-#define PORT_PBCR      0xA4050102
-#define PORT_PCCR      0xA4050104
-#define PORT_PDCR      0xA4050106
-#define PORT_PECR      0xA4050108
-#define PORT_PFCR      0xA405010A
-#define PORT_PGCR      0xA405010C
-#define PORT_PHCR      0xA405010E
-#define PORT_PJCR      0xA4050110
-#define PORT_PKCR      0xA4050112
-#define PORT_PLCR      0xA4050114
-#define PORT_PMCR      0xA4050116
-#define PORT_PNCR      0xA4050118
-#define PORT_PQCR      0xA405011A
-#define PORT_PRCR      0xA405011C
-#define PORT_PSCR      0xA405011E
-#define PORT_PTCR      0xA4050140
-#define PORT_PUCR      0xA4050142
-#define PORT_PVCR      0xA4050144
-#define PORT_PWCR      0xA4050146
-#define PORT_PYCR      0xA4050148
-#define PORT_PZCR      0xA405014A
-
-#define PORT_PSELA     0xA405014C
-#define PORT_PSELB     0xA405014E
-#define PORT_PSELC     0xA4050150
-#define PORT_PSELD     0xA4050152
-#define PORT_PSELE     0xA4050154
-
-#define PORT_HIZCRA    0xA4050156
-#define PORT_HIZCRB    0xA4050158
-#define PORT_HIZCRC    0xA405015C
-
-#define PORT_DRVCR     0xA4050180
-
-#define PORT_PADR      0xA4050120
-#define PORT_PBDR      0xA4050122
-#define PORT_PCDR      0xA4050124
-#define PORT_PDDR      0xA4050126
-#define PORT_PEDR      0xA4050128
-#define PORT_PFDR      0xA405012A
-#define PORT_PGDR      0xA405012C
-#define PORT_PHDR      0xA405012E
-#define PORT_PJDR      0xA4050130
-#define PORT_PKDR      0xA4050132
-#define PORT_PLDR      0xA4050134
-#define PORT_PMDR      0xA4050136
-#define PORT_PNDR      0xA4050138
-#define PORT_PQDR      0xA405013A
-#define PORT_PRDR      0xA405013C
-#define PORT_PTDR      0xA4050160
-#define PORT_PUDR      0xA4050162
-#define PORT_PVDR      0xA4050164
-#define PORT_PWDR      0xA4050166
-#define PORT_PYDR      0xA4050168
-
-#define FPGA_IN                0xb1400000
-#define FPGA_OUT       0xb1400002
-
-#define __IO_PREFIX    sh7343se
-#include <asm/io_generic.h>
-
-#define IRQ0_IRQ        32
-#define IRQ1_IRQ        33
-#define IRQ4_IRQ        36
-#define IRQ5_IRQ        37
-
-#define SE7343_FPGA_IRQ_MRSHPC0        0
-#define SE7343_FPGA_IRQ_MRSHPC1        1
-#define SE7343_FPGA_IRQ_MRSHPC2        2
-#define SE7343_FPGA_IRQ_MRSHPC3        3
-#define SE7343_FPGA_IRQ_SMC    6       /* EXT_IRQ2 */
-#define SE7343_FPGA_IRQ_USB    8
-
-#define SE7343_FPGA_IRQ_NR     11
-#define SE7343_FPGA_IRQ_BASE   120
-
-#define MRSHPC_IRQ3            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC3)
-#define MRSHPC_IRQ2            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC2)
-#define MRSHPC_IRQ1            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC1)
-#define MRSHPC_IRQ0            (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC0)
-#define SMC_IRQ                (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_SMC)
-#define USB_IRQ                (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_USB)
-
-/* arch/sh/boards/se/7343/irq.c */
-void init_7343se_IRQ(void);
-
-#endif  /* __ASM_SH_HITACHI_SE7343_H */
diff --git a/include/asm-sh/se7721.h b/include/asm-sh/se7721.h
deleted file mode 100644 (file)
index b957f60..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008 Renesas Solutions Corp.
- *
- * Hitachi UL SolutionEngine 7721 Support.
- *
- * 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.
- *
- */
-
-#ifndef __ASM_SH_SE7721_H
-#define __ASM_SH_SE7721_H
-#include <asm/addrspace.h>
-
-/* Box specific addresses. */
-#define SE_AREA0_WIDTH 2               /* Area0: 32bit */
-#define PA_ROM         0xa0000000      /* EPROM */
-#define PA_ROM_SIZE    0x00200000      /* EPROM size 2M byte */
-#define PA_FROM                0xa1000000      /* Flash-ROM */
-#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
-#define PA_EXT1                0xa4000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_SDRAM       0xaC000000      /* SDRAM(Area3) 64MB */
-#define PA_SDRAM_SIZE  0x04000000
-
-#define PA_EXT4                0xb0000000
-#define PA_EXT4_SIZE   0x04000000
-
-#define PA_PERIPHERAL  0xB8000000
-
-#define PA_PCIC                PA_PERIPHERAL
-#define PA_MRSHPC      (PA_PERIPHERAL + 0x003fffe0)
-#define PA_MRSHPC_MW1  (PA_PERIPHERAL + 0x00400000)
-#define PA_MRSHPC_MW2  (PA_PERIPHERAL + 0x00500000)
-#define PA_MRSHPC_IO   (PA_PERIPHERAL + 0x00600000)
-#define MRSHPC_OPTION  (PA_MRSHPC + 6)
-#define MRSHPC_CSR     (PA_MRSHPC + 8)
-#define MRSHPC_ISR     (PA_MRSHPC + 10)
-#define MRSHPC_ICR     (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR   (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1  (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1  (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1  (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2  (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2  (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2  (PA_MRSHPC + 26)
-#define MRSHPC_CDCR    (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO       (PA_MRSHPC + 30)
-
-#define PA_LED         0xB6800000      /* 8bit LED */
-#define PA_FPGA                0xB7000000      /* FPGA base address */
-
-#define MRSHPC_IRQ0    10
-
-#define FPGA_ILSR1     (PA_FPGA + 0x02)
-#define FPGA_ILSR2     (PA_FPGA + 0x03)
-#define FPGA_ILSR3     (PA_FPGA + 0x04)
-#define FPGA_ILSR4     (PA_FPGA + 0x05)
-#define FPGA_ILSR5     (PA_FPGA + 0x06)
-#define FPGA_ILSR6     (PA_FPGA + 0x07)
-#define FPGA_ILSR7     (PA_FPGA + 0x08)
-#define FPGA_ILSR8     (PA_FPGA + 0x09)
-
-void init_se7721_IRQ(void);
-
-#define __IO_PREFIX            se7721
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_SE7721_H */
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
deleted file mode 100644 (file)
index e971d9a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef __ASM_SH_SE7722_H
-#define __ASM_SH_SE7722_H
-
-/*
- * linux/include/asm-sh/se7722.h
- *
- * Copyright (C) 2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7722 Support.
- *
- * 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.
- *
- */
-#include <asm/addrspace.h>
-
-/* Box specific addresses.  */
-#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
-#define PA_ROM         0xa0000000      /* EPROM */
-#define PA_ROM_SIZE    0x00200000      /* EPROM size 2M byte */
-#define PA_FROM                0xa1000000      /* Flash-ROM */
-#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
-#define PA_EXT1                0xa4000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_SDRAM       0xaC000000      /* DDR-SDRAM(Area3) 64MB */
-#define PA_SDRAM_SIZE  0x04000000
-
-#define PA_EXT4                0xb0000000
-#define PA_EXT4_SIZE   0x04000000
-
-#define PA_PERIPHERAL  0xB0000000
-
-#define PA_PCIC         PA_PERIPHERAL                  /* MR-SHPC-01 PCMCIA */
-#define PA_MRSHPC       (PA_PERIPHERAL + 0x003fffe0)    /* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1   (PA_PERIPHERAL + 0x00400000)    /* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2   (PA_PERIPHERAL + 0x00500000)    /* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO    (PA_PERIPHERAL + 0x00600000)    /* MR-SHPC-01 I/O window base */
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define PA_LED         (PA_PERIPHERAL + 0x00800000)    /* 8bit LED */
-#define PA_FPGA                (PA_PERIPHERAL + 0x01800000)    /* FPGA base address */
-
-#define PA_LAN         (PA_AREA6_IO + 0)               /* SMC LAN91C111 */
-/* GPIO */
-#define FPGA_IN         0xb1840000UL
-#define FPGA_OUT        0xb1840004UL
-
-#define PORT_PECR       0xA4050108UL
-#define PORT_PJCR       0xA4050110UL
-#define PORT_PSELD      0xA4050154UL
-#define PORT_PSELB      0xA4050150UL
-
-#define PORT_PSELC      0xA4050152UL
-#define PORT_PKCR       0xA4050112UL
-#define PORT_PHCR       0xA405010EUL
-#define PORT_PLCR       0xA4050114UL
-#define PORT_PMCR       0xA4050116UL
-#define PORT_PRCR       0xA405011CUL
-#define PORT_PXCR       0xA4050148UL
-#define PORT_PSELA      0xA405014EUL
-#define PORT_PYCR       0xA405014AUL
-#define PORT_PZCR       0xA405014CUL
-#define PORT_HIZCRA     0xA4050158UL
-#define PORT_HIZCRC     0xA405015CUL
-
-/* IRQ */
-#define IRQ0_IRQ        32
-#define IRQ1_IRQ        33
-
-#define IRQ01_MODE      0xb1800000
-#define IRQ01_STS       0xb1800004
-#define IRQ01_MASK      0xb1800008
-
-/* Bits in IRQ01_* registers */
-
-#define SE7722_FPGA_IRQ_USB    0 /* IRQ0 */
-#define SE7722_FPGA_IRQ_SMC    1 /* IRQ0 */
-#define SE7722_FPGA_IRQ_MRSHPC0        2 /* IRQ1 */
-#define SE7722_FPGA_IRQ_MRSHPC1        3 /* IRQ1 */
-#define SE7722_FPGA_IRQ_MRSHPC2        4 /* IRQ1 */
-#define SE7722_FPGA_IRQ_MRSHPC3        5 /* IRQ1 */
-
-#define SE7722_FPGA_IRQ_NR     6
-#define SE7722_FPGA_IRQ_BASE   110
-
-#define MRSHPC_IRQ3            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC3)
-#define MRSHPC_IRQ2            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC2)
-#define MRSHPC_IRQ1            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC1)
-#define MRSHPC_IRQ0            (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC0)
-#define SMC_IRQ                (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_SMC)
-#define USB_IRQ                (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_USB)
-
-/* arch/sh/boards/se/7722/irq.c */
-void init_se7722_IRQ(void);
-
-#define __IO_PREFIX            se7722
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_SE7722_H */
diff --git a/include/asm-sh/se7751.h b/include/asm-sh/se7751.h
deleted file mode 100644 (file)
index b36792a..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __ASM_SH_HITACHI_7751SE_H
-#define __ASM_SH_HITACHI_7751SE_H
-
-/*
- * linux/include/asm-sh/hitachi_7751se.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine support
-
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-
-/* Box specific addresses.  */
-
-#define PA_ROM         0x00000000      /* EPROM */
-#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
-#define PA_FROM                0x01000000      /* EPROM */
-#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
-#define PA_EXT1                0x04000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_EXT2                0x08000000
-#define PA_EXT2_SIZE   0x04000000
-#define PA_SDRAM       0x0c000000
-#define PA_SDRAM_SIZE  0x04000000
-
-#define PA_EXT4                0x12000000
-#define PA_EXT4_SIZE   0x02000000
-#define PA_EXT5                0x14000000
-#define PA_EXT5_SIZE   0x04000000
-#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
-
-#define PA_DIPSW0      0xb9000000      /* Dip switch 5,6 */
-#define PA_DIPSW1      0xb9000002      /* Dip switch 7,8 */
-#define PA_LED         0xba000000      /* LED */
-#define        PA_BCR          0xbb000000      /* FPGA on the MS7751SE01 */
-
-#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
-#define MRSHPC_MODE     (PA_MRSHPC + 4)
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define BCR_ILCRA      (PA_BCR + 0)
-#define BCR_ILCRB      (PA_BCR + 2)
-#define BCR_ILCRC      (PA_BCR + 4)
-#define BCR_ILCRD      (PA_BCR + 6)
-#define BCR_ILCRE      (PA_BCR + 8)
-#define BCR_ILCRF      (PA_BCR + 10)
-#define BCR_ILCRG      (PA_BCR + 12)
-
-#define IRQ_79C973     13
-
-void init_7751se_IRQ(void);
-
-#define __IO_PREFIX    sh7751se
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_HITACHI_7751SE_H */
diff --git a/include/asm-sh/se7780.h b/include/asm-sh/se7780.h
deleted file mode 100644 (file)
index 40e9b41..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef __ASM_SH_SE7780_H
-#define __ASM_SH_SE7780_H
-
-/*
- * linux/include/asm-sh/se7780.h
- *
- * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- *
- * 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.
- */
-#include <asm/addrspace.h>
-
-/* Box specific addresses.  */
-#define SE_AREA0_WIDTH 4               /* Area0: 32bit */
-#define PA_ROM         0xa0000000      /* EPROM */
-#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
-#define PA_FROM                0xa1000000      /* Flash-ROM */
-#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
-#define PA_EXT1                0xa4000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_SM501       PA_EXT1         /* Graphic IC (SM501) */
-#define PA_SM501_SIZE  PA_EXT1_SIZE    /* Graphic IC (SM501) */
-#define PA_SDRAM       0xa8000000      /* DDR-SDRAM(Area2/3) 128MB */
-#define PA_SDRAM_SIZE  0x08000000
-
-#define PA_EXT4                0xb0000000
-#define PA_EXT4_SIZE   0x04000000
-#define PA_EXT_FLASH   PA_EXT4         /* Expansion Flash-ROM */
-
-#define PA_PERIPHERAL  PA_AREA6_IO     /* SW6-6=ON */
-
-#define PA_LAN         (PA_PERIPHERAL + 0)             /* SMC LAN91C111 */
-#define PA_LED_DISP    (PA_PERIPHERAL + 0x02000000)    /* 8words LED Display */
-#define DISP_CHAR_RAM  (7 << 3)
-#define DISP_SEL0_ADDR (DISP_CHAR_RAM + 0)
-#define DISP_SEL1_ADDR (DISP_CHAR_RAM + 1)
-#define DISP_SEL2_ADDR (DISP_CHAR_RAM + 2)
-#define DISP_SEL3_ADDR (DISP_CHAR_RAM + 3)
-#define DISP_SEL4_ADDR (DISP_CHAR_RAM + 4)
-#define DISP_SEL5_ADDR (DISP_CHAR_RAM + 5)
-#define DISP_SEL6_ADDR (DISP_CHAR_RAM + 6)
-#define DISP_SEL7_ADDR (DISP_CHAR_RAM + 7)
-
-#define DISP_UDC_RAM   (5 << 3)
-#define PA_FPGA                (PA_PERIPHERAL + 0x03000000) /* FPGA base address */
-
-/* FPGA register address and bit */
-#define FPGA_SFTRST            (PA_FPGA + 0)   /* Soft reset register */
-#define FPGA_INTMSK1           (PA_FPGA + 2)   /* Interrupt Mask register 1 */
-#define FPGA_INTMSK2           (PA_FPGA + 4)   /* Interrupt Mask register 2 */
-#define FPGA_INTSEL1           (PA_FPGA + 6)   /* Interrupt select register 1 */
-#define FPGA_INTSEL2           (PA_FPGA + 8)   /* Interrupt select register 2 */
-#define FPGA_INTSEL3           (PA_FPGA + 10)  /* Interrupt select register 3 */
-#define FPGA_PCI_INTSEL1       (PA_FPGA + 12)  /* PCI Interrupt select register 1 */
-#define FPGA_PCI_INTSEL2       (PA_FPGA + 14)  /* PCI Interrupt select register 2 */
-#define FPGA_INTSET            (PA_FPGA + 16)  /* IRQ/IRL select register */
-#define FPGA_INTSTS1           (PA_FPGA + 18)  /* Interrupt status register 1 */
-#define FPGA_INTSTS2           (PA_FPGA + 20)  /* Interrupt status register 2 */
-#define FPGA_REQSEL            (PA_FPGA + 22)  /* REQ/GNT select register */
-#define FPGA_DBG_LED           (PA_FPGA + 32)  /* Debug LED(D-LED[8:1] */
-#define PA_LED                 FPGA_DBG_LED
-#define FPGA_IVDRID            (PA_FPGA + 36)  /* iVDR ID Register */
-#define FPGA_IVDRPW            (PA_FPGA + 38)  /* iVDR Power ON Register */
-#define FPGA_MMCID             (PA_FPGA + 40)  /* MMC ID Register */
-
-/* FPGA INTSEL position */
-/* INTSEL1 */
-#define IRQPOS_SMC91CX          (0 * 4)
-#define IRQPOS_SM501            (1 * 4)
-/* INTSEL2 */
-#define IRQPOS_EXTINT1          (0 * 4)
-#define IRQPOS_EXTINT2          (1 * 4)
-#define IRQPOS_EXTINT3          (2 * 4)
-#define IRQPOS_EXTINT4          (3 * 4)
-/* INTSEL3 */
-#define IRQPOS_PCCPW            (0 * 4)
-
-/* IDE interrupt */
-#define IRQ_IDE0                67 /* iVDR */
-
-/* SMC interrupt */
-#define SMC_IRQ                 8
-
-/* SM501 interrupt */
-#define SM501_IRQ               0
-
-/* interrupt pin */
-#define IRQPIN_EXTINT1          0 /* IRQ0 pin */
-#define IRQPIN_EXTINT2          1 /* IRQ1 pin */
-#define IRQPIN_EXTINT3          2 /* IRQ2 pin */
-#define IRQPIN_SMC91CX          3 /* IRQ3 pin */
-#define IRQPIN_EXTINT4          4 /* IRQ4 pin */
-#define IRQPIN_PCC0             5 /* IRQ5 pin */
-#define IRQPIN_PCC2             6 /* IRQ6 pin */
-#define IRQPIN_SM501            7 /* IRQ7 pin */
-#define IRQPIN_PCCPW            7 /* IRQ7 pin */
-
-/* arch/sh/boards/se/7780/irq.c */
-void init_se7780_IRQ(void);
-
-#define __IO_PREFIX            se7780
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_SE7780_H */
diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h
deleted file mode 100644 (file)
index 8f8f4ad..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_SH_SECTIONS_H
-#define __ASM_SH_SECTIONS_H
-
-#include <asm-generic/sections.h>
-
-extern long __machvec_start, __machvec_end;
-extern char __uncached_start, __uncached_end;
-extern char _ebss[];
-
-#endif /* __ASM_SH_SECTIONS_H */
-
diff --git a/include/asm-sh/segment.h b/include/asm-sh/segment.h
deleted file mode 100644 (file)
index 5e2725f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __ASM_SH_SEGMENT_H
-#define __ASM_SH_SEGMENT_H
-
-#ifndef __ASSEMBLY__
-
-typedef struct {
-       unsigned long seg;
-} mm_segment_t;
-
-#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
-
-/*
- * 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.
- *
- * For historical reasons, these macros are grossly misnamed.
- */
-#define KERNEL_DS      MAKE_MM_SEG(0xFFFFFFFFUL)
-#ifdef CONFIG_MMU
-#define USER_DS                MAKE_MM_SEG(PAGE_OFFSET)
-#else
-#define USER_DS                KERNEL_DS
-#endif
-
-#define segment_eq(a,b)        ((a).seg == (b).seg)
-
-#define get_ds()       (KERNEL_DS)
-
-#define get_fs()       (current_thread_info()->addr_limit)
-#define set_fs(x)      (current_thread_info()->addr_limit = (x))
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_SEGMENT_H */
diff --git a/include/asm-sh/sembuf.h b/include/asm-sh/sembuf.h
deleted file mode 100644 (file)
index d79f3bd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __ASM_SH_SEMBUF_H
-#define __ASM_SH_SEMBUF_H
-
-/* 
- * The semid64_ds structure for i386 architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct semid64_ds {
-       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
-       __kernel_time_t sem_otime;              /* last semop time */
-       unsigned long   __unused1;
-       __kernel_time_t sem_ctime;              /* last change time */
-       unsigned long   __unused2;
-       unsigned long   sem_nsems;              /* no. of semaphores in array */
-       unsigned long   __unused3;
-       unsigned long   __unused4;
-};
-
-#endif /* __ASM_SH_SEMBUF_H */
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h
deleted file mode 100644 (file)
index 21f6d33..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * include/asm-sh/serial.h
- *
- * Configuration details for 8250, 16450, 16550, etc. serial ports
- */
-
-#ifndef _ASM_SERIAL_H
-#define _ASM_SERIAL_H
-
-#include <linux/kernel.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 )
-
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-#ifdef CONFIG_HD64465
-#include <asm/hd64465.h>
-
-#define SERIAL_PORT_DFNS                   \
-        /* UART CLK   PORT IRQ     FLAGS        */                      \
-        { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS }  /* ttyS0 */
-
-#else
-
-#define SERIAL_PORT_DFNS
-
-#endif
-
-#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h
deleted file mode 100644 (file)
index 55a2bd3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _SH_SETUP_H
-#define _SH_SETUP_H
-
-#define COMMAND_LINE_SIZE 256
-
-#ifdef __KERNEL__
-
-/*
- * This is set up by the setup-routine at boot-time
- */
-#define PARAM  ((unsigned char *)empty_zero_page)
-
-#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
-#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
-#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
-#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
-#define INITRD_START (*(unsigned long *) (PARAM+0x010))
-#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
-/* ... */
-#define COMMAND_LINE ((char *) (PARAM+0x100))
-
-int setup_early_printk(char *);
-void sh_mv_setup(void);
-
-#endif /* __KERNEL__ */
-
-#endif /* _SH_SETUP_H */
diff --git a/include/asm-sh/sfp-machine.h b/include/asm-sh/sfp-machine.h
deleted file mode 100644 (file)
index d3c5484..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Machine-dependent software floating-point definitions.
-   SuperH 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 (jj@ultra.linux.cz),
-                 David S. Miller (davem@redhat.com) and
-                 Peter Maydell (pmaydell@chiark.greenend.org.uk).
-
-   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                32
-#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_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y)                                  \
-  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y)                                  \
-  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y)  _FP_DIV_MEAT_1_udiv(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y)  _FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y)  _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S          ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D          ((_FP_QNANBIT_D << 1) - 1), -1
-#define _FP_NANFRAC_Q          ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
-#define _FP_NANSIGN_S          0
-#define _FP_NANSIGN_D          0
-#define _FP_NANSIGN_Q          0
-
-#define _FP_KEEPNANFRACP 1
-
-/*
- * If one NaN is signaling and the other is not,
- * we choose that one, otherwise we choose X.
- */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                      \
-  do {                                                          \
-    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)          \
-        && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))     \
-      {                                                         \
-        R##_s = Y##_s;                                          \
-        _FP_FRAC_COPY_##wc(R,Y);                                \
-      }                                                         \
-    else                                                        \
-      {                                                         \
-        R##_s = X##_s;                                          \
-        _FP_FRAC_COPY_##wc(R,X);                                \
-      }                                                         \
-    R##_c = FP_CLS_NAN;                                         \
-  } while (0)
-
-//#define FP_ROUNDMODE         FPSCR_RM
-#define FP_DENORM_ZERO         1/*FPSCR_DN*/
-
-/* Exception flags. */
-#define FP_EX_INVALID          (1<<4)
-#define FP_EX_DIVZERO          (1<<3)
-#define FP_EX_OVERFLOW         (1<<2)
-#define FP_EX_UNDERFLOW                (1<<1)
-#define FP_EX_INEXACT          (1<<0)
-
-#endif
-
diff --git a/include/asm-sh/sh03/io.h b/include/asm-sh/sh03/io.h
deleted file mode 100644 (file)
index c39c785..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * include/asm-sh/sh03/io.h
- *
- * Copyright 2004 Interface Co.,Ltd. Saito.K
- *
- * IO functions for an Interface CTP/PCI-SH03
- */
-
-#ifndef _ASM_SH_IO_SH03_H
-#define _ASM_SH_IO_SH03_H
-
-#include <linux/time.h>
-
-#define IRL0_IRQ       2
-#define IRL0_PRIORITY  13
-#define IRL1_IRQ       5
-#define IRL1_PRIORITY  10
-#define IRL2_IRQ       8
-#define IRL2_PRIORITY  7
-#define IRL3_IRQ       11
-#define IRL3_PRIORITY  4
-
-void heartbeat_sh03(void);
-
-#endif /* _ASM_SH_IO_SH03_H */
diff --git a/include/asm-sh/sh03/sh03.h b/include/asm-sh/sh03/sh03.h
deleted file mode 100644 (file)
index 19c40b8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef __ASM_SH_SH03_H
-#define __ASM_SH_SH03_H
-
-/*
- * linux/include/asm-sh/sh03/sh03.h
- *
- * Copyright (C) 2004  Interface Co., Ltd. Saito.K
- *
- * Interface CTP/PCI-SH03 support
- */
-
-#define PA_PCI_IO       (0xbe240000)    /* PCI I/O space */
-#define PA_PCI_MEM      (0xbd000000)    /* PCI MEM space */
-
-#define PCIPAR          (0xa4000cf8)    /* PCI Config address */
-#define PCIPDR          (0xa4000cfc)    /* PCI Config data    */
-
-#endif  /* __ASM_SH_SH03_H */
diff --git a/include/asm-sh/sh7760fb.h b/include/asm-sh/sh7760fb.h
deleted file mode 100644 (file)
index 8767f61..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * sh7760fb.h -- platform data for SH7760/SH7763 LCDC framebuffer driver.
- *
- * (c) 2006-2008 MSC Vertriebsges.m.b.H.,
- *                     Manuel Lauss <mano@roarinelk.homelinux.net>
- * (c) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- */
-
-#ifndef _ASM_SH_SH7760FB_H
-#define _ASM_SH_SH7760FB_H
-
-/*
- * some bits of the colormap registers should be written as zero.
- * create a mask for that.
- */
-#define SH7760FB_PALETTE_MASK 0x00f8fcf8
-
-/* The LCDC dma engine always sets bits 27-26 to 1: this is Area3 */
-#define SH7760FB_DMA_MASK 0x0C000000
-
-/* palette */
-#define LDPR(x) (((x) << 2))
-
-/* framebuffer registers and bits */
-#define LDICKR 0x400
-#define LDMTR 0x402
-/* see sh7760fb.h for LDMTR bits */
-#define LDDFR 0x404
-#define LDDFR_PABD (1 << 8)
-#define LDDFR_COLOR_MASK 0x7F
-#define LDSMR 0x406
-#define LDSMR_ROT (1 << 13)
-#define LDSARU 0x408
-#define LDSARL 0x40c
-#define LDLAOR 0x410
-#define LDPALCR 0x412
-#define LDPALCR_PALS (1 << 4)
-#define LDPALCR_PALEN (1 << 0)
-#define LDHCNR 0x414
-#define LDHSYNR 0x416
-#define LDVDLNR 0x418
-#define LDVTLNR 0x41a
-#define LDVSYNR 0x41c
-#define LDACLNR 0x41e
-#define LDINTR 0x420
-#define LDPMMR 0x424
-#define LDPSPR 0x426
-#define LDCNTR 0x428
-#define LDCNTR_DON (1 << 0)
-#define LDCNTR_DON2 (1 << 4)
-
-#ifdef CONFIG_CPU_SUBTYPE_SH7763
-# define LDLIRNR       0x440
-/* LDINTR bit */
-# define LDINTR_MINTEN (1 << 15)
-# define LDINTR_FINTEN (1 << 14)
-# define LDINTR_VSINTEN (1 << 13)
-# define LDINTR_VEINTEN (1 << 12)
-# define LDINTR_MINTS (1 << 11)
-# define LDINTR_FINTS (1 << 10)
-# define LDINTR_VSINTS (1 << 9)
-# define LDINTR_VEINTS (1 << 8)
-# define VINT_START (LDINTR_VSINTEN)
-# define VINT_CHECK (LDINTR_VSINTS)
-#else
-/* LDINTR bit */
-# define LDINTR_VINTSEL (1 << 12)
-# define LDINTR_VINTE (1 << 8)
-# define LDINTR_VINTS (1 << 0)
-# define VINT_START (LDINTR_VINTSEL)
-# define VINT_CHECK (LDINTR_VINTS)
-#endif
-
-/* HSYNC polarity inversion */
-#define LDMTR_FLMPOL (1 << 15)
-
-/* VSYNC polarity inversion */
-#define LDMTR_CL1POL (1 << 14)
-
-/* DISPLAY-ENABLE polarity inversion */
-#define LDMTR_DISPEN_LOWACT (1 << 13)
-
-/* DISPLAY DATA BUS polarity inversion */
-#define LDMTR_DPOL_LOWACT (1 << 12)
-
-/* AC modulation signal enable */
-#define LDMTR_MCNT (1 << 10)
-
-/* Disable output of HSYNC during VSYNC period */
-#define LDMTR_CL1CNT (1 << 9)
-
-/* Disable output of VSYNC during VSYNC period */
-#define LDMTR_CL2CNT (1 << 8)
-
-/* Display types supported by the LCDC */
-#define LDMTR_STN_MONO_4       0x00
-#define LDMTR_STN_MONO_8       0x01
-#define LDMTR_STN_COLOR_4      0x08
-#define LDMTR_STN_COLOR_8      0x09
-#define LDMTR_STN_COLOR_12     0x0A
-#define LDMTR_STN_COLOR_16     0x0B
-#define LDMTR_DSTN_MONO_8      0x11
-#define LDMTR_DSTN_MONO_16     0x13
-#define LDMTR_DSTN_COLOR_8     0x19
-#define LDMTR_DSTN_COLOR_12    0x1A
-#define LDMTR_DSTN_COLOR_16    0x1B
-#define LDMTR_TFT_COLOR_16     0x2B
-
-/* framebuffer color layout */
-#define LDDFR_1BPP_MONO 0x00
-#define LDDFR_2BPP_MONO 0x01
-#define LDDFR_4BPP_MONO 0x02
-#define LDDFR_6BPP_MONO 0x04
-#define LDDFR_4BPP 0x0A
-#define LDDFR_8BPP 0x0C
-#define LDDFR_16BPP_RGB555 0x1D
-#define LDDFR_16BPP_RGB565 0x2D
-
-/* LCDC Pixclock sources */
-#define LCDC_CLKSRC_BUSCLOCK 0
-#define LCDC_CLKSRC_PERIPHERAL 1
-#define LCDC_CLKSRC_EXTERNAL 2
-
-#define LDICKR_CLKSRC(x) \
-       (((x) & 3) << 12)
-
-/* LCDC pixclock input divider. Set to 1 at a minimum! */
-#define LDICKR_CLKDIV(x) \
-       ((x) & 0x1f)
-
-struct sh7760fb_platdata {
-
-       /* Set this member to a valid fb_videmode for the display you
-        * wish to use.  The following members must be initialized:
-        * xres, yres, hsync_len, vsync_len, sync,
-        * {left,right,upper,lower}_margin.
-        * The driver uses the above members to calculate register values
-        * and memory requirements. Other members are ignored but may
-        * be used by other framebuffer layer components.
-        */
-       struct fb_videomode *def_mode;
-
-       /* LDMTR includes display type and signal polarity.  The
-        * HSYNC/VSYNC polarities are derived from the fb_var_screeninfo
-        * data above; however the polarities of the following signals
-        * must be encoded in the ldmtr member:
-        * Display Enable signal (default high-active)  DISPEN_LOWACT
-        * Display Data signals (default high-active)   DPOL_LOWACT
-        * AC Modulation signal (default off)           MCNT
-        * Hsync-During-Vsync suppression (default off) CL1CNT
-        * Vsync-during-vsync suppression (default off) CL2CNT
-        * NOTE: also set a display type!
-        * (one of LDMTR_{STN,DSTN,TFT}_{MONO,COLOR}_{4,8,12,16})
-        */
-       u16 ldmtr;
-
-       /* LDDFR controls framebuffer image format (depth, organization)
-        * Use ONE of the LDDFR_?BPP_* macros!
-        */
-       u16 lddfr;
-
-       /* LDPMMR and LDPSPR control the timing of the power signals
-        * for the display. Please read the SH7760 Hardware Manual,
-        * Chapters 30.3.17, 30.3.18 and 30.4.6!
-        */
-       u16 ldpmmr;
-       u16 ldpspr;
-
-       /* LDACLNR contains the line numbers after which the AC modulation
-        * signal is to toggle. Set to ZERO for TFTs or displays which
-        * do not need it. (Chapter 30.3.15 in SH7760 Hardware Manual).
-        */
-       u16 ldaclnr;
-
-       /* LDICKR contains information on pixelclock source and config.
-        * Please use the LDICKR_CLKSRC() and LDICKR_CLKDIV() macros.
-        * minimal value for CLKDIV() must be 1!.
-        */
-       u16 ldickr;
-
-       /* set this member to 1 if you wish to use the LCDC's hardware
-        * rotation function.  This is limited to displays <= 320x200
-        * pixels resolution!
-        */
-       int rotate;             /* set to 1 to rotate 90 CCW */
-
-       /* set this to 1 to suppress vsync irq use. */
-       int novsync;
-
-       /* blanking hook for platform. Set this if your platform can do
-        * more than the LCDC in terms of blanking (e.g. disable clock
-        * generator / backlight power supply / etc.
-        */
-       void (*blank) (int);
-};
-
-#endif /* _ASM_SH_SH7760FB_H */
diff --git a/include/asm-sh/sh7763rdp.h b/include/asm-sh/sh7763rdp.h
deleted file mode 100644 (file)
index 8750cc8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef __ASM_SH_SH7763RDP_H
-#define __ASM_SH_SH7763RDP_H
-
-/*
- * linux/include/asm-sh/sh7763drp.h
- *
- * Copyright (C) 2008 Renesas Solutions
- * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- *
- * 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.
- *
- */
-#include <asm/addrspace.h>
-
-/* clock control */
-#define MSTPCR1 0xFFC80038
-
-/* PORT */
-#define PORT_PSEL0     0xFFEF0070
-#define PORT_PSEL1     0xFFEF0072
-#define PORT_PSEL2     0xFFEF0074
-#define PORT_PSEL3     0xFFEF0076
-#define PORT_PSEL4     0xFFEF0078
-
-#define PORT_PACR      0xFFEF0000
-#define PORT_PCCR      0xFFEF0004
-#define PORT_PFCR      0xFFEF000A
-#define PORT_PGCR      0xFFEF000C
-#define PORT_PHCR      0xFFEF000E
-#define PORT_PICR      0xFFEF0010
-#define PORT_PJCR      0xFFEF0012
-#define PORT_PKCR      0xFFEF0014
-#define PORT_PLCR      0xFFEF0016
-#define PORT_PMCR      0xFFEF0018
-#define PORT_PNCR      0xFFEF001A
-
-/* FPGA */
-#define CPLD_BOARD_ID_ERV_REG  0xB1000000
-#define CPLD_CPLD_CMD_REG              0xB1000006
-
-/*
- * USB SH7763RDP board can use Host only.
- */
-#define USB_USBHSC     0xFFEC80f0
-
-/* arch/sh/boards/renesas/sh7763rdp/irq.c */
-void init_sh7763rdp_IRQ(void);
-int sh7763rdp_irq_demux(int irq);
-#define __IO_PREFIX    sh7763rdp
-#include <asm/io_generic.h>
-
-#endif /* __ASM_SH_SH7763RDP_H */
diff --git a/include/asm-sh/sh7785lcr.h b/include/asm-sh/sh7785lcr.h
deleted file mode 100644 (file)
index 1ce27d5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef __ASM_SH_RENESAS_SH7785LCR_H
-#define __ASM_SH_RENESAS_SH7785LCR_H
-
-/*
- * This board has 2 physical memory maps.
- * It can be changed with DIP switch(S2-5).
- *
- * phys address                        | S2-5 = OFF    | S2-5 = ON
- * -----------------------------+---------------+---------------
- * 0x00000000 - 0x03ffffff(CS0)        | NOR Flash     | NOR Flash
- * 0x04000000 - 0x05ffffff(CS1)        | PLD           | PLD
- * 0x06000000 - 0x07ffffff(CS1)        | reserved      | I2C
- * 0x08000000 - 0x0bffffff(CS2)        | USB           | DDR SDRAM
- * 0x0c000000 - 0x0fffffff(CS3)        | SD            | DDR SDRAM
- * 0x10000000 - 0x13ffffff(CS4)        | SM107         | SM107
- * 0x14000000 - 0x17ffffff(CS5)        | I2C           | USB
- * 0x18000000 - 0x1bffffff(CS6)        | reserved      | SD
- * 0x40000000 - 0x5fffffff     | DDR SDRAM     | (cannot use)
- *
- */
-
-#define NOR_FLASH_ADDR         0x00000000
-#define NOR_FLASH_SIZE         0x04000000
-
-#define PLD_BASE_ADDR          0x04000000
-#define PLD_PCICR              (PLD_BASE_ADDR + 0x00)
-#define PLD_LCD_BK_CONTR       (PLD_BASE_ADDR + 0x02)
-#define PLD_LOCALCR            (PLD_BASE_ADDR + 0x04)
-#define PLD_POFCR              (PLD_BASE_ADDR + 0x06)
-#define PLD_LEDCR              (PLD_BASE_ADDR + 0x08)
-#define PLD_SWSR               (PLD_BASE_ADDR + 0x0a)
-#define PLD_VERSR              (PLD_BASE_ADDR + 0x0c)
-#define PLD_MMSR               (PLD_BASE_ADDR + 0x0e)
-
-#define SM107_MEM_ADDR         0x10000000
-#define SM107_MEM_SIZE         0x00e00000
-#define SM107_REG_ADDR         0x13e00000
-#define SM107_REG_SIZE         0x00200000
-
-#if defined(CONFIG_SH_SH7785LCR_29BIT_PHYSMAPS)
-#define R8A66597_ADDR          0x14000000      /* USB */
-#define CG200_ADDR             0x18000000      /* SD */
-#define PCA9564_ADDR           0x06000000      /* I2C */
-#else
-#define R8A66597_ADDR          0x08000000
-#define CG200_ADDR             0x0c000000
-#define PCA9564_ADDR           0x14000000
-#endif
-
-#define R8A66597_SIZE          0x00000100
-#define CG200_SIZE             0x00010000
-#define PCA9564_SIZE           0x00000100
-
-#endif  /* __ASM_SH_RENESAS_SH7785LCR_H */
-
diff --git a/include/asm-sh/sh_bios.h b/include/asm-sh/sh_bios.h
deleted file mode 100644 (file)
index 0ca2619..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef __ASM_SH_BIOS_H
-#define __ASM_SH_BIOS_H
-
-/*
- * Copyright (C) 2000 Greg Banks, Mitch Davis
- * C API to interface to the standard LinuxSH BIOS
- * usually from within the early stages of kernel boot.
- */
-
-
-extern void sh_bios_console_write(const char *buf, unsigned int len);
-extern void sh_bios_char_out(char ch);
-extern int sh_bios_in_gdb_mode(void);
-extern void sh_bios_gdb_detach(void);
-
-extern void sh_bios_get_node_addr(unsigned char *node_addr);
-extern void sh_bios_shutdown(unsigned int how);
-
-#endif /* __ASM_SH_BIOS_H */
diff --git a/include/asm-sh/sh_keysc.h b/include/asm-sh/sh_keysc.h
deleted file mode 100644 (file)
index b5a4dd5..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_KEYSC_H__
-#define __ASM_KEYSC_H__
-
-#define SH_KEYSC_MAXKEYS 30
-
-struct sh_keysc_info {
-       enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
-       int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
-       int delay;
-       int keycodes[SH_KEYSC_MAXKEYS];
-};
-
-#endif /* __ASM_KEYSC_H__ */
diff --git a/include/asm-sh/sh_mobile_lcdc.h b/include/asm-sh/sh_mobile_lcdc.h
deleted file mode 100644 (file)
index 2767772..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __ASM_SH_MOBILE_LCDC_H__
-#define __ASM_SH_MOBILE_LCDC_H__
-
-#include <linux/fb.h>
-
-enum { RGB8,   /* 24bpp, 8:8:8 */
-       RGB9,   /* 18bpp, 9:9 */
-       RGB12A, /* 24bpp, 12:12 */
-       RGB12B, /* 12bpp */
-       RGB16,  /* 16bpp */
-       RGB18,  /* 18bpp */
-       RGB24,  /* 24bpp */
-       SYS8A,  /* 24bpp, 8:8:8 */
-       SYS8B,  /* 18bpp, 8:8:2 */
-       SYS8C,  /* 18bpp, 2:8:8 */
-       SYS8D,  /* 16bpp, 8:8 */
-       SYS9,   /* 18bpp, 9:9 */
-       SYS12,  /* 24bpp, 12:12 */
-       SYS16A, /* 16bpp */
-       SYS16B, /* 18bpp, 16:2 */
-       SYS16C, /* 18bpp, 2:16 */
-       SYS18,  /* 18bpp */
-       SYS24 };/* 24bpp */
-
-enum { LCDC_CHAN_DISABLED = 0,
-       LCDC_CHAN_MAINLCD,
-       LCDC_CHAN_SUBLCD };
-
-enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
-
-struct sh_mobile_lcdc_sys_bus_cfg {
-       unsigned long ldmt2r;
-       unsigned long ldmt3r;
-};
-
-struct sh_mobile_lcdc_sys_bus_ops {
-       void (*write_index)(void *handle, unsigned long data);
-       void (*write_data)(void *handle, unsigned long data);
-       unsigned long (*read_data)(void *handle);
-};
-
-struct sh_mobile_lcdc_board_cfg {
-       void *board_data;
-       int (*setup_sys)(void *board_data, void *sys_ops_handle,
-                        struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-       void (*display_on)(void *board_data);
-       void (*display_off)(void *board_data);
-};
-
-struct sh_mobile_lcdc_chan_cfg {
-       int chan;
-       int bpp;
-       int interface_type; /* selects RGBn or SYSn I/F, see above */
-       int clock_divider;
-       struct fb_videomode lcd_cfg;
-       struct sh_mobile_lcdc_board_cfg board_cfg;
-       struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
-};
-
-struct sh_mobile_lcdc_info {
-       unsigned long lddckr;
-       int clock_source;
-       struct sh_mobile_lcdc_chan_cfg ch[2];
-};
-
-#endif /* __ASM_SH_MOBILE_LCDC_H__ */
diff --git a/include/asm-sh/shmbuf.h b/include/asm-sh/shmbuf.h
deleted file mode 100644 (file)
index b2101f4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __ASM_SH_SHMBUF_H
-#define __ASM_SH_SHMBUF_H
-
-/* 
- * The shmid64_ds structure for i386 architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-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 */
-       unsigned long           __unused1;
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       unsigned long           __unused2;
-       __kernel_time_t         shm_ctime;      /* last change time */
-       unsigned long           __unused3;
-       __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           __unused4;
-       unsigned long           __unused5;
-};
-
-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 /* __ASM_SH_SHMBUF_H */
diff --git a/include/asm-sh/shmin.h b/include/asm-sh/shmin.h
deleted file mode 100644 (file)
index 36ba138..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_SH_SHMIN_H
-#define __ASM_SH_SHMIN_H
-
-#define SHMIN_IO_BASE 0xb0000000UL
-
-#define SHMIN_NE_IRQ IRQ2_IRQ
-#define SHMIN_NE_BASE 0x300
-
-#endif
diff --git a/include/asm-sh/shmparam.h b/include/asm-sh/shmparam.h
deleted file mode 100644 (file)
index ba1758d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * include/asm-sh/shmparam.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2006 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_SHMPARAM_H
-#define __ASM_SH_SHMPARAM_H
-
-/*
- * SH-4 and SH-3 7705 have an aliasing dcache. Bump this up to a sensible value
- * for everyone, and work out the specifics from the probed cache descriptor.
- */
-#define        SHMLBA  0x4000           /* attach addr a multiple of this */
-
-#define __ARCH_FORCE_SHMLBA
-
-#endif /* __ASM_SH_SHMPARAM_H */
diff --git a/include/asm-sh/sigcontext.h b/include/asm-sh/sigcontext.h
deleted file mode 100644 (file)
index 8ce1435..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef __ASM_SH_SIGCONTEXT_H
-#define __ASM_SH_SIGCONTEXT_H
-
-struct sigcontext {
-       unsigned long   oldmask;
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-       /* CPU registers */
-       unsigned long long sc_regs[63];
-       unsigned long long sc_tregs[8];
-       unsigned long long sc_pc;
-       unsigned long long sc_sr;
-
-       /* FPU registers */
-       unsigned long long sc_fpregs[32];
-       unsigned int sc_fpscr;
-       unsigned int sc_fpvalid;
-#else
-       /* CPU registers */
-       unsigned long sc_regs[16];
-       unsigned long sc_pc;
-       unsigned long sc_pr;
-       unsigned long sc_sr;
-       unsigned long sc_gbr;
-       unsigned long sc_mach;
-       unsigned long sc_macl;
-
-#if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \
-    defined(__SH2A__) || defined(CONFIG_CPU_SH2A)
-       /* FPU registers */
-       unsigned long sc_fpregs[16];
-       unsigned long sc_xfpregs[16];
-       unsigned int sc_fpscr;
-       unsigned int sc_fpul;
-       unsigned int sc_ownedfp;
-#endif
-#endif
-};
-
-#endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/include/asm-sh/siginfo.h b/include/asm-sh/siginfo.h
deleted file mode 100644 (file)
index 813040e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_SIGINFO_H
-#define __ASM_SH_SIGINFO_H
-
-#include <asm-generic/siginfo.h>
-
-#endif /* __ASM_SH_SIGINFO_H */
diff --git a/include/asm-sh/signal.h b/include/asm-sh/signal.h
deleted file mode 100644 (file)
index 5c5c1e8..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef __ASM_SH_SIGNAL_H
-#define __ASM_SH_SIGNAL_H
-
-#include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct pt_regs;
-struct siginfo;
-
-#ifdef __KERNEL__
-/* 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      32
-#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__ */
-
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGBUS          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGUSR1                10
-#define SIGSEGV                11
-#define SIGUSR2                12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGSTKFLT      16
-#define SIGCHLD                17
-#define SIGCONT                18
-#define SIGSTOP                19
-#define SIGTSTP                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGURG         23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGIO          29
-#define SIGPOLL                SIGIO
-/*
-#define SIGLOST                29
-*/
-#define SIGPWR         30
-#define SIGSYS         31
-#define        SIGUNUSED       31
-
-/* 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_NOCLDSTOP   0x00000001
-#define SA_NOCLDWAIT   0x00000002
-#define SA_SIGINFO     0x00000004
-#define SA_ONSTACK     0x08000000
-#define SA_RESTART     0x10000000
-#define SA_NODEFER     0x40000000
-#define SA_RESETHAND   0x80000000
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-#define SA_RESTORER    0x04000000
-
-/* 
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
-
-#include <asm-generic/signal.h>
-
-#ifdef __KERNEL__
-struct old_sigaction {
-       __sighandler_t sa_handler;
-       old_sigset_t sa_mask;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-struct sigaction {
-       __sighandler_t sa_handler;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-       sigset_t sa_mask;               /* mask last for extensibility */
-};
-
-struct k_sigaction {
-       struct sigaction sa;
-};
-#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;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-#define sa_handler     _u._sa_handler
-#define sa_sigaction   _u._sa_sigaction
-
-#endif /* __KERNEL__ */
-
-typedef struct sigaltstack {
-       void *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-#ifdef __KERNEL__
-#include <asm/sigcontext.h>
-
-#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_SIGNAL_H */
diff --git a/include/asm-sh/smc37c93x.h b/include/asm-sh/smc37c93x.h
deleted file mode 100644 (file)
index 585da2a..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef __ASM_SH_SMC37C93X_H
-#define __ASM_SH_SMC37C93X_H
-
-/*
- * linux/include/asm-sh/smc37c93x.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * SMSC 37C93x Super IO Chip support
- */
-
-/* Default base I/O address */
-#define FDC_PRIMARY_BASE       0x3f0
-#define IDE1_PRIMARY_BASE      0x1f0
-#define IDE1_SECONDARY_BASE    0x170
-#define PARPORT_PRIMARY_BASE   0x378
-#define COM1_PRIMARY_BASE      0x2f8
-#define COM2_PRIMARY_BASE      0x3f8
-#define RTC_PRIMARY_BASE       0x070
-#define KBC_PRIMARY_BASE       0x060
-#define AUXIO_PRIMARY_BASE     0x000   /* XXX */
-
-/* Logical device number */
-#define LDN_FDC                        0
-#define LDN_IDE1               1
-#define LDN_IDE2               2
-#define LDN_PARPORT            3
-#define LDN_COM1               4
-#define LDN_COM2               5
-#define LDN_RTC                        6
-#define LDN_KBC                        7
-#define LDN_AUXIO              8
-
-/* Configuration port and key */
-#define CONFIG_PORT            0x3f0
-#define INDEX_PORT             CONFIG_PORT
-#define DATA_PORT              0x3f1
-#define CONFIG_ENTER           0x55
-#define CONFIG_EXIT            0xaa
-
-/* Configuration index */
-#define CURRENT_LDN_INDEX      0x07
-#define POWER_CONTROL_INDEX    0x22
-#define ACTIVATE_INDEX         0x30
-#define IO_BASE_HI_INDEX       0x60
-#define IO_BASE_LO_INDEX       0x61
-#define IRQ_SELECT_INDEX       0x70
-#define DMA_SELECT_INDEX       0x74
-
-#define GPIO46_INDEX           0xc6
-#define GPIO47_INDEX           0xc7
-
-/* UART stuff. Only for debugging.  */
-/* UART Register */
-
-#define UART_RBR       0x0     /* Receiver Buffer Register (Read Only) */
-#define UART_THR       0x0     /* Transmitter Holding Register (Write Only) */
-#define UART_IER       0x2     /* Interrupt Enable Register */
-#define UART_IIR       0x4     /* Interrupt Ident Register (Read Only) */
-#define UART_FCR       0x4     /* FIFO Control Register (Write Only) */
-#define UART_LCR       0x6     /* Line Control Register */
-#define UART_MCR       0x8     /* MODEM Control Register */
-#define UART_LSR       0xa     /* Line Status Register */
-#define UART_MSR       0xc     /* MODEM Status Register */
-#define UART_SCR       0xe     /* Scratch Register */
-#define UART_DLL       0x0     /* Divisor Latch (LS) */
-#define UART_DLM       0x2     /* Divisor Latch (MS) */
-
-#ifndef __ASSEMBLY__
-typedef struct uart_reg {
-       volatile __u16 rbr;
-       volatile __u16 ier;
-       volatile __u16 iir;
-       volatile __u16 lcr;
-       volatile __u16 mcr;
-       volatile __u16 lsr;
-       volatile __u16 msr;
-       volatile __u16 scr;
-} uart_reg;
-#endif /* ! __ASSEMBLY__ */
-
-/* Alias for Write Only Register */
-
-#define thr    rbr
-#define tcr    iir
-
-/* Alias for Divisor Latch Register */
-
-#define dll    rbr
-#define dlm    ier
-#define fcr    iir
-
-/* Interrupt Enable Register */
-
-#define IER_ERDAI      0x0100  /* Enable Received Data Available Interrupt */
-#define IER_ETHREI     0x0200  /* Enable Transmitter Holding Register Empty Interrupt */
-#define IER_ELSI       0x0400  /* Enable Receiver Line Status Interrupt */
-#define IER_EMSI       0x0800  /* Enable MODEM Status Interrupt */
-
-/* Interrupt Ident Register */
-
-#define IIR_IP         0x0100  /* "0" if Interrupt Pending */
-#define IIR_IIB0       0x0200  /* Interrupt ID Bit 0 */
-#define IIR_IIB1       0x0400  /* Interrupt ID Bit 1 */
-#define IIR_IIB2       0x0800  /* Interrupt ID Bit 2 */
-#define IIR_FIFO       0xc000  /* FIFOs enabled */
-
-/* FIFO Control Register */
-
-#define FCR_FEN                0x0100  /* FIFO enable */
-#define FCR_RFRES      0x0200  /* Receiver FIFO reset */
-#define FCR_TFRES      0x0400  /* Transmitter FIFO reset */
-#define FCR_DMA                0x0800  /* DMA mode select */
-#define FCR_RTL                0x4000  /* Receiver triger (LSB) */
-#define FCR_RTM                0x8000  /* Receiver triger (MSB) */
-
-/* Line Control Register */
-
-#define LCR_WLS0       0x0100  /* Word Length Select Bit 0 */
-#define LCR_WLS1       0x0200  /* Word Length Select Bit 1 */
-#define LCR_STB                0x0400  /* Number of Stop Bits */
-#define LCR_PEN                0x0800  /* Parity Enable */
-#define LCR_EPS                0x1000  /* Even Parity Select */
-#define LCR_SP         0x2000  /* Stick Parity */
-#define LCR_SB         0x4000  /* Set Break */
-#define LCR_DLAB       0x8000  /* Divisor Latch Access Bit */
-
-/* MODEM Control Register */
-
-#define MCR_DTR                0x0100  /* Data Terminal Ready */
-#define MCR_RTS                0x0200  /* Request to Send */
-#define MCR_OUT1       0x0400  /* Out 1 */
-#define MCR_IRQEN      0x0800  /* IRQ Enable */
-#define MCR_LOOP       0x1000  /* Loop */
-
-/* Line Status Register */
-
-#define LSR_DR         0x0100  /* Data Ready */
-#define LSR_OE         0x0200  /* Overrun Error */
-#define LSR_PE         0x0400  /* Parity Error */
-#define LSR_FE         0x0800  /* Framing Error */
-#define LSR_BI         0x1000  /* Break Interrupt */
-#define LSR_THRE       0x2000  /* Transmitter Holding Register Empty */
-#define LSR_TEMT       0x4000  /* Transmitter Empty */
-#define LSR_FIFOE      0x8000  /* Receiver FIFO error */
-
-/* MODEM Status Register */
-
-#define MSR_DCTS       0x0100  /* Delta Clear to Send */
-#define MSR_DDSR       0x0200  /* Delta Data Set Ready */
-#define MSR_TERI       0x0400  /* Trailing Edge Ring Indicator */
-#define MSR_DDCD       0x0800  /* Delta Data Carrier Detect */
-#define MSR_CTS                0x1000  /* Clear to Send */
-#define MSR_DSR                0x2000  /* Data Set Ready */
-#define MSR_RI         0x4000  /* Ring Indicator */
-#define MSR_DCD                0x8000  /* Data Carrier Detect */
-
-/* Baud Rate Divisor */
-
-#define UART_CLK       (1843200)       /* 1.8432 MHz */
-#define UART_BAUD(x)   (UART_CLK / (16 * (x)))
-
-/* RTC register definition */
-#define RTC_SECONDS             0
-#define RTC_SECONDS_ALARM       1
-#define RTC_MINUTES             2
-#define RTC_MINUTES_ALARM       3
-#define RTC_HOURS               4
-#define RTC_HOURS_ALARM         5
-#define RTC_DAY_OF_WEEK         6
-#define RTC_DAY_OF_MONTH        7
-#define RTC_MONTH               8
-#define RTC_YEAR                9
-#define RTC_FREQ_SELECT                10
-# define RTC_UIP 0x80
-# define RTC_DIV_CTL 0x70
-/* This RTC can work under 32.768KHz clock only.  */
-# define RTC_OSC_ENABLE 0x20
-# define RTC_OSC_DISABLE 0x00
-#define RTC_CONTROL            11
-# define RTC_SET 0x80
-# define RTC_PIE 0x40
-# define RTC_AIE 0x20
-# define RTC_UIE 0x10
-# define RTC_SQWE 0x08
-# define RTC_DM_BINARY 0x04
-# define RTC_24H 0x02
-# define RTC_DST_EN 0x01
-
-#endif  /* __ASM_SH_SMC37C93X_H */
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
deleted file mode 100644 (file)
index 593343c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef __ASM_SH_SMP_H
-#define __ASM_SH_SMP_H
-
-#include <linux/bitops.h>
-#include <linux/cpumask.h>
-
-#ifdef CONFIG_SMP
-
-#include <linux/spinlock.h>
-#include <asm/atomic.h>
-#include <asm/current.h>
-
-#define raw_smp_processor_id() (current_thread_info()->cpu)
-#define hard_smp_processor_id()        plat_smp_processor_id()
-
-/* Map from cpu id to sequential logical cpu number. */
-extern int __cpu_number_map[NR_CPUS];
-#define cpu_number_map(cpu)  __cpu_number_map[cpu]
-
-/* The reverse map from sequential logical cpu number to cpu id.  */
-extern int __cpu_logical_map[NR_CPUS];
-#define cpu_logical_map(cpu)  __cpu_logical_map[cpu]
-
-/* I've no idea what the real meaning of this is */
-#define PROC_CHANGE_PENALTY    20
-
-#define NO_PROC_ID     (-1)
-
-#define SMP_MSG_FUNCTION       0
-#define SMP_MSG_RESCHEDULE     1
-#define SMP_MSG_FUNCTION_SINGLE        2
-#define SMP_MSG_NR             3
-
-void plat_smp_setup(void);
-void plat_prepare_cpus(unsigned int max_cpus);
-int plat_smp_processor_id(void);
-void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
-void plat_send_ipi(unsigned int cpu, unsigned int message);
-int plat_register_ipi_handler(unsigned int message,
-                             void (*handler)(void *), void *arg);
-extern void arch_send_call_function_single_ipi(int cpu);
-extern void arch_send_call_function_ipi(cpumask_t mask);
-
-#else
-
-#define hard_smp_processor_id()        (0)
-
-#endif /* CONFIG_SMP */
-
-#endif /* __ASM_SH_SMP_H */
diff --git a/include/asm-sh/snapgear.h b/include/asm-sh/snapgear.h
deleted file mode 100644 (file)
index 042d95f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * include/asm-sh/snapgear.h
- *
- * Modified version of io_se.h for the snapgear-specific functions.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for a SnapGear
- */
-
-#ifndef _ASM_SH_IO_SNAPGEAR_H
-#define _ASM_SH_IO_SNAPGEAR_H
-
-#if defined(CONFIG_CPU_SH4)
-/*
- * The external interrupt lines, these take up ints 0 - 15 inclusive
- * depending on the priority for the interrupt.  In fact the priority
- * is the interrupt :-)
- */
-
-#define IRL0_IRQ       2
-#define IRL0_PRIORITY  13
-
-#define IRL1_IRQ       5
-#define IRL1_PRIORITY  10
-
-#define IRL2_IRQ       8
-#define IRL2_PRIORITY  7
-
-#define IRL3_IRQ       11
-#define IRL3_PRIORITY  4
-#endif
-
-#define __IO_PREFIX    snapgear
-#include <asm/io_generic.h>
-
-#ifdef CONFIG_SH_SECUREEDGE5410
-/*
- * We need to remember what was written to the ioport as some bits
- * are shared with other functions and you cannot read back what was
- * written :-|
- *
- * Bit        Read                   Write
- * -----------------------------------------------
- * D0         DCD on ttySC1          power
- * D1         Reset Switch           heatbeat
- * D2         ttySC0 CTS (7100)      LAN
- * D3         -                      WAN
- * D4         ttySC0 DCD (7100)      CONSOLE
- * D5         -                      ONLINE
- * D6         -                      VPN
- * D7         -                      DTR on ttySC1
- * D8         -                      ttySC0 RTS (7100)
- * D9         -                      ttySC0 DTR (7100)
- * D10        -                      RTC SCLK
- * D11        RTC DATA               RTC DATA
- * D12        -                      RTS RESET
- */
-
-#define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
-extern unsigned short secureedge5410_ioport;
-
-#define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
-        (secureedge5410_ioport = \
-                       ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
-#define SECUREEDGE_READ_IOPORT() \
-        ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
-#endif
-
-#endif /* _ASM_SH_IO_SNAPGEAR_H */
diff --git a/include/asm-sh/socket.h b/include/asm-sh/socket.h
deleted file mode 100644 (file)
index 6d4bf65..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef __ASM_SH_SOCKET_H
-#define __ASM_SH_SOCKET_H
-
-#include <asm/sockios.h>
-
-/* For setsockopt(2) */
-#define SOL_SOCKET     1
-
-#define SO_DEBUG       1
-#define SO_REUSEADDR   2
-#define SO_TYPE                3
-#define SO_ERROR       4
-#define SO_DONTROUTE   5
-#define SO_BROADCAST   6
-#define SO_SNDBUF      7
-#define SO_RCVBUF      8
-#define SO_RCVBUFFORCE 32
-#define SO_SNDBUFFORCE 33
-#define SO_KEEPALIVE   9
-#define SO_OOBINLINE   10
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_LINGER      13
-#define SO_BSDCOMPAT   14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED    16
-#define SO_PEERCRED    17
-#define SO_RCVLOWAT    18
-#define SO_SNDLOWAT    19
-#define SO_RCVTIMEO    20
-#define SO_SNDTIMEO    21
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
-#define SO_SECURITY_ENCRYPTION_NETWORK         24
-
-#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_ACCEPTCONN          30
-
-#define SO_PEERSEC             31
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-#define SO_MARK                        36
-
-#endif /* __ASM_SH_SOCKET_H */
diff --git a/include/asm-sh/sockios.h b/include/asm-sh/sockios.h
deleted file mode 100644 (file)
index cf8b96b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_SH_SOCKIOS_H
-#define __ASM_SH_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     _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
-#endif /* __ASM_SH_SOCKIOS_H */
diff --git a/include/asm-sh/sparsemem.h b/include/asm-sh/sparsemem.h
deleted file mode 100644 (file)
index 547a540..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef __ASM_SH_SPARSEMEM_H
-#define __ASM_SH_SPARSEMEM_H
-
-#ifdef __KERNEL__
-/*
- * SECTION_SIZE_BITS           2^N: how big each section will be
- * MAX_PHYSADDR_BITS           2^N: how much physical address space we have
- * MAX_PHYSMEM_BITS            2^N: how much memory we can have in that space
- */
-#define SECTION_SIZE_BITS      26
-#define MAX_PHYSADDR_BITS      32
-#define MAX_PHYSMEM_BITS       32
-
-#endif
-
-#endif /* __ASM_SH_SPARSEMEM_H */
diff --git a/include/asm-sh/spi.h b/include/asm-sh/spi.h
deleted file mode 100644 (file)
index e96f5b0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_SPI_H__
-#define __ASM_SPI_H__
-
-struct sh_spi_info;
-
-struct sh_spi_info {
-       int                      bus_num;
-       int                      num_chipselect;
-
-       void (*chip_select)(struct sh_spi_info *spi, int cs, int state);
-};
-
-#endif /* __ASM_SPI_H__ */
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
deleted file mode 100644 (file)
index e793181..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * include/asm-sh/spinlock.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- * Copyright (C) 2006, 2007 Akio Idehara
- *
- * 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.
- */
-#ifndef __ASM_SH_SPINLOCK_H
-#define __ASM_SH_SPINLOCK_H
-
-/*
- * The only locking implemented here uses SH-4A opcodes. For others,
- * split this out as per atomic-*.h.
- */
-#ifndef CONFIG_CPU_SH4A
-#error "Need movli.l/movco.l for spinlocks"
-#endif
-
-/*
- * Your basic SMP spinlocks, allowing only a single CPU anywhere
- */
-
-#define __raw_spin_is_locked(x)                ((x)->lock <= 0)
-#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
-#define __raw_spin_unlock_wait(x) \
-       do { cpu_relax(); } while ((x)->lock)
-
-/*
- * 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.
- */
-static inline void __raw_spin_lock(raw_spinlock_t *lock)
-{
-       unsigned long tmp;
-       unsigned long oldval;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%2, %0 ! __raw_spin_lock       \n\t"
-               "mov            %0, %1                          \n\t"
-               "mov            #0, %0                          \n\t"
-               "movco.l        %0, @%2                         \n\t"
-               "bf             1b                              \n\t"
-               "cmp/pl         %1                              \n\t"
-               "bf             1b                              \n\t"
-               : "=&z" (tmp), "=&r" (oldval)
-               : "r" (&lock->lock)
-               : "t", "memory"
-       );
-}
-
-static inline void __raw_spin_unlock(raw_spinlock_t *lock)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-               "mov            #1, %0 ! __raw_spin_unlock      \n\t"
-               "mov.l          %0, @%1                         \n\t"
-               : "=&z" (tmp)
-               : "r" (&lock->lock)
-               : "t", "memory"
-       );
-}
-
-static inline int __raw_spin_trylock(raw_spinlock_t *lock)
-{
-       unsigned long tmp, oldval;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%2, %0 ! __raw_spin_trylock    \n\t"
-               "mov            %0, %1                          \n\t"
-               "mov            #0, %0                          \n\t"
-               "movco.l        %0, @%2                         \n\t"
-               "bf             1b                              \n\t"
-               "synco                                          \n\t"
-               : "=&z" (tmp), "=&r" (oldval)
-               : "r" (&lock->lock)
-               : "t", "memory"
-       );
-
-       return oldval;
-}
-
-/*
- * Read-write spinlocks, allowing multiple readers but only one writer.
- *
- * NOTE! it is quite common to have readers in interrupts but no interrupt
- * writers. For those circumstances we can "mix" irq-safe locks - any writer
- * needs to get a irq-safe write-lock, but readers can get non-irqsafe
- * read-locks.
- */
-
-/**
- * read_can_lock - would read_trylock() succeed?
- * @lock: the rwlock in question.
- */
-#define __raw_read_can_lock(x) ((x)->lock > 0)
-
-/**
- * write_can_lock - would write_trylock() succeed?
- * @lock: the rwlock in question.
- */
-#define __raw_write_can_lock(x)        ((x)->lock == RW_LOCK_BIAS)
-
-static inline void __raw_read_lock(raw_rwlock_t *rw)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%1, %0 ! __raw_read_lock       \n\t"
-               "cmp/pl         %0                              \n\t"
-               "bf             1b                              \n\t"
-               "add            #-1, %0                         \n\t"
-               "movco.l        %0, @%1                         \n\t"
-               "bf             1b                              \n\t"
-               : "=&z" (tmp)
-               : "r" (&rw->lock)
-               : "t", "memory"
-       );
-}
-
-static inline void __raw_read_unlock(raw_rwlock_t *rw)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%1, %0 ! __raw_read_unlock     \n\t"
-               "add            #1, %0                          \n\t"
-               "movco.l        %0, @%1                         \n\t"
-               "bf             1b                              \n\t"
-               : "=&z" (tmp)
-               : "r" (&rw->lock)
-               : "t", "memory"
-       );
-}
-
-static inline void __raw_write_lock(raw_rwlock_t *rw)
-{
-       unsigned long tmp;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%1, %0 ! __raw_write_lock      \n\t"
-               "cmp/hs         %2, %0                          \n\t"
-               "bf             1b                              \n\t"
-               "sub            %2, %0                          \n\t"
-               "movco.l        %0, @%1                         \n\t"
-               "bf             1b                              \n\t"
-               : "=&z" (tmp)
-               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
-               : "t", "memory"
-       );
-}
-
-static inline void __raw_write_unlock(raw_rwlock_t *rw)
-{
-       __asm__ __volatile__ (
-               "mov.l          %1, @%0 ! __raw_write_unlock    \n\t"
-               :
-               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
-               : "t", "memory"
-       );
-}
-
-static inline int __raw_read_trylock(raw_rwlock_t *rw)
-{
-       unsigned long tmp, oldval;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%2, %0 ! __raw_read_trylock    \n\t"
-               "mov            %0, %1                          \n\t"
-               "cmp/pl         %0                              \n\t"
-               "bf             2f                              \n\t"
-               "add            #-1, %0                         \n\t"
-               "movco.l        %0, @%2                         \n\t"
-               "bf             1b                              \n\t"
-               "2:                                             \n\t"
-               "synco                                          \n\t"
-               : "=&z" (tmp), "=&r" (oldval)
-               : "r" (&rw->lock)
-               : "t", "memory"
-       );
-
-       return (oldval > 0);
-}
-
-static inline int __raw_write_trylock(raw_rwlock_t *rw)
-{
-       unsigned long tmp, oldval;
-
-       __asm__ __volatile__ (
-               "1:                                             \n\t"
-               "movli.l        @%2, %0 ! __raw_write_trylock   \n\t"
-               "mov            %0, %1                          \n\t"
-               "cmp/hs         %3, %0                          \n\t"
-               "bf             2f                              \n\t"
-               "sub            %3, %0                          \n\t"
-               "2:                                             \n\t"
-               "movco.l        %0, @%2                         \n\t"
-               "bf             1b                              \n\t"
-               "synco                                          \n\t"
-               : "=&z" (tmp), "=&r" (oldval)
-               : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
-               : "t", "memory"
-       );
-
-       return (oldval > (RW_LOCK_BIAS - 1));
-}
-
-#define _raw_spin_relax(lock)  cpu_relax()
-#define _raw_read_relax(lock)  cpu_relax()
-#define _raw_write_relax(lock) cpu_relax()
-
-#endif /* __ASM_SH_SPINLOCK_H */
diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h
deleted file mode 100644 (file)
index b4d244e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __ASM_SH_SPINLOCK_TYPES_H
-#define __ASM_SH_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               { 1 }
-
-typedef struct {
-       volatile unsigned int lock;
-} raw_rwlock_t;
-
-#define RW_LOCK_BIAS                   0x01000000
-#define __RAW_RW_LOCK_UNLOCKED         { RW_LOCK_BIAS }
-
-#endif
diff --git a/include/asm-sh/stat.h b/include/asm-sh/stat.h
deleted file mode 100644 (file)
index e1810cc..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifndef __ASM_SH_STAT_H
-#define __ASM_SH_STAT_H
-
-struct __old_kernel_stat {
-       unsigned short st_dev;
-       unsigned short st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned short st_rdev;
-       unsigned long  st_size;
-       unsigned long  st_atime;
-       unsigned long  st_mtime;
-       unsigned long  st_ctime;
-};
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-struct stat {
-       unsigned short st_dev;
-       unsigned short __pad1;
-       unsigned long st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned short st_rdev;
-       unsigned short __pad2;
-       unsigned long  st_size;
-       unsigned long  st_blksize;
-       unsigned long  st_blocks;
-       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;
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
-       unsigned short  st_dev;
-       unsigned char   __pad0[10];
-
-       unsigned long   st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-
-       unsigned long   st_uid;
-       unsigned long   st_gid;
-
-       unsigned short  st_rdev;
-       unsigned char   __pad3[10];
-
-       long long       st_size;
-       unsigned long   st_blksize;
-
-       unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
-       unsigned long   __pad4;         /* future possible st_blocks high bits */
-
-       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;  /* will be high 32 bits of ctime someday */
-
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-};
-#else
-struct stat {
-       unsigned long  st_dev;
-       unsigned long  st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned long  st_rdev;
-       unsigned long  st_size;
-       unsigned long  st_blksize;
-       unsigned long  st_blocks;
-       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;
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
-       unsigned long long      st_dev;
-       unsigned char   __pad0[4];
-
-#define STAT64_HAS_BROKEN_ST_INO       1
-       unsigned long   __st_ino;
-
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-
-       unsigned long   st_uid;
-       unsigned long   st_gid;
-
-       unsigned long long      st_rdev;
-       unsigned char   __pad3[4];
-
-       long long       st_size;
-       unsigned long   st_blksize;
-
-       unsigned long long      st_blocks;      /* Number 512-byte blocks allocated. */
-
-       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;
-
-       unsigned long long      st_ino;
-};
-
-#define STAT_HAVE_NSEC 1
-#endif
-
-#endif /* __ASM_SH_STAT_H */
diff --git a/include/asm-sh/statfs.h b/include/asm-sh/statfs.h
deleted file mode 100644 (file)
index 9202a02..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_STATFS_H
-#define __ASM_SH_STATFS_H
-
-#include <asm-generic/statfs.h>
-
-#endif /* __ASM_SH_STATFS_H */
diff --git a/include/asm-sh/string.h b/include/asm-sh/string.h
deleted file mode 100644 (file)
index 8c1ea21..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef CONFIG_SUPERH32
-# include "string_32.h"
-#else
-# include "string_64.h"
-#endif
diff --git a/include/asm-sh/string_32.h b/include/asm-sh/string_32.h
deleted file mode 100644 (file)
index 55f8db6..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef __ASM_SH_STRING_H
-#define __ASM_SH_STRING_H
-
-#ifdef __KERNEL__
-
-/*
- * Copyright (C) 1999 Niibe Yutaka
- * But consider these trivial functions to be public domain.
- */
-
-#define __HAVE_ARCH_STRCPY
-static inline char *strcpy(char *__dest, const char *__src)
-{
-       register char *__xdest = __dest;
-       unsigned long __dummy;
-
-       __asm__ __volatile__("1:\n\t"
-                            "mov.b     @%1+, %2\n\t"
-                            "mov.b     %2, @%0\n\t"
-                            "cmp/eq    #0, %2\n\t"
-                            "bf/s      1b\n\t"
-                            " add      #1, %0\n\t"
-                            : "=r" (__dest), "=r" (__src), "=&z" (__dummy)
-                            : "0" (__dest), "1" (__src)
-                            : "memory", "t");
-
-       return __xdest;
-}
-
-#define __HAVE_ARCH_STRNCPY
-static inline char *strncpy(char *__dest, const char *__src, size_t __n)
-{
-       register char *__xdest = __dest;
-       unsigned long __dummy;
-
-       if (__n == 0)
-               return __xdest;
-
-       __asm__ __volatile__(
-               "1:\n"
-               "mov.b  @%1+, %2\n\t"
-               "mov.b  %2, @%0\n\t"
-               "cmp/eq #0, %2\n\t"
-               "bt/s   2f\n\t"
-               " cmp/eq        %5,%1\n\t"
-               "bf/s   1b\n\t"
-               " add   #1, %0\n"
-               "2:"
-               : "=r" (__dest), "=r" (__src), "=&z" (__dummy)
-               : "0" (__dest), "1" (__src), "r" (__src+__n)
-               : "memory", "t");
-
-       return __xdest;
-}
-
-#define __HAVE_ARCH_STRCMP
-static inline int strcmp(const char *__cs, const char *__ct)
-{
-       register int __res;
-       unsigned long __dummy;
-
-       __asm__ __volatile__(
-               "mov.b  @%1+, %3\n"
-               "1:\n\t"
-               "mov.b  @%0+, %2\n\t"
-               "cmp/eq #0, %3\n\t"
-               "bt     2f\n\t"
-               "cmp/eq %2, %3\n\t"
-               "bt/s   1b\n\t"
-               " mov.b @%1+, %3\n\t"
-               "add    #-2, %1\n\t"
-               "mov.b  @%1, %3\n\t"
-               "sub    %3, %2\n"
-               "2:"
-               : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
-               : "0" (__cs), "1" (__ct)
-               : "t");
-
-       return __res;
-}
-
-#define __HAVE_ARCH_STRNCMP
-static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
-{
-       register int __res;
-       unsigned long __dummy;
-
-       if (__n == 0)
-               return 0;
-
-       __asm__ __volatile__(
-               "mov.b  @%1+, %3\n"
-               "1:\n\t"
-               "mov.b  @%0+, %2\n\t"
-               "cmp/eq %6, %0\n\t"
-               "bt/s   2f\n\t"
-               " cmp/eq #0, %3\n\t"
-               "bt/s   3f\n\t"
-               " cmp/eq %3, %2\n\t"
-               "bt/s   1b\n\t"
-               " mov.b @%1+, %3\n\t"
-               "add    #-2, %1\n\t"
-               "mov.b  @%1, %3\n"
-               "2:\n\t"
-               "sub    %3, %2\n"
-               "3:"
-               :"=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
-               : "0" (__cs), "1" (__ct), "r" (__cs+__n)
-               : "t");
-
-       return __res;
-}
-
-#define __HAVE_ARCH_MEMSET
-extern void *memset(void *__s, int __c, size_t __count);
-
-#define __HAVE_ARCH_MEMCPY
-extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
-
-#define __HAVE_ARCH_MEMMOVE
-extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
-
-#define __HAVE_ARCH_MEMCHR
-extern void *memchr(const void *__s, int __c, size_t __n);
-
-#define __HAVE_ARCH_STRLEN
-extern size_t strlen(const char *);
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_STRING_H */
diff --git a/include/asm-sh/string_64.h b/include/asm-sh/string_64.h
deleted file mode 100644 (file)
index aa1fef2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ASM_SH_STRING_64_H
-#define __ASM_SH_STRING_64_H
-
-/*
- * include/asm-sh/string_64.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- *
- * 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.
- */
-
-#define __HAVE_ARCH_MEMCPY
-extern void *memcpy(void *dest, const void *src, size_t count);
-
-#endif /* __ASM_SH_STRING_64_H */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
deleted file mode 100644 (file)
index 056d68c..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef __ASM_SH_SYSTEM_H
-#define __ASM_SH_SYSTEM_H
-
-/*
- * Copyright (C) 1999, 2000  Niibe Yutaka  &  Kaz Kojima
- * Copyright (C) 2002 Paul Mundt
- */
-
-#include <linux/irqflags.h>
-#include <linux/compiler.h>
-#include <linux/linkage.h>
-#include <asm/types.h>
-#include <asm/ptrace.h>
-
-#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
-
-#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
-#define __icbi()                       \
-{                                      \
-       unsigned long __addr;           \
-       __addr = 0xa8000000;            \
-       __asm__ __volatile__(           \
-               "icbi   %0\n\t"         \
-               : /* no output */       \
-               : "m" (__m(__addr)));   \
-}
-#endif
-
-/*
- * A brief note on ctrl_barrier(), the control register write barrier.
- *
- * Legacy SH cores typically require a sequence of 8 nops after
- * modification of a control register in order for the changes to take
- * effect. On newer cores (like the sh4a and sh5) this is accomplished
- * with icbi.
- *
- * Also note that on sh4a in the icbi case we can forego a synco for the
- * write barrier, as it's not necessary for control registers.
- *
- * Historically we have only done this type of barrier for the MMUCR, but
- * it's also necessary for the CCR, so we make it generic here instead.
- */
-#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
-#define mb()           __asm__ __volatile__ ("synco": : :"memory")
-#define rmb()          mb()
-#define wmb()          __asm__ __volatile__ ("synco": : :"memory")
-#define ctrl_barrier() __icbi()
-#define read_barrier_depends() do { } while(0)
-#else
-#define mb()           __asm__ __volatile__ ("": : :"memory")
-#define rmb()          mb()
-#define wmb()          __asm__ __volatile__ ("": : :"memory")
-#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
-#define read_barrier_depends() do { } while(0)
-#endif
-
-#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 { (void)xchg(&var, value); } while (0)
-
-#ifdef CONFIG_GUSA_RB
-#include <asm/cmpxchg-grb.h>
-#else
-#include <asm/cmpxchg-irq.h>
-#endif
-
-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 4:                                         \
-               __xchg__res = xchg_u32(__xchg_ptr, x);  \
-               break;                                  \
-       case 1:                                         \
-               __xchg__res = xchg_u8(__xchg_ptr, x);   \
-               break;                                  \
-       default:                                        \
-               __xchg_called_with_bad_pointer();       \
-               __xchg__res = x;                        \
-               break;                                  \
-       }                                               \
-                                                       \
-       __xchg__res;                                    \
-})
-
-#define xchg(ptr,x)    \
-       ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
-
-/* 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);
-
-#define __HAVE_ARCH_CMPXCHG 1
-
-static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
-               unsigned long new, int size)
-{
-       switch (size) {
-       case 4:
-               return __cmpxchg_u32(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))); \
-  })
-
-extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
-
-extern void *set_exception_table_vec(unsigned int vec, void *handler);
-
-static inline void *set_exception_table_evt(unsigned int evt, void *handler)
-{
-       return set_exception_table_vec(evt >> 5, handler);
-}
-
-/*
- * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
- */
-#ifdef CONFIG_CPU_SH2A
-extern unsigned int instruction_size(unsigned int insn);
-#elif defined(CONFIG_SUPERH32)
-#define instruction_size(insn) (2)
-#else
-#define instruction_size(insn) (4)
-#endif
-
-extern unsigned long cached_to_uncached;
-
-extern struct dentry *sh_debugfs_root;
-
-void per_cpu_trap_init(void);
-
-asmlinkage void break_point_trap(void);
-
-#ifdef CONFIG_SUPERH32
-#define BUILD_TRAP_HANDLER(name)                                       \
-asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5,        \
-                                   unsigned long r6, unsigned long r7, \
-                                   struct pt_regs __regs)
-
-#define TRAP_HANDLER_DECL                              \
-       struct pt_regs *regs = RELOC_HIDE(&__regs, 0);  \
-       unsigned int vec = regs->tra;                   \
-       (void)vec;
-#else
-#define BUILD_TRAP_HANDLER(name)       \
-asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
-#define TRAP_HANDLER_DECL
-#endif
-
-BUILD_TRAP_HANDLER(address_error);
-BUILD_TRAP_HANDLER(debug);
-BUILD_TRAP_HANDLER(bug);
-BUILD_TRAP_HANDLER(fpu_error);
-BUILD_TRAP_HANDLER(fpu_state_restore);
-
-#define arch_align_stack(x) (x)
-
-struct mem_access {
-       unsigned long (*from)(void *dst, const void *src, unsigned long cnt);
-       unsigned long (*to)(void *dst, const void *src, unsigned long cnt);
-};
-
-#ifdef CONFIG_SUPERH32
-# include "system_32.h"
-#else
-# include "system_64.h"
-#endif
-
-#endif
diff --git a/include/asm-sh/system_32.h b/include/asm-sh/system_32.h
deleted file mode 100644 (file)
index f11bcf0..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef __ASM_SH_SYSTEM_32_H
-#define __ASM_SH_SYSTEM_32_H
-
-#include <linux/types.h>
-
-struct task_struct *__switch_to(struct task_struct *prev,
-                               struct task_struct *next);
-
-/*
- *     switch_to() should switch tasks to task nr n, first
- */
-#define switch_to(prev, next, last)                                    \
-do {                                                                   \
-       register u32 *__ts1 __asm__ ("r1") = (u32 *)&prev->thread.sp;   \
-       register u32 *__ts2 __asm__ ("r2") = (u32 *)&prev->thread.pc;   \
-       register u32 *__ts4 __asm__ ("r4") = (u32 *)prev;               \
-       register u32 *__ts5 __asm__ ("r5") = (u32 *)next;               \
-       register u32 *__ts6 __asm__ ("r6") = (u32 *)&next->thread.sp;   \
-       register u32 __ts7 __asm__ ("r7") = next->thread.pc;            \
-       struct task_struct *__last;                                     \
-                                                                       \
-       __asm__ __volatile__ (                                          \
-               ".balign 4\n\t"                                         \
-               "stc.l  gbr, @-r15\n\t"                                 \
-               "sts.l  pr, @-r15\n\t"                                  \
-               "mov.l  r8, @-r15\n\t"                                  \
-               "mov.l  r9, @-r15\n\t"                                  \
-               "mov.l  r10, @-r15\n\t"                                 \
-               "mov.l  r11, @-r15\n\t"                                 \
-               "mov.l  r12, @-r15\n\t"                                 \
-               "mov.l  r13, @-r15\n\t"                                 \
-               "mov.l  r14, @-r15\n\t"                                 \
-               "mov.l  r15, @r1\t! save SP\n\t"                        \
-               "mov.l  @r6, r15\t! change to new stack\n\t"            \
-               "mova   1f, %0\n\t"                                     \
-               "mov.l  %0, @r2\t! save PC\n\t"                         \
-               "mov.l  2f, %0\n\t"                                     \
-               "jmp    @%0\t! call __switch_to\n\t"                    \
-               " lds   r7, pr\t!  with return to new PC\n\t"           \
-               ".balign        4\n"                                    \
-               "2:\n\t"                                                \
-               ".long  __switch_to\n"                                  \
-               "1:\n\t"                                                \
-               "mov.l  @r15+, r14\n\t"                                 \
-               "mov.l  @r15+, r13\n\t"                                 \
-               "mov.l  @r15+, r12\n\t"                                 \
-               "mov.l  @r15+, r11\n\t"                                 \
-               "mov.l  @r15+, r10\n\t"                                 \
-               "mov.l  @r15+, r9\n\t"                                  \
-               "mov.l  @r15+, r8\n\t"                                  \
-               "lds.l  @r15+, pr\n\t"                                  \
-               "ldc.l  @r15+, gbr\n\t"                                 \
-               : "=z" (__last)                                         \
-               : "r" (__ts1), "r" (__ts2), "r" (__ts4),                \
-                 "r" (__ts5), "r" (__ts6), "r" (__ts7)                 \
-               : "r3", "t");                                           \
-                                                                       \
-       last = __last;                                                  \
-} while (0)
-
-#define __uses_jump_to_uncached __attribute__ ((__section__ (".uncached.text")))
-
-/*
- * Jump to uncached area.
- * When handling TLB or caches, we need to do it from an uncached area.
- */
-#define jump_to_uncached()                     \
-do {                                           \
-       unsigned long __dummy;                  \
-                                               \
-       __asm__ __volatile__(                   \
-               "mova   1f, %0\n\t"             \
-               "add    %1, %0\n\t"             \
-               "jmp    @%0\n\t"                \
-               " nop\n\t"                      \
-               ".balign 4\n"                   \
-               "1:"                            \
-               : "=&z" (__dummy)               \
-               : "r" (cached_to_uncached));    \
-} while (0)
-
-/*
- * Back to cached area.
- */
-#define back_to_cached()                               \
-do {                                                   \
-       unsigned long __dummy;                          \
-       ctrl_barrier();                                 \
-       __asm__ __volatile__(                           \
-               "mov.l  1f, %0\n\t"                     \
-               "jmp    @%0\n\t"                        \
-               " nop\n\t"                              \
-               ".balign 4\n"                           \
-               "1:     .long 2f\n"                     \
-               "2:"                                    \
-               : "=&r" (__dummy));                     \
-} while (0)
-
-int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
-                           struct mem_access *ma);
-
-#endif /* __ASM_SH_SYSTEM_32_H */
diff --git a/include/asm-sh/system_64.h b/include/asm-sh/system_64.h
deleted file mode 100644 (file)
index 943acf5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef __ASM_SH_SYSTEM_64_H
-#define __ASM_SH_SYSTEM_64_H
-
-/*
- * include/asm-sh/system_64.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003  Paul Mundt
- * Copyright (C) 2004  Richard Curnow
- *
- * 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.
- */
-#include <asm/processor.h>
-
-/*
- *     switch_to() should switch tasks to task nr n, first
- */
-struct task_struct *sh64_switch_to(struct task_struct *prev,
-                                  struct thread_struct *prev_thread,
-                                  struct task_struct *next,
-                                  struct thread_struct *next_thread);
-
-#define switch_to(prev,next,last)                              \
-do {                                                           \
-       if (last_task_used_math != next) {                      \
-               struct pt_regs *regs = next->thread.uregs;      \
-               if (regs) regs->sr |= SR_FD;                    \
-       }                                                       \
-       last = sh64_switch_to(prev, &prev->thread, next,        \
-                             &next->thread);                   \
-} while (0)
-
-#define __uses_jump_to_uncached
-
-#define jump_to_uncached()     do { } while (0)
-#define back_to_cached()       do { } while (0)
-
-#endif /* __ASM_SH_SYSTEM_64_H */
diff --git a/include/asm-sh/systemh7751.h b/include/asm-sh/systemh7751.h
deleted file mode 100644 (file)
index 4161122..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef __ASM_SH_SYSTEMH_7751SYSTEMH_H
-#define __ASM_SH_SYSTEMH_7751SYSTEMH_H
-
-/*
- * linux/include/asm-sh/systemh/7751systemh.h
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SystemH support
-
- * Modified for 7751 SystemH by
- * Jonathan Short, 2002.
- */
-
-/* Box specific addresses.  */
-
-#define PA_ROM         0x00000000      /* EPROM */
-#define PA_ROM_SIZE    0x00400000      /* EPROM size 4M byte */
-#define PA_FROM                0x01000000      /* EPROM */
-#define PA_FROM_SIZE   0x00400000      /* EPROM size 4M byte */
-#define PA_EXT1                0x04000000
-#define PA_EXT1_SIZE   0x04000000
-#define PA_EXT2                0x08000000
-#define PA_EXT2_SIZE   0x04000000
-#define PA_SDRAM       0x0c000000
-#define PA_SDRAM_SIZE  0x04000000
-
-#define PA_EXT4                0x12000000
-#define PA_EXT4_SIZE   0x02000000
-#define PA_EXT5                0x14000000
-#define PA_EXT5_SIZE   0x04000000
-#define PA_PCIC                0x18000000      /* MR-SHPC-01 PCMCIA */
-
-#define PA_DIPSW0      0xb9000000      /* Dip switch 5,6 */
-#define PA_DIPSW1      0xb9000002      /* Dip switch 7,8 */
-#define PA_LED         0xba000000      /* LED */
-#define        PA_BCR          0xbb000000      /* FPGA on the MS7751SE01 */
-
-#define PA_MRSHPC      0xb83fffe0      /* MR-SHPC-01 PCMCIA controller */
-#define PA_MRSHPC_MW1  0xb8400000      /* MR-SHPC-01 memory window base */
-#define PA_MRSHPC_MW2  0xb8500000      /* MR-SHPC-01 attribute window base */
-#define PA_MRSHPC_IO   0xb8600000      /* MR-SHPC-01 I/O window base */
-#define MRSHPC_MODE     (PA_MRSHPC + 4)
-#define MRSHPC_OPTION   (PA_MRSHPC + 6)
-#define MRSHPC_CSR      (PA_MRSHPC + 8)
-#define MRSHPC_ISR      (PA_MRSHPC + 10)
-#define MRSHPC_ICR      (PA_MRSHPC + 12)
-#define MRSHPC_CPWCR    (PA_MRSHPC + 14)
-#define MRSHPC_MW0CR1   (PA_MRSHPC + 16)
-#define MRSHPC_MW1CR1   (PA_MRSHPC + 18)
-#define MRSHPC_IOWCR1   (PA_MRSHPC + 20)
-#define MRSHPC_MW0CR2   (PA_MRSHPC + 22)
-#define MRSHPC_MW1CR2   (PA_MRSHPC + 24)
-#define MRSHPC_IOWCR2   (PA_MRSHPC + 26)
-#define MRSHPC_CDCR     (PA_MRSHPC + 28)
-#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
-
-#define BCR_ILCRA      (PA_BCR + 0)
-#define BCR_ILCRB      (PA_BCR + 2)
-#define BCR_ILCRC      (PA_BCR + 4)
-#define BCR_ILCRD      (PA_BCR + 6)
-#define BCR_ILCRE      (PA_BCR + 8)
-#define BCR_ILCRF      (PA_BCR + 10)
-#define BCR_ILCRG      (PA_BCR + 12)
-
-#define IRQ_79C973     13
-
-#define __IO_PREFIX    sh7751systemh
-#include <asm/io_generic.h>
-
-#endif  /* __ASM_SH_SYSTEMH_7751SYSTEMH_H */
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h
deleted file mode 100644 (file)
index 77db116..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef __ASM_SH_TERMBITS_H
-#define __ASM_SH_TERMBITS_H
-
-#include <linux/posix_types.h>
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-};
-
-struct termios2 {
-       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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-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_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* 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 IUCLC  0001000
-#define IXON   0002000
-#define IXANY  0004000
-#define IXOFF  0010000
-#define IMAXBEL        0020000
-#define IUTF8  0040000
-
-/* c_oflag bits */
-#define OPOST  0000001
-#define OLCUC  0000002
-#define ONLCR  0000004
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-#define OFILL  0000100
-#define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
-#define VTDLY  0040000
-#define   VT0  0000000
-#define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
-
-/* c_cflag bit meaning */
-#define CBAUD  0010017
-#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 CSIZE  0000060
-#define   CS5  0000000
-#define   CS6  0000020
-#define   CS7  0000040
-#define   CS8  0000060
-#define CSTOPB 0000100
-#define CREAD  0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL  0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define           BOTHER 0010000
-#define    B57600 0010001
-#define   B115200 0010002
-#define   B230400 0010003
-#define   B460800 0010004
-#define   B500000 0010005
-#define   B576000 0010006
-#define   B921600 0010007
-#define  B1000000 0010010
-#define  B1152000 0010011
-#define  B1500000 0010012
-#define  B2000000 0010013
-#define  B2500000 0010014
-#define  B3000000 0010015
-#define  B3500000 0010016
-#define  B4000000 0010017
-#define CIBAUD   002003600000          /* input baud rate */
-#define CMSPAR   010000000000          /* mark or space (stick) parity */
-#define CRTSCTS          020000000000          /* flow control */
-
-#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
-
-/* c_lflag bits */
-#define ISIG   0000001
-#define ICANON 0000002
-#define XCASE  0000004
-#define ECHO   0000010
-#define ECHOE  0000020
-#define ECHOK  0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL        0001000
-#define ECHOPRT        0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif /* __ASM_SH_TERMBITS_H */
diff --git a/include/asm-sh/termios.h b/include/asm-sh/termios.h
deleted file mode 100644 (file)
index 0a8c793..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef __ASM_SH_TERMIOS_H
-#define __ASM_SH_TERMIOS_H
-
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
-
-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 */
-};
-
-/* modem lines */
-#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
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-#ifdef __KERNEL__
-
-/*     intr=^C         quit=^\         erase=del       kill=^U
-       eof=^D          vtime=\0        vmin=\1         sxtc=\0
-       start=^Q        stop=^S         susp=^Z         eol=\0
-       reprint=^R      discard=^U      werase=^W       lnext=^V
-       eol2=\0
-*/
-#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
-
-/*
- * Translate a "termio" structure into a "termios". Ugh.
- */
-#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
-       unsigned short __tmp; \
-       get_user(__tmp,&(termio)->x); \
-       *(unsigned short *) &(termios)->x = __tmp; \
-}
-
-#define user_termio_to_kernel_termios(termios, termio) \
-({ \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
-       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
-})
-
-/*
- * Translate a "termios" structure into a "termio". Ugh.
- */
-#define kernel_termios_to_user_termio(termio, termios) \
-({ \
-       put_user((termios)->c_iflag, &(termio)->c_iflag); \
-       put_user((termios)->c_oflag, &(termio)->c_oflag); \
-       put_user((termios)->c_cflag, &(termio)->c_cflag); \
-       put_user((termios)->c_lflag, &(termio)->c_lflag); \
-       put_user((termios)->c_line,  &(termio)->c_line); \
-       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
-})
-
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
-#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_TERMIOS_H */
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
deleted file mode 100644 (file)
index eeb4c74..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef __ASM_SH_THREAD_INFO_H
-#define __ASM_SH_THREAD_INFO_H
-
-/* SuperH version
- * Copyright (C) 2002  Niibe Yutaka
- *
- * The copyright of original i386 version is:
- *
- *  Copyright (C) 2002  David Howells (dhowells@redhat.com)
- *  - Incorporating suggestions made by Linus Torvalds and Dave Miller
- */
-#ifdef __KERNEL__
-#include <asm/page.h>
-
-#ifndef __ASSEMBLY__
-#include <asm/processor.h>
-
-struct thread_info {
-       struct task_struct      *task;          /* main task structure */
-       struct exec_domain      *exec_domain;   /* execution domain */
-       unsigned long           flags;          /* low level flags */
-       __u32                   cpu;
-       int                     preempt_count; /* 0 => preemptable, <0 => BUG */
-       mm_segment_t            addr_limit;     /* thread address space */
-       struct restart_block    restart_block;
-       unsigned long           previous_sp;    /* sp of previous stack in case
-                                                  of nested IRQ stacks */
-       __u8                    supervisor_stack[0];
-};
-
-#endif
-
-#define PREEMPT_ACTIVE         0x10000000
-
-#if defined(CONFIG_4KSTACKS)
-#define THREAD_SIZE_ORDER      (0)
-#elif defined(CONFIG_PAGE_SIZE_4KB)
-#define THREAD_SIZE_ORDER      (1)
-#elif defined(CONFIG_PAGE_SIZE_8KB)
-#define THREAD_SIZE_ORDER      (1)
-#elif defined(CONFIG_PAGE_SIZE_16KB)
-#define THREAD_SIZE_ORDER      (0)
-#elif defined(CONFIG_PAGE_SIZE_64KB)
-#define THREAD_SIZE_ORDER      (0)
-#else
-#error "Unknown thread size"
-#endif
-
-#define THREAD_SIZE    (PAGE_SIZE << THREAD_SIZE_ORDER)
-#define STACK_WARN     (THREAD_SIZE >> 3)
-
-/*
- * macros/functions for gaining access to the thread information structure
- */
-#ifndef __ASSEMBLY__
-#define INIT_THREAD_INFO(tsk)                  \
-{                                              \
-       .task           = &tsk,                 \
-       .exec_domain    = &default_exec_domain, \
-       .flags          = 0,                    \
-       .cpu            = 0,                    \
-       .preempt_count  = 1,                    \
-       .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 current stack pointer from C */
-register unsigned long current_stack_pointer asm("r15") __used;
-
-/* how to get the thread information struct from C */
-static inline struct thread_info *current_thread_info(void)
-{
-       struct thread_info *ti;
-#if defined(CONFIG_SUPERH64)
-       __asm__ __volatile__ ("getcon   cr17, %0" : "=r" (ti));
-#elif defined(CONFIG_CPU_HAS_SR_RB)
-       __asm__ __volatile__ ("stc      r7_bank, %0" : "=r" (ti));
-#else
-       unsigned long __dummy;
-
-       __asm__ __volatile__ (
-               "mov    r15, %0\n\t"
-               "and    %1, %0\n\t"
-               : "=&r" (ti), "=r" (__dummy)
-               : "1" (~(THREAD_SIZE - 1))
-               : "memory");
-#endif
-
-       return ti;
-}
-
-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
-/* thread information allocation */
-#ifdef CONFIG_DEBUG_STACK_USAGE
-#define alloc_thread_info(ti)  kzalloc(THREAD_SIZE, GFP_KERNEL)
-#else
-#define alloc_thread_info(ti)  kmalloc(THREAD_SIZE, GFP_KERNEL)
-#endif
-#define free_thread_info(ti)   kfree(ti)
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * thread information flags
- * - these are process state flags that various assembly files may need to access
- * - pending work-to-be-done flags are in LSW
- * - other flags in MSW
- */
-#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
-#define TIF_SIGPENDING         1       /* signal pending */
-#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
-#define TIF_RESTORE_SIGMASK    3       /* restore signal mask in do_signal() */
-#define TIF_SINGLESTEP         4       /* singlestepping active */
-#define TIF_SYSCALL_AUDIT      5
-#define TIF_USEDFPU            16      /* FPU was used by this task this quantum (SMP) */
-#define TIF_POLLING_NRFLAG     17      /* true if poll_idle() is polling TIF_NEED_RESCHED */
-#define TIF_MEMDIE             18
-#define TIF_FREEZE             19
-
-#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
-#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
-#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
-#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
-#define _TIF_SINGLESTEP                (1<<TIF_SINGLESTEP)
-#define _TIF_SYSCALL_AUDIT             (1<<TIF_SYSCALL_AUDIT)
-#define _TIF_USEDFPU           (1<<TIF_USEDFPU)
-#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
-#define _TIF_FREEZE            (1<<TIF_FREEZE)
-
-#define _TIF_WORK_MASK         0x000000FE      /* work to do on interrupt/exception return */
-#define _TIF_ALLWORK_MASK      0x000000FF      /* work to do on any return to u-space */
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_THREAD_INFO_H */
diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h
deleted file mode 100644 (file)
index 327f7eb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __ASM_SH_TIMER_H
-#define __ASM_SH_TIMER_H
-
-#include <linux/sysdev.h>
-#include <linux/clocksource.h>
-#include <asm/cpu/timer.h>
-
-struct sys_timer_ops {
-       int (*init)(void);
-       int (*start)(void);
-       int (*stop)(void);
-       cycle_t (*read)(void);
-#ifndef CONFIG_GENERIC_TIME
-       unsigned long (*get_offset)(void);
-#endif
-};
-
-struct sys_timer {
-       const char              *name;
-
-       struct sys_device       dev;
-       struct sys_timer_ops    *ops;
-};
-
-#define TICK_SIZE (tick_nsec / 1000)
-
-extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;
-extern struct sys_timer *sys_timer;
-
-#ifndef CONFIG_GENERIC_TIME
-static inline unsigned long get_timer_offset(void)
-{
-       return sys_timer->ops->get_offset();
-}
-#endif
-
-/* arch/sh/kernel/timers/timer.c */
-struct sys_timer *get_sys_timer(void);
-
-/* arch/sh/kernel/time.c */
-void handle_timer_tick(void);
-extern unsigned long sh_hpt_frequency;
-
-#endif /* __ASM_SH_TIMER_H */
diff --git a/include/asm-sh/timex.h b/include/asm-sh/timex.h
deleted file mode 100644 (file)
index a873e24..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * linux/include/asm-sh/timex.h
- *
- * sh architecture timex specifications
- */
-#ifndef __ASM_SH_TIMEX_H
-#define __ASM_SH_TIMEX_H
-
-#define CLOCK_TICK_RATE                (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */
-
-typedef unsigned long long cycles_t;
-
-static __inline__ cycles_t get_cycles (void)
-{
-       return 0;
-}
-
-#endif /* __ASM_SH_TIMEX_H */
diff --git a/include/asm-sh/titan.h b/include/asm-sh/titan.h
deleted file mode 100644 (file)
index 03f3583..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Platform defintions for Titan
- */
-#ifndef _ASM_SH_TITAN_H
-#define _ASM_SH_TITAN_H
-
-#define __IO_PREFIX titan
-#include <asm/io_generic.h>
-
-/* IRQ assignments */
-#define TITAN_IRQ_WAN          2       /* eth0 (WAN) */
-#define TITAN_IRQ_LAN          5       /* eth1 (LAN) */
-#define TITAN_IRQ_MPCIA                8       /* mPCI A */
-#define TITAN_IRQ_MPCIB                11      /* mPCI B */
-#define TITAN_IRQ_USB          11      /* USB */
-
-#endif /* __ASM_SH_TITAN_H */
diff --git a/include/asm-sh/tlb.h b/include/asm-sh/tlb.h
deleted file mode 100644 (file)
index 88ff1ae..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_SH_TLB_H
-#define __ASM_SH_TLB_H
-
-#ifdef CONFIG_SUPERH64
-# include "tlb_64.h"
-#endif
-
-#ifndef __ASSEMBLY__
-
-#define tlb_start_vma(tlb, vma) \
-       flush_cache_range(vma, vma->vm_start, vma->vm_end)
-
-#define tlb_end_vma(tlb, vma)  \
-       flush_tlb_range(vma, vma->vm_start, vma->vm_end)
-
-#define __tlb_remove_tlb_entry(tlb, pte, address)      do { } while (0)
-
-/*
- * Flush whole TLBs for MM
- */
-#define tlb_flush(tlb)                         flush_tlb_mm((tlb)->mm)
-
-#include <linux/pagemap.h>
-#include <asm-generic/tlb.h>
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_TLB_H */
diff --git a/include/asm-sh/tlb_64.h b/include/asm-sh/tlb_64.h
deleted file mode 100644 (file)
index 0a96f3a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * include/asm-sh/tlb_64.h
- *
- * Copyright (C) 2003  Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_TLB_64_H
-#define __ASM_SH_TLB_64_H
-
-/* ITLB defines */
-#define ITLB_FIXED     0x00000000      /* First fixed ITLB, see head.S */
-#define ITLB_LAST_VAR_UNRESTRICTED     0x000003F0      /* Last ITLB */
-
-/* DTLB defines */
-#define DTLB_FIXED     0x00800000      /* First fixed DTLB, see head.S */
-#define DTLB_LAST_VAR_UNRESTRICTED     0x008003F0      /* Last DTLB */
-
-#ifndef __ASSEMBLY__
-
-/**
- * for_each_dtlb_entry
- *
- * @tlb:       TLB entry
- *
- * Iterate over free (non-wired) DTLB entries
- */
-#define for_each_dtlb_entry(tlb)               \
-       for (tlb  = cpu_data->dtlb.first;       \
-            tlb <= cpu_data->dtlb.last;        \
-            tlb += cpu_data->dtlb.step)
-
-/**
- * for_each_itlb_entry
- *
- * @tlb:       TLB entry
- *
- * Iterate over free (non-wired) ITLB entries
- */
-#define for_each_itlb_entry(tlb)               \
-       for (tlb  = cpu_data->itlb.first;       \
-            tlb <= cpu_data->itlb.last;        \
-            tlb += cpu_data->itlb.step)
-
-/**
- * __flush_tlb_slot
- *
- * @slot:      Address of TLB slot.
- *
- * Flushes TLB slot @slot.
- */
-static inline void __flush_tlb_slot(unsigned long long slot)
-{
-       __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
-}
-
-#ifdef CONFIG_MMU
-/* arch/sh64/mm/tlb.c */
-int sh64_tlb_init(void);
-unsigned long long sh64_next_free_dtlb_entry(void);
-unsigned long long sh64_get_wired_dtlb_entry(void);
-int sh64_put_wired_dtlb_entry(unsigned long long entry);
-void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr,
-                        unsigned long asid, unsigned long paddr);
-void sh64_teardown_tlb_slot(unsigned long long config_addr);
-#else
-#define sh64_tlb_init()                                        do { } while (0)
-#define sh64_next_free_dtlb_entry()                    (0)
-#define sh64_get_wired_dtlb_entry()                    (0)
-#define sh64_put_wired_dtlb_entry(entry)               do { } while (0)
-#define sh64_setup_tlb_slot(conf, virt, asid, phys)    do { } while (0)
-#define sh64_teardown_tlb_slot(addr)                   do { } while (0)
-#endif /* CONFIG_MMU */
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_SH_TLB_64_H */
diff --git a/include/asm-sh/tlbflush.h b/include/asm-sh/tlbflush.h
deleted file mode 100644 (file)
index e0ac972..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef __ASM_SH_TLBFLUSH_H
-#define __ASM_SH_TLBFLUSH_H
-
-/*
- * TLB flushing:
- *
- *  - flush_tlb_all() flushes all processes TLBs
- *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
- *  - flush_tlb_page(vma, vmaddr) flushes one page
- *  - flush_tlb_range(vma, start, end) flushes a range of pages
- *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
- */
-extern void local_flush_tlb_all(void);
-extern void local_flush_tlb_mm(struct mm_struct *mm);
-extern void local_flush_tlb_range(struct vm_area_struct *vma,
-                                 unsigned long start,
-                                 unsigned long end);
-extern void local_flush_tlb_page(struct vm_area_struct *vma,
-                                unsigned long page);
-extern void local_flush_tlb_kernel_range(unsigned long start,
-                                        unsigned long end);
-extern void local_flush_tlb_one(unsigned long asid, unsigned long page);
-
-#ifdef CONFIG_SMP
-
-extern void flush_tlb_all(void);
-extern void flush_tlb_mm(struct mm_struct *mm);
-extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
-                           unsigned long end);
-extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
-extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
-extern void flush_tlb_one(unsigned long asid, unsigned long page);
-
-#else
-
-#define flush_tlb_all()                        local_flush_tlb_all()
-#define flush_tlb_mm(mm)               local_flush_tlb_mm(mm)
-#define flush_tlb_page(vma, page)      local_flush_tlb_page(vma, page)
-#define flush_tlb_one(asid, page)      local_flush_tlb_one(asid, page)
-
-#define flush_tlb_range(vma, start, end)       \
-       local_flush_tlb_range(vma, start, end)
-
-#define flush_tlb_kernel_range(start, end)     \
-       local_flush_tlb_kernel_range(start, end)
-
-#endif /* CONFIG_SMP */
-
-#endif /* __ASM_SH_TLBFLUSH_H */
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h
deleted file mode 100644 (file)
index 95f0085..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _ASM_SH_TOPOLOGY_H
-#define _ASM_SH_TOPOLOGY_H
-
-#ifdef CONFIG_NUMA
-
-/* sched_domains SD_NODE_INIT for sh machines */
-#define SD_NODE_INIT (struct sched_domain) {           \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
-       .min_interval           = 8,                    \
-       .max_interval           = 32,                   \
-       .busy_factor            = 32,                   \
-       .imbalance_pct          = 125,                  \
-       .cache_nice_tries       = 2,                    \
-       .busy_idx               = 3,                    \
-       .idle_idx               = 2,                    \
-       .newidle_idx            = 2,                    \
-       .wake_idx               = 1,                    \
-       .forkexec_idx           = 1,                    \
-       .flags                  = SD_LOAD_BALANCE       \
-                               | SD_BALANCE_FORK       \
-                               | SD_BALANCE_EXEC       \
-                               | SD_SERIALIZE          \
-                               | SD_WAKE_BALANCE,      \
-       .last_balance           = jiffies,              \
-       .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
-}
-
-#define cpu_to_node(cpu)       ((void)(cpu),0)
-#define parent_node(node)      ((void)(node),0)
-
-#define node_to_cpumask(node)  ((void)node, cpu_online_map)
-#define node_to_first_cpu(node)        ((void)(node),0)
-
-#define pcibus_to_node(bus)    ((void)(bus), -1)
-#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
-                                       CPU_MASK_ALL : \
-                                       node_to_cpumask(pcibus_to_node(bus)) \
-                               )
-#endif
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_SH_TOPOLOGY_H */
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
deleted file mode 100644 (file)
index beea4e6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef __ASM_SH_TYPES_H
-#define __ASM_SH_TYPES_H
-
-#include <asm-generic/int-ll64.h>
-
-#ifndef __ASSEMBLY__
-
-typedef unsigned short umode_t;
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#ifdef __KERNEL__
-
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
-#ifdef CONFIG_SUPERH32
-typedef u16 opcode_t;
-#else
-typedef u32 opcode_t;
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_SH_TYPES_H */
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
deleted file mode 100644 (file)
index 45c2c9b..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-#ifndef __ASM_SH_UACCESS_H
-#define __ASM_SH_UACCESS_H
-
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <asm/segment.h>
-
-#define VERIFY_READ    0
-#define VERIFY_WRITE   1
-
-#define __addr_ok(addr) \
-       ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg)
-
-/*
- * __access_ok: Check if address with size is OK or not.
- *
- * Uhhuh, this needs 33-bit arithmetic. We have a carry..
- *
- * sum := addr + size;  carry? --> flag = true;
- * if (sum >= addr_limit) flag = true;
- */
-#define __access_ok(addr, size)                \
-       (__addr_ok((addr) + (size)))
-#define access_ok(type, addr, size)    \
-       (__chk_user_ptr(addr),          \
-        __access_ok((unsigned long __force)(addr), (size)))
-
-/*
- * Uh, these should become the main single-value transfer routines ...
- * They automatically use the right size if we just have the right
- * pointer type ...
- *
- * As SuperH uses the same address space for kernel and user data, we
- * can just do these as direct assignments.
- *
- * Careful to not
- * (a) re-use the arguments for side effects (sizeof is ok)
- * (b) require any knowledge of processes at this stage
- */
-#define put_user(x,ptr)                __put_user_check((x), (ptr), sizeof(*(ptr)))
-#define get_user(x,ptr)                __get_user_check((x), (ptr), sizeof(*(ptr)))
-
-/*
- * The "__xxx" versions do not do address space checking, useful when
- * doing multiple accesses to the same area (the user has to do the
- * checks by hand with "access_ok()")
- */
-#define __put_user(x,ptr)      __put_user_nocheck((x), (ptr), sizeof(*(ptr)))
-#define __get_user(x,ptr)      __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
-
-struct __large_struct { unsigned long buf[100]; };
-#define __m(x) (*(struct __large_struct __user *)(x))
-
-#define __get_user_nocheck(x,ptr,size)                         \
-({                                                             \
-       long __gu_err;                                          \
-       unsigned long __gu_val;                                 \
-       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);     \
-       __chk_user_ptr(ptr);                                    \
-       __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
-       (x) = (__typeof__(*(ptr)))__gu_val;                     \
-       __gu_err;                                               \
-})
-
-#define __get_user_check(x,ptr,size)                                   \
-({                                                                     \
-       long __gu_err = -EFAULT;                                        \
-       unsigned long __gu_val = 0;                                     \
-       const __typeof__(*(ptr)) *__gu_addr = (ptr);                    \
-       if (likely(access_ok(VERIFY_READ, __gu_addr, (size))))          \
-               __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
-       (x) = (__typeof__(*(ptr)))__gu_val;                             \
-       __gu_err;                                                       \
-})
-
-#define __put_user_nocheck(x,ptr,size)                         \
-({                                                             \
-       long __pu_err;                                          \
-       __typeof__(*(ptr)) __user *__pu_addr = (ptr);           \
-       __chk_user_ptr(ptr);                                    \
-       __put_user_size((x), __pu_addr, (size), __pu_err);      \
-       __pu_err;                                               \
-})
-
-#define __put_user_check(x,ptr,size)                           \
-({                                                             \
-       long __pu_err = -EFAULT;                                \
-       __typeof__(*(ptr)) __user *__pu_addr = (ptr);           \
-       if (likely(access_ok(VERIFY_WRITE, __pu_addr, size)))   \
-               __put_user_size((x), __pu_addr, (size),         \
-                               __pu_err);                      \
-       __pu_err;                                               \
-})
-
-#ifdef CONFIG_SUPERH32
-# include "uaccess_32.h"
-#else
-# include "uaccess_64.h"
-#endif
-
-/* Generic arbitrary sized copy.  */
-/* Return the number of bytes NOT copied */
-__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n);
-
-static __always_inline unsigned long
-__copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-       return __copy_user(to, (__force void *)from, n);
-}
-
-static __always_inline unsigned long __must_check
-__copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-       return __copy_user((__force void *)to, from, n);
-}
-
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
-
-/*
- * Clear the area and return remaining number of bytes
- * (on failure.  Usually it's 0.)
- */
-__kernel_size_t __clear_user(void *addr, __kernel_size_t size);
-
-#define clear_user(addr,n)                                             \
-({                                                                     \
-       void __user * __cl_addr = (addr);                               \
-       unsigned long __cl_size = (n);                                  \
-                                                                       \
-       if (__cl_size && access_ok(VERIFY_WRITE,                        \
-               ((unsigned long)(__cl_addr)), __cl_size))               \
-               __cl_size = __clear_user(__cl_addr, __cl_size);         \
-                                                                       \
-       __cl_size;                                                      \
-})
-
-/**
- * strncpy_from_user: - Copy a NUL terminated string from userspace.
- * @dst:   Destination address, in kernel space.  This buffer must be at
- *         least @count bytes long.
- * @src:   Source address, in user space.
- * @count: Maximum number of bytes to copy, including the trailing NUL.
- *
- * Copies a NUL-terminated string from userspace to kernel space.
- *
- * On success, returns the length of the string (not including the trailing
- * NUL).
- *
- * If access to userspace fails, returns -EFAULT (some data may have been
- * copied).
- *
- * If @count is smaller than the length of the string, copies @count bytes
- * and returns @count.
- */
-#define strncpy_from_user(dest,src,count)                              \
-({                                                                     \
-       unsigned long __sfu_src = (unsigned long)(src);                 \
-       int __sfu_count = (int)(count);                                 \
-       long __sfu_res = -EFAULT;                                       \
-                                                                       \
-       if (__access_ok(__sfu_src, __sfu_count))                        \
-               __sfu_res = __strncpy_from_user((unsigned long)(dest),  \
-                               __sfu_src, __sfu_count);                \
-                                                                       \
-       __sfu_res;                                                      \
-})
-
-static inline unsigned long
-copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-       unsigned long __copy_from = (unsigned long) from;
-       __kernel_size_t __copy_size = (__kernel_size_t) n;
-
-       if (__copy_size && __access_ok(__copy_from, __copy_size))
-               return __copy_user(to, from, __copy_size);
-
-       return __copy_size;
-}
-
-static inline unsigned long
-copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-       unsigned long __copy_to = (unsigned long) to;
-       __kernel_size_t __copy_size = (__kernel_size_t) n;
-
-       if (__copy_size && __access_ok(__copy_to, __copy_size))
-               return __copy_user(to, from, __copy_size);
-
-       return __copy_size;
-}
-
-/**
- * strnlen_user: - Get the size of a string in user space.
- * @s: The string to measure.
- * @n: The maximum valid length
- *
- * Context: User context only.  This function may sleep.
- *
- * Get the size of a NUL-terminated string in user space.
- *
- * Returns the size of the string INCLUDING the terminating NUL.
- * On exception, returns 0.
- * If the string is too long, returns a value greater than @n.
- */
-static inline long strnlen_user(const char __user *s, long n)
-{
-       if (!__addr_ok(s))
-               return 0;
-       else
-               return __strnlen_user(s, n);
-}
-
-/**
- * strlen_user: - Get the size of a string in user space.
- * @str: The string to measure.
- *
- * Context: User context only.  This function may sleep.
- *
- * Get the size of a NUL-terminated string in user space.
- *
- * Returns the size of the string INCLUDING the terminating NUL.
- * On exception, returns 0.
- *
- * If there is a limit on the length of a valid string, you may wish to
- * consider using strnlen_user() instead.
- */
-#define strlen_user(str)       strnlen_user(str, ~0UL >> 1)
-
-/*
- * The exception table consists of pairs of addresses: the first is the
- * address of an instruction that is allowed to fault, and the second is
- * the address at which the program should continue.  No registers are
- * modified, so it is entirely up to the continuation code to figure out
- * what to do.
- *
- * All the routines below use bits of fixup code that are out of line
- * with the main instruction path.  This means when everything is well,
- * we don't even have to jump over them.  Further, they do not intrude
- * on our cache or tlb entries.
- */
-struct exception_table_entry {
-       unsigned long insn, fixup;
-};
-
-#if defined(CONFIG_SUPERH64) && defined(CONFIG_MMU)
-#define ARCH_HAS_SEARCH_EXTABLE
-#endif
-
-int fixup_exception(struct pt_regs *regs);
-/* Returns 0 if exception not found and fixup.unit otherwise.  */
-unsigned long search_exception_table(unsigned long addr);
-const struct exception_table_entry *search_exception_tables(unsigned long addr);
-
-
-#endif /* __ASM_SH_UACCESS_H */
diff --git a/include/asm-sh/uaccess_32.h b/include/asm-sh/uaccess_32.h
deleted file mode 100644 (file)
index 892fd6d..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * User space memory access functions
- *
- * Copyright (C) 1999, 2002  Niibe Yutaka
- * Copyright (C) 2003 - 2008  Paul Mundt
- *
- *  Based on:
- *     MIPS implementation version 1.15 by
- *              Copyright (C) 1996, 1997, 1998 by Ralf Baechle
- *     and i386 version.
- */
-#ifndef __ASM_SH_UACCESS_32_H
-#define __ASM_SH_UACCESS_32_H
-
-#define __get_user_size(x,ptr,size,retval)                     \
-do {                                                           \
-       retval = 0;                                             \
-       switch (size) {                                         \
-       case 1:                                                 \
-               __get_user_asm(x, ptr, retval, "b");            \
-               break;                                          \
-       case 2:                                                 \
-               __get_user_asm(x, ptr, retval, "w");            \
-               break;                                          \
-       case 4:                                                 \
-               __get_user_asm(x, ptr, retval, "l");            \
-               break;                                          \
-       default:                                                \
-               __get_user_unknown();                           \
-               break;                                          \
-       }                                                       \
-} while (0)
-
-#ifdef CONFIG_MMU
-#define __get_user_asm(x, addr, err, insn) \
-({ \
-__asm__ __volatile__( \
-       "1:\n\t" \
-       "mov." insn "   %2, %1\n\t" \
-       "2:\n" \
-       ".section       .fixup,\"ax\"\n" \
-       "3:\n\t" \
-       "mov    #0, %1\n\t" \
-       "mov.l  4f, %0\n\t" \
-       "jmp    @%0\n\t" \
-       " mov   %3, %0\n\t" \
-       ".balign        4\n" \
-       "4:     .long   2b\n\t" \
-       ".previous\n" \
-       ".section       __ex_table,\"a\"\n\t" \
-       ".long  1b, 3b\n\t" \
-       ".previous" \
-       :"=&r" (err), "=&r" (x) \
-       :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
-#else
-#define __get_user_asm(x, addr, err, insn)             \
-do {                                                   \
-       __asm__ __volatile__ (                          \
-               "mov." insn "   %1, %0\n\t"             \
-               : "=&r" (x)                             \
-               : "m" (__m(addr))                       \
-       );                                              \
-} while (0)
-#endif /* CONFIG_MMU */
-
-extern void __get_user_unknown(void);
-
-#define __put_user_size(x,ptr,size,retval)             \
-do {                                                   \
-       retval = 0;                                     \
-       switch (size) {                                 \
-       case 1:                                         \
-               __put_user_asm(x, ptr, retval, "b");    \
-               break;                                  \
-       case 2:                                         \
-               __put_user_asm(x, ptr, retval, "w");    \
-               break;                                  \
-       case 4:                                         \
-               __put_user_asm((u32)x, ptr,             \
-                              retval, "l");            \
-               break;                                  \
-       case 8:                                         \
-               __put_user_u64(x, ptr, retval);         \
-               break;                                  \
-       default:                                        \
-               __put_user_unknown();                   \
-       }                                               \
-} while (0)
-
-#ifdef CONFIG_MMU
-#define __put_user_asm(x, addr, err, insn)                     \
-do {                                                           \
-       __asm__ __volatile__ (                                  \
-               "1:\n\t"                                        \
-               "mov." insn "   %1, %2\n\t"                     \
-               "2:\n"                                          \
-               ".section       .fixup,\"ax\"\n"                \
-               "3:\n\t"                                        \
-               "mov.l  4f, %0\n\t"                             \
-               "jmp    @%0\n\t"                                \
-               " mov   %3, %0\n\t"                             \
-               ".balign        4\n"                            \
-               "4:     .long   2b\n\t"                         \
-               ".previous\n"                                   \
-               ".section       __ex_table,\"a\"\n\t"           \
-               ".long  1b, 3b\n\t"                             \
-               ".previous"                                     \
-               : "=&r" (err)                                   \
-               : "r" (x), "m" (__m(addr)), "i" (-EFAULT),      \
-                 "0" (err)                                     \
-               : "memory"                                      \
-       );                                                      \
-} while (0)
-#else
-#define __put_user_asm(x, addr, err, insn)             \
-do {                                                   \
-       __asm__ __volatile__ (                          \
-               "mov." insn "   %0, %1\n\t"             \
-               : /* no outputs */                      \
-               : "r" (x), "m" (__m(addr))              \
-               : "memory"                              \
-       );                                              \
-} while (0)
-#endif /* CONFIG_MMU */
-
-#if defined(CONFIG_CPU_LITTLE_ENDIAN)
-#define __put_user_u64(val,addr,retval) \
-({ \
-__asm__ __volatile__( \
-       "1:\n\t" \
-       "mov.l  %R1,%2\n\t" \
-       "mov.l  %S1,%T2\n\t" \
-       "2:\n" \
-       ".section       .fixup,\"ax\"\n" \
-       "3:\n\t" \
-       "mov.l  4f,%0\n\t" \
-       "jmp    @%0\n\t" \
-       " mov   %3,%0\n\t" \
-       ".balign        4\n" \
-       "4:     .long   2b\n\t" \
-       ".previous\n" \
-       ".section       __ex_table,\"a\"\n\t" \
-       ".long  1b, 3b\n\t" \
-       ".previous" \
-       : "=r" (retval) \
-       : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
-        : "memory"); })
-#else
-#define __put_user_u64(val,addr,retval) \
-({ \
-__asm__ __volatile__( \
-       "1:\n\t" \
-       "mov.l  %S1,%2\n\t" \
-       "mov.l  %R1,%T2\n\t" \
-       "2:\n" \
-       ".section       .fixup,\"ax\"\n" \
-       "3:\n\t" \
-       "mov.l  4f,%0\n\t" \
-       "jmp    @%0\n\t" \
-       " mov   %3,%0\n\t" \
-       ".balign        4\n" \
-       "4:     .long   2b\n\t" \
-       ".previous\n" \
-       ".section       __ex_table,\"a\"\n\t" \
-       ".long  1b, 3b\n\t" \
-       ".previous" \
-       : "=r" (retval) \
-       : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
-        : "memory"); })
-#endif
-
-extern void __put_user_unknown(void);
-
-static inline int
-__strncpy_from_user(unsigned long __dest, unsigned long __user __src, int __count)
-{
-       __kernel_size_t res;
-       unsigned long __dummy, _d, _s, _c;
-
-       __asm__ __volatile__(
-               "9:\n"
-               "mov.b  @%2+, %1\n\t"
-               "cmp/eq #0, %1\n\t"
-               "bt/s   2f\n"
-               "1:\n"
-               "mov.b  %1, @%3\n\t"
-               "dt     %4\n\t"
-               "bf/s   9b\n\t"
-               " add   #1, %3\n\t"
-               "2:\n\t"
-               "sub    %4, %0\n"
-               "3:\n"
-               ".section .fixup,\"ax\"\n"
-               "4:\n\t"
-               "mov.l  5f, %1\n\t"
-               "jmp    @%1\n\t"
-               " mov   %9, %0\n\t"
-               ".balign 4\n"
-               "5:     .long 3b\n"
-               ".previous\n"
-               ".section __ex_table,\"a\"\n"
-               "       .balign 4\n"
-               "       .long 9b,4b\n"
-               ".previous"
-               : "=r" (res), "=&z" (__dummy), "=r" (_s), "=r" (_d), "=r"(_c)
-               : "0" (__count), "2" (__src), "3" (__dest), "4" (__count),
-                 "i" (-EFAULT)
-               : "memory", "t");
-
-       return res;
-}
-
-/*
- * Return the size of a string (including the ending 0 even when we have
- * exceeded the maximum string length).
- */
-static inline long __strnlen_user(const char __user *__s, long __n)
-{
-       unsigned long res;
-       unsigned long __dummy;
-
-       __asm__ __volatile__(
-               "1:\t"
-               "mov.b  @(%0,%3), %1\n\t"
-               "cmp/eq %4, %0\n\t"
-               "bt/s   2f\n\t"
-               " add   #1, %0\n\t"
-               "tst    %1, %1\n\t"
-               "bf     1b\n\t"
-               "2:\n"
-               ".section .fixup,\"ax\"\n"
-               "3:\n\t"
-               "mov.l  4f, %1\n\t"
-               "jmp    @%1\n\t"
-               " mov   #0, %0\n"
-               ".balign 4\n"
-               "4:     .long 2b\n"
-               ".previous\n"
-               ".section __ex_table,\"a\"\n"
-               "       .balign 4\n"
-               "       .long 1b,3b\n"
-               ".previous"
-               : "=z" (res), "=&r" (__dummy)
-               : "0" (0), "r" (__s), "r" (__n)
-               : "t");
-       return res;
-}
-
-#endif /* __ASM_SH_UACCESS_32_H */
diff --git a/include/asm-sh/uaccess_64.h b/include/asm-sh/uaccess_64.h
deleted file mode 100644 (file)
index 81b3d51..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef __ASM_SH_UACCESS_64_H
-#define __ASM_SH_UACCESS_64_H
-
-/*
- * include/asm-sh/uaccess_64.h
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003, 2004  Paul Mundt
- *
- * User space memory access functions
- *
- * Copyright (C) 1999  Niibe Yutaka
- *
- *  Based on:
- *     MIPS implementation version 1.15 by
- *              Copyright (C) 1996, 1997, 1998 by Ralf Baechle
- *     and i386 version.
- *
- * 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.
- */
-
-#define __get_user_size(x,ptr,size,retval)                     \
-do {                                                           \
-       retval = 0;                                             \
-       switch (size) {                                         \
-       case 1:                                                 \
-               retval = __get_user_asm_b(x, ptr);              \
-               break;                                          \
-       case 2:                                                 \
-               retval = __get_user_asm_w(x, ptr);              \
-               break;                                          \
-       case 4:                                                 \
-               retval = __get_user_asm_l(x, ptr);              \
-               break;                                          \
-       case 8:                                                 \
-               retval = __get_user_asm_q(x, ptr);              \
-               break;                                          \
-       default:                                                \
-               __get_user_unknown();                           \
-               break;                                          \
-       }                                                       \
-} while (0)
-
-extern long __get_user_asm_b(void *, long);
-extern long __get_user_asm_w(void *, long);
-extern long __get_user_asm_l(void *, long);
-extern long __get_user_asm_q(void *, long);
-extern void __get_user_unknown(void);
-
-#define __put_user_size(x,ptr,size,retval)                     \
-do {                                                           \
-       retval = 0;                                             \
-       switch (size) {                                         \
-       case 1:                                                 \
-               retval = __put_user_asm_b(x, ptr);              \
-               break;                                          \
-       case 2:                                                 \
-               retval = __put_user_asm_w(x, ptr);              \
-               break;                                          \
-       case 4:                                                 \
-               retval = __put_user_asm_l(x, ptr);              \
-               break;                                          \
-       case 8:                                                 \
-               retval = __put_user_asm_q(x, ptr);              \
-               break;                                          \
-       default:                                                \
-               __put_user_unknown();                           \
-       }                                                       \
-} while (0)
-
-extern long __put_user_asm_b(void *, long);
-extern long __put_user_asm_w(void *, long);
-extern long __put_user_asm_l(void *, long);
-extern long __put_user_asm_q(void *, long);
-extern void __put_user_unknown(void);
-
-#endif /* __ASM_SH_UACCESS_64_H */
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h
deleted file mode 100644 (file)
index 56f4e30..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * include/asm-sh/ubc.h
- *
- * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_UBC_H
-#define __ASM_SH_UBC_H
-#ifdef __KERNEL__
-
-#include <asm/cpu/ubc.h>
-
-/* User Break Controller */
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
-#define UBC_TYPE_SH7729        (current_cpu_data.type == CPU_SH7729)
-#else
-#define UBC_TYPE_SH7729        0
-#endif
-
-#define BAMR_ASID              (1 << 2)
-#define BAMR_NONE              0
-#define BAMR_10                        0x1
-#define BAMR_12                        0x2
-#define BAMR_ALL               0x3
-#define BAMR_16                        0x8
-#define BAMR_20                        0x9
-
-#define BBR_INST               (1 << 4)
-#define BBR_DATA               (2 << 4)
-#define BBR_READ               (1 << 2)
-#define BBR_WRITE              (2 << 2)
-#define BBR_BYTE               0x1
-#define BBR_HALF               0x2
-#define BBR_LONG               0x3
-#define BBR_QUAD               (1 << 6)        /* SH7750 */
-#define BBR_CPU                        (1 << 6)        /* SH7709A,SH7729 */
-#define BBR_DMA                        (2 << 6)        /* SH7709A,SH7729 */
-
-#define BRCR_CMFA              (1 << 15)
-#define BRCR_CMFB              (1 << 14)
-#define BRCR_PCTE              (1 << 11)
-#define BRCR_PCBA              (1 << 10)       /* 1: after execution */
-#define BRCR_DBEB              (1 << 7)
-#define BRCR_PCBB              (1 << 6)
-#define BRCR_SEQ               (1 << 3)
-#define BRCR_UBDE              (1 << 0)
-
-#ifndef __ASSEMBLY__
-/* arch/sh/kernel/cpu/ubc.S */
-extern void ubc_sleep(void);
-
-#ifdef CONFIG_UBC_WAKEUP
-extern void ubc_wakeup(void);
-#else
-#define ubc_wakeup()   do { } while (0)
-#endif
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_UBC_H */
diff --git a/include/asm-sh/ucontext.h b/include/asm-sh/ucontext.h
deleted file mode 100644 (file)
index 202ef1d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __ASM_SH_UCONTEXT_H
-#define __ASM_SH_UCONTEXT_H
-
-struct ucontext {
-       unsigned long     uc_flags;
-       struct ucontext  *uc_link;
-       stack_t           uc_stack;
-       struct sigcontext uc_mcontext;
-       sigset_t          uc_sigmask;   /* mask last for extensibility */
-};
-
-#endif /* __ASM_SH_UCONTEXT_H */
diff --git a/include/asm-sh/unaligned.h b/include/asm-sh/unaligned.h
deleted file mode 100644 (file)
index c1641a0..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_SH_UNALIGNED_H
-#define _ASM_SH_UNALIGNED_H
-
-/* SH can't handle unaligned accesses. */
-#ifdef __LITTLE_ENDIAN__
-# 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
-#else
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#endif
-
-#endif /* _ASM_SH_UNALIGNED_H */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
deleted file mode 100644 (file)
index 65be656..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifdef __KERNEL__
-# ifdef CONFIG_SUPERH32
-#  include "unistd_32.h"
-# else
-#  include "unistd_64.h"
-# endif
-#else
-# ifdef __SH5__
-#  include "unistd_64.h"
-# else
-#  include "unistd_32.h"
-# endif
-#endif
diff --git a/include/asm-sh/unistd_32.h b/include/asm-sh/unistd_32.h
deleted file mode 100644 (file)
index d52c000..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-#ifndef __ASM_SH_UNISTD_H
-#define __ASM_SH_UNISTD_H
-
-/*
- * Copyright (C) 1999  Niibe Yutaka
- */
-
-/*
- * This file contains the system call numbers.
- */
-
-#define __NR_restart_syscall     0
-#define __NR_exit                1
-#define __NR_fork                2
-#define __NR_read                3
-#define __NR_write               4
-#define __NR_open                5
-#define __NR_close               6
-#define __NR_waitpid             7
-#define __NR_creat               8
-#define __NR_link                9
-#define __NR_unlink             10
-#define __NR_execve             11
-#define __NR_chdir              12
-#define __NR_time               13
-#define __NR_mknod              14
-#define __NR_chmod              15
-#define __NR_lchown             16
-#define __NR_break              17
-#define __NR_oldstat            18
-#define __NR_lseek              19
-#define __NR_getpid             20
-#define __NR_mount              21
-#define __NR_umount             22
-#define __NR_setuid             23
-#define __NR_getuid             24
-#define __NR_stime              25
-#define __NR_ptrace             26
-#define __NR_alarm              27
-#define __NR_oldfstat           28
-#define __NR_pause              29
-#define __NR_utime              30
-#define __NR_stty               31
-#define __NR_gtty               32
-#define __NR_access             33
-#define __NR_nice               34
-#define __NR_ftime              35
-#define __NR_sync               36
-#define __NR_kill               37
-#define __NR_rename             38
-#define __NR_mkdir              39
-#define __NR_rmdir              40
-#define __NR_dup                41
-#define __NR_pipe               42
-#define __NR_times              43
-#define __NR_prof               44
-#define __NR_brk                45
-#define __NR_setgid             46
-#define __NR_getgid             47
-#define __NR_signal             48
-#define __NR_geteuid            49
-#define __NR_getegid            50
-#define __NR_acct               51
-#define __NR_umount2            52
-#define __NR_lock               53
-#define __NR_ioctl              54
-#define __NR_fcntl              55
-#define __NR_mpx                56
-#define __NR_setpgid            57
-#define __NR_ulimit             58
-#define __NR_oldolduname        59
-#define __NR_umask              60
-#define __NR_chroot             61
-#define __NR_ustat              62
-#define __NR_dup2               63
-#define __NR_getppid            64
-#define __NR_getpgrp            65
-#define __NR_setsid             66
-#define __NR_sigaction          67
-#define __NR_sgetmask           68
-#define __NR_ssetmask           69
-#define __NR_setreuid           70
-#define __NR_setregid           71
-#define __NR_sigsuspend                 72
-#define __NR_sigpending                 73
-#define __NR_sethostname        74
-#define __NR_setrlimit          75
-#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
-#define __NR_getrusage          77
-#define __NR_gettimeofday       78
-#define __NR_settimeofday       79
-#define __NR_getgroups          80
-#define __NR_setgroups          81
-#define __NR_select             82
-#define __NR_symlink            83
-#define __NR_oldlstat           84
-#define __NR_readlink           85
-#define __NR_uselib             86
-#define __NR_swapon             87
-#define __NR_reboot             88
-#define __NR_readdir            89
-#define __NR_mmap               90
-#define __NR_munmap             91
-#define __NR_truncate           92
-#define __NR_ftruncate          93
-#define __NR_fchmod             94
-#define __NR_fchown             95
-#define __NR_getpriority        96
-#define __NR_setpriority        97
-#define __NR_profil             98
-#define __NR_statfs             99
-#define __NR_fstatfs           100
-#define __NR_ioperm            101
-#define __NR_socketcall                102
-#define __NR_syslog            103
-#define __NR_setitimer         104
-#define __NR_getitimer         105
-#define __NR_stat              106
-#define __NR_lstat             107
-#define __NR_fstat             108
-#define __NR_olduname          109
-#define __NR_iopl              110
-#define __NR_vhangup           111
-#define __NR_idle              112
-#define __NR_vm86old           113
-#define __NR_wait4             114
-#define __NR_swapoff           115
-#define __NR_sysinfo           116
-#define __NR_ipc               117
-#define __NR_fsync             118
-#define __NR_sigreturn         119
-#define __NR_clone             120
-#define __NR_setdomainname     121
-#define __NR_uname             122
-#define __NR_modify_ldt                123
-#define __NR_adjtimex          124
-#define __NR_mprotect          125
-#define __NR_sigprocmask       126
-#define __NR_create_module     127
-#define __NR_init_module       128
-#define __NR_delete_module     129
-#define __NR_get_kernel_syms   130
-#define __NR_quotactl          131
-#define __NR_getpgid           132
-#define __NR_fchdir            133
-#define __NR_bdflush           134
-#define __NR_sysfs             135
-#define __NR_personality       136
-#define __NR_afs_syscall       137 /* Syscall for Andrew File System */
-#define __NR_setfsuid          138
-#define __NR_setfsgid          139
-#define __NR__llseek           140
-#define __NR_getdents          141
-#define __NR__newselect                142
-#define __NR_flock             143
-#define __NR_msync             144
-#define __NR_readv             145
-#define __NR_writev            146
-#define __NR_getsid            147
-#define __NR_fdatasync         148
-#define __NR__sysctl           149
-#define __NR_mlock             150
-#define __NR_munlock           151
-#define __NR_mlockall          152
-#define __NR_munlockall                153
-#define __NR_sched_setparam            154
-#define __NR_sched_getparam            155
-#define __NR_sched_setscheduler                156
-#define __NR_sched_getscheduler                157
-#define __NR_sched_yield               158
-#define __NR_sched_get_priority_max    159
-#define __NR_sched_get_priority_min    160
-#define __NR_sched_rr_get_interval     161
-#define __NR_nanosleep         162
-#define __NR_mremap            163
-#define __NR_setresuid         164
-#define __NR_getresuid         165
-#define __NR_vm86              166
-#define __NR_query_module      167
-#define __NR_poll              168
-#define __NR_nfsservctl                169
-#define __NR_setresgid         170
-#define __NR_getresgid         171
-#define __NR_prctl              172
-#define __NR_rt_sigreturn      173
-#define __NR_rt_sigaction      174
-#define __NR_rt_sigprocmask    175
-#define __NR_rt_sigpending     176
-#define __NR_rt_sigtimedwait   177
-#define __NR_rt_sigqueueinfo   178
-#define __NR_rt_sigsuspend     179
-#define __NR_pread64           180
-#define __NR_pwrite64          181
-#define __NR_chown             182
-#define __NR_getcwd            183
-#define __NR_capget            184
-#define __NR_capset            185
-#define __NR_sigaltstack       186
-#define __NR_sendfile          187
-#define __NR_streams1          188     /* some people actually want it */
-#define __NR_streams2          189     /* some people actually want it */
-#define __NR_vfork             190
-#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
-#define __NR_mmap2             192
-#define __NR_truncate64                193
-#define __NR_ftruncate64       194
-#define __NR_stat64            195
-#define __NR_lstat64           196
-#define __NR_fstat64           197
-#define __NR_lchown32          198
-#define __NR_getuid32          199
-#define __NR_getgid32          200
-#define __NR_geteuid32         201
-#define __NR_getegid32         202
-#define __NR_setreuid32                203
-#define __NR_setregid32                204
-#define __NR_getgroups32       205
-#define __NR_setgroups32       206
-#define __NR_fchown32          207
-#define __NR_setresuid32       208
-#define __NR_getresuid32       209
-#define __NR_setresgid32       210
-#define __NR_getresgid32       211
-#define __NR_chown32           212
-#define __NR_setuid32          213
-#define __NR_setgid32          214
-#define __NR_setfsuid32                215
-#define __NR_setfsgid32                216
-#define __NR_pivot_root                217
-#define __NR_mincore           218
-#define __NR_madvise           219
-#define __NR_getdents64                220
-#define __NR_fcntl64           221
-/* 223 is unused */
-#define __NR_gettid            224
-#define __NR_readahead         225
-#define __NR_setxattr          226
-#define __NR_lsetxattr         227
-#define __NR_fsetxattr         228
-#define __NR_getxattr          229
-#define __NR_lgetxattr         230
-#define __NR_fgetxattr         231
-#define __NR_listxattr         232
-#define __NR_llistxattr                233
-#define __NR_flistxattr                234
-#define __NR_removexattr       235
-#define __NR_lremovexattr      236
-#define __NR_fremovexattr      237
-#define __NR_tkill             238
-#define __NR_sendfile64                239
-#define __NR_futex             240
-#define __NR_sched_setaffinity 241
-#define __NR_sched_getaffinity 242
-#define __NR_set_thread_area   243
-#define __NR_get_thread_area   244
-#define __NR_io_setup          245
-#define __NR_io_destroy                246
-#define __NR_io_getevents      247
-#define __NR_io_submit         248
-#define __NR_io_cancel         249
-#define __NR_fadvise64         250
-
-#define __NR_exit_group                252
-#define __NR_lookup_dcookie    253
-#define __NR_epoll_create      254
-#define __NR_epoll_ctl         255
-#define __NR_epoll_wait                256
-#define __NR_remap_file_pages  257
-#define __NR_set_tid_address   258
-#define __NR_timer_create      259
-#define __NR_timer_settime     (__NR_timer_create+1)
-#define __NR_timer_gettime     (__NR_timer_create+2)
-#define __NR_timer_getoverrun  (__NR_timer_create+3)
-#define __NR_timer_delete      (__NR_timer_create+4)
-#define __NR_clock_settime     (__NR_timer_create+5)
-#define __NR_clock_gettime     (__NR_timer_create+6)
-#define __NR_clock_getres      (__NR_timer_create+7)
-#define __NR_clock_nanosleep   (__NR_timer_create+8)
-#define __NR_statfs64          268
-#define __NR_fstatfs64         269
-#define __NR_tgkill            270
-#define __NR_utimes            271
-#define __NR_fadvise64_64      272
-#define __NR_vserver           273
-#define __NR_mbind              274
-#define __NR_get_mempolicy      275
-#define __NR_set_mempolicy      276
-#define __NR_mq_open            277
-#define __NR_mq_unlink          (__NR_mq_open+1)
-#define __NR_mq_timedsend       (__NR_mq_open+2)
-#define __NR_mq_timedreceive    (__NR_mq_open+3)
-#define __NR_mq_notify          (__NR_mq_open+4)
-#define __NR_mq_getsetattr      (__NR_mq_open+5)
-#define __NR_kexec_load                283
-#define __NR_waitid            284
-#define __NR_add_key           285
-#define __NR_request_key       286
-#define __NR_keyctl            287
-#define __NR_ioprio_set                288
-#define __NR_ioprio_get                289
-#define __NR_inotify_init      290
-#define __NR_inotify_add_watch 291
-#define __NR_inotify_rm_watch  292
-/* 293 is unused */
-#define __NR_migrate_pages     294
-#define __NR_openat            295
-#define __NR_mkdirat           296
-#define __NR_mknodat           297
-#define __NR_fchownat          298
-#define __NR_futimesat         299
-#define __NR_fstatat64         300
-#define __NR_unlinkat          301
-#define __NR_renameat          302
-#define __NR_linkat            303
-#define __NR_symlinkat         304
-#define __NR_readlinkat                305
-#define __NR_fchmodat          306
-#define __NR_faccessat         307
-#define __NR_pselect6          308
-#define __NR_ppoll             309
-#define __NR_unshare           310
-#define __NR_set_robust_list   311
-#define __NR_get_robust_list   312
-#define __NR_splice            313
-#define __NR_sync_file_range   314
-#define __NR_tee               315
-#define __NR_vmsplice          316
-#define __NR_move_pages                317
-#define __NR_getcpu            318
-#define __NR_epoll_pwait       319
-#define __NR_utimensat         320
-#define __NR_signalfd          321
-#define __NR_timerfd_create    322
-#define __NR_eventfd           323
-#define __NR_fallocate         324
-#define __NR_timerfd_settime   325
-#define __NR_timerfd_gettime   326
-#define __NR_signalfd4         327
-#define __NR_eventfd2          328
-#define __NR_epoll_create1     329
-#define __NR_dup3              330
-#define __NR_pipe2             331
-#define __NR_inotify_init1     332
-
-#define NR_syscalls 333
-
-#ifdef __KERNEL__
-
-#define __ARCH_WANT_IPC_PARSE_VERSION
-#define __ARCH_WANT_OLD_READDIR
-#define __ARCH_WANT_OLD_STAT
-#define __ARCH_WANT_STAT64
-#define __ARCH_WANT_SYS_ALARM
-#define __ARCH_WANT_SYS_GETHOSTNAME
-#define __ARCH_WANT_SYS_PAUSE
-#define __ARCH_WANT_SYS_SGETMASK
-#define __ARCH_WANT_SYS_SIGNAL
-#define __ARCH_WANT_SYS_TIME
-#define __ARCH_WANT_SYS_UTIME
-#define __ARCH_WANT_SYS_WAITPID
-#define __ARCH_WANT_SYS_SOCKETCALL
-#define __ARCH_WANT_SYS_FADVISE64
-#define __ARCH_WANT_SYS_GETPGRP
-#define __ARCH_WANT_SYS_LLSEEK
-#define __ARCH_WANT_SYS_NICE
-#define __ARCH_WANT_SYS_OLD_GETRLIMIT
-#define __ARCH_WANT_SYS_OLDUMOUNT
-#define __ARCH_WANT_SYS_SIGPENDING
-#define __ARCH_WANT_SYS_SIGPROCMASK
-#define __ARCH_WANT_SYS_RT_SIGACTION
-#define __ARCH_WANT_SYS_RT_SIGSUSPEND
-
-/*
- * "Conditional" syscalls
- *
- * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
- * but it doesn't work on all toolchains, so we just do it by hand
- */
-#ifndef cond_syscall
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_UNISTD_H */
diff --git a/include/asm-sh/unistd_64.h b/include/asm-sh/unistd_64.h
deleted file mode 100644 (file)
index 7c54e91..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-#ifndef __ASM_SH_UNISTD_64_H
-#define __ASM_SH_UNISTD_64_H
-
-/*
- * include/asm-sh/unistd_64.h
- *
- * This file contains the system call numbers.
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003 - 2007 Paul Mundt
- * Copyright (C) 2004  Sean McGoogan
- *
- * 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.
- */
-#define __NR_restart_syscall     0
-#define __NR_exit                1
-#define __NR_fork                2
-#define __NR_read                3
-#define __NR_write               4
-#define __NR_open                5
-#define __NR_close               6
-#define __NR_waitpid             7
-#define __NR_creat               8
-#define __NR_link                9
-#define __NR_unlink             10
-#define __NR_execve             11
-#define __NR_chdir              12
-#define __NR_time               13
-#define __NR_mknod              14
-#define __NR_chmod              15
-#define __NR_lchown             16
-#define __NR_break              17
-#define __NR_oldstat            18
-#define __NR_lseek              19
-#define __NR_getpid             20
-#define __NR_mount              21
-#define __NR_umount             22
-#define __NR_setuid             23
-#define __NR_getuid             24
-#define __NR_stime              25
-#define __NR_ptrace             26
-#define __NR_alarm              27
-#define __NR_oldfstat           28
-#define __NR_pause              29
-#define __NR_utime              30
-#define __NR_stty               31
-#define __NR_gtty               32
-#define __NR_access             33
-#define __NR_nice               34
-#define __NR_ftime              35
-#define __NR_sync               36
-#define __NR_kill               37
-#define __NR_rename             38
-#define __NR_mkdir              39
-#define __NR_rmdir              40
-#define __NR_dup                41
-#define __NR_pipe               42
-#define __NR_times              43
-#define __NR_prof               44
-#define __NR_brk                45
-#define __NR_setgid             46
-#define __NR_getgid             47
-#define __NR_signal             48
-#define __NR_geteuid            49
-#define __NR_getegid            50
-#define __NR_acct               51
-#define __NR_umount2            52
-#define __NR_lock               53
-#define __NR_ioctl              54
-#define __NR_fcntl              55
-#define __NR_mpx                56
-#define __NR_setpgid            57
-#define __NR_ulimit             58
-#define __NR_oldolduname        59
-#define __NR_umask              60
-#define __NR_chroot             61
-#define __NR_ustat              62
-#define __NR_dup2               63
-#define __NR_getppid            64
-#define __NR_getpgrp            65
-#define __NR_setsid             66
-#define __NR_sigaction          67
-#define __NR_sgetmask           68
-#define __NR_ssetmask           69
-#define __NR_setreuid           70
-#define __NR_setregid           71
-#define __NR_sigsuspend                 72
-#define __NR_sigpending                 73
-#define __NR_sethostname        74
-#define __NR_setrlimit          75
-#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
-#define __NR_getrusage          77
-#define __NR_gettimeofday       78
-#define __NR_settimeofday       79
-#define __NR_getgroups          80
-#define __NR_setgroups          81
-#define __NR_select             82
-#define __NR_symlink            83
-#define __NR_oldlstat           84
-#define __NR_readlink           85
-#define __NR_uselib             86
-#define __NR_swapon             87
-#define __NR_reboot             88
-#define __NR_readdir            89
-#define __NR_mmap               90
-#define __NR_munmap             91
-#define __NR_truncate           92
-#define __NR_ftruncate          93
-#define __NR_fchmod             94
-#define __NR_fchown             95
-#define __NR_getpriority        96
-#define __NR_setpriority        97
-#define __NR_profil             98
-#define __NR_statfs             99
-#define __NR_fstatfs           100
-#define __NR_ioperm            101
-#define __NR_socketcall                102     /* old implementation of socket systemcall */
-#define __NR_syslog            103
-#define __NR_setitimer         104
-#define __NR_getitimer         105
-#define __NR_stat              106
-#define __NR_lstat             107
-#define __NR_fstat             108
-#define __NR_olduname          109
-#define __NR_iopl              110
-#define __NR_vhangup           111
-#define __NR_idle              112
-#define __NR_vm86old           113
-#define __NR_wait4             114
-#define __NR_swapoff           115
-#define __NR_sysinfo           116
-#define __NR_ipc               117
-#define __NR_fsync             118
-#define __NR_sigreturn         119
-#define __NR_clone             120
-#define __NR_setdomainname     121
-#define __NR_uname             122
-#define __NR_modify_ldt                123
-#define __NR_adjtimex          124
-#define __NR_mprotect          125
-#define __NR_sigprocmask       126
-#define __NR_create_module     127
-#define __NR_init_module       128
-#define __NR_delete_module     129
-#define __NR_get_kernel_syms   130
-#define __NR_quotactl          131
-#define __NR_getpgid           132
-#define __NR_fchdir            133
-#define __NR_bdflush           134
-#define __NR_sysfs             135
-#define __NR_personality       136
-#define __NR_afs_syscall       137 /* Syscall for Andrew File System */
-#define __NR_setfsuid          138
-#define __NR_setfsgid          139
-#define __NR__llseek           140
-#define __NR_getdents          141
-#define __NR__newselect                142
-#define __NR_flock             143
-#define __NR_msync             144
-#define __NR_readv             145
-#define __NR_writev            146
-#define __NR_getsid            147
-#define __NR_fdatasync         148
-#define __NR__sysctl           149
-#define __NR_mlock             150
-#define __NR_munlock           151
-#define __NR_mlockall          152
-#define __NR_munlockall                153
-#define __NR_sched_setparam            154
-#define __NR_sched_getparam            155
-#define __NR_sched_setscheduler                156
-#define __NR_sched_getscheduler                157
-#define __NR_sched_yield               158
-#define __NR_sched_get_priority_max    159
-#define __NR_sched_get_priority_min    160
-#define __NR_sched_rr_get_interval     161
-#define __NR_nanosleep         162
-#define __NR_mremap            163
-#define __NR_setresuid         164
-#define __NR_getresuid         165
-#define __NR_vm86              166
-#define __NR_query_module      167
-#define __NR_poll              168
-#define __NR_nfsservctl                169
-#define __NR_setresgid         170
-#define __NR_getresgid         171
-#define __NR_prctl              172
-#define __NR_rt_sigreturn      173
-#define __NR_rt_sigaction      174
-#define __NR_rt_sigprocmask    175
-#define __NR_rt_sigpending     176
-#define __NR_rt_sigtimedwait   177
-#define __NR_rt_sigqueueinfo   178
-#define __NR_rt_sigsuspend     179
-#define __NR_pread64           180
-#define __NR_pwrite64          181
-#define __NR_chown             182
-#define __NR_getcwd            183
-#define __NR_capget            184
-#define __NR_capset            185
-#define __NR_sigaltstack       186
-#define __NR_sendfile          187
-#define __NR_streams1          188     /* some people actually want it */
-#define __NR_streams2          189     /* some people actually want it */
-#define __NR_vfork             190
-#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
-#define __NR_mmap2             192
-#define __NR_truncate64                193
-#define __NR_ftruncate64       194
-#define __NR_stat64            195
-#define __NR_lstat64           196
-#define __NR_fstat64           197
-#define __NR_lchown32          198
-#define __NR_getuid32          199
-#define __NR_getgid32          200
-#define __NR_geteuid32         201
-#define __NR_getegid32         202
-#define __NR_setreuid32                203
-#define __NR_setregid32                204
-#define __NR_getgroups32       205
-#define __NR_setgroups32       206
-#define __NR_fchown32          207
-#define __NR_setresuid32       208
-#define __NR_getresuid32       209
-#define __NR_setresgid32       210
-#define __NR_getresgid32       211
-#define __NR_chown32           212
-#define __NR_setuid32          213
-#define __NR_setgid32          214
-#define __NR_setfsuid32                215
-#define __NR_setfsgid32                216
-#define __NR_pivot_root                217
-#define __NR_mincore           218
-#define __NR_madvise           219
-
-/* Non-multiplexed socket family */
-#define __NR_socket            220
-#define __NR_bind              221
-#define __NR_connect           222
-#define __NR_listen            223
-#define __NR_accept            224
-#define __NR_getsockname       225
-#define __NR_getpeername       226
-#define __NR_socketpair                227
-#define __NR_send              228
-#define __NR_sendto            229
-#define __NR_recv              230
-#define __NR_recvfrom          231
-#define __NR_shutdown          232
-#define __NR_setsockopt                233
-#define __NR_getsockopt                234
-#define __NR_sendmsg           235
-#define __NR_recvmsg           236
-
-/* Non-multiplexed IPC family */
-#define __NR_semop             237
-#define __NR_semget            238
-#define __NR_semctl            239
-#define __NR_msgsnd            240
-#define __NR_msgrcv            241
-#define __NR_msgget            242
-#define __NR_msgctl            243
-#if 0
-#define __NR_shmatcall         244
-#endif
-#define __NR_shmdt             245
-#define __NR_shmget            246
-#define __NR_shmctl            247
-
-#define __NR_getdents64                248
-#define __NR_fcntl64           249
-/* 223 is unused */
-#define __NR_gettid            252
-#define __NR_readahead         253
-#define __NR_setxattr          254
-#define __NR_lsetxattr         255
-#define __NR_fsetxattr         256
-#define __NR_getxattr          257
-#define __NR_lgetxattr         258
-#define __NR_fgetxattr         269
-#define __NR_listxattr         260
-#define __NR_llistxattr                261
-#define __NR_flistxattr                262
-#define __NR_removexattr       263
-#define __NR_lremovexattr      264
-#define __NR_fremovexattr      265
-#define __NR_tkill             266
-#define __NR_sendfile64                267
-#define __NR_futex             268
-#define __NR_sched_setaffinity 269
-#define __NR_sched_getaffinity 270
-#define __NR_set_thread_area   271
-#define __NR_get_thread_area   272
-#define __NR_io_setup          273
-#define __NR_io_destroy                274
-#define __NR_io_getevents      275
-#define __NR_io_submit         276
-#define __NR_io_cancel         277
-#define __NR_fadvise64         278
-#define __NR_exit_group                280
-
-#define __NR_lookup_dcookie    281
-#define __NR_epoll_create      282
-#define __NR_epoll_ctl         283
-#define __NR_epoll_wait                284
-#define __NR_remap_file_pages  285
-#define __NR_set_tid_address   286
-#define __NR_timer_create      287
-#define __NR_timer_settime     (__NR_timer_create+1)
-#define __NR_timer_gettime     (__NR_timer_create+2)
-#define __NR_timer_getoverrun  (__NR_timer_create+3)
-#define __NR_timer_delete      (__NR_timer_create+4)
-#define __NR_clock_settime     (__NR_timer_create+5)
-#define __NR_clock_gettime     (__NR_timer_create+6)
-#define __NR_clock_getres      (__NR_timer_create+7)
-#define __NR_clock_nanosleep   (__NR_timer_create+8)
-#define __NR_statfs64          296
-#define __NR_fstatfs64         297
-#define __NR_tgkill            298
-#define __NR_utimes            299
-#define __NR_fadvise64_64      300
-#define __NR_vserver           301
-#define __NR_mbind              302
-#define __NR_get_mempolicy      303
-#define __NR_set_mempolicy      304
-#define __NR_mq_open            305
-#define __NR_mq_unlink          (__NR_mq_open+1)
-#define __NR_mq_timedsend       (__NR_mq_open+2)
-#define __NR_mq_timedreceive    (__NR_mq_open+3)
-#define __NR_mq_notify          (__NR_mq_open+4)
-#define __NR_mq_getsetattr      (__NR_mq_open+5)
-#define __NR_kexec_load                311
-#define __NR_waitid            312
-#define __NR_add_key           313
-#define __NR_request_key       314
-#define __NR_keyctl            315
-#define __NR_ioprio_set                316
-#define __NR_ioprio_get                317
-#define __NR_inotify_init      318
-#define __NR_inotify_add_watch 319
-#define __NR_inotify_rm_watch  320
-/* 321 is unused */
-#define __NR_migrate_pages     322
-#define __NR_openat            323
-#define __NR_mkdirat           324
-#define __NR_mknodat           325
-#define __NR_fchownat          326
-#define __NR_futimesat         327
-#define __NR_fstatat64         328
-#define __NR_unlinkat          329
-#define __NR_renameat          330
-#define __NR_linkat            331
-#define __NR_symlinkat         332
-#define __NR_readlinkat                333
-#define __NR_fchmodat          334
-#define __NR_faccessat         335
-#define __NR_pselect6          336
-#define __NR_ppoll             337
-#define __NR_unshare           338
-#define __NR_set_robust_list   339
-#define __NR_get_robust_list   340
-#define __NR_splice            341
-#define __NR_sync_file_range   342
-#define __NR_tee               343
-#define __NR_vmsplice          344
-#define __NR_move_pages                345
-#define __NR_getcpu            346
-#define __NR_epoll_pwait       347
-#define __NR_utimensat         348
-#define __NR_signalfd          349
-#define __NR_timerfd_create    350
-#define __NR_eventfd           351
-#define __NR_fallocate         352
-#define __NR_timerfd_settime   353
-#define __NR_timerfd_gettime   354
-#define __NR_signalfd4         355
-#define __NR_eventfd2          356
-#define __NR_epoll_create1     357
-#define __NR_dup3              358
-#define __NR_pipe2             359
-#define __NR_inotify_init1     360
-
-#ifdef __KERNEL__
-
-#define NR_syscalls 361
-
-#define __ARCH_WANT_IPC_PARSE_VERSION
-#define __ARCH_WANT_OLD_READDIR
-#define __ARCH_WANT_OLD_STAT
-#define __ARCH_WANT_STAT64
-#define __ARCH_WANT_SYS_ALARM
-#define __ARCH_WANT_SYS_GETHOSTNAME
-#define __ARCH_WANT_SYS_PAUSE
-#define __ARCH_WANT_SYS_SGETMASK
-#define __ARCH_WANT_SYS_SIGNAL
-#define __ARCH_WANT_SYS_TIME
-#define __ARCH_WANT_SYS_UTIME
-#define __ARCH_WANT_SYS_WAITPID
-#define __ARCH_WANT_SYS_SOCKETCALL
-#define __ARCH_WANT_SYS_FADVISE64
-#define __ARCH_WANT_SYS_GETPGRP
-#define __ARCH_WANT_SYS_LLSEEK
-#define __ARCH_WANT_SYS_NICE
-#define __ARCH_WANT_SYS_OLD_GETRLIMIT
-#define __ARCH_WANT_SYS_OLDUMOUNT
-#define __ARCH_WANT_SYS_SIGPENDING
-#define __ARCH_WANT_SYS_SIGPROCMASK
-#define __ARCH_WANT_SYS_RT_SIGACTION
-
-/*
- * "Conditional" syscalls
- *
- * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
- * but it doesn't work on all toolchains, so we just do it by hand
- */
-#ifndef cond_syscall
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
-#endif
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_UNISTD_64_H */
diff --git a/include/asm-sh/user.h b/include/asm-sh/user.h
deleted file mode 100644 (file)
index 8fd3cf6..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef __ASM_SH_USER_H
-#define __ASM_SH_USER_H
-
-#include <asm/ptrace.h>
-#include <asm/page.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).  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.
- */
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-struct user_fpu_struct {
-       unsigned long fp_regs[32];
-       unsigned int fpscr;
-};
-#else
-struct user_fpu_struct {
-       unsigned long fp_regs[16];
-       unsigned long xfp_regs[16];
-       unsigned long fpscr;
-       unsigned long fpul;
-};
-#endif
-
-struct user {
-       struct pt_regs  regs;                   /* entire machine state */
-       struct user_fpu_struct fpu;     /* Math Co-processor registers  */
-       int u_fpvalid;          /* True if math co-processor being used */
-       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 */
-       struct user_fpu_struct* u_fpstate;      /* Math Co-processor pointer */
-       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 /* __ASM_SH_USER_H */
diff --git a/include/asm-sh/vga.h b/include/asm-sh/vga.h
deleted file mode 100644 (file)
index 06a5de8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_SH_VGA_H
-#define __ASM_SH_VGA_H
-
-/* Stupid drivers. */
-
-#endif /* __ASM_SH_VGA_H */
diff --git a/include/asm-sh/watchdog.h b/include/asm-sh/watchdog.h
deleted file mode 100644 (file)
index d19ea62..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * include/asm-sh/watchdog.h
- *
- * Copyright (C) 2002, 2003 Paul Mundt
- *
- * 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.
- */
-#ifndef __ASM_SH_WATCHDOG_H
-#define __ASM_SH_WATCHDOG_H
-#ifdef __KERNEL__
-
-#include <linux/types.h>
-#include <asm/cpu/watchdog.h>
-#include <asm/io.h>
-
-/* 
- * See asm/cpu-sh2/watchdog.h for explanation of this stupidity..
- */
-#ifndef WTCNT_R
-#  define WTCNT_R      WTCNT
-#endif
-
-#ifndef WTCSR_R
-#  define WTCSR_R      WTCSR
-#endif
-
-#define WTCNT_HIGH     0x5a
-#define WTCSR_HIGH     0xa5
-
-#define WTCSR_CKS2     0x04
-#define WTCSR_CKS1     0x02
-#define WTCSR_CKS0     0x01
-
-/*
- * CKS0-2 supports a number of clock division ratios. At the time the watchdog
- * is enabled, it defaults to a 41 usec overflow period .. we overload this to
- * something a little more reasonable, and really can't deal with anything
- * lower than WTCSR_CKS_1024, else we drop back into the usec range.
- *
- * Clock Division Ratio         Overflow Period
- * --------------------------------------------
- *     1/32 (initial value)       41 usecs
- *     1/64                       82 usecs
- *     1/128                     164 usecs
- *     1/256                     328 usecs
- *     1/512                     656 usecs
- *     1/1024                   1.31 msecs
- *     1/2048                   2.62 msecs
- *     1/4096                   5.25 msecs
- */
-#define WTCSR_CKS_32   0x00
-#define WTCSR_CKS_64   0x01
-#define WTCSR_CKS_128  0x02
-#define WTCSR_CKS_256  0x03
-#define WTCSR_CKS_512  0x04
-#define WTCSR_CKS_1024 0x05
-#define WTCSR_CKS_2048 0x06
-#define WTCSR_CKS_4096 0x07
-
-/**
- *     sh_wdt_read_cnt - Read from Counter
- *     Reads back the WTCNT value.
- */
-static inline __u8 sh_wdt_read_cnt(void)
-{
-       return ctrl_inb(WTCNT_R);
-}
-
-/**
- *     sh_wdt_write_cnt - Write to Counter
- *     @val: Value to write
- *
- *     Writes the given value @val to the lower byte of the timer counter.
- *     The upper byte is set manually on each write.
- */
-static inline void sh_wdt_write_cnt(__u8 val)
-{
-       ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, WTCNT);
-}
-
-/**
- *     sh_wdt_read_csr - Read from Control/Status Register
- *
- *     Reads back the WTCSR value.
- */
-static inline __u8 sh_wdt_read_csr(void)
-{
-       return ctrl_inb(WTCSR_R);
-}
-
-/**
- *     sh_wdt_write_csr - Write to Control/Status Register
- *     @val: Value to write
- *
- *     Writes the given value @val to the lower byte of the control/status
- *     register. The upper byte is set manually on each write.
- */
-static inline void sh_wdt_write_csr(__u8 val)
-{
-       ctrl_outw((WTCSR_HIGH << 8) | (__u16)val, WTCSR);
-}
-
-#endif /* __KERNEL__ */
-#endif /* __ASM_SH_WATCHDOG_H */
diff --git a/include/asm-sh/xor.h b/include/asm-sh/xor.h
deleted file mode 100644 (file)
index c82eb12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
index ecc8061904a9ee27210d27efd74dfe4534212fb6..5f888cc5be49a0eb87fab02d32ec050a686d0387 100644 (file)
@@ -7,6 +7,8 @@ extern struct dma_mapping_ops nommu_dma_ops;
 extern int force_iommu, no_iommu;
 extern int iommu_detected;
 
+extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
+
 #ifdef CONFIG_GART_IOMMU
 extern int gart_iommu_aperture;
 extern int gart_iommu_aperture_allowed;
index bc34dc21f178a0381441f49a580e788df7d8d2cd..0f3c531146142df89075e4623c36377510c7489e 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/mm.h>
+#include <linux/mmu_notifier.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
@@ -251,6 +252,7 @@ struct kvm_vcpu_arch {
                gfn_t gfn;      /* presumed gfn during guest pte update */
                pfn_t pfn;      /* pfn corresponding to that gfn */
                int largepage;
+               unsigned long mmu_seq;
        } update_pte;
 
        struct i387_fxsave_struct host_fx_image;
@@ -729,4 +731,8 @@ asmlinkage void kvm_handle_fault_on_reboot(void);
        KVM_EX_ENTRY " 666b, 667b \n\t" \
        ".popsection"
 
+#define KVM_ARCH_WANT_MMU_NOTIFIER
+int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
+int kvm_age_hva(struct kvm *kvm, unsigned long hva);
+
 #endif
index 4c4142c5aa6ef26839e4acceb8bcb8b009bf5861..a26f565e8189978b490e9b7f4e6265b1f9993811 100644 (file)
@@ -97,6 +97,7 @@ header-y += ioctl.h
 header-y += ip6_tunnel.h
 header-y += ipmi_msgdefs.h
 header-y += ipsec.h
+header-y += ip_vs.h
 header-y += ipx.h
 header-y += irda.h
 header-y += iso_fs.h
index 88d68081a0f159a8fe19bfea00cb95aca161715d..e61f22be4d0ebc186a2778fcf45fbe30251e999a 100644 (file)
@@ -655,6 +655,7 @@ extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
 extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
 extern void blk_requeue_request(struct request_queue *, struct request *);
 extern void blk_plug_device(struct request_queue *);
+extern void blk_plug_device_unlocked(struct request_queue *);
 extern int blk_remove_plug(struct request_queue *);
 extern void blk_recount_segments(struct request_queue *, struct bio *);
 extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
index d62c19ff041ccb64905558f1d634b2d202c968ac..7f627775c947a4a89701092422eae9025cbd7731 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/list.h>
 #include <linux/kref.h>
 #include <linux/mutex.h>
+#include <linux/err.h>
 
 #include <asm/atomic.h>
 
@@ -129,8 +130,25 @@ struct configfs_attribute {
 /*
  * Users often need to create attribute structures for their configurable
  * attributes, containing a configfs_attribute member and function pointers
- * for the show() and store() operations on that attribute. They can use
- * this macro (similar to sysfs' __ATTR) to make defining attributes easier.
+ * for the show() and store() operations on that attribute. If they don't
+ * need anything else on the extended attribute structure, they can use
+ * this macro to define it  The argument _item is the name of the
+ * config_item structure.
+ */
+#define CONFIGFS_ATTR_STRUCT(_item)                                    \
+struct _item##_attribute {                                             \
+       struct configfs_attribute attr;                                 \
+       ssize_t (*show)(struct _item *, char *);                        \
+       ssize_t (*store)(struct _item *, const char *, size_t);         \
+}
+
+/*
+ * With the extended attribute structure, users can use this macro
+ * (similar to sysfs' __ATTR) to make defining attributes easier.
+ * An example:
+ * #define MYITEM_ATTR(_name, _mode, _show, _store)    \
+ * struct myitem_attribute childless_attr_##_name =    \
+ *         __CONFIGFS_ATTR(_name, _mode, _show, _store)
  */
 #define __CONFIGFS_ATTR(_name, _mode, _show, _store)                   \
 {                                                                      \
@@ -142,6 +160,52 @@ struct configfs_attribute {
        .show   = _show,                                                \
        .store  = _store,                                               \
 }
+/* Here is a readonly version, only requiring a show() operation */
+#define __CONFIGFS_ATTR_RO(_name, _show)                               \
+{                                                                      \
+       .attr   = {                                                     \
+                       .ca_name = __stringify(_name),                  \
+                       .ca_mode = 0444,                                \
+                       .ca_owner = THIS_MODULE,                        \
+       },                                                              \
+       .show   = _show,                                                \
+}
+
+/*
+ * With these extended attributes, the simple show_attribute() and
+ * store_attribute() operations need to call the show() and store() of the
+ * attributes.  This is a common pattern, so we provide a macro to define
+ * them.  The argument _item is the name of the config_item structure.
+ * This macro expects the attributes to be named "struct <name>_attribute"
+ * and the function to_<name>() to exist;
+ */
+#define CONFIGFS_ATTR_OPS(_item)                                       \
+static ssize_t _item##_attr_show(struct config_item *item,             \
+                                struct configfs_attribute *attr,       \
+                                char *page)                            \
+{                                                                      \
+       struct _item *_item = to_##_item(item);                         \
+       struct _item##_attribute *_item##_attr =                        \
+               container_of(attr, struct _item##_attribute, attr);     \
+       ssize_t ret = 0;                                                \
+                                                                       \
+       if (_item##_attr->show)                                         \
+               ret = _item##_attr->show(_item, page);                  \
+       return ret;                                                     \
+}                                                                      \
+static ssize_t _item##_attr_store(struct config_item *item,            \
+                                 struct configfs_attribute *attr,      \
+                                 const char *page, size_t count)       \
+{                                                                      \
+       struct _item *_item = to_##_item(item);                         \
+       struct _item##_attribute *_item##_attr =                        \
+               container_of(attr, struct _item##_attribute, attr);     \
+       ssize_t ret = -EINVAL;                                          \
+                                                                       \
+       if (_item##_attr->store)                                        \
+               ret = _item##_attr->store(_item, page, count);          \
+       return ret;                                                     \
+}
 
 /*
  * If allow_link() exists, the item can symlink(2) out to other
index 98202c672fdebf25e3fc9dd3c7362fc3e9d8e5b8..07aa198f19ed993fbffad01d2de5d480a48ea7cf 100644 (file)
@@ -230,6 +230,7 @@ extern void d_delete(struct dentry *);
 extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
 extern struct dentry * d_alloc_anon(struct inode *);
 extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
+extern struct dentry * d_add_ci(struct inode *, struct dentry *, struct qstr *);
 extern void shrink_dcache_sb(struct super_block *);
 extern void shrink_dcache_parent(struct dentry *);
 extern void shrink_dcache_for_umount(struct super_block *);
index 27c64bdc68c961baa821614bbfc6246951393acd..a20259e248a5ac6d641713512d1891e05154abcd 100644 (file)
@@ -34,8 +34,9 @@ extern struct file *fget(unsigned int fd);
 extern struct file *fget_light(unsigned int fd, int *fput_needed);
 extern void set_close_on_exec(unsigned int fd, int flag);
 extern void put_filp(struct file *);
+extern int alloc_fd(unsigned start, unsigned flags);
 extern int get_unused_fd(void);
-extern int get_unused_fd_flags(int flags);
+#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
 extern void put_unused_fd(unsigned int fd);
 
 extern void fd_install(unsigned int fd, struct file *file);
index 2baace2788a7d73cffcd12396ea2aa37dd117963..31d8629e75a15f55ae59d8d4e936dab96f9fa396 100644 (file)
@@ -18,7 +18,7 @@ struct ihex_binrec {
        __be32 addr;
        __be16 len;
        uint8_t data[0];
-} __attribute__((aligned(4)));
+} __attribute__((packed));
 
 /* Find the next record, taking into account the 4-byte alignment */
 static inline const struct ihex_binrec *
index f8598f583944a5355b4ee33ddef3a785b3adcc79..c975caf75385d2e634cdb151dae416e2487533a0 100644 (file)
@@ -8,4 +8,3 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
                                      unsigned long align_mask);
 extern void iommu_area_free(unsigned long *map, unsigned long start,
                            unsigned int nr);
-extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
new file mode 100644 (file)
index 0000000..ec6eb49
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ *      IP Virtual Server
+ *      data structure and functionality definitions
+ */
+
+#ifndef _IP_VS_H
+#define _IP_VS_H
+
+#include <linux/types.h>       /* For __beXX types in userland */
+
+#define IP_VS_VERSION_CODE     0x010201
+#define NVERSION(version)                      \
+       (version >> 16) & 0xFF,                 \
+       (version >> 8) & 0xFF,                  \
+       version & 0xFF
+
+/*
+ *      Virtual Service Flags
+ */
+#define IP_VS_SVC_F_PERSISTENT 0x0001          /* persistent port */
+#define IP_VS_SVC_F_HASHED     0x0002          /* hashed entry */
+
+/*
+ *      Destination Server Flags
+ */
+#define IP_VS_DEST_F_AVAILABLE 0x0001          /* server is available */
+#define IP_VS_DEST_F_OVERLOAD  0x0002          /* server is overloaded */
+
+/*
+ *      IPVS sync daemon states
+ */
+#define IP_VS_STATE_NONE       0x0000          /* daemon is stopped */
+#define IP_VS_STATE_MASTER     0x0001          /* started as master */
+#define IP_VS_STATE_BACKUP     0x0002          /* started as backup */
+
+/*
+ *      IPVS socket options
+ */
+#define IP_VS_BASE_CTL         (64+1024+64)            /* base */
+
+#define IP_VS_SO_SET_NONE      IP_VS_BASE_CTL          /* just peek */
+#define IP_VS_SO_SET_INSERT    (IP_VS_BASE_CTL+1)
+#define IP_VS_SO_SET_ADD       (IP_VS_BASE_CTL+2)
+#define IP_VS_SO_SET_EDIT      (IP_VS_BASE_CTL+3)
+#define IP_VS_SO_SET_DEL       (IP_VS_BASE_CTL+4)
+#define IP_VS_SO_SET_FLUSH     (IP_VS_BASE_CTL+5)
+#define IP_VS_SO_SET_LIST      (IP_VS_BASE_CTL+6)
+#define IP_VS_SO_SET_ADDDEST   (IP_VS_BASE_CTL+7)
+#define IP_VS_SO_SET_DELDEST   (IP_VS_BASE_CTL+8)
+#define IP_VS_SO_SET_EDITDEST  (IP_VS_BASE_CTL+9)
+#define IP_VS_SO_SET_TIMEOUT   (IP_VS_BASE_CTL+10)
+#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
+#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
+#define IP_VS_SO_SET_RESTORE    (IP_VS_BASE_CTL+13)
+#define IP_VS_SO_SET_SAVE       (IP_VS_BASE_CTL+14)
+#define IP_VS_SO_SET_ZERO      (IP_VS_BASE_CTL+15)
+#define IP_VS_SO_SET_MAX       IP_VS_SO_SET_ZERO
+
+#define IP_VS_SO_GET_VERSION   IP_VS_BASE_CTL
+#define IP_VS_SO_GET_INFO      (IP_VS_BASE_CTL+1)
+#define IP_VS_SO_GET_SERVICES  (IP_VS_BASE_CTL+2)
+#define IP_VS_SO_GET_SERVICE   (IP_VS_BASE_CTL+3)
+#define IP_VS_SO_GET_DESTS     (IP_VS_BASE_CTL+4)
+#define IP_VS_SO_GET_DEST      (IP_VS_BASE_CTL+5)      /* not used now */
+#define IP_VS_SO_GET_TIMEOUT   (IP_VS_BASE_CTL+6)
+#define IP_VS_SO_GET_DAEMON    (IP_VS_BASE_CTL+7)
+#define IP_VS_SO_GET_MAX       IP_VS_SO_GET_DAEMON
+
+
+/*
+ *      IPVS Connection Flags
+ */
+#define IP_VS_CONN_F_FWD_MASK  0x0007          /* mask for the fwd methods */
+#define IP_VS_CONN_F_MASQ      0x0000          /* masquerading/NAT */
+#define IP_VS_CONN_F_LOCALNODE 0x0001          /* local node */
+#define IP_VS_CONN_F_TUNNEL    0x0002          /* tunneling */
+#define IP_VS_CONN_F_DROUTE    0x0003          /* direct routing */
+#define IP_VS_CONN_F_BYPASS    0x0004          /* cache bypass */
+#define IP_VS_CONN_F_SYNC      0x0020          /* entry created by sync */
+#define IP_VS_CONN_F_HASHED    0x0040          /* hashed entry */
+#define IP_VS_CONN_F_NOOUTPUT  0x0080          /* no output packets */
+#define IP_VS_CONN_F_INACTIVE  0x0100          /* not established */
+#define IP_VS_CONN_F_OUT_SEQ   0x0200          /* must do output seq adjust */
+#define IP_VS_CONN_F_IN_SEQ    0x0400          /* must do input seq adjust */
+#define IP_VS_CONN_F_SEQ_MASK  0x0600          /* in/out sequence mask */
+#define IP_VS_CONN_F_NO_CPORT  0x0800          /* no client port set yet */
+#define IP_VS_CONN_F_TEMPLATE  0x1000          /* template, not connection */
+
+#define IP_VS_SCHEDNAME_MAXLEN 16
+#define IP_VS_IFNAME_MAXLEN    16
+
+
+/*
+ *     The struct ip_vs_service_user and struct ip_vs_dest_user are
+ *     used to set IPVS rules through setsockopt.
+ */
+struct ip_vs_service_user {
+       /* virtual service addresses */
+       u_int16_t               protocol;
+       __be32                  addr;           /* virtual ip address */
+       __be16                  port;
+       u_int32_t               fwmark;         /* firwall mark of service */
+
+       /* virtual service options */
+       char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
+       unsigned                flags;          /* virtual service flags */
+       unsigned                timeout;        /* persistent timeout in sec */
+       __be32                  netmask;        /* persistent netmask */
+};
+
+
+struct ip_vs_dest_user {
+       /* destination server address */
+       __be32                  addr;
+       __be16                  port;
+
+       /* real server options */
+       unsigned                conn_flags;     /* connection flags */
+       int                     weight;         /* destination weight */
+
+       /* thresholds for active connections */
+       u_int32_t               u_threshold;    /* upper threshold */
+       u_int32_t               l_threshold;    /* lower threshold */
+};
+
+
+/*
+ *     IPVS statistics object (for user space)
+ */
+struct ip_vs_stats_user
+{
+       __u32                   conns;          /* connections scheduled */
+       __u32                   inpkts;         /* incoming packets */
+       __u32                   outpkts;        /* outgoing packets */
+       __u64                   inbytes;        /* incoming bytes */
+       __u64                   outbytes;       /* outgoing bytes */
+
+       __u32                   cps;            /* current connection rate */
+       __u32                   inpps;          /* current in packet rate */
+       __u32                   outpps;         /* current out packet rate */
+       __u32                   inbps;          /* current in byte rate */
+       __u32                   outbps;         /* current out byte rate */
+};
+
+
+/* The argument to IP_VS_SO_GET_INFO */
+struct ip_vs_getinfo {
+       /* version number */
+       unsigned int            version;
+
+       /* size of connection hash table */
+       unsigned int            size;
+
+       /* number of virtual services */
+       unsigned int            num_services;
+};
+
+
+/* The argument to IP_VS_SO_GET_SERVICE */
+struct ip_vs_service_entry {
+       /* which service: user fills in these */
+       u_int16_t               protocol;
+       __be32                  addr;           /* virtual address */
+       __be16                  port;
+       u_int32_t               fwmark;         /* firwall mark of service */
+
+       /* service options */
+       char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
+       unsigned                flags;          /* virtual service flags */
+       unsigned                timeout;        /* persistent timeout */
+       __be32                  netmask;        /* persistent netmask */
+
+       /* number of real servers */
+       unsigned int            num_dests;
+
+       /* statistics */
+       struct ip_vs_stats_user stats;
+};
+
+
+struct ip_vs_dest_entry {
+       __be32                  addr;           /* destination address */
+       __be16                  port;
+       unsigned                conn_flags;     /* connection flags */
+       int                     weight;         /* destination weight */
+
+       u_int32_t               u_threshold;    /* upper threshold */
+       u_int32_t               l_threshold;    /* lower threshold */
+
+       u_int32_t               activeconns;    /* active connections */
+       u_int32_t               inactconns;     /* inactive connections */
+       u_int32_t               persistconns;   /* persistent connections */
+
+       /* statistics */
+       struct ip_vs_stats_user stats;
+};
+
+
+/* The argument to IP_VS_SO_GET_DESTS */
+struct ip_vs_get_dests {
+       /* which service: user fills in these */
+       u_int16_t               protocol;
+       __be32                  addr;           /* virtual address */
+       __be16                  port;
+       u_int32_t               fwmark;         /* firwall mark of service */
+
+       /* number of real servers */
+       unsigned int            num_dests;
+
+       /* the real servers */
+       struct ip_vs_dest_entry entrytable[0];
+};
+
+
+/* The argument to IP_VS_SO_GET_SERVICES */
+struct ip_vs_get_services {
+       /* number of virtual services */
+       unsigned int            num_services;
+
+       /* service table */
+       struct ip_vs_service_entry entrytable[0];
+};
+
+
+/* The argument to IP_VS_SO_GET_TIMEOUT */
+struct ip_vs_timeout_user {
+       int                     tcp_timeout;
+       int                     tcp_fin_timeout;
+       int                     udp_timeout;
+};
+
+
+/* The argument to IP_VS_SO_GET_DAEMON */
+struct ip_vs_daemon_user {
+       /* sync daemon state (master/backup) */
+       int                     state;
+
+       /* multicast interface name */
+       char                    mcast_ifn[IP_VS_IFNAME_MAXLEN];
+
+       /* SyncID we belong to */
+       int                     syncid;
+};
+
+#endif /* _IP_VS_H */
index 0ea064cbfbc8660a7119a22546165ca3ec3387cd..69511f74f912682e69e4d49a9abf5198c0a4bfa3 100644 (file)
@@ -371,6 +371,7 @@ struct kvm_trace_rec {
 #define KVM_CAP_PV_MMU 13
 #define KVM_CAP_MP_STATE 14
 #define KVM_CAP_COALESCED_MMIO 15
+#define KVM_CAP_SYNC_MMU 16  /* Changes to host mmap are reflected in guest */
 
 /*
  * ioctls for VM fds
index 07d68a8ae8e950bc21bdb86b8900aea4ee68b46e..8525afc53107faaaa993fa6ebae6c2d703eb718c 100644 (file)
@@ -121,6 +121,12 @@ struct kvm {
        struct kvm_coalesced_mmio_dev *coalesced_mmio_dev;
        struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
 #endif
+
+#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
+       struct mmu_notifier mmu_notifier;
+       unsigned long mmu_notifier_seq;
+       long mmu_notifier_count;
+#endif
 };
 
 /* The guest did something we don't support. */
@@ -332,4 +338,22 @@ int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
 #define kvm_trace_cleanup() ((void)0)
 #endif
 
+#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
+static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
+{
+       if (unlikely(vcpu->kvm->mmu_notifier_count))
+               return 1;
+       /*
+        * Both reads happen under the mmu_lock and both values are
+        * modified under mmu_lock, so there's no need of smb_rmb()
+        * here in between, otherwise mmu_notifier_count should be
+        * read before mmu_notifier_seq, see
+        * mmu_notifier_invalidate_range_end write side.
+        */
+       if (vcpu->kvm->mmu_notifier_seq != mmu_seq)
+               return 1;
+       return 0;
+}
+#endif
+
 #endif
index 5b247b8a6b3bf9e77143d62c0fb8c57cedd5cee3..06b80337303b805bffcc2920b0d8796004f902ef 100644 (file)
@@ -60,9 +60,9 @@
 
 /* note: prints function name for you */
 #ifdef ATA_DEBUG
-#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 #ifdef ATA_VERBOSE_DEBUG
-#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 #else
 #define VPRINTK(fmt, args...)
 #endif /* ATA_VERBOSE_DEBUG */
@@ -71,7 +71,7 @@
 #define VPRINTK(fmt, args...)
 #endif /* ATA_DEBUG */
 
-#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 
 /* NEW: debug levels */
 #define HAVE_LIBATA_MSG 1
@@ -750,6 +750,7 @@ struct ata_port_operations {
        void (*set_piomode)(struct ata_port *ap, struct ata_device *dev);
        void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev);
        int  (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
+       unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf, u16 *id);
 
        void (*dev_config)(struct ata_device *dev);
 
@@ -951,6 +952,8 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
                          unsigned int ofs, unsigned int len);
 extern void ata_id_c_string(const u16 *id, unsigned char *s,
                            unsigned int ofs, unsigned int len);
+extern unsigned int ata_do_dev_read_id(struct ata_device *dev,
+                                       struct ata_taskfile *tf, u16 *id);
 extern void ata_qc_complete(struct ata_queued_cmd *qc);
 extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active);
 extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
index 5c948f337817da7bb1386826d84f4e9f52e3d49a..8f2d60da04e757f1e1c5a9bbd26f486916a419da 100644 (file)
@@ -37,7 +37,7 @@
  */
 #define        MISDN_MAJOR_VERSION     1
 #define        MISDN_MINOR_VERSION     0
-#define MISDN_RELEASE          18
+#define MISDN_RELEASE          19
 
 /* primitives for information exchange
  * generell format
@@ -242,7 +242,8 @@ struct mISDNhead {
 #define TEI_SAPI               63
 #define CTRL_SAPI              0
 
-#define MISDN_CHMAP_SIZE       4
+#define MISDN_MAX_CHANNEL      127
+#define MISDN_CHMAP_SIZE       ((MISDN_MAX_CHANNEL + 1) >> 3)
 
 #define SOL_MISDN      0
 
@@ -275,11 +276,32 @@ struct mISDN_devinfo {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   protocol;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        u_int                   nrbchan;
        char                    name[MISDN_MAX_IDLEN];
 };
 
+static inline int
+test_channelmap(u_int nr, u_char *map)
+{
+       if (nr <= MISDN_MAX_CHANNEL)
+               return map[nr >> 3] & (1 << (nr & 7));
+       else
+               return 0;
+}
+
+static inline void
+set_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] |= (1 << (nr & 7));
+}
+
+static inline void
+clear_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] &= ~(1 << (nr & 7));
+}
+
 /* CONTROL_CHANNEL parameters */
 #define MISDN_CTRL_GETOP               0x0000
 #define MISDN_CTRL_LOOP                        0x0001
@@ -405,7 +427,7 @@ struct mISDNdevice {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   nrbchan;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        struct list_head        bchannels;
        struct mISDNchannel     *teimgr;
        struct device           dev;
@@ -430,7 +452,7 @@ struct mISDNstack {
 #endif
 };
 
-/* global alloc/queue dunctions */
+/* global alloc/queue functions */
 
 static inline struct sk_buff *
 mI_alloc_skb(unsigned int len, gfp_t gfp_mask)
index 523a286bb477d1d6ab1020140aa4390a5b568571..c853b10660183af6b27df8af218ac5478d124334 100644 (file)
@@ -2,6 +2,7 @@
 #define __LINUX_MAPLE_H
 
 #include <linux/device.h>
+#include <mach/maple.h>
 
 extern struct bus_type maple_bus_type;
 
@@ -33,6 +34,7 @@ struct mapleq {
        void *sendbuf, *recvbuf, *recvbufdcsp;
        unsigned char length;
        enum maple_code command;
+       struct mutex mutex;
 };
 
 struct maple_devinfo {
@@ -69,7 +71,9 @@ void maple_getcond_callback(struct maple_device *dev,
                            unsigned long interval,
                            unsigned long function);
 int maple_driver_register(struct device_driver *drv);
-void maple_add_packet(struct mapleq *mq);
+int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
+       u32 command, u32 length, void *data);
+void maple_clear_dev(struct maple_device *mdev);
 
 #define to_maple_dev(n) container_of(n, struct maple_device, dev)
 #define to_maple_driver(n) container_of(n, struct maple_driver, drv)
index b5efaa2132ab2ff79b624e09ab7eba0adcd18a04..30a1d63b6fb5cb37574935ff33c121c6526d111d 100644 (file)
@@ -105,7 +105,8 @@ extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
 
 struct nameidata;
 
-extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
+struct path;
+extern int do_add_mount(struct vfsmount *newmnt, struct path *path,
                        int mnt_flags, struct list_head *fslist);
 
 extern void mark_mounts_for_expiry(struct list_head *mounts);
index 4ed40caff4e58161a8e5d545421e375d0b81f7e2..922636548558943d7af9007074cb8d2e7e91fcb0 100644 (file)
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr)
                        printk(KERN_INFO args);         \
        } while(0)
 #else /* CONFIG_MTD_DEBUG */
-#define DEBUG(n, args...) do { } while(0)
+#define DEBUG(n, args...)                              \
+       do {                                            \
+               if (0)                                  \
+                       printk(KERN_INFO args);         \
+       } while(0)
 
 #endif /* CONFIG_MTD_DEBUG */
 
index 83f678702dff3903a262956e21c306bc068c9bbf..81774e5facf4e74a2d5dd742bae6bb81a1922b17 100644 (file)
@@ -177,7 +177,9 @@ typedef enum {
 #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
 #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
 #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
-#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT))
+/* Large page NAND with SOFT_ECC should support subpage reads */
+#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \
+                                       && (chip->page_shift > 9))
 
 /* Mask to zero out the chip options, which come from the id table */
 #define NAND_CHIPOPTIONS_MSK   (0x0000ffff & ~NAND_NO_AUTOINCR)
index b4d056ceab96d0500d951f7b7f00bee1e1d28627..ee583f642a9f56de52b7be72c381764ebf816307 100644 (file)
@@ -440,6 +440,7 @@ static inline void napi_synchronize(const struct napi_struct *n)
 enum netdev_queue_state_t
 {
        __QUEUE_STATE_XOFF,
+       __QUEUE_STATE_FROZEN,
 };
 
 struct netdev_queue {
@@ -636,7 +637,7 @@ struct net_device
        unsigned int            real_num_tx_queues;
 
        unsigned long           tx_queue_len;   /* Max frames per queue allowed */
-
+       spinlock_t              tx_global_lock;
 /*
  * One part is mostly used on xmit path (device)
  */
@@ -1099,6 +1100,11 @@ static inline int netif_queue_stopped(const struct net_device *dev)
        return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
 }
 
+static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue)
+{
+       return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state);
+}
+
 /**
  *     netif_running - test if up
  *     @dev: network device
@@ -1475,6 +1481,26 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
        txq->xmit_lock_owner = smp_processor_id();
 }
 
+static inline int __netif_tx_trylock(struct netdev_queue *txq)
+{
+       int ok = spin_trylock(&txq->_xmit_lock);
+       if (likely(ok))
+               txq->xmit_lock_owner = smp_processor_id();
+       return ok;
+}
+
+static inline void __netif_tx_unlock(struct netdev_queue *txq)
+{
+       txq->xmit_lock_owner = -1;
+       spin_unlock(&txq->_xmit_lock);
+}
+
+static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
+{
+       txq->xmit_lock_owner = -1;
+       spin_unlock_bh(&txq->_xmit_lock);
+}
+
 /**
  *     netif_tx_lock - grab network device transmit lock
  *     @dev: network device
@@ -1484,12 +1510,23 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
  */
 static inline void netif_tx_lock(struct net_device *dev)
 {
-       int cpu = smp_processor_id();
        unsigned int i;
+       int cpu;
 
+       spin_lock(&dev->tx_global_lock);
+       cpu = smp_processor_id();
        for (i = 0; i < dev->num_tx_queues; i++) {
                struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
+
+               /* We are the only thread of execution doing a
+                * freeze, but we have to grab the _xmit_lock in
+                * order to synchronize with threads which are in
+                * the ->hard_start_xmit() handler and already
+                * checked the frozen bit.
+                */
                __netif_tx_lock(txq, cpu);
+               set_bit(__QUEUE_STATE_FROZEN, &txq->state);
+               __netif_tx_unlock(txq);
        }
 }
 
@@ -1499,40 +1536,22 @@ static inline void netif_tx_lock_bh(struct net_device *dev)
        netif_tx_lock(dev);
 }
 
-static inline int __netif_tx_trylock(struct netdev_queue *txq)
-{
-       int ok = spin_trylock(&txq->_xmit_lock);
-       if (likely(ok))
-               txq->xmit_lock_owner = smp_processor_id();
-       return ok;
-}
-
-static inline int netif_tx_trylock(struct net_device *dev)
-{
-       return __netif_tx_trylock(netdev_get_tx_queue(dev, 0));
-}
-
-static inline void __netif_tx_unlock(struct netdev_queue *txq)
-{
-       txq->xmit_lock_owner = -1;
-       spin_unlock(&txq->_xmit_lock);
-}
-
-static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
-{
-       txq->xmit_lock_owner = -1;
-       spin_unlock_bh(&txq->_xmit_lock);
-}
-
 static inline void netif_tx_unlock(struct net_device *dev)
 {
        unsigned int i;
 
        for (i = 0; i < dev->num_tx_queues; i++) {
                struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
-               __netif_tx_unlock(txq);
-       }
 
+               /* No need to grab the _xmit_lock here.  If the
+                * queue is not stopped for another reason, we
+                * force a schedule.
+                */
+               clear_bit(__QUEUE_STATE_FROZEN, &txq->state);
+               if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
+                       __netif_schedule(txq->qdisc);
+       }
+       spin_unlock(&dev->tx_global_lock);
 }
 
 static inline void netif_tx_unlock_bh(struct net_device *dev)
@@ -1556,13 +1575,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
 static inline void netif_tx_disable(struct net_device *dev)
 {
        unsigned int i;
+       int cpu;
 
-       netif_tx_lock_bh(dev);
+       local_bh_disable();
+       cpu = smp_processor_id();
        for (i = 0; i < dev->num_tx_queues; i++) {
                struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
+
+               __netif_tx_lock(txq, cpu);
                netif_tx_stop_queue(txq);
+               __netif_tx_unlock(txq);
        }
-       netif_tx_unlock_bh(dev);
+       local_bh_enable();
 }
 
 static inline void netif_addr_lock(struct net_device *dev)
index 22ce29995f138050739468a8ea9667bcfc3e0c52..a049df4f2236360e2aae61bf3da3e38bf35b6963 100644 (file)
@@ -30,6 +30,9 @@ enum tcp_conntrack {
 /* Be liberal in window checking */
 #define IP_CT_TCP_FLAG_BE_LIBERAL              0x08
 
+/* Has unacknowledged data */
+#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED     0x10
+
 struct nf_ct_tcp_flags {
        u_int8_t flags;
        u_int8_t mask;
index cc554ca8bc7836401807ec1359a13f44f679c908..7dcd050757567eb94265fb12b29d6f79e5cbcb3f 100644 (file)
@@ -14,7 +14,7 @@ struct match_token {
        const char *pattern;
 };
 
-typedef const struct match_token match_table_t[];
+typedef struct match_token match_table_t[];
 
 /* Maximum number of arguments that match_token will find in a pattern */
 enum {MAX_OPT_ARGS = 3};
index 68ed19ccf1f702c1978c8fb5e18ed557f316484c..ea96ead1d39daa0ac621d12ae28633e30e4c7f71 100644 (file)
@@ -78,6 +78,7 @@ enum power_supply_property {
        POWER_SUPPLY_PROP_CHARGE_EMPTY,
        POWER_SUPPLY_PROP_CHARGE_NOW,
        POWER_SUPPLY_PROP_CHARGE_AVG,
+       POWER_SUPPLY_PROP_CHARGE_COUNTER,
        POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
        POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
        POWER_SUPPLY_PROP_ENERGY_FULL,
index 742187f7a05c54051da11975373acd5cc3de56e2..ca6b9b5c8d5271b430a534fe59969a09af85c997 100644 (file)
@@ -43,6 +43,8 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
 
 int vfs_quota_on(struct super_block *sb, int type, int format_id,
        char *path, int remount);
+int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
+       struct path *path);
 int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
        int format_id, int type);
 int vfs_quota_off(struct super_block *sb, int type, int remount);
index 9f2549ac0e2d0133e014739cc7c5843fcb0a4e91..c200b9a34affc193500897aead3eec14f98f5f5f 100644 (file)
@@ -128,6 +128,7 @@ struct mddev_s
 #define MD_CHANGE_DEVS 0       /* Some device status has changed */
 #define MD_CHANGE_CLEAN 1      /* transition to or from 'clean' */
 #define MD_CHANGE_PENDING 2    /* superblock update in progress */
+#define MD_NOTIFY_ARRAY_STATE 3        /* atomic context wants to notify userspace */
 
        int                             ro;
 
diff --git a/include/linux/regulator/bq24022.h b/include/linux/regulator/bq24022.h
new file mode 100644 (file)
index 0000000..e84b0a9
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater)
+ * 1-Cell Li-Ion Charger connected via GPIOs.
+ *
+ * Copyright (c) 2008 Philipp Zabel
+ *
+ * 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.
+ *
+ */
+
+/**
+ * bq24022_mach_info - platform data for bq24022
+ * @gpio_nce: GPIO line connected to the nCE pin, used to enable / disable charging
+ * @gpio_iset2: GPIO line connected to the ISET2 pin, used to limit charging current to 100 mA / 500 mA
+ */
+struct bq24022_mach_info {
+       int gpio_nce;
+       int gpio_iset2;
+};
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
new file mode 100644 (file)
index 0000000..afdc455
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ * consumer.h -- SoC Regulator consumer support.
+ *
+ * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
+ *
+ * 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.
+ *
+ * Regulator Consumer Interface.
+ *
+ * A Power Management Regulator framework for SoC based devices.
+ * Features:-
+ *   o Voltage and current level control.
+ *   o Operating mode control.
+ *   o Regulator status.
+ *   o sysfs entries for showing client devices and status
+ *
+ * EXPERIMENTAL FEATURES:
+ *   Dynamic Regulator operating Mode Switching (DRMS) - allows regulators
+ *   to use most efficient operating mode depending upon voltage and load and
+ *   is transparent to client drivers.
+ *
+ *   e.g. Devices x,y,z share regulator r. Device x and y draw 20mA each during
+ *   IO and 1mA at idle. Device z draws 100mA when under load and 5mA when
+ *   idling. Regulator r has > 90% efficiency in NORMAL mode at loads > 100mA
+ *   but this drops rapidly to 60% when below 100mA. Regulator r has > 90%
+ *   efficiency in IDLE mode at loads < 10mA. Thus regulator r will operate
+ *   in normal mode for loads > 10mA and in IDLE mode for load <= 10mA.
+ *
+ */
+
+#ifndef __LINUX_REGULATOR_CONSUMER_H_
+#define __LINUX_REGULATOR_CONSUMER_H_
+
+/*
+ * Regulator operating modes.
+ *
+ * Regulators can run in a variety of different operating modes depending on
+ * output load. This allows further system power savings by selecting the
+ * best (and most efficient) regulator mode for a desired load.
+ *
+ * Most drivers will only care about NORMAL. The modes below are generic and
+ * will probably not match the naming convention of your regulator data sheet
+ * but should match the use cases in the datasheet.
+ *
+ * In order of power efficiency (least efficient at top).
+ *
+ *  Mode       Description
+ *  FAST       Regulator can handle fast changes in it's load.
+ *             e.g. useful in CPU voltage & frequency scaling where
+ *             load can quickly increase with CPU frequency increases.
+ *
+ *  NORMAL     Normal regulator power supply mode. Most drivers will
+ *             use this mode.
+ *
+ *  IDLE       Regulator runs in a more efficient mode for light
+ *             loads. Can be used for devices that have a low power
+ *             requirement during periods of inactivity. This mode
+ *             may be more noisy than NORMAL and may not be able
+ *             to handle fast load switching.
+ *
+ *  STANDBY    Regulator runs in the most efficient mode for very
+ *             light loads. Can be used by devices when they are
+ *             in a sleep/standby state. This mode is likely to be
+ *             the most noisy and may not be able to handle fast load
+ *             switching.
+ *
+ * NOTE: Most regulators will only support a subset of these modes. Some
+ * will only just support NORMAL.
+ *
+ * These modes can be OR'ed together to make up a mask of valid register modes.
+ */
+
+#define REGULATOR_MODE_FAST                    0x1
+#define REGULATOR_MODE_NORMAL                  0x2
+#define REGULATOR_MODE_IDLE                    0x4
+#define REGULATOR_MODE_STANDBY                 0x8
+
+/*
+ * Regulator notifier events.
+ *
+ * UNDER_VOLTAGE  Regulator output is under voltage.
+ * OVER_CURRENT   Regulator output current is too high.
+ * REGULATION_OUT Regulator output is out of regulation.
+ * FAIL           Regulator output has failed.
+ * OVER_TEMP      Regulator over temp.
+ * FORCE_DISABLE  Regulator shut down by software.
+ *
+ * NOTE: These events can be OR'ed together when passed into handler.
+ */
+
+#define REGULATOR_EVENT_UNDER_VOLTAGE          0x01
+#define REGULATOR_EVENT_OVER_CURRENT           0x02
+#define REGULATOR_EVENT_REGULATION_OUT         0x04
+#define REGULATOR_EVENT_FAIL                   0x08
+#define REGULATOR_EVENT_OVER_TEMP              0x10
+#define REGULATOR_EVENT_FORCE_DISABLE          0x20
+
+struct regulator;
+
+/**
+ * struct regulator_bulk_data - Data used for bulk regulator operations.
+ *
+ * @supply   The name of the supply.  Initialised by the user before
+ *           using the bulk regulator APIs.
+ * @consumer The regulator consumer for the supply.  This will be managed
+ *           by the bulk API.
+ *
+ * The regulator APIs provide a series of regulator_bulk_() API calls as
+ * a convenience to consumers which require multiple supplies.  This
+ * structure is used to manage data for these calls.
+ */
+struct regulator_bulk_data {
+       const char *supply;
+       struct regulator *consumer;
+};
+
+#if defined(CONFIG_REGULATOR)
+
+/* regulator get and put */
+struct regulator *__must_check regulator_get(struct device *dev,
+                                            const char *id);
+void regulator_put(struct regulator *regulator);
+
+/* regulator output control and status */
+int regulator_enable(struct regulator *regulator);
+int regulator_disable(struct regulator *regulator);
+int regulator_force_disable(struct regulator *regulator);
+int regulator_is_enabled(struct regulator *regulator);
+
+int regulator_bulk_get(struct device *dev, int num_consumers,
+                      struct regulator_bulk_data *consumers);
+int regulator_bulk_enable(int num_consumers,
+                         struct regulator_bulk_data *consumers);
+int regulator_bulk_disable(int num_consumers,
+                          struct regulator_bulk_data *consumers);
+void regulator_bulk_free(int num_consumers,
+                        struct regulator_bulk_data *consumers);
+
+int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
+int regulator_get_voltage(struct regulator *regulator);
+int regulator_set_current_limit(struct regulator *regulator,
+                              int min_uA, int max_uA);
+int regulator_get_current_limit(struct regulator *regulator);
+
+int regulator_set_mode(struct regulator *regulator, unsigned int mode);
+unsigned int regulator_get_mode(struct regulator *regulator);
+int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
+
+/* regulator notifier block */
+int regulator_register_notifier(struct regulator *regulator,
+                             struct notifier_block *nb);
+int regulator_unregister_notifier(struct regulator *regulator,
+                               struct notifier_block *nb);
+
+/* driver data - core doesn't touch */
+void *regulator_get_drvdata(struct regulator *regulator);
+void regulator_set_drvdata(struct regulator *regulator, void *data);
+
+#else
+
+/*
+ * Make sure client drivers will still build on systems with no software
+ * controllable voltage or current regulators.
+ */
+static inline struct regulator *__must_check regulator_get(struct device *dev,
+       const char *id)
+{
+       /* Nothing except the stubbed out regulator API should be
+        * looking at the value except to check if it is an error
+        * value so the actual return value doesn't matter.
+        */
+       return (struct regulator *)id;
+}
+static inline void regulator_put(struct regulator *regulator)
+{
+}
+
+static inline int regulator_enable(struct regulator *regulator)
+{
+       return 0;
+}
+
+static inline int regulator_disable(struct regulator *regulator)
+{
+       return 0;
+}
+
+static inline int regulator_is_enabled(struct regulator *regulator)
+{
+       return 1;
+}
+
+static inline int regulator_bulk_get(struct device *dev,
+                                    int num_consumers,
+                                    struct regulator_bulk_data *consumers)
+{
+       return 0;
+}
+
+static inline int regulator_bulk_enable(int num_consumers,
+                                       struct regulator_bulk_data *consumers)
+{
+       return 0;
+}
+
+static inline int regulator_bulk_disable(int num_consumers,
+                                        struct regulator_bulk_data *consumers)
+{
+       return 0;
+}
+
+static inline void regulator_bulk_free(int num_consumers,
+                                      struct regulator_bulk_data *consumers)
+{
+}
+
+static inline int regulator_set_voltage(struct regulator *regulator,
+                                       int min_uV, int max_uV)
+{
+       return 0;
+}
+
+static inline int regulator_get_voltage(struct regulator *regulator)
+{
+       return 0;
+}
+
+static inline int regulator_set_current_limit(struct regulator *regulator,
+                                            int min_uA, int max_uA)
+{
+       return 0;
+}
+
+static inline int regulator_get_current_limit(struct regulator *regulator)
+{
+       return 0;
+}
+
+static inline int regulator_set_mode(struct regulator *regulator,
+       unsigned int mode)
+{
+       return 0;
+}
+
+static inline unsigned int regulator_get_mode(struct regulator *regulator)
+{
+       return REGULATOR_MODE_NORMAL;
+}
+
+static inline int regulator_set_optimum_mode(struct regulator *regulator,
+                                       int load_uA)
+{
+       return REGULATOR_MODE_NORMAL;
+}
+
+static inline int regulator_register_notifier(struct regulator *regulator,
+                             struct notifier_block *nb)
+{
+       return 0;
+}
+
+static inline int regulator_unregister_notifier(struct regulator *regulator,
+                               struct notifier_block *nb)
+{
+       return 0;
+}
+
+static inline void *regulator_get_drvdata(struct regulator *regulator)
+{
+       return NULL;
+}
+
+static inline void regulator_set_drvdata(struct regulator *regulator,
+       void *data)
+{
+}
+
+#endif
+
+#endif
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
new file mode 100644 (file)
index 0000000..1d712c7
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * driver.h -- SoC Regulator driver support.
+ *
+ * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
+ *
+ * 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.
+ *
+ * Regulator Driver Interface.
+ */
+
+#ifndef __LINUX_REGULATOR_DRIVER_H_
+#define __LINUX_REGULATOR_DRIVER_H_
+
+#include <linux/device.h>
+#include <linux/regulator/consumer.h>
+
+struct regulator_constraints;
+struct regulator_dev;
+
+/**
+ * struct regulator_ops - regulator operations.
+ *
+ * This struct describes regulator operations.
+ */
+struct regulator_ops {
+
+       /* get/set regulator voltage */
+       int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV);
+       int (*get_voltage) (struct regulator_dev *);
+
+       /* get/set regulator current  */
+       int (*set_current_limit) (struct regulator_dev *,
+                                int min_uA, int max_uA);
+       int (*get_current_limit) (struct regulator_dev *);
+
+       /* enable/disable regulator */
+       int (*enable) (struct regulator_dev *);
+       int (*disable) (struct regulator_dev *);
+       int (*is_enabled) (struct regulator_dev *);
+
+       /* get/set regulator operating mode (defined in regulator.h) */
+       int (*set_mode) (struct regulator_dev *, unsigned int mode);
+       unsigned int (*get_mode) (struct regulator_dev *);
+
+       /* get most efficient regulator operating mode for load */
+       unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV,
+                                         int output_uV, int load_uA);
+
+       /* the operations below are for configuration of regulator state when
+        * it's parent PMIC enters a global STANBY/HIBERNATE state */
+
+       /* set regulator suspend voltage */
+       int (*set_suspend_voltage) (struct regulator_dev *, int uV);
+
+       /* enable/disable regulator in suspend state */
+       int (*set_suspend_enable) (struct regulator_dev *);
+       int (*set_suspend_disable) (struct regulator_dev *);
+
+       /* set regulator suspend operating mode (defined in regulator.h) */
+       int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
+};
+
+/*
+ * Regulators can either control voltage or current.
+ */
+enum regulator_type {
+       REGULATOR_VOLTAGE,
+       REGULATOR_CURRENT,
+};
+
+/**
+ * struct regulator_desc - Regulator descriptor
+ *
+ */
+struct regulator_desc {
+       const char *name;
+       int id;
+       struct regulator_ops *ops;
+       int irq;
+       enum regulator_type type;
+       struct module *owner;
+};
+
+
+struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+                                         void *reg_data);
+void regulator_unregister(struct regulator_dev *rdev);
+
+int regulator_notifier_call_chain(struct regulator_dev *rdev,
+                                 unsigned long event, void *data);
+
+void *rdev_get_drvdata(struct regulator_dev *rdev);
+int rdev_get_id(struct regulator_dev *rdev);
+
+#endif
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
new file mode 100644 (file)
index 0000000..1387a5d
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * fixed.h
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.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 2 of the
+ * License, or (at your option) any later version.
+ */
+
+#ifndef __REGULATOR_FIXED_H
+#define __REGULATOR_FIXED_H
+
+struct fixed_voltage_config {
+       const char *supply_name;
+       int microvolts;
+};
+
+#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
new file mode 100644 (file)
index 0000000..11e737d
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * machine.h -- SoC Regulator support, machine/board driver API.
+ *
+ * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
+ *
+ * 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.
+ *
+ * Regulator Machine/Board Interface.
+ */
+
+#ifndef __LINUX_REGULATOR_MACHINE_H_
+#define __LINUX_REGULATOR_MACHINE_H_
+
+#include <linux/regulator/consumer.h>
+#include <linux/suspend.h>
+
+struct regulator;
+
+/*
+ * Regulator operation constraint flags. These flags are used to enable
+ * certain regulator operations and can be OR'ed together.
+ *
+ * VOLTAGE:  Regulator output voltage can be changed by software on this
+ *           board/machine.
+ * CURRENT:  Regulator output current can be changed by software on this
+ *           board/machine.
+ * MODE:     Regulator operating mode can be changed by software on this
+ *           board/machine.
+ * STATUS:   Regulator can be enabled and disabled.
+ * DRMS:     Dynamic Regulator Mode Switching is enabled for this regulator.
+ */
+
+#define REGULATOR_CHANGE_VOLTAGE       0x1
+#define REGULATOR_CHANGE_CURRENT       0x2
+#define REGULATOR_CHANGE_MODE          0x4
+#define REGULATOR_CHANGE_STATUS                0x8
+#define REGULATOR_CHANGE_DRMS          0x10
+
+/**
+ * struct regulator_state - regulator state during low power syatem states
+ *
+ * This describes a regulators state during a system wide low power state.
+ */
+struct regulator_state {
+       int uV; /* suspend voltage */
+       unsigned int mode; /* suspend regulator operating mode */
+       int enabled; /* is regulator enabled in this suspend state */
+};
+
+/**
+ * struct regulation_constraints - regulator operating constraints.
+ *
+ * This struct describes regulator and board/machine specific constraints.
+ */
+struct regulation_constraints {
+
+       char *name;
+
+       /* voltage output range (inclusive) - for voltage control */
+       int min_uV;
+       int max_uV;
+
+       /* current output range (inclusive) - for current control */
+       int min_uA;
+       int max_uA;
+
+       /* valid regulator operating modes for this machine */
+       unsigned int valid_modes_mask;
+
+       /* valid operations for regulator on this machine */
+       unsigned int valid_ops_mask;
+
+       /* regulator input voltage - only if supply is another regulator */
+       int input_uV;
+
+       /* regulator suspend states for global PMIC STANDBY/HIBERNATE */
+       struct regulator_state state_disk;
+       struct regulator_state state_mem;
+       struct regulator_state state_standby;
+       suspend_state_t initial_state; /* suspend state to set at init */
+
+       /* constriant flags */
+       unsigned always_on:1;   /* regulator never off when system is on */
+       unsigned boot_on:1;     /* bootloader/firmware enabled regulator */
+       unsigned apply_uV:1;    /* apply uV constraint iff min == max */
+};
+
+int regulator_set_supply(const char *regulator, const char *regulator_supply);
+
+const char *regulator_get_supply(const char *regulator);
+
+int regulator_set_machine_constraints(const char *regulator,
+       struct regulation_constraints *constraints);
+
+int regulator_set_device_supply(const char *regulator, struct device *dev,
+                               const char *supply);
+
+int regulator_suspend_prepare(suspend_state_t state);
+
+#endif
index a640385e0598b7f127cb21e7688618643152064e..cfcc45b3bef0e7a1f1c582786aed7fc1d7bfdafc 100644 (file)
@@ -243,6 +243,7 @@ typedef unsigned char *sk_buff_data_t;
  *     @tc_index: Traffic control index
  *     @tc_verd: traffic control verdict
  *     @ndisc_nodetype: router type (from link layer)
+ *     @do_not_encrypt: set to prevent encryption of this frame
  *     @dma_cookie: a cookie to one of several possible DMA operations
  *             done by skb DMA functions
  *     @secmark: security marking
index b1875582c1a1466c558f3ef7831e3186bd766be8..12532839f508da4d7692beaf7191c9711a78a556 100644 (file)
@@ -493,16 +493,21 @@ static inline int tracehook_notify_jctl(int notify, int why)
  * @death_cookie:      value to pass to tracehook_report_death()
  * @group_dead:                nonzero if this was the last thread in the group to die
  *
- * Return the signal number to send our parent with do_notify_parent(), or
- * zero to send no signal and leave a zombie, or -1 to self-reap right now.
+ * A return value >= 0 means call do_notify_parent() with that signal
+ * number.  Negative return value can be %DEATH_REAP to self-reap right
+ * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
+ * parent.  Note that a return value of 0 means a do_notify_parent() call
+ * that sends no signal, but still wakes up a parent blocked in wait*().
  *
  * Called with write_lock_irq(&tasklist_lock) held.
  */
+#define DEATH_REAP                     -1
+#define DEATH_DELAYED_GROUP_LEADER     -2
 static inline int tracehook_notify_death(struct task_struct *task,
                                         void **death_cookie, int group_dead)
 {
        if (task->exit_signal == -1)
-               return task->ptrace ? SIGCHLD : -1;
+               return task->ptrace ? SIGCHLD : DEATH_REAP;
 
        /*
         * If something other than our normal parent is ptracing us, then
@@ -512,21 +517,21 @@ static inline int tracehook_notify_death(struct task_struct *task,
        if (thread_group_empty(task) && !ptrace_reparented(task))
                return task->exit_signal;
 
-       return task->ptrace ? SIGCHLD : 0;
+       return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
 }
 
 /**
  * tracehook_report_death - task is dead and ready to be reaped
  * @task:              @current task now exiting
- * @signal:            signal number sent to parent, or 0 or -1
+ * @signal:            return value from tracheook_notify_death()
  * @death_cookie:      value passed back from tracehook_notify_death()
  * @group_dead:                nonzero if this was the last thread in the group to die
  *
  * Thread has just become a zombie or is about to self-reap.  If positive,
  * @signal is the signal number just sent to the parent (usually %SIGCHLD).
- * If @signal is -1, this thread will self-reap.  If @signal is 0, this is
- * a delayed_group_leader() zombie.  The @death_cookie was passed back by
- * tracehook_notify_death().
+ * If @signal is %DEATH_REAP, this thread will self-reap.  If @signal is
+ * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
+ * The @death_cookie was passed back by tracehook_notify_death().
  *
  * If normal reaping is not inhibited, @task->exit_state might be changing
  * in parallel.
index 14c0e91be9b5121f811a2375382d0096270b4486..1c78d56c57e546cf6492e075e6c5ad5604144457 100644 (file)
@@ -74,7 +74,7 @@ void con_protect_unimap(struct vc_data *vc, int rdonly);
 int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
 
 #define vc_translate(vc, c) ((vc)->vc_translate[(c) |                  \
-                                       (vc)->vc_toggle_meta ? 0x80 : 0])
+                                       ((vc)->vc_toggle_meta ? 0x80 : 0)])
 #else
 #define con_set_trans_old(arg) (0)
 #define con_get_trans_old(arg) (-EINVAL)
@@ -86,6 +86,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
 #define con_copy_unimap(d, s) (0)
 #define con_get_unimap(vc, ct, uct, list) (-EINVAL)
 #define con_free_unimap(vc) do { ; } while (0)
+#define con_protect_unimap(vc, rdonly) do { ; } while (0)
 
 #define vc_translate(vc, c) (c)
 #endif
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
deleted file mode 100644 (file)
index e69de29..0000000
index 9a51ebad3f1fc21e054cedd03b344d8a851c28bd..cbb59ebed4aebaf7003d3db98b061e7b07b5d9f7 100644 (file)
  *      data structure and functionality definitions
  */
 
-#ifndef _IP_VS_H
-#define _IP_VS_H
-
-#include <asm/types.h>         /* For __uXX types */
-#include <linux/types.h>       /* For __beXX types in userland */
-
-#include <linux/sysctl.h>      /* For ctl_path */
-
-#define IP_VS_VERSION_CODE     0x010201
-#define NVERSION(version)                      \
-       (version >> 16) & 0xFF,                 \
-       (version >> 8) & 0xFF,                  \
-       version & 0xFF
-
-/*
- *      Virtual Service Flags
- */
-#define IP_VS_SVC_F_PERSISTENT 0x0001          /* persistent port */
-#define IP_VS_SVC_F_HASHED     0x0002          /* hashed entry */
-
-/*
- *      Destination Server Flags
- */
-#define IP_VS_DEST_F_AVAILABLE 0x0001          /* server is available */
-#define IP_VS_DEST_F_OVERLOAD  0x0002          /* server is overloaded */
-
-/*
- *      IPVS sync daemon states
- */
-#define IP_VS_STATE_NONE       0x0000          /* daemon is stopped */
-#define IP_VS_STATE_MASTER     0x0001          /* started as master */
-#define IP_VS_STATE_BACKUP     0x0002          /* started as backup */
-
-/*
- *      IPVS socket options
- */
-#define IP_VS_BASE_CTL         (64+1024+64)            /* base */
-
-#define IP_VS_SO_SET_NONE      IP_VS_BASE_CTL          /* just peek */
-#define IP_VS_SO_SET_INSERT    (IP_VS_BASE_CTL+1)
-#define IP_VS_SO_SET_ADD       (IP_VS_BASE_CTL+2)
-#define IP_VS_SO_SET_EDIT      (IP_VS_BASE_CTL+3)
-#define IP_VS_SO_SET_DEL       (IP_VS_BASE_CTL+4)
-#define IP_VS_SO_SET_FLUSH     (IP_VS_BASE_CTL+5)
-#define IP_VS_SO_SET_LIST      (IP_VS_BASE_CTL+6)
-#define IP_VS_SO_SET_ADDDEST   (IP_VS_BASE_CTL+7)
-#define IP_VS_SO_SET_DELDEST   (IP_VS_BASE_CTL+8)
-#define IP_VS_SO_SET_EDITDEST  (IP_VS_BASE_CTL+9)
-#define IP_VS_SO_SET_TIMEOUT   (IP_VS_BASE_CTL+10)
-#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
-#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
-#define IP_VS_SO_SET_RESTORE    (IP_VS_BASE_CTL+13)
-#define IP_VS_SO_SET_SAVE       (IP_VS_BASE_CTL+14)
-#define IP_VS_SO_SET_ZERO      (IP_VS_BASE_CTL+15)
-#define IP_VS_SO_SET_MAX       IP_VS_SO_SET_ZERO
-
-#define IP_VS_SO_GET_VERSION   IP_VS_BASE_CTL
-#define IP_VS_SO_GET_INFO      (IP_VS_BASE_CTL+1)
-#define IP_VS_SO_GET_SERVICES  (IP_VS_BASE_CTL+2)
-#define IP_VS_SO_GET_SERVICE   (IP_VS_BASE_CTL+3)
-#define IP_VS_SO_GET_DESTS     (IP_VS_BASE_CTL+4)
-#define IP_VS_SO_GET_DEST      (IP_VS_BASE_CTL+5)      /* not used now */
-#define IP_VS_SO_GET_TIMEOUT   (IP_VS_BASE_CTL+6)
-#define IP_VS_SO_GET_DAEMON    (IP_VS_BASE_CTL+7)
-#define IP_VS_SO_GET_MAX       IP_VS_SO_GET_DAEMON
-
-
-/*
- *      IPVS Connection Flags
- */
-#define IP_VS_CONN_F_FWD_MASK  0x0007          /* mask for the fwd methods */
-#define IP_VS_CONN_F_MASQ      0x0000          /* masquerading/NAT */
-#define IP_VS_CONN_F_LOCALNODE 0x0001          /* local node */
-#define IP_VS_CONN_F_TUNNEL    0x0002          /* tunneling */
-#define IP_VS_CONN_F_DROUTE    0x0003          /* direct routing */
-#define IP_VS_CONN_F_BYPASS    0x0004          /* cache bypass */
-#define IP_VS_CONN_F_SYNC      0x0020          /* entry created by sync */
-#define IP_VS_CONN_F_HASHED    0x0040          /* hashed entry */
-#define IP_VS_CONN_F_NOOUTPUT  0x0080          /* no output packets */
-#define IP_VS_CONN_F_INACTIVE  0x0100          /* not established */
-#define IP_VS_CONN_F_OUT_SEQ   0x0200          /* must do output seq adjust */
-#define IP_VS_CONN_F_IN_SEQ    0x0400          /* must do input seq adjust */
-#define IP_VS_CONN_F_SEQ_MASK  0x0600          /* in/out sequence mask */
-#define IP_VS_CONN_F_NO_CPORT  0x0800          /* no client port set yet */
-#define IP_VS_CONN_F_TEMPLATE  0x1000          /* template, not connection */
-
-/* Move it to better place one day, for now keep it unique */
-#define NFC_IPVS_PROPERTY      0x10000
-
-#define IP_VS_SCHEDNAME_MAXLEN 16
-#define IP_VS_IFNAME_MAXLEN    16
-
-
-/*
- *     The struct ip_vs_service_user and struct ip_vs_dest_user are
- *     used to set IPVS rules through setsockopt.
- */
-struct ip_vs_service_user {
-       /* virtual service addresses */
-       u_int16_t               protocol;
-       __be32                  addr;           /* virtual ip address */
-       __be16                  port;
-       u_int32_t               fwmark;         /* firwall mark of service */
-
-       /* virtual service options */
-       char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
-       unsigned                flags;          /* virtual service flags */
-       unsigned                timeout;        /* persistent timeout in sec */
-       __be32                  netmask;        /* persistent netmask */
-};
-
-
-struct ip_vs_dest_user {
-       /* destination server address */
-       __be32                  addr;
-       __be16                  port;
-
-       /* real server options */
-       unsigned                conn_flags;     /* connection flags */
-       int                     weight;         /* destination weight */
-
-       /* thresholds for active connections */
-       u_int32_t               u_threshold;    /* upper threshold */
-       u_int32_t               l_threshold;    /* lower threshold */
-};
-
-
-/*
- *     IPVS statistics object (for user space)
- */
-struct ip_vs_stats_user
-{
-       __u32                   conns;          /* connections scheduled */
-       __u32                   inpkts;         /* incoming packets */
-       __u32                   outpkts;        /* outgoing packets */
-       __u64                   inbytes;        /* incoming bytes */
-       __u64                   outbytes;       /* outgoing bytes */
-
-       __u32                   cps;            /* current connection rate */
-       __u32                   inpps;          /* current in packet rate */
-       __u32                   outpps;         /* current out packet rate */
-       __u32                   inbps;          /* current in byte rate */
-       __u32                   outbps;         /* current out byte rate */
-};
-
-
-/* The argument to IP_VS_SO_GET_INFO */
-struct ip_vs_getinfo {
-       /* version number */
-       unsigned int            version;
-
-       /* size of connection hash table */
-       unsigned int            size;
-
-       /* number of virtual services */
-       unsigned int            num_services;
-};
-
-
-/* The argument to IP_VS_SO_GET_SERVICE */
-struct ip_vs_service_entry {
-       /* which service: user fills in these */
-       u_int16_t               protocol;
-       __be32                  addr;           /* virtual address */
-       __be16                  port;
-       u_int32_t               fwmark;         /* firwall mark of service */
-
-       /* service options */
-       char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
-       unsigned                flags;          /* virtual service flags */
-       unsigned                timeout;        /* persistent timeout */
-       __be32                  netmask;        /* persistent netmask */
-
-       /* number of real servers */
-       unsigned int            num_dests;
-
-       /* statistics */
-       struct ip_vs_stats_user stats;
-};
-
-
-struct ip_vs_dest_entry {
-       __be32                  addr;           /* destination address */
-       __be16                  port;
-       unsigned                conn_flags;     /* connection flags */
-       int                     weight;         /* destination weight */
-
-       u_int32_t               u_threshold;    /* upper threshold */
-       u_int32_t               l_threshold;    /* lower threshold */
-
-       u_int32_t               activeconns;    /* active connections */
-       u_int32_t               inactconns;     /* inactive connections */
-       u_int32_t               persistconns;   /* persistent connections */
-
-       /* statistics */
-       struct ip_vs_stats_user stats;
-};
-
-
-/* The argument to IP_VS_SO_GET_DESTS */
-struct ip_vs_get_dests {
-       /* which service: user fills in these */
-       u_int16_t               protocol;
-       __be32                  addr;           /* virtual address */
-       __be16                  port;
-       u_int32_t               fwmark;         /* firwall mark of service */
-
-       /* number of real servers */
-       unsigned int            num_dests;
-
-       /* the real servers */
-       struct ip_vs_dest_entry entrytable[0];
-};
-
-
-/* The argument to IP_VS_SO_GET_SERVICES */
-struct ip_vs_get_services {
-       /* number of virtual services */
-       unsigned int            num_services;
-
-       /* service table */
-       struct ip_vs_service_entry entrytable[0];
-};
-
-
-/* The argument to IP_VS_SO_GET_TIMEOUT */
-struct ip_vs_timeout_user {
-       int                     tcp_timeout;
-       int                     tcp_fin_timeout;
-       int                     udp_timeout;
-};
-
-
-/* The argument to IP_VS_SO_GET_DAEMON */
-struct ip_vs_daemon_user {
-       /* sync daemon state (master/backup) */
-       int                     state;
-
-       /* multicast interface name */
-       char                    mcast_ifn[IP_VS_IFNAME_MAXLEN];
-
-       /* SyncID we belong to */
-       int                     syncid;
-};
+#ifndef _NET_IP_VS_H
+#define _NET_IP_VS_H
 
+#include <linux/ip_vs.h>                /* definitions shared with userland */
 
+/* old ipvsadm versions still include this file directly */
 #ifdef __KERNEL__
 
+#include <asm/types.h>                  /* for __uXX types */
+
+#include <linux/sysctl.h>               /* for ctl_path */
 #include <linux/list.h>                 /* for struct list_head */
 #include <linux/spinlock.h>             /* for struct rwlock_t */
 #include <asm/atomic.h>                 /* for struct atomic_t */
@@ -981,4 +744,4 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
 
 #endif /* __KERNEL__ */
 
-#endif /* _IP_VS_H */
+#endif /* _NET_IP_VS_H */
index 291d56a19167db9b8688dbbba446d051daae3b17..9cecc409f0f8418cea3e547447e210d8304f4178 100644 (file)
@@ -140,8 +140,7 @@ struct scsi_device {
        unsigned fix_capacity:1;        /* READ_CAPACITY is too high by 1 */
        unsigned guess_capacity:1;      /* READ_CAPACITY might be too high by 1 */
        unsigned retry_hwerror:1;       /* Retry HARDWARE_ERROR */
-       unsigned last_sector_bug:1;     /* do not use multisector accesses on
-                                          SD_LAST_BUGGY_SECTORS */
+       unsigned last_sector_bug:1;     /* Always read last sector in a 1 sector read */
 
        DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
        struct list_head event_list;    /* asserted events */
index 3030fdc6981d05b804ccb5e31d5d7d3fafd7565e..c1b26fcc0b5c81e8950c77230675bf9314b2c2a8 100644 (file)
@@ -202,6 +202,9 @@ struct snd_soc_dapm_path;
 struct snd_soc_dapm_pin;
 struct snd_soc_dapm_route;
 
+int dapm_reg_event(struct snd_soc_dapm_widget *w,
+                  struct snd_kcontrol *kcontrol, int event);
+
 /* dapm controls */
 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol);
index 250e02c8f8f9b6f68e33a008b5cab014068b8902..7e6dae1ae727b3573079784391aa500c434f0110 100644 (file)
@@ -522,7 +522,7 @@ config CC_OPTIMIZE_FOR_SIZE
          Enabling this option will pass "-Os" instead of "-O2" to gcc
          resulting in a smaller kernel.
 
-         If unsure, say N.
+         If unsure, say Y.
 
 config SYSCTL
        bool
index 7963e3fc51d9c8a60550c934210b987e375a0860..a379c9061199c64368936a88f91353992a4d5f92 100644 (file)
@@ -170,7 +170,7 @@ void __cpuinit calibrate_delay(void)
                                loops_per_jiffy &= ~loopbit;
                }
        }
-       printk(KERN_INFO "%lu.%02lu BogoMIPS (lpj=%lu)\n",
+       printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
                        loops_per_jiffy/(500000/HZ),
                        (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
 }
index e092f1c0ce3030916d9ad4c3af2b90fd64082f15..4414e93d875018b89b6363e2821093c38600d776 100644 (file)
@@ -707,12 +707,14 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                if (status_get->mask & AUDIT_STATUS_ENABLED) {
                        err = audit_set_enabled(status_get->enabled,
                                                loginuid, sessionid, sid);
-                       if (err < 0) return err;
+                       if (err < 0)
+                               return err;
                }
                if (status_get->mask & AUDIT_STATUS_FAILURE) {
                        err = audit_set_failure(status_get->failure,
                                                loginuid, sessionid, sid);
-                       if (err < 0) return err;
+                       if (err < 0)
+                               return err;
                }
                if (status_get->mask & AUDIT_STATUS_PID) {
                        int new_pid = status_get->pid;
@@ -725,9 +727,12 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                        audit_pid = new_pid;
                        audit_nlk_pid = NETLINK_CB(skb).pid;
                }
-               if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
+               if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) {
                        err = audit_set_rate_limit(status_get->rate_limit,
                                                   loginuid, sessionid, sid);
+                       if (err < 0)
+                               return err;
+               }
                if (status_get->mask & AUDIT_STATUS_BACKLOG_LIMIT)
                        err = audit_set_backlog_limit(status_get->backlog_limit,
                                                      loginuid, sessionid, sid);
@@ -1366,7 +1371,7 @@ int audit_string_contains_control(const char *string, size_t len)
 {
        const unsigned char *p;
        for (p = string; p < (const unsigned char *)string + len && *p; p++) {
-               if (*p == '"' || *p < 0x21 || *p > 0x7f)
+               if (*p == '"' || *p < 0x21 || *p > 0x7e)
                        return 1;
        }
        return 0;
index 98c50cc671bb85525f8534cc422bc692dbef5dc9..b7d354e2b0ef35d618f7a69fee70d301078faa02 100644 (file)
@@ -1022,8 +1022,11 @@ static void audit_update_watch(struct audit_parent *parent,
                        struct audit_buffer *ab;
                        ab = audit_log_start(NULL, GFP_KERNEL,
                                AUDIT_CONFIG_CHANGE);
+                       audit_log_format(ab, "auid=%u ses=%u",
+                               audit_get_loginuid(current),
+                               audit_get_sessionid(current));
                        audit_log_format(ab,
-                               "op=updated rules specifying path=");
+                               " op=updated rules specifying path=");
                        audit_log_untrustedstring(ab, owatch->path);
                        audit_log_format(ab, " with dev=%u ino=%lu\n",
                                 dev, ino);
@@ -1058,7 +1061,10 @@ static void audit_remove_parent_watches(struct audit_parent *parent)
                                struct audit_buffer *ab;
                                ab = audit_log_start(NULL, GFP_KERNEL,
                                        AUDIT_CONFIG_CHANGE);
-                               audit_log_format(ab, "op=remove rule path=");
+                               audit_log_format(ab, "auid=%u ses=%u",
+                                       audit_get_loginuid(current),
+                                       audit_get_sessionid(current));
+                               audit_log_format(ab, " op=remove rule path=");
                                audit_log_untrustedstring(ab, w->path);
                                if (r->filterkey) {
                                        audit_log_format(ab, " key=");
index 4699950e65bd46a06e58a330c75f01ddff3f3d28..496c3dd372761a4862791658d7635db3fca87e65 100644 (file)
@@ -610,7 +610,7 @@ static int audit_filter_rules(struct task_struct *tsk,
                if (!result)
                        return 0;
        }
-       if (rule->filterkey)
+       if (rule->filterkey && ctx)
                ctx->filterkey = kstrdup(rule->filterkey, GFP_ATOMIC);
        switch (rule->action) {
        case AUDIT_NEVER:    *state = AUDIT_DISABLED;       break;
@@ -2375,7 +2375,7 @@ int __audit_signal_info(int sig, struct task_struct *t)
        struct audit_context *ctx = tsk->audit_context;
 
        if (audit_pid && t->tgid == audit_pid) {
-               if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) {
+               if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) {
                        audit_sig_pid = tsk->pid;
                        if (tsk->loginuid != -1)
                                audit_sig_uid = tsk->loginuid;
index eb4d6470d1d01f79a33a94df89833c3ba7d4387a..38ec40630149bd07b97f06d406d9398763a6de8c 100644 (file)
@@ -911,10 +911,10 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
                tsk->exit_signal = SIGCHLD;
 
        signal = tracehook_notify_death(tsk, &cookie, group_dead);
-       if (signal > 0)
+       if (signal >= 0)
                signal = do_notify_parent(tsk, signal);
 
-       tsk->exit_state = signal < 0 ? EXIT_DEAD : EXIT_ZOMBIE;
+       tsk->exit_state = signal == DEATH_REAP ? EXIT_DEAD : EXIT_ZOMBIE;
 
        /* mt-exec, de_thread() is waiting for us */
        if (thread_group_leader(tsk) &&
@@ -927,7 +927,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
        tracehook_report_death(tsk, signal, cookie, group_dead);
 
        /* If the process is dead, release it - nobody will wait for it */
-       if (signal < 0)
+       if (signal == DEATH_REAP)
                release_task(tsk);
 }
 
index 3ec23c3ec97fae75910a399b4b7200fb6a9169c6..eaa21fc9ad1d54250142a6c806115267865d3be6 100644 (file)
 
 static int kgdb_break_asap;
 
+#define KGDB_MAX_THREAD_QUERY 17
 struct kgdb_state {
        int                     ex_vector;
        int                     signo;
        int                     err_code;
        int                     cpu;
        int                     pass_exception;
+       unsigned long           thr_query;
        unsigned long           threadid;
        long                    kgdb_usethreadid;
        struct pt_regs          *linux_regs;
@@ -166,13 +168,6 @@ early_param("nokgdbroundup", opt_nokgdbroundup);
  * Weak aliases for breakpoint management,
  * can be overriden by architectures when needed:
  */
-int __weak kgdb_validate_break_address(unsigned long addr)
-{
-       char tmp_variable[BREAK_INSTR_SIZE];
-
-       return probe_kernel_read(tmp_variable, (char *)addr, BREAK_INSTR_SIZE);
-}
-
 int __weak kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
 {
        int err;
@@ -191,6 +186,25 @@ int __weak kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
                                  (char *)bundle, BREAK_INSTR_SIZE);
 }
 
+int __weak kgdb_validate_break_address(unsigned long addr)
+{
+       char tmp_variable[BREAK_INSTR_SIZE];
+       int err;
+       /* Validate setting the breakpoint and then removing it.  In the
+        * remove fails, the kernel needs to emit a bad message because we
+        * are deep trouble not being able to put things back the way we
+        * found them.
+        */
+       err = kgdb_arch_set_breakpoint(addr, tmp_variable);
+       if (err)
+               return err;
+       err = kgdb_arch_remove_breakpoint(addr, tmp_variable);
+       if (err)
+               printk(KERN_ERR "KGDB: Critical breakpoint error, kernel "
+                  "memory destroyed at: %lx", addr);
+       return err;
+}
+
 unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs)
 {
        return instruction_pointer(regs);
@@ -433,9 +447,14 @@ int kgdb_hex2long(char **ptr, unsigned long *long_val)
 {
        int hex_val;
        int num = 0;
+       int negate = 0;
 
        *long_val = 0;
 
+       if (**ptr == '-') {
+               negate = 1;
+               (*ptr)++;
+       }
        while (**ptr) {
                hex_val = hex(**ptr);
                if (hex_val < 0)
@@ -446,6 +465,9 @@ int kgdb_hex2long(char **ptr, unsigned long *long_val)
                (*ptr)++;
        }
 
+       if (negate)
+               *long_val = -*long_val;
+
        return num;
 }
 
@@ -515,10 +537,16 @@ static void int_to_threadref(unsigned char *id, int value)
 static struct task_struct *getthread(struct pt_regs *regs, int tid)
 {
        /*
-        * Non-positive TIDs are remapped idle tasks:
+        * Non-positive TIDs are remapped to the cpu shadow information
         */
-       if (tid <= 0)
-               return idle_task(-tid);
+       if (tid == 0 || tid == -1)
+               tid = -atomic_read(&kgdb_active) - 2;
+       if (tid < 0) {
+               if (kgdb_info[-tid - 2].task)
+                       return kgdb_info[-tid - 2].task;
+               else
+                       return idle_task(-tid - 2);
+       }
 
        /*
         * find_task_by_pid_ns() does not take the tasklist lock anymore
@@ -725,14 +753,15 @@ setundefined:
 }
 
 /*
- * Remap normal tasks to their real PID, idle tasks to -1 ... -NR_CPUs:
+ * Remap normal tasks to their real PID,
+ * CPU shadow threads are mapped to -CPU - 2
  */
 static inline int shadow_pid(int realpid)
 {
        if (realpid)
                return realpid;
 
-       return -1-raw_smp_processor_id();
+       return -raw_smp_processor_id() - 2;
 }
 
 static char gdbmsgbuf[BUFMAX + 1];
@@ -826,7 +855,7 @@ static void gdb_cmd_getregs(struct kgdb_state *ks)
                local_debuggerinfo = kgdb_info[ks->cpu].debuggerinfo;
        } else {
                local_debuggerinfo = NULL;
-               for (i = 0; i < NR_CPUS; i++) {
+               for_each_online_cpu(i) {
                        /*
                         * Try to find the task on some other
                         * or possibly this node if we do not
@@ -960,10 +989,13 @@ static int gdb_cmd_reboot(struct kgdb_state *ks)
 /* Handle the 'q' query packets */
 static void gdb_cmd_query(struct kgdb_state *ks)
 {
-       struct task_struct *thread;
+       struct task_struct *g;
+       struct task_struct *p;
        unsigned char thref[8];
        char *ptr;
        int i;
+       int cpu;
+       int finished = 0;
 
        switch (remcom_in_buffer[1]) {
        case 's':
@@ -973,22 +1005,34 @@ static void gdb_cmd_query(struct kgdb_state *ks)
                        break;
                }
 
-               if (remcom_in_buffer[1] == 'f')
-                       ks->threadid = 1;
-
+               i = 0;
                remcom_out_buffer[0] = 'm';
                ptr = remcom_out_buffer + 1;
-
-               for (i = 0; i < 17; ks->threadid++) {
-                       thread = getthread(ks->linux_regs, ks->threadid);
-                       if (thread) {
-                               int_to_threadref(thref, ks->threadid);
+               if (remcom_in_buffer[1] == 'f') {
+                       /* Each cpu is a shadow thread */
+                       for_each_online_cpu(cpu) {
+                               ks->thr_query = 0;
+                               int_to_threadref(thref, -cpu - 2);
                                pack_threadid(ptr, thref);
                                ptr += BUF_THREAD_ID_SIZE;
                                *(ptr++) = ',';
                                i++;
                        }
                }
+
+               do_each_thread(g, p) {
+                       if (i >= ks->thr_query && !finished) {
+                               int_to_threadref(thref, p->pid);
+                               pack_threadid(ptr, thref);
+                               ptr += BUF_THREAD_ID_SIZE;
+                               *(ptr++) = ',';
+                               ks->thr_query++;
+                               if (ks->thr_query % KGDB_MAX_THREAD_QUERY == 0)
+                                       finished = 1;
+                       }
+                       i++;
+               } while_each_thread(g, p);
+
                *(--ptr) = '\0';
                break;
 
@@ -1011,15 +1055,15 @@ static void gdb_cmd_query(struct kgdb_state *ks)
                        error_packet(remcom_out_buffer, -EINVAL);
                        break;
                }
-               if (ks->threadid > 0) {
+               if ((int)ks->threadid > 0) {
                        kgdb_mem2hex(getthread(ks->linux_regs,
                                        ks->threadid)->comm,
                                        remcom_out_buffer, 16);
                } else {
                        static char tmpstr[23 + BUF_THREAD_ID_SIZE];
 
-                       sprintf(tmpstr, "Shadow task %d for pid 0",
-                                       (int)(-ks->threadid-1));
+                       sprintf(tmpstr, "shadowCPU%d",
+                                       (int)(-ks->threadid - 2));
                        kgdb_mem2hex(tmpstr, remcom_out_buffer, strlen(tmpstr));
                }
                break;
index bcdc9ac8ef60da5a2937ce8205e58ab2a2350deb..12c779dc65d48a56f1941cc41d73f9593828cf0a 100644 (file)
@@ -34,6 +34,7 @@
 /***
  * mutex_init - initialize the mutex
  * @lock: the mutex to be initialized
+ * @key: the lock_class_key for the class; used by mutex lock debugging
  *
  * Initialize the mutex to unlocked state.
  *
index 2cfd2721f7ed17f0e1e199082616c861bdd3c63e..9b5d1d7f2ef72bf49f750a4b2bf12344906ddc74 100644 (file)
@@ -4,14 +4,17 @@ config HAVE_ARCH_KGDB
 
 menuconfig KGDB
        bool "KGDB: kernel debugging with remote gdb"
-       select FRAME_POINTER
        depends on HAVE_ARCH_KGDB
        depends on DEBUG_KERNEL && EXPERIMENTAL
        help
          If you say Y here, it will be possible to remotely debug the
-         kernel using gdb.  Documentation of kernel debugger is available
-         at http://kgdb.sourceforge.net as well as in DocBook form
-         in Documentation/DocBook/.  If unsure, say N.
+         kernel using gdb.  It is recommended but not required, that
+         you also turn on the kernel config option
+         CONFIG_FRAME_POINTER to aid in producing more reliable stack
+         backtraces in the external debugger.  Documentation of
+         kernel debugger is available at http://kgdb.sourceforge.net
+         as well as in DocBook form in Documentation/DocBook/.  If
+         unsure, say N.
 
 if KGDB
 
index 889ddce2021e26870b0b287ad0d28e7032e99028..a3b8d4c3f77a5e7e466bd8f5e5591f3dcaa2c3bd 100644 (file)
@@ -80,11 +80,3 @@ void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr)
        }
 }
 EXPORT_SYMBOL(iommu_area_free);
-
-unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
-{
-       unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
-
-       return size >> PAGE_SHIFT;
-}
-EXPORT_SYMBOL(iommu_num_pages);
index ca87d86992bdb7bfd6bb30d4dbe6dcefe2bab7b9..217d5c4b666d22e4f309ad363c157580c2810bf8 100644 (file)
@@ -56,23 +56,12 @@ static u32 __random32(struct rnd_state *state)
        return (state->s1 ^ state->s2 ^ state->s3);
 }
 
-static void __set_random32(struct rnd_state *state, unsigned long s)
+/*
+ * Handle minimum values for seeds
+ */
+static inline u32 __seed(u32 x, u32 m)
 {
-       if (s == 0)
-               s = 1;      /* default seed is 1 */
-
-#define LCG(n) (69069 * n)
-       state->s1 = LCG(s);
-       state->s2 = LCG(state->s1);
-       state->s3 = LCG(state->s2);
-
-       /* "warm it up" */
-       __random32(state);
-       __random32(state);
-       __random32(state);
-       __random32(state);
-       __random32(state);
-       __random32(state);
+       return (x < m) ? x + m : x;
 }
 
 /**
@@ -107,7 +96,7 @@ void srandom32(u32 entropy)
         */
        for_each_possible_cpu (i) {
                struct rnd_state *state = &per_cpu(net_rand_state, i);
-               __set_random32(state, state->s1 ^ entropy);
+               state->s1 = __seed(state->s1 ^ entropy, 1);
        }
 }
 EXPORT_SYMBOL(srandom32);
@@ -122,7 +111,19 @@ static int __init random32_init(void)
 
        for_each_possible_cpu(i) {
                struct rnd_state *state = &per_cpu(net_rand_state,i);
-               __set_random32(state, i + jiffies);
+
+#define LCG(x) ((x) * 69069)   /* super-duper LCG */
+               state->s1 = __seed(LCG(i + jiffies), 1);
+               state->s2 = __seed(LCG(state->s1), 7);
+               state->s3 = __seed(LCG(state->s2), 15);
+
+               /* "warm it up" */
+               __random32(state);
+               __random32(state);
+               __random32(state);
+               __random32(state);
+               __random32(state);
+               __random32(state);
        }
        return 0;
 }
@@ -135,13 +136,18 @@ core_initcall(random32_init);
 static int __init random32_reseed(void)
 {
        int i;
-       unsigned long seed;
 
        for_each_possible_cpu(i) {
                struct rnd_state *state = &per_cpu(net_rand_state,i);
+               u32 seeds[3];
+
+               get_random_bytes(&seeds, sizeof(seeds));
+               state->s1 = __seed(seeds[0], 1);
+               state->s2 = __seed(seeds[1], 7);
+               state->s3 = __seed(seeds[2], 15);
 
-               get_random_bytes(&seed, sizeof(seed));
-               __set_random32(state, seed);
+               /* mix it in */
+               __random32(state);
        }
        return 0;
 }
index 254ce2b901588f48a06f61da5692aa82b93ee0cd..28a2980ee4359cb43bcc530c22e3906c5169dbab 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/mutex.h>
 #include <linux/bootmem.h>
 #include <linux/sysfs.h>
-
+#include <asm/io.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
@@ -1283,7 +1283,12 @@ module_exit(hugetlb_exit);
 
 static int __init hugetlb_init(void)
 {
-       BUILD_BUG_ON(HPAGE_SHIFT == 0);
+       /* Some platform decide whether they support huge pages at boot
+        * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
+        * there is no such support
+        */
+       if (HPAGE_SHIFT == 0)
+               return 0;
 
        if (!size_to_hstate(default_hstate_size)) {
                default_hstate_size = HPAGE_SIZE;
index 0e4eea10c7b0bd63579e0c2e25a6ae1ae51551bb..a472bcd4b061615504bce67bf93b28cfd723e044 100644 (file)
@@ -993,7 +993,6 @@ unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
                tlb_finish_mmu(tlb, address, end);
        return end;
 }
-EXPORT_SYMBOL_GPL(zap_page_range);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
@@ -1111,7 +1110,6 @@ no_page_table:
        }
        return page;
 }
-EXPORT_SYMBOL_GPL(follow_page);
 
 /* Can we do the FOLL_ANON optimization? */
 static inline int use_zero_page(struct vm_area_struct *vma)
@@ -2767,16 +2765,26 @@ int make_pages_present(unsigned long addr, unsigned long end)
 
        vma = find_vma(current->mm, addr);
        if (!vma)
-               return -1;
+               return -ENOMEM;
        write = (vma->vm_flags & VM_WRITE) != 0;
        BUG_ON(addr >= end);
        BUG_ON(end > vma->vm_end);
        len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE;
        ret = get_user_pages(current, current->mm, addr,
                        len, write, 0, NULL, NULL);
-       if (ret < 0)
+       if (ret < 0) {
+               /*
+                  SUS require strange return value to mlock
+                   - invalid addr generate to ENOMEM.
+                   - out of memory should generate EAGAIN.
+               */
+               if (ret == -EFAULT)
+                       ret = -ENOMEM;
+               else if (ret == -ENOMEM)
+                       ret = -EAGAIN;
                return ret;
-       return ret == len ? 0 : -1;
+       }
+       return ret == len ? 0 : -ENOMEM;
 }
 
 #if !defined(__HAVE_ARCH_GATE_AREA)
index 7b2656055d6a96a6b940574e4d23f0a4fc7dd6bc..01fbe93eff5ca25f1143b1295da6ce7115e00bde 100644 (file)
@@ -78,8 +78,6 @@ success:
 
        mm->locked_vm -= pages;
 out:
-       if (ret == -ENOMEM)
-               ret = -EAGAIN;
        return ret;
 }
 
index e68443d7456702767d1b4c6213d5bb006f048b67..894e9a70699fe8bbc7e39aa7cef7f68032cabede 100644 (file)
@@ -104,7 +104,6 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
        cancel_dirty_page(page, PAGE_CACHE_SIZE);
 
        remove_from_page_cache(page);
-       ClearPageUptodate(page);
        ClearPageMappedToDisk(page);
        page_cache_release(page);       /* pagecache ref */
 }
@@ -356,7 +355,6 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page)
        BUG_ON(PagePrivate(page));
        __remove_from_page_cache(page);
        spin_unlock_irq(&mapping->tree_lock);
-       ClearPageUptodate(page);
        page_cache_release(page);       /* pagecache ref */
        return 1;
 failed:
index 4fccaa1e07be2b8aff15f0159afe526453752d0e..11b16d16661c18e458c9d624b8fcc4cfe4f4a67b 100644 (file)
@@ -62,11 +62,13 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg, struct mpoa_client *mpc
 static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc);
 static void set_mps_mac_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc);
 
-static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac,
-                         uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type);
+static const uint8_t *copy_macs(struct mpoa_client *mpc,
+                               const uint8_t *router_mac,
+                               const uint8_t *tlvs, uint8_t mps_macs,
+                               uint8_t device_type);
 static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry);
 
-static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc);
+static void send_set_mps_ctrl_addr(const char *addr, struct mpoa_client *mpc);
 static void mpoad_close(struct atm_vcc *vcc);
 static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb);
 
@@ -351,12 +353,12 @@ static const char *mpoa_device_type_string(char type)
  * lec sees a TLV it uses the pointer to call this function.
  *
  */
-static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr,
-                           uint8_t *tlvs, uint32_t sizeoftlvs)
+static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
+                           const u8 *tlvs, u32 sizeoftlvs)
 {
        uint32_t type;
        uint8_t length, mpoa_device_type, number_of_mps_macs;
-       uint8_t *end_of_tlvs;
+       const uint8_t *end_of_tlvs;
        struct mpoa_client *mpc;
 
        mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */
@@ -430,8 +432,10 @@ static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr,
  * plus the possible MAC address(es) to mpc->mps_macs.
  * For a freshly allocated MPOA client mpc->mps_macs == 0.
  */
-static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac,
-                         uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type)
+static const uint8_t *copy_macs(struct mpoa_client *mpc,
+                               const uint8_t *router_mac,
+                               const uint8_t *tlvs, uint8_t mps_macs,
+                               uint8_t device_type)
 {
        int num_macs;
        num_macs = (mps_macs > 1) ? mps_macs : 1;
@@ -811,7 +815,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
        return arg;
 }
 
-static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc)
+static void send_set_mps_ctrl_addr(const char *addr, struct mpoa_client *mpc)
 {
        struct k_message mesg;
 
index d9449df7cad518d52d499b201d4e2cfd6ab4718f..9b58d70b0e7d2a4a79129a2a7c769a7b70c3c5bc 100644 (file)
@@ -68,10 +68,17 @@ static int br_dev_stop(struct net_device *dev)
 
 static int br_change_mtu(struct net_device *dev, int new_mtu)
 {
-       if (new_mtu < 68 || new_mtu > br_min_mtu(netdev_priv(dev)))
+       struct net_bridge *br = netdev_priv(dev);
+       if (new_mtu < 68 || new_mtu > br_min_mtu(br))
                return -EINVAL;
 
        dev->mtu = new_mtu;
+
+#ifdef CONFIG_BRIDGE_NETFILTER
+       /* remember the MTU in the rtable for PMTU */
+       br->fake_rtable.u.dst.metrics[RTAX_MTU - 1] = new_mtu;
+#endif
+
        return 0;
 }
 
index a072ea5ca6f58fc90b48e0b663cbaac4ff039816..63c18aacde8cbfc13b31d38bc040711805e97725 100644 (file)
@@ -202,6 +202,9 @@ static struct net_device *new_bridge_dev(const char *name)
        br->topology_change = 0;
        br->topology_change_detected = 0;
        br->ageing_time = 300 * HZ;
+
+       br_netfilter_rtable_init(br);
+
        INIT_LIST_HEAD(&br->age_list);
 
        br_stp_timer_init(br);
index bb90cd7bace326b06710e95155aa6b72ee3a0339..6e280a8a31ee025527463c35381459442f1d4d9f 100644 (file)
@@ -101,33 +101,30 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb)
         pppoe_proto(skb) == htons(PPP_IPV6) && \
         brnf_filter_pppoe_tagged)
 
-/* We need these fake structures to make netfilter happy --
- * lots of places assume that skb->dst != NULL, which isn't
- * all that unreasonable.
- *
+/*
+ * Initialize bogus route table used to keep netfilter happy.
  * Currently, we fill in the PMTU entry because netfilter
  * refragmentation needs it, and the rt_flags entry because
  * ipt_REJECT needs it.  Future netfilter modules might
- * require us to fill additional fields. */
-static struct net_device __fake_net_device = {
-       .hard_header_len        = ETH_HLEN,
-#ifdef CONFIG_NET_NS
-       .nd_net                 = &init_net,
-#endif
-};
+ * require us to fill additional fields.
+ */
+void br_netfilter_rtable_init(struct net_bridge *br)
+{
+       struct rtable *rt = &br->fake_rtable;
 
-static struct rtable __fake_rtable = {
-       .u = {
-               .dst = {
-                       .__refcnt               = ATOMIC_INIT(1),
-                       .dev                    = &__fake_net_device,
-                       .path                   = &__fake_rtable.u.dst,
-                       .metrics                = {[RTAX_MTU - 1] = 1500},
-                       .flags                  = DST_NOXFRM,
-               }
-       },
-       .rt_flags       = 0,
-};
+       atomic_set(&rt->u.dst.__refcnt, 1);
+       rt->u.dst.dev = &br->dev;
+       rt->u.dst.path = &rt->u.dst;
+       rt->u.dst.metrics[RTAX_MTU - 1] = 1500;
+       rt->u.dst.flags = DST_NOXFRM;
+}
+
+static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
+{
+       struct net_bridge_port *port = rcu_dereference(dev->br_port);
+
+       return port ? &port->br->fake_rtable : NULL;
+}
 
 static inline struct net_device *bridge_parent(const struct net_device *dev)
 {
@@ -226,8 +223,12 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
        }
        nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
 
-       skb->rtable = &__fake_rtable;
-       dst_hold(&__fake_rtable.u.dst);
+       skb->rtable = bridge_parent_rtable(nf_bridge->physindev);
+       if (!skb->rtable) {
+               kfree_skb(skb);
+               return 0;
+       }
+       dst_hold(&skb->rtable->u.dst);
 
        skb->dev = nf_bridge->physindev;
        nf_bridge_push_encap_header(skb);
@@ -391,8 +392,12 @@ bridged_dnat:
                        skb->pkt_type = PACKET_HOST;
                }
        } else {
-               skb->rtable = &__fake_rtable;
-               dst_hold(&__fake_rtable.u.dst);
+               skb->rtable = bridge_parent_rtable(nf_bridge->physindev);
+               if (!skb->rtable) {
+                       kfree_skb(skb);
+                       return 0;
+               }
+               dst_hold(&skb->rtable->u.dst);
        }
 
        skb->dev = nf_bridge->physindev;
@@ -611,8 +616,8 @@ static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff *skb,
                                   const struct net_device *out,
                                   int (*okfn)(struct sk_buff *))
 {
-       if (skb->rtable == &__fake_rtable) {
-               dst_release(&__fake_rtable.u.dst);
+       if (skb->rtable && skb->rtable == bridge_parent_rtable(in)) {
+               dst_release(&skb->rtable->u.dst);
                skb->rtable = NULL;
        }
 
index 815ed38925b2d428c1713709d11c7b45bfe0ad6e..c3dc18ddc0431b87fa02135b99ddb0f7bbf08d4c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <linux/netdevice.h>
 #include <linux/if_bridge.h>
+#include <net/route.h>
 
 #define BR_HASH_BITS 8
 #define BR_HASH_SIZE (1 << BR_HASH_BITS)
@@ -92,6 +93,9 @@ struct net_bridge
        struct hlist_head               hash[BR_HASH_SIZE];
        struct list_head                age_list;
        unsigned long                   feature_mask;
+#ifdef CONFIG_BRIDGE_NETFILTER
+       struct rtable                   fake_rtable;
+#endif
        unsigned long                   flags;
 #define BR_SET_MAC_ADDR                0x00000001
 
@@ -197,9 +201,11 @@ extern int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd, void __us
 #ifdef CONFIG_BRIDGE_NETFILTER
 extern int br_netfilter_init(void);
 extern void br_netfilter_fini(void);
+extern void br_netfilter_rtable_init(struct net_bridge *);
 #else
 #define br_netfilter_init()    (0)
 #define br_netfilter_fini()    do { } while(0)
+#define br_netfilter_rtable_init(x)
 #endif
 
 /* br_stp.c */
index 63d6bcddbf46d1b09388191da411d038b77adee6..69320a56a084667d860ccbd4d4b5573e6977672d 100644 (file)
@@ -4200,6 +4200,7 @@ static void netdev_init_queues(struct net_device *dev)
 {
        netdev_init_one_queue(dev, &dev->rx_queue, NULL);
        netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
+       spin_lock_init(&dev->tx_global_lock);
 }
 
 /**
index c12720895ecf90c049723f3cf9d854e78586ebeb..6c7af390be0a515cfb1d09d2db79f16776e0dbe4 100644 (file)
@@ -70,6 +70,7 @@ static void queue_process(struct work_struct *work)
                local_irq_save(flags);
                __netif_tx_lock(txq, smp_processor_id());
                if (netif_tx_queue_stopped(txq) ||
+                   netif_tx_queue_frozen(txq) ||
                    dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
                        skb_queue_head(&npinfo->txq, skb);
                        __netif_tx_unlock(txq);
index c7d484f7e1c42ff2bc3e1f0ad9b32c75e72c52fd..3284605f2ec74dd5ea896b01ef24eb1712c92c9c 100644 (file)
@@ -3305,6 +3305,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
 
        txq = netdev_get_tx_queue(odev, queue_map);
        if (netif_tx_queue_stopped(txq) ||
+           netif_tx_queue_frozen(txq) ||
            need_resched()) {
                idle_start = getCurUs();
 
@@ -3320,7 +3321,8 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
 
                pkt_dev->idle_acc += getCurUs() - idle_start;
 
-               if (netif_tx_queue_stopped(txq)) {
+               if (netif_tx_queue_stopped(txq) ||
+                   netif_tx_queue_frozen(txq)) {
                        pkt_dev->next_tx_us = getCurUs();       /* TODO */
                        pkt_dev->next_tx_ns = 0;
                        goto out;       /* Try the next interface */
@@ -3352,7 +3354,8 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
        txq = netdev_get_tx_queue(odev, queue_map);
 
        __netif_tx_lock_bh(txq);
-       if (!netif_tx_queue_stopped(txq)) {
+       if (!netif_tx_queue_stopped(txq) &&
+           !netif_tx_queue_frozen(txq)) {
 
                atomic_inc(&(pkt_dev->skb->users));
              retry_now:
index 1819ad7ab910988c1c29b805f1ec5cdd9ecc4715..fafe8ebb4c552f1738c8d3b617a6026e84b77631 100644 (file)
@@ -475,11 +475,10 @@ static void arp_print(struct arp_payload *payload)
 #define HBUFFERLEN 30
        char hbuffer[HBUFFERLEN];
        int j,k;
-       const char hexbuf[]= "0123456789abcdef";
 
        for (k=0, j=0; k < HBUFFERLEN-3 && j < ETH_ALEN; j++) {
-               hbuffer[k++]=hexbuf[(payload->src_hw[j]>>4)&15];
-               hbuffer[k++]=hexbuf[payload->src_hw[j]&15];
+               hbuffer[k++] = hex_asc_hi(payload->src_hw[j]);
+               hbuffer[k++] = hex_asc_lo(payload->src_hw[j]);
                hbuffer[k++]=':';
        }
        hbuffer[--k]='\0';
index 21cb053f5d7dbe46b4d8b7aff9da9a6167fcf43d..3974d7cae5c02a05219e712ede460a7091fac964 100644 (file)
@@ -305,10 +305,10 @@ static void recent_mt_destroy(const struct xt_match *match, void *matchinfo)
                spin_lock_bh(&recent_lock);
                list_del(&t->list);
                spin_unlock_bh(&recent_lock);
-               recent_table_flush(t);
 #ifdef CONFIG_PROC_FS
                remove_proc_entry(t->name, proc_dir);
 #endif
+               recent_table_flush(t);
                kfree(t);
        }
        mutex_unlock(&recent_mutex);
index 380d6474cf661d91fb45ef88699c526b23dabd01..1bfa078ddbd0c357d97c269179b713c09b0a0ad3 100644 (file)
@@ -3216,14 +3216,18 @@ int __init ip_rt_init(void)
        return rc;
 }
 
+#ifdef CONFIG_SYSCTL
 /*
  * We really need to sanitize the damn ipv4 init order, then all
  * this nonsense will go away.
  */
 void __init ip_static_sysctl_init(void)
 {
+#ifdef CONFIG_SYSCTL
        register_sysctl_paths(ipv4_route_path, ipv4_route_table);
+#endif
 }
+#endif
 
 EXPORT_SYMBOL(__ip_select_ident);
 EXPORT_SYMBOL(ip_route_input);
index b3875c0d83c726943666cf3eadbf768d7662848e..91a8cfddf1c46f312d523a9e02d325e0cd322aad 100644 (file)
@@ -655,8 +655,8 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
                rep.th.doff = arg.iov[0].iov_len/4;
 
                tcp_v4_md5_hash_hdr((__u8 *) &rep.opt[offset],
-                                   key, ip_hdr(skb)->daddr,
-                                   ip_hdr(skb)->saddr, &rep.th);
+                                   key, ip_hdr(skb)->saddr,
+                                   ip_hdr(skb)->daddr, &rep.th);
        }
 #endif
        arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
index 6811901e6b1ec94c0e3084de16c7b8c408bb0503..a027003d69a483057024633a984da6e6e6e51cda 100644 (file)
@@ -236,6 +236,10 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
        skb_reset_network_header(skb);
        hdr = ipv6_hdr(skb);
 
+       /* Allow local fragmentation. */
+       if (ipfragok)
+               skb->local_df = 1;
+
        /*
         *      Fill in the IPv6 header
         */
index 1db45216b2327fea71c3b78776ce608e8534d2ec..78185a409212d5476fcf855defbda0b41939adaf 100644 (file)
@@ -748,7 +748,7 @@ static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp,
        ipv6_addr_copy(&bp->saddr, saddr);
        ipv6_addr_copy(&bp->daddr, daddr);
        bp->protocol = cpu_to_be32(IPPROTO_TCP);
-       bp->len = cpu_to_be16(nbytes);
+       bp->len = cpu_to_be32(nbytes);
 
        sg_init_one(&sg, bp, sizeof(*bp));
        return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp));
@@ -1094,8 +1094,8 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
                *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
                                (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG);
                tcp_v6_md5_hash_hdr((__u8 *)topt, key,
-                                   &ipv6_hdr(skb)->daddr,
-                                   &ipv6_hdr(skb)->saddr, t1);
+                                   &ipv6_hdr(skb)->saddr,
+                                   &ipv6_hdr(skb)->daddr, t1);
        }
 #endif
 
index 420a10d8eb1ec7fdc449cc4304afcbe00f4b9e98..6f61261888eff8861699c5bcbdb767ef1cc9051e 100644 (file)
@@ -67,7 +67,8 @@ static const char *const tcp_conntrack_names[] = {
 /* RFC1122 says the R2 limit should be at least 100 seconds.
    Linux uses 15 packets as limit, which corresponds
    to ~13-30min depending on RTO. */
-static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly =   5 MINS;
+static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly    =   5 MINS;
+static unsigned int nf_ct_tcp_timeout_unacknowledged __read_mostly =   5 MINS;
 
 static unsigned int tcp_timeouts[TCP_CONNTRACK_MAX] __read_mostly = {
        [TCP_CONNTRACK_SYN_SENT]        = 2 MINS,
@@ -625,8 +626,10 @@ static bool tcp_in_window(const struct nf_conn *ct,
                swin = win + (sack - ack);
                if (sender->td_maxwin < swin)
                        sender->td_maxwin = swin;
-               if (after(end, sender->td_end))
+               if (after(end, sender->td_end)) {
                        sender->td_end = end;
+                       sender->flags |= IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED;
+               }
                /*
                 * Update receiver data.
                 */
@@ -637,6 +640,8 @@ static bool tcp_in_window(const struct nf_conn *ct,
                        if (win == 0)
                                receiver->td_maxend++;
                }
+               if (ack == receiver->td_end)
+                       receiver->flags &= ~IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED;
 
                /*
                 * Check retransmissions.
@@ -951,9 +956,16 @@ static int tcp_packet(struct nf_conn *ct,
        if (old_state != new_state
            && new_state == TCP_CONNTRACK_FIN_WAIT)
                ct->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT;
-       timeout = ct->proto.tcp.retrans >= nf_ct_tcp_max_retrans
-                 && tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans
-                 ? nf_ct_tcp_timeout_max_retrans : tcp_timeouts[new_state];
+
+       if (ct->proto.tcp.retrans >= nf_ct_tcp_max_retrans &&
+           tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans)
+               timeout = nf_ct_tcp_timeout_max_retrans;
+       else if ((ct->proto.tcp.seen[0].flags | ct->proto.tcp.seen[1].flags) &
+                IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED &&
+                tcp_timeouts[new_state] > nf_ct_tcp_timeout_unacknowledged)
+               timeout = nf_ct_tcp_timeout_unacknowledged;
+       else
+               timeout = tcp_timeouts[new_state];
        write_unlock_bh(&tcp_lock);
 
        nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb);
@@ -1235,6 +1247,13 @@ static struct ctl_table tcp_sysctl_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec_jiffies,
        },
+       {
+               .procname       = "nf_conntrack_tcp_timeout_unacknowledged",
+               .data           = &nf_ct_tcp_timeout_unacknowledged,
+               .maxlen         = sizeof(unsigned int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec_jiffies,
+       },
        {
                .ctl_name       = NET_NF_CONNTRACK_TCP_LOOSE,
                .procname       = "nf_conntrack_tcp_loose",
index 6809af542a2c8e305054afa28a6f1008f8badb1f..d9418a26781202e5a2b927b211f9976a14375a10 100644 (file)
@@ -367,9 +367,7 @@ static void htable_gc(unsigned long htlong)
 
 static void htable_destroy(struct xt_hashlimit_htable *hinfo)
 {
-       /* remove timer, if it is pending */
-       if (timer_pending(&hinfo->timer))
-               del_timer(&hinfo->timer);
+       del_timer_sync(&hinfo->timer);
 
        /* remove proc entry */
        remove_proc_entry(hinfo->pde->name,
index 345838a2e369559885d501ebe8d948d639d124b9..9c9cd4d94890d1b1c5fb7d582af730f37248cfc0 100644 (file)
@@ -135,7 +135,8 @@ static inline int qdisc_restart(struct Qdisc *q)
        txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
 
        HARD_TX_LOCK(dev, txq, smp_processor_id());
-       if (!netif_subqueue_stopped(dev, skb))
+       if (!netif_tx_queue_stopped(txq) &&
+           !netif_tx_queue_frozen(txq))
                ret = dev_hard_start_xmit(skb, dev, txq);
        HARD_TX_UNLOCK(dev, txq);
 
@@ -162,7 +163,8 @@ static inline int qdisc_restart(struct Qdisc *q)
                break;
        }
 
-       if (ret && netif_tx_queue_stopped(txq))
+       if (ret && (netif_tx_queue_stopped(txq) ||
+                   netif_tx_queue_frozen(txq)))
                ret = 0;
 
        return ret;
index 537223642b6e834423b7b02a7a26a6bc7664ba5d..2c35c678563bec7fafaed3125fe36477b1a7c567 100644 (file)
@@ -305,10 +305,11 @@ restart:
 
                switch (teql_resolve(skb, skb_res, slave)) {
                case 0:
-                       if (netif_tx_trylock(slave)) {
-                               if (!__netif_subqueue_stopped(slave, subq) &&
+                       if (__netif_tx_trylock(slave_txq)) {
+                               if (!netif_tx_queue_stopped(slave_txq) &&
+                                   !netif_tx_queue_frozen(slave_txq) &&
                                    slave->hard_start_xmit(skb, slave) == 0) {
-                                       netif_tx_unlock(slave);
+                                       __netif_tx_unlock(slave_txq);
                                        master->slaves = NEXT_SLAVE(q);
                                        netif_wake_queue(dev);
                                        master->stats.tx_packets++;
@@ -316,7 +317,7 @@ restart:
                                                qdisc_pkt_len(skb);
                                        return 0;
                                }
-                               netif_tx_unlock(slave);
+                               __netif_tx_unlock(slave_txq);
                        }
                        if (netif_queue_stopped(dev))
                                busy = 1;
index f63a663de1589106a05897270b56709e5400034a..6bf8e87f1dcf124021083b25babe9aab317b7bbf 100644 (file)
@@ -50,8 +50,12 @@ PHONY +=  __fw_install __fw_modinst FORCE
 .PHONY: $(PHONY)
 
 __fw_install: $(installed-fw)
+
 __fw_modinst: $(installed-mod-fw)
+       @:
+
 __fw_modbuild: $(addprefix $(obj)/,$(mod-fw))
+       @:
 
 FORCE:
 
index 4f8a3007e45706117a74fe316a28c28c7e46486f..c249274e005a93144c29759d877419a3d196423e 100644 (file)
@@ -545,6 +545,8 @@ int main(int argc, char **argv)
                        }
                        fputs(sym->name, dumpfile);
                        putc(' ', dumpfile);
+                       if (sym->is_extern)
+                               fputs("extern ", dumpfile);
                        print_list(dumpfile, sym->defn);
                        putc('\n', dumpfile);
 
index 2a176988d468bb10d05fcf605f8b4302eeaddc12..2ac23bcca5b537fad4c8b06401404b20adb03e9e 100644 (file)
@@ -6,10 +6,19 @@
 
 /* A lexical scanner generated by flex */
 
+/* %not-for-header */
+
+/* %if-c-only */
+/* %if-not-reentrant */
+
+/* %endif */
+/* %endif */
+/* %ok-for-header */
+
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 33
+#define YY_FLEX_SUBMINOR_VERSION 35
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -47,7 +56,7 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  * if you want the limit (max/min) macros for int types. 
@@ -70,7 +79,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -101,6 +109,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 /* %endif */
@@ -115,11 +125,12 @@ typedef unsigned int flex_uint32_t;
 
 #else  /* ! __cplusplus */
 
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
 #endif /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
@@ -218,14 +229,9 @@ extern FILE *yyin, *yyout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
 #endif
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -401,7 +407,7 @@ void yyfree (void *  );
 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
 /* Begin user sect3 */
 
-#define yywrap() 1
+#define yywrap(n) 1
 #define YY_SKIP_YYWRAP
 
 #define FLEX_DEBUG
@@ -613,8 +619,8 @@ int yy_flex_debug = 1;
 
 static yyconst flex_int16_t yy_rule_linenum[13] =
     {   0,
-       69,   70,   71,   74,   77,   78,   79,   85,   86,   87,
-       89,   92
+       71,   72,   73,   76,   79,   80,   81,   87,   88,   89,
+       91,   94
     } ;
 
 /* The intent behind this definition is that it'll catch
@@ -665,7 +671,8 @@ char *yytext;
    quite so pedantic.  */
 
 /* We don't do multiple input files.  */
-#line 669 "scripts/genksyms/lex.c"
+#define YY_NO_INPUT 1
+#line 676 "scripts/genksyms/lex.c"
 
 #define INITIAL 0
 #define V2_TOKENS 1
@@ -695,9 +702,39 @@ static int yy_init_globals (void );
 /* %endif */
 /* %if-reentrant */
 /* %endif */
+/* %endif End reentrant structures and macros. */
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
+
 /* %if-bison-bridge */
 /* %endif */
-/* %endif End reentrant structures and macros. */
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -756,7 +793,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
 /* %endif */
 /* %if-c++-only C++ definition */
 /* %endif */
@@ -881,12 +918,12 @@ YY_DECL
        register int yy_act;
     
 /* %% [7.0] user's declarations go here */
-#line 65 "scripts/genksyms/lex.l"
+#line 67 "scripts/genksyms/lex.l"
 
 
 
  /* Keep track of our location in the original source files.  */
-#line 890 "scripts/genksyms/lex.c"
+#line 927 "scripts/genksyms/lex.c"
 
        if ( !(yy_init) )
                {
@@ -1004,42 +1041,42 @@ do_action:      /* This label is used only to access EOF actions. */
 case 1:
 /* rule 1 can match eol */
 YY_RULE_SETUP
-#line 69 "scripts/genksyms/lex.l"
+#line 71 "scripts/genksyms/lex.l"
 return FILENAME;
        YY_BREAK
 case 2:
 /* rule 2 can match eol */
 YY_RULE_SETUP
-#line 70 "scripts/genksyms/lex.l"
+#line 72 "scripts/genksyms/lex.l"
 cur_line++;
        YY_BREAK
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 71 "scripts/genksyms/lex.l"
+#line 73 "scripts/genksyms/lex.l"
 cur_line++;
        YY_BREAK
 /* Ignore all other whitespace.  */
 case 4:
 YY_RULE_SETUP
-#line 74 "scripts/genksyms/lex.l"
+#line 76 "scripts/genksyms/lex.l"
 ;
        YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 77 "scripts/genksyms/lex.l"
+#line 79 "scripts/genksyms/lex.l"
 return STRING;
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 78 "scripts/genksyms/lex.l"
+#line 80 "scripts/genksyms/lex.l"
 return CHAR;
        YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 79 "scripts/genksyms/lex.l"
+#line 81 "scripts/genksyms/lex.l"
 return IDENT;
        YY_BREAK
 /* The Pedant requires that the other C multi-character tokens be
@@ -1048,36 +1085,36 @@ return IDENT;
     around them properly.  */
 case 8:
 YY_RULE_SETUP
-#line 85 "scripts/genksyms/lex.l"
+#line 87 "scripts/genksyms/lex.l"
 return OTHER;
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 86 "scripts/genksyms/lex.l"
+#line 88 "scripts/genksyms/lex.l"
 return INT;
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 87 "scripts/genksyms/lex.l"
+#line 89 "scripts/genksyms/lex.l"
 return REAL;
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 89 "scripts/genksyms/lex.l"
+#line 91 "scripts/genksyms/lex.l"
 return DOTS;
        YY_BREAK
 /* All other tokens are single characters.  */
 case 12:
 YY_RULE_SETUP
-#line 92 "scripts/genksyms/lex.l"
+#line 94 "scripts/genksyms/lex.l"
 return yytext[0];
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 95 "scripts/genksyms/lex.l"
+#line 97 "scripts/genksyms/lex.l"
 ECHO;
        YY_BREAK
-#line 1081 "scripts/genksyms/lex.c"
+#line 1118 "scripts/genksyms/lex.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(V2_TOKENS):
        yyterminate();
@@ -1346,6 +1383,14 @@ static int yy_get_next_buffer (void)
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
+       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
        (yy_n_chars) += number_to_move;
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
@@ -1851,7 +1896,9 @@ static void yyensure_buffer_stack (void)
                (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
-               
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+                                                                 
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
                                
                (yy_buffer_stack_max) = num_to_alloc;
@@ -1869,6 +1916,8 @@ static void yyensure_buffer_stack (void)
                                                                ((yy_buffer_stack),
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
 
                /* zero only the new slots.*/
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2092,7 +2141,7 @@ void yyset_debug (int  bdebug )
 /* %if-reentrant */
 /* %if-bison-bridge */
 /* %endif */
-/* %endif */
+/* %endif if-c-only */
 
 /* %if-c-only */
 static int yy_init_globals (void)
@@ -2124,13 +2173,9 @@ static int yy_init_globals (void)
 }
 /* %endif */
 
-/* %if-c-or-c++ */
-/* %if-c-only */
+/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
 int yylex_destroy  (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     
     /* Pop the buffer stack, destroying each element. */
@@ -2144,11 +2189,6 @@ int yylex_destroy  (void)
        yyfree((yy_buffer_stack) );
        (yy_buffer_stack) = NULL;
 
-/* %if-c++-only */
-/* %endif */
-
-/* %if-c-only */
-
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
     yy_init_globals( );
@@ -2156,7 +2196,6 @@ int yylex_destroy  (void)
 /* %if-reentrant */
 /* %endif */
     return 0;
-/* %endif */
 }
 /* %endif */
 
@@ -2213,7 +2252,7 @@ void yyfree (void * ptr )
 
 /* %ok-for-header */
 
-#line 95 "scripts/genksyms/lex.l"
+#line 97 "scripts/genksyms/lex.l"
 
 
 
index 5e544a06678b6f10791b2af77a6eb05f21c13beb..fe50ff9dacd089d56760c79244c3d4cfacb4c32d 100644 (file)
@@ -62,6 +62,8 @@ MC_TOKEN              ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
 /* We don't do multiple input files.  */
 %option noyywrap
 
+%option noinput
+
 %%
 
 
index 3e6079f36b9f918ffa91a7cf9b16d9ceb38c2cf3..eaee44e66a43cba6686775dbd7ce628a2836d1d1 100644 (file)
@@ -504,7 +504,7 @@ static const yytype_uint16 yyprhs[] =
      239,   242,   245,   247,   248,   250,   252,   257,   262,   265,
      269,   273,   277,   278,   280,   283,   287,   291,   292,   294,
      296,   299,   303,   306,   307,   309,   311,   315,   318,   321,
-     323,   326,   327,   329,   332,   333,   335
+     323,   326,   327,   330,   333,   334,   336
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
@@ -542,9 +542,9 @@ static const yytype_int8 yyrhs[] =
       -1,    -1,    89,    -1,    90,    -1,    89,    90,    -1,    64,
       91,    44,    -1,     1,    44,    -1,    -1,    92,    -1,    93,
       -1,    92,    46,    93,    -1,    76,    95,    -1,    37,    94,
-      -1,    94,    -1,    52,    34,    -1,    -1,    31,    -1,    30,
-      44,    -1,    -1,    30,    -1,    29,    47,    37,    49,    44,
-      -1
+      -1,    94,    -1,    52,    34,    -1,    -1,    95,    31,    -1,
+      30,    44,    -1,    -1,    30,    -1,    29,    47,    37,    49,
+      44,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -647,7 +647,7 @@ static const yytype_uint8 yyr2[] =
        2,     2,     1,     0,     1,     1,     4,     4,     2,     3,
        3,     3,     0,     1,     2,     3,     3,     0,     1,     1,
        2,     3,     2,     0,     1,     1,     3,     2,     2,     1,
-       2,     0,     1,     2,     0,     1,     5
+       2,     0,     2,     2,     0,     1,     5
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -667,9 +667,9 @@ static const yytype_uint8 yydefact[] =
        0,    66,   125,   101,   121,    71,     0,     7,   112,   106,
       76,    77,     0,     0,     0,   121,    75,     0,   114,   115,
      119,   105,     0,   110,   124,     0,    36,     0,    73,    72,
-      61,    20,   122,   102,     0,    93,     0,    84,    87,    88,
-     118,     0,    76,     0,   120,    74,   117,    80,     0,   111,
-       0,    35,   126,     0,    21,   103,    70,    94,    56,     0,
+      61,    20,   102,     0,    93,     0,    84,    87,    88,   118,
+       0,    76,     0,   120,    74,   117,    80,     0,   111,     0,
+      35,   126,   122,     0,    21,   103,    70,    94,    56,     0,
       93,    90,    92,    69,    83,     0,    82,    81,     0,     0,
      116,   104,     0,    95,     0,    91,    98,     0,    85,    89,
       79,    78,   100,    99,     0,     0,    97,    96
@@ -680,44 +680,44 @@ static const yytype_int16 yydefgoto[] =
 {
       -1,     1,     2,     3,    35,    72,    55,    36,    64,    65,
       66,    75,    38,    39,    40,    41,    42,    67,    86,    87,
-      43,   114,    69,   105,   106,   126,   127,   128,   129,   151,
+      43,   114,    69,   105,   106,   125,   126,   127,   128,   151,
      152,    44,   144,   145,    54,    76,    77,    78,   107,   108,
-     109,   110,   123,    45,    94,    46
+     109,   110,   122,    45,    94,    46
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -135
+#define YYPACT_NINF -134
 static const yytype_int16 yypact[] =
 {
-    -135,    11,  -135,   312,  -135,  -135,    24,  -135,  -135,  -135,
-    -135,  -135,   -23,  -135,    -2,  -135,  -135,  -135,  -135,  -135,
-    -135,  -135,  -135,  -135,   -17,  -135,   -11,  -135,  -135,  -135,
-      -3,    16,    26,  -135,  -135,  -135,  -135,    34,   482,  -135,
-    -135,  -135,  -135,  -135,  -135,  -135,  -135,  -135,  -135,  -135,
-      -8,  -135,    22,    97,  -135,   482,    22,  -135,   482,    56,
-    -135,  -135,    12,    10,    50,    49,  -135,    34,   -13,    15,
-    -135,  -135,   482,  -135,    47,   -25,    51,   145,  -135,  -135,
-      34,  -135,   356,    52,    71,    77,  -135,    10,  -135,  -135,
-      34,  -135,  -135,  -135,    68,  -135,   193,  -135,  -135,  -135,
-      48,  -135,     6,    93,    37,    68,    18,    85,    84,  -135,
-    -135,  -135,    87,  -135,   102,    86,  -135,    89,  -135,  -135,
-    -135,  -135,  -135,    90,    88,   401,    94,   100,   101,  -135,
-    -135,    99,  -135,   108,  -135,  -135,  -135,  -135,   230,  -135,
-     -25,  -135,  -135,   105,  -135,  -135,  -135,  -135,  -135,     9,
-      42,  -135,    28,  -135,  -135,   445,  -135,  -135,   119,   125,
-    -135,  -135,   126,  -135,   128,  -135,  -135,   267,  -135,  -135,
-    -135,  -135,  -135,  -135,   129,   130,  -135,  -135
+    -134,    16,  -134,   312,  -134,  -134,    20,  -134,  -134,  -134,
+    -134,  -134,   -18,  -134,    -3,  -134,  -134,  -134,  -134,  -134,
+    -134,  -134,  -134,  -134,   -26,  -134,   -25,  -134,  -134,  -134,
+      -7,     5,    27,  -134,  -134,  -134,  -134,    46,   482,  -134,
+    -134,  -134,  -134,  -134,  -134,  -134,  -134,  -134,  -134,  -134,
+      -8,  -134,    30,    97,  -134,   482,    30,  -134,   482,     7,
+    -134,  -134,    12,    10,    42,    55,  -134,    46,   -15,    15,
+    -134,  -134,   482,  -134,    25,    26,    47,   145,  -134,  -134,
+      46,  -134,   356,    39,    71,    77,  -134,    10,  -134,  -134,
+      46,  -134,  -134,  -134,  -134,  -134,   193,  -134,  -134,  -134,
+      75,  -134,     6,    95,    43,  -134,    28,    86,    85,  -134,
+    -134,  -134,    88,  -134,   103,    87,  -134,    91,  -134,  -134,
+    -134,  -134,   -23,    90,   401,    94,   101,   102,  -134,  -134,
+      98,  -134,   108,  -134,  -134,   109,  -134,   230,  -134,    26,
+    -134,  -134,  -134,   134,  -134,  -134,  -134,  -134,  -134,     9,
+      48,  -134,    35,  -134,  -134,   445,  -134,  -134,   125,   126,
+    -134,  -134,   128,  -134,   129,  -134,  -134,   267,  -134,  -134,
+    -134,  -134,  -134,  -134,   130,   131,  -134,  -134
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -135,  -135,   179,  -135,  -135,  -135,  -135,   -47,  -135,  -135,
-      91,     0,   -58,   -37,  -135,  -135,  -135,   -73,  -135,  -135,
-     -48,   -32,  -135,   -38,  -135,  -134,  -135,  -135,    29,   -63,
-    -135,  -135,  -135,  -135,   -20,  -135,  -135,   106,  -135,  -135,
-      45,    95,    82,  -135,  -135,  -135
+    -134,  -134,   180,  -134,  -134,  -134,  -134,   -33,  -134,  -134,
+      93,     0,   -58,   -37,  -134,  -134,  -134,   -73,  -134,  -134,
+     -54,   -32,  -134,   -81,  -134,  -133,  -134,  -134,    29,   -50,
+    -134,  -134,  -134,  -134,   -20,  -134,  -134,   110,  -134,  -134,
+      49,    96,    80,  -134,  -134,  -134
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -727,26 +727,26 @@ static const yytype_int16 yypgoto[] =
 #define YYTABLE_NINF -109
 static const yytype_int16 yytable[] =
 {
-      82,    70,   104,    37,   159,    68,    57,   131,    79,    49,
-     162,     4,   100,    84,    50,    88,   101,    92,    10,    93,
-      52,    51,   102,    63,    71,    97,    56,   103,    20,   104,
-      85,   104,    73,   175,    53,    91,    81,    29,   125,   120,
-      53,    33,   -93,   132,    58,    70,   147,   101,    95,    61,
-     163,   137,   150,   102,    63,    80,   149,    63,   -93,    62,
-      63,   166,    96,    59,   133,   138,   135,   104,    47,    48,
-      60,    61,    80,    53,   132,   167,   150,   150,   101,   147,
-     125,    62,    63,   163,   102,    63,   164,   165,    70,   149,
-      63,    98,    99,    83,    89,    90,   111,   125,    74,   122,
-     103,   117,     7,     8,     9,    10,    11,    12,    13,   125,
+      82,    70,   104,    37,   159,    68,    57,   130,   142,    88,
+     162,    52,    56,    84,    49,    92,     4,    93,    10,    50,
+      51,   132,    79,   134,    71,    53,    53,   143,    20,   104,
+      85,   104,    73,   120,   175,    91,    81,    29,   124,    97,
+      58,    33,   -93,   131,    83,    70,   147,   101,    95,    61,
+     163,   150,    59,   102,    63,    80,   149,    63,   -93,    62,
+      63,   136,    96,   100,    47,    48,   104,   101,   166,    98,
+      99,    60,    80,   102,    63,   137,   150,   150,   103,   124,
+     131,    53,   167,    61,   101,   147,    89,    70,   117,   163,
+     102,    63,   111,    62,    63,   149,    63,   124,    74,   164,
+     165,    90,     7,     8,     9,    10,    11,    12,    13,   124,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-     118,    26,    27,    28,    29,    30,   119,   134,    33,   139,
-     140,    98,    92,   142,   -22,   141,   154,   146,    34,   161,
-     143,   -22,  -107,   153,   -22,   -22,   112,   155,   156,   -22,
+     118,    26,    27,    28,    29,    30,   119,   103,    33,   133,
+     138,   139,    98,    92,   -22,   141,   140,   154,    34,   146,
+     142,   -22,  -107,   153,   -22,   -22,   112,   156,   155,   -22,
        7,     8,     9,    10,    11,    12,    13,   157,    15,    16,
-      17,    18,    19,    20,    21,    22,    23,    24,   170,    26,
-      27,    28,    29,    30,   171,   172,    33,   173,   176,   177,
-       5,   121,   -22,   113,   169,   160,    34,   136,     0,   -22,
-    -108,     0,   -22,   -22,   124,   130,     0,   -22,     7,     8,
+      17,    18,    19,    20,    21,    22,    23,    24,   161,    26,
+      27,    28,    29,    30,   170,   171,    33,   172,   173,   176,
+     177,     5,   -22,   121,   169,   135,    34,   113,   160,   -22,
+    -108,     0,   -22,   -22,   123,     0,   129,   -22,     7,     8,
        9,    10,    11,    12,    13,     0,    15,    16,    17,    18,
       19,    20,    21,    22,    23,    24,     0,    26,    27,    28,
       29,    30,     0,     0,    33,     0,     0,     0,     0,   -86,
@@ -784,26 +784,26 @@ static const yytype_int16 yytable[] =
 
 static const yytype_int16 yycheck[] =
 {
-      58,    38,    75,     3,   138,    37,    26,     1,    55,    32,
-       1,     0,    37,     1,    37,    63,    41,    30,     8,    32,
-      37,    23,    47,    48,    32,    72,    37,    52,    18,   102,
-      62,   104,    52,   167,    51,    67,    56,    27,    96,    87,
-      51,    31,    33,    37,    47,    82,    37,    41,    33,    37,
-      41,    33,   125,    47,    48,    55,    47,    48,    49,    47,
-      48,    33,    47,    47,   102,    47,   104,   140,    44,    45,
-      44,    37,    72,    51,    37,    47,   149,   150,    41,    37,
-     138,    47,    48,    41,    47,    48,   149,   150,   125,    47,
-      48,    44,    45,    37,    44,    46,    45,   155,     1,    31,
-      52,    49,     5,     6,     7,     8,     9,    10,    11,   167,
+      58,    38,    75,     3,   137,    37,    26,     1,    31,    63,
+       1,    37,    37,     1,    32,    30,     0,    32,     8,    37,
+      23,   102,    55,   104,    32,    51,    51,    50,    18,   102,
+      62,   104,    52,    87,   167,    67,    56,    27,    96,    72,
+      47,    31,    33,    37,    37,    82,    37,    41,    33,    37,
+      41,   124,    47,    47,    48,    55,    47,    48,    49,    47,
+      48,    33,    47,    37,    44,    45,   139,    41,    33,    44,
+      45,    44,    72,    47,    48,    47,   149,   150,    52,   137,
+      37,    51,    47,    37,    41,    37,    44,   124,    49,    41,
+      47,    48,    45,    47,    48,    47,    48,   155,     1,   149,
+     150,    46,     5,     6,     7,     8,     9,    10,    11,   167,
       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      49,    24,    25,    26,    27,    28,    49,    34,    31,    44,
-      46,    44,    30,    44,    37,    49,    36,    49,    41,    34,
-      50,    44,    45,    49,    47,    48,     1,    46,    49,    52,
+      49,    24,    25,    26,    27,    28,    49,    52,    31,    34,
+      44,    46,    44,    30,    37,    44,    49,    36,    41,    49,
+      31,    44,    45,    49,    47,    48,     1,    49,    46,    52,
        5,     6,     7,     8,     9,    10,    11,    49,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    49,    24,
+      15,    16,    17,    18,    19,    20,    21,    22,    34,    24,
       25,    26,    27,    28,    49,    49,    31,    49,    49,    49,
-       1,    90,    37,    77,   155,   140,    41,   105,    -1,    44,
-      45,    -1,    47,    48,     1,   100,    -1,    52,     5,     6,
+      49,     1,    37,    90,   155,   105,    41,    77,   139,    44,
+      45,    -1,    47,    48,     1,    -1,   100,    52,     5,     6,
        7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
       17,    18,    19,    20,    21,    22,    -1,    24,    25,    26,
       27,    28,    -1,    -1,    31,    -1,    -1,    -1,    -1,    36,
@@ -855,9 +855,9 @@ static const yytype_uint8 yystos[] =
       46,    74,    30,    32,    97,    33,    47,    60,    44,    45,
       37,    41,    47,    52,    70,    76,    77,    91,    92,    93,
       94,    45,     1,    90,    74,    48,    49,    49,    49,    49,
-      73,    63,    31,    95,     1,    65,    78,    79,    80,    81,
-      94,     1,    37,    76,    34,    76,    95,    33,    47,    44,
-      46,    49,    44,    50,    85,    86,    49,    37,    41,    47,
+      73,    63,    95,     1,    65,    78,    79,    80,    81,    94,
+       1,    37,    76,    34,    76,    95,    33,    47,    44,    46,
+      49,    44,    31,    50,    85,    86,    49,    37,    41,    47,
       70,    82,    83,    49,    36,    46,    49,    49,     1,    78,
       93,    34,     1,    41,    82,    82,    33,    47,    36,    81,
       49,    49,    49,    49,     1,    78,    49,    49
index 408cdf82b27187694c11976f2bc01137bb3d28cc..10d7dc724b6d692a3ea283c4e0756798b03f73d6 100644 (file)
@@ -446,7 +446,7 @@ member_bitfield_declarator:
 
 attribute_opt:
        /* empty */                                     { $$ = NULL; }
-       | ATTRIBUTE_PHRASE
+       | attribute_opt ATTRIBUTE_PHRASE
        ;
 
 asm_definition:
index 6a61cee4a32c39ca6931b191e93b6a6313689331..7342ce0a77801ff031e81e88f6ff1de3d48e7f4e 100644 (file)
@@ -5,10 +5,29 @@
 
 /* A lexical scanner generated by flex */
 
+#define yy_create_buffer zconf_create_buffer
+#define yy_delete_buffer zconf_delete_buffer
+#define yy_flex_debug zconf_flex_debug
+#define yy_init_buffer zconf_init_buffer
+#define yy_flush_buffer zconf_flush_buffer
+#define yy_load_buffer_state zconf_load_buffer_state
+#define yy_switch_to_buffer zconf_switch_to_buffer
+#define yyin zconfin
+#define yyleng zconfleng
+#define yylex zconflex
+#define yylineno zconflineno
+#define yyout zconfout
+#define yyrestart zconfrestart
+#define yytext zconftext
+#define yywrap zconfwrap
+#define yyalloc zconfalloc
+#define yyrealloc zconfrealloc
+#define yyfree zconffree
+
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 33
+#define YY_FLEX_SUBMINOR_VERSION 35
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -30,7 +49,7 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  * if you want the limit (max/min) macros for int types. 
@@ -53,7 +72,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +102,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -93,11 +113,12 @@ typedef unsigned int flex_uint32_t;
 
 #else  /* ! __cplusplus */
 
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
 #endif /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
@@ -177,14 +198,9 @@ extern FILE *zconfin, *zconfout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
 #endif
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -335,7 +351,7 @@ void zconffree (void *  );
 
 /* Begin user sect3 */
 
-#define zconfwrap() 1
+#define zconfwrap(n) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -748,6 +764,7 @@ int zconf_flex_debug = 0;
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *zconftext;
+#define YY_NO_INPUT 1
 
 /*
  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
@@ -834,6 +851,35 @@ void alloc_string(const char *str, int size)
 
 static int yy_init_globals (void );
 
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int zconflex_destroy (void );
+
+int zconfget_debug (void );
+
+void zconfset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE zconfget_extra (void );
+
+void zconfset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *zconfget_in (void );
+
+void zconfset_in  (FILE * in_str  );
+
+FILE *zconfget_out (void );
+
+void zconfset_out  (FILE * out_str  );
+
+int zconfget_leng (void );
+
+char *zconfget_text (void );
+
+int zconfget_lineno (void );
+
+void zconfset_lineno (int line_number  );
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
@@ -876,7 +922,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
+#define ECHO fwrite( zconftext, zconfleng, 1, zconfout )
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1540,6 +1586,14 @@ static int yy_get_next_buffer (void)
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
+       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
        (yy_n_chars) += number_to_move;
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
@@ -1926,7 +1980,9 @@ static void zconfensure_buffer_stack (void)
                (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
-               
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
+                                                                 
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
                                
                (yy_buffer_stack_max) = num_to_alloc;
@@ -1944,6 +2000,8 @@ static void zconfensure_buffer_stack (void)
                                                                ((yy_buffer_stack),
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
 
                /* zero only the new slots.*/
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
index 4cea5c85cd0a9297f029d58cf97c4771825f4641..5164ef7ce499db39f1dc40b1ff5be6165083ed2e 100644 (file)
@@ -1,5 +1,6 @@
 %option backup nostdinit noyywrap never-interactive full ecs
 %option 8bit backup nodefault perf-report perf-report
+%option noinput
 %x COMMAND HELP STRING PARAM
 %{
 /*
index 7ac0e309be0985386c3196958859a1381fb02735..dbb3037f13464893a1a0637435a8598ea59f88cf 100755 (executable)
@@ -4,7 +4,6 @@
 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
 # differ on your system.
 #
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:$PATH
 echo 'If some fields are empty or look unusual you may have an old version.'
 echo 'Compare to the current minimal requirements in Documentation/Changes.'
 echo ' '
index 40d06c533f89fb574efd68507142fbe9b770d9f7..3ae9bec5a5088ba62eab619cae7e7664151a522b 100644 (file)
@@ -998,8 +998,12 @@ static int selinux_sb_show_options(struct seq_file *m, struct super_block *sb)
        int rc;
 
        rc = selinux_get_mnt_opts(sb, &opts);
-       if (rc)
+       if (rc) {
+               /* before policy load we may get EINVAL, don't show anything */
+               if (rc == -EINVAL)
+                       rc = 0;
                return rc;
+       }
 
        selinux_write_opts(m, &opts);
 
index 558dadbf45f12e39387573ca5566b8d31b5be562..e024e4588b829280b8871420c7d32a616352e7ef 100644 (file)
@@ -604,6 +604,9 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
 {
        struct seq_oss_synth *rec;
 
+       if (dev < 0 || dev >= dp->max_synthdev)
+               return -ENXIO;
+
        if (dp->synths[dev].is_midi) {
                struct midi_info minf;
                snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);
index 9ca1133261437f7f7d630e4e2276b9af9d068e1c..54df8baf916f4f8462c0a44105bf49c6c0bb3e6d 100644 (file)
@@ -42,7 +42,7 @@
 #include <sound/info.h>
 #include <asm/io.h>
 #include <asm/dma.h>
-#include <asm/dreamcast/sysasic.h>
+#include <mach/sysasic.h>
 #include "aica.h"
 
 MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
index da2bc590286438fe7b000cea43e24baf4b6bb417..7ceea2bba1f597a6a873da3c81ca71932cfea5a8 100644 (file)
@@ -132,12 +132,17 @@ struct fsl_dma_private {
  * Since each link descriptor has a 32-bit byte count field, we set
  * period_bytes_max to the largest 32-bit number.  We also have no maximum
  * number of periods.
+ *
+ * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a
+ * limitation in the SSI driver requires the sample rates for playback and
+ * capture to be the same.
  */
 static const struct snd_pcm_hardware fsl_dma_hardware = {
 
        .info                   = SNDRV_PCM_INFO_INTERLEAVED |
                                  SNDRV_PCM_INFO_MMAP |
-                                 SNDRV_PCM_INFO_MMAP_VALID,
+                                 SNDRV_PCM_INFO_MMAP_VALID |
+                                 SNDRV_PCM_INFO_JOINT_DUPLEX,
        .formats                = FSLDMA_PCM_FORMATS,
        .rates                  = FSLDMA_PCM_RATES,
        .rate_min               = 5512,
index 71bff33f5528fe5e34849c06bbc1e88b91fbbcbb..157a7895ffa1befbb2427b121f0bb493c0190b3d 100644 (file)
@@ -67,6 +67,8 @@
  * @ssi: pointer to the SSI's registers
  * @ssi_phys: physical address of the SSI registers
  * @irq: IRQ of this SSI
+ * @first_stream: pointer to the stream that was opened first
+ * @second_stream: pointer to second stream
  * @dev: struct device pointer
  * @playback: the number of playback streams opened
  * @capture: the number of capture streams opened
@@ -79,6 +81,8 @@ struct fsl_ssi_private {
        struct ccsr_ssi __iomem *ssi;
        dma_addr_t ssi_phys;
        unsigned int irq;
+       struct snd_pcm_substream *first_stream;
+       struct snd_pcm_substream *second_stream;
        struct device *dev;
        unsigned int playback;
        unsigned int capture;
@@ -342,6 +346,49 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream)
                 */
        }
 
+       if (!ssi_private->first_stream)
+               ssi_private->first_stream = substream;
+       else {
+               /* This is the second stream open, so we need to impose sample
+                * rate and maybe sample size constraints.  Note that this can
+                * cause a race condition if the second stream is opened before
+                * the first stream is fully initialized.
+                *
+                * We provide some protection by checking to make sure the first
+                * stream is initialized, but it's not perfect.  ALSA sometimes
+                * re-initializes the driver with a different sample rate or
+                * size.  If the second stream is opened before the first stream
+                * has received its final parameters, then the second stream may
+                * be constrained to the wrong sample rate or size.
+                *
+                * FIXME: This code does not handle opening and closing streams
+                * repeatedly.  If you open two streams and then close the first
+                * one, you may not be able to open another stream until you
+                * close the second one as well.
+                */
+               struct snd_pcm_runtime *first_runtime =
+                       ssi_private->first_stream->runtime;
+
+               if (!first_runtime->rate || !first_runtime->sample_bits) {
+                       dev_err(substream->pcm->card->dev,
+                               "set sample rate and size in %s stream first\n",
+                               substream->stream == SNDRV_PCM_STREAM_PLAYBACK
+                               ? "capture" : "playback");
+                       return -EAGAIN;
+               }
+
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                       SNDRV_PCM_HW_PARAM_RATE,
+                       first_runtime->rate, first_runtime->rate);
+
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                       SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+                       first_runtime->sample_bits,
+                       first_runtime->sample_bits);
+
+               ssi_private->second_stream = substream;
+       }
+
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                ssi_private->playback++;
 
@@ -371,18 +418,16 @@ static int fsl_ssi_prepare(struct snd_pcm_substream *substream)
        struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
 
        struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
-       u32 wl;
 
-       wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
+       if (substream == ssi_private->first_stream) {
+               u32 wl;
 
-       clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+               /* The SSI should always be disabled at this points (SSIEN=0) */
+               wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
 
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               /* In synchronous mode, the SSI uses STCCR for capture */
                clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl);
-       else
-               clrsetbits_be32(&ssi->srccr, CCSR_SSI_SxCCR_WL_MASK, wl);
-
-       setbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+       }
 
        return 0;
 }
@@ -407,9 +452,13 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd)
        case SNDRV_PCM_TRIGGER_RESUME:
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
                if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-                       setbits32(&ssi->scr, CCSR_SSI_SCR_TE);
+                       clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+                       setbits32(&ssi->scr,
+                               CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
                } else {
-                       setbits32(&ssi->scr, CCSR_SSI_SCR_RE);
+                       clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
+                       setbits32(&ssi->scr,
+                               CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
 
                        /*
                         * I think we need this delay to allow time for the SSI
@@ -452,6 +501,11 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream)
        if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
                ssi_private->capture--;
 
+       if (ssi_private->first_stream == substream)
+               ssi_private->first_stream = ssi_private->second_stream;
+
+       ssi_private->second_stream = NULL;
+
        /*
         * If this is the last active substream, disable the SSI and release
         * the IRQ.
index 65a4e9a8c39e18ec4dc0b45f44dd780ff6c54b36..d968cf71b569f9056d8668d333e1bdb9594d36fb 100644 (file)
@@ -85,17 +85,13 @@ static int poodle_startup(struct snd_pcm_substream *substream)
 }
 
 /* we need to unmute the HP at shutdown as the mute burns power on poodle */
-static int poodle_shutdown(struct snd_pcm_substream *substream)
+static void poodle_shutdown(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->socdev->codec;
-
        /* set = unmute headphone */
        locomo_gpio_write(&poodle_locomo_device.dev,
                POODLE_LOCOMO_GPIO_MUTE_L, 1);
        locomo_gpio_write(&poodle_locomo_device.dev,
                POODLE_LOCOMO_GPIO_MUTE_R, 1);
-       return 0;
 }
 
 static int poodle_hw_params(struct snd_pcm_substream *substream,
@@ -232,7 +228,7 @@ static const struct soc_enum poodle_enum[] = {
        SOC_ENUM_SINGLE_EXT(2, spk_function),
 };
 
-static const snd_kcontrol_new_t wm8731_poodle_controls[] = {
+static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
        SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack,
                poodle_set_jack),
        SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk,
index fe6cca9c9e760c0424e627e1f208130e47f372ce..22971a0f040ea3c019d085ce98916590c32bf755 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/audio.h>
-#include <asm/arch/tosa.h>
 
 #include "../codecs/wm9712.h"
 #include "pxa2xx-pcm.h"
index 820347c9ae4bbc5d5281e981e94f0cd27d2e28ae..f9d100bc8479e970225c6f1274c824f3ee12dfee 100644 (file)
@@ -470,6 +470,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(dapm_reg_event);
 
 /*
  * Scan each dapm widget for complete audio path.
index a845890b680062365930b89a63ba4536c0fa6670..7dd9b0b85e4eea1aafaff116e993e6392c9cc173 100644 (file)
@@ -192,6 +192,123 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu)
 }
 EXPORT_SYMBOL_GPL(kvm_vcpu_uninit);
 
+#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
+static inline struct kvm *mmu_notifier_to_kvm(struct mmu_notifier *mn)
+{
+       return container_of(mn, struct kvm, mmu_notifier);
+}
+
+static void kvm_mmu_notifier_invalidate_page(struct mmu_notifier *mn,
+                                            struct mm_struct *mm,
+                                            unsigned long address)
+{
+       struct kvm *kvm = mmu_notifier_to_kvm(mn);
+       int need_tlb_flush;
+
+       /*
+        * When ->invalidate_page runs, the linux pte has been zapped
+        * already but the page is still allocated until
+        * ->invalidate_page returns. So if we increase the sequence
+        * here the kvm page fault will notice if the spte can't be
+        * established because the page is going to be freed. If
+        * instead the kvm page fault establishes the spte before
+        * ->invalidate_page runs, kvm_unmap_hva will release it
+        * before returning.
+        *
+        * The sequence increase only need to be seen at spin_unlock
+        * time, and not at spin_lock time.
+        *
+        * Increasing the sequence after the spin_unlock would be
+        * unsafe because the kvm page fault could then establish the
+        * pte after kvm_unmap_hva returned, without noticing the page
+        * is going to be freed.
+        */
+       spin_lock(&kvm->mmu_lock);
+       kvm->mmu_notifier_seq++;
+       need_tlb_flush = kvm_unmap_hva(kvm, address);
+       spin_unlock(&kvm->mmu_lock);
+
+       /* we've to flush the tlb before the pages can be freed */
+       if (need_tlb_flush)
+               kvm_flush_remote_tlbs(kvm);
+
+}
+
+static void kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn,
+                                                   struct mm_struct *mm,
+                                                   unsigned long start,
+                                                   unsigned long end)
+{
+       struct kvm *kvm = mmu_notifier_to_kvm(mn);
+       int need_tlb_flush = 0;
+
+       spin_lock(&kvm->mmu_lock);
+       /*
+        * The count increase must become visible at unlock time as no
+        * spte can be established without taking the mmu_lock and
+        * count is also read inside the mmu_lock critical section.
+        */
+       kvm->mmu_notifier_count++;
+       for (; start < end; start += PAGE_SIZE)
+               need_tlb_flush |= kvm_unmap_hva(kvm, start);
+       spin_unlock(&kvm->mmu_lock);
+
+       /* we've to flush the tlb before the pages can be freed */
+       if (need_tlb_flush)
+               kvm_flush_remote_tlbs(kvm);
+}
+
+static void kvm_mmu_notifier_invalidate_range_end(struct mmu_notifier *mn,
+                                                 struct mm_struct *mm,
+                                                 unsigned long start,
+                                                 unsigned long end)
+{
+       struct kvm *kvm = mmu_notifier_to_kvm(mn);
+
+       spin_lock(&kvm->mmu_lock);
+       /*
+        * This sequence increase will notify the kvm page fault that
+        * the page that is going to be mapped in the spte could have
+        * been freed.
+        */
+       kvm->mmu_notifier_seq++;
+       /*
+        * The above sequence increase must be visible before the
+        * below count decrease but both values are read by the kvm
+        * page fault under mmu_lock spinlock so we don't need to add
+        * a smb_wmb() here in between the two.
+        */
+       kvm->mmu_notifier_count--;
+       spin_unlock(&kvm->mmu_lock);
+
+       BUG_ON(kvm->mmu_notifier_count < 0);
+}
+
+static int kvm_mmu_notifier_clear_flush_young(struct mmu_notifier *mn,
+                                             struct mm_struct *mm,
+                                             unsigned long address)
+{
+       struct kvm *kvm = mmu_notifier_to_kvm(mn);
+       int young;
+
+       spin_lock(&kvm->mmu_lock);
+       young = kvm_age_hva(kvm, address);
+       spin_unlock(&kvm->mmu_lock);
+
+       if (young)
+               kvm_flush_remote_tlbs(kvm);
+
+       return young;
+}
+
+static const struct mmu_notifier_ops kvm_mmu_notifier_ops = {
+       .invalidate_page        = kvm_mmu_notifier_invalidate_page,
+       .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start,
+       .invalidate_range_end   = kvm_mmu_notifier_invalidate_range_end,
+       .clear_flush_young      = kvm_mmu_notifier_clear_flush_young,
+};
+#endif /* CONFIG_MMU_NOTIFIER && KVM_ARCH_WANT_MMU_NOTIFIER */
+
 static struct kvm *kvm_create_vm(void)
 {
        struct kvm *kvm = kvm_arch_create_vm();
@@ -212,6 +329,21 @@ static struct kvm *kvm_create_vm(void)
                        (struct kvm_coalesced_mmio_ring *)page_address(page);
 #endif
 
+#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
+       {
+               int err;
+               kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops;
+               err = mmu_notifier_register(&kvm->mmu_notifier, current->mm);
+               if (err) {
+#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
+                       put_page(page);
+#endif
+                       kfree(kvm);
+                       return ERR_PTR(err);
+               }
+       }
+#endif
+
        kvm->mm = current->mm;
        atomic_inc(&kvm->mm->mm_count);
        spin_lock_init(&kvm->mmu_lock);
@@ -271,6 +403,9 @@ static void kvm_destroy_vm(struct kvm *kvm)
 #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
        if (kvm->coalesced_mmio_ring != NULL)
                free_page((unsigned long)kvm->coalesced_mmio_ring);
+#endif
+#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
+       mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm);
 #endif
        kvm_arch_destroy_vm(kvm);
        mmdrop(mm);
@@ -375,7 +510,15 @@ int __kvm_set_memory_region(struct kvm *kvm,
                memset(new.rmap, 0, npages * sizeof(*new.rmap));
 
                new.user_alloc = user_alloc;
-               new.userspace_addr = mem->userspace_addr;
+               /*
+                * hva_to_rmmap() serialzies with the mmu_lock and to be
+                * safe it has to ignore memslots with !user_alloc &&
+                * !userspace_addr.
+                */
+               if (user_alloc)
+                       new.userspace_addr = mem->userspace_addr;
+               else
+                       new.userspace_addr = 0;
        }
        if (npages && !new.lpage_info) {
                int largepages = npages / KVM_PAGES_PER_HPAGE;
@@ -408,17 +551,21 @@ int __kvm_set_memory_region(struct kvm *kvm,
        }
 #endif /* not defined CONFIG_S390 */
 
-       if (mem->slot >= kvm->nmemslots)
-               kvm->nmemslots = mem->slot + 1;
-
        if (!npages)
                kvm_arch_flush_shadow(kvm);
 
+       spin_lock(&kvm->mmu_lock);
+       if (mem->slot >= kvm->nmemslots)
+               kvm->nmemslots = mem->slot + 1;
+
        *memslot = new;
+       spin_unlock(&kvm->mmu_lock);
 
        r = kvm_arch_set_memory_region(kvm, mem, old, user_alloc);
        if (r) {
+               spin_lock(&kvm->mmu_lock);
                *memslot = old;
+               spin_unlock(&kvm->mmu_lock);
                goto out_free;
        }